function xS(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bv={exports:{}},ku={},Hv={exports:{}},Q={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var xa=Symbol.for("react.element"),kS=Symbol.for("react.portal"),wS=Symbol.for("react.fragment"),SS=Symbol.for("react.strict_mode"),OS=Symbol.for("react.profiler"),CS=Symbol.for("react.provider"),ES=Symbol.for("react.context"),TS=Symbol.for("react.forward_ref"),NS=Symbol.for("react.suspense"),MS=Symbol.for("react.memo"),PS=Symbol.for("react.lazy"),ty=Symbol.iterator;function AS(t){return t===null||typeof t!="object"?null:(t=ty&&t[ty]||t["@@iterator"],typeof t=="function"?t:null)}var Uv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vv=Object.assign,Wv={};function _o(t,e,n){this.props=t,this.context=e,this.refs=Wv,this.updater=n||Uv}_o.prototype.isReactComponent={};_o.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};_o.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Kv(){}Kv.prototype=_o.prototype;function sm(t,e,n){this.props=t,this.context=e,this.refs=Wv,this.updater=n||Uv}var am=sm.prototype=new Kv;am.constructor=sm;Vv(am,_o.prototype);am.isPureReactComponent=!0;var ny=Array.isArray,Jv=Object.prototype.hasOwnProperty,lm={current:null},qv={key:!0,ref:!0,__self:!0,__source:!0};function Gv(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)Jv.call(e,r)&&!qv.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,je=D[we];if(0>>1;wei(yf,G))Hri(_a,yf)?(D[we]=_a,D[Hr]=G,we=Hr):(D[we]=yf,D[Br]=G,we=Br);else if(Hri(_a,G))D[we]=_a,D[Hr]=G,we=Hr;else break e}}return W}function i(D,W){var G=D.sortIndex-W.sortIndex;return G!==0?G:D.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(D){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=D)r(c),W.sortIndex=W.expirationTime,e(l,W);else break;W=n(c)}}function w(D){if(m=!1,k(D),!p)if(n(l)!==null)p=!0,Fn(O);else{var W=n(c);W!==null&&nn(w,W.startTime-D)}}function O(D,W){p=!1,m&&(m=!1,g(j),j=-1),h=!0;var G=d;try{for(k(W),f=n(l);f!==null&&(!(f.expirationTime>W)||D&&!pe());){var we=f.callback;if(typeof we=="function"){f.callback=null,d=f.priorityLevel;var je=we(f.expirationTime<=W);W=t.unstable_now(),typeof je=="function"?f.callback=je:f===n(l)&&r(l),k(W)}else r(l);f=n(l)}if(f!==null)var La=!0;else{var Br=n(c);Br!==null&&nn(w,Br.startTime-W),La=!1}return La}finally{f=null,d=G,h=!1}}var C=!1,T=null,j=-1,L=5,H=-1;function pe(){return!(t.unstable_now()-HD||125we?(D.sortIndex=G,e(c,D),n(l)===null&&D===n(c)&&(m?(g(j),j=-1):m=!0,nn(w,G-we))):(D.sortIndex=je,e(l,D),p||h||(p=!0,Fn(O))),D},t.unstable_shouldYield=pe,t.unstable_wrapCallback=function(D){var W=d;return function(){var G=d;d=W;try{return D.apply(this,arguments)}finally{d=G}}}})(Zv);Xv.exports=Zv;var US=Xv.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var eb=S,Ct=US;function P(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ad=Object.prototype.hasOwnProperty,VS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,iy={},oy={};function WS(t){return Ad.call(oy,t)?!0:Ad.call(iy,t)?!1:VS.test(t)?oy[t]=!0:(iy[t]=!0,!1)}function KS(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JS(t,e,n,r){if(e===null||typeof e>"u"||KS(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function lt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ke[t]=new lt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ke[e]=new lt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ke[t]=new lt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ke[t]=new lt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ke[t]=new lt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ke[t]=new lt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ke[t]=new lt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ke[t]=new lt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ke[t]=new lt(t,5,!1,t.toLowerCase(),null,!1,!1)});var um=/[\-:]([a-z])/g;function fm(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(um,fm);Ke[e]=new lt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(um,fm);Ke[e]=new lt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(um,fm);Ke[e]=new lt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ke[t]=new lt(t,1,!1,t.toLowerCase(),null,!1,!1)});Ke.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ke[t]=new lt(t,1,!1,t.toLowerCase(),null,!0,!0)});function dm(t,e,n,r){var i=Ke.hasOwnProperty(e)?Ke[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` `+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{xf=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?rs(t):""}function qS(t){switch(t.tag){case 5:return rs(t.type);case 16:return rs("Lazy");case 13:return rs("Suspense");case 19:return rs("SuspenseList");case 0:case 2:case 15:return t=kf(t.type,!1),t;case 11:return t=kf(t.type.render,!1),t;case 1:return t=kf(t.type,!0),t;default:return""}}function Dd(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ui:return"Fragment";case Hi:return"Portal";case Rd:return"Profiler";case hm:return"StrictMode";case jd:return"Suspense";case Id:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case rb:return(t.displayName||"Context")+".Consumer";case nb:return(t._context.displayName||"Context")+".Provider";case pm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case mm:return e=t.displayName||null,e!==null?e:Dd(t.type)||"Memo";case qn:e=t._payload,t=t._init;try{return Dd(t(e))}catch{}}return null}function GS(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dd(e);case 8:return e===hm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Cr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ob(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function YS(t){var e=ob(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fa(t){t._valueTracker||(t._valueTracker=YS(t))}function sb(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ob(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Hl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ld(t,e){var n=e.checked;return ve({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function ay(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Cr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ab(t,e){e=e.checked,e!=null&&dm(t,"checked",e,!1)}function _d(t,e){ab(t,e);var n=Cr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?zd(t,e.type,n):e.hasOwnProperty("defaultValue")&&zd(t,e.type,Cr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ly(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function zd(t,e,n){(e!=="number"||Hl(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var is=Array.isArray;function ao(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Ba.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ls(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ps={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},QS=["Webkit","ms","Moz","O"];Object.keys(ps).forEach(function(t){QS.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ps[e]=ps[t]})});function fb(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ps.hasOwnProperty(t)&&ps[t]?(""+e).trim():e+"px"}function db(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=fb(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var XS=ve({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bd(t,e){if(e){if(XS[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(P(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(P(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(P(61))}if(e.style!=null&&typeof e.style!="object")throw Error(P(62))}}function Hd(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ud=null;function gm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vd=null,lo=null,co=null;function fy(t){if(t=Sa(t)){if(typeof Vd!="function")throw Error(P(280));var e=t.stateNode;e&&(e=Eu(e),Vd(t.stateNode,t.type,e))}}function hb(t){lo?co?co.push(t):co=[t]:lo=t}function pb(){if(lo){var t=lo,e=co;if(co=lo=null,fy(t),e)for(t=0;t>>=0,t===0?32:31-(cO(t)/uO|0)|0}var Ha=64,Ua=4194304;function ss(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Kl(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=ss(a):(o&=s,o!==0&&(r=ss(o)))}else s=n&~i,s!==0?r=ss(s):o!==0&&(r=ss(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ka(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Yt(e),t[e]=n}function pO(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=gs),xy=" ",ky=!1;function Ib(t,e){switch(t){case"keyup":return HO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Db(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Vi=!1;function VO(t,e){switch(t){case"compositionend":return Db(e);case"keypress":return e.which!==32?null:(ky=!0,xy);case"textInput":return t=e.data,t===xy&&ky?null:t;default:return null}}function WO(t,e){if(Vi)return t==="compositionend"||!Om&&Ib(t,e)?(t=Rb(),Sl=km=rr=null,Vi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cy(n)}}function $b(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?$b(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Fb(){for(var t=window,e=Hl();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Hl(t.document)}return e}function Cm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function eC(t){var e=Fb(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&$b(n.ownerDocument.documentElement,n)){if(r!==null&&Cm(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Ey(n,o);var s=Ey(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wi=null,Yd=null,vs=null,Qd=!1;function Ty(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qd||Wi==null||Wi!==Hl(r)||(r=Wi,"selectionStart"in r&&Cm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vs&&Hs(vs,r)||(vs=r,r=Gl(Yd,"onSelect"),0qi||(t.current=rh[qi],rh[qi]=null,qi--)}function oe(t,e){qi++,rh[qi]=t.current,t.current=e}var Er={},Xe=jr(Er),pt=jr(!1),di=Er;function xo(t,e){var n=t.type.contextTypes;if(!n)return Er;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function mt(t){return t=t.childContextTypes,t!=null}function Ql(){ce(pt),ce(Xe)}function Iy(t,e,n){if(Xe.current!==Er)throw Error(P(168));oe(Xe,e),oe(pt,n)}function Gb(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(P(108,GS(t)||"Unknown",i));return ve({},n,r)}function Xl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Er,di=Xe.current,oe(Xe,t),oe(pt,pt.current),!0}function Dy(t,e,n){var r=t.stateNode;if(!r)throw Error(P(169));n?(t=Gb(t,e,di),r.__reactInternalMemoizedMergedChildContext=t,ce(pt),ce(Xe),oe(Xe,t)):ce(pt),oe(pt,n)}var Cn=null,Tu=!1,Df=!1;function Yb(t){Cn===null?Cn=[t]:Cn.push(t)}function dC(t){Tu=!0,Yb(t)}function Ir(){if(!Df&&Cn!==null){Df=!0;var t=0,e=ne;try{var n=Cn;for(ne=1;t>=s,i-=s,En=1<<32-Yt(e)+i|n<j?(L=T,T=null):L=T.sibling;var H=d(g,T,k[j],w);if(H===null){T===null&&(T=L);break}t&&T&&H.alternate===null&&e(g,T),y=o(H,y,j),C===null?O=H:C.sibling=H,C=H,T=L}if(j===k.length)return n(g,T),de&&Ur(g,j),O;if(T===null){for(;jj?(L=T,T=null):L=T.sibling;var pe=d(g,T,H.value,w);if(pe===null){T===null&&(T=L);break}t&&T&&pe.alternate===null&&e(g,T),y=o(pe,y,j),C===null?O=pe:C.sibling=pe,C=pe,T=L}if(H.done)return n(g,T),de&&Ur(g,j),O;if(T===null){for(;!H.done;j++,H=k.next())H=f(g,H.value,w),H!==null&&(y=o(H,y,j),C===null?O=H:C.sibling=H,C=H);return de&&Ur(g,j),O}for(T=r(g,T);!H.done;j++,H=k.next())H=h(T,g,j,H.value,w),H!==null&&(t&&H.alternate!==null&&T.delete(H.key===null?j:H.key),y=o(H,y,j),C===null?O=H:C.sibling=H,C=H);return t&&T.forEach(function(Je){return e(g,Je)}),de&&Ur(g,j),O}function v(g,y,k,w){if(typeof k=="object"&&k!==null&&k.type===Ui&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case $a:e:{for(var O=k.key,C=y;C!==null;){if(C.key===O){if(O=k.type,O===Ui){if(C.tag===7){n(g,C.sibling),y=i(C,k.props.children),y.return=g,g=y;break e}}else if(C.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qn&&Hy(O)===C.type){n(g,C.sibling),y=i(C,k.props),y.ref=Qo(g,C,k),y.return=g,g=y;break e}n(g,C);break}else e(g,C);C=C.sibling}k.type===Ui?(y=oi(k.props.children,g.mode,w,k.key),y.return=g,g=y):(w=Al(k.type,k.key,k.props,null,g.mode,w),w.ref=Qo(g,y,k),w.return=g,g=w)}return s(g);case Hi:e:{for(C=k.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===k.containerInfo&&y.stateNode.implementation===k.implementation){n(g,y.sibling),y=i(y,k.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else e(g,y);y=y.sibling}y=Uf(k,g.mode,w),y.return=g,g=y}return s(g);case qn:return C=k._init,v(g,y,C(k._payload),w)}if(is(k))return p(g,y,k,w);if(Ko(k))return m(g,y,k,w);Ya(g,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,y!==null&&y.tag===6?(n(g,y.sibling),y=i(y,k),y.return=g,g=y):(n(g,y),y=Hf(k,g.mode,w),y.return=g,g=y),s(g)):n(g,y)}return v}var wo=ix(!0),ox=ix(!1),Oa={},yn=jr(Oa),Ks=jr(Oa),Js=jr(Oa);function Qr(t){if(t===Oa)throw Error(P(174));return t}function Im(t,e){switch(oe(Js,e),oe(Ks,t),oe(yn,Oa),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Fd(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Fd(e,t)}ce(yn),oe(yn,e)}function So(){ce(yn),ce(Ks),ce(Js)}function sx(t){Qr(Js.current);var e=Qr(yn.current),n=Fd(e,t.type);e!==n&&(oe(Ks,t),oe(yn,n))}function Dm(t){Ks.current===t&&(ce(yn),ce(Ks))}var ge=jr(0);function ic(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Lf=[];function Lm(){for(var t=0;tn?n:4,t(!0);var r=_f.transition;_f.transition={};try{t(!1),e()}finally{ne=n,_f.transition=r}}function wx(){return Bt().memoizedState}function gC(t,e,n){var r=gr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sx(t))Ox(e,n);else if(n=ex(t,e,n,r),n!==null){var i=nt();Qt(n,t,r,i),Cx(n,e,r)}}function yC(t,e,n){var r=gr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sx(t))Ox(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Zt(a,s)){var l=e.interleaved;l===null?(i.next=i,Rm(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=ex(t,e,i,r),n!==null&&(i=nt(),Qt(n,t,r,i),Cx(n,e,r))}}function Sx(t){var e=t.alternate;return t===ye||e!==null&&e===ye}function Ox(t,e){bs=oc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Cx(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,vm(t,n)}}var sc={readContext:Ft,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},vC={readContext:Ft,useCallback:function(t,e){return on().memoizedState=[t,e===void 0?null:e],t},useContext:Ft,useEffect:Vy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Tl(4194308,4,yx.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tl(4194308,4,t,e)},useInsertionEffect:function(t,e){return Tl(4,2,t,e)},useMemo:function(t,e){var n=on();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=on();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=gC.bind(null,ye,t),[r.memoizedState,t]},useRef:function(t){var e=on();return t={current:t},e.memoizedState=t},useState:Uy,useDebugValue:Bm,useDeferredValue:function(t){return on().memoizedState=t},useTransition:function(){var t=Uy(!1),e=t[0];return t=mC.bind(null,t[1]),on().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ye,i=on();if(de){if(n===void 0)throw Error(P(407));n=n()}else{if(n=e(),Le===null)throw Error(P(349));pi&30||cx(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Vy(fx.bind(null,r,o,t),[t]),r.flags|=2048,Ys(9,ux.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=on(),e=Le.identifierPrefix;if(de){var n=Tn,r=En;n=(r&~(1<<32-Yt(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=qs++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[un]=e,t[Ws]=r,Ix(t,e,!1,!1),e.stateNode=t;e:{switch(s=Hd(n,r),n){case"dialog":se("cancel",t),se("close",t),i=r;break;case"iframe":case"object":case"embed":se("load",t),i=r;break;case"video":case"audio":for(i=0;iCo&&(e.flags|=128,r=!0,Xo(o,!1),e.lanes=4194304)}else{if(!r)if(t=ic(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Xo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!de)return Ge(e),null}else 2*Se()-o.renderingStartTime>Co&&n!==1073741824&&(e.flags|=128,r=!0,Xo(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Se(),e.sibling=null,n=ge.current,oe(ge,r?n&1|2:n&1),e):(Ge(e),null);case 22:case 23:return Jm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?kt&1073741824&&(Ge(e),e.subtreeFlags&6&&(e.flags|=8192)):Ge(e),null;case 24:return null;case 25:return null}throw Error(P(156,e.tag))}function EC(t,e){switch(Tm(e),e.tag){case 1:return mt(e.type)&&Ql(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return So(),ce(pt),ce(Xe),Lm(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Dm(e),null;case 13:if(ce(ge),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(P(340));ko()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ce(ge),null;case 4:return So(),null;case 10:return Am(e.type._context),null;case 22:case 23:return Jm(),null;case 24:return null;default:return null}}var Xa=!1,Qe=!1,TC=typeof WeakSet=="function"?WeakSet:Set,z=null;function Xi(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){be(t,e,r)}else n.current=null}function mh(t,e,n){try{n()}catch(r){be(t,e,r)}}var Zy=!1;function NC(t,e){if(Xd=Jl,t=Fb(),Cm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zd={focusedElem:t,selectionRange:n},Jl=!1,z=e;z!==null;)if(e=z,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,z=t;else for(;z!==null;){e=z;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,g=e.stateNode,y=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:Ut(e.type,m),v);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var k=e.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(w){be(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,z=t;break}z=e.return}return p=Zy,Zy=!1,p}function xs(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&mh(e,n,o)}i=i.next}while(i!==r)}}function Pu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function gh(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function _x(t){var e=t.alternate;e!==null&&(t.alternate=null,_x(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[un],delete e[Ws],delete e[nh],delete e[uC],delete e[fC])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function zx(t){return t.tag===5||t.tag===3||t.tag===4}function e0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||zx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Yl));else if(r!==4&&(t=t.child,t!==null))for(yh(t,e,n),t=t.sibling;t!==null;)yh(t,e,n),t=t.sibling}function vh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(vh(t,e,n),t=t.sibling;t!==null;)vh(t,e,n),t=t.sibling}var Fe=null,Vt=!1;function Bn(t,e,n){for(n=n.child;n!==null;)$x(t,e,n),n=n.sibling}function $x(t,e,n){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(wu,n)}catch{}switch(n.tag){case 5:Qe||Xi(n,e);case 6:var r=Fe,i=Vt;Fe=null,Bn(t,e,n),Fe=r,Vt=i,Fe!==null&&(Vt?(t=Fe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Vt?(t=Fe,n=n.stateNode,t.nodeType===8?If(t.parentNode,n):t.nodeType===1&&If(t,n),Fs(t)):If(Fe,n.stateNode));break;case 4:r=Fe,i=Vt,Fe=n.stateNode.containerInfo,Vt=!0,Bn(t,e,n),Fe=r,Vt=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&mh(n,e,s),i=i.next}while(i!==r)}Bn(t,e,n);break;case 1:if(!Qe&&(Xi(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){be(n,e,a)}Bn(t,e,n);break;case 21:Bn(t,e,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Bn(t,e,n),Qe=r):Bn(t,e,n);break;default:Bn(t,e,n)}}function t0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new TC),e.forEach(function(r){var i=_C.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ht(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Se()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*PC(r/1960))-r,10t?16:t,ir===null)var r=!1;else{if(t=ir,ir=null,cc=0,ee&6)throw Error(P(331));var i=ee;for(ee|=4,z=t.current;z!==null;){var o=z,s=o.child;if(z.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lSe()-Wm?ii(t,0):Vm|=n),gt(t,e)}function Jx(t,e){e===0&&(t.mode&1?(e=Ua,Ua<<=1,!(Ua&130023424)&&(Ua=4194304)):e=1);var n=nt();t=jn(t,e),t!==null&&(ka(t,e,n),gt(t,n))}function LC(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Jx(t,n)}function _C(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(e),Jx(t,n)}var qx;qx=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||pt.current)dt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return dt=!1,OC(t,e,n);dt=!!(t.flags&131072)}else dt=!1,de&&e.flags&1048576&&Qb(e,ec,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Nl(t,e),t=e.pendingProps;var i=xo(e,Xe.current);fo(e,n),i=zm(null,e,r,t,i,n);var o=$m();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,mt(r)?(o=!0,Xl(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,jm(e),i.updater=Nu,e.stateNode=i,i._reactInternals=e,lh(e,r,t,n),e=fh(null,e,r,!0,o,n)):(e.tag=0,de&&o&&Em(e),et(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Nl(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=$C(r),t=Ut(r,t),i){case 0:e=uh(null,e,r,t,n);break e;case 1:e=Yy(null,e,r,t,n);break e;case 11:e=qy(null,e,r,t,n);break e;case 14:e=Gy(null,e,r,Ut(r.type,t),n);break e}throw Error(P(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ut(r,i),uh(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ut(r,i),Yy(t,e,r,i,n);case 3:e:{if(Ax(e),t===null)throw Error(P(387));r=e.pendingProps,o=e.memoizedState,i=o.element,tx(t,e),rc(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Oo(Error(P(423)),e),e=Qy(t,e,r,n,i);break e}else if(r!==i){i=Oo(Error(P(424)),e),e=Qy(t,e,r,n,i);break e}else for(St=hr(e.stateNode.containerInfo.firstChild),Ot=e,de=!0,Wt=null,n=ox(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ko(),r===i){e=In(t,e,n);break e}et(t,e,r,n)}e=e.child}return e;case 5:return sx(e),t===null&&oh(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,eh(r,i)?s=null:o!==null&&eh(r,o)&&(e.flags|=32),Px(t,e),et(t,e,s,n),e.child;case 6:return t===null&&oh(e),null;case 13:return Rx(t,e,n);case 4:return Im(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=wo(e,null,r,n):et(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ut(r,i),qy(t,e,r,i,n);case 7:return et(t,e,e.pendingProps,n),e.child;case 8:return et(t,e,e.pendingProps.children,n),e.child;case 12:return et(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,oe(tc,r._currentValue),r._currentValue=s,o!==null)if(Zt(o.value,s)){if(o.children===i.children&&!pt.current){e=In(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Nn(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),sh(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(P(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),sh(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}et(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,fo(e,n),i=Ft(i),r=r(i),e.flags|=1,et(t,e,r,n),e.child;case 14:return r=e.type,i=Ut(r,e.pendingProps),i=Ut(r.type,i),Gy(t,e,r,i,n);case 15:return Nx(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ut(r,i),Nl(t,e),e.tag=1,mt(r)?(t=!0,Xl(e)):t=!1,fo(e,n),rx(e,r,i),lh(e,r,i,n),fh(null,e,r,!0,t,n);case 19:return jx(t,e,n);case 22:return Mx(t,e,n)}throw Error(P(156,e.tag))};function Gx(t,e){return kb(t,e)}function zC(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(t,e,n,r){return new zC(t,e,n,r)}function Gm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function $C(t){if(typeof t=="function")return Gm(t)?1:0;if(t!=null){if(t=t.$$typeof,t===pm)return 11;if(t===mm)return 14}return 2}function yr(t,e){var n=t.alternate;return n===null?(n=Dt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Al(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Gm(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Ui:return oi(n.children,i,o,e);case hm:s=8,i|=8;break;case Rd:return t=Dt(12,n,e,i|2),t.elementType=Rd,t.lanes=o,t;case jd:return t=Dt(13,n,e,i),t.elementType=jd,t.lanes=o,t;case Id:return t=Dt(19,n,e,i),t.elementType=Id,t.lanes=o,t;case ib:return Ru(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case nb:s=10;break e;case rb:s=9;break e;case pm:s=11;break e;case mm:s=14;break e;case qn:s=16,r=null;break e}throw Error(P(130,t==null?t:typeof t,""))}return e=Dt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function oi(t,e,n,r){return t=Dt(7,t,r,e),t.lanes=n,t}function Ru(t,e,n,r){return t=Dt(22,t,r,e),t.elementType=ib,t.lanes=n,t.stateNode={isHidden:!1},t}function Hf(t,e,n){return t=Dt(6,t,null,e),t.lanes=n,t}function Uf(t,e,n){return e=Dt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function FC(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sf(0),this.expirationTimes=Sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ym(t,e,n,r,i,o,s,a,l){return t=new FC(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Dt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jm(o),t}function BC(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zx)}catch(t){console.error(t)}}Zx(),Qv.exports=Et;var eg=Qv.exports;const eo=xu(eg);var c0=eg;Pd.createRoot=c0.createRoot,Pd.hydrateRoot=c0.hydrateRoot;/** * @remix-run/router v1.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Xs(){return Xs=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function ek(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function JC(){return Math.random().toString(36).substr(2,8)}function f0(t,e){return{usr:t.state,key:t.key,idx:e}}function Sh(t,e,n,r){return n===void 0&&(n=null),Xs({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Fo(e):e,{state:n,key:e&&e.key||r||JC()})}function dc(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Fo(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function qC(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=or.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Xs({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){a=or.Pop;let v=u(),g=v==null?null:v-c;c=v,l&&l({action:a,location:m.location,delta:g})}function d(v,g){a=or.Push;let y=Sh(m.location,v,g);n&&n(y,v),c=u()+1;let k=f0(y,c),w=m.createHref(y);try{s.pushState(k,"",w)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(w)}o&&l&&l({action:a,location:m.location,delta:1})}function h(v,g){a=or.Replace;let y=Sh(m.location,v,g);n&&n(y,v),c=u();let k=f0(y,c),w=m.createHref(y);s.replaceState(k,"",w),o&&l&&l({action:a,location:m.location,delta:0})}function p(v){let g=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof v=="string"?v:dc(v);return y=y.replace(/ $/,"%20"),Ee(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let m={get action(){return a},get location(){return t(i,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(u0,f),l=v,()=>{i.removeEventListener(u0,f),l=null}},createHref(v){return e(i,v)},createURL:p,encodeLocation(v){let g=p(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:h,go(v){return s.go(v)}};return m}var d0;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(d0||(d0={}));function GC(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?Fo(e):e,i=tg(r.pathname||"/",n);if(i==null)return null;let o=tk(t);YC(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Ee(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=vr([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Ee(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),tk(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:rE(c,o.index),routesMeta:u})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of nk(o.path))i(o,s,l)}),e}function nk(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=nk(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function YC(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:iE(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const QC=/^:[\w-]+$/,XC=3,ZC=2,eE=1,tE=10,nE=-2,h0=t=>t==="*";function rE(t,e){let n=t.split("/"),r=n.length;return n.some(h0)&&(r+=nE),e&&(r+=ZC),n.filter(i=>!h0(i)).reduce((i,o)=>i+(QC.test(o)?XC:o===""?eE:tE),r)}function iE(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function oE(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let s=0;s{let{paramName:d,isOptional:h}=u;if(d==="*"){let m=a[f]||"";s=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[f];return h&&!p?c[d]=void 0:c[d]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:t}}function aE(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ek(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function lE(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ek(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function tg(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function cE(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Fo(t):t;return{pathname:n?n.startsWith("/")?n:uE(n,e):e,search:hE(r),hash:pE(i)}}function uE(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vf(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fE(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function rk(t,e){let n=fE(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ik(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Fo(t):(i=Xs({},t),Ee(!i.pathname||!i.pathname.includes("?"),Vf("?","pathname","search",i)),Ee(!i.pathname||!i.pathname.includes("#"),Vf("#","pathname","hash",i)),Ee(!i.search||!i.search.includes("#"),Vf("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let f=e.length-1;if(!r&&s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),f-=1;i.pathname=d.join("/")}a=f>=0?e[f]:"/"}let l=cE(i,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const vr=t=>t.join("/").replace(/\/\/+/g,"/"),dE=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),hE=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,pE=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function mE(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ok=["post","put","patch","delete"];new Set(ok);const gE=["get",...ok];new Set(gE);/** * React Router v6.22.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Zs(){return Zs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),S.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=ik(c,JSON.parse(s),o,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:vr([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,o,t])}function lk(){let{matches:t}=S.useContext(Dr),e=t[t.length-1];return e?e.params:{}}function ck(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=S.useContext(Ci),{matches:i}=S.useContext(Dr),{pathname:o}=zu(),s=JSON.stringify(rk(i,r.v7_relativeSplatPath));return S.useMemo(()=>ik(t,JSON.parse(s),o,n==="path"),[t,s,o,n])}function xE(t,e){return kE(t,e)}function kE(t,e,n,r){Ca()||Ee(!1);let{navigator:i}=S.useContext(Ci),{matches:o}=S.useContext(Dr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=zu(),u;if(e){var f;let v=typeof e=="string"?Fo(e):e;l==="/"||(f=v.pathname)!=null&&f.startsWith(l)||Ee(!1),u=v}else u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(v.length).join("/")}let p=GC(t,{pathname:h}),m=EE(p&&p.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:vr([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:vr([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return e&&m?S.createElement(_u.Provider,{value:{location:Zs({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:or.Pop}},m):m}function wE(){let t=PE(),e=mE(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:i},n):null,null)}const SE=S.createElement(wE,null);class OE extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?S.createElement(Dr.Provider,{value:this.props.routeContext},S.createElement(sk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function CE(t){let{routeContext:e,match:n,children:r}=t,i=S.useContext(ng);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(Dr.Provider,{value:e},r)}function EE(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if((o=n)!=null&&o.errors)t=n.matches;else return null}let s=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=s.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id]));u>=0||Ee(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,f,d)=>{let h,p=!1,m=null,v=null;n&&(h=a&&f.route.id?a[f.route.id]:void 0,m=f.route.errorElement||SE,l&&(c<0&&d===0?(RE("route-fallback",!1),p=!0,v=null):c===d&&(p=!0,v=f.route.hydrateFallbackElement||null)));let g=e.concat(s.slice(0,d+1)),y=()=>{let k;return h?k=m:p?k=v:f.route.Component?k=S.createElement(f.route.Component,null):f.route.element?k=f.route.element:k=u,S.createElement(CE,{match:f,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:k})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?S.createElement(OE,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var uk=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(uk||{}),hc=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(hc||{});function TE(t){let e=S.useContext(ng);return e||Ee(!1),e}function NE(t){let e=S.useContext(yE);return e||Ee(!1),e}function ME(t){let e=S.useContext(Dr);return e||Ee(!1),e}function fk(t){let e=ME(),n=e.matches[e.matches.length-1];return n.route.id||Ee(!1),n.route.id}function PE(){var t;let e=S.useContext(sk),n=NE(hc.UseRouteError),r=fk(hc.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function AE(){let{router:t}=TE(uk.UseNavigateStable),e=fk(hc.UseNavigateStable),n=S.useRef(!1);return ak(()=>{n.current=!0}),S.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Zs({fromRouteId:e},o)))},[t,e])}const p0={};function RE(t,e,n){!e&&!p0[t]&&(p0[t]=!0)}function ls(t){Ee(!1)}function jE(t){let{basename:e="/",children:n=null,location:r,navigationType:i=or.Pop,navigator:o,static:s=!1,future:a}=t;Ca()&&Ee(!1);let l=e.replace(/^\/*/,"/"),c=S.useMemo(()=>({basename:l,navigator:o,static:s,future:Zs({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=Fo(r));let{pathname:u="/",search:f="",hash:d="",state:h=null,key:p="default"}=r,m=S.useMemo(()=>{let v=tg(u,l);return v==null?null:{location:{pathname:v,search:f,hash:d,state:h,key:p},navigationType:i}},[l,u,f,d,h,p,i]);return m==null?null:S.createElement(Ci.Provider,{value:c},S.createElement(_u.Provider,{children:n,value:m}))}function IE(t){let{children:e,location:n}=t;return xE(Oh(e),n)}new Promise(()=>{});function Oh(t,e){e===void 0&&(e=[]);let n=[];return S.Children.forEach(t,(r,i)=>{if(!S.isValidElement(r))return;let o=[...e,i];if(r.type===S.Fragment){n.push.apply(n,Oh(r.props.children,o));return}r.type!==ls&&Ee(!1),!r.props.index||!r.props.children||Ee(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Oh(r.props.children,o)),n.push(s)}),n}/** * React Router DOM v6.22.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ch(){return Ch=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function LE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function _E(t,e){return t.button===0&&(!e||e==="_self")&&!LE(t)}const zE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],$E="6";try{window.__reactRouterVersion=$E}catch{}const FE="startTransition",m0=LS[FE];function BE(t){let{basename:e,children:n,future:r,window:i}=t,o=S.useRef();o.current==null&&(o.current=KC({window:i,v5Compat:!0}));let s=o.current,[a,l]=S.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},u=S.useCallback(f=>{c&&m0?m0(()=>l(f)):l(f)},[l,c]);return S.useLayoutEffect(()=>s.listen(u),[s,u]),S.createElement(jE,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const HE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",UE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ea=S.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,unstable_viewTransition:f}=e,d=DE(e,zE),{basename:h}=S.useContext(Ci),p,m=!1;if(typeof c=="string"&&UE.test(c)&&(p=c,HE))try{let k=new URL(window.location.href),w=c.startsWith("//")?new URL(k.protocol+c):new URL(c),O=tg(w.pathname,h);w.origin===k.origin&&O!=null?c=O+w.search+w.hash:m=!0}catch{}let v=vE(c,{relative:i}),g=VE(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:i,unstable_viewTransition:f});function y(k){r&&r(k),k.defaultPrevented||g(k)}return S.createElement("a",Ch({},d,{href:p||v,onClick:m||o?r:y,ref:n,target:l}))});var g0;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(g0||(g0={}));var y0;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(y0||(y0={}));function VE(t,e){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=e===void 0?{}:e,l=$u(),c=zu(),u=ck(t,{relative:s});return S.useCallback(f=>{if(_E(f,n)){f.preventDefault();let d=r!==void 0?r:dc(c)===dc(u);l(t,{replace:d,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[c,l,u,r,i,n,t,o,s,a])}var dk={exports:{}},WE="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KE=WE,JE=KE;function hk(){}function pk(){}pk.resetWarningCache=hk;var qE=function(){function t(r,i,o,s,a,l){if(l!==JE){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:pk,resetWarningCache:hk};return n.PropTypes=n,n};dk.exports=qE();var GE=dk.exports;const x=xu(GE);var mk={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s0?"".concat(t,"px"):null}function XE(){return document.body.clientWidth0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tT;return e?t.split(" ").map(function(n){return e[n]||n}).join(" "):t}function Fu(t,e){var n={};return Object.keys(t).forEach(function(r){e.indexOf(r)===-1&&(n[r]=t[r])}),n}function yk(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i,o={};r>0;)r-=1,i=n[r],o[i]=t[i];return o}var v0={};function Eh(t){v0[t]||(typeof console<"u"&&console.error(t),v0[t]=!0)}function nT(t,e){return function(r,i,o){r[i]!==null&&typeof r[i]<"u"&&Eh('"'.concat(i,'" property of "').concat(o,`" has been deprecated. `).concat(e));for(var s=arguments.length,a=new Array(s>3?s-3:0),l=3;l"u"?"undefined":ta(window))==="object"&&window.Element||function(){};function iT(t,e,n){if(!(t[e]instanceof rT))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")}var oT=x.oneOfType([x.string,x.func,iT,x.shape({current:x.any})]),ie=x.oneOfType([x.func,x.string,x.shape({$$typeof:x.symbol,render:x.func}),x.arrayOf(x.oneOfType([x.func,x.string,x.shape({$$typeof:x.symbol,render:x.func})]))]),pc={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},mc=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],tl={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},te={esc:27,space:32,enter:13,tab:9,up:38,down:40,home:36,end:35,n:78,p:80},rg=!!(typeof window<"u"&&window.document&&window.document.createElement);function sT(t){return t&&ta(t)==="object"?"current"in t:!1}function aT(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ig(t){var e=ta(t);return t!=null&&(e==="object"||e==="function")}function lT(t){if(!ig(t))return!1;var e=aT(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object Proxy]"}function cT(t){if(sT(t))return t.current;if(lT(t))return t();if(typeof t=="string"&&rg){var e=document.querySelectorAll(t);if(e.length||(e=document.querySelectorAll("#".concat(t))),!e.length)throw new Error("The target '".concat(t,"' could not be identified in the dom, tip: check spelling"));return e}return t}function b0(t){return t===null?!1:Array.isArray(t)||rg&&typeof t.length=="number"}function uT(t,e){var n=cT(t);return e?b0(n)?n:n===null?[]:[n]:b0(n)?n[0]:n}var fT=["a[href]","area[href]","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","object","embed","[tabindex]:not(.modal):not(.offcanvas)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],dT=["className","cssModule","fluid","tag"];function Th(){return Th=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var mT={tag:ie,fluid:x.oneOfType([x.bool,x.string]),className:x.string,cssModule:x.object};function Lr(t){var e=t.className,n=t.cssModule,r=t.fluid,i=t.tag,o=i===void 0?"div":i,s=hT(t,dT),a="container";r===!0?a="container-fluid":r&&(a="container-".concat(r));var l=V(Y(e,a),n);return M.createElement(o,Th({},s,{className:l}))}Lr.propTypes=mT;var gT=["className","cssModule","noGutters","tag","widths"];function Nh(){return Nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var bT=["xs","sm","md","lg","xl","xxl"],Ti=x.oneOfType([x.number,x.string]),xT={tag:ie,noGutters:nT(x.bool,"Please use Bootstrap 5 gutter utility classes. https://getbootstrap.com/docs/5.0/layout/gutters/"),className:x.string,cssModule:x.object,xs:Ti,sm:Ti,md:Ti,lg:Ti,xl:Ti,xxl:Ti,widths:x.array};function ht(t){var e=t.className,n=t.cssModule,r=t.noGutters,i=t.tag,o=i===void 0?"div":i,s=t.widths,a=s===void 0?bT:s,l=yT(t,gT),c=[];a.forEach(function(f,d){var h=t[f];if(delete l[f],!!h){var p=!d;c.push(p?"row-cols-".concat(h):"row-cols-".concat(f,"-").concat(h))}});var u=V(Y(e,r?"gx-0":null,"row",c),n);return M.createElement(o,Nh({},l,{className:u}))}ht.propTypes=xT;var kT=["className","cssModule","widths","tag"];function Mh(){return Mh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ST(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Wf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vk=["xs","sm","md","lg","xl","xxl"],x0=x.oneOfType([x.number,x.string]),Ni=x.oneOfType([x.bool,x.number,x.string,x.shape({size:x.oneOfType([x.bool,x.number,x.string]),order:x0,offset:x0})]),OT={tag:ie,xs:Ni,sm:Ni,md:Ni,lg:Ni,xl:Ni,xxl:Ni,className:x.string,cssModule:x.object,widths:x.array},k0=function(e,n,r){return r===!0||r===""?e?"col":"col-".concat(n):r==="auto"?e?"col-auto":"col-".concat(n,"-auto"):e?"col-".concat(r):"col-".concat(n,"-").concat(r)},CT=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vk,i=e,o=[];return r.forEach(function(s,a){var l=i[s];if(delete i[s],!(!l&&l!=="")){var c=!a;if(ig(l)){var u,f=c?"-":"-".concat(s,"-"),d=k0(c,s,l.size);o.push(V(Y((u={},Wf(u,d,l.size||l.size===""),Wf(u,"order".concat(f).concat(l.order),l.order||l.order===0),Wf(u,"offset".concat(f).concat(l.offset),l.offset||l.offset===0),u)),n))}else{var h=k0(c,s,l);o.push(h)}}}),{colClasses:o,modifiedAttributes:i}};function ae(t){var e=t.className,n=t.cssModule,r=t.widths,i=r===void 0?vk:r,o=t.tag,s=o===void 0?"div":o,a=wT(t,kT),l=CT(a,n,i),c=l.modifiedAttributes,u=l.colClasses;u.length||u.push("col");var f=V(Y(e,u),n);return M.createElement(s,Mh({},c,{className:f}))}ae.propTypes=OT;var ET=["expand","className","cssModule","light","dark","fixed","sticky","color","container","tag","children"];function Ph(){return Ph=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function NT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var MT={children:x.node,className:x.string,color:x.string,container:x.oneOfType([x.bool,x.string]),cssModule:x.object,dark:x.bool,expand:x.oneOfType([x.bool,x.string]),fixed:x.string,light:x.bool,role:x.string,sticky:x.string,tag:ie},PT=function(e){return e===!1?!1:e===!0||e==="xs"?"navbar-expand":"navbar-expand-".concat(e)};function bk(t){var e,n=t.expand,r=n===void 0?!1:n,i=t.className,o=t.cssModule,s=t.light,a=t.dark,l=t.fixed,c=t.sticky,u=t.color,f=t.container,d=f===void 0?"fluid":f,h=t.tag,p=h===void 0?"nav":h,m=t.children,v=TT(t,ET),g=V(Y(i,"navbar",PT(r),(e={"navbar-light":s,"navbar-dark":a},Kf(e,"bg-".concat(u),u),Kf(e,"fixed-".concat(l),l),Kf(e,"sticky-".concat(c),c),e)),o),y=d&&d===!0?"container":"container-".concat(d);return M.createElement(p,Ph({},v,{className:g}),d?M.createElement("div",{className:y},m):m)}bk.propTypes=MT;var AT=["className","cssModule","tag"];function Ah(){return Ah=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var IT={className:x.string,cssModule:x.object,tag:ie};function xk(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"a":r,o=RT(t,AT),s=V(Y(e,"navbar-brand"),n);return M.createElement(i,Ah({},o,{className:s}))}xk.propTypes=IT;var DT=["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"];function Rh(){return Rh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _T(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var zT={card:x.bool,className:x.string,cssModule:x.object,fill:x.bool,horizontal:x.oneOf(["center","end"]),justified:x.bool,navbar:x.bool,pills:x.bool,tabs:x.bool,tag:ie,vertical:x.oneOfType([x.bool,x.string])},$T=function(e){return e===!1?!1:e===!0||e==="xs"?"flex-column":"flex-".concat(e,"-column")};function kk(t){var e=t.className,n=t.cssModule,r=t.tabs,i=t.pills,o=t.vertical,s=o===void 0?!1:o,a=t.horizontal,l=t.justified,c=t.fill,u=t.navbar,f=t.card,d=t.tag,h=d===void 0?"ul":d,p=LT(t,DT),m=V(Y(e,u?"navbar-nav":"nav",a?"justify-content-".concat(a):!1,$T(s),{"nav-tabs":r,"card-header-tabs":f&&r,"nav-pills":i,"card-header-pills":f&&i,"nav-justified":l,"nav-fill":c}),n);return M.createElement(h,Rh({},p,{className:m}))}kk.propTypes=zT;var FT=["className","cssModule","active","tag"];function jh(){return jh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function HT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var UT={active:x.bool,className:x.string,cssModule:x.object,tag:ie};function wk(t){var e=t.className,n=t.cssModule,r=t.active,i=t.tag,o=i===void 0?"li":i,s=BT(t,FT),a=V(Y(e,"nav-item",r?"active":!1),n);return M.createElement(o,jh({},s,{className:a}))}wk.propTypes=UT;var VT=["className","cssModule","variant","innerRef"];function Ih(){return Ih=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var GT={active:x.bool,"aria-label":x.string,onClick:x.func,variant:x.oneOf(["white"]),className:x.string,cssModule:x.object,innerRef:x.oneOfType([x.object,x.string,x.func])};function Sk(t){var e=t.className;t.cssModule;var n=t.variant,r=t.innerRef,i=JT(t,VT),o=V(Y(e,"btn-close",n&&"btn-close-".concat(n)));return M.createElement("button",Ih({ref:r,type:"button",className:o},WT({"aria-label":"close"},i)))}Sk.propTypes=GT;var YT=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function Dh(){return Dh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XT(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var ZT={active:x.bool,"aria-label":x.string,block:x.bool,children:x.node,className:x.string,cssModule:x.object,close:x.bool,color:x.string,disabled:x.bool,innerRef:x.oneOfType([x.object,x.func,x.string]),onClick:x.func,outline:x.bool,size:x.string,tag:ie};function A(t){var e=S.useCallback(function(y){if(t.disabled){y.preventDefault();return}if(t.onClick)return t.onClick(y)},[t.onClick,t.disabled]),n=t.active,r=t["aria-label"],i=t.block,o=t.className,s=t.close,a=t.cssModule,l=t.color,c=l===void 0?"secondary":l,u=t.outline,f=t.size,d=t.tag,h=d===void 0?"button":d,p=t.innerRef,m=QT(t,YT);if(s)return M.createElement(Sk,m);var v="btn".concat(u?"-outline":"","-").concat(c),g=V(Y(o,"btn",v,f?"btn-".concat(f):!1,i?"d-block w-100":!1,{active:n,disabled:t.disabled}),a);return m.href&&h==="button"&&(h="a"),M.createElement(h,Dh({type:h==="button"&&m.onClick?"button":void 0},m,{className:g,ref:p,onClick:e,"aria-label":r}))}A.propTypes=ZT;var e3=S.createContext(),t3=S.createContext();function S0(t){var e=t.children,n=S.useState(null),r=n[0],i=n[1],o=S.useRef(!1);S.useEffect(function(){return function(){o.current=!0}},[]);var s=S.useCallback(function(a){o.current||i(a)},[]);return S.createElement(e3.Provider,{value:r},S.createElement(t3.Provider,{value:s},e))}var O0=M.createContext({}),Ok=M.createContext({});function Lh(t){"@babel/helpers - typeof";return Lh=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},Lh(t)}var n3=["className","cssModule","direction","isOpen","group","size","nav","setActiveFromChild","active","tag","menuRole"];function _h(){return _h=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function i3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function o3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C0(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gc(t){return gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gc(t)}var f3={a11y:x.bool,disabled:x.bool,direction:x.oneOf(["up","down","start","end","left","right"]),group:x.bool,isOpen:x.bool,nav:x.bool,active:x.bool,size:x.string,tag:ie,toggle:x.func,children:x.node,className:x.string,cssModule:x.object,dropup:x.bool,inNavbar:x.bool,setActiveFromChild:x.bool,menuRole:x.oneOf(["listbox","menu"])},d3={a11y:!0,isOpen:!1,direction:"down",nav:!1,active:!1,inNavbar:!1,setActiveFromChild:!1},h3=[te.space,te.enter,te.up,te.down,te.end,te.home],Bu=function(t){a3(n,t);var e=l3(n);function n(r){var i;return o3(this,n),i=e.call(this,r),i.addEvents=i.addEvents.bind(Kn(i)),i.handleDocumentClick=i.handleDocumentClick.bind(Kn(i)),i.handleKeyDown=i.handleKeyDown.bind(Kn(i)),i.removeEvents=i.removeEvents.bind(Kn(i)),i.toggle=i.toggle.bind(Kn(i)),i.handleMenuRef=i.handleMenuRef.bind(Kn(i)),i.handleToggleRef=i.handleToggleRef.bind(Kn(i)),i.containerRef=M.createRef(),i.menuRef=M.createRef(),i.toggleRef=M.createRef(),i}return s3(n,[{key:"componentDidMount",value:function(){this.handleProps()}},{key:"componentDidUpdate",value:function(i){this.props.isOpen!==i.isOpen&&this.handleProps()}},{key:"componentWillUnmount",value:function(){this.removeEvents()}},{key:"handleMenuRef",value:function(i){this.menuRef.current=i}},{key:"handleToggleRef",value:function(i){this.toggleRef.current=i}},{key:"handleDocumentClick",value:function(i){if(!(i&&(i.which===3||i.type==="keyup"&&i.which!==te.tab))){var o=this.getContainer(),s=this.getMenu(),a=this.getToggle();if(a){var l=a.contains(i.target),c=s&&s.contains(i.target)&&s!==i.target,u=!1;o&&(u=o.classList.contains("input-group")&&o.classList.contains("dropdown")&&i.target.tagName==="INPUT"),!((l&&!u||c)&&(i.type!=="keyup"||i.which===te.tab))&&this.toggle(i)}}}},{key:"handleKeyDown",value:function(i){var o=this,s=i.target.getAttribute("role")==="menuitem"||i.target.getAttribute("role")==="option",a=this.getMenuCtrl()===i.target,l=te.tab===i.which;if(!(/input|textarea/i.test(i.target.tagName)||l&&!this.props.a11y||l&&!(s||a))&&((h3.indexOf(i.which)!==-1||i.which>=48&&i.which<=90)&&i.preventDefault(),!this.props.disabled)){if(a)if([te.space,te.enter,te.up,te.down].indexOf(i.which)>-1)this.props.isOpen||this.toggle(i),setTimeout(function(){var y;return(y=o.getMenuItems()[0])===null||y===void 0?void 0:y.focus()});else if(this.props.isOpen&&l){var c;i.preventDefault(),(c=this.getMenuItems()[0])===null||c===void 0||c.focus()}else this.props.isOpen&&i.which===te.esc&&this.toggle(i);if(this.props.isOpen&&s){if([te.tab,te.esc].indexOf(i.which)>-1)this.toggle(i),this.getMenuCtrl().focus();else if([te.space,te.enter].indexOf(i.which)>-1)i.target.click(),this.getMenuCtrl().focus();else if([te.down,te.up].indexOf(i.which)>-1||[te.n,te.p].indexOf(i.which)>-1&&i.ctrlKey){var u=this.getMenuItems(),f=u.indexOf(i.target);te.up===i.which||te.p===i.which&&i.ctrlKey?f=f!==0?f-1:u.length-1:(te.down===i.which||te.n===i.which&&i.ctrlKey)&&(f=f===u.length-1?0:f+1),u[f].focus()}else if(te.end===i.which){var d=this.getMenuItems();d[d.length-1].focus()}else if(te.home===i.which){var h=this.getMenuItems();h[0].focus()}else if(i.which>=48&&i.which<=90)for(var p=this.getMenuItems(),m=String.fromCharCode(i.which).toLowerCase(),v=0;v=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var x3={"aria-label":x.string,className:x.string,cssModule:x.object,role:x.string,size:x.string,tag:ie,vertical:x.bool};function Ve(t){var e=t.className,n=t.cssModule,r=t.size,i=t.vertical,o=t.tag,s=o===void 0?"div":o,a=v3(t,m3),l=V(Y(e,r?"btn-group-"+r:!1,i?"btn-group-vertical":"btn-group"),n);return M.createElement(s,$h({},g3({role:"group"},a),{className:l}))}Ve.propTypes=x3;function k3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Fh(t,e){return Fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fh(t,e)}function w3(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Fh(t,e)}const T0={disabled:!1},Ck=M.createContext(null);var S3=function(e){return e.scrollTop},cs="unmounted",Wr="exited",Kr="entering",Li="entered",Bh="exiting",bt=function(t){w3(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=Wr,o.appearStatus=Kr):l=Li:r.unmountOnExit||r.mountOnEnter?l=cs:l=Wr,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===cs?{status:Wr}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==Kr&&s!==Li&&(o=Kr):(s===Kr||s===Li)&&(o=Bh)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Kr){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:eo.findDOMNode(this);s&&S3(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Wr&&this.setState({status:cs})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[eo.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||T0.disabled){this.safeSetState({status:Li},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Kr},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Li},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:eo.findDOMNode(this);if(!o||T0.disabled){this.safeSetState({status:Wr},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:Bh},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Wr},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:eo.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===cs)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=k3(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return M.createElement(Ck.Provider,{value:null},typeof s=="function"?s(i,a):M.cloneElement(M.Children.only(s),a))},e}(M.Component);bt.contextType=Ck;bt.propTypes={};function Mi(){}bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Mi,onEntering:Mi,onEntered:Mi,onExit:Mi,onExiting:Mi,onExited:Mi};bt.UNMOUNTED=cs;bt.EXITED=Wr;bt.ENTERING=Kr;bt.ENTERED=Li;bt.EXITING=Bh;var O3=["tag","baseClass","baseClassActive","className","cssModule","children","innerRef"];function yc(){return yc=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function E3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function N0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function na(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function A3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function R3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M0(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bc(t){return bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bc(t)}function P0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Eo(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var K3={body:x.bool,className:x.string,color:x.string,cssModule:x.object,innerRef:x.oneOfType([x.object,x.string,x.func]),inverse:x.bool,outline:x.bool,tag:ie};function To(t){var e=t.className,n=t.cssModule,r=t.color,i=t.body,o=t.inverse,s=t.outline,a=t.tag,l=a===void 0?"div":a,c=t.innerRef,u=V3(t,U3),f=V(Y(e,"card",o?"text-white":!1,i?"card-body":!1,r?"".concat(s?"border":"bg","-").concat(r):!1),n);return M.createElement(l,Vh({},u,{className:f,ref:c}))}To.propTypes=K3;var J3=["className","cssModule","innerRef","tag"];function Wh(){return Wh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function G3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var Y3={className:x.string,cssModule:x.object,innerRef:x.oneOfType([x.object,x.string,x.func]),tag:ie};function No(t){var e=t.className,n=t.cssModule,r=t.innerRef,i=t.tag,o=i===void 0?"div":i,s=q3(t,J3),a=V(Y(e,"card-body"),n);return M.createElement(o,Wh({},s,{className:a,ref:r}))}No.propTypes=Y3;var Q3=["className","cssModule","top","bottom","tag"];function Kh(){return Kh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Z3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var eN={bottom:x.bool,className:x.string,cssModule:x.object,tag:ie,top:x.bool};function Nk(t){var e=t.className,n=t.cssModule,r=t.top,i=t.bottom,o=t.tag,s=o===void 0?"img":o,a=X3(t,Q3),l="card-img";r&&(l="card-img-top"),i&&(l="card-img-bottom");var c=V(Y(e,l),n);return M.createElement(s,Kh({},a,{className:c}))}Nk.propTypes=eN;var tN=["className","cssModule","tag"];function Jh(){return Jh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var iN={className:x.string,cssModule:x.object,tag:ie};function _i(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"p":r,o=nN(t,tN),s=V(Y(e,"card-text"),n);return M.createElement(i,Jh({},o,{className:s}))}_i.propTypes=iN;var oN=["className","cssModule","tag"];function qh(){return qh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function aN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var lN={className:x.string,cssModule:x.object,tag:ie};function ra(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"div":r,o=sN(t,oN),s=V(Y(e,"card-title"),n);return M.createElement(i,qh({},o,{className:s}))}ra.propTypes=lN;function Gh(t){"@babel/helpers - typeof";return Gh=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},Gh(t)}function cN(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A0(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xc(t){return xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xc(t)}var gN={children:x.node.isRequired,node:x.any},Mk=function(t){fN(n,t);var e=dN(n);function n(){return cN(this,n),e.apply(this,arguments)}return uN(n,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return rg?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),eo.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),n}(M.Component);Mk.propTypes=gN;const yN=Mk;function Qh(t){"@babel/helpers - typeof";return Qh=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},Qh(t)}function R0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ai(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kc(t){return kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kc(t)}function wc(){}var I0=x.shape(qt.propTypes),Pk={autoFocus:x.bool,backdrop:x.oneOfType([x.bool,x.oneOf(["static"])]),backdropClassName:x.string,backdropTransition:I0,centered:x.bool,children:x.node,contentClassName:x.string,className:x.string,container:oT,cssModule:x.object,external:x.node,fade:x.bool,fullscreen:x.oneOfType([x.bool,x.oneOf(["sm","md","lg","xl"])]),innerRef:x.oneOfType([x.object,x.string,x.func]),isOpen:x.bool,keyboard:x.bool,labelledBy:x.string,modalClassName:x.string,modalTransition:I0,onClosed:x.func,onEnter:x.func,onExit:x.func,onOpened:x.func,returnFocusAfterClose:x.bool,role:x.string,scrollable:x.bool,size:x.string,toggle:x.func,trapFocus:x.bool,unmountOnClose:x.bool,wrapClassName:x.string,zIndex:x.oneOfType([x.number,x.string])},ON=Object.keys(Pk),CN={isOpen:!1,autoFocus:!0,centered:!1,scrollable:!1,role:"dialog",backdrop:!0,keyboard:!0,zIndex:1050,fade:!0,onOpened:wc,onClosed:wc,modalTransition:{timeout:pc.Modal},backdropTransition:{mountOnEnter:!0,timeout:pc.Fade},unmountOnClose:!0,returnFocusAfterClose:!0,container:"body",trapFocus:!1},Ea=function(t){xN(n,t);var e=kN(n);function n(r){var i;return vN(this,n),i=e.call(this,r),i._element=null,i._originalBodyPadding=null,i.getFocusableChildren=i.getFocusableChildren.bind(At(i)),i.handleBackdropClick=i.handleBackdropClick.bind(At(i)),i.handleBackdropMouseDown=i.handleBackdropMouseDown.bind(At(i)),i.handleEscape=i.handleEscape.bind(At(i)),i.handleStaticBackdropAnimation=i.handleStaticBackdropAnimation.bind(At(i)),i.handleTab=i.handleTab.bind(At(i)),i.onOpened=i.onOpened.bind(At(i)),i.onClosed=i.onClosed.bind(At(i)),i.manageFocusAfterClose=i.manageFocusAfterClose.bind(At(i)),i.clearBackdropAnimationTimeout=i.clearBackdropAnimationTimeout.bind(At(i)),i.trapFocus=i.trapFocus.bind(At(i)),i.state={isOpen:!1,showStaticBackdropAnimation:!1},i}return bN(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isOpen,s=i.autoFocus,a=i.onEnter;o&&(this.init(),this.setState({isOpen:!0}),s&&this.setFocus()),a&&a(),document.addEventListener("focus",this.trapFocus,!0),this._isMounted=!0}},{key:"componentDidUpdate",value:function(i,o){if(this.props.isOpen&&!i.isOpen){this.init(),this.setState({isOpen:!0});return}this.props.autoFocus&&this.state.isOpen&&!o.isOpen&&this.setFocus(),this._element&&i.zIndex!==this.props.zIndex&&(this._element.style.zIndex=this.props.zIndex)}},{key:"componentWillUnmount",value:function(){this.clearBackdropAnimationTimeout(),this.props.onExit&&this.props.onExit(),this._element&&(this.destroy(),(this.props.isOpen||this.state.isOpen)&&this.close()),document.removeEventListener("focus",this.trapFocus,!0),this._isMounted=!1}},{key:"handleBackdropClick",value:function(i){if(i.target===this._mouseDownElement){i.stopPropagation();var o=this._dialog?this._dialog.parentNode:null;if(o&&i.target===o&&this.props.backdrop==="static"&&this.handleStaticBackdropAnimation(),!this.props.isOpen||this.props.backdrop!==!0)return;o&&i.target===o&&this.props.toggle&&this.props.toggle(i)}}},{key:"handleTab",value:function(i){if(i.which===9&&!(this.modalIndex0&&(i.preventDefault(),i.stopPropagation(),o[0].focus())}}},{key:"init",value:function(){try{this._triggeringElement=document.activeElement}catch{this._triggeringElement=null}this._element||(this._element=document.createElement("div"),this._element.setAttribute("tabindex","-1"),this._element.style.position="relative",this._element.style.zIndex=this.props.zIndex,this._mountContainer=uT(this.props.container),this._mountContainer.appendChild(this._element)),this._originalBodyPadding=ZE(),n.openCount<1&&(n.originalBodyOverflow=window.getComputedStyle(document.body).overflow),eT(),n.openCount===0&&(document.body.className=Y(document.body.className,V("modal-open",this.props.cssModule)),document.body.style.overflow="hidden"),this.modalIndex=n.openCount,n.openCount+=1}},{key:"destroy",value:function(){this._element&&(this._mountContainer.removeChild(this._element),this._element=null),this.manageFocusAfterClose()}},{key:"manageFocusAfterClose",value:function(){if(this._triggeringElement){var i=this.props.returnFocusAfterClose;this._triggeringElement.focus&&i&&this._triggeringElement.focus(),this._triggeringElement=null}}},{key:"close",value:function(){if(n.openCount<=1){var i=V("modal-open",this.props.cssModule),o=new RegExp("(^| )".concat(i,"( |$)"));document.body.className=document.body.className.replace(o," ").trim(),document.body.style.overflow=n.originalBodyOverflow}this.manageFocusAfterClose(),n.openCount=Math.max(0,n.openCount-1),gk(this._originalBodyPadding)}},{key:"clearBackdropAnimationTimeout",value:function(){this._backdropAnimationTimeout&&(clearTimeout(this._backdropAnimationTimeout),this._backdropAnimationTimeout=void 0)}},{key:"renderModalDialog",value:function(){var i,o=this,s=Fu(this.props,ON),a="modal-dialog";return M.createElement("div",Ss({},s,{className:V(Y(a,this.props.className,(i={},zi(i,"modal-".concat(this.props.size),this.props.size),zi(i,"".concat(a,"-centered"),this.props.centered),zi(i,"".concat(a,"-scrollable"),this.props.scrollable),zi(i,"modal-fullscreen",this.props.fullscreen===!0),zi(i,"modal-fullscreen-".concat(this.props.fullscreen,"-down"),typeof this.props.fullscreen=="string"),i)),this.props.cssModule),role:"document",ref:function(c){o._dialog=c}}),M.createElement("div",{className:V(Y("modal-content",this.props.contentClassName),this.props.cssModule)},this.props.children))}},{key:"render",value:function(){var i=this.props.unmountOnClose;if(this._element&&(this.state.isOpen||!i)){var o=!!this._element&&!this.state.isOpen&&!i;this._element.style.display=o?"none":"block";var s=this.props,a=s.wrapClassName,l=s.modalClassName,c=s.backdropClassName,u=s.cssModule,f=s.isOpen,d=s.backdrop,h=s.role,p=s.labelledBy,m=s.external,v=s.innerRef,g={onClick:this.handleBackdropClick,onMouseDown:this.handleBackdropMouseDown,onKeyUp:this.handleEscape,onKeyDown:this.handleTab,style:{display:"block"},"aria-labelledby":p,"aria-modal":!0,role:h,tabIndex:"-1"},y=this.props.fade,k=Ai(Ai(Ai({},qt.defaultProps),this.props.modalTransition),{},{baseClass:y?this.props.modalTransition.baseClass:"",timeout:y?this.props.modalTransition.timeout:0}),w=Ai(Ai(Ai({},qt.defaultProps),this.props.backdropTransition),{},{baseClass:y?this.props.backdropTransition.baseClass:"",timeout:y?this.props.backdropTransition.timeout:0}),O=d&&(y?M.createElement(qt,Ss({},w,{in:f&&!!d,cssModule:u,className:V(Y("modal-backdrop",c),u)})):M.createElement("div",{className:V(Y("modal-backdrop","show",c),u)}));return M.createElement(yN,{node:this._element},M.createElement("div",{className:V(a)},M.createElement(qt,Ss({},g,k,{in:f,onEntered:this.onOpened,onExited:this.onClosed,cssModule:u,className:V(Y("modal",l,this.state.showStaticBackdropAnimation&&"modal-static"),u),innerRef:v}),m,this.renderModalDialog()),O))}return null}}]),n}(M.Component);Ea.propTypes=Pk;Ea.defaultProps=CN;Ea.openCount=0;Ea.originalBodyOverflow=null;const sg=Ea;var EN=["className","cssModule","children","toggle","tag","wrapTag","closeAriaLabel","close"];function Zh(){return Zh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function NN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var MN={children:x.node,className:x.string,close:x.object,closeAriaLabel:x.string,cssModule:x.object,tag:ie,toggle:x.func,wrapTag:ie};function Hu(t){var e,n=t.className,r=t.cssModule,i=t.children,o=t.toggle,s=t.tag,a=s===void 0?"h5":s,l=t.wrapTag,c=l===void 0?"div":l,u=t.closeAriaLabel,f=u===void 0?"Close":u,d=t.close,h=TN(t,EN),p=V(Y(n,"modal-header"),r);return!d&&o&&(e=M.createElement("button",{type:"button",onClick:o,className:V("btn-close",r),"aria-label":f})),M.createElement(c,Zh({},h,{className:p}),M.createElement(a,{className:V("modal-title",r)},i),d||e)}Hu.propTypes=MN;var PN=["className","cssModule","tag"];function ep(){return ep=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function RN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var jN={className:x.string,cssModule:x.object,tag:ie};function Uu(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"div":r,o=AN(t,PN),s=V(Y(e,"modal-body"),n);return M.createElement(i,ep({},o,{className:s}))}Uu.propTypes=jN;var IN=["className","cssModule","tag"];function tp(){return tp=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function LN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var _N={className:x.string,cssModule:x.object,tag:ie};function Vu(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"div":r,o=DN(t,IN),s=V(Y(e,"modal-footer"),n);return M.createElement(i,tp({},o,{className:s}))}Vu.propTypes=_N;var zN=["className","cssModule","valid","tooltip","tag"];function np(){return np=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function FN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var BN={children:x.node,tag:ie,className:x.string,cssModule:x.object,valid:x.bool,tooltip:x.bool};function Os(t){var e=t.className,n=t.cssModule,r=t.valid,i=r===void 0?void 0:r,o=t.tooltip,s=t.tag,a=s===void 0?"div":s,l=$N(t,zN),c=o?"tooltip":"feedback",u=V(Y(e,i?"valid-".concat(c):"invalid-".concat(c)),n);return M.createElement(a,np({},l,{className:u}))}Os.propTypes=BN;function rp(t){"@babel/helpers - typeof";return rp=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},rp(t)}var HN=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function ip(){return ip=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function VN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function WN(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D0(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sc(t)}var QN={children:x.node,type:x.string,size:x.oneOfType([x.number,x.string]),bsSize:x.string,valid:x.bool,invalid:x.bool,tag:ie,innerRef:x.oneOfType([x.object,x.func,x.string]),plaintext:x.bool,addon:x.bool,className:x.string,cssModule:x.object},Ak=function(t){JN(n,t);var e=qN(n);function n(r){var i;return WN(this,n),i=e.call(this,r),i.getRef=i.getRef.bind(sp(i)),i.focus=i.focus.bind(sp(i)),i}return KN(n,[{key:"getRef",value:function(i){this.props.innerRef&&this.props.innerRef(i),this.ref=i}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var i=this.props,o=i.className,s=i.cssModule,a=i.type,l=a===void 0?"text":a,c=i.bsSize,u=i.valid,f=i.invalid,d=i.tag,h=i.addon,p=i.plaintext,m=i.innerRef,v=UN(i,HN),g=["switch","radio","checkbox"].indexOf(l)>-1,y=/\D/g,k=l==="textarea",w=l==="select",O=l==="range",C=d||(w||k?l:"input"),T="form-control";p?(T="".concat(T,"-plaintext"),C=d||"input"):O?T="form-range":w?T="form-select":g&&(h?T=null:T="form-check-input"),v.size&&y.test(v.size)&&(Eh(`Please use the prop "bsSize" instead of the "size" to bootstrap's input sizing.`),c=v.size,delete v.size);var j=V(Y(o,f&&"is-invalid",u&&"is-valid",c?w?"form-select-".concat(c):"form-control-".concat(c):!1,T),s);return(C==="input"||d&&typeof d=="function")&&(v.type=l==="switch"?"checkbox":l),v.children&&!(p||l==="select"||typeof C!="string"||C==="select")&&(Eh('Input with a type of "'.concat(l,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete v.children),M.createElement(C,ip({},v,{ref:m,className:j,"aria-invalid":f}))}}]),n}(M.Component);Ak.propTypes=QN;const br=Ak;var XN=["className","cssModule","tag","type","size"];function Oc(){return Oc=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function eM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var tM={className:x.string,cssModule:x.object,size:x.string,tag:ie,type:x.string};function xr(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"div":r;t.type;var o=t.size,s=ZN(t,XN),a=V(Y(e,"input-group",o?"input-group-".concat(o):null),n);return t.type==="dropdown"?M.createElement(p3,Oc({},s,{className:a})):M.createElement(Ok.Provider,{value:{insideInputGroup:!0}},M.createElement(i,Oc({},s,{className:a})))}xr.propTypes=tM;var nM=["className","cssModule","tag"];function ap(){return ap=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function iM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var oM={className:x.string,cssModule:x.object,tag:ie};function kr(t){var e=t.className,n=t.cssModule,r=t.tag,i=r===void 0?"span":r,o=rM(t,nM),s=V(Y(e,"input-group-text"),n);return M.createElement(i,ap({},o,{className:s}))}kr.propTypes=oM;var sM=["className","cssModule","hidden","widths","tag","check","size","for"];function lp(){return lp=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var cM=["xs","sm","md","lg","xl","xxl"],qf=x.oneOfType([x.number,x.string]),Ri=x.oneOfType([x.bool,x.string,x.number,x.shape({size:qf,order:qf,offset:qf})]),uM={children:x.node,hidden:x.bool,check:x.bool,size:x.string,for:x.string,tag:ie,className:x.string,cssModule:x.object,xs:Ri,sm:Ri,md:Ri,lg:Ri,xl:Ri,xxl:Ri,widths:x.array},L0=function(e,n,r){return r===!0||r===""?e?"col":"col-".concat(n):r==="auto"?e?"col-auto":"col-".concat(n,"-auto"):e?"col-".concat(r):"col-".concat(n,"-").concat(r)};function Rk(t){var e=t.className,n=t.cssModule,r=t.hidden,i=t.widths,o=i===void 0?cM:i,s=t.tag,a=s===void 0?"label":s,l=t.check,c=t.size,u=t.for,f=aM(t,sM),d=[];o.forEach(function(v,g){var y=t[v];if(delete f[v],!(!y&&y!=="")){var k=!g,w;if(ig(y)){var O,C=k?"-":"-".concat(v,"-");w=L0(k,v,y.size),d.push(V(Y((O={},Jf(O,w,y.size||y.size===""),Jf(O,"order".concat(C).concat(y.order),y.order||y.order===0),Jf(O,"offset".concat(C).concat(y.offset),y.offset||y.offset===0),O))),n)}else w=L0(k,v,y),d.push(w)}});var h=c||d.length,p=!(l||h),m=V(Y(e,r?"visually-hidden":!1,l?"form-check-label":!1,c?"col-form-label-".concat(c):!1,d,h?"col-form-label":!1,p?"form-label":!1),n);return M.createElement(a,lp({htmlFor:u},f,{className:m}))}Rk.propTypes=uM;var fM=["className","closeClassName","closeAriaLabel","cssModule","tag","color","isOpen","toggle","children","transition","fade","innerRef"];function cp(){return cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var mM={children:x.node,className:x.string,closeClassName:x.string,closeAriaLabel:x.string,color:x.string,cssModule:x.object,fade:x.bool,innerRef:x.oneOfType([x.object,x.string,x.func]),isOpen:x.bool,tag:ie,toggle:x.func,transition:x.shape(qt.propTypes)};function jk(t){var e=t.className,n=t.closeClassName,r=t.closeAriaLabel,i=r===void 0?"Close":r,o=t.cssModule,s=t.tag,a=s===void 0?"div":s,l=t.color,c=l===void 0?"success":l,u=t.isOpen,f=u===void 0?!0:u,d=t.toggle,h=t.children,p=t.transition,m=p===void 0?es(es({},qt.defaultProps),{},{unmountOnExit:!0}):p,v=t.fade,g=v===void 0?!0:v,y=t.innerRef,k=hM(t,fM),w=V(Y(e,"alert","alert-".concat(c),{"alert-dismissible":d}),o),O=V(Y("btn-close",n),o),C=es(es(es({},qt.defaultProps),m),{},{baseClass:g?m.baseClass:"",timeout:g?m.timeout:0});return M.createElement(qt,cp({},k,C,{tag:a,className:w,in:f,role:"alert",innerRef:y}),d?M.createElement("button",{type:"button",className:O,"aria-label":i,onClick:d}):null,h)}jk.propTypes=mM;var gM=["className","cssModule","type","size","color","children","tag"];function up(){return up=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var bM={tag:ie,type:x.oneOf(["border","grow"]),size:x.oneOf(["sm"]),color:x.oneOf(["primary","secondary","success","danger","warning","info","light","dark"]),className:x.string,cssModule:x.object,children:x.string};function _r(t){var e=t.className,n=t.cssModule,r=t.type,i=r===void 0?"border":r,o=t.size,s=t.color,a=t.children,l=a===void 0?"Loading...":a,c=t.tag,u=c===void 0?"div":c,f=yM(t,gM),d=V(Y(e,o?"spinner-".concat(i,"-").concat(o):!1,"spinner-".concat(i),s?"text-".concat(s):!1),n);return M.createElement(u,up({role:"status"},f,{className:d}),l&&M.createElement("span",{className:V("visually-hidden",n)},l))}_r.propTypes=bM;function Be(t){this.content=t}Be.prototype={constructor:Be,find:function(t){for(var e=0;e>1}};Be.from=function(t){if(t instanceof Be)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Be(e)};function Ik(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Ik(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Dk(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new N(r,i)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new N(i,o)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?nl(r+1,s):nl(r,i);i=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,n){if(!n)return N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};re.none=[];class Ec extends Error{}class I{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=_k(this.content,e+this.openStart,n);return r&&new I(r,this.openStart,this.openEnd)}removeBetween(e,n){return new I(Lk(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return I.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new I(N.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new I(e,r,i)}}I.empty=new I(N.empty,0,0);function Lk(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Lk(o.content,e-i-1,n-i-1)))}function _k(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=_k(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function xM(t,e,n){if(n.openStart>t.depth)throw new Ec("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ec("Inconsistent open depths");return zk(t,e,n,0)}function zk(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Cs(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(si(t.nodeAfter,r),o++));for(let a=o;ai&&dp(t,e,i+1),s=r.depth>i&&dp(n,r,i+1),a=[];return Cs(null,t,i,a),o&&s&&e.index(i)==n.index(i)?($k(o,s),si(ai(o,Fk(t,e,n,r,i+1)),a)):(o&&si(ai(o,Tc(t,e,i+1)),a),Cs(e,n,i,a),s&&si(ai(s,Tc(n,r,i+1)),a)),Cs(r,null,i,a),new N(a)}function Tc(t,e,n){let r=[];if(Cs(null,t,n,r),t.depth>n){let i=dp(t,e,n+1);si(ai(i,Tc(t,e,n+1)),r)}return Cs(e,null,n,r),new N(r)}function kM(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(N.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class ia{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Nc(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new ia(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.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()+")"),Bk(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=N.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=N.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};li.prototype.text=void 0;class Mc extends li{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Bk(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Mc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Mc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Bk(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class yi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new OM(e,n);if(r.next==null)return yi.empty;let i=Hk(r);r.next&&r.err("Unexpected trailing text");let o=AM(PM(i));return RM(o,r),o}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}}yi.empty=new yi(!0);class OM{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Hk(t){let e=[];do e.push(CM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function CM(t){let e=[];do e.push(EM(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function EM(t){let e=MM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=TM(t,e);else break;return e}function z0(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function TM(t,e){let n=z0(t),r=n;return t.eat(",")&&(t.next!="}"?r=z0(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function NM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function MM(t){if(t.eat("(")){let e=Hk(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=NM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function PM(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new yi(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new Jk(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class jM{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Wu{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Kk(i.attrs),this.excluded=null;let o=Vk(this.attrs);this.instance=o?new re(this,o):null}create(e=null){return!e&&this.instance?this.instance:new re(this,Wk(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Wu(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class IM{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Be.from(e.nodes),n.marks=Be.from(e.marks||{}),this.nodes=F0.compile(this.spec.nodes,this),this.marks=Wu.compile(this.spec.marks,this);let r=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 o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=yi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?B0(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:B0(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof F0){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Mc(r,r.defaultAttrs,e,re.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return li.fromJSON(this,e)}markFromJSON(e){return re.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function B0(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function DM(t){return t.tag!=null}function LM(t){return t.style!=null}class Mo{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{DM(r)?this.tags.push(r):LM(r)&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new U0(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new U0(this,n,!0);return r.addAll(e,n.from,n.to),I.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=V0(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=V0(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mo(e,Mo.schemaRules(e)))}}const qk={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},_M={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Gk={ol:!0,ul:!0},Pc=1,Ac=2,Es=4;function H0(t,e,n){return e!=null?(e?Pc:0)|(e==="full"?Ac:0):t&&t.whitespace=="pre"?Pc|Ac:n&~Es}class rl{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=re.none,this.stashMarks=[],this.match=s||(a&Es?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(N.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Pc)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=N.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(N.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=re.none,r=re.none;for(let i=0;i{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=HM(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function zM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Gk.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function $M(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function FM(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function V0(t){let e={};for(let n in t)e[n]=t[n];return e}function BM(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&dn.renderSpec(Xf(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:d,contentDOM:h}=dn.renderSpec(e,f,r);if(a.appendChild(d),h){if(s)throw new RangeError("Multiple content holes");s=h}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=W0(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return W0(e.marks)}}function W0(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Xf(t){return t.document||window.document}const Yk=65535,Qk=Math.pow(2,16);function UM(t,e){return t+e*Qk}function K0(t){return t&Yk}function VM(t){return(t-(t&Yk))/Qk}const Xk=1,Zk=2,Rl=4,e2=8;class pp{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&e2)>0}get deletedBefore(){return(this.delInfo&(Xk|Rl))>0}get deletedAfter(){return(this.delInfo&(Zk|Rl))>0}get deletedAcross(){return(this.delInfo&Rl)>0}}class wt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&wt.empty)return wt.empty}recover(e){let n=0,r=K0(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(e<=f){let d=c?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:u);if(r)return h;let p=e==(n<0?l:f)?null:UM(a/3,e-l),m=e==l?Zk:e==f?Xk:Rl;return(n<0?e!=l:e!=f)&&(m|=e2),new pp(h,m,p)}i+=u-c}return r?e+i:new pp(e+i,0,null)}touches(e,n){let r=0,i=K0(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new po;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ce.fromReplace(e,this.from,this.to,o)}invert(){return new hn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new sr(n.pos,r.pos,this.mark)}merge(e){return e instanceof sr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new sr(n.from,n.to,e.markFromJSON(n.mark))}}Ze.jsonID("addMark",sr);class hn extends Ze{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new I(ag(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ce.fromReplace(e,this.from,this.to,r)}invert(){return new sr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new hn(n.pos,r.pos,this.mark)}merge(e){return e instanceof hn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hn(n.from,n.to,e.markFromJSON(n.mark))}}Ze.jsonID("removeMark",hn);class ar extends Ze{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ce.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ce.fromReplace(e,this.pos,this.pos+1,new I(N.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new _e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ze.jsonID("replaceAround",_e);function mp(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function WM(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(f);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function KM(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Wu){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new hn(s.from,s.to,s.style)))}function t2(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function JM(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Bo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;p--)m||r.index(p)>0?(m=!0,u=N.from(r.node(p).copy(u)),f++):l--;let d=N.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=N.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new _e(i,o,i,o,new I(r,0,0),n.length,!0))}function XM(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&tP(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&eP(t,s,a,o),t2(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let c=t.mapping.slice(o),u=c.map(a,1),f=c.map(a+s.nodeSize,1);return t.step(new _e(u,f,u+1,f-1,new I(N.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&ZM(t,s,a,o),!1}})}function ZM(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function eP(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` `))}})}function tP(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function nP(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new _e(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new I(N.from(s),0,0),1,!0))}function mo(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function rP(t,e,n=1,r){let i=t.doc.resolve(e),o=N.empty,s=N.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=N.from(i.node(a).copy(o));let u=r&&r[c];s=N.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new De(e,e,new I(o.append(s),n,n),!0))}function zr(t,e){let n=t.resolve(e),r=n.index();return n2(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function n2(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Ku(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&n2(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function iP(t,e,n){let r=new De(e-n,e+n,I.empty,!0);t.step(r)}function oP(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ju(t,e,n=e,r=I.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return i2(i,o,r)?new De(e,n,r):new sP(i,o,r).fit()}function i2(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class sP{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=N.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=N.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new I(o,s,a);return e>-1?new _e(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new De(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ed(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(N.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ed(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new I(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ed(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new I(us(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new I(us(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=v,u.push(o2(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=fs(this.placed,n,N.from(u)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,v=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:c}=this.frontier[a],u=td(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=fs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=fs(this.placed,this.depth,N.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(N.empty,!0);n.childCount&&(this.placed=fs(this.placed,this.frontier.length,n))}}function us(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(us(t.firstChild.content,e-1,n)))}function fs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(fs(t.lastChild.content,e-1,n)))}function ed(t,e){for(let n=0;n1&&(r=r.replaceChild(0,o2(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(N.empty,!0)))),t.copy(r)}function td(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!aP(n,o.content,s)?a:null}function aP(t,e,n){for(let r=n;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=lP(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function s2(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(N.empty,!0))}return t}function uP(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=oP(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new I(N.from(r),0,0))}function fP(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=a2(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function a2(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class go extends Ze{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ce.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ce.fromReplace(e,this.pos,this.pos+1,new I(N.from(i),0,n.isLeaf?0:1))}getMap(){return wt.empty}invert(e){return new go(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new go(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new go(n.pos,n.attr,n.value)}}Ze.jsonID("attr",go);class oa extends Ze{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ce.ok(r)}getMap(){return wt.empty}invert(e){return new oa(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new oa(n.attr,n.value)}}Ze.jsonID("docAttr",oa);let Ao=class extends Error{};Ao=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ao.prototype=Object.create(Error.prototype);Ao.prototype.constructor=Ao;Ao.prototype.name="TransformError";class l2{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new po}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ao(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=I.empty){let i=Ju(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new I(N.from(r),0,0))}delete(e,n){return this.replace(e,n,I.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return cP(this,e,n,r),this}replaceRangeWith(e,n,r){return uP(this,e,n,r),this}deleteRange(e,n){return fP(this,e,n),this}lift(e,n){return qM(this,e,n),this}join(e,n=1){return iP(this,e,n),this}wrap(e,n){return QM(this,e,n),this}setBlockType(e,n=e,r,i=null){return XM(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return nP(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new go(e,n,r)),this}setDocAttribute(e,n){return this.step(new oa(e,n)),this}addNodeMark(e,n){return this.step(new ar(e,n)),this}removeNodeMark(e,n){if(!(n instanceof re)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Po(e,n)),this}split(e,n=1,r){return rP(this,e,n,r),this}addMark(e,n,r){return WM(this,e,n,r),this}removeMark(e,n,r){return KM(this,e,n,r),this}clearIncompatible(e,n,r){return t2(this,e,n,r),this}}const nd=Object.create(null);class q{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new dP(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?$i(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):$i(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Xt(e.node(0))}static atStart(e){return $i(e,e,0,0,1)||new Xt(e)}static atEnd(e){return $i(e,e,e.content.size,e.childCount,-1)||new Xt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=nd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in nd)throw new RangeError("Duplicate use of selection JSON ID "+e);return nd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return U.between(this.$anchor,this.$head).getBookmark()}}q.prototype.visible=!0;class dP{constructor(e,n){this.$from=e,this.$to=n}}let q0=!1;function G0(t){!q0&&!t.parent.inlineContent&&(q0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class U extends q{constructor(e,n=e){G0(e),G0(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=e.resolve(n.map(this.anchor));return new U(i.parent.inlineContent?i:r,r)}replace(e,n=I.empty){if(super.replace(e,n),n==I.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof U&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new qu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new U(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(o)n=o.$head;else return q.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(q.findFrom(e,-r,!0)||q.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&B.isSelectable(a))return B.create(t,n-(i<0?a.nodeSize:0))}else{let l=$i(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function Y0(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=u)}),t.setSelection(q.near(t.doc.resolve(s),n))}const Q0=1,il=2,X0=4;class pP extends l2{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=il,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&il)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~il,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||re.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=X0,this}get scrolledIntoView(){return(this.updated&X0)>0}}function Z0(t,e){return!e||!t?t:t.bind(e)}class ds{constructor(e,n,r){this.name=e,this.init=Z0(n.init,r),this.apply=Z0(n.apply,r)}}const mP=[new ds("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ds("selection",{init(t,e){return t.selection||q.atStart(e.doc)},apply(t){return t.selection}}),new ds("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ds("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class rd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=mP.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ds(r.key,r.spec.state,r))})}}class no{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new rd(e.schema,e.plugins),o=new no(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=li.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=q.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function c2(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=c2(i,e,{})),n[r]=i}return n}class ct{constructor(e){this.spec=e,this.props={},e.props&&c2(e.props,this,this.props),this.key=e.key?e.key.key:u2("plugin")}getState(e){return e[this.key]}}const id=Object.create(null);function u2(t){return t in id?t+"$"+ ++id[t]:(id[t]=0,t+"$")}class tn{constructor(e="key"){this.key=u2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const He=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},sa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let gp=null;const On=function(t,e,n){let r=gp||(gp=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},gP=function(){gp=null},vi=function(t,e,n,r){return n&&(e1(t,e,n,r,-1)||e1(t,e,n,r,1))},yP=/^(img|br|input|textarea|hr)$/i;function e1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:fn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ta(t)||yP.test(t.nodeName)||t.contentEditable=="false")return!1;e=He(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?fn(t):0}else return!1}}function fn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=fn(t)}else if(t.parentNode&&!Ta(t))e=He(t),t=t.parentNode;else return null}}function bP(t,e){for(;;){if(t.nodeType==3&&e2),Rt=Ro||(vn?/Mac/.test(vn.platform):!1),OP=vn?/Win/.test(vn.platform):!1,Kt=/Android \d/.test($r),Na=!!t1&&"webkitFontSmoothing"in t1.documentElement.style,CP=Na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function EP(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function kn(t,e){return typeof t=="number"?t:t[e]}function TP(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function n1(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=sa(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?EP(o):TP(a),u=0,f=0;if(e.topc.bottom-kn(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+kn(i,"top")-c.top:e.bottom-c.bottom+kn(i,"bottom")),e.leftc.right-kn(r,"right")&&(u=e.right-c.right+kn(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let d=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let p=a.scrollLeft-d,m=a.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function NP(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:d2(t.dom)}}function d2(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=sa(r));return e}function MP({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;h2(n,r==0?0:r-e)}function h2(t,e){for(let n=0;n=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?AP(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:p2(n,i)}function AP(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function ug(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function RP(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function IP(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?i=a.posBefore:(l.right-1?i:t.docView.posFromDOM(e,n,-1)}function m2(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;Na&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=IP(t,r,i,e))}a==null&&(a=jP(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function r1(t){return t.top=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,ts(Jn(On(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==fn(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return od(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==fn(r))){let l=r.childNodes[i-1],c=l.nodeType==3?On(l,fn(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ts(Jn(c,1),!1)}if(o==null&&i=0)}function ts(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function od(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function y2(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function _P(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return y2(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=g2(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=On(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const zP=/[\u0590-\u08ac]/;function $P(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!zP.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:y2(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),v=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==m;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),v})}let i1=null,o1=null,s1=!1;function FP(t,e,n){return i1==e&&o1==n?s1:(i1=e,o1=n,s1=n=="up"||n=="down"?_P(t,e,n):$P(t,e,n))}const zt=0,a1=1,Xr=2,bn=3;class Ma{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=zt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nHe(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(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof b2){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof v2&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?He(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=He(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;uh&&sn){let h=a;a=l,l=h}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Xr:a1,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=bn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Xr:bn}r=s}this.dirty=Xr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Xr:a1;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==zt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class BP extends Ma{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class bi extends Ma{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=dn.renderSpec(document,n.type.spec.toDOM(n,r))),new bi(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&bn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=bn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=zt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=wp(o,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=dn.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=w2(u,r,n),c?l=new HP(e,n,r,i,u,f||null,d,c,o,s+1):n.isText?new Yu(e,n,r,i,u,d,o):new Sr(e,n,r,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>N.empty)}return e}matchesNode(e,n,r){return this.dirty==zt&&e.eq(this.node)&&kp(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new VP(this,s&&s.node,e);JP(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?re.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,f,d)=>{l.syncToMarks(c.marks,r,e);let h;l.findNodeMatch(c,u,f,d)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,f,h,e)||l.updateNextNode(c,u,f,e,d,i)||l.addNode(c,u,f,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xr)&&(s&&this.protectLocalComposition(e,s),x2(this.contentDOM,this.children,e),Ro&&qP(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof U)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=GP(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new BP(this,o,n,i);e.input.compositionNodes.push(s),this.children=wp(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==bn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=zt}updateOuterDeco(e){if(kp(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=k2(this.dom,this.nodeDOM,xp(this.outerDeco,this.node,n),xp(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function l1(t,e,n,r,i){w2(r,e,t);let o=new Sr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Yu extends Sr{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==bn||this.dirty!=zt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=zt||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=zt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Yu(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=bn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class b2 extends Ma{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==zt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class HP extends Sr{constructor(e,n,r,i,o,s,a,l,c,u){super(e,n,r,i,o,s,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==bn)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,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 x2(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=bi.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof bi)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function KP(t,e){return t.type.side-e.type.side}function JP(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;co;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let v=p;s!v.inline):a.slice();r(d,m,e.forChild(o,d),h),o=p}}function qP(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function GP(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function wp(t,e,n,r,i){let o=[];for(let s=0,a=0;s=n||u<=e?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function fg(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Gu(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&B.isSelectable(u)&&i.parent&&!(u.isInline&&xP(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new B(s==f?a:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!S2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function QP(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,He(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&yt&&wr<=11&&(r.disabled=!0,r.disabled=!1)}function O2(t,e){if(e instanceof B){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(h1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else h1(t)}function h1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function dg(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||U.between(e,n,r)}function p1(t){return t.editable&&!t.hasFocus()?!1:C2(t)}function C2(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function XP(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sp(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&q.findFrom(o,e)}function Yn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function m1(t,e,n){let r=t.state.selection;if(r instanceof U)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Yn(t,new U(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Sp(t.state,e);return i&&i instanceof B?Yn(t,i):!1}else if(!(Rt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?B.isSelectable(o)?Yn(t,new B(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Na?Yn(t,new U(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof B&&r.node.isInline)return Yn(t,new U(e>0?r.$to:r.$from));{let i=Sp(t.state,e);return i?Yn(t,i):!1}}}function Rc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ns(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ii(t,e){return e<0?ZP(t):e4(t)}function ZP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(en&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ns(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(E2(n))break;{let a=n.previousSibling;for(;a&&Ns(a,-1);)i=n.parentNode,o=He(a),a=a.previousSibling;if(a)n=a,r=Rc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Op(t,n,r):i&&Op(t,i,o)}function e4(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Rc(n),o,s;for(;;)if(r{t.state==i&&Mn(t)},50)}function g1(t,e){let n=t.state.doc.resolve(e);if(!(tt||OP)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function y1(t,e,n){let r=t.state.selection;if(r instanceof U&&!r.empty||n.indexOf("s")>-1||Rt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sp(t.state,e);if(s&&s instanceof B)return Yn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Xt?q.near(s,e):q.findFrom(s,e);return a?Yn(t,a):!1}return!1}function v1(t,e){if(!(t.state.selection instanceof U))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function b1(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function r4(t){if(!rt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;b1(t,r,"true"),setTimeout(()=>b1(t,r,"false"),20)}return!1}function i4(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function o4(t,e){let n=e.keyCode,r=i4(e);if(n==8||Rt&&n==72&&r=="c")return v1(t,-1)||Ii(t,-1);if(n==46&&!e.shiftKey||Rt&&n==68&&r=="c")return v1(t,1)||Ii(t,1);if(n==13||n==27)return!0;if(n==37||Rt&&n==66&&r=="c"){let i=n==37?g1(t,t.state.selection.from)=="ltr"?-1:1:-1;return m1(t,i,r)||Ii(t,i)}else if(n==39||Rt&&n==70&&r=="c"){let i=n==39?g1(t,t.state.selection.from)=="ltr"?1:-1:1;return m1(t,i,r)||Ii(t,i)}else{if(n==38||Rt&&n==80&&r=="c")return y1(t,-1,r)||Ii(t,-1);if(n==40||Rt&&n==78&&r=="c")return r4(t)||y1(t,1,r)||Ii(t,1);if(r==(Rt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function T2(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||dn.fromSchema(t.state.schema),a=j2(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=R2[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:d,slice:e}}function N2(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return e?new I(N.from(t.state.schema.text(e.replace(/\r\n?/g,` `))),0,0):I.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=dn.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let v=s.appendChild(document.createElement("p"));m&&v.appendChild(p.serializeNode(h.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=l4(n),Na&&c4(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Mo.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!s4.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=u4(x1(a,+u[1],+u[2]),u[4]);else if(a=I.maxOpen(a4(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f{a=f(a,t)}),a}const s4=/^(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 a4(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&P2(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=A2(s[s.length-1],o.length));let u=M2(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return N.from(s)}return t}function M2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,N.from(t));return t}function P2(t,e,n,r,i){if(i1&&(o=0),i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(N.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function x1(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=j2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&R2[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=N.from(l.create(r[a+1],i)),o++,s++}return new I(i,o,s)}const it={},ot={},f4={touchstart:!0,touchmove:!0};class d4{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.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 h4(t){for(let e in it){let n=it[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{m4(t,r)&&!hg(t,r)&&(t.editable||!(r.type in ot))&&n(t,r)},f4[e]?{passive:!0}:void 0)}rt&&t.dom.addEventListener("input",()=>null),Ep(t)}function lr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function p4(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ep(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>hg(t,r))})}function hg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function m4(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function g4(t,e){!hg(t,e)&&it[e.type]&&(t.editable||!(e.type in ot))&&it[e.type](t,e)}ot.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!D2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Kt&&tt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ro&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Jr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||o4(t,n)?n.preventDefault():lr(t,"key")};ot.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ot.keypress=(t,e)=>{let n=e;if(D2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Rt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof U)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Qu(t){return{left:t.clientX,top:t.clientY}}function y4(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function pg(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function yo(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function v4(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&B.isSelectable(r)?(yo(t,new B(n),"pointer"),!0):!1}function b4(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof B&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(B.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(yo(t,B.create(t.state.doc,i),"pointer"),!0):!1}function x4(t,e,n,r,i){return pg(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?b4(t,n):v4(t,n))}function k4(t,e,n,r){return pg(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function w4(t,e,n,r){return pg(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||S4(t,n,r)}function S4(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(yo(t,U.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)yo(t,U.create(r,a+1,a+1+s.content.size),"pointer");else if(B.isSelectable(s))yo(t,B.create(r,a),"pointer");else continue;return!0}}function mg(t){return jc(t)}const I2=Rt?"metaKey":"ctrlKey";it.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=mg(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&y4(n,t.input.lastClick)&&!n[I2]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Qu(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new O4(t,s,n,!!r)):(o=="doubleClick"?k4:w4)(t,s.pos,s.inside,n)?n.preventDefault():lr(t,"pointer"))};class O4{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[I2],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof B&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&en&&!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)),lr(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(()=>Mn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Qu(e))),this.updateAllowDefault(e),this.allowDefault||!n?lr(this.view,"pointer"):x4(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||rt&&this.mightDrag&&!this.mightDrag.node.isAtom||tt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(yo(this.view,q.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):lr(this.view,"pointer")}move(e){this.updateAllowDefault(e),lr(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)}}it.touchstart=t=>{t.input.lastTouch=Date.now(),mg(t),lr(t,"pointer")};it.touchmove=t=>{t.input.lastTouch=Date.now(),lr(t,"pointer")};it.contextmenu=t=>mg(t);function D2(t,e){return t.composing?!0:rt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const C4=Kt?5e3:-1;ot.compositionstart=ot.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),jc(t,!0),t.markCursor=null;else if(jc(t),en&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}L2(t,C4)};ot.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,L2(t,20))};function L2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>jc(t),e))}function _2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=T4());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function E4(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=vP(e.focusNode,e.focusOffset),r=bP(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function T4(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function jc(t,e=!1){if(!(Kt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_2(t),e||t.docView&&t.docView.dirty){let n=fg(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function N4(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const aa=yt&&wr<15||Ro&&CP<604;it.copy=ot.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=aa?null:n.clipboardData,s=r.content(),{dom:a,text:l}=T2(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):N4(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function M4(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function P4(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?la(t,r.value,null,i,e):la(t,r.textContent,r.innerHTML,i,e)},50)}function la(t,e,n,r,i){let o=N2(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||I.empty)))return!0;if(!o)return!1;let s=M4(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function z2(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ot.paste=(t,e)=>{let n=e;if(t.composing&&!Kt)return;let r=aa?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&la(t,z2(r),r.getData("text/html"),i,n)?n.preventDefault():P4(t,n)};class $2{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const F2=Rt?"altKey":"ctrlKey";it.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Qu(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof B?i.to-1:i.to))){if(r&&r.mightDrag)s=B.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=B.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=T2(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(aa?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",aa||n.dataTransfer.setData("text/plain",c),t.dragging=new $2(u,!n[F2],s)};it.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ot.dragover=ot.dragenter=(t,e)=>e.preventDefault();ot.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Qu(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=N2(t,z2(n.dataTransfer),aa?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[F2]);if(t.someProp("handleDrop",p=>p(t,n,s||I.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?r2(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let h=c.doc.resolve(u);if(f&&B.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new B(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,v,g,y)=>p=y),c.setSelection(dg(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};it.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Mn(t)},20))};it.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};it.beforeinput=(t,e)=>{if(tt&&Kt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Jr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ot)it[t]=ot[t];function ca(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ic{constructor(e,n){this.toDOM=e,this.spec=n||ci,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Lt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ic&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ca(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Or{constructor(e,n){this.attrs=e,this.spec=n||ci}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Lt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ye||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ci)}mapInner(e,n,r,i,o){let s;for(let a=0;a{let c=l+r,u;if(u=H2(n,a,c)){for(i||(i=this.children.slice());oa&&f.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof Or){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;ci.map(e,n,ci));return tr.from(r)}forChild(e,n){if(n.isLeaf)return Me.empty;let r=[];for(let i=0;in instanceof Me)?e:e.reduce((n,r)=>n.concat(r instanceof Me?r:r.members),[]))}}}function A4(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,u=o;c{let v=m-p-(h-d);for(let g=0;gy+u-f)continue;let k=a[g]+u-f;h>=k?a[g+1]=d<=k?-2:-1:d>=u&&v&&(a[g]+=v,a[g+1]+=v)}f+=v}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let d=n.map(t[c+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),v=r.maybeChild(p);if(v&&m==f&&m+v.nodeSize==h){let g=a[c+2].mapInner(n,v,u+1,t[c]+o+1,s);g!=Ye?(a[c]=f,a[c+1]=h,a[c+2]=g):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=R4(a,t,e,n,i,o,s),u=Dc(c,r,0,s);e=u.local;for(let f=0;fn&&s.to{let c=H2(t,a,l+n);if(c){o=!0;let u=Dc(c,a,n+l+1,r);u!=Ye&&i.push(l,l+a.nodeSize,u)}});let s=B2(o?U2(t):t,-n).sort(ui);for(let a=0;a0;)e++;t.splice(e,0,n)}function ad(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ye&&e.push(r)}),t.cursorWrapper&&e.push(Me.create(t.state.doc,[t.cursorWrapper.deco])),tr.from(e)}const j4={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},I4=yt&&wr<=11;class D4{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 L4{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new D4,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),I4&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,j4)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.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(p1(this.view)){if(this.suppressingSelectionUpdates)return Mn(this.view);if(yt&&wr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=sa(o))n.add(o);for(let o=e.anchorNode;o;o=sa(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&p1(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u1){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let f=u[0],d=u[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),_4(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Mn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;v--){let g=r.childNodes[v-1],y=g.pmViewDesc;if(g.nodeName=="BR"&&!y){o=v;break}if(!y||y.size)break}let f=t.state.doc,d=t.someProp("domParser")||Mo.fromSchema(t.state.schema),h=f.resolve(s),p=null,m=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:F4,context:h});if(c&&c[0].pos!=null){let v=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=v),p={anchor:v+s,head:g+s}}return{doc:m,sel:p,from:s,to:a}}function F4(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(rt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||rt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const B4=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function H4(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let L=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,H=fg(t,L);if(H&&!t.state.selection.eq(H)){if(tt&&Kt&&t.input.lastKeyCode===13&&Date.now()-100Je(t,Jr(13,"Enter"))))return;let pe=t.state.tr.setSelection(H);L=="pointer"?pe.setMeta("pointer",!0):L=="key"&&pe.scrollIntoView(),o&&pe.setMeta("composition",o),t.dispatch(pe)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=$4(t,e,n),u=t.state.doc,f=u.slice(c.from,c.to),d,h;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Kt)&&i.some(L=>L.nodeType==1&&!B4.test(L.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",L=>L(t,Jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof U&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let L=E1(t,t.state.doc,c.sel);if(L&&!L.eq(t.state.selection)){let H=t.state.tr.setSelection(L);o&&H.setMeta("composition",o),t.dispatch(H)}}return}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),yt&&wr<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),v=c.doc.resolveNoCache(p.endB-c.from),g=u.resolve(p.start),y=m.sameParent(v)&&m.parent.inlineContent&&g.end()>=p.endA,k;if((Ro&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(L=>L.nodeName=="DIV"||L.nodeName=="P"))||!y&&m.posL(t,Jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&V4(u,p.start,p.endA,m,v)&&t.someProp("handleKeyDown",L=>L(t,Jr(8,"Backspace")))){Kt&&tt&&t.domObserver.suppressSelectionUpdates();return}tt&&Kt&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),Kt&&!y&&m.start()!=v.start()&&v.parentOffset==0&&m.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,v=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(L){return L(t,Jr(13,"Enter"))})},20));let w=p.start,O=p.endA,C,T,j;if(y){if(m.pos==v.pos)yt&&wr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Mn(t),20)),C=t.state.tr.delete(w,O),T=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(j=U4(m.parent.content.cut(m.parentOffset,v.parentOffset),g.parent.content.cut(g.parentOffset,p.endA-g.start()))))C=t.state.tr,j.type=="add"?C.addMark(w,O,j.mark):C.removeMark(w,O,j.mark);else if(m.parent.child(m.index()).isText&&m.index()==v.index()-(v.textOffset?0:1)){let L=m.parent.textBetween(m.parentOffset,v.parentOffset);if(t.someProp("handleTextInput",H=>H(t,w,O,L)))return;C=t.state.tr.insertText(L,w,O)}}if(C||(C=t.state.tr.replace(w,O,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let L=E1(t,C.doc,c.sel);L&&!(tt&&Kt&&t.composing&&L.empty&&(p.start!=p.endB||t.input.lastAndroidDeletee.content.size?null:dg(t,e.resolve(n.anchor),e.resolve(n.head))}function U4(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||ld(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function W4(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s=s?o-r:0;o-=l,o&&o=a?o-r:0;o-=l,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}class K4{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new d4,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(R1),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=P1(this),M1(this),this.nodeViews=A1(this),this.docView=l1(this.state.doc,N1(this),ad(this),this.dom,this),this.domObserver=new L4(this,(r,i,o,s)=>H4(this,r,i,o,s)),this.domObserver.start(),h4(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ep(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(R1),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(_2(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=A1(this);q4(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ep(this),this.editable=P1(this),M1(this);let l=ad(this),c=N1(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&NP(this);if(s){this.domObserver.stop();let h=f&&(yt||tt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&J4(i.selection,e.selection);if(f){let p=tt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=E4(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=l1(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&XP(this))?Mn(this,h):(O2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&MP(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof B){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&n1(this,n.getBoundingClientRect(),e)}else n1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new $2(e.slice,e.move,i<0?void 0:B.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return DP(this,e)}coordsAtPos(e,n=1){return g2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return FP(this,n||this.state,e)}pasteHTML(e,n){return la(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return la(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(p4(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ad(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return g4(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return rt&&this.root.nodeType===11&&kP(this.dom.ownerDocument)==this.dom&&z4(this,e)||e}domSelection(){return this.root.getSelection()}}function N1(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Lt.node(0,t.state.doc.content.size,e)]}function M1(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Lt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function P1(t){return!t.someProp("editable",e=>e(t.state)===!1)}function J4(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function A1(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function q4(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function R1(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Tr={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:"'"},Lc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},G4=typeof navigator<"u"&&/Mac/.test(navigator.platform),Y4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ue=0;Ue<10;Ue++)Tr[48+Ue]=Tr[96+Ue]=String(Ue);for(var Ue=1;Ue<=24;Ue++)Tr[Ue+111]="F"+Ue;for(var Ue=65;Ue<=90;Ue++)Tr[Ue]=String.fromCharCode(Ue+32),Lc[Ue]=String.fromCharCode(Ue);for(var cd in Tr)Lc.hasOwnProperty(cd)||(Lc[cd]=Tr[cd]);function Q4(t){var e=G4&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Y4&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Lc:Tr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const X4=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Z4(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a127)&&(o=Tr[r.keyCode])&&o!=i){let a=e[ud(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const nA=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function W2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const rA=(t,e,n)=>{let r=W2(t,n);if(!r)return!1;let i=vg(r);if(!i){let s=r.blockRange(),a=s&&Bo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&G2(t,i,e))return!0;if(r.parent.content.size==0&&(jo(o,"end")||B.isSelectable(o))){let s=Ju(t.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let r=W2(t,n);if(!r)return!1;let i=vg(r);return i?K2(t,i,e):!1},oA=(t,e,n)=>{let r=J2(t,n);if(!r)return!1;let i=bg(r);return i?K2(t,i,e):!1};function K2(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Ju(t.doc,o,l,I.empty);if(!c||c.from!=o||c instanceof De&&c.slice.size>=l-o)return!1;if(n){let u=t.tr.step(c);u.setSelection(U.create(u.doc,o)),n(u.scrollIntoView())}return!0}function jo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const sA=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=vg(r)}let s=o&&o.nodeBefore;return!s||!B.isSelectable(s)?!1:(e&&e(t.tr.setSelection(B.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function vg(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function J2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=J2(t,n);if(!r)return!1;let i=bg(r);if(!i)return!1;let o=i.nodeAfter;if(G2(t,i,e))return!0;if(r.parent.content.size==0&&(jo(o,"start")||B.isSelectable(o))){let s=Ju(t.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof B,i;if(r){if(n.node.isTextblock||!zr(t.doc,n.from))return!1;i=n.from}else if(i=Ku(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(B.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},uA=(t,e)=>{let n=t.selection,r;if(n instanceof B){if(n.node.isTextblock||!zr(t.doc,n.to))return!1;r=n.to}else if(r=Ku(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},fA=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Bo(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},dA=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` `).scrollIntoView()),!0)};function q2(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=q2(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(q.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},pA=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Xt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=q2(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(mo(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Bo(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},gA=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(B.create(t.doc,i))),!0)};function yA(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||zr(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function G2(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(yA(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=N.empty;for(let m=o.length-1;m>=0;m--)d=N.from(o[m].create(null,d));d=N.from(r.copy(d));let h=t.tr.step(new _e(e.pos-1,f,e.pos,f,new I(d,1,0),o.length,!0)),p=f+2*o.length;zr(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=q.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Bo(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&jo(i,"start",!0)&&jo(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=N.empty;for(let g=d.length-1;g>=0;g--)m=N.from(d[g].copy(m));let v=t.tr.step(new _e(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new I(m,d.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function Y2(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(U.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const vA=Y2(-1),bA=Y2(1);function xA(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&lg(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function j1(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Nc(u,u,s.depth),s.endIndex=0;u--)o=N.from(n[u].type.create(n[u].attrs,o));t.step(new _e(e.start-(r?2:0),e.end,e.start,e.end,new I(o,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?OA(e,n,t,o):CA(e,n,o):!0:!1}}function OA(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?N.empty:N.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new _e(f-(a?1:0),d+(l?1:0),f+1,d-1,new I((a?N.empty:N.from(i.copy(N.empty))).append(l?N.empty:N.from(i.copy(N.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function EA(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=N.from(c?t.create():null),f=new I(N.from(t.create(null,N.from(a.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;n(e.tr.step(new _e(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function Xu(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;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 o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Zu{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const v=this.buildProps(c,n),g=h(...m)(v);return a.push(g),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Xu({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class TA{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function $(t,e,n){return t.config[e]===void 0&&t.parent?$(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?$(t.parent,e,n):null}):t.config[e]}function ef(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Q2(t){const e=[],{nodeExtensions:n,markExtensions:r}=ef(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=$(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=$(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:s.name,name:u,attribute:d})})}),e}function $e(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function fe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Tp(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>fe(n,r),{})}function X2(t){return typeof t=="function"}function J(t,e=void 0,...n){return X2(t)?e?t.bind(e)(...n):t(...n):t}function NA(t={}){return Object.keys(t).length===0&&t.constructor===Object}function MA(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function I1(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):MA(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function D1(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&NA(n)?!1:n!=null))}function PA(t,e){var n;const r=Q2(t),{nodeExtensions:i,markExtensions:o}=ef(t),s=(n=i.find(c=>$(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((g,y)=>{const k=$(y,"extendNodeSchema",f);return{...g,...k?k(c):{}}},{}),h=D1({...d,content:J($(c,"content",f)),marks:J($(c,"marks",f)),group:J($(c,"group",f)),inline:J($(c,"inline",f)),atom:J($(c,"atom",f)),selectable:J($(c,"selectable",f)),draggable:J($(c,"draggable",f)),code:J($(c,"code",f)),defining:J($(c,"defining",f)),isolating:J($(c,"isolating",f)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),p=J($(c,"parseHTML",f));p&&(h.parseDOM=p.map(g=>I1(g,u)));const m=$(c,"renderHTML",f);m&&(h.toDOM=g=>m({node:g,HTMLAttributes:Tp(g,u)}));const v=$(c,"renderText",f);return v&&(h.toText=v),[c.name,h]})),l=Object.fromEntries(o.map(c=>{const u=r.filter(v=>v.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((v,g)=>{const y=$(g,"extendMarkSchema",f);return{...v,...y?y(c):{}}},{}),h=D1({...d,inclusive:J($(c,"inclusive",f)),excludes:J($(c,"excludes",f)),group:J($(c,"group",f)),spanning:J($(c,"spanning",f)),code:J($(c,"code",f)),attrs:Object.fromEntries(u.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))}),p=J($(c,"parseHTML",f));p&&(h.parseDOM=p.map(v=>I1(v,u)));const m=$(c,"renderHTML",f);return m&&(h.toDOM=v=>m({mark:v,HTMLAttributes:Tp(v,u)})),[c.name,h]}));return new IM({topNode:s,nodes:a,marks:l})}function fd(t,e){return e.nodes[t]||e.marks[t]||null}function L1(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const AA=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function xg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class tf{constructor(e){this.find=e.find,this.handler=e.handler}}const RA=(t,e)=>{if(xg(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function ol(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1;const f=AA(c)+o;return s.forEach(d=>{if(u)return;const h=RA(f,d.find);if(!h)return;const p=l.state.tr,m=Xu({state:l.state,transaction:p}),v={from:r-(h[0].length-o.length),to:i},{commands:g,chain:y,can:k}=new Zu({editor:n,state:m});d.handler({state:m,range:v,match:h,commands:g,chain:y,can:k})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:o}),l.dispatch(p),u=!0)}),u}function jA(t){const{editor:e,rules:n}=t,r=new ct({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:c,text:u}=a,f=c+u.length;ol({editor:e,from:c,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return ol({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&ol({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?ol({editor:e,from:s.pos,to:s.pos,text:` `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function IA(t){return typeof t=="number"}class DA{constructor(e){this.find=e.find,this.handler=e.handler}}const LA=(t,e,n)=>{if(xg(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function _A(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Zu({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(r,p),v=Math.min(i,p+h.content.size),g=h.textBetween(m-p,v-p,void 0,"");LA(g,o.find,s).forEach(k=>{if(k.index===void 0)return;const w=m+k.index+1,O=w+k[0].length,C={from:n.tr.mapping.map(w),to:n.tr.mapping.map(O)},T=o.handler({state:n,range:C,match:k,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});f.push(T)})}),f.every(h=>h!==null)}const zA=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function $A(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:f,to:d,rule:h,pasteEvt:p})=>{const m=u.tr,v=Xu({state:u,transaction:m});if(!(!_A({editor:e,state:v,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!m.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(u=>new ct({view(f){const d=h=>{var p;r=!((p=f.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(f,d)=>(o=r===f.dom.parentElement,a=d,!1),paste:(f,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,v=p.getMeta("uiEvent")==="drop"&&!o,g=p.getMeta("applyPasteRules"),y=!!g;if(!m&&!v&&!y)return;if(y){const{from:O,text:C}=g,T=O+C.length,j=zA(C);return l({rule:u,state:h,from:O,to:{b:T},pasteEvt:j})}const k=d.doc.content.findDiffStart(h.doc.content),w=d.doc.content.findDiffEnd(h.doc.content);if(!(!IA(k)||!w||k===w.b))return l({rule:u,state:h,from:k,to:w,pasteEvt:s})}}))}function FA(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class ro{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ro.resolve(e),this.schema=PA(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:fd(r.name,this.schema)};r.type==="mark"&&(!((i=J($(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=$(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const a=$(r,"onCreate",o);a&&this.editor.on("create",a);const l=$(r,"onUpdate",o);l&&this.editor.on("update",l);const c=$(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const u=$(r,"onTransaction",o);u&&this.editor.on("transaction",u);const f=$(r,"onFocus",o);f&&this.editor.on("focus",f);const d=$(r,"onBlur",o);d&&this.editor.on("blur",d);const h=$(r,"onDestroy",o);h&&this.editor.on("destroy",h)})}static resolve(e){const n=ro.sort(ro.flatten(e)),r=FA(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=$(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=$(r,"priority")||100,s=$(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:fd(n.name,this.schema)},i=$(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=ro.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:fd(s.name,this.schema)},l=[],c=$(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>vt.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([v,g])=>[v,()=>g({editor:e})]));u={...u,...m}}const f=tA(u);l.push(f);const d=$(s,"addInputRules",a);L1(s,e.options.enableInputRules)&&d&&r.push(...d());const h=$(s,"addPasteRules",a);L1(s,e.options.enablePasteRules)&&h&&i.push(...h());const p=$(s,"addProseMirrorPlugins",a);if(p){const m=p();l.push(...m)}return l}).flat();return[jA({editor:e,rules:r}),...$A({editor:e,rules:i}),...o]}get attributes(){return Q2(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=ef(this.extensions);return Object.fromEntries(n.filter(r=>!!$(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:$e(r.name,this.schema)},s=$(r,"addNodeView",o);if(!s)return[];const a=(l,c,u,f)=>{const d=Tp(l,i);return s()({editor:e,node:l,getPos:u,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,a]}))}}function BA(t){return Object.prototype.toString.call(t).slice(8,-1)}function dd(t){return BA(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function nf(t,e){const n={...t};return dd(t)&&dd(e)&&Object.keys(e).forEach(r=>{dd(e[r])?r in t?n[r]=nf(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class st{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=J($(this,"addOptions",{name:this.name}))),this.storage=J($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new st(e)}configure(e={}){const n=this.extend();return n.options=nf(this.options,e),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new st({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=J($(n,"addOptions",{name:n.name})),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}}function Z2(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` `,textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,i,(c,u,f,d)=>{var h;const p=s==null?void 0:s[c.type.name];if(p)return c.isBlock&&!l&&(a+=o,l=!0),f&&(a+=p({node:c,pos:u,parent:f,index:d,range:e})),!1;c.isText?(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),l=!1):c.isBlock&&!l&&(a+=o,l=!0)}),a}function ew(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const HA=st.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new tn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=ew(n);return Z2(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),UA=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),VA=(t=!1)=>({commands:e})=>e.setContent("",t),WA=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),d=c.resolve(u.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Bo(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},KA=t=>e=>t(e),JA=()=>({state:t,dispatch:e})=>pA(t,e),qA=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new U(r.doc.resolve(s-1))),!0},GA=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},YA=t=>({tr:e,state:n,dispatch:r})=>{const i=$e(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},QA=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},XA=()=>({state:t,dispatch:e})=>nA(t,e),ZA=()=>({commands:t})=>t.keyboardShortcut("Enter"),eR=()=>({state:t,dispatch:e})=>hA(t,e);function _c(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:xg(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Np(t,e,n={}){return t.find(r=>r.type===e&&_c(r.attrs,n))}function tR(t,e,n={}){return!!Np(t,e,n)}function kg(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=Np([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Np([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Fr(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const f=kg(l,o,e);if(f&&f.from<=c&&f.to>=u){const d=U.create(s,f.from,f.to);n.setSelection(d)}}return!0},rR=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{rf()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!tw(n.state.selection))return s(),!0;const a=nw(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},oR=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),sR=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),rw=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&rw(r)}return t};function _1(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return rw(n)}function zc(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?N.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),zc("",e,n)}if(typeof t=="string"){const r=Mo.fromSchema(e);return n.slice?r.parseSlice(_1(t),n.parseOptions).content:r.parse(_1(t),n.parseOptions)}return zc("",e,n)}function aR(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=u)}),t.setSelection(q.near(t.doc.resolve(s),n))}const lR=t=>t.toString().startsWith("<"),cR=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const s=zc(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,u=!0;if((lR(s)?s:[s]).forEach(h=>{h.check(),c=c?h.isText&&h.marks.length===0:!1,u=u?h.isBlock:!1}),a===l&&u){const{parent:h}=r.doc.resolve(a);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(a-=1,l+=1)}let d;c?(Array.isArray(e)?d=e.map(h=>h.text||"").join(""):typeof e=="object"&&e&&e.text?d=e.text:d=e,r.insertText(d,a,l)):(d=s,r.replaceWith(a,l,d)),n.updateSelection&&aR(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:d}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:d})}return!0},uR=()=>({state:t,dispatch:e})=>cA(t,e),fR=()=>({state:t,dispatch:e})=>uA(t,e),dR=()=>({state:t,dispatch:e})=>rA(t,e),hR=()=>({state:t,dispatch:e})=>aA(t,e),pR=()=>({tr:t,state:e,dispatch:n})=>{try{const r=Ku(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},mR=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ku(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},gR=()=>({state:t,dispatch:e})=>iA(t,e),yR=()=>({state:t,dispatch:e})=>oA(t,e);function wg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vR(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=vR(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ua(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?$e(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>_c(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=l}const xR=(t,e={})=>({state:n,dispatch:r})=>{const i=$e(t,n.schema);return ua(n,i,e)?fA(n,r):!1},kR=()=>({state:t,dispatch:e})=>mA(t,e),wR=t=>({state:e,dispatch:n})=>{const r=$e(t,e.schema);return SA(r)(e,n)},SR=()=>({state:t,dispatch:e})=>dA(t,e);function of(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function z1(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const OR=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=of(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=$e(t,r.schema)),a==="mark"&&(s=Fr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,z1(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&n.addMark(u,u+c.nodeSize,s.create(z1(f.attrs,e)))})})}),!0):!1},CR=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),ER=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),TR=()=>({state:t,dispatch:e})=>sA(t,e),NR=()=>({state:t,dispatch:e})=>lA(t,e),MR=()=>({state:t,dispatch:e})=>gA(t,e),PR=()=>({state:t,dispatch:e})=>bA(t,e),AR=()=>({state:t,dispatch:e})=>vA(t,e);function iw(t,e,n={}){return zc(t,e,{slice:!1,parseOptions:n})}const RR=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=iw(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function Pa(t,e){const n=Fr(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function jR(t,e){const n=new l2(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function IR(t){for(let e=0;e{n(i)&&r.push({node:i,pos:o})}),r}function LR(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Sg(t){return e=>LR(e.$from,t)}function _R(t,e){const n=dn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function zR(t,e){const n={from:0,to:t.content.size};return Z2(t,n,e)}function $R(t,e){const n=$e(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function ow(t,e){const n=of(typeof e=="string"?e:e.name,t.schema);return n==="node"?$R(t,e):n==="mark"?Pa(t,e):{}}function FR(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function BR(t){const e=FR(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function HR(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(o).map(a,-1),u=e.slice(o).map(l),f=e.invert().map(c,-1),d=e.invert().map(u);r.push({oldRange:{from:f,to:d},newRange:{from:c,to:u}})})}),BR(r)}function Og(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=kg(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function jl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Mp(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Fr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>_c(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,v)=>{if(!m.isText&&!m.marks.length)return;const g=Math.max(h,v),y=Math.min(p,v+m.nodeSize),k=y-g;s+=k,a.push(...m.marks.map(w=>({mark:w,from:g,to:y})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>_c(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+c:l)>=s}function UR(t,e,n={}){if(!e)return ua(t,null,n)||Mp(t,null,n);const r=of(e,t.schema);return r==="node"?ua(t,e,n):r==="mark"?Mp(t,e,n):!1}function $1(t,e){const{nodeExtensions:n}=ef(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=J($(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function VR(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function WR(t,e,n){var r;const{selection:i}=e;let o=null;if(tw(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=h&&p}return!c}),c})}const KR=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Fr(t,r.schema);if(i)if(s){const c=Pa(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(d,h)=>{const p=Math.max(h,u),m=Math.min(h+d.nodeSize,f);d.marks.find(g=>g.type===l)?d.marks.forEach(g=>{l===g.type&&n.addMark(p,m,l.create({...g.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return WR(r,n,l)},JR=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),qR=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=$e(t,n.schema);return o.isTextblock?i().command(({commands:s})=>j1(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>j1(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},GR=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ei(t,0,r.content.size),o=B.create(r,i);e.setSelection(o)}return!0},YR=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=U.atStart(r).from,a=U.atEnd(r).to,l=ei(i,s,a),c=ei(o,s,a),u=U.create(r,l,c);e.setSelection(u)}return!0},QR=t=>({state:e,dispatch:n})=>{const r=$e(t,e.schema);return EA(r)(e,n)};function F1(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const XR=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=jl(c,a.node().type.name,a.node().attrs);if(o instanceof B&&o.node.isBlock)return!a.parentOffset||!mo(s,a.pos)?!1:(r&&(t&&F1(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof U&&e.deleteSelection();const d=a.depth===0?void 0:IR(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:u}]:void 0,p=mo(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&mo(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:u}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),v=e.doc.resolve(m);a.node(-1).canReplaceWith(v.index(),v.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&F1(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},ZR=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=$e(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let v=N.empty;const g=a.index(-1)?1:a.index(-2)?2:3;for(let T=a.depth-g;T>=a.depth-3;T-=1)v=N.from(a.node(T).copy(v));const y=a.indexAfter(-1){if(C>-1)return!1;T.isTextblock&&T.content.size===0&&(C=j+1)}),C>-1&&e.setSelection(U.near(e.doc.resolve(C))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=jl(f,u.type.name,u.attrs),p=jl(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!mo(e.doc,a.pos,2))return!1;if(r){const{selection:v,storedMarks:g}=n,{splittableMarks:y}=i.extensionManager,k=g||v.$to.parentOffset&&v.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!k||!r)return!0;const w=k.filter(O=>y.includes(O.type.name));e.ensureMarks(w)}return!0},hd=(t,e)=>{const n=Sg(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&zr(t.doc,n.pos)&&t.join(n.pos),!0},pd=(t,e)=>{const n=Sg(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&zr(t.doc,r)&&t.join(r),!0},ej=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=$e(t,s.schema),p=$e(e,s.schema),{selection:m,storedMarks:v}=s,{$from:g,$to:y}=m,k=g.blockRange(y),w=v||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const O=Sg(C=>$1(C.type.name,f))(m);if(k.depth>=1&&O&&k.depth-O.depth<=1){if(O.node.type===h)return c.liftListItem(p);if($1(O.node.type.name,f)&&h.validContent(O.node.content)&&a)return l().command(()=>(o.setNodeMarkup(O.pos,h),!0)).command(()=>hd(o,h)).command(()=>pd(o,h)).run()}return!n||!w||!a?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>hd(o,h)).command(()=>pd(o,h)).run():l().command(()=>{const C=u().wrapInList(h,r),T=w.filter(j=>d.includes(j.type.name));return o.ensureMarks(T),C?!0:c.clearNodes()}).wrapInList(h,r).command(()=>hd(o,h)).command(()=>pd(o,h)).run()},tj=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Fr(t,r.schema);return Mp(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},nj=(t,e,n={})=>({state:r,commands:i})=>{const o=$e(t,r.schema),s=$e(e,r.schema);return ua(r,o,n)?i.setNode(s):i.setNode(o,n)},rj=(t,e={})=>({state:n,commands:r})=>{const i=$e(t,n.schema);return ua(n,i,e)?r.lift(i):r.wrapIn(i,e)},ij=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},oj=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},sj=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Fr(t,r.schema),{$from:c,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:d,to:h}=a;const p=(o=c.marks().find(v=>v.type===l))===null||o===void 0?void 0:o.attrs,m=kg(c,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},aj=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=of(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=$e(t,r.schema)),a==="mark"&&(s=Fr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,c),m=Math.min(d+f.nodeSize,u);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},lj=(t,e={})=>({state:n,dispatch:r})=>{const i=$e(t,n.schema);return xA(i,e)(n,r)},cj=(t,e={})=>({state:n,dispatch:r})=>{const i=$e(t,n.schema);return kA(i,e)(n,r)};var uj=Object.freeze({__proto__:null,blur:UA,clearContent:VA,clearNodes:WA,command:KA,createParagraphNear:JA,cut:qA,deleteCurrentNode:GA,deleteNode:YA,deleteRange:QA,deleteSelection:XA,enter:ZA,exitCode:eR,extendMarkRange:nR,first:rR,focus:iR,forEach:oR,insertContent:sR,insertContentAt:cR,joinUp:uR,joinDown:fR,joinBackward:dR,joinForward:hR,joinItemBackward:pR,joinItemForward:mR,joinTextblockBackward:gR,joinTextblockForward:yR,keyboardShortcut:bR,lift:xR,liftEmptyBlock:kR,liftListItem:wR,newlineInCode:SR,resetAttributes:OR,scrollIntoView:CR,selectAll:ER,selectNodeBackward:TR,selectNodeForward:NR,selectParentNode:MR,selectTextblockEnd:PR,selectTextblockStart:AR,setContent:RR,setMark:KR,setMeta:JR,setNode:qR,setNodeSelection:GR,setTextSelection:YR,sinkListItem:QR,splitBlock:XR,splitListItem:ZR,toggleList:ej,toggleMark:tj,toggleNode:nj,toggleWrap:rj,undoInputRule:ij,unsetAllMarks:oj,unsetMark:sj,updateAttributes:aj,wrapIn:lj,wrapInList:cj});const fj=st.create({name:"commands",addCommands(){return{...uj}}}),dj=st.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new tn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),hj=st.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ct({key:new tn("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),pj=st.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,v=f.pos-f.parentOffset,g=m&&p.parent.childCount===1?v===f.pos:q.atStart(c).from===d;return!u||!g||!h.type.isTextblock||h.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return rf()||wg()?o:i},addProseMirrorPlugins(){return[new ct({key:new tn("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=q.atStart(e.doc).from,l=q.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=Xu({state:n,transaction:f}),{commands:h}=new Zu({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),mj=st.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new tn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class qr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,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!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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),n=this.resolvedPos.doc.resolve(e);return new qr(n,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 qr(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 qr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new qr(s,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new qr(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const gj=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function yj(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let vj=class extends TA{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=yj(gj,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=X2(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[dj,HA.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),fj,hj,pj,mj]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new ro(i,this)}createCommandManager(){this.commandManager=new Zu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=iw(this.options.content,this.schema,this.options.parseOptions),n=nw(e,this.options.autofocus);this.view=new K4(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:no.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ow(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return UR(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return _R(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` `,textSerializers:r={}}=e||{};return zR(this.state.doc,{blockSeparator:n,textSerializers:{...ew(this.schema),...r}})}get isEmpty(){return VR(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new qr(n,this)}get $doc(){return this.$pos(0)}};function xi(t){return new tf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=J(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(Og(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;un.from&&o.delete(n.from+l,c);const d=n.from+l+s.length;o.addMark(n.from+l,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function sw(t){return new tf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=J(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,l)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));o.scrollIntoView()}})}function Pp(t){return new tf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=J(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function fa(t){return new tf({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=J(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&lg(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:h}=t.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){const m=p.filter(v=>h.includes(v.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&zr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class vt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=J($(this,"addOptions",{name:this.name}))),this.storage=J($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new vt(e)}configure(e={}){const n=this.extend();return n.options=nf(this.options,e),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new vt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=J($(n,"addOptions",{name:n.name})),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let xt=class Ap{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=J($(this,"addOptions",{name:this.name}))),this.storage=J($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ap(e)}configure(e={}){const n=this.extend();return n.options=nf(this.options,e),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Ap({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=J($(n,"addOptions",{name:n.name})),n.storage=J($(n,"addStorage",{name:n.name,options:n.options})),n}};function bj(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class xj{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,a,l;const{view:c}=this.editor,u=e.target,f=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!f)return;let d=0,h=0;if(this.dom!==f){const v=this.dom.getBoundingClientRect(),g=f.getBoundingClientRect(),y=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,k=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;d=g.x-v.x+y,h=g.y-v.y+k}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,d,h);const p=B.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(p);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,f=B.isSelectable(this.node),d=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!u&&f&&o&&e.preventDefault(),u&&o&&!c)return e.preventDefault(),!1;if(u&&l&&!c&&m){const v=r.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!(c||s||d||h||p||m&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(rf()||bj())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Nr(t){return new DA({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=J(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if(Og(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(v=>v===t.type&&v!==p.mark.type)).filter(p=>p.to>f).length)return null;dn.from&&s.delete(n.from+u,f),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}const B1=vt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Pa(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),kj=st.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Rp=xt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",fe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),wj=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Sj=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Oj=vt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[xi({find:wj,type:this.type})]},addPasteRules(){return[Nr({find:Sj,type:this.type})]}}),Cj=st.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Ej=vt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Tj=/^\s*>\s$/,aw=xt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[fa({find:Tj,type:this.type})]}}),Nj="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Mj="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Io=(t,e)=>{for(const n in e)t[n]=e[n];return t},jp="numeric",Ip="ascii",Dp="alpha",Il="asciinumeric",sl="alphanumeric",Lp="domain",lw="emoji",Pj="scheme",Aj="slashscheme",H1="whitespace";function Rj(t,e){return t in e||(e[t]=[]),e[t]}function ti(t,e,n){e[jp]&&(e[Il]=!0,e[sl]=!0),e[Ip]&&(e[Il]=!0,e[Dp]=!0),e[Il]&&(e[sl]=!0),e[Dp]&&(e[sl]=!0),e[sl]&&(e[Lp]=!0),e[lw]&&(e[Lp]=!0);for(const r in e){const i=Rj(r,n);i.indexOf(t)<0&&i.push(t)}}function jj(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ft(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}ft.groups={};ft.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Mt=(t,e,n,r,i)=>t.tr(e,n,r,i),U1=(t,e,n,r,i)=>t.ts(e,n,r,i),R=(t,e,n,r,i)=>t.tt(e,n,r,i),wn="WORD",_p="UWORD",da="LOCALHOST",zp="TLD",$p="UTLD",Dl="SCHEME",Bi="SLASH_SCHEME",Cg="NUM",cw="WS",Eg="NL",Ms="OPENBRACE",Ps="CLOSEBRACE",$c="OPENBRACKET",Fc="CLOSEBRACKET",Bc="OPENPAREN",Hc="CLOSEPAREN",Uc="OPENANGLEBRACKET",Vc="CLOSEANGLEBRACKET",Wc="FULLWIDTHLEFTPAREN",Kc="FULLWIDTHRIGHTPAREN",Jc="LEFTCORNERBRACKET",qc="RIGHTCORNERBRACKET",Gc="LEFTWHITECORNERBRACKET",Yc="RIGHTWHITECORNERBRACKET",Qc="FULLWIDTHLESSTHAN",Xc="FULLWIDTHGREATERTHAN",Zc="AMPERSAND",eu="APOSTROPHE",tu="ASTERISK",Qn="AT",nu="BACKSLASH",ru="BACKTICK",iu="CARET",nr="COLON",Tg="COMMA",ou="DOLLAR",sn="DOT",su="EQUALS",Ng="EXCLAMATION",an="HYPHEN",au="PERCENT",lu="PIPE",cu="PLUS",uu="POUND",fu="QUERY",Mg="QUOTE",Pg="SEMI",ln="SLASH",As="TILDE",du="UNDERSCORE",uw="EMOJI",hu="SYM";var fw=Object.freeze({__proto__:null,WORD:wn,UWORD:_p,LOCALHOST:da,TLD:zp,UTLD:$p,SCHEME:Dl,SLASH_SCHEME:Bi,NUM:Cg,WS:cw,NL:Eg,OPENBRACE:Ms,CLOSEBRACE:Ps,OPENBRACKET:$c,CLOSEBRACKET:Fc,OPENPAREN:Bc,CLOSEPAREN:Hc,OPENANGLEBRACKET:Uc,CLOSEANGLEBRACKET:Vc,FULLWIDTHLEFTPAREN:Wc,FULLWIDTHRIGHTPAREN:Kc,LEFTCORNERBRACKET:Jc,RIGHTCORNERBRACKET:qc,LEFTWHITECORNERBRACKET:Gc,RIGHTWHITECORNERBRACKET:Yc,FULLWIDTHLESSTHAN:Qc,FULLWIDTHGREATERTHAN:Xc,AMPERSAND:Zc,APOSTROPHE:eu,ASTERISK:tu,AT:Qn,BACKSLASH:nu,BACKTICK:ru,CARET:iu,COLON:nr,COMMA:Tg,DOLLAR:ou,DOT:sn,EQUALS:su,EXCLAMATION:Ng,HYPHEN:an,PERCENT:au,PIPE:lu,PLUS:cu,POUND:uu,QUERY:fu,QUOTE:Mg,SEMI:Pg,SLASH:ln,TILDE:As,UNDERSCORE:du,EMOJI:uw,SYM:hu});const Di=/[a-z]/,md=new RegExp("\\p{L}","u"),gd=new RegExp("\\p{Emoji}","u"),yd=/\d/,V1=/\s/,W1=` `,Ij="️",Dj="‍";let al=null,ll=null;function Lj(t){t===void 0&&(t=[]);const e={};ft.groups=e;const n=new ft;al==null&&(al=K1(Nj)),ll==null&&(ll=K1(Mj)),R(n,"'",eu),R(n,"{",Ms),R(n,"}",Ps),R(n,"[",$c),R(n,"]",Fc),R(n,"(",Bc),R(n,")",Hc),R(n,"<",Uc),R(n,">",Vc),R(n,"(",Wc),R(n,")",Kc),R(n,"「",Jc),R(n,"」",qc),R(n,"『",Gc),R(n,"』",Yc),R(n,"<",Qc),R(n,">",Xc),R(n,"&",Zc),R(n,"*",tu),R(n,"@",Qn),R(n,"`",ru),R(n,"^",iu),R(n,":",nr),R(n,",",Tg),R(n,"$",ou),R(n,".",sn),R(n,"=",su),R(n,"!",Ng),R(n,"-",an),R(n,"%",au),R(n,"|",lu),R(n,"+",cu),R(n,"#",uu),R(n,"?",fu),R(n,'"',Mg),R(n,"/",ln),R(n,";",Pg),R(n,"~",As),R(n,"_",du),R(n,"\\",nu);const r=Mt(n,yd,Cg,{[jp]:!0});Mt(r,yd,r);const i=Mt(n,Di,wn,{[Ip]:!0});Mt(i,Di,i);const o=Mt(n,md,_p,{[Dp]:!0});Mt(o,Di),Mt(o,md,o);const s=Mt(n,V1,cw,{[H1]:!0});R(n,W1,Eg,{[H1]:!0}),R(s,W1),Mt(s,V1,s);const a=Mt(n,gd,uw,{[lw]:!0});Mt(a,gd,a),R(a,Ij,a);const l=R(a,Dj);Mt(l,gd,a);const c=[[Di,i]],u=[[Di,null],[md,o]];for(let f=0;ff[0]>d[0]?1:-1);for(let f=0;f=0?p[Lp]=!0:Di.test(d)?yd.test(d)?p[Il]=!0:p[Ip]=!0:p[jp]=!0,U1(n,d,d,p)}return U1(n,"localhost",da,{ascii:!0}),n.jd=new ft(hu),{start:n,tokens:Io({groups:e},fw)}}function _j(t,e){const n=zj(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(f+=n[s].length,d++),c+=n[s].length,o+=n[s].length,s++;o-=f,s-=d,c-=f,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function zj(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Un(t,e,n,r,i){let o;const s=e.length;for(let a=0;a=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const ha={defaultProtocol:"http",events:null,format:J1,formatHref:J1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ag(t,e){e===void 0&&(e=null);let n=Io({},ha);t&&(n=Io(n,t instanceof Ag?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=ha.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Io(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function sf(t,e){class n extends dw{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const q1=sf("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),G1=sf("text"),$j=sf("nl"),cl=sf("url",{isLink:!0,toHref(t){return t===void 0&&(t=ha.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==da&&t[1].t===nr}}),Pt=t=>new ft(t);function Fj(t){let{groups:e}=t;const n=e.domain.concat([Zc,tu,Qn,nu,ru,iu,ou,su,an,Cg,au,lu,cu,uu,ln,hu,As,du]),r=[eu,nr,Tg,sn,Ng,fu,Mg,Pg,Uc,Vc,Ms,Ps,Fc,$c,Bc,Hc,Wc,Kc,Jc,qc,Gc,Yc,Qc,Xc],i=[Zc,eu,tu,nu,ru,iu,ou,su,an,Ms,Ps,au,lu,cu,uu,fu,ln,hu,As,du],o=Pt(),s=R(o,As);K(s,i,s),K(s,e.domain,s);const a=Pt(),l=Pt(),c=Pt();K(o,e.domain,a),K(o,e.scheme,l),K(o,e.slashscheme,c),K(a,i,s),K(a,e.domain,a);const u=R(a,Qn);R(s,Qn,u),R(l,Qn,u),R(c,Qn,u);const f=R(s,sn);K(f,i,s),K(f,e.domain,s);const d=Pt();K(u,e.domain,d),K(d,e.domain,d);const h=R(d,sn);K(h,e.domain,d);const p=Pt(q1);K(h,e.tld,p),K(h,e.utld,p),R(u,da,p);const m=R(d,an);K(m,e.domain,d),K(p,e.domain,d),R(p,sn,h),R(p,an,m);const v=R(p,nr);K(v,e.numeric,q1);const g=R(a,an),y=R(a,sn);K(g,e.domain,a),K(y,i,s),K(y,e.domain,a);const k=Pt(cl);K(y,e.tld,k),K(y,e.utld,k),K(k,e.domain,a),K(k,i,s),R(k,sn,y),R(k,an,g),R(k,Qn,u);const w=R(k,nr),O=Pt(cl);K(w,e.numeric,O);const C=Pt(cl),T=Pt();K(C,n,C),K(C,r,T),K(T,n,C),K(T,r,T),R(k,ln,C),R(O,ln,C);const j=R(l,nr),L=R(c,nr),H=R(L,ln),pe=R(H,ln);K(l,e.domain,a),R(l,sn,y),R(l,an,g),K(c,e.domain,a),R(c,sn,y),R(c,an,g),K(j,e.domain,C),R(j,ln,C),K(pe,e.domain,C),K(pe,n,C),R(pe,ln,C);const Je=[[Ms,Ps],[$c,Fc],[Bc,Hc],[Uc,Vc],[Wc,Kc],[Jc,qc],[Gc,Yc],[Qc,Xc]];for(let Te=0;Te=0&&d++,i++,u++;if(d<0)i-=u,i0&&(o.push(vd(G1,e,s)),s=[]),i-=d,u-=d;const h=f.t,p=n.slice(i-u,i);o.push(vd(h,e,p))}}return s.length>0&&o.push(vd(G1,e,s)),o}function vd(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const Hj=typeof console<"u"&&console&&console.warn||(()=>{}),Uj="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",me={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Vj(){ft.groups={},me.scanner=null,me.parser=null,me.tokenQueue=[],me.pluginQueue=[],me.customSchemes=[],me.initialized=!1}function Y1(t,e){if(e===void 0&&(e=!1),me.initialized&&Hj(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Uj}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);me.customSchemes.push([t,e])}function Wj(){me.scanner=Lj(me.customSchemes);for(let t=0;t{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=jR(n.doc,[...e]);if(HR(a).forEach(({newRange:c})=>{const u=DR(r.doc,c,h=>h.isTextblock);let f,d;if(u.length>1?(f=u[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],d=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&d){const h=d.split(" ").filter(g=>g!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const v=hw(p).map(g=>g.toObject());if(!Kj(v))return!1;v.filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>t.validate?t.validate(g.value):!0).forEach(g=>{Og(g.from,g.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function qj(t){return new ct({key:new tn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(t.whenNotEditable&&e.editable||r.button!==0)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=ow(e.state,t.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,f=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function Gj(t){return new ct({key:new tn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=pw(a).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const Yj=vt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Y1(t);return}Y1(t.scheme,t.optionalSlashes)})},onDestroy(){Vj()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){var e;return!((e=t.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",fe(this.options.HTMLAttributes,{...t,href:""}),0]:["a",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Nr({find:t=>{const e=[];if(t){const n=pw(t).filter(r=>r.isLink);n.length&&n.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(Jj({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(qj({type:this.type,whenNotEditable:this.options.openOnClick==="whenNotEditable"})),this.options.linkOnPaste&&t.push(Gj({editor:this.editor,type:this.type})),t}}),Qj=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Xj=({renderers:t})=>M.createElement(M.Fragment,null,Object.entries(t).map(([e,n])=>eo.createPortal(n.reactElement,n.element,e)));class Zj extends M.Component{constructor(e){super(e),this.editorContentRef=M.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?eg.flushSync(e):e()}setRenderer(e,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[e]:n}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[e],{renderers:r}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return M.createElement(M.Fragment,null,M.createElement("div",{ref:Qj(n,this.editorContentRef),...r}),M.createElement(Xj,{renderers:this.state.renderers}))}}const e5=S.forwardRef((t,e)=>{const n=M.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return M.createElement(Zj,{key:n,innerRef:e,...t})}),t5=M.memo(e5);class n5 extends vj{constructor(){super(...arguments),this.contentComponent=null}}const r5=(t={},e=[])=>{const n=S.useRef(null),[,r]=S.useState({}),{onBeforeCreate:i,onBlur:o,onCreate:s,onDestroy:a,onFocus:l,onSelectionUpdate:c,onTransaction:u,onUpdate:f}=t,d=S.useRef(i),h=S.useRef(o),p=S.useRef(s),m=S.useRef(a),v=S.useRef(l),g=S.useRef(c),y=S.useRef(u),k=S.useRef(f);return S.useEffect(()=>{n.current&&(i&&(n.current.off("beforeCreate",d.current),n.current.on("beforeCreate",i),d.current=i),o&&(n.current.off("blur",h.current),n.current.on("blur",o),h.current=o),s&&(n.current.off("create",p.current),n.current.on("create",s),p.current=s),a&&(n.current.off("destroy",m.current),n.current.on("destroy",a),m.current=a),l&&(n.current.off("focus",v.current),n.current.on("focus",l),v.current=l),c&&(n.current.off("selectionUpdate",g.current),n.current.on("selectionUpdate",c),g.current=c),u&&(n.current.off("transaction",y.current),n.current.on("transaction",u),y.current=u),f&&(n.current.off("update",k.current),n.current.on("update",f),k.current=f))},[i,o,s,a,l,c,u,f,n.current]),S.useEffect(()=>{let w=!0;const O=new n5(t);return n.current=O,n.current.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{w&&r({})})})}),()=>{w=!1,O.destroy()}},e),n.current},Rg=S.createContext({editor:null}),i5=Rg.Consumer,o5=()=>S.useContext(Rg),s5=({children:t,slotAfter:e,slotBefore:n,...r})=>{const i=r5(r);return i?M.createElement(Rg.Provider,{value:{editor:i}},n,M.createElement(i5,null,({editor:o})=>M.createElement(t5,{editor:o})),t,e):null},mw=S.createContext({onDragStart:void 0}),a5=()=>S.useContext(mw),l5=M.forwardRef((t,e)=>{const{onDragStart:n}=a5(),r=t.as||"div";return M.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function c5(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function u5(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class f5{constructor(e,{editor:n,props:r={},as:i="div",className:o="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),s&&Object.keys(s).forEach(a=>{this.element.setAttribute(a,s[a])}),this.render()}render(){var e,n;const r=this.component,i=this.props;(c5(r)||u5(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=M.createElement(r,{...i}),(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e,n;(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class d5 extends xj{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=s=>s.charAt(0).toUpperCase()+s.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const s=this.component,a=this.onDragStart.bind(this),l=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return M.createElement(M.Fragment,null,M.createElement(mw.Provider,{value:{onDragStart:a,nodeViewContentRef:l}},M.createElement(s,{...o})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new f5(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.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(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=i=>{this.renderer.updateProps(i)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!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}}function h5(t,e){return n=>n.editor.contentComponent?new d5(t,n,e):{}}const p5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,m5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,g5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,y5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v5=vt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xi({find:p5,type:this.type}),xi({find:g5,type:this.type})]},addPasteRules(){return[Nr({find:m5,type:this.type}),Nr({find:y5,type:this.type})]}}),b5=xt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",fe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Q1=vt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Pa(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),X1=/^\s*([-+*])\s$/,x5=xt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(b5.name,this.editor.getAttributes(Q1.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=fa({find:X1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fa({find:X1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Q1.name),editor:this.editor})),[t]}}),k5=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,w5=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,S5=vt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xi({find:k5,type:this.type})]},addPasteRules(){return[Nr({find:w5,type:this.type})]}}),O5=/^```([a-z]+)?[\s\n]$/,C5=/^~~~([a-z]+)?[\s\n]$/,E5=xt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",fe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[Pp({find:O5,type:this.type,getAttributes:t=>({language:t[1]})}),Pp({find:C5,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ct({key:new tn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return t.state.selection.from===t.state.doc.nodeSize-(1+t.state.selection.$to.depth*2)?s.insert(t.state.selection.from-1,this.type.create({language:o})):s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(U.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` `)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),T5=xt.create({name:"doc",topNode:!0,content:"block+"});function N5(t={}){return new ct({view(e){return new M5(e,t)}})}class M5{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),f=a?u.bottom:u.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=r2(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const P5=st.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[N5(this.options)]}});class xe extends q{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return xe.valid(r)?new xe(r):q.near(r)}content(){return I.empty}eq(e){return e instanceof xe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new xe(e.resolve(n.pos))}getBookmark(){return new jg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!A5(e)||!R5(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&xe.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(xe.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!B.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(xe.valid(a))return a}return null}}}xe.prototype.visible=!1;xe.findFrom=xe.findGapCursorFrom;q.jsonID("gapcursor",xe);class jg{constructor(e){this.pos=e}map(e){return new jg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xe.valid(n)?new xe(n):q.near(n)}}function A5(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function R5(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function j5(){return new ct({props:{decorations:_5,createSelectionBetween(t,e,n){return e.pos==n.pos&&xe.valid(n)?new xe(n):null},handleClick:D5,handleKeyDown:I5,handleDOMEvents:{beforeinput:L5}}})}const I5=V2({ArrowLeft:ul("horiz",-1),ArrowRight:ul("horiz",1),ArrowUp:ul("vert",-1),ArrowDown:ul("vert",1)});function ul(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof U){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=xe.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new xe(c))),!0):!1}}function D5(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!xe.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&B.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new xe(r))),!0)}function L5(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof xe))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=N.empty;for(let s=r.length-1;s>=0;s--)i=N.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new I(i,0,0));return o.setSelection(U.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function _5(t){if(!(t.selection instanceof xe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Me.create(t.doc,[Lt.widget(t.selection.head,e,{key:"gapcursor"})])}const z5=st.create({name:"gapCursor",addProseMirrorPlugins(){return[j5()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=J($(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),$5=xt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",fe(this.options.HTMLAttributes,t)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(d=>a.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),F5=xt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Pp({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var pu=200,ze=function(){};ze.prototype.append=function(e){return e.length?(e=ze.from(e),!this.length&&e||e.length=n?ze.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};ze.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ze.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};ze.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};ze.from=function(e){return e instanceof ze?e:e&&e.length?new gw(e):ze.empty};var gw=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=pu)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=pu)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ze);ze.empty=new gw([]);var B5=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ze);const H5=500;class Jt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new cn(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new cn(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Jt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;uV5&&(a=U5(a,c),s-=c),new Jt(a.append(o),s)}remapping(e,n){let r=new po;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Jt(this.items.append(e.map(n=>new cn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),v=d.selection&&d.selection.map(o.slice(l+1,h));v&&a++,r.push(new cn(p,m,v))}else r.push(new cn(p))},i);let c=[];for(let d=n;dH5&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new cn(c.invert(),l,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new Jt(ze.from(i.reverse()),o)}}Jt.empty=new Jt(ze.empty,0);function U5(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class cn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new cn(n.getMap().invert(),n,this.selection)}}}class Xn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const V5=20;function W5(t,e,n,r){let i=n.getMeta(fi),o;if(i)return i.historyState;n.getMeta(q5)&&(t=new Xn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(fi))return s.getMeta(fi).redo?new Xn(t.done.addTransform(n,void 0,r,Ll(e)),t.undone,Z1(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Xn(t.done,t.undone.addTransform(n,void 0,r,Ll(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!K5(n,t.prevRanges)),c=s?bd(t.prevRanges,n.mapping):Z1(n.mapping.maps[n.steps.length-1]);return new Xn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Ll(e)),Jt.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Xn(t.done.rebased(n,o),t.undone.rebased(n,o),bd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Xn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),bd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function K5(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function Z1(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function bd(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=fi.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=J5(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const vw=yw(!1,!0),bw=yw(!0,!0),Y5=st.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>vw(t,e),redo:()=>({state:t,dispatch:e})=>bw(t,e)}},addProseMirrorPlugins(){return[G5(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()}}}),Q5=xt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",fe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(U.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(B.create(i.doc,a.pos)):i.setSelection(U.create(i.doc,a.pos));else{const c=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(l,c),i.setSelection(U.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),X5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Z5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,eI=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,tI=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,nI=vt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[xi({find:X5,type:this.type}),xi({find:eI,type:this.type})]},addPasteRules(){return[Nr({find:Z5,type:this.type}),Nr({find:tI,type:this.type})]}}),rI=xt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",fe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tv=vt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Pa(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),nv=/^(\d+)\.\s$/,iI=xt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",fe(this.options.HTMLAttributes,n),0]:["ol",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rI.name,this.editor.getAttributes(tv.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=fa({find:nv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fa({find:nv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(tv.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),oI=xt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),sI=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,aI=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,lI=vt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){const t={};return wg()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[xi({find:sI,type:this.type})]},addPasteRules(){return[Nr({find:aI,type:this.type})]}}),cI=xt.create({name:"text",group:"inline"}),uI=st.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g;const y=[];return this.options.blockquote!==!1&&y.push(aw.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&y.push(v5.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&y.push(x5.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&y.push(S5.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&y.push(E5.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&y.push(T5.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&y.push(P5.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&y.push(z5.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&y.push($5.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&y.push(F5.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&y.push(Y5.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&y.push(Q5.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&y.push(nI.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&y.push(Rp.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&y.push(iI.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&y.push(oI.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&y.push(lI.configure((v=this.options)===null||v===void 0?void 0:v.strike)),this.options.text!==!1&&y.push(cI.configure((g=this.options)===null||g===void 0?void 0:g.text)),y}});function rv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1;i--){var o=n[i],s=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=o)}return ue.head.insertBefore(e,r),t}}var DI="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function va(){for(var t=12,e="";t-- >0;)e+=DI[Math.random()*62|0];return e}function Ho(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function $g(t){return t.classList?Ho(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(e){return e})}function Aw(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function LI(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(Aw(t[n]),'" ')},"").trim()}function af(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,": ").concat(t[n].trim(),";")},"")}function Fg(t){return t.size!==pn.size||t.x!==pn.x||t.y!==pn.y||t.rotate!==pn.rotate||t.flipX||t.flipY}function _I(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(o," ").concat(s," ").concat(a)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function zI(t){var e=t.transform,n=t.width,r=n===void 0?Bp:n,i=t.height,o=i===void 0?Bp:i,s=t.startCentered,a=s===void 0?!1:s,l="";return a&&Ow?l+="translate(".concat(e.x/Vn-r/2,"em, ").concat(e.y/Vn-o/2,"em) "):a?l+="translate(calc(-50% + ".concat(e.x/Vn,"em), calc(-50% + ").concat(e.y/Vn,"em)) "):l+="translate(".concat(e.x/Vn,"em, ").concat(e.y/Vn,"em) "),l+="scale(".concat(e.size/Vn*(e.flipX?-1:1),", ").concat(e.size/Vn*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var $I=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light"; --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin"; --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; } svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { overflow: visible; box-sizing: content-box; } .svg-inline--fa { display: var(--fa-display, inline-block); height: 1em; overflow: visible; vertical-align: -0.125em; } .svg-inline--fa.fa-2xs { vertical-align: 0.1em; } .svg-inline--fa.fa-xs { vertical-align: 0em; } .svg-inline--fa.fa-sm { vertical-align: -0.0714285705em; } .svg-inline--fa.fa-lg { vertical-align: -0.2em; } .svg-inline--fa.fa-xl { vertical-align: -0.25em; } .svg-inline--fa.fa-2xl { vertical-align: -0.3125em; } .svg-inline--fa.fa-pull-left { margin-right: var(--fa-pull-margin, 0.3em); width: auto; } .svg-inline--fa.fa-pull-right { margin-left: var(--fa-pull-margin, 0.3em); width: auto; } .svg-inline--fa.fa-li { width: var(--fa-li-width, 2em); top: 0.25em; } .svg-inline--fa.fa-fw { width: var(--fa-fw-width, 1.25em); } .fa-layers svg.svg-inline--fa { bottom: 0; left: 0; margin: auto; position: absolute; right: 0; top: 0; } .fa-layers-counter, .fa-layers-text { display: inline-block; position: absolute; text-align: center; } .fa-layers { display: inline-block; height: 1em; position: relative; text-align: center; vertical-align: -0.125em; width: 1em; } .fa-layers svg.svg-inline--fa { -webkit-transform-origin: center center; transform-origin: center center; } .fa-layers-text { left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); -webkit-transform-origin: center center; transform-origin: center center; } .fa-layers-counter { background-color: var(--fa-counter-background-color, #ff253a); border-radius: var(--fa-counter-border-radius, 1em); box-sizing: border-box; color: var(--fa-inverse, #fff); line-height: var(--fa-counter-line-height, 1); max-width: var(--fa-counter-max-width, 5em); min-width: var(--fa-counter-min-width, 1.5em); overflow: hidden; padding: var(--fa-counter-padding, 0.25em 0.5em); right: var(--fa-right, 0); text-overflow: ellipsis; top: var(--fa-top, 0); -webkit-transform: scale(var(--fa-counter-scale, 0.25)); transform: scale(var(--fa-counter-scale, 0.25)); -webkit-transform-origin: top right; transform-origin: top right; } .fa-layers-bottom-right { bottom: var(--fa-bottom, 0); right: var(--fa-right, 0); top: auto; -webkit-transform: scale(var(--fa-layers-scale, 0.25)); transform: scale(var(--fa-layers-scale, 0.25)); -webkit-transform-origin: bottom right; transform-origin: bottom right; } .fa-layers-bottom-left { bottom: var(--fa-bottom, 0); left: var(--fa-left, 0); right: auto; top: auto; -webkit-transform: scale(var(--fa-layers-scale, 0.25)); transform: scale(var(--fa-layers-scale, 0.25)); -webkit-transform-origin: bottom left; transform-origin: bottom left; } .fa-layers-top-right { top: var(--fa-top, 0); right: var(--fa-right, 0); -webkit-transform: scale(var(--fa-layers-scale, 0.25)); transform: scale(var(--fa-layers-scale, 0.25)); -webkit-transform-origin: top right; transform-origin: top right; } .fa-layers-top-left { left: var(--fa-left, 0); right: auto; top: var(--fa-top, 0); -webkit-transform: scale(var(--fa-layers-scale, 0.25)); transform: scale(var(--fa-layers-scale, 0.25)); -webkit-transform-origin: top left; transform-origin: top left; } .fa-1x { font-size: 1em; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-6x { font-size: 6em; } .fa-7x { font-size: 7em; } .fa-8x { font-size: 8em; } .fa-9x { font-size: 9em; } .fa-10x { font-size: 10em; } .fa-2xs { font-size: 0.625em; line-height: 0.1em; vertical-align: 0.225em; } .fa-xs { font-size: 0.75em; line-height: 0.0833333337em; vertical-align: 0.125em; } .fa-sm { font-size: 0.875em; line-height: 0.0714285718em; vertical-align: 0.0535714295em; } .fa-lg { font-size: 1.25em; line-height: 0.05em; vertical-align: -0.075em; } .fa-xl { font-size: 1.5em; line-height: 0.0416666682em; vertical-align: -0.125em; } .fa-2xl { font-size: 2em; line-height: 0.03125em; vertical-align: -0.1875em; } .fa-fw { text-align: center; width: 1.25em; } .fa-ul { list-style-type: none; margin-left: var(--fa-li-margin, 2.5em); padding-left: 0; } .fa-ul > li { position: relative; } .fa-li { left: calc(var(--fa-li-width, 2em) * -1); position: absolute; text-align: center; width: var(--fa-li-width, 2em); line-height: inherit; } .fa-border { border-color: var(--fa-border-color, #eee); border-radius: var(--fa-border-radius, 0.1em); border-style: var(--fa-border-style, solid); border-width: var(--fa-border-width, 0.08em); padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); } .fa-pull-left { float: left; margin-right: var(--fa-pull-margin, 0.3em); } .fa-pull-right { float: right; margin-left: var(--fa-pull-margin, 0.3em); } .fa-beat { -webkit-animation-name: fa-beat; animation-name: fa-beat; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-bounce { -webkit-animation-name: fa-bounce; animation-name: fa-bounce; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); } .fa-fade { -webkit-animation-name: fa-fade; animation-name: fa-fade; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-beat-fade { -webkit-animation-name: fa-beat-fade; animation-name: fa-beat-fade; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-flip { -webkit-animation-name: fa-flip; animation-name: fa-flip; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-shake { -webkit-animation-name: fa-shake; animation-name: fa-shake; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, linear); animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin { -webkit-animation-name: fa-spin; animation-name: fa-spin; -webkit-animation-delay: var(--fa-animation-delay, 0s); animation-delay: var(--fa-animation-delay, 0s); -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 2s); animation-duration: var(--fa-animation-duration, 2s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, linear); animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin-reverse { --fa-animation-direction: reverse; } .fa-pulse, .fa-spin-pulse { -webkit-animation-name: fa-spin; animation-name: fa-spin; -webkit-animation-direction: var(--fa-animation-direction, normal); animation-direction: var(--fa-animation-direction, normal); -webkit-animation-duration: var(--fa-animation-duration, 1s); animation-duration: var(--fa-animation-duration, 1s); -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-iteration-count: var(--fa-animation-iteration-count, infinite); -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); animation-timing-function: var(--fa-animation-timing, steps(8)); } @media (prefers-reduced-motion: reduce) { .fa-beat, .fa-bounce, .fa-fade, .fa-beat-fade, .fa-flip, .fa-pulse, .fa-shake, .fa-spin, .fa-spin-pulse { -webkit-animation-delay: -1ms; animation-delay: -1ms; -webkit-animation-duration: 1ms; animation-duration: 1ms; -webkit-animation-iteration-count: 1; animation-iteration-count: 1; -webkit-transition-delay: 0s; transition-delay: 0s; -webkit-transition-duration: 0s; transition-duration: 0s; } } @-webkit-keyframes fa-beat { 0%, 90% { -webkit-transform: scale(1); transform: scale(1); } 45% { -webkit-transform: scale(var(--fa-beat-scale, 1.25)); transform: scale(var(--fa-beat-scale, 1.25)); } } @keyframes fa-beat { 0%, 90% { -webkit-transform: scale(1); transform: scale(1); } 45% { -webkit-transform: scale(var(--fa-beat-scale, 1.25)); transform: scale(var(--fa-beat-scale, 1.25)); } } @-webkit-keyframes fa-bounce { 0% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } 10% { -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } 30% { -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } 50% { -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } 57% { -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } 64% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } 100% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } } @keyframes fa-bounce { 0% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } 10% { -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } 30% { -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } 50% { -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } 57% { -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } 64% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } 100% { -webkit-transform: scale(1, 1) translateY(0); transform: scale(1, 1) translateY(0); } } @-webkit-keyframes fa-fade { 50% { opacity: var(--fa-fade-opacity, 0.4); } } @keyframes fa-fade { 50% { opacity: var(--fa-fade-opacity, 0.4); } } @-webkit-keyframes fa-beat-fade { 0%, 100% { opacity: var(--fa-beat-fade-opacity, 0.4); -webkit-transform: scale(1); transform: scale(1); } 50% { opacity: 1; -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); transform: scale(var(--fa-beat-fade-scale, 1.125)); } } @keyframes fa-beat-fade { 0%, 100% { opacity: var(--fa-beat-fade-opacity, 0.4); -webkit-transform: scale(1); transform: scale(1); } 50% { opacity: 1; -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); transform: scale(var(--fa-beat-fade-scale, 1.125)); } } @-webkit-keyframes fa-flip { 50% { -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } @keyframes fa-flip { 50% { -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } @-webkit-keyframes fa-shake { 0% { -webkit-transform: rotate(-15deg); transform: rotate(-15deg); } 4% { -webkit-transform: rotate(15deg); transform: rotate(15deg); } 8%, 24% { -webkit-transform: rotate(-18deg); transform: rotate(-18deg); } 12%, 28% { -webkit-transform: rotate(18deg); transform: rotate(18deg); } 16% { -webkit-transform: rotate(-22deg); transform: rotate(-22deg); } 20% { -webkit-transform: rotate(22deg); transform: rotate(22deg); } 32% { -webkit-transform: rotate(-12deg); transform: rotate(-12deg); } 36% { -webkit-transform: rotate(12deg); transform: rotate(12deg); } 40%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } } @keyframes fa-shake { 0% { -webkit-transform: rotate(-15deg); transform: rotate(-15deg); } 4% { -webkit-transform: rotate(15deg); transform: rotate(15deg); } 8%, 24% { -webkit-transform: rotate(-18deg); transform: rotate(-18deg); } 12%, 28% { -webkit-transform: rotate(18deg); transform: rotate(18deg); } 16% { -webkit-transform: rotate(-22deg); transform: rotate(-22deg); } 20% { -webkit-transform: rotate(22deg); transform: rotate(22deg); } 32% { -webkit-transform: rotate(-12deg); transform: rotate(-12deg); } 36% { -webkit-transform: rotate(12deg); transform: rotate(12deg); } 40%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } .fa-rotate-90 { -webkit-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { -webkit-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { -webkit-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { -webkit-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { -webkit-transform: scale(1, -1); transform: scale(1, -1); } .fa-flip-both, .fa-flip-horizontal.fa-flip-vertical { -webkit-transform: scale(-1, -1); transform: scale(-1, -1); } .fa-rotate-by { -webkit-transform: rotate(var(--fa-rotate-angle, 0)); transform: rotate(var(--fa-rotate-angle, 0)); } .fa-stack { display: inline-block; vertical-align: middle; height: 2em; position: relative; width: 2.5em; } .fa-stack-1x, .fa-stack-2x { bottom: 0; left: 0; margin: auto; position: absolute; right: 0; top: 0; z-index: var(--fa-stack-z-index, auto); } .svg-inline--fa.fa-stack-1x { height: 1em; width: 1.25em; } .svg-inline--fa.fa-stack-2x { height: 2em; width: 2.5em; } .fa-inverse { color: var(--fa-inverse, #fff); } .sr-only, .fa-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } .sr-only-focusable:not(:focus), .fa-sr-only-focusable:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } .svg-inline--fa .fa-primary { fill: var(--fa-primary-color, currentColor); opacity: var(--fa-primary-opacity, 1); } .svg-inline--fa .fa-secondary { fill: var(--fa-secondary-color, currentColor); opacity: var(--fa-secondary-opacity, 0.4); } .svg-inline--fa.fa-swap-opacity .fa-primary { opacity: var(--fa-secondary-opacity, 0.4); } .svg-inline--fa.fa-swap-opacity .fa-secondary { opacity: var(--fa-primary-opacity, 1); } .svg-inline--fa mask .fa-primary, .svg-inline--fa mask .fa-secondary { fill: black; } .fad.fa-inverse, .fa-duotone.fa-inverse { color: var(--fa-inverse, #fff); }`;function Rw(){var t=Cw,e=Ew,n=F.cssPrefix,r=F.replacementClass,i=$I;if(n!==t||r!==e){var o=new RegExp("\\.".concat(t,"\\-"),"g"),s=new RegExp("\\--".concat(t,"\\-"),"g"),a=new RegExp("\\.".concat(e),"g");i=i.replace(o,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(a,".".concat(r))}return i}var uv=!1;function kd(){F.autoAddCss&&!uv&&(II(Rw()),uv=!0)}var FI={mixout:function(){return{dom:{css:Rw,insertCss:kd}}},hooks:function(){return{beforeDOMElementCreation:function(){kd()},beforeI2svg:function(){kd()}}}},Ln=Mr||{};Ln[Dn]||(Ln[Dn]={});Ln[Dn].styles||(Ln[Dn].styles={});Ln[Dn].hooks||(Ln[Dn].hooks={});Ln[Dn].shims||(Ln[Dn].shims=[]);var Gt=Ln[Dn],jw=[],BI=function t(){ue.removeEventListener("DOMContentLoaded",t),gu=1,jw.map(function(e){return e()})},gu=!1;$n&&(gu=(ue.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(ue.readyState),gu||ue.addEventListener("DOMContentLoaded",BI));function HI(t){$n&&(gu?setTimeout(t,0):jw.push(t))}function ja(t){var e=t.tag,n=t.attributes,r=n===void 0?{}:n,i=t.children,o=i===void 0?[]:i;return typeof t=="string"?Aw(t):"<".concat(e," ").concat(LI(r),">").concat(o.map(ja).join(""),"")}function fv(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var UI=function(e,n){return function(r,i,o,s){return e.call(n,r,i,o,s)}},wd=function(e,n,r,i){var o=Object.keys(e),s=o.length,a=i!==void 0?UI(n,i):n,l,c,u;for(r===void 0?(l=1,u=e[o[0]]):(l=0,u=r);l=55296&&i<=56319&&n=55296&&r<=56319&&n>e+1&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function dv(t){return Object.keys(t).reduce(function(e,n){var r=t[n],i=!!r.icon;return i?e[r.iconName]=r.icon:e[n]=r,e},{})}function Vp(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=dv(e);typeof Gt.hooks.addPack=="function"&&!i?Gt.hooks.addPack(t,dv(e)):Gt.styles[t]=_(_({},Gt.styles[t]||{}),o),t==="fas"&&Vp("fa",e)}var yl,vl,bl,io=Gt.styles,KI=Gt.shims,JI=(yl={},Re(yl,le,Object.values(ga[le])),Re(yl,ke,Object.values(ga[ke])),yl),Bg=null,Iw={},Dw={},Lw={},_w={},zw={},qI=(vl={},Re(vl,le,Object.keys(pa[le])),Re(vl,ke,Object.keys(pa[ke])),vl);function GI(t){return~MI.indexOf(t)}function YI(t,e){var n=e.split("-"),r=n[0],i=n.slice(1).join("-");return r===t&&i!==""&&!GI(i)?i:null}var $w=function(){var e=function(o){return wd(io,function(s,a,l){return s[l]=wd(a,o,{}),s},{})};Iw=e(function(i,o,s){if(o[3]&&(i[o[3]]=s),o[2]){var a=o[2].filter(function(l){return typeof l=="number"});a.forEach(function(l){i[l.toString(16)]=s})}return i}),Dw=e(function(i,o,s){if(i[s]=s,o[2]){var a=o[2].filter(function(l){return typeof l=="string"});a.forEach(function(l){i[l]=s})}return i}),zw=e(function(i,o,s){var a=o[2];return i[s]=s,a.forEach(function(l){i[l]=s}),i});var n="far"in io||F.autoFetchSvg,r=wd(KI,function(i,o){var s=o[0],a=o[1],l=o[2];return a==="far"&&!n&&(a="fas"),typeof s=="string"&&(i.names[s]={prefix:a,iconName:l}),typeof s=="number"&&(i.unicodes[s.toString(16)]={prefix:a,iconName:l}),i},{names:{},unicodes:{}});Lw=r.names,_w=r.unicodes,Bg=lf(F.styleDefault,{family:F.familyDefault})};jI(function(t){Bg=lf(t.styleDefault,{family:F.familyDefault})});$w();function Hg(t,e){return(Iw[t]||{})[e]}function QI(t,e){return(Dw[t]||{})[e]}function ri(t,e){return(zw[t]||{})[e]}function Fw(t){return Lw[t]||{prefix:null,iconName:null}}function XI(t){var e=_w[t],n=Hg("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Pr(){return Bg}var Ug=function(){return{prefix:null,iconName:null,rest:[]}};function lf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.family,r=n===void 0?le:n,i=pa[r][t],o=ma[r][t]||ma[r][i],s=t in Gt.styles?t:null;return o||s||null}var hv=(bl={},Re(bl,le,Object.keys(ga[le])),Re(bl,ke,Object.keys(ga[ke])),bl);function cf(t){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(e={},Re(e,le,"".concat(F.cssPrefix,"-").concat(le)),Re(e,ke,"".concat(F.cssPrefix,"-").concat(ke)),e),s=null,a=le;(t.includes(o[le])||t.some(function(c){return hv[le].includes(c)}))&&(a=le),(t.includes(o[ke])||t.some(function(c){return hv[ke].includes(c)}))&&(a=ke);var l=t.reduce(function(c,u){var f=YI(F.cssPrefix,u);if(io[u]?(u=JI[a].includes(u)?SI[a][u]:u,s=u,c.prefix=u):qI[a].indexOf(u)>-1?(s=u,c.prefix=lf(u,{family:a})):f?c.iconName=f:u!==F.replacementClass&&u!==o[le]&&u!==o[ke]&&c.rest.push(u),!i&&c.prefix&&c.iconName){var d=s==="fa"?Fw(c.iconName):{},h=ri(c.prefix,c.iconName);d.prefix&&(s=null),c.iconName=d.iconName||h||c.iconName,c.prefix=d.prefix||c.prefix,c.prefix==="far"&&!io.far&&io.fas&&!F.autoFetchSvg&&(c.prefix="fas")}return c},Ug());return(t.includes("fa-brands")||t.includes("fab"))&&(l.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(l.prefix="fad"),!l.prefix&&a===ke&&(io.fass||F.autoFetchSvg)&&(l.prefix="fass",l.iconName=ri(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||s==="fa")&&(l.prefix=Pr()||"fas"),l}var ZI=function(){function t(){fI(this,t),this.definitions={}}return dI(t,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o0&&u.forEach(function(f){typeof f=="string"&&(n[a][f]=c)}),n[a][l]=c}),n}}]),t}(),pv=[],oo={},vo={},eD=Object.keys(vo);function tD(t,e){var n=e.mixoutsTo;return pv=t,oo={},Object.keys(vo).forEach(function(r){eD.indexOf(r)===-1&&delete vo[r]}),pv.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(s){typeof i[s]=="function"&&(n[s]=i[s]),mu(i[s])==="object"&&Object.keys(i[s]).forEach(function(a){n[s]||(n[s]={}),n[s][a]=i[s][a]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(s){oo[s]||(oo[s]=[]),oo[s].push(o[s])})}r.provides&&r.provides(vo)}),n}function Wp(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?e-1:0),r=1;r0&&arguments[0]!==void 0?arguments[0]:{};return $n?(wi("beforeI2svg",e),_n("pseudoElements2svg",e),_n("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot;F.autoReplaceSvg===!1&&(F.autoReplaceSvg=!0),F.observeMutations=!0,HI(function(){oD({autoReplaceSvgRoot:n}),wi("watch",e)})}},iD={icon:function(e){if(e===null)return null;if(mu(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:ri(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var n=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],r=lf(e[0]);return{prefix:r,iconName:ri(r,n)||n}}if(typeof e=="string"&&(e.indexOf("".concat(F.cssPrefix,"-"))>-1||e.match(OI))){var i=cf(e.split(" "),{skipLookups:!0});return{prefix:i.prefix||Pr(),iconName:ri(i.prefix,i.iconName)||i.iconName}}if(typeof e=="string"){var o=Pr();return{prefix:o,iconName:ri(o,e)||e}}}},Nt={noAuto:nD,config:F,dom:rD,parse:iD,library:Bw,findIconDefinition:Kp,toHtml:ja},oD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot,r=n===void 0?ue:n;(Object.keys(Gt.styles).length>0||F.autoFetchSvg)&&$n&&F.autoReplaceSvg&&Nt.dom.i2svg({node:r})};function uf(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(r){return ja(r)})}}),Object.defineProperty(t,"node",{get:function(){if($n){var r=ue.createElement("div");return r.innerHTML=t.html,r.children}}}),t}function sD(t){var e=t.children,n=t.main,r=t.mask,i=t.attributes,o=t.styles,s=t.transform;if(Fg(s)&&n.found&&!r.found){var a=n.width,l=n.height,c={x:a/l/2,y:.5};i.style=af(_(_({},o),{},{"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function aD(t){var e=t.prefix,n=t.iconName,r=t.children,i=t.attributes,o=t.symbol,s=o===!0?"".concat(e,"-").concat(F.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:_(_({},i),{},{id:s}),children:r}]}]}function Vg(t){var e=t.icons,n=e.main,r=e.mask,i=t.prefix,o=t.iconName,s=t.transform,a=t.symbol,l=t.title,c=t.maskId,u=t.titleId,f=t.extra,d=t.watchable,h=d===void 0?!1:d,p=r.found?r:n,m=p.width,v=p.height,g=i==="fak",y=[F.replacementClass,o?"".concat(F.cssPrefix,"-").concat(o):""].filter(function(L){return f.classes.indexOf(L)===-1}).filter(function(L){return L!==""||!!L}).concat(f.classes).join(" "),k={children:[],attributes:_(_({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:y,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(v)})},w=g&&!~f.classes.indexOf("fa-fw")?{width:"".concat(m/v*16*.0625,"em")}:{};h&&(k.attributes[ki]=""),l&&(k.children.push({tag:"title",attributes:{id:k.attributes["aria-labelledby"]||"title-".concat(u||va())},children:[l]}),delete k.attributes.title);var O=_(_({},k),{},{prefix:i,iconName:o,main:n,mask:r,maskId:c,transform:s,symbol:a,styles:_(_({},w),f.styles)}),C=r.found&&n.found?_n("generateAbstractMask",O)||{children:[],attributes:{}}:_n("generateAbstractIcon",O)||{children:[],attributes:{}},T=C.children,j=C.attributes;return O.children=T,O.attributes=j,a?aD(O):sD(O)}function mv(t){var e=t.content,n=t.width,r=t.height,i=t.transform,o=t.title,s=t.extra,a=t.watchable,l=a===void 0?!1:a,c=_(_(_({},s.attributes),o?{title:o}:{}),{},{class:s.classes.join(" ")});l&&(c[ki]="");var u=_({},s.styles);Fg(i)&&(u.transform=zI({transform:i,startCentered:!0,width:n,height:r}),u["-webkit-transform"]=u.transform);var f=af(u);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[e]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function lD(t){var e=t.content,n=t.title,r=t.extra,i=_(_(_({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=af(r.styles);o.length>0&&(i.style=o);var s=[];return s.push({tag:"span",attributes:i,children:[e]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}var Sd=Gt.styles;function Jp(t){var e=t[0],n=t[1],r=t.slice(4),i=Ig(r,1),o=i[0],s=null;return Array.isArray(o)?s={tag:"g",attributes:{class:"".concat(F.cssPrefix,"-").concat(ni.GROUP)},children:[{tag:"path",attributes:{class:"".concat(F.cssPrefix,"-").concat(ni.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(F.cssPrefix,"-").concat(ni.PRIMARY),fill:"currentColor",d:o[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:n,icon:s}}var cD={found:!1,width:512,height:512};function uD(t,e){!Tw&&!F.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function qp(t,e){var n=e;return e==="fa"&&F.styleDefault!==null&&(e=Pr()),new Promise(function(r,i){if(_n("missingIconAbstract"),n==="fa"){var o=Fw(t)||{};t=o.iconName||t,e=o.prefix||e}if(t&&e&&Sd[e]&&Sd[e][t]){var s=Sd[e][t];return r(Jp(s))}uD(t,e),r(_(_({},cD),{},{icon:F.showMissingIcons&&t?_n("missingIconAbstract")||{}:{}}))})}var gv=function(){},Gp=F.measurePerformance&&fl&&fl.mark&&fl.measure?fl:{mark:gv,measure:gv},hs='FA "6.5.2"',fD=function(e){return Gp.mark("".concat(hs," ").concat(e," begins")),function(){return Hw(e)}},Hw=function(e){Gp.mark("".concat(hs," ").concat(e," ends")),Gp.measure("".concat(hs," ").concat(e),"".concat(hs," ").concat(e," begins"),"".concat(hs," ").concat(e," ends"))},Wg={begin:fD,end:Hw},_l=function(){};function yv(t){var e=t.getAttribute?t.getAttribute(ki):null;return typeof e=="string"}function dD(t){var e=t.getAttribute?t.getAttribute(Lg):null,n=t.getAttribute?t.getAttribute(_g):null;return e&&n}function hD(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(F.replacementClass)}function pD(){if(F.autoReplaceSvg===!0)return zl.replace;var t=zl[F.autoReplaceSvg];return t||zl.replace}function mD(t){return ue.createElementNS("http://www.w3.org/2000/svg",t)}function gD(t){return ue.createElement(t)}function Uw(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.ceFn,r=n===void 0?t.tag==="svg"?mD:gD:n;if(typeof t=="string")return ue.createTextNode(t);var i=r(t.tag);Object.keys(t.attributes||[]).forEach(function(s){i.setAttribute(s,t.attributes[s])});var o=t.children||[];return o.forEach(function(s){i.appendChild(Uw(s,{ceFn:r}))}),i}function yD(t){var e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var zl={replace:function(e){var n=e[0];if(n.parentNode)if(e[1].forEach(function(i){n.parentNode.insertBefore(Uw(i),n)}),n.getAttribute(ki)===null&&F.keepOriginalSource){var r=ue.createComment(yD(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(e){var n=e[0],r=e[1];if(~$g(n).indexOf(F.replacementClass))return zl.replace(e);var i=new RegExp("".concat(F.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(a,l){return l===F.replacementClass||l.match(i)?a.toSvg.push(l):a.toNode.push(l),a},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var s=r.map(function(a){return ja(a)}).join(` `);n.setAttribute(ki,""),n.innerHTML=s}};function vv(t){t()}function Vw(t,e){var n=typeof e=="function"?e:_l;if(t.length===0)n();else{var r=vv;F.mutateApproach===kI&&(r=Mr.requestAnimationFrame||vv),r(function(){var i=pD(),o=Wg.begin("mutate");t.map(i),o(),n()})}}var Kg=!1;function Ww(){Kg=!0}function Yp(){Kg=!1}var yu=null;function bv(t){if(lv&&F.observeMutations){var e=t.treeCallback,n=e===void 0?_l:e,r=t.nodeCallback,i=r===void 0?_l:r,o=t.pseudoElementsCallback,s=o===void 0?_l:o,a=t.observeMutationsRoot,l=a===void 0?ue:a;yu=new lv(function(c){if(!Kg){var u=Pr();Ho(c).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!yv(f.addedNodes[0])&&(F.searchPseudoElements&&s(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&F.searchPseudoElements&&s(f.target.parentNode),f.type==="attributes"&&yv(f.target)&&~NI.indexOf(f.attributeName))if(f.attributeName==="class"&&dD(f.target)){var d=cf($g(f.target)),h=d.prefix,p=d.iconName;f.target.setAttribute(Lg,h||u),p&&f.target.setAttribute(_g,p)}else hD(f.target)&&i(f.target)})}}),$n&&yu.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function vD(){yu&&yu.disconnect()}function bD(t){var e=t.getAttribute("style"),n=[];return e&&(n=e.split(";").reduce(function(r,i){var o=i.split(":"),s=o[0],a=o.slice(1);return s&&a.length>0&&(r[s]=a.join(":").trim()),r},{})),n}function xD(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=t.innerText!==void 0?t.innerText.trim():"",i=cf($g(t));return i.prefix||(i.prefix=Pr()),e&&n&&(i.prefix=e,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=QI(i.prefix,t.innerText)||Hg(i.prefix,Up(t.innerText))),!i.iconName&&F.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=t.firstChild.data)),i}function kD(t){var e=Ho(t.attributes).reduce(function(i,o){return i.name!=="class"&&i.name!=="style"&&(i[o.name]=o.value),i},{}),n=t.getAttribute("title"),r=t.getAttribute("data-fa-title-id");return F.autoA11y&&(n?e["aria-labelledby"]="".concat(F.replacementClass,"-title-").concat(r||va()):(e["aria-hidden"]="true",e.focusable="false")),e}function wD(){return{iconName:null,title:null,titleId:null,prefix:null,transform:pn,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function xv(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=xD(t),r=n.iconName,i=n.prefix,o=n.rest,s=kD(t),a=Wp("parseNodeAttributes",{},t),l=e.styleParser?bD(t):[];return _({iconName:r,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:i,transform:pn,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:l,attributes:s}},a)}var SD=Gt.styles;function Kw(t){var e=F.autoReplaceSvg==="nest"?xv(t,{styleParser:!1}):xv(t);return~e.extra.classes.indexOf(Nw)?_n("generateLayersText",t,e):_n("generateSvgReplacementMutation",t,e)}var Ar=new Set;zg.map(function(t){Ar.add("fa-".concat(t))});Object.keys(pa[le]).map(Ar.add.bind(Ar));Object.keys(pa[ke]).map(Ar.add.bind(Ar));Ar=Aa(Ar);function kv(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!$n)return Promise.resolve();var n=ue.documentElement.classList,r=function(f){return n.add("".concat(cv,"-").concat(f))},i=function(f){return n.remove("".concat(cv,"-").concat(f))},o=F.autoFetchSvg?Ar:zg.map(function(u){return"fa-".concat(u)}).concat(Object.keys(SD));o.includes("fa")||o.push("fa");var s=[".".concat(Nw,":not([").concat(ki,"])")].concat(o.map(function(u){return".".concat(u,":not([").concat(ki,"])")})).join(", ");if(s.length===0)return Promise.resolve();var a=[];try{a=Ho(t.querySelectorAll(s))}catch{}if(a.length>0)r("pending"),i("complete");else return Promise.resolve();var l=Wg.begin("onTree"),c=a.reduce(function(u,f){try{var d=Kw(f);d&&u.push(d)}catch(h){Tw||h.name==="MissingIcon"&&console.error(h)}return u},[]);return new Promise(function(u,f){Promise.all(c).then(function(d){Vw(d,function(){r("active"),r("complete"),i("pending"),typeof e=="function"&&e(),l(),u()})}).catch(function(d){l(),f(d)})})}function OD(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Kw(t).then(function(n){n&&Vw([n],e)})}function CD(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(e||{}).icon?e:Kp(e||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Kp(i||{})),t(r,_(_({},n),{},{mask:i}))}}var ED=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?pn:r,o=n.symbol,s=o===void 0?!1:o,a=n.mask,l=a===void 0?null:a,c=n.maskId,u=c===void 0?null:c,f=n.title,d=f===void 0?null:f,h=n.titleId,p=h===void 0?null:h,m=n.classes,v=m===void 0?[]:m,g=n.attributes,y=g===void 0?{}:g,k=n.styles,w=k===void 0?{}:k;if(e){var O=e.prefix,C=e.iconName,T=e.icon;return uf(_({type:"icon"},e),function(){return wi("beforeDOMElementCreation",{iconDefinition:e,params:n}),F.autoA11y&&(d?y["aria-labelledby"]="".concat(F.replacementClass,"-title-").concat(p||va()):(y["aria-hidden"]="true",y.focusable="false")),Vg({icons:{main:Jp(T),mask:l?Jp(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:O,iconName:C,transform:_(_({},pn),i),symbol:s,title:d,maskId:u,titleId:p,extra:{attributes:y,styles:w,classes:v}})})}},TD={mixout:function(){return{icon:CD(ED)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=kv,n.nodeCallback=OD,n}}},provides:function(e){e.i2svg=function(n){var r=n.node,i=r===void 0?ue:r,o=n.callback,s=o===void 0?function(){}:o;return kv(i,s)},e.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,s=r.titleId,a=r.prefix,l=r.transform,c=r.symbol,u=r.mask,f=r.maskId,d=r.extra;return new Promise(function(h,p){Promise.all([qp(i,a),u.iconName?qp(u.iconName,u.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(m){var v=Ig(m,2),g=v[0],y=v[1];h([n,Vg({icons:{main:g,mask:y},prefix:a,iconName:i,transform:l,symbol:c,maskId:f,title:o,titleId:s,extra:d,watchable:!0})])}).catch(p)})},e.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.transform,a=n.styles,l=af(a);l.length>0&&(i.style=l);var c;return Fg(s)&&(c=_n("generateAbstractTransformGrouping",{main:o,transform:s,containerWidth:o.width,iconWidth:o.width})),r.push(c||o.icon),{children:r,attributes:i}}}},ND={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,o=i===void 0?[]:i;return uf({type:"layer"},function(){wi("beforeDOMElementCreation",{assembler:n,params:r});var s=[];return n(function(a){Array.isArray(a)?a.map(function(l){s=s.concat(l.abstract)}):s=s.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(F.cssPrefix,"-layers")].concat(Aa(o)).join(" ")},children:s}]})}}}},MD={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,s=r.classes,a=s===void 0?[]:s,l=r.attributes,c=l===void 0?{}:l,u=r.styles,f=u===void 0?{}:u;return uf({type:"counter",content:n},function(){return wi("beforeDOMElementCreation",{content:n,params:r}),lD({content:n.toString(),title:o,extra:{attributes:c,styles:f,classes:["".concat(F.cssPrefix,"-layers-counter")].concat(Aa(a))}})})}}}},PD={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?pn:i,s=r.title,a=s===void 0?null:s,l=r.classes,c=l===void 0?[]:l,u=r.attributes,f=u===void 0?{}:u,d=r.styles,h=d===void 0?{}:d;return uf({type:"text",content:n},function(){return wi("beforeDOMElementCreation",{content:n,params:r}),mv({content:n,transform:_(_({},pn),o),title:a,extra:{attributes:f,styles:h,classes:["".concat(F.cssPrefix,"-layers-text")].concat(Aa(c))}})})}}},provides:function(e){e.generateLayersText=function(n,r){var i=r.title,o=r.transform,s=r.extra,a=null,l=null;if(Ow){var c=parseInt(getComputedStyle(n).fontSize,10),u=n.getBoundingClientRect();a=u.width/c,l=u.height/c}return F.autoA11y&&!i&&(s.attributes["aria-hidden"]="true"),Promise.resolve([n,mv({content:n.innerHTML,width:a,height:l,transform:o,title:i,extra:s,watchable:!0})])}}},AD=new RegExp('"',"ug"),wv=[1105920,1112319];function RD(t){var e=t.replace(AD,""),n=WI(e,0),r=n>=wv[0]&&n<=wv[1],i=e.length===2?e[0]===e[1]:!1;return{value:Up(i?e[0]:e),isSecondary:r||i}}function Sv(t,e){var n="".concat(xI).concat(e.replace(":","-"));return new Promise(function(r,i){if(t.getAttribute(n)!==null)return r();var o=Ho(t.children),s=o.filter(function(T){return T.getAttribute(Hp)===e})[0],a=Mr.getComputedStyle(t,e),l=a.getPropertyValue("font-family").match(CI),c=a.getPropertyValue("font-weight"),u=a.getPropertyValue("content");if(s&&!l)return t.removeChild(s),r();if(l&&u!=="none"&&u!==""){var f=a.getPropertyValue("content"),d=~["Sharp"].indexOf(l[2])?ke:le,h=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(l[2])?ma[d][l[2].toLowerCase()]:EI[d][c],p=RD(f),m=p.value,v=p.isSecondary,g=l[0].startsWith("FontAwesome"),y=Hg(h,m),k=y;if(g){var w=XI(m);w.iconName&&w.prefix&&(y=w.iconName,h=w.prefix)}if(y&&!v&&(!s||s.getAttribute(Lg)!==h||s.getAttribute(_g)!==k)){t.setAttribute(n,k),s&&t.removeChild(s);var O=wD(),C=O.extra;C.attributes[Hp]=e,qp(y,h).then(function(T){var j=Vg(_(_({},O),{},{icons:{main:T,mask:Ug()},prefix:h,iconName:k,extra:C,watchable:!0})),L=ue.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?t.insertBefore(L,t.firstChild):t.appendChild(L),L.outerHTML=j.map(function(H){return ja(H)}).join(` `),t.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function jD(t){return Promise.all([Sv(t,"::before"),Sv(t,"::after")])}function ID(t){return t.parentNode!==document.head&&!~wI.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(Hp)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function Ov(t){if($n)return new Promise(function(e,n){var r=Ho(t.querySelectorAll("*")).filter(ID).map(jD),i=Wg.begin("searchPseudoElements");Ww(),Promise.all(r).then(function(){i(),Yp(),e()}).catch(function(){i(),Yp(),n()})})}var DD={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=Ov,n}}},provides:function(e){e.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?ue:r;F.searchPseudoElements&&Ov(i)}}},Cv=!1,LD={mixout:function(){return{dom:{unwatch:function(){Ww(),Cv=!0}}}},hooks:function(){return{bootstrap:function(){bv(Wp("mutationObserverCallbacks",{}))},noAuto:function(){vD()},watch:function(n){var r=n.observeMutationsRoot;Cv?Yp():bv(Wp("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},Ev=function(e){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(r,i){var o=i.toLowerCase().split("-"),s=o[0],a=o.slice(1).join("-");if(s&&a==="h")return r.flipX=!0,r;if(s&&a==="v")return r.flipY=!0,r;if(a=parseFloat(a),isNaN(a))return r;switch(s){case"grow":r.size=r.size+a;break;case"shrink":r.size=r.size-a;break;case"left":r.x=r.x-a;break;case"right":r.x=r.x+a;break;case"up":r.y=r.y-a;break;case"down":r.y=r.y+a;break;case"rotate":r.rotate=r.rotate+a;break}return r},n)},_D={mixout:function(){return{parse:{transform:function(n){return Ev(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=Ev(i)),n}}},provides:function(e){e.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,s=n.iconWidth,a={transform:"translate(".concat(o/2," 256)")},l="translate(".concat(i.x*32,", ").concat(i.y*32,") "),c="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),u="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(l," ").concat(c," ").concat(u)},d={transform:"translate(".concat(s/2*-1," -256)")},h={outer:a,inner:f,path:d};return{tag:"g",attributes:_({},h.outer),children:[{tag:"g",attributes:_({},h.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:_(_({},r.icon.attributes),h.path)}]}]}}}},Od={x:0,y:0,width:"100%",height:"100%"};function Tv(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function zD(t){return t.tag==="g"?t.children:[t]}var $D={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?cf(i.split(" ").map(function(s){return s.trim()})):Ug();return o.prefix||(o.prefix=Pr()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(e){e.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.mask,a=n.maskId,l=n.transform,c=o.width,u=o.icon,f=s.width,d=s.icon,h=_I({transform:l,containerWidth:f,iconWidth:c}),p={tag:"rect",attributes:_(_({},Od),{},{fill:"white"})},m=u.children?{children:u.children.map(Tv)}:{},v={tag:"g",attributes:_({},h.inner),children:[Tv(_({tag:u.tag,attributes:_(_({},u.attributes),h.path)},m))]},g={tag:"g",attributes:_({},h.outer),children:[v]},y="mask-".concat(a||va()),k="clip-".concat(a||va()),w={tag:"mask",attributes:_(_({},Od),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,g]},O={tag:"defs",children:[{tag:"clipPath",attributes:{id:k},children:zD(d)},w]};return r.push(O,{tag:"rect",attributes:_({fill:"currentColor","clip-path":"url(#".concat(k,")"),mask:"url(#".concat(y,")")},Od)}),{children:r,attributes:i}}}},FD={provides:function(e){var n=!1;Mr.matchMedia&&(n=Mr.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:_(_({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var s=_(_({},o),{},{attributeName:"opacity"}),a={tag:"circle",attributes:_(_({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||a.children.push({tag:"animate",attributes:_(_({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:_(_({},s),{},{values:"1;0;1;1;0;1;"})}),r.push(a),r.push({tag:"path",attributes:_(_({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:_(_({},s),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:_(_({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:_(_({},s),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},BD={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),o=i===null?!1:i===""?!0:i;return n.symbol=o,n}}}},HD=[FI,TD,ND,MD,PD,DD,LD,_D,$D,FD,BD];tD(HD,{mixoutsTo:Nt});Nt.noAuto;Nt.config;Nt.library;Nt.dom;var Qp=Nt.parse;Nt.findIconDefinition;Nt.toHtml;var UD=Nt.icon;Nt.layer;Nt.text;Nt.counter;function Nv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cr(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function WD(t,e){if(t==null)return{};var n=VD(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Xp(t){return KD(t)||JD(t)||qD(t)||GD()}function KD(t){if(Array.isArray(t))return Zp(t)}function JD(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function qD(t,e){if(t){if(typeof t=="string")return Zp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zp(t,e)}}function Zp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return qw(t,l)}),i=Object.keys(e.attributes||{}).reduce(function(l,c){var u=e.attributes[c];switch(c){case"class":l.attrs.className=u,delete e.attributes.class;break;case"style":l.attrs.style=e6(u);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?l.attrs[c.toLowerCase()]=u:l.attrs[Jw(c)]=u}return l},{attrs:{}}),o=n.style,s=o===void 0?{}:o,a=WD(n,XD);return i.attrs.style=cr(cr({},i.attrs.style),s),t.apply(void 0,[e.tag,cr(cr({},i.attrs),a)].concat(Xp(r)))}var Gw=!1;try{Gw=!0}catch{}function t6(){if(!Gw&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function Mv(t){if(t&&vu(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(Qp.icon)return Qp.icon(t);if(t===null)return null;if(t&&vu(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}function Cd(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?so({},t,e):{}}var X=M.forwardRef(function(t,e){var n=t.icon,r=t.mask,i=t.symbol,o=t.className,s=t.title,a=t.titleId,l=t.maskId,c=Mv(n),u=Cd("classes",[].concat(Xp(YD(t)),Xp(o.split(" ")))),f=Cd("transform",typeof t.transform=="string"?Qp.transform(t.transform):t.transform),d=Cd("mask",Mv(r)),h=UD(c,cr(cr(cr(cr({},u),f),d),{},{symbol:i,title:s,titleId:a,maskId:l}));if(!h)return t6("Could not find icon",c),null;var p=h.abstract,m={ref:e};return Object.keys(t).forEach(function(v){X.defaultProps.hasOwnProperty(v)||(m[v]=t[v])}),n6(p[0],m)});X.displayName="FontAwesomeIcon";X.propTypes={beat:x.bool,border:x.bool,beatFade:x.bool,bounce:x.bool,className:x.string,fade:x.bool,flash:x.bool,mask:x.oneOfType([x.object,x.array,x.string]),maskId:x.string,fixedWidth:x.bool,inverse:x.bool,flip:x.oneOf([!0,!1,"horizontal","vertical","both"]),icon:x.oneOfType([x.object,x.array,x.string]),listItem:x.bool,pull:x.oneOf(["right","left"]),pulse:x.bool,rotation:x.oneOf([0,90,180,270]),shake:x.bool,size:x.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:x.bool,spinPulse:x.bool,spinReverse:x.bool,symbol:x.oneOfType([x.bool,x.string]),title:x.string,titleId:x.string,transform:x.oneOfType([x.string,x.object]),swapOpacity:x.bool};X.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var n6=qw.bind(null,M.createElement),r6={prefix:"fas",iconName:"strikethrough",icon:[512,512,[],"f0cc","M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H270.1c-.1 0-.3-.1-.4-.1l-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3l0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6l0 0 .2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1H335.1c7 5.6 11.4 11.2 13.9 17.2z"]},i6={prefix:"fas",iconName:"ruler-horizontal",icon:[640,512,[],"f547","M0 336c0 26.5 21.5 48 48 48l544 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48l-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0c-26.5 0-48 21.5-48 48L0 336z"]},o6={prefix:"fas",iconName:"align-justify",icon:[448,512,[],"f039","M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"]},s6={prefix:"fas",iconName:"highlighter",icon:[576,512,[],"f591","M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5l0 0V248.3c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5H224l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7H24c-13.3 0-24-10.7-24-24v-4.7c0-6.4 2.5-12.5 7-17z"]},a6={prefix:"fas",iconName:"underline",icon:[448,512,[],"f0cd","M16 64c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H128V224c0 53 43 96 96 96s96-43 96-96V96H304c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V224c0 88.4-71.6 160-160 160s-160-71.6-160-160V96H48C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32z"]},l6={prefix:"fas",iconName:"bold",icon:[384,512,[],"f032","M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"]},c6={prefix:"fas",iconName:"image",icon:[512,512,[],"f03e","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]},u6={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z"]},f6={prefix:"fas",iconName:"italic",icon:[384,512,[],"f033","M128 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H293.3L160 416h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H90.7L224 96H160c-17.7 0-32-14.3-32-32z"]},d6={prefix:"fas",iconName:"list-ol",icon:[512,512,["list-1-2","list-numeric"],"f0cb","M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]},h6={prefix:"fas",iconName:"code",icon:[640,512,[],"f121","M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"]},p6={prefix:"fas",iconName:"pen",icon:[512,512,[128394],"f304","M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]},m6={prefix:"fas",iconName:"quote-right",icon:[448,512,[8221,"quote-right-alt"],"f10e","M448 296c0 66.3-53.7 120-120 120h-8c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H320c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72zm-256 0c0 66.3-53.7 120-120 120H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72z"]},g6={prefix:"fas",iconName:"align-left",icon:[448,512,[],"f036","M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Jg={prefix:"fas",iconName:"left-long",icon:[512,512,["long-arrow-alt-left"],"f30a","M177.5 414c-8.8 3.8-19 2-26-4.6l-144-136C2.7 268.9 0 262.6 0 256s2.7-12.9 7.5-17.4l144-136c7-6.6 17.2-8.4 26-4.6s14.5 12.5 14.5 22l0 72 288 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-288 0 0 72c0 9.6-5.7 18.2-14.5 22z"]},y6={prefix:"fas",iconName:"align-center",icon:[448,512,[],"f037","M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"]},v6={prefix:"fas",iconName:"rotate-right",icon:[512,512,["redo-alt","rotate-forward"],"f2f9","M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"]},b6={prefix:"fas",iconName:"sun",icon:[512,512,[9728],"f185","M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]},x6={prefix:"fas",iconName:"link",icon:[640,512,[128279,"chain"],"f0c1","M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"]},k6={prefix:"fas",iconName:"list-ul",icon:[512,512,["list-dots"],"f0ca","M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]},w6={prefix:"fas",iconName:"quote-left",icon:[448,512,[8220,"quote-left-alt"],"f10d","M0 216C0 149.7 53.7 96 120 96h8c17.7 0 32 14.3 32 32s-14.3 32-32 32h-8c-30.9 0-56 25.1-56 56v8h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V320 288 216zm256 0c0-66.3 53.7-120 120-120h8c17.7 0 32 14.3 32 32s-14.3 32-32 32h-8c-30.9 0-56 25.1-56 56v8h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H320c-35.3 0-64-28.7-64-64V320 288 216z"]},S6={prefix:"fas",iconName:"moon",icon:[384,512,[127769,9214],"f186","M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"]},O6={prefix:"fas",iconName:"align-right",icon:[448,512,[],"f038","M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Is={prefix:"fas",iconName:"brush",icon:[384,512,[],"f55d","M162.4 6c-1.5-3.6-5-6-8.9-6h-19c-3.9 0-7.5 2.4-8.9 6L104.9 57.7c-3.2 8-14.6 8-17.8 0L66.4 6c-1.5-3.6-5-6-8.9-6H48C21.5 0 0 21.5 0 48V224v22.4V256H9.6 374.4 384v-9.6V224 48c0-26.5-21.5-48-48-48H230.5c-3.9 0-7.5 2.4-8.9 6L200.9 57.7c-3.2 8-14.6 8-17.8 0L162.4 6zM0 288v32c0 35.3 28.7 64 64 64h64v64c0 35.3 28.7 64 64 64s64-28.7 64-64V384h64c35.3 0 64-28.7 64-64V288H0zM192 432a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]};const C6=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,E6=xt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",fe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[sw({find:C6,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});function T6(t){const{src:e,alt:n}=t.node.attrs,{updateAttributes:r}=t,i=()=>{const s=prompt("Set alt text:",n||"");r({alt:s})};let o="image";return t.selected&&(o+=" ProseMirror-selectednode"),b.jsx(l5,{className:o,"data-drag-handle":!0,children:b.jsxs("div",{className:"image-container d-md-block",children:[b.jsx("img",{className:"mx-auto d-block",src:e,alt:n}),b.jsx("div",{className:"image-overlay",children:b.jsxs("span",{className:"image-text mx-auto d-block",children:[n?b.jsx("span",{children:"✔"}):b.jsx("span",{children:"!"}),n?b.jsxs("span",{className:"text",children:['Alt text: "',n,'".']}):b.jsx("span",{className:"text",children:"Alt text missing."}),b.jsx(A,{className:"edit",type:"button",onClick:i,children:"Edit"})]})})]})})}const N6=E6.extend({addNodeView(){return h5(T6)}});function Yw(t,e){return function(){return t.apply(e,arguments)}}const{toString:M6}=Object.prototype,{getPrototypeOf:qg}=Object,ff=(t=>e=>{const n=M6.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),xn=t=>(t=t.toLowerCase(),e=>ff(e)===t),df=t=>e=>typeof e===t,{isArray:Uo}=Array,ba=df("undefined");function P6(t){return t!==null&&!ba(t)&&t.constructor!==null&&!ba(t.constructor)&&$t(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Qw=xn("ArrayBuffer");function A6(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Qw(t.buffer),e}const R6=df("string"),$t=df("function"),Xw=df("number"),hf=t=>t!==null&&typeof t=="object",j6=t=>t===!0||t===!1,$l=t=>{if(ff(t)!=="object")return!1;const e=qg(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},I6=xn("Date"),D6=xn("File"),L6=xn("Blob"),_6=xn("FileList"),z6=t=>hf(t)&&$t(t.pipe),$6=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||$t(t.append)&&((e=ff(t))==="formdata"||e==="object"&&$t(t.toString)&&t.toString()==="[object FormData]"))},F6=xn("URLSearchParams"),B6=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ia(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Uo(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const eS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tS=t=>!ba(t)&&t!==eS;function em(){const{caseless:t}=tS(this)&&this||{},e={},n=(r,i)=>{const o=t&&Zw(e,i)||i;$l(e[o])&&$l(r)?e[o]=em(e[o],r):$l(r)?e[o]=em({},r):Uo(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r(Ia(e,(i,o)=>{n&&$t(i)?t[o]=Yw(i,n):t[o]=i},{allOwnKeys:r}),t),U6=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),V6=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},W6=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&qg(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},K6=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},J6=t=>{if(!t)return null;if(Uo(t))return t;let e=t.length;if(!Xw(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},q6=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qg(Uint8Array)),G6=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},Y6=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Q6=xn("HTMLFormElement"),X6=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pv=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Z6=xn("RegExp"),nS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ia(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},eL=t=>{nS(t,(e,n)=>{if($t(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if($t(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tL=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Uo(t)?r(t):r(String(t).split(e)),n},nL=()=>{},rL=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ed="abcdefghijklmnopqrstuvwxyz",Av="0123456789",rS={DIGIT:Av,ALPHA:Ed,ALPHA_DIGIT:Ed+Ed.toUpperCase()+Av},iL=(t=16,e=rS.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function oL(t){return!!(t&&$t(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const sL=t=>{const e=new Array(10),n=(r,i)=>{if(hf(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=Uo(r)?[]:{};return Ia(r,(s,a)=>{const l=n(s,i+1);!ba(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},aL=xn("AsyncFunction"),lL=t=>t&&(hf(t)||$t(t))&&$t(t.then)&&$t(t.catch),E={isArray:Uo,isArrayBuffer:Qw,isBuffer:P6,isFormData:$6,isArrayBufferView:A6,isString:R6,isNumber:Xw,isBoolean:j6,isObject:hf,isPlainObject:$l,isUndefined:ba,isDate:I6,isFile:D6,isBlob:L6,isRegExp:Z6,isFunction:$t,isStream:z6,isURLSearchParams:F6,isTypedArray:q6,isFileList:_6,forEach:Ia,merge:em,extend:H6,trim:B6,stripBOM:U6,inherits:V6,toFlatObject:W6,kindOf:ff,kindOfTest:xn,endsWith:K6,toArray:J6,forEachEntry:G6,matchAll:Y6,isHTMLForm:Q6,hasOwnProperty:Pv,hasOwnProp:Pv,reduceDescriptors:nS,freezeMethods:eL,toObjectSet:tL,toCamelCase:X6,noop:nL,toFiniteNumber:rL,findKey:Zw,global:eS,isContextDefined:tS,ALPHABET:rS,generateString:iL,isSpecCompliantForm:oL,toJSONObject:sL,isAsyncFn:aL,isThenable:lL};function Z(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}E.inherits(Z,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const iS=Z.prototype,oS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{oS[t]={value:t}});Object.defineProperties(Z,oS);Object.defineProperty(iS,"isAxiosError",{value:!0});Z.from=(t,e,n,r,i,o)=>{const s=Object.create(iS);return E.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Z.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const cL=null;function tm(t){return E.isPlainObject(t)||E.isArray(t)}function sS(t){return E.endsWith(t,"[]")?t.slice(0,-2):t}function Rv(t,e,n){return t?t.concat(e).map(function(i,o){return i=sS(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function uL(t){return E.isArray(t)&&!t.some(tm)}const fL=E.toFlatObject(E,{},null,function(e){return/^is[A-Z]/.test(e)});function pf(t,e,n){if(!E.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=E.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,v){return!E.isUndefined(v[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(e);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(E.isDate(p))return p.toISOString();if(!l&&E.isBlob(p))throw new Z("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(p)||E.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,v){let g=p;if(p&&!v&&typeof p=="object"){if(E.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(E.isArray(p)&&uL(p)||(E.isFileList(p)||E.endsWith(m,"[]"))&&(g=E.toArray(p)))return m=sS(m),g.forEach(function(k,w){!(E.isUndefined(k)||k===null)&&e.append(s===!0?Rv([m],w,o):s===null?m:m+"[]",c(k))}),!1}return tm(p)?!0:(e.append(Rv(v,m,o),c(p)),!1)}const f=[],d=Object.assign(fL,{defaultVisitor:u,convertValue:c,isVisitable:tm});function h(p,m){if(!E.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),E.forEach(p,function(g,y){(!(E.isUndefined(g)||g===null)&&i.call(e,g,E.isString(y)?y.trim():y,m,d))===!0&&h(g,m?m.concat(y):[y])}),f.pop()}}if(!E.isObject(t))throw new TypeError("data must be an object");return h(t),e}function jv(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Gg(t,e){this._pairs=[],t&&pf(t,this,e)}const aS=Gg.prototype;aS.append=function(e,n){this._pairs.push([e,n])};aS.toString=function(e){const n=e?function(r){return e.call(this,r,jv)}:jv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function dL(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lS(t,e,n){if(!e)return t;const r=n&&n.encode||dL,i=n&&n.serialize;let o;if(i?o=i(e,n):o=E.isURLSearchParams(e)?e.toString():new Gg(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Iv{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){E.forEach(this.handlers,function(r){r!==null&&e(r)})}}const cS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hL=typeof URLSearchParams<"u"?URLSearchParams:Gg,pL=typeof FormData<"u"?FormData:null,mL=typeof Blob<"u"?Blob:null,gL={isBrowser:!0,classes:{URLSearchParams:hL,FormData:pL,Blob:mL},protocols:["http","https","file","blob","url","data"]},uS=typeof window<"u"&&typeof document<"u",yL=(t=>uS&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),vL=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bL=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:uS,hasStandardBrowserEnv:yL,hasStandardBrowserWebWorkerEnv:vL},Symbol.toStringTag,{value:"Module"})),mn={...bL,...gL};function xL(t,e){return pf(t,new mn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return mn.isNode&&E.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function kL(t){return E.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wL(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&E.isArray(i)?i.length:s,l?(E.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!E.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&E.isArray(i[s])&&(i[s]=wL(i[s])),!a)}if(E.isFormData(t)&&E.isFunction(t.entries)){const n={};return E.forEachEntry(t,(r,i)=>{e(kL(r),i,n,0)}),n}return null}function SL(t,e,n){if(E.isString(t))try{return(e||JSON.parse)(t),E.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Yg={transitional:cS,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=E.isObject(e);if(o&&E.isHTMLForm(e)&&(e=new FormData(e)),E.isFormData(e))return i?JSON.stringify(fS(e)):e;if(E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e))return e;if(E.isArrayBufferView(e))return e.buffer;if(E.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xL(e,this.formSerializer).toString();if((a=E.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return pf(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),SL(e)):e}],transformResponse:[function(e){const n=this.transitional||Yg.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&E.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Z.from(a,Z.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mn.classes.FormData,Blob:mn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],t=>{Yg.headers[t]={}});const Qg=Yg,OL=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),CL=t=>{const e={};let n,r,i;return t&&t.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&OL[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Dv=Symbol("internals");function ns(t){return t&&String(t).trim().toLowerCase()}function Fl(t){return t===!1||t==null?t:E.isArray(t)?t.map(Fl):String(t)}function EL(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const TL=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Td(t,e,n,r,i){if(E.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!E.isString(e)){if(E.isString(r))return e.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(e)}}function NL(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function ML(t,e){const n=E.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class mf{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=ns(l);if(!u)throw new Error("header name must be a non-empty string");const f=E.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Fl(a))}const s=(a,l)=>E.forEach(a,(c,u)=>o(c,u,l));return E.isPlainObject(e)||e instanceof this.constructor?s(e,n):E.isString(e)&&(e=e.trim())&&!TL(e)?s(CL(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=ns(e),e){const r=E.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return EL(i);if(E.isFunction(n))return n.call(this,i,r);if(E.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ns(e),e){const r=E.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Td(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=ns(s),s){const a=E.findKey(r,s);a&&(!n||Td(r,r[a],a,n))&&(delete r[a],i=!0)}}return E.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||Td(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return E.forEach(this,(i,o)=>{const s=E.findKey(r,o);if(s){n[s]=Fl(i),delete n[o];return}const a=e?NL(o):String(o).trim();a!==o&&delete n[o],n[a]=Fl(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return E.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&E.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Dv]=this[Dv]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ns(s);r[a]||(ML(i,s),r[a]=!0)}return E.isArray(e)?e.forEach(o):o(e),this}}mf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);E.reduceDescriptors(mf.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});E.freezeMethods(mf);const Pn=mf;function Nd(t,e){const n=this||Qg,r=e||n,i=Pn.from(r.headers);let o=r.data;return E.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function dS(t){return!!(t&&t.__CANCEL__)}function Da(t,e,n){Z.call(this,t??"canceled",Z.ERR_CANCELED,e,n),this.name="CanceledError"}E.inherits(Da,Z,{__CANCEL__:!0});function PL(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Z("Request failed with status code "+n.status,[Z.ERR_BAD_REQUEST,Z.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const AL=mn.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];E.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),E.isString(r)&&s.push("path="+r),E.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function RL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function jL(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function hS(t,e){return t&&!RL(e)?jL(t,e):e}const IL=mn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=E.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function DL(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function LL(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,d=0;for(;f!==i;)d+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),c=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const _L=typeof XMLHttpRequest<"u",zL=_L&&function(t){return new Promise(function(n,r){let i=t.data;const o=Pn.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let u;if(E.isFormData(i)){if(mn.hasStandardBrowserEnv||mn.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((u=o.getContentType())!==!1){const[m,...v]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];o.setContentType([m||"multipart/form-data",...v].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",v=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+v))}const d=hS(t.baseURL,t.url);f.open(t.method.toUpperCase(),lS(d,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function h(){if(!f)return;const m=Pn.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),g={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:m,config:t,request:f};PL(function(k){n(k),c()},function(k){r(k),c()},g),f=null}if("onloadend"in f?f.onloadend=h:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(h)},f.onabort=function(){f&&(r(new Z("Request aborted",Z.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new Z("Network Error",Z.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let v=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const g=t.transitional||cS;t.timeoutErrorMessage&&(v=t.timeoutErrorMessage),r(new Z(v,g.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,t,f)),f=null},mn.hasStandardBrowserEnv&&(a&&E.isFunction(a)&&(a=a(t)),a||a!==!1&&IL(d))){const m=t.xsrfHeaderName&&t.xsrfCookieName&&AL.read(t.xsrfCookieName);m&&o.set(t.xsrfHeaderName,m)}i===void 0&&o.setContentType(null),"setRequestHeader"in f&&E.forEach(o.toJSON(),function(v,g){f.setRequestHeader(g,v)}),E.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",Lv(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",Lv(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=m=>{f&&(r(!m||m.type?new Da(null,t,f):m),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=DL(d);if(p&&mn.protocols.indexOf(p)===-1){r(new Z("Unsupported protocol "+p+":",Z.ERR_BAD_REQUEST,t));return}f.send(i||null)})},nm={http:cL,xhr:zL};E.forEach(nm,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const _v=t=>`- ${t}`,$L=t=>E.isFunction(t)||t===null||t===!1,pS={getAdapter:t=>{t=E.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since : `+o.map(_v).join(` `):" "+_v(o[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:nm};function Md(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Da(null,t)}function zv(t){return Md(t),t.headers=Pn.from(t.headers),t.data=Nd.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),pS.getAdapter(t.adapter||Qg.adapter)(t).then(function(r){return Md(t),r.data=Nd.call(t,t.transformResponse,r),r.headers=Pn.from(r.headers),r},function(r){return dS(r)||(Md(t),r&&r.response&&(r.response.data=Nd.call(t,t.transformResponse,r.response),r.response.headers=Pn.from(r.response.headers))),Promise.reject(r)})}const $v=t=>t instanceof Pn?{...t}:t;function Lo(t,e){e=e||{};const n={};function r(c,u,f){return E.isPlainObject(c)&&E.isPlainObject(u)?E.merge.call({caseless:f},c,u):E.isPlainObject(u)?E.merge({},u):E.isArray(u)?u.slice():u}function i(c,u,f){if(E.isUndefined(u)){if(!E.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!E.isUndefined(u))return r(void 0,u)}function s(c,u){if(E.isUndefined(u)){if(!E.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i($v(c),$v(u),!0)};return E.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,d=f(t[u],e[u],u);E.isUndefined(d)&&f!==a||(n[u]=d)}),n}const mS="1.6.8",Xg={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Xg[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Fv={};Xg.transitional=function(e,n,r){function i(o,s){return"[Axios v"+mS+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new Z(i(s," has been removed"+(n?" in "+n:"")),Z.ERR_DEPRECATED);return n&&!Fv[s]&&(Fv[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function FL(t,e,n){if(typeof t!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Z("option "+o+" must be "+l,Z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Z("Unknown option "+o,Z.ERR_BAD_OPTION)}}const rm={assertOptions:FL,validators:Xg},Wn=rm.validators;class bu{constructor(e){this.defaults=e,this.interceptors={request:new Iv,response:new Iv}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Lo(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&rm.assertOptions(r,{silentJSONParsing:Wn.transitional(Wn.boolean),forcedJSONParsing:Wn.transitional(Wn.boolean),clarifyTimeoutError:Wn.transitional(Wn.boolean)},!1),i!=null&&(E.isFunction(i)?n.paramsSerializer={serialize:i}:rm.assertOptions(i,{encode:Wn.function,serialize:Wn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&E.merge(o.common,o[n.method]);o&&E.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=Pn.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,f=0,d;if(!l){const p=[zv.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),d=p.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Da(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Zg(function(i){e=i}),cancel:e}}}const BL=Zg;function HL(t){return function(n){return t.apply(null,n)}}function UL(t){return E.isObject(t)&&t.isAxiosError===!0}const im={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(im).forEach(([t,e])=>{im[e]=t});const VL=im;function gS(t){const e=new Bl(t),n=Yw(Bl.prototype.request,e);return E.extend(n,Bl.prototype,e,{allOwnKeys:!0}),E.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return gS(Lo(t,i))},n}const he=gS(Qg);he.Axios=Bl;he.CanceledError=Da;he.CancelToken=BL;he.isCancel=dS;he.VERSION=mS;he.toFormData=pf;he.AxiosError=Z;he.Cancel=he.CanceledError;he.all=function(e){return Promise.all(e)};he.spread=HL;he.isAxiosError=UL;he.mergeConfig=Lo;he.AxiosHeaders=Pn;he.formToJSON=t=>fS(E.isHTMLForm(t)?new FormData(t):t);he.getAdapter=pS.getAdapter;he.HttpStatusCode=VL;he.default=he;he.interceptors.request.use(t=>{const e=document.cookie.split(";").find(n=>n.trim().startsWith("csrftoken="));return e&&(t.headers["X-CSRFToken"]=e.split("=")[1]),t},t=>Promise.reject(t));const WL=t=>he.get(t),KL=(t,e)=>he.patch(t,e),JL=(t,e)=>he.post(t,e),qL=t=>he.delete(t),Ae={getData:WL,updateData:KL,createData:JL,deleteData:qL};function GL(t){const[e,n]=S.useState(null);S.useState(""),S.useState("");const r=o=>{n(o.target.files[0])},i=async o=>{o.preventDefault();const s=new FormData;s.append("media",e),s.append("resource_type",t.resourceType),s.append("resource_id",t.resourceId);try{const a=await Ae.createData("/data/upload/",s);t.notificationToggler("Media uploaded successfully")}catch{t.notificationToggler("Media upload failed","danger")}};return b.jsxs("form",{onSubmit:i,children:[b.jsx(Rk,{for:"exampleFile",children:"File"}),b.jsx(br,{id:"exampleFile",name:"file",type:"file",onChange:r}),b.jsx(A,{className:"mt-2",type:"submit",children:"Upload"})]})}function YL(t){const[e,n]=S.useState([]),r=async()=>{try{const o=await Ae.getData(`/data/media/${t.resourceType}/${t.resourceId}/`);n(o.data.media)}catch{t.notificationToggler("Error fetching media","danger")}};S.useEffect(()=>{r()},[]);const i=o=>{const s=o.substring(o.lastIndexOf("/")+1);Ae.deleteData(`/data/media/${t.resourceType}/${t.resourceId}/?file=${s}`).then(()=>{t.notificationToggler("Media deleted"),r()}).catch(a=>{t.notificationToggler("Error deleting media","danger")})};return b.jsxs("div",{children:[b.jsx("h4",{children:"Choose media to insert"}),e.map(o=>b.jsxs("div",{className:"mb-2",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"1px"},children:[b.jsx("img",{src:o,style:{width:"150px",height:"auto"}}),b.jsx(A,{color:"success",onClick:()=>t.setMedia(o),style:{cursor:"pointer"},children:"Upload"}),b.jsx(A,{color:"danger",onClick:()=>i(o),style:{cursor:"pointer"},children:"Remove"})]},o))]})}function ey(t){const[e,n]=S.useState("insert"),r=()=>{e==="insert"&&n("upload"),e==="upload"&&n("insert")};return b.jsx("div",{children:b.jsxs(sg,{isOpen:t.modal,toggle:t.toggle,children:[b.jsx(Hu,{toggle:t.toggle,children:t.modalTitle}),b.jsxs(Uu,{children:[b.jsxs(Ve,{children:[b.jsx(A,{outline:!0,active:e==="insert",onClick:()=>r(),children:"Insert Media"}),b.jsx(A,{outline:!0,active:e==="upload",onClick:()=>r(),children:"Upload Media"})]}),b.jsx("div",{className:"mt-3",children:e==="insert"?b.jsx("div",{children:b.jsx(YL,{setMedia:t.setMedia,notificationToggler:t.notificationToggler,resourceType:t.resourceType,resourceId:t.resourceId})}):b.jsx("div",{children:b.jsx(GL,{notificationToggler:t.notificationToggler,resourceType:t.resourceType,resourceId:t.resourceId})})})]}),b.jsx(Vu,{children:b.jsx(A,{color:"secondary",onClick:t.toggle,children:"Cancel"})})]})})}const QL=t=>{const{editor:e}=o5(),n=s=>{e.commands.setImage({src:s})};if(!e)return null;S.useEffect(()=>{if(e){const s=()=>{t.setContent(e.getHTML())};return e.on("update",s),()=>{e.on("update",s)}}},[e]);const r=t.GlobalTheme,i=t.ThemeConfig,o=S.useCallback(()=>{const s=e.getAttributes("link").href,a=window.prompt("URL",s);if(a!==null){if(a===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:a}).run()}},[e]);return e?b.jsxs(b.Fragment,{children:[b.jsxs(Ve,{className:"mt-2",children:[b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().setTextAlign("left").run(),outline:!0,active:e.isActive("left"),children:b.jsx(X,{icon:g6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().setTextAlign("center").run(),outline:!0,active:e.isActive("center"),children:b.jsx(X,{icon:y6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().setTextAlign("right").run(),outline:!0,active:e.isActive("right"),children:b.jsx(X,{icon:O6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().setTextAlign("justify").run(),outline:!0,active:e.isActive("justify"),children:b.jsx(X,{icon:o6})})]}),b.jsxs(Ve,{className:"mt-2",style:{marginLeft:"10px"},children:[b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleBold().run(),disabled:!e.can().chain().focus().toggleBold().run(),outline:!0,active:e.isActive("bold"),children:b.jsx(X,{icon:l6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleItalic().run(),disabled:!e.can().chain().focus().toggleItalic().run(),outline:!0,active:e.isActive("italic"),children:b.jsx(X,{icon:f6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleUnderline().run(),outline:!0,active:e.isActive("underline"),children:b.jsx(X,{icon:a6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHighlight().run(),outline:!0,active:e.isActive("highlight"),children:b.jsx(X,{icon:s6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleStrike().run(),disabled:!e.can().chain().focus().toggleStrike().run(),outline:!0,active:e.isActive("strike"),children:b.jsx(X,{icon:r6})})]}),b.jsx(A,{className:"mt-2",color:i[r].buttonColor,onClick:o,style:{marginLeft:"10px"},outline:!0,active:e.isActive("link"),children:b.jsx(X,{icon:x6})}),b.jsx(A,{className:"mt-2",color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleCodeBlock().run(),style:{marginLeft:"10px"},outline:!0,active:e.isActive("codeBlock"),children:b.jsx(X,{icon:h6})}),b.jsxs(Ve,{className:"mt-2",style:{marginLeft:"10px"},children:[b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().setParagraph().run(),outline:!0,active:e.isActive("paragraph"),children:"p"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),outline:!0,active:e.isActive("heading",{level:1}),children:"h1"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),outline:!0,active:e.isActive("heading",{level:2}),children:"h2"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),outline:!0,active:e.isActive("heading",{level:3}),children:"h3"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:4}).run(),outline:!0,active:e.isActive("heading",{level:4}),children:"h4"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:5}).run(),outline:!0,active:e.isActive("heading",{level:5}),children:"h5"}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleHeading({level:6}).run(),outline:!0,active:e.isActive("heading",{level:6}),children:"h6"})]}),b.jsxs(Ve,{className:"mt-2",style:{marginLeft:"10px"},children:[b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleBulletList().run(),outline:!0,active:e.isActive("bulletList"),children:b.jsx(X,{icon:k6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleOrderedList().run(),outline:!0,active:e.isActive("orderedList"),children:b.jsx(X,{icon:d6})})]}),b.jsxs(A,{className:"mt-2",color:i[r].buttonColor,onClick:()=>e.chain().focus().toggleBlockquote().run(),style:{marginLeft:"10px"},outline:!0,active:e.isActive("blockquote"),children:[b.jsx(X,{icon:w6})," ",b.jsx(X,{icon:m6})]}),b.jsx(A,{className:"mt-2",color:i[r].buttonColor,onClick:()=>e.chain().focus().setHorizontalRule().run(),outline:!0,style:{marginLeft:"10px"},children:b.jsx(X,{icon:i6})}),b.jsxs(Ve,{className:"mt-2",style:{marginLeft:"10px"},children:[b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().undo().run(),disabled:!e.can().chain().focus().undo().run(),children:b.jsx(X,{icon:u6})}),b.jsx(A,{color:i[r].buttonColor,onClick:()=>e.chain().focus().redo().run(),disabled:!e.can().chain().focus().redo().run(),children:b.jsx(X,{icon:v6})})]}),b.jsx(A,{className:"mt-2 ms-2",color:i[r].buttonColor,onClick:()=>t.toggle(),outline:!0,children:b.jsx(X,{icon:c6})}),b.jsx(ey,{setMedia:n,notificationToggler:t.notificationToggler,modal:t.modal,toggle:t.toggle,resourceType:t.resourceType,resourceId:t.resourceId})]}):null},XL=[kj.configure({types:[B1.name,Rp.name]}),B1.configure({types:[Rp.name]}),uI.configure({bulletList:{keepMarks:!0,keepAttributes:!1},orderedList:{keepMarks:!0,keepAttributes:!1}}),Ej,aw,N6,Cj.configure({types:["heading","paragraph"]}),Oj,Yj.configure({openOnClick:!1,autolink:!0})],yS=t=>{const e=t.GlobalTheme,n=t.ThemeConfig,[r,i]=S.useState(!1),o=()=>i(!r);if(t.content&&e&&n)return b.jsx(b.Fragment,{children:b.jsx(s5,{slotBefore:b.jsx(QL,{resourceType:t.resourceType,resourceId:t.resourceId,modal:r,toggle:o,notificationToggler:t.notificationToggler,setContent:t.setContent,GlobalTheme:e,ThemeConfig:n}),extensions:XL,content:t.content})})},ZL=t=>`${t}`,gf={getMedia:ZL};function e_(t){const[e,n]=S.useState(""),[r,i]=S.useState(!1),[o,s]=S.useState(!1),[a,l]=S.useState(!1),c=S.useRef(null),u=t.UserData?t.UserData:b.jsx(_r,{children:" Loading... "}),f=t.GlobalTheme,d=t.ThemeConfig,h=async()=>{let v=await t.setInfo("/data/shared/update/user-data/",{name:c.current.value,intro_content:e,profile_photo:r?r!=="-"?r:"":u.profilePhoto});console.log(v),v===200&&t.notificationToggler("Data saved successfully!"),[500,404,403,400].includes(v)&&t.notificationToggler("Something failed!","danger")},p=()=>{l(!a)},m=(v,g)=>{console.log(v),g==="nameField"&&s(v==="")};if(S.useEffect(()=>{n(u.introContent)},[u]),S.useEffect(()=>{r&&(h(),r!=="-"&&p())},[r]),f&&d)return b.jsxs(Lr,{fluid:!0,className:`${d[f].textColor} ${d[f].background}`,children:[b.jsx(ey,{setMedia:i,notificationToggler:t.notificationToggler,modal:a,toggle:p,resourceType:"homepage",resourceId:"homepage"}),b.jsxs(ht,{className:"mb-4",children:[b.jsx(ae,{xs:"3",className:"d-none d-md-block"}),b.jsxs(ae,{className:"p-0",children:[b.jsxs(ht,{className:"d-md-block",children:[b.jsx(ae,{xs:"4",className:"d-none d-md-block"}),u.profilePhoto!==""&&b.jsx("center",{children:b.jsx("img",{style:{width:"180px",height:"180px",objectFit:"cover"},className:"mt-5 mb-2 rounded-circle",src:gf.getMedia(u.profilePhoto),alt:"Profile Photo"})}),b.jsx(ae,{xs:"4",className:"d-none d-md-block"})]}),b.jsx(ht,{children:b.jsxs(Ve,{className:"mt-4",children:[b.jsx(A,{outline:!0,color:d[f].buttonColor,onClick:()=>p(),children:"Set Profile Photo"}),b.jsx(A,{outline:!0,color:d[f].buttonColor,onClick:()=>i("-"),children:"Remove Profile Photo"})]})})]}),b.jsx(ae,{xs:"3",className:"d-none d-md-block"})]}),b.jsxs(ht,{className:"mr-2 ml-2 mb-2 mt-1 blogContent",children:[b.jsx(ae,{xs:"3",className:"d-none d-md-block"}),b.jsxs(ae,{md:"6",xs:"12",children:[b.jsxs(xr,{className:"mb-5",children:[b.jsx(kr,{children:"Name"}),b.jsx(br,{invalid:o,innerRef:c,defaultValue:u.name,onChange:()=>m(c.current.value,"nameField")}),o&&b.jsx(Os,{tooltip:!0,className:"mt-1",children:"This field cannot be empty"})]}),b.jsx(yS,{notificationToggler:t.notificationToggler,GlobalTheme:f,ThemeConfig:d,content:u.introContent,setContent:n,resourceType:"homepage",resourceId:"homepage"}),b.jsx(A,{className:"mt-3 mb-2",onClick:()=>h(),color:d[f].buttonColor,outline:!0,children:"Save Data"})]}),b.jsx(ae,{xs:"3",className:"d-none d-md-block"})]})]})}function vS(t){return b.jsx("div",{children:b.jsxs(sg,{isOpen:t.modal,toggle:t.toggle,children:[b.jsx(Hu,{toggle:t.toggle,children:t.modalTitle}),b.jsx(Uu,{children:t.modalText}),b.jsxs(Vu,{children:[b.jsx(A,{color:"primary",onClick:t.confirmAction,children:"Yes"})," ",b.jsx(A,{color:"secondary",onClick:t.toggle,children:"Cancel"})]})]})})}function om(t){const[e,n]=S.useState(!1),[r,i]=S.useState(!1),[o,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState(!1),[f,d]=S.useState(!1),h=()=>l(!a),p=S.useRef(null),m=S.useRef(null),v=S.useRef(null),g=(O,C)=>{C==="nameField"&&n(O===""),C==="descriptionField"&&i(O===""),C==="taglineField"&&s(O===""),t.addToIdsToUpdate({id:t.id,name:p.current.value,featuredBlog:"",description:m.current.value,tagLine:v.current.value})},y=()=>{d("Confirm"),u("Are you sure that you wish to delete this category?"),h()},k=()=>{t.deleteResource(t.id),h()},w=t.itemObject;return t.totalItems>0&&w&&Object.keys(w).length!==0?t.resourceType==="categories"?b.jsxs(b.Fragment,{children:[b.jsx(vS,{modalText:c,modalTitle:f,modal:a,toggle:h,confirmAction:k}),b.jsx(To,{color:t.borderColor,outline:!0,className:`my-2 ${t.bgColor}`,style:{width:t.cardType==="smallCard"?"18rem":"100%"},children:b.jsxs(No,{children:[b.jsx(ra,{className:`mb-3 ${t.textColor}`,tag:"h5",children:b.jsxs(xr,{children:[b.jsx(kr,{children:"Name"}),b.jsx(br,{defaultValue:w.name,invalid:e,innerRef:p,onChange:()=>g(p.current.value,"nameField")}),e?b.jsx(Os,{tooltip:!0,className:"mt-1",children:"This field cannot be empty"}):""]})}),b.jsx(_i,{className:`${t.textColor}`,children:b.jsxs(xr,{children:[b.jsx(kr,{children:"Description"}),b.jsx(br,{defaultValue:w.description,invalid:r,innerRef:m,onChange:()=>g(m.current.value,"descriptionField")}),r?b.jsx(Os,{tooltip:!0,className:"mt-1",children:"This field cannot be empty"}):""]})}),b.jsx(_i,{children:b.jsx("small",{className:`${t.textColor}`,children:b.jsxs(xr,{children:[b.jsx(kr,{children:"Tagline"}),b.jsx(br,{defaultValue:w.tagLine,invalid:o,innerRef:v,onChange:()=>g(v.current.value,"taglineField")}),o?b.jsx(Os,{tooltip:!0,className:"mt-1",children:"This field cannot be empty"}):""]})})}),b.jsxs(_i,{children:[b.jsx(ea,{className:`${t.textColor}`,to:`/${t.resourceType}/${w.id}`,children:"Open this resource"}),b.jsx(A,{color:"danger",onClick:()=>y(),className:"m-2",children:"Delete Category"})]})]})})]}):b.jsxs(To,{color:t.borderColor,outline:!0,className:`my-2 ${t.bgColor}`,style:{width:t.cardType==="smallCard"?"18rem":"100%"},children:[w.coverImage!==""?b.jsx(Nk,{src:gf.getMedia(w.coverImage),style:{height:"180px",objectFit:"cover"},top:!0,width:"100%"}):"",b.jsx(No,{children:b.jsxs(ea,{to:`/${t.resourceType}/${w.id}`,children:[b.jsx(ra,{className:`${t.textColor}`,tag:"h3",children:w.name}),b.jsx(_i,{className:`${t.textColor}`,tag:"h5",children:w.description}),b.jsx(_i,{tag:"h6",children:b.jsx("small",{className:`${t.textColor}`,children:w.tagLine})})]})}),b.jsxs(Ve,{children:[b.jsx(A,{outline:!0,active:w.id===t.featuredBlog,onClick:()=>t.updateFeaturedBlog(w.id),children:"Set this as featured"}),b.jsx(A,{outline:!0,onClick:()=>t.updateFeaturedBlog(""),children:"Unset featured blog"})]})]}):b.jsx("h3",{className:`${t.textColor}`,children:"No items found in this section"})}function t_(t){let e=$u();const n=t.GlobalTheme,r=t.ThemeConfig,[i,o]=S.useState([]),[s,a]=S.useState({});S.useEffect(()=>{l()},[]);const l=()=>{Ae.getData("/data/category/").then(h=>{let p=h.data,m=[];for(let v of p)m.push({id:v.category_id,name:v.name,featuredBlog:v.featured_id,description:v.description,tagLine:v.tagline,coverImage:v.cover_image});o(m)})},c=h=>{let p={...s};p[h.id]={name:h.name,featured_blog:h.featuredBlog,description:h.description,tagline:h.tagLine,cover_image:h.coverImage},a(p)},u=h=>{Ae.deleteData(`/data/category/delete/${h}/`).then(p=>{t.notificationToggler("Category successfully deleted"),l()}).catch(p=>{t.notificationToggler("Failed to delete category","danger")})},f=()=>{Ae.createData("/data/category/create/",{name:"Enter name",featured_id:"",description:"Enter description",tagline:"Enter tagline",cover_image:""}).then(h=>{t.notificationToggler("Category created successfully"),l()}).catch(h=>{t.notificationToggler("Failed to add category","danger")})},d=()=>{for(let h of Object.keys(s))Ae.updateData(`/data/category/update/${h}/`,s[h]).then(p=>{t.notificationToggler("Category data updated successfully")}).catch(p=>{t.notificationToggler("Failed to update category data","danger")});l()};return n&&r?b.jsxs(Lr,{fluid:!0,className:`p-0 mb-2 ${r[n].background}`,children:[b.jsx(ae,{xs:"3",className:"d-md-block",children:b.jsx(A,{color:r[n].buttonColor,onClick:()=>e("/"),className:"ms-5 mt-5",outline:!0,children:b.jsx(X,{icon:Jg})})}),b.jsx(ht,{className:"justify-content-center align-items-center",children:b.jsxs(ae,{className:"d-flex flex-column align-items-center",children:[b.jsx("div",{className:"w-100",children:b.jsx(To,{className:`my-2 ${r[n].background}`,style:{width:"100%",border:"none"},children:b.jsx(No,{children:b.jsxs(ra,{style:{display:"grid"},className:`${r[n].textColor} justify-content-center`,tag:"h1",children:["Categories",b.jsx(A,{className:"mt-2",color:r[n].buttonColor,outline:!0,onClick:()=>f(),children:"Add New"})]})})})}),b.jsxs("div",{className:"",style:{width:"70%",margin:"auto"},children:[i.length>0?i.map((h,p)=>b.jsx(om,{id:h.id,totalItems:i.length,addToIdsToUpdate:c,cardType:"longCard",deleteResource:u,resourceType:"categories",textColor:r[n].textColor,bgColor:r[n].background,borderColor:r[n].borderColor,buttonColor:r[n].buttonColor,notificationToggler:t.notificationToggler,itemObject:h},h.id)):b.jsx(_r,{}),b.jsx(A,{className:"mt-3 mb-2",onClick:()=>d(),color:r[n].buttonColor,outline:!0,children:"Save Data"})]})]})})]}):null}function bS(t){const[e,n]=S.useState([]),r=()=>{Ae.getData("/data/category/").then(a=>{let l=a.data,c=[];for(let u of l)c.push({id:u.category_id,name:u.name,featuredBlog:u.featured_id,description:u.description,tagLine:u.tagline,coverImage:u.cover_image});n(c)})};S.useEffect(()=>{r()},[]);const i={height:"auto",width:"auto",overflowX:"auto",display:"grid"},o=t.GlobalTheme,s=t.ThemeConfig;if(o&&s)return b.jsx(Lr,{fluid:!0,className:`${s[o].background}`,children:b.jsx(ht,{style:i,children:b.jsx("center",{style:{marginTop:"1.5em",marginBottom:"1.5em"},children:b.jsx(ae,{children:b.jsx(Ve,{style:{marginTop:"15px",marginBottom:"15px"},children:e.length>0?e.map((a,l)=>b.jsx(A,{className:"btn-lg",color:`${s[o].buttonColor}`,outline:!0,active:t.currentPage===a.id,children:b.jsx(ea,{className:"p-3",to:`/categories/${a.id}`,children:a.name})},a.id)):b.jsx(_r,{})})})})})})}function n_(t){const{categoryID:e}=lk();let n=$u();const r=t.GlobalTheme,i=t.ThemeConfig,[o,s]=S.useState("loading"),[a,l]=S.useState(null),c=()=>{Ae.getData(`/data/category/${e}/`).then(d=>{let h=d.data,p=[],m={id:h.category_id,name:h.name,coverImage:h.cover_image,tagLine:h.tagline,description:h.description,featuredBlog:h.featured_id,blogMetadata:h.blog_metadata};for(let v of h.blog_metadata)p.push({id:v.blog_id,name:v.name,description:v.description,tagLine:v.tagline,coverImage:v.cover_image,parentCategory:v.parent_category});m.blogMetadata=p,s(m),l(p.find(v=>v.id===m.featuredBlog))})};S.useEffect(()=>{c()},[e]);const u=()=>{Ae.createData("/data/blog/create/",{name:"Enter a blog name",description:"Enter a description",tagline:"Enter a tagline",cover_image:"",content_body:"

",parent_category:e}).then(d=>{t.notificationToggler("New blog created"),c()}).catch(d=>{t.notificationToggler("Failed to add a new blog","danger")})},f=d=>{Ae.updateData(`/data/category/update/${e}/`,{featured_id:d}).then(h=>{d?t.notificationToggler("Blog set as featured"):t.notificationToggler("Featured blog removed"),c()})};return r&&i?b.jsxs(Lr,{fluid:!0,className:`mb-2 p-0 ${i[r].background}`,children:[b.jsx(ae,{className:"d-md-block",children:b.jsx(A,{color:i[r].buttonColor,onClick:()=>n("/categories/"),className:"ms-5 mt-5",outline:!0,children:b.jsx(X,{icon:Jg})})}),b.jsx(bS,{currentPage:e,GlobalTheme:r,ThemeConfig:i}),b.jsx(ht,{className:"justify-content-center align-items-center",children:b.jsxs(ae,{className:"d-flex flex-column align-items-center",children:[b.jsx("div",{className:"w-100",children:b.jsx(To,{className:`my-2 ${i[r].background}`,style:{width:"100%",border:"none"},children:b.jsx(No,{children:b.jsxs(ra,{style:{display:"grid"},className:`${i[r].textColor} justify-content-center`,tag:"h1",children:[`Blogs in ${o.name}`,b.jsx(A,{className:"mt-2",color:i[r].buttonColor,outline:!0,onClick:()=>u(),children:"Add New"})]})})})}),b.jsxs("div",{className:"container",children:[a?b.jsx(om,{totalItems:a==="nodata"?0:1,cardType:"longCard",resourceType:"blog",textColor:i[r].textColor,bgColor:i[r].background,borderColor:i[r].borderColor,itemObject:a},a.id):"",b.jsx(ht,{children:o==="loading"?b.jsx(_r,{}):o.blogMetadata.map((d,h)=>b.jsx(ae,{children:b.jsx("div",{className:`p-2 ml-2 ${i[r].textColor}`,children:b.jsx(om,{totalItems:o.blogMetadata.length,featuredBlog:o.featuredBlog,updateFeaturedBlog:f,cardType:"smallCard",resourceType:"blog",textColor:i[r].textColor,bgColor:i[r].background,borderColor:i[r].borderColor,itemObject:d})})},d.blog_id))})]})]})})]}):null}function r_(t){let e=$u();const n=S.useRef(null),r=S.useRef(null),i=S.useRef(null),{blogID:o}=lk(),s=t.GlobalTheme,a=t.ThemeConfig,[l,c]=S.useState([]),[u,f]=S.useState(),[d,h]=S.useState(!1),[p,m]=S.useState(!1),[v,g]=S.useState(!1),[y,k]=S.useState(!1),[w,O]=S.useState(!1),C=()=>m(!p),T=()=>O(!w),j=Je=>{Ae.updateData(`/data/blog/update/${o}/`,{name:n.current.value,description:r.current.value,tagline:i.current.value,content_body:u,cover_image:d?d!=="-"?d:"":l.coverImage}).then(Te=>{t.notificationToggler("Blog data saved!"),pe()}).catch(Te=>{t.notificationToggler("Failed to update blog!","danger")})},L=()=>{k("Confirm"),g("Are you sure that you wish to delete this blog?"),C()},H=()=>{Ae.deleteData(`/data/blog/delete/${l.id}/`).then(Je=>{t.notificationToggler("Blog successfully deleted"),e(`/categories/${l.parentCategory}`)}).catch(Je=>{t.notificationToggler("Failed to delete blog","danger")}),C()},pe=()=>{Ae.getData(`/data/blog/${o}/`).then(Je=>{let Te=Je.data;c({id:Te.blog_id,name:Te.name,description:Te.description,tagLine:Te.tagline,coverImage:Te.cover_image,parentCategory:Te.parent_category}),f(Te.content_body)})};return S.useEffect(()=>{pe()},[]),S.useEffect(()=>{d&&(j(),d!=="-"&&T())},[d]),s&&a&&l?b.jsxs(Lr,{fluid:!0,className:`${a[s].background}`,children:[b.jsx(vS,{modalText:v,modalTitle:y,modal:p,toggle:C,confirmAction:H}),b.jsx(ey,{setMedia:h,notificationToggler:t.notificationToggler,modal:w,toggle:T,resourceType:"blog",resourceId:l.id}),b.jsx(ae,{xs:"3",className:"d-md-block",children:b.jsx(A,{color:a[s].buttonColor,onClick:()=>e(`/categories/${l.parentCategory}`),className:"ms-5 mt-5",outline:!0,children:b.jsx(X,{icon:Jg})})}),b.jsx(bS,{currentPage:l.parentCategory,GlobalTheme:s,ThemeConfig:a}),b.jsx(ht,{className:"mb-4",children:b.jsx(ae,{className:"p-0",children:l.coverImage!==""?b.jsx("img",{src:gf.getMedia(l.coverImage),alt:"Banner",style:{width:"100%",height:"auto",maxHeight:"20vh",objectFit:"cover"}}):""})}),b.jsxs(ht,{className:"mr-2 ml-2 mb-2 mt-1 blogContent",children:[b.jsx(ae,{xs:"3",className:"d-none d-md-block"}),b.jsxs(ae,{xs:`${window.screen.width>=765?"6":""}`,children:[b.jsx(A,{color:"danger",onClick:()=>L(),className:"mb-5",children:"Delete Blog"}),b.jsxs(Ve,{className:"mb-5 ms-5",children:[b.jsx(A,{outline:!0,color:a[s].buttonColor,onClick:()=>T(),children:"Set Cover Image"}),b.jsx(A,{outline:!0,color:a[s].buttonColor,onClick:()=>h("-"),children:"Remove Cover Image"})]}),b.jsxs(xr,{className:"mb-3",children:[b.jsx(kr,{children:"Name"}),b.jsx(br,{innerRef:n,defaultValue:l.name})]}),b.jsxs(xr,{className:"mb-3",children:[b.jsx(kr,{children:"Description"}),b.jsx(br,{innerRef:r,defaultValue:l.description})]}),b.jsxs(xr,{children:[b.jsx(kr,{children:"Tagline"}),b.jsx(br,{innerRef:i,defaultValue:l.tagLine})]})]}),b.jsx(ae,{xs:"3",className:"d-none d-md-block"})]}),b.jsx(ht,{className:`my-2 ${a[s].background}`,children:b.jsx(ae,{children:b.jsx("hr",{style:{borderColor:`${a[s].borderColor}`}})})}),b.jsxs(ht,{className:"mr-2 ml-2 mt-1",children:[b.jsx(ae,{xs:"3",className:"d-none d-md-block"}),b.jsxs(ae,{className:`blogContent ${a[s].textColor}`,style:{marginBottom:"25px"},children:[b.jsx(yS,{notificationToggler:t.notificationToggler,setContent:f,GlobalTheme:s,ThemeConfig:a,content:u,resourceType:"blog",resourceId:l.id}),b.jsx(A,{className:"mt-3 mb-2",onClick:Je=>j(),color:a[s].buttonColor,outline:!0,children:"Save Data"})]}),b.jsx(ae,{xs:"3",className:"d-none d-md-block"})]})]}):b.jsx(_r,{})}function i_(t){const[e,n]=S.useState(null);S.useEffect(()=>{r()},[]);const r=async()=>{try{const o=await Ae.getData("/data/publish/methods/");n(o.data)}catch{t.notificationToggler("Error fetching methods","danger")}},i=async o=>{try{const s=await Ae.getData(`/data/publish/${o}/`);t.notificationToggler("Deployment Sucess")}catch{t.notificationToggler("Deployment Failed","danger")}};return b.jsx("div",{children:b.jsxs(sg,{isOpen:t.modal,toggle:t.toggle,children:[b.jsx(Hu,{toggle:t.toggle,children:"Publish Website"}),b.jsxs(Uu,{children:[b.jsx("h4",{children:"Select a publish method"}),e?Object.values(e).map((o,s)=>b.jsx("div",{className:"mb-3",children:b.jsx(A,{color:"danger",onClick:()=>i(s),children:o},s)})):""]}),b.jsx(Vu,{children:b.jsx(A,{color:"secondary",onClick:t.toggle,children:"Cancel"})})]})})}function o_(t){const e=t.GlobalTheme,n=t.ThemeConfig,r=t.UserData;S.useState("");const[i,o]=S.useState("lightTheme"),[s,a]=S.useState("lightTheme"),[l,c]=S.useState(!1),u=()=>{c(!l)},f=async(d,h,p)=>{let m={...n};d&&h&&(m[e].navBar[d]=`${h}`);let v=await t.setInfo("/data/shared/update/theme-config/",e==="darkTheme"?{default_theme:p,dark_theme:JSON.stringify(m[e])}:{default_theme:p,light_theme:JSON.stringify(m[e])});v===200&&t.notificationToggler(`Color set for ${n[e].theme} successfully!`),[500,404,403].includes(v)&&t.notificationToggler("Something failed!","danger")};if(S.useEffect(()=>{t.ThemeSwitcher(i)},[i]),S.useEffect(()=>{o(t.ThemeConfig.defaultTheme),a(t.ThemeConfig.defaultTheme)},[]),e&&n&&r)return b.jsx("header",{className:"header-global",id:"site-header",children:b.jsx(bk,{className:`navbar-horizontal ${n[e].navBar.navBarTheme} ${n[e].navBar.background}`,expand:"lg",children:b.jsxs(Lr,{children:[b.jsx(i_,{notificationToggler:t.notificationToggler,modal:l,toggle:u}),b.jsx(xk,{children:b.jsxs(ea,{to:"/",children:[r.profilePhoto!==""?b.jsx("img",{style:{width:"40px",height:"40px",objectFit:"cover",marginRight:"10px"},className:"rounded-circle",src:gf.getMedia(r.profilePhoto)}):"",b.jsx(A,{color:`${n?n[e].navBar.buttonColor:""}`,size:"lg",children:r?r.name:b.jsx(_r,{children:" Loading... "})})]})}),b.jsx(kk,{className:"ml-lg-auto",navbar:!0,children:b.jsxs(wk,{children:[b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px",marginRight:"15px"},children:[b.jsx(A,{color:`${n?n[e].navBar.buttonColor:""}`,children:b.jsxs(ea,{to:"/categories",children:[b.jsx(X,{icon:p6})," Blogs"]})}),b.jsxs(A,{color:`${n?n[e].navBar.buttonColor:""}`,outline:!0,onClick:()=>{o("lightTheme")},active:i==="lightTheme",children:[b.jsx(X,{icon:b6})," Light Theme"]}),b.jsxs(A,{color:`${n?n[e].navBar.buttonColor:""}`,outline:!0,onClick:()=>{o("darkTheme")},active:i==="darkTheme",children:[b.jsx(X,{icon:S6})," Dark Theme"]})]}),b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px",marginRight:"15px"},children:[b.jsxs(A,{disabled:!0,color:`${n?n[e].navBar.buttonColor:""}`,children:[b.jsx(X,{icon:Is})," Set color"]}),b.jsx(A,{color:"primary",onClick:()=>f("background","bg-primary",n.defaultTheme)}),b.jsx(A,{color:"secondary",onClick:()=>f("background","bg-secondary",n.defaultTheme)}),b.jsx(A,{color:"success",onClick:()=>f("background","bg-success",n.defaultTheme)}),b.jsx(A,{color:"danger",onClick:()=>f("background","bg-danger",n.defaultTheme)}),b.jsx(A,{color:"warning",onClick:()=>f("background","bg-warning",n.defaultTheme)}),b.jsx(A,{color:"info",onClick:()=>f("background","bg-info",n.defaultTheme)}),b.jsx(A,{color:"light",onClick:()=>f("background","bg-light",n.defaultTheme)}),b.jsx(A,{color:"dark",onClick:()=>f("background","bg-dark",n.defaultTheme)})]}),b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px"},children:[b.jsxs(A,{disabled:!0,color:`${n?n[e].navBar.buttonColor:""}`,children:[b.jsx(X,{icon:Is})," Set button color"]}),b.jsx(A,{color:"light",onClick:()=>f("buttonColor","light",n.defaultTheme),children:"White"}),b.jsx(A,{color:"dark",onClick:()=>f("buttonColor","black",n.defaultTheme),children:"Black"})]}),b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px"},children:[b.jsxs(A,{disabled:!0,color:`${n?n[e].navBar.buttonColor:""}`,children:[b.jsx(X,{icon:Is})," Default Theme"]}),b.jsx(A,{color:`${n?n[e].navBar.buttonColor:""}`,outline:!0,onClick:()=>f(null,null,"lightTheme"),children:"Light Theme"}),b.jsx(A,{color:`${n?n[e].navBar.buttonColor:""}`,outline:!0,onClick:()=>f(null,null,"darkTheme"),children:"Dark Theme"})]}),b.jsx(A,{color:`${n?n[e].navBar.buttonColor:""}`,className:"ms-5",outline:!0,onClick:()=>u(),children:"Publish Data"})]})})]})})})}const s_=t=>{const e=t.GlobalTheme,n=t.ThemeConfig,r=t.UserData,i=async(o,s)=>{let a={...n};a[e].footer[o]=`${s}`;let l=await t.setInfo("/data/shared/update/theme-config/",e==="darkTheme"?{dark_theme:JSON.stringify(a[e])}:{light_theme:JSON.stringify(a[e])});l===200&&t.notificationToggler(`Color set for ${n[e].theme} successfully!`),[500,404,403].includes(l)&&t.notificationToggler("Something failed!","danger")};return b.jsx("footer",{className:`footer p-4 ${n?n[e].footer.background+" "+n[e].footer.text:""}`,id:"site-footer",children:b.jsx(Lr,{className:"p-1",children:b.jsxs(ht,{children:[b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px",marginRight:"15px"},children:[b.jsxs(A,{disabled:!0,color:`${n?n[e].navBar.buttonColor:""}`,children:[b.jsx(X,{icon:Is})," Set color"]}),b.jsx(A,{color:"primary",onClick:()=>i("background","bg-primary")}),b.jsx(A,{color:"secondary",onClick:()=>i("background","bg-secondary")}),b.jsx(A,{color:"success",onClick:()=>i("background","bg-success")}),b.jsx(A,{color:"danger",onClick:()=>i("background","bg-danger")}),b.jsx(A,{color:"warning",onClick:()=>i("background","bg-warning")}),b.jsx(A,{color:"info",onClick:()=>i("background","bg-info")}),b.jsx(A,{color:"light",onClick:()=>i("background","bg-light")}),b.jsx(A,{color:"dark",onClick:()=>i("background","bg-dark")})]}),b.jsxs(Ve,{style:{marginTop:"15px",marginBottom:"15px"},children:[b.jsxs(A,{disabled:!0,color:`${n?n[e].navBar.buttonColor:""}`,children:[b.jsx(X,{icon:Is})," Set footer text color"]}),b.jsx(A,{color:"light",onClick:()=>i("text","text-white"),children:"White"}),b.jsx(A,{color:"dark",onClick:()=>i("text","text-black"),children:"Black"})]}),b.jsx(ae,{md:"12",children:b.jsxs("div",{className:"blogContent text-center text-md-left mt-3",children:[new Date().getFullYear(),", ",b.jsx("a",{className:`${n[e].linkBackground} ${n[e].linkTextColor}`,href:"/",children:r?r.name:b.jsx(_r,{children:" Loading... "})}),b.jsx("br",{}),b.jsx("div",{className:"m-2",children:r.builtWith?b.jsxs("span",{children:["Built with ",b.jsx("a",{target:"_blank",className:`${n[e].linkBackground} ${n[e].linkTextColor}`,href:"https://github.com/barunespadhy/rangolio",children:"Rangolio"})]}):""})]})})]})})})};function a_(t){return b.jsx(M.StrictMode,{children:b.jsx(H3,{isOpen:t.isOpen,...t,children:b.jsx(To,{children:b.jsx(No,{children:b.jsx(jk,{color:t.message.color,children:t.message.message})})})})})}function l_(){const[t,e]=S.useState(null),[n,r]=S.useState(null),[i,o]=S.useState("lightTheme"),[s,a]=S.useState(!1),[l,c]=S.useState(""),u=(p,m)=>{a(!0),c({message:p,color:m}),setTimeout(()=>{a(!1)},1500)},f=async(p,m)=>{try{const v=await Ae.updateData(p,m);return d(),v.status}catch(v){return v.response?v.response.status:500}},d=()=>{Ae.getData("/data/shared/user-data/").then(p=>{let m=p.data[0];e({name:m.name,introContent:m.intro_content,profilePhoto:m.profile_photo,builtWith:m.built_with}),document.title=m.name}),Ae.getData("/data/shared/theme-config/").then(p=>{let m=p.data[0];r({defaultTheme:m.default_theme,darkTheme:JSON.parse(m.dark_theme),lightTheme:JSON.parse(m.light_theme)})})};S.useEffect(()=>{d()},[]);const h=p=>{o(p)};if(n&&t&&i)return b.jsx("div",{className:"app-container",children:b.jsxs(BE,{children:[b.jsx(o_,{className:"header",ThemeSwitcher:h,GlobalTheme:i,ThemeConfig:n,UserData:t,notificationToggler:u,setInfo:f}),b.jsx("div",{className:`p-0 ${n[i].background}`,children:b.jsxs(IE,{children:[b.jsx(ls,{path:"/",element:b.jsx(e_,{notificationToggler:u,GlobalTheme:i,ThemeConfig:n,UserData:t,setInfo:f})}),b.jsx(ls,{path:"/categories",element:b.jsx(t_,{notificationToggler:u,GlobalTheme:i,ThemeConfig:n})}),b.jsx(ls,{path:"/categories/:categoryID",element:b.jsx(n_,{notificationToggler:u,GlobalTheme:i,ThemeConfig:n})}),b.jsx(ls,{path:"/blog/:blogID",element:b.jsx(r_,{notificationToggler:u,GlobalTheme:i,ThemeConfig:n})})]})}),b.jsx(s_,{notificationToggler:u,setInfo:f,className:"footer",ThemeSwitcher:h,GlobalTheme:i,ThemeConfig:n,UserData:t}),b.jsx(a_,{style:{width:"20%"},className:"fixed-top",isOpen:s,message:l})]})})}Pd.createRoot(document.getElementById("root")).render(b.jsx(M.StrictMode,{children:b.jsx(l_,{})}));