@valbuild/ui 0.62.2 → 0.62.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +22 -21
- package/server/.tmp/assets/{index-pKuZDzpw.css → index-GtCVWcmy.css} +1 -1
- package/server/.tmp/assets/index-oTAoLk94.js +432 -0
- package/server/.tmp/index.html +2 -2
- package/server/dist/valbuild-ui-server.cjs.js +1 -1
- package/server/dist/valbuild-ui-server.esm.js +1 -1
- package/server/.tmp/assets/index-Um3617EO.js +0 -219
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
var JR=Object.defineProperty;var QR=(t,e,n)=>e in t?JR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ot=(t,e,n)=>(QR(t,typeof e!="symbol"?e+"":e,n),n),e$=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var ug=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var df=(t,e,n)=>(e$(t,e,"access private method"),n);function t$(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var n$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ui(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var GE={exports:{}},Ne={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Bd=Symbol.for("react.element"),o$=Symbol.for("react.portal"),i$=Symbol.for("react.fragment"),s$=Symbol.for("react.strict_mode"),a$=Symbol.for("react.profiler"),l$=Symbol.for("react.provider"),c$=Symbol.for("react.context"),u$=Symbol.for("react.forward_ref"),d$=Symbol.for("react.suspense"),f$=Symbol.for("react.memo"),p$=Symbol.for("react.lazy"),Eb=Symbol.iterator;function h$(t){return t===null||typeof t!="object"?null:(t=Eb&&t[Eb]||t["@@iterator"],typeof t=="function"?t:null)}var YE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XE=Object.assign,ZE={};function sc(t,e,n){this.props=t,this.context=e,this.refs=ZE,this.updater=n||YE}sc.prototype.isReactComponent={};sc.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")};sc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function JE(){}JE.prototype=sc.prototype;function A0(t,e,n){this.props=t,this.context=e,this.refs=ZE,this.updater=n||YE}var I0=A0.prototype=new JE;I0.constructor=A0;XE(I0,sc.prototype);I0.isPureReactComponent=!0;var _b=Array.isArray,QE=Object.prototype.hasOwnProperty,D0={current:null},e_={key:!0,ref:!0,__self:!0,__source:!0};function t_(t,e,n){var r,o={},i=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)QE.call(e,r)&&!e_.hasOwnProperty(r)&&(o[r]=e[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Bd,type:t,key:i,ref:s,props:o,_owner:D0.current}}function m$(t,e){return{$$typeof:Bd,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function L0(t){return typeof t=="object"&&t!==null&&t.$$typeof===Bd}function g$(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Cb=/\/+/g;function dg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?g$(""+t.key):e.toString(36)}function Gf(t,e,n,r,o){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Bd:case o$:s=!0}}if(s)return s=t,o=o(s),t=r===""?"."+dg(s,0):r,_b(o)?(n="",t!=null&&(n=t.replace(Cb,"$&/")+"/"),Gf(o,e,n,"",function(c){return c})):o!=null&&(L0(o)&&(o=m$(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Cb,"$&/")+"/")+t)),e.push(o)),1;if(s=0,r=r===""?".":r+":",_b(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+dg(i,a);s+=Gf(i,e,n,l,o)}else if(l=h$(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+dg(i,a++),s+=Gf(i,e,n,l,o);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function ff(t,e,n){if(t==null)return t;var r=[],o=0;return Gf(t,r,"","",function(i){return e.call(n,i,o++)}),r}function v$(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var En={current:null},Yf={transition:null},y$={ReactCurrentDispatcher:En,ReactCurrentBatchConfig:Yf,ReactCurrentOwner:D0};Ne.Children={map:ff,forEach:function(t,e,n){ff(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ff(t,function(){e++}),e},toArray:function(t){return ff(t,function(e){return e})||[]},only:function(t){if(!L0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ne.Component=sc;Ne.Fragment=i$;Ne.Profiler=a$;Ne.PureComponent=A0;Ne.StrictMode=s$;Ne.Suspense=d$;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=y$;Ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=XE({},t.props),o=t.key,i=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,s=D0.current),e.key!==void 0&&(o=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)QE.call(e,l)&&!e_.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Bd,type:t.type,key:o,ref:i,props:r,_owner:s}};Ne.createContext=function(t){return t={$$typeof:c$,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:l$,_context:t},t.Consumer=t};Ne.createElement=t_;Ne.createFactory=function(t){var e=t_.bind(null,t);return e.type=t,e};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(t){return{$$typeof:u$,render:t}};Ne.isValidElement=L0;Ne.lazy=function(t){return{$$typeof:p$,_payload:{_status:-1,_result:t},_init:v$}};Ne.memo=function(t,e){return{$$typeof:f$,type:t,compare:e===void 0?null:e}};Ne.startTransition=function(t){var e=Yf.transition;Yf.transition={};try{t()}finally{Yf.transition=e}};Ne.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ne.useCallback=function(t,e){return En.current.useCallback(t,e)};Ne.useContext=function(t){return En.current.useContext(t)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(t){return En.current.useDeferredValue(t)};Ne.useEffect=function(t,e){return En.current.useEffect(t,e)};Ne.useId=function(){return En.current.useId()};Ne.useImperativeHandle=function(t,e,n){return En.current.useImperativeHandle(t,e,n)};Ne.useInsertionEffect=function(t,e){return En.current.useInsertionEffect(t,e)};Ne.useLayoutEffect=function(t,e){return En.current.useLayoutEffect(t,e)};Ne.useMemo=function(t,e){return En.current.useMemo(t,e)};Ne.useReducer=function(t,e,n){return En.current.useReducer(t,e,n)};Ne.useRef=function(t){return En.current.useRef(t)};Ne.useState=function(t){return En.current.useState(t)};Ne.useSyncExternalStore=function(t,e,n){return En.current.useSyncExternalStore(t,e,n)};Ne.useTransition=function(){return En.current.useTransition()};Ne.version="18.2.0";GE.exports=Ne;var m=GE.exports;const X=ui(m),x$=t$({__proto__:null,default:X},[m]);var gu={},n_={exports:{}},nr={},r_={exports:{}},o_={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* scheduler.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/(function(t){function e(_,N){var R=_.length;_.push(N);e:for(;0<R;){var L=R-1>>>1,q=_[L];if(0<o(q,N))_[L]=N,_[R]=q,R=L;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var N=_[0],R=_.pop();if(R!==N){_[0]=R;e:for(var L=0,q=_.length,ve=q>>>1;L<ve;){var he=2*(L+1)-1,Be=_[he],Oe=he+1,J=_[Oe];if(0>o(Be,R))Oe<q&&0>o(J,Be)?(_[L]=J,_[Oe]=R,L=Oe):(_[L]=Be,_[he]=R,L=he);else if(Oe<q&&0>o(J,R))_[L]=J,_[Oe]=R,L=Oe;else break e}}return N}function o(_,N){var R=_.sortIndex-N.sortIndex;return R!==0?R:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,v=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 w(_){for(var N=n(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=_)r(c),N.sortIndex=N.expirationTime,e(l,N);else break;N=n(c)}}function k(_){if(g=!1,w(_),!h)if(n(l)!==null)h=!0,C(E);else{var N=n(c);N!==null&&T(k,N.startTime-_)}}function E(_,N){h=!1,g&&(g=!1,v(P),P=-1),p=!0;var R=f;try{for(w(N),d=n(l);d!==null&&(!(d.expirationTime>N)||_&&!V());){var L=d.callback;if(typeof L=="function"){d.callback=null,f=d.priorityLevel;var q=L(d.expirationTime<=N);N=t.unstable_now(),typeof q=="function"?d.callback=q:d===n(l)&&r(l),w(N)}else r(l);d=n(l)}if(d!==null)var ve=!0;else{var he=n(c);he!==null&&T(k,he.startTime-N),ve=!1}return ve}finally{d=null,f=R,p=!1}}var O=!1,S=null,P=-1,M=5,$=-1;function V(){return!(t.unstable_now()-$<M)}function j(){if(S!==null){var _=t.unstable_now();$=_;var N=!0;try{N=S(!0,_)}finally{N?le():(O=!1,S=null)}}else O=!1}var le;if(typeof y=="function")le=function(){y(j)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,H=K.port2;K.port1.onmessage=j,le=function(){H.postMessage(null)}}else le=function(){x(j,0)};function C(_){S=_,O||(O=!0,le())}function T(_,N){P=x(function(){_(t.unstable_now())},N)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(_){_.callback=null},t.unstable_continueExecution=function(){h||p||(h=!0,C(E))},t.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(_){switch(f){case 1:case 2:case 3:var N=3;break;default:N=f}var R=f;f=N;try{return _()}finally{f=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var R=f;f=_;try{return N()}finally{f=R}},t.unstable_scheduleCallback=function(_,N,R){var L=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?L+R:L):R=L,_){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=R+q,_={id:u++,callback:N,priorityLevel:_,startTime:R,expirationTime:q,sortIndex:-1},R>L?(_.sortIndex=R,e(c,_),n(l)===null&&_===n(c)&&(g?(v(P),P=-1):g=!0,T(k,R-L))):(_.sortIndex=q,e(l,_),h||p||(h=!0,C(E))),_},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(_){var N=f;return function(){var R=f;f=N;try{return _.apply(this,arguments)}finally{f=R}}}})(o_);r_.exports=o_;var b$=r_.exports;/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var i_=m,Qn=b$;function z(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s_=new Set,Iu={};function Ca(t,e){Dl(t,e),Dl(t+"Capture",e)}function Dl(t,e){for(Iu[t]=e,t=0;t<e.length;t++)s_.add(e[t])}var Qo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ev=Object.prototype.hasOwnProperty,w$=/^[: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]*$/,Ob={},Tb={};function k$(t){return Ev.call(Tb,t)?!0:Ev.call(Ob,t)?!1:w$.test(t)?Tb[t]=!0:(Ob[t]=!0,!1)}function S$(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 E$(t,e,n,r){if(e===null||typeof e>"u"||S$(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 _n(t,e,n,r,o,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var Jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Jt[t]=new _n(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Jt[e]=new _n(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Jt[t]=new _n(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Jt[t]=new _n(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){Jt[t]=new _n(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Jt[t]=new _n(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Jt[t]=new _n(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Jt[t]=new _n(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Jt[t]=new _n(t,5,!1,t.toLowerCase(),null,!1,!1)});var j0=/[\-:]([a-z])/g;function z0(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(j0,z0);Jt[e]=new _n(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(j0,z0);Jt[e]=new _n(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(j0,z0);Jt[e]=new _n(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Jt[t]=new _n(t,1,!1,t.toLowerCase(),null,!1,!1)});Jt.xlinkHref=new _n("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Jt[t]=new _n(t,1,!1,t.toLowerCase(),null,!0,!0)});function F0(t,e,n,r){var o=Jt.hasOwnProperty(e)?Jt[e]:null;(o!==null?o.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(E$(e,n,o,r)&&(n=null),r||o===null?k$(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):o.mustUseProperty?t[o.propertyName]=n===null?o.type===3?!1:"":n:(e=o.attributeName,r=o.attributeNamespace,n===null?t.removeAttribute(e):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var di=i_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pf=Symbol.for("react.element"),al=Symbol.for("react.portal"),ll=Symbol.for("react.fragment"),B0=Symbol.for("react.strict_mode"),_v=Symbol.for("react.profiler"),a_=Symbol.for("react.provider"),l_=Symbol.for("react.context"),V0=Symbol.for("react.forward_ref"),Cv=Symbol.for("react.suspense"),Ov=Symbol.for("react.suspense_list"),U0=Symbol.for("react.memo"),Ai=Symbol.for("react.lazy"),c_=Symbol.for("react.offscreen"),Pb=Symbol.iterator;function Sc(t){return t===null||typeof t!="object"?null:(t=Pb&&t[Pb]||t["@@iterator"],typeof t=="function"?t:null)}var gt=Object.assign,fg;function Bc(t){if(fg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);fg=e&&e[1]||""}return`
|
|
26
|
-
`+fg+t}var pg=!1;function hg(t,e){if(!t||pg)return"";pg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
27
|
-
`),i=r.stack.split(`
|
|
28
|
-
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
29
|
-
`+o[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{pg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Bc(t):""}function _$(t){switch(t.tag){case 5:return Bc(t.type);case 16:return Bc("Lazy");case 13:return Bc("Suspense");case 19:return Bc("SuspenseList");case 0:case 2:case 15:return t=hg(t.type,!1),t;case 11:return t=hg(t.type.render,!1),t;case 1:return t=hg(t.type,!0),t;default:return""}}function Tv(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 ll:return"Fragment";case al:return"Portal";case _v:return"Profiler";case B0:return"StrictMode";case Cv:return"Suspense";case Ov:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case l_:return(t.displayName||"Context")+".Consumer";case a_:return(t._context.displayName||"Context")+".Provider";case V0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case U0:return e=t.displayName||null,e!==null?e:Tv(t.type)||"Memo";case Ai:e=t._payload,t=t._init;try{return Tv(t(e))}catch{}}return null}function C$(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 Tv(e);case 8:return e===B0?"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 cs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function u_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function O$(t){var e=u_(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 o=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.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 hf(t){t._valueTracker||(t._valueTracker=O$(t))}function d_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=u_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function _p(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 Pv(t,e){var n=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Mb(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=cs(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 f_(t,e){e=e.checked,e!=null&&F0(t,"checked",e,!1)}function Mv(t,e){f_(t,e);var n=cs(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")?Nv(t,e.type,n):e.hasOwnProperty("defaultValue")&&Nv(t,e.type,cs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Nb(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 Nv(t,e,n){(e!=="number"||_p(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vc=Array.isArray;function kl(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e["$"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty("$"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=""+cs(n),e=null,o=0;o<t.length;o++){if(t[o].value===n){t[o].selected=!0,r&&(t[o].defaultSelected=!0);return}e!==null||t[o].disabled||(e=t[o])}e!==null&&(e.selected=!0)}}function Rv(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(z(91));return gt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Rb(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(z(92));if(Vc(n)){if(1<n.length)throw Error(z(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:cs(n)}}function p_(t,e){var n=cs(e.value),r=cs(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function $b(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function h_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $v(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?h_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var mf,m_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,o){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,o)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(mf=mf||document.createElement("div"),mf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=mf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Du(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var vu={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},T$=["Webkit","ms","Moz","O"];Object.keys(vu).forEach(function(t){T$.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),vu[e]=vu[t]})});function g_(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||vu.hasOwnProperty(t)&&vu[t]?(""+e).trim():e+"px"}function v_(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=g_(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,o):t[n]=o}}var P$=gt({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 Av(t,e){if(e){if(P$[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function Iv(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 Dv=null;function H0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Lv=null,Sl=null,El=null;function Ab(t){if(t=Hd(t)){if(typeof Lv!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Qh(e),Lv(t.stateNode,t.type,e))}}function y_(t){Sl?El?El.push(t):El=[t]:Sl=t}function x_(){if(Sl){var t=Sl,e=El;if(El=Sl=null,Ab(t),e)for(t=0;t<e.length;t++)Ab(e[t])}}function b_(t,e){return t(e)}function w_(){}var mg=!1;function k_(t,e,n){if(mg)return t(e,n);mg=!0;try{return b_(t,e,n)}finally{mg=!1,(Sl!==null||El!==null)&&(w_(),x_())}}function Lu(t,e){var n=t.stateNode;if(n===null)return null;var r=Qh(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(z(231,e,typeof n));return n}var jv=!1;if(Qo)try{var Ec={};Object.defineProperty(Ec,"passive",{get:function(){jv=!0}}),window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{jv=!1}function M$(t,e,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var yu=!1,Cp=null,Op=!1,zv=null,N$={onError:function(t){yu=!0,Cp=t}};function R$(t,e,n,r,o,i,s,a,l){yu=!1,Cp=null,M$.apply(N$,arguments)}function $$(t,e,n,r,o,i,s,a,l){if(R$.apply(this,arguments),yu){if(yu){var c=Cp;yu=!1,Cp=null}else throw Error(z(198));Op||(Op=!0,zv=c)}}function Oa(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function S_(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Ib(t){if(Oa(t)!==t)throw Error(z(188))}function A$(t){var e=t.alternate;if(!e){if(e=Oa(t),e===null)throw Error(z(188));return e!==t?null:t}for(var n=t,r=e;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Ib(o),t;if(i===r)return Ib(o),e;i=i.sibling}throw Error(z(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?t:e}function E_(t){return t=A$(t),t!==null?__(t):null}function __(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=__(t);if(e!==null)return e;t=t.sibling}return null}var C_=Qn.unstable_scheduleCallback,Db=Qn.unstable_cancelCallback,I$=Qn.unstable_shouldYield,D$=Qn.unstable_requestPaint,St=Qn.unstable_now,L$=Qn.unstable_getCurrentPriorityLevel,W0=Qn.unstable_ImmediatePriority,O_=Qn.unstable_UserBlockingPriority,Tp=Qn.unstable_NormalPriority,j$=Qn.unstable_LowPriority,T_=Qn.unstable_IdlePriority,Yh=null,mo=null;function z$(t){if(mo&&typeof mo.onCommitFiberRoot=="function")try{mo.onCommitFiberRoot(Yh,t,void 0,(t.current.flags&128)===128)}catch{}}var qr=Math.clz32?Math.clz32:V$,F$=Math.log,B$=Math.LN2;function V$(t){return t>>>=0,t===0?32:31-(F$(t)/B$|0)|0}var gf=64,vf=4194304;function Uc(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 Pp(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,o=t.suspendedLanes,i=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Uc(a):(i&=s,i!==0&&(r=Uc(i)))}else s=n&~o,s!==0?r=Uc(s):i!==0&&(r=Uc(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&o)&&(o=r&-r,i=e&-e,o>=i||o===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-qr(e),o=1<<n,r|=t[n],e&=~o;return r}function U$(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function H$(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes;0<i;){var s=31-qr(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=U$(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Fv(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function P_(){var t=gf;return gf<<=1,!(gf&4194240)&&(gf=64),t}function gg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Vd(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-qr(e),t[e]=n}function W$(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<n;){var o=31-qr(n),i=1<<o;e[o]=0,r[o]=-1,t[o]=-1,n&=~i}}function K0(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-qr(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}var Ke=0;function M_(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var N_,q0,R_,$_,A_,Bv=!1,yf=[],qi=null,Gi=null,Yi=null,ju=new Map,zu=new Map,ji=[],K$="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lb(t,e){switch(t){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Gi=null;break;case"mouseover":case"mouseout":Yi=null;break;case"pointerover":case"pointerout":ju.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":zu.delete(e.pointerId)}}function _c(t,e,n,r,o,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},e!==null&&(e=Hd(e),e!==null&&q0(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function q$(t,e,n,r,o){switch(e){case"focusin":return qi=_c(qi,t,e,n,r,o),!0;case"dragenter":return Gi=_c(Gi,t,e,n,r,o),!0;case"mouseover":return Yi=_c(Yi,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return ju.set(i,_c(ju.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,zu.set(i,_c(zu.get(i)||null,t,e,n,r,o)),!0}return!1}function I_(t){var e=Hs(t.target);if(e!==null){var n=Oa(e);if(n!==null){if(e=n.tag,e===13){if(e=S_(n),e!==null){t.blockedOn=e,A_(t.priority,function(){R_(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Vv(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Dv=r,n.target.dispatchEvent(r),Dv=null}else return e=Hd(n),e!==null&&q0(e),t.blockedOn=n,!1;e.shift()}return!0}function jb(t,e,n){Xf(t)&&n.delete(e)}function G$(){Bv=!1,qi!==null&&Xf(qi)&&(qi=null),Gi!==null&&Xf(Gi)&&(Gi=null),Yi!==null&&Xf(Yi)&&(Yi=null),ju.forEach(jb),zu.forEach(jb)}function Cc(t,e){t.blockedOn===e&&(t.blockedOn=null,Bv||(Bv=!0,Qn.unstable_scheduleCallback(Qn.unstable_NormalPriority,G$)))}function Fu(t){function e(o){return Cc(o,t)}if(0<yf.length){Cc(yf[0],t);for(var n=1;n<yf.length;n++){var r=yf[n];r.blockedOn===t&&(r.blockedOn=null)}}for(qi!==null&&Cc(qi,t),Gi!==null&&Cc(Gi,t),Yi!==null&&Cc(Yi,t),ju.forEach(e),zu.forEach(e),n=0;n<ji.length;n++)r=ji[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<ji.length&&(n=ji[0],n.blockedOn===null);)I_(n),n.blockedOn===null&&ji.shift()}var _l=di.ReactCurrentBatchConfig,Mp=!0;function Y$(t,e,n,r){var o=Ke,i=_l.transition;_l.transition=null;try{Ke=1,G0(t,e,n,r)}finally{Ke=o,_l.transition=i}}function X$(t,e,n,r){var o=Ke,i=_l.transition;_l.transition=null;try{Ke=4,G0(t,e,n,r)}finally{Ke=o,_l.transition=i}}function G0(t,e,n,r){if(Mp){var o=Vv(t,e,n,r);if(o===null)Cg(t,e,r,Np,n),Lb(t,r);else if(q$(o,t,e,n,r))r.stopPropagation();else if(Lb(t,r),e&4&&-1<K$.indexOf(t)){for(;o!==null;){var i=Hd(o);if(i!==null&&N_(i),i=Vv(t,e,n,r),i===null&&Cg(t,e,r,Np,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Cg(t,e,r,null,n)}}var Np=null;function Vv(t,e,n,r){if(Np=null,t=H0(r),t=Hs(t),t!==null)if(e=Oa(t),e===null)t=null;else if(n=e.tag,n===13){if(t=S_(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Np=t,null}function D_(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(L$()){case W0:return 1;case O_:return 4;case Tp:case j$:return 16;case T_:return 536870912;default:return 16}default:return 16}}var Vi=null,Y0=null,Zf=null;function L_(){if(Zf)return Zf;var t,e=Y0,n=e.length,r,o="value"in Vi?Vi.value:Vi.textContent,i=o.length;for(t=0;t<n&&e[t]===o[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===o[i-r];r++);return Zf=o.slice(t,1<r?1-r:void 0)}function Jf(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function xf(){return!0}function zb(){return!1}function rr(t){function e(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?xf:zb,this.isPropagationStopped=zb,this}return gt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=xf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xf)},persist:function(){},isPersistent:xf}),e}var ac={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},X0=rr(ac),Ud=gt({},ac,{view:0,detail:0}),Z$=rr(Ud),vg,yg,Oc,Xh=gt({},Ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Z0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Oc&&(Oc&&t.type==="mousemove"?(vg=t.screenX-Oc.screenX,yg=t.screenY-Oc.screenY):yg=vg=0,Oc=t),vg)},movementY:function(t){return"movementY"in t?t.movementY:yg}}),Fb=rr(Xh),J$=gt({},Xh,{dataTransfer:0}),Q$=rr(J$),eA=gt({},Ud,{relatedTarget:0}),xg=rr(eA),tA=gt({},ac,{animationName:0,elapsedTime:0,pseudoElement:0}),nA=rr(tA),rA=gt({},ac,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),oA=rr(rA),iA=gt({},ac,{data:0}),Bb=rr(iA),sA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aA={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},lA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cA(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=lA[t])?!!e[t]:!1}function Z0(){return cA}var uA=gt({},Ud,{key:function(t){if(t.key){var e=sA[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Jf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?aA[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Z0,charCode:function(t){return t.type==="keypress"?Jf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),dA=rr(uA),fA=gt({},Xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vb=rr(fA),pA=gt({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Z0}),hA=rr(pA),mA=gt({},ac,{propertyName:0,elapsedTime:0,pseudoElement:0}),gA=rr(mA),vA=gt({},Xh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),yA=rr(vA),xA=[9,13,27,32],J0=Qo&&"CompositionEvent"in window,xu=null;Qo&&"documentMode"in document&&(xu=document.documentMode);var bA=Qo&&"TextEvent"in window&&!xu,j_=Qo&&(!J0||xu&&8<xu&&11>=xu),Ub=" ",Hb=!1;function z_(t,e){switch(t){case"keyup":return xA.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cl=!1;function wA(t,e){switch(t){case"compositionend":return F_(e);case"keypress":return e.which!==32?null:(Hb=!0,Ub);case"textInput":return t=e.data,t===Ub&&Hb?null:t;default:return null}}function kA(t,e){if(cl)return t==="compositionend"||!J0&&z_(t,e)?(t=L_(),Zf=Y0=Vi=null,cl=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return j_&&e.locale!=="ko"?null:e.data;default:return null}}var SA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wb(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!SA[t.type]:e==="textarea"}function B_(t,e,n,r){y_(r),e=Rp(e,"onChange"),0<e.length&&(n=new X0("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var bu=null,Bu=null;function EA(t){J_(t,0)}function Zh(t){var e=fl(t);if(d_(e))return t}function _A(t,e){if(t==="change")return e}var V_=!1;if(Qo){var bg;if(Qo){var wg="oninput"in document;if(!wg){var Kb=document.createElement("div");Kb.setAttribute("oninput","return;"),wg=typeof Kb.oninput=="function"}bg=wg}else bg=!1;V_=bg&&(!document.documentMode||9<document.documentMode)}function qb(){bu&&(bu.detachEvent("onpropertychange",U_),Bu=bu=null)}function U_(t){if(t.propertyName==="value"&&Zh(Bu)){var e=[];B_(e,Bu,t,H0(t)),k_(EA,e)}}function CA(t,e,n){t==="focusin"?(qb(),bu=e,Bu=n,bu.attachEvent("onpropertychange",U_)):t==="focusout"&&qb()}function OA(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Zh(Bu)}function TA(t,e){if(t==="click")return Zh(e)}function PA(t,e){if(t==="input"||t==="change")return Zh(e)}function MA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Qr=typeof Object.is=="function"?Object.is:MA;function Vu(t,e){if(Qr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Ev.call(e,o)||!Qr(t[o],e[o]))return!1}return!0}function Gb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Yb(t,e){var n=Gb(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=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=Gb(n)}}function H_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?H_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function W_(){for(var t=window,e=_p();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=_p(t.document)}return e}function Q0(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 NA(t){var e=W_(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&H_(n.ownerDocument.documentElement,n)){if(r!==null&&Q0(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!t.extend&&i>r&&(o=r,r=i,i=o),o=Yb(n,i);var s=Yb(n,r);o&&s&&(t.rangeCount!==1||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(o.node,o.offset),t.removeAllRanges(),i>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<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var RA=Qo&&"documentMode"in document&&11>=document.documentMode,ul=null,Uv=null,wu=null,Hv=!1;function Xb(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hv||ul==null||ul!==_p(r)||(r=ul,"selectionStart"in r&&Q0(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}),wu&&Vu(wu,r)||(wu=r,r=Rp(Uv,"onSelect"),0<r.length&&(e=new X0("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=ul)))}function bf(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var dl={animationend:bf("Animation","AnimationEnd"),animationiteration:bf("Animation","AnimationIteration"),animationstart:bf("Animation","AnimationStart"),transitionend:bf("Transition","TransitionEnd")},kg={},K_={};Qo&&(K_=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function Jh(t){if(kg[t])return kg[t];if(!dl[t])return t;var e=dl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in K_)return kg[t]=e[n];return t}var q_=Jh("animationend"),G_=Jh("animationiteration"),Y_=Jh("animationstart"),X_=Jh("transitionend"),Z_=new Map,Zb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ss(t,e){Z_.set(t,e),Ca(e,[t])}for(var Sg=0;Sg<Zb.length;Sg++){var Eg=Zb[Sg],$A=Eg.toLowerCase(),AA=Eg[0].toUpperCase()+Eg.slice(1);Ss($A,"on"+AA)}Ss(q_,"onAnimationEnd");Ss(G_,"onAnimationIteration");Ss(Y_,"onAnimationStart");Ss("dblclick","onDoubleClick");Ss("focusin","onFocus");Ss("focusout","onBlur");Ss(X_,"onTransitionEnd");Dl("onMouseEnter",["mouseout","mouseover"]);Dl("onMouseLeave",["mouseout","mouseover"]);Dl("onPointerEnter",["pointerout","pointerover"]);Dl("onPointerLeave",["pointerout","pointerover"]);Ca("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ca("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ca("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ca("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ca("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ca("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),IA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hc));function Jb(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,$$(r,e,void 0,t),t.currentTarget=null}function J_(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],o=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Jb(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Jb(o,a,c),i=l}}}if(Op)throw t=zv,Op=!1,zv=null,t}function st(t,e){var n=e[Yv];n===void 0&&(n=e[Yv]=new Set);var r=t+"__bubble";n.has(r)||(Q_(e,t,2,!1),n.add(r))}function _g(t,e,n){var r=0;e&&(r|=4),Q_(n,t,r,e)}var wf="_reactListening"+Math.random().toString(36).slice(2);function Uu(t){if(!t[wf]){t[wf]=!0,s_.forEach(function(n){n!=="selectionchange"&&(IA.has(n)||_g(n,!1,t),_g(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[wf]||(e[wf]=!0,_g("selectionchange",!1,e))}}function Q_(t,e,n,r){switch(D_(e)){case 1:var o=Y$;break;case 4:o=X$;break;default:o=G0}n=o.bind(null,e,n,t),o=void 0,!jv||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(o=!0),r?o!==void 0?t.addEventListener(e,n,{capture:!0,passive:o}):t.addEventListener(e,n,!0):o!==void 0?t.addEventListener(e,n,{passive:o}):t.addEventListener(e,n,!1)}function Cg(t,e,n,r,o){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Hs(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}k_(function(){var c=i,u=H0(n),d=[];e:{var f=Z_.get(t);if(f!==void 0){var p=X0,h=t;switch(t){case"keypress":if(Jf(n)===0)break e;case"keydown":case"keyup":p=dA;break;case"focusin":h="focus",p=xg;break;case"focusout":h="blur",p=xg;break;case"beforeblur":case"afterblur":p=xg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Fb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Q$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=hA;break;case q_:case G_:case Y_:p=nA;break;case X_:p=gA;break;case"scroll":p=Z$;break;case"wheel":p=yA;break;case"copy":case"cut":case"paste":p=oA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Vb}var g=(e&4)!==0,x=!g&&t==="scroll",v=g?f!==null?f+"Capture":null:f;g=[];for(var y=c,w;y!==null;){w=y;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,v!==null&&(k=Lu(y,v),k!=null&&g.push(Hu(y,k,w)))),x)break;y=y.return}0<g.length&&(f=new p(f,h,null,n,u),d.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==Dv&&(h=n.relatedTarget||n.fromElement)&&(Hs(h)||h[ei]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=c,h=h?Hs(h):null,h!==null&&(x=Oa(h),h!==x||h.tag!==5&&h.tag!==6)&&(h=null)):(p=null,h=c),p!==h)){if(g=Fb,k="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=Vb,k="onPointerLeave",v="onPointerEnter",y="pointer"),x=p==null?f:fl(p),w=h==null?f:fl(h),f=new g(k,y+"leave",p,n,u),f.target=x,f.relatedTarget=w,k=null,Hs(u)===c&&(g=new g(v,y+"enter",h,n,u),g.target=w,g.relatedTarget=x,k=g),x=k,p&&h)t:{for(g=p,v=h,y=0,w=g;w;w=za(w))y++;for(w=0,k=v;k;k=za(k))w++;for(;0<y-w;)g=za(g),y--;for(;0<w-y;)v=za(v),w--;for(;y--;){if(g===v||v!==null&&g===v.alternate)break t;g=za(g),v=za(v)}g=null}else g=null;p!==null&&Qb(d,f,p,g,!1),h!==null&&x!==null&&Qb(d,x,h,g,!0)}}e:{if(f=c?fl(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=_A;else if(Wb(f))if(V_)E=PA;else{E=OA;var O=CA}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=TA);if(E&&(E=E(t,c))){B_(d,E,n,u);break e}O&&O(t,f,c),t==="focusout"&&(O=f._wrapperState)&&O.controlled&&f.type==="number"&&Nv(f,"number",f.value)}switch(O=c?fl(c):window,t){case"focusin":(Wb(O)||O.contentEditable==="true")&&(ul=O,Uv=c,wu=null);break;case"focusout":wu=Uv=ul=null;break;case"mousedown":Hv=!0;break;case"contextmenu":case"mouseup":case"dragend":Hv=!1,Xb(d,n,u);break;case"selectionchange":if(RA)break;case"keydown":case"keyup":Xb(d,n,u)}var S;if(J0)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else cl?z_(t,n)&&(P="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(j_&&n.locale!=="ko"&&(cl||P!=="onCompositionStart"?P==="onCompositionEnd"&&cl&&(S=L_()):(Vi=u,Y0="value"in Vi?Vi.value:Vi.textContent,cl=!0)),O=Rp(c,P),0<O.length&&(P=new Bb(P,t,null,n,u),d.push({event:P,listeners:O}),S?P.data=S:(S=F_(n),S!==null&&(P.data=S)))),(S=bA?wA(t,n):kA(t,n))&&(c=Rp(c,"onBeforeInput"),0<c.length&&(u=new Bb("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=S))}J_(d,e)})}function Hu(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Rp(t,e){for(var n=e+"Capture",r=[];t!==null;){var o=t,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Lu(t,n),i!=null&&r.unshift(Hu(t,i,o)),i=Lu(t,e),i!=null&&r.push(Hu(t,i,o))),t=t.return}return r}function za(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Qb(t,e,n,r,o){for(var i=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=Lu(n,i),l!=null&&s.unshift(Hu(n,l,a))):o||(l=Lu(n,i),l!=null&&s.push(Hu(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var DA=/\r\n?/g,LA=/\u0000|\uFFFD/g;function ew(t){return(typeof t=="string"?t:""+t).replace(DA,`
|
|
30
|
-
`).replace(LA,"")}function kf(t,e,n){if(e=ew(e),ew(t)!==e&&n)throw Error(z(425))}function $p(){}var Wv=null,Kv=null;function qv(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Gv=typeof setTimeout=="function"?setTimeout:void 0,jA=typeof clearTimeout=="function"?clearTimeout:void 0,tw=typeof Promise=="function"?Promise:void 0,zA=typeof queueMicrotask=="function"?queueMicrotask:typeof tw<"u"?function(t){return tw.resolve(null).then(t).catch(FA)}:Gv;function FA(t){setTimeout(function(){throw t})}function Og(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){t.removeChild(o),Fu(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Fu(e)}function Xi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function nw(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var lc=Math.random().toString(36).slice(2),co="__reactFiber$"+lc,Wu="__reactProps$"+lc,ei="__reactContainer$"+lc,Yv="__reactEvents$"+lc,BA="__reactListeners$"+lc,VA="__reactHandles$"+lc;function Hs(t){var e=t[co];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ei]||n[co]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=nw(t);t!==null;){if(n=t[co])return n;t=nw(t)}return e}t=n,n=t.parentNode}return null}function Hd(t){return t=t[co]||t[ei],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function fl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(z(33))}function Qh(t){return t[Wu]||null}var Xv=[],pl=-1;function Es(t){return{current:t}}function at(t){0>pl||(t.current=Xv[pl],Xv[pl]=null,pl--)}function rt(t,e){pl++,Xv[pl]=t.current,t.current=e}var us={},cn=Es(us),$n=Es(!1),sa=us;function Ll(t,e){var n=t.type.contextTypes;if(!n)return us;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function An(t){return t=t.childContextTypes,t!=null}function Ap(){at($n),at(cn)}function rw(t,e,n){if(cn.current!==us)throw Error(z(168));rt(cn,e),rt($n,n)}function eC(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in e))throw Error(z(108,C$(t)||"Unknown",o));return gt({},n,r)}function Ip(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||us,sa=cn.current,rt(cn,t),rt($n,$n.current),!0}function ow(t,e,n){var r=t.stateNode;if(!r)throw Error(z(169));n?(t=eC(t,e,sa),r.__reactInternalMemoizedMergedChildContext=t,at($n),at(cn),rt(cn,t)):at($n),rt($n,n)}var Uo=null,em=!1,Tg=!1;function tC(t){Uo===null?Uo=[t]:Uo.push(t)}function UA(t){em=!0,tC(t)}function _s(){if(!Tg&&Uo!==null){Tg=!0;var t=0,e=Ke;try{var n=Uo;for(Ke=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Uo=null,em=!1}catch(o){throw Uo!==null&&(Uo=Uo.slice(t+1)),C_(W0,_s),o}finally{Ke=e,Tg=!1}}return null}var hl=[],ml=0,Dp=null,Lp=0,ur=[],dr=0,aa=null,Wo=1,Ko="";function Rs(t,e){hl[ml++]=Lp,hl[ml++]=Dp,Dp=t,Lp=e}function nC(t,e,n){ur[dr++]=Wo,ur[dr++]=Ko,ur[dr++]=aa,aa=t;var r=Wo;t=Ko;var o=32-qr(r)-1;r&=~(1<<o),n+=1;var i=32-qr(e)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Wo=1<<32-qr(e)+o|n<<o|r,Ko=i+t}else Wo=1<<i|n<<o|r,Ko=t}function ex(t){t.return!==null&&(Rs(t,1),nC(t,1,0))}function tx(t){for(;t===Dp;)Dp=hl[--ml],hl[ml]=null,Lp=hl[--ml],hl[ml]=null;for(;t===aa;)aa=ur[--dr],ur[dr]=null,Ko=ur[--dr],ur[dr]=null,Wo=ur[--dr],ur[dr]=null}var Xn=null,Yn=null,lt=!1,zr=null;function rC(t,e){var n=pr(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function iw(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Xn=t,Yn=Xi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Xn=t,Yn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=aa!==null?{id:Wo,overflow:Ko}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=pr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Xn=t,Yn=null,!0):!1;default:return!1}}function Zv(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Jv(t){if(lt){var e=Yn;if(e){var n=e;if(!iw(t,e)){if(Zv(t))throw Error(z(418));e=Xi(n.nextSibling);var r=Xn;e&&iw(t,e)?rC(r,n):(t.flags=t.flags&-4097|2,lt=!1,Xn=t)}}else{if(Zv(t))throw Error(z(418));t.flags=t.flags&-4097|2,lt=!1,Xn=t}}}function sw(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Xn=t}function Sf(t){if(t!==Xn)return!1;if(!lt)return sw(t),lt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!qv(t.type,t.memoizedProps)),e&&(e=Yn)){if(Zv(t))throw oC(),Error(z(418));for(;e;)rC(t,e),e=Xi(e.nextSibling)}if(sw(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(z(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Yn=Xi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Yn=null}}else Yn=Xn?Xi(t.stateNode.nextSibling):null;return!0}function oC(){for(var t=Yn;t;)t=Xi(t.nextSibling)}function jl(){Yn=Xn=null,lt=!1}function nx(t){zr===null?zr=[t]:zr.push(t)}var HA=di.ReactCurrentBatchConfig;function Dr(t,e){if(t&&t.defaultProps){e=gt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var jp=Es(null),zp=null,gl=null,rx=null;function ox(){rx=gl=zp=null}function ix(t){var e=jp.current;at(jp),t._currentValue=e}function Qv(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Cl(t,e){zp=t,rx=gl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Nn=!0),t.firstContext=null)}function yr(t){var e=t._currentValue;if(rx!==t)if(t={context:t,memoizedValue:e,next:null},gl===null){if(zp===null)throw Error(z(308));gl=t,zp.dependencies={lanes:0,firstContext:t}}else gl=gl.next=t;return e}var Ws=null;function sx(t){Ws===null?Ws=[t]:Ws.push(t)}function iC(t,e,n,r){var o=e.interleaved;return o===null?(n.next=n,sx(e)):(n.next=o.next,o.next=n),e.interleaved=n,ti(t,r)}function ti(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ii=!1;function ax(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sC(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Xo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Zi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ie&2){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,ti(t,n)}return o=r.interleaved,o===null?(e.next=e,sx(r)):(e.next=o.next,o.next=e),r.interleaved=e,ti(t,n)}function Qf(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,K0(t,n)}}function aw(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=e:i=i.next=e}else o=i=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Fp(t,e,n,r){var o=t.updateQueue;Ii=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=t,g=a;switch(f=e,p=n,g.tag){case 1:if(h=g.payload,typeof h=="function"){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h=="function"?h.call(p,d,f):h,f==null)break e;d=gt({},d,f);break e;case 2:Ii=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,e=o.shared.interleaved,e!==null){o=e;do s|=o.lane,o=o.next;while(o!==e)}else i===null&&(o.shared.lanes=0);ca|=s,t.lanes=s,t.memoizedState=d}}function lw(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(z(191,o));o.call(r)}}}var aC=new i_.Component().refs;function ey(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:gt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var tm={isMounted:function(t){return(t=t._reactInternals)?Oa(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=vn(),o=Qi(t),i=Xo(r,o);i.payload=e,n!=null&&(i.callback=n),e=Zi(t,i,o),e!==null&&(Gr(e,t,o,r),Qf(e,t,o))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=vn(),o=Qi(t),i=Xo(r,o);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=Zi(t,i,o),e!==null&&(Gr(e,t,o,r),Qf(e,t,o))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=vn(),r=Qi(t),o=Xo(n,r);o.tag=2,e!=null&&(o.callback=e),e=Zi(t,o,r),e!==null&&(Gr(e,t,r,n),Qf(e,t,r))}};function cw(t,e,n,r,o,i,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,s):e.prototype&&e.prototype.isPureReactComponent?!Vu(n,r)||!Vu(o,i):!0}function lC(t,e,n){var r=!1,o=us,i=e.contextType;return typeof i=="object"&&i!==null?i=yr(i):(o=An(e)?sa:cn.current,r=e.contextTypes,i=(r=r!=null)?Ll(t,o):us),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=tm,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=o,t.__reactInternalMemoizedMaskedChildContext=i),e}function uw(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&tm.enqueueReplaceState(e,e.state,null)}function ty(t,e,n,r){var o=t.stateNode;o.props=n,o.state=t.memoizedState,o.refs=aC,ax(t);var i=e.contextType;typeof i=="object"&&i!==null?o.context=yr(i):(i=An(e)?sa:cn.current,o.context=Ll(t,i)),o.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(ey(t,e,i,n),o.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(e=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),e!==o.state&&tm.enqueueReplaceState(o,o.state,null),Fp(t,n,o,r),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308)}function Tc(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,t));var o=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(s){var a=o.refs;a===aC&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},e._stringRef=i,e)}if(typeof t!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,t))}return t}function Ef(t,e){throw t=Object.prototype.toString.call(e),Error(z(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function dw(t){var e=t._init;return e(t._payload)}function cC(t){function e(v,y){if(t){var w=v.deletions;w===null?(v.deletions=[y],v.flags|=16):w.push(y)}}function n(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function o(v,y){return v=es(v,y),v.index=0,v.sibling=null,v}function i(v,y,w){return v.index=w,t?(w=v.alternate,w!==null?(w=w.index,w<y?(v.flags|=2,y):w):(v.flags|=2,y)):(v.flags|=1048576,y)}function s(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,y,w,k){return y===null||y.tag!==6?(y=Ig(w,v.mode,k),y.return=v,y):(y=o(y,w),y.return=v,y)}function l(v,y,w,k){var E=w.type;return E===ll?u(v,y,w.props.children,k,w.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ai&&dw(E)===y.type)?(k=o(y,w.props),k.ref=Tc(v,y,w),k.return=v,k):(k=ip(w.type,w.key,w.props,null,v.mode,k),k.ref=Tc(v,y,w),k.return=v,k)}function c(v,y,w,k){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=Dg(w,v.mode,k),y.return=v,y):(y=o(y,w.children||[]),y.return=v,y)}function u(v,y,w,k,E){return y===null||y.tag!==7?(y=Qs(w,v.mode,k,E),y.return=v,y):(y=o(y,w),y.return=v,y)}function d(v,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Ig(""+y,v.mode,w),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case pf:return w=ip(y.type,y.key,y.props,null,v.mode,w),w.ref=Tc(v,null,y),w.return=v,w;case al:return y=Dg(y,v.mode,w),y.return=v,y;case Ai:var k=y._init;return d(v,k(y._payload),w)}if(Vc(y)||Sc(y))return y=Qs(y,v.mode,w,null),y.return=v,y;Ef(v,y)}return null}function f(v,y,w,k){var E=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return E!==null?null:a(v,y,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case pf:return w.key===E?l(v,y,w,k):null;case al:return w.key===E?c(v,y,w,k):null;case Ai:return E=w._init,f(v,y,E(w._payload),k)}if(Vc(w)||Sc(w))return E!==null?null:u(v,y,w,k,null);Ef(v,w)}return null}function p(v,y,w,k,E){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(w)||null,a(y,v,""+k,E);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case pf:return v=v.get(k.key===null?w:k.key)||null,l(y,v,k,E);case al:return v=v.get(k.key===null?w:k.key)||null,c(y,v,k,E);case Ai:var O=k._init;return p(v,y,w,O(k._payload),E)}if(Vc(k)||Sc(k))return v=v.get(w)||null,u(y,v,k,E,null);Ef(y,k)}return null}function h(v,y,w,k){for(var E=null,O=null,S=y,P=y=0,M=null;S!==null&&P<w.length;P++){S.index>P?(M=S,S=null):M=S.sibling;var $=f(v,S,w[P],k);if($===null){S===null&&(S=M);break}t&&S&&$.alternate===null&&e(v,S),y=i($,y,P),O===null?E=$:O.sibling=$,O=$,S=M}if(P===w.length)return n(v,S),lt&&Rs(v,P),E;if(S===null){for(;P<w.length;P++)S=d(v,w[P],k),S!==null&&(y=i(S,y,P),O===null?E=S:O.sibling=S,O=S);return lt&&Rs(v,P),E}for(S=r(v,S);P<w.length;P++)M=p(S,v,P,w[P],k),M!==null&&(t&&M.alternate!==null&&S.delete(M.key===null?P:M.key),y=i(M,y,P),O===null?E=M:O.sibling=M,O=M);return t&&S.forEach(function(V){return e(v,V)}),lt&&Rs(v,P),E}function g(v,y,w,k){var E=Sc(w);if(typeof E!="function")throw Error(z(150));if(w=E.call(w),w==null)throw Error(z(151));for(var O=E=null,S=y,P=y=0,M=null,$=w.next();S!==null&&!$.done;P++,$=w.next()){S.index>P?(M=S,S=null):M=S.sibling;var V=f(v,S,$.value,k);if(V===null){S===null&&(S=M);break}t&&S&&V.alternate===null&&e(v,S),y=i(V,y,P),O===null?E=V:O.sibling=V,O=V,S=M}if($.done)return n(v,S),lt&&Rs(v,P),E;if(S===null){for(;!$.done;P++,$=w.next())$=d(v,$.value,k),$!==null&&(y=i($,y,P),O===null?E=$:O.sibling=$,O=$);return lt&&Rs(v,P),E}for(S=r(v,S);!$.done;P++,$=w.next())$=p(S,v,P,$.value,k),$!==null&&(t&&$.alternate!==null&&S.delete($.key===null?P:$.key),y=i($,y,P),O===null?E=$:O.sibling=$,O=$);return t&&S.forEach(function(j){return e(v,j)}),lt&&Rs(v,P),E}function x(v,y,w,k){if(typeof w=="object"&&w!==null&&w.type===ll&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case pf:e:{for(var E=w.key,O=y;O!==null;){if(O.key===E){if(E=w.type,E===ll){if(O.tag===7){n(v,O.sibling),y=o(O,w.props.children),y.return=v,v=y;break e}}else if(O.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ai&&dw(E)===O.type){n(v,O.sibling),y=o(O,w.props),y.ref=Tc(v,O,w),y.return=v,v=y;break e}n(v,O);break}else e(v,O);O=O.sibling}w.type===ll?(y=Qs(w.props.children,v.mode,k,w.key),y.return=v,v=y):(k=ip(w.type,w.key,w.props,null,v.mode,k),k.ref=Tc(v,y,w),k.return=v,v=k)}return s(v);case al:e:{for(O=w.key;y!==null;){if(y.key===O)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(v,y.sibling),y=o(y,w.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=Dg(w,v.mode,k),y.return=v,v=y}return s(v);case Ai:return O=w._init,x(v,y,O(w._payload),k)}if(Vc(w))return h(v,y,w,k);if(Sc(w))return g(v,y,w,k);Ef(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(v,y.sibling),y=o(y,w),y.return=v,v=y):(n(v,y),y=Ig(w,v.mode,k),y.return=v,v=y),s(v)):n(v,y)}return x}var zl=cC(!0),uC=cC(!1),Wd={},go=Es(Wd),Ku=Es(Wd),qu=Es(Wd);function Ks(t){if(t===Wd)throw Error(z(174));return t}function lx(t,e){switch(rt(qu,e),rt(Ku,t),rt(go,Wd),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:$v(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=$v(e,t)}at(go),rt(go,e)}function Fl(){at(go),at(Ku),at(qu)}function dC(t){Ks(qu.current);var e=Ks(go.current),n=$v(e,t.type);e!==n&&(rt(Ku,t),rt(go,n))}function cx(t){Ku.current===t&&(at(go),at(Ku))}var pt=Es(0);function Bp(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 Pg=[];function ux(){for(var t=0;t<Pg.length;t++)Pg[t]._workInProgressVersionPrimary=null;Pg.length=0}var ep=di.ReactCurrentDispatcher,Mg=di.ReactCurrentBatchConfig,la=0,mt=null,Mt=null,zt=null,Vp=!1,ku=!1,Gu=0,WA=0;function tn(){throw Error(z(321))}function dx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Qr(t[n],e[n]))return!1;return!0}function fx(t,e,n,r,o,i){if(la=i,mt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ep.current=t===null||t.memoizedState===null?YA:XA,t=n(r,o),ku){i=0;do{if(ku=!1,Gu=0,25<=i)throw Error(z(301));i+=1,zt=Mt=null,e.updateQueue=null,ep.current=ZA,t=n(r,o)}while(ku)}if(ep.current=Up,e=Mt!==null&&Mt.next!==null,la=0,zt=Mt=mt=null,Vp=!1,e)throw Error(z(300));return t}function px(){var t=Gu!==0;return Gu=0,t}function ao(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?mt.memoizedState=zt=t:zt=zt.next=t,zt}function xr(){if(Mt===null){var t=mt.alternate;t=t!==null?t.memoizedState:null}else t=Mt.next;var e=zt===null?mt.memoizedState:zt.next;if(e!==null)zt=e,Mt=t;else{if(t===null)throw Error(z(310));Mt=t,t={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},zt===null?mt.memoizedState=zt=t:zt=zt.next=t}return zt}function Yu(t,e){return typeof e=="function"?e(t):e}function Ng(t){var e=xr(),n=e.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=t;var r=Mt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((la&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,mt.lanes|=u,ca|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,Qr(r,e.memoizedState)||(Nn=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){o=t;do i=o.lane,mt.lanes|=i,ca|=i,o=o.next;while(o!==t)}else o===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Rg(t){var e=xr(),n=e.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=t;var r=n.dispatch,o=n.pending,i=e.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=t(i,s.action),s=s.next;while(s!==o);Qr(i,e.memoizedState)||(Nn=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function fC(){}function pC(t,e){var n=mt,r=xr(),o=e(),i=!Qr(r.memoizedState,o);if(i&&(r.memoizedState=o,Nn=!0),r=r.queue,hx(gC.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||zt!==null&&zt.memoizedState.tag&1){if(n.flags|=2048,Xu(9,mC.bind(null,n,r,o,e),void 0,null),Vt===null)throw Error(z(349));la&30||hC(n,e,o)}return o}function hC(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=mt.updateQueue,e===null?(e={lastEffect:null,stores:null},mt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function mC(t,e,n,r){e.value=n,e.getSnapshot=r,vC(e)&&yC(t)}function gC(t,e,n){return n(function(){vC(e)&&yC(t)})}function vC(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Qr(t,n)}catch{return!0}}function yC(t){var e=ti(t,1);e!==null&&Gr(e,t,1,-1)}function fw(t){var e=ao();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yu,lastRenderedState:t},e.queue=t,t=t.dispatch=GA.bind(null,mt,t),[e.memoizedState,t]}function Xu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=mt.updateQueue,e===null?(e={lastEffect:null,stores:null},mt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function xC(){return xr().memoizedState}function tp(t,e,n,r){var o=ao();mt.flags|=t,o.memoizedState=Xu(1|e,n,void 0,r===void 0?null:r)}function nm(t,e,n,r){var o=xr();r=r===void 0?null:r;var i=void 0;if(Mt!==null){var s=Mt.memoizedState;if(i=s.destroy,r!==null&&dx(r,s.deps)){o.memoizedState=Xu(e,n,i,r);return}}mt.flags|=t,o.memoizedState=Xu(1|e,n,i,r)}function pw(t,e){return tp(8390656,8,t,e)}function hx(t,e){return nm(2048,8,t,e)}function bC(t,e){return nm(4,2,t,e)}function wC(t,e){return nm(4,4,t,e)}function kC(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function SC(t,e,n){return n=n!=null?n.concat([t]):null,nm(4,4,kC.bind(null,e,t),n)}function mx(){}function EC(t,e){var n=xr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&dx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function _C(t,e){var n=xr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&dx(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function CC(t,e,n){return la&21?(Qr(n,e)||(n=P_(),mt.lanes|=n,ca|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Nn=!0),t.memoizedState=n)}function KA(t,e){var n=Ke;Ke=n!==0&&4>n?n:4,t(!0);var r=Mg.transition;Mg.transition={};try{t(!1),e()}finally{Ke=n,Mg.transition=r}}function OC(){return xr().memoizedState}function qA(t,e,n){var r=Qi(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},TC(t))PC(e,n);else if(n=iC(t,e,n,r),n!==null){var o=vn();Gr(n,t,r,o),MC(n,e,r)}}function GA(t,e,n){var r=Qi(t),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(TC(t))PC(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Qr(a,s)){var l=e.interleaved;l===null?(o.next=o,sx(e)):(o.next=l.next,l.next=o),e.interleaved=o;return}}catch{}finally{}n=iC(t,e,o,r),n!==null&&(o=vn(),Gr(n,t,r,o),MC(n,e,r))}}function TC(t){var e=t.alternate;return t===mt||e!==null&&e===mt}function PC(t,e){ku=Vp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function MC(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,K0(t,n)}}var Up={readContext:yr,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useInsertionEffect:tn,useLayoutEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useMutableSource:tn,useSyncExternalStore:tn,useId:tn,unstable_isNewReconciler:!1},YA={readContext:yr,useCallback:function(t,e){return ao().memoizedState=[t,e===void 0?null:e],t},useContext:yr,useEffect:pw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,tp(4194308,4,kC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return tp(4194308,4,t,e)},useInsertionEffect:function(t,e){return tp(4,2,t,e)},useMemo:function(t,e){var n=ao();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ao();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=qA.bind(null,mt,t),[r.memoizedState,t]},useRef:function(t){var e=ao();return t={current:t},e.memoizedState=t},useState:fw,useDebugValue:mx,useDeferredValue:function(t){return ao().memoizedState=t},useTransition:function(){var t=fw(!1),e=t[0];return t=KA.bind(null,t[1]),ao().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=mt,o=ao();if(lt){if(n===void 0)throw Error(z(407));n=n()}else{if(n=e(),Vt===null)throw Error(z(349));la&30||hC(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,pw(gC.bind(null,r,i,t),[t]),r.flags|=2048,Xu(9,mC.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=ao(),e=Vt.identifierPrefix;if(lt){var n=Ko,r=Wo;n=(r&~(1<<32-qr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Gu++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=WA++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},XA={readContext:yr,useCallback:EC,useContext:yr,useEffect:hx,useImperativeHandle:SC,useInsertionEffect:bC,useLayoutEffect:wC,useMemo:_C,useReducer:Ng,useRef:xC,useState:function(){return Ng(Yu)},useDebugValue:mx,useDeferredValue:function(t){var e=xr();return CC(e,Mt.memoizedState,t)},useTransition:function(){var t=Ng(Yu)[0],e=xr().memoizedState;return[t,e]},useMutableSource:fC,useSyncExternalStore:pC,useId:OC,unstable_isNewReconciler:!1},ZA={readContext:yr,useCallback:EC,useContext:yr,useEffect:hx,useImperativeHandle:SC,useInsertionEffect:bC,useLayoutEffect:wC,useMemo:_C,useReducer:Rg,useRef:xC,useState:function(){return Rg(Yu)},useDebugValue:mx,useDeferredValue:function(t){var e=xr();return Mt===null?e.memoizedState=t:CC(e,Mt.memoizedState,t)},useTransition:function(){var t=Rg(Yu)[0],e=xr().memoizedState;return[t,e]},useMutableSource:fC,useSyncExternalStore:pC,useId:OC,unstable_isNewReconciler:!1};function Bl(t,e){try{var n="",r=e;do n+=_$(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
31
|
-
Error generating stack: `+i.message+`
|
|
32
|
-
`+i.stack}return{value:t,source:e,stack:o,digest:null}}function $g(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function ny(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var JA=typeof WeakMap=="function"?WeakMap:Map;function NC(t,e,n){n=Xo(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Wp||(Wp=!0,fy=r),ny(t,e)},n}function RC(t,e,n){n=Xo(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var o=e.value;n.payload=function(){return r(o)},n.callback=function(){ny(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ny(t,e),typeof r!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function hw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new JA;var o=new Set;r.set(e,o)}else o=r.get(e),o===void 0&&(o=new Set,r.set(e,o));o.has(n)||(o.add(n),t=fI.bind(null,t,e,n),e.then(t,t))}function mw(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function gw(t,e,n,r,o){return t.mode&1?(t.flags|=65536,t.lanes=o,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Xo(-1,1),e.tag=2,Zi(n,e,1))),n.lanes|=1),t)}var QA=di.ReactCurrentOwner,Nn=!1;function hn(t,e,n,r){e.child=t===null?uC(e,null,n,r):zl(e,t.child,n,r)}function vw(t,e,n,r,o){n=n.render;var i=e.ref;return Cl(e,o),r=fx(t,e,n,r,i,o),n=px(),t!==null&&!Nn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~o,ni(t,e,o)):(lt&&n&&ex(e),e.flags|=1,hn(t,e,r,o),e.child)}function yw(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!Sx(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,$C(t,e,i,r,o)):(t=ip(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Vu,n(s,r)&&t.ref===e.ref)return ni(t,e,o)}return e.flags|=1,t=es(i,r),t.ref=e.ref,t.return=e,e.child=t}function $C(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(Vu(i,r)&&t.ref===e.ref)if(Nn=!1,e.pendingProps=r=i,(t.lanes&o)!==0)t.flags&131072&&(Nn=!0);else return e.lanes=t.lanes,ni(t,e,o)}return ry(t,e,n,r,o)}function AC(t,e,n){var r=e.pendingProps,o=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(yl,Hn),Hn|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,rt(yl,Hn),Hn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,rt(yl,Hn),Hn|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,rt(yl,Hn),Hn|=r;return hn(t,e,o,n),e.child}function IC(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function ry(t,e,n,r,o){var i=An(n)?sa:cn.current;return i=Ll(e,i),Cl(e,o),n=fx(t,e,n,r,i,o),r=px(),t!==null&&!Nn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~o,ni(t,e,o)):(lt&&r&&ex(e),e.flags|=1,hn(t,e,n,o),e.child)}function xw(t,e,n,r,o){if(An(n)){var i=!0;Ip(e)}else i=!1;if(Cl(e,o),e.stateNode===null)np(t,e),lC(e,n,r),ty(e,n,r,o),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=yr(c):(c=An(n)?sa:cn.current,c=Ll(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&uw(e,s,r,c),Ii=!1;var f=e.memoizedState;s.state=f,Fp(e,r,s,o),l=e.memoizedState,a!==r||f!==l||$n.current||Ii?(typeof u=="function"&&(ey(e,n,u,r),l=e.memoizedState),(a=Ii||cw(e,n,a,r,f,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,sC(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:Dr(e.type,a),s.props=c,d=e.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=yr(l):(l=An(n)?sa:cn.current,l=Ll(e,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&uw(e,s,r,l),Ii=!1,f=e.memoizedState,s.state=f,Fp(e,r,s,o);var h=e.memoizedState;a!==d||f!==h||$n.current||Ii?(typeof p=="function"&&(ey(e,n,p,r),h=e.memoizedState),(c=Ii||cw(e,n,c,r,f,h,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,h,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,h,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=h),s.props=r,s.state=h,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return oy(t,e,n,r,i,o)}function oy(t,e,n,r,o,i){IC(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return o&&ow(e,n,!1),ni(t,e,i);r=e.stateNode,QA.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=zl(e,t.child,null,i),e.child=zl(e,null,a,i)):hn(t,e,a,i),e.memoizedState=r.state,o&&ow(e,n,!0),e.child}function DC(t){var e=t.stateNode;e.pendingContext?rw(t,e.pendingContext,e.pendingContext!==e.context):e.context&&rw(t,e.context,!1),lx(t,e.containerInfo)}function bw(t,e,n,r,o){return jl(),nx(o),e.flags|=256,hn(t,e,n,r),e.child}var iy={dehydrated:null,treeContext:null,retryLane:0};function sy(t){return{baseLanes:t,cachePool:null,transitions:null}}function LC(t,e,n){var r=e.pendingProps,o=pt.current,i=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(o&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(o|=1),rt(pt,o&1),t===null)return Jv(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,i?(r=e.mode,i=e.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=im(s,r,0,null),t=Qs(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=sy(n),e.memoizedState=iy,t):gx(e,s));if(o=t.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return eI(t,e,s,r,a,o,n);if(i){i=r.fallback,s=e.mode,o=t.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&e.child!==o?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=es(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=es(a,i):(i=Qs(i,s,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,s=t.child.memoizedState,s=s===null?sy(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=t.childLanes&~n,e.memoizedState=iy,r}return i=t.child,t=i.sibling,r=es(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function gx(t,e){return e=im({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function _f(t,e,n,r){return r!==null&&nx(r),zl(e,t.child,null,n),t=gx(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function eI(t,e,n,r,o,i,s){if(n)return e.flags&256?(e.flags&=-257,r=$g(Error(z(422))),_f(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,o=e.mode,r=im({mode:"visible",children:r.children},o,0,null),i=Qs(i,o,s,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&zl(e,t.child,null,s),e.child.memoizedState=sy(s),e.memoizedState=iy,i);if(!(e.mode&1))return _f(t,e,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=$g(i,r,void 0),_f(t,e,s,r)}if(a=(s&t.childLanes)!==0,Nn||a){if(r=Vt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,ti(t,o),Gr(r,t,o,-1))}return kx(),r=$g(Error(z(421))),_f(t,e,s,r)}return o.data==="$?"?(e.flags|=128,e.child=t.child,e=pI.bind(null,t),o._reactRetry=e,null):(t=i.treeContext,Yn=Xi(o.nextSibling),Xn=e,lt=!0,zr=null,t!==null&&(ur[dr++]=Wo,ur[dr++]=Ko,ur[dr++]=aa,Wo=t.id,Ko=t.overflow,aa=e),e=gx(e,r.children),e.flags|=4096,e)}function ww(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Qv(t.return,e,n)}function Ag(t,e,n,r,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function jC(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;if(hn(t,e,r.children,n),r=pt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ww(t,n,e);else if(t.tag===19)ww(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(rt(pt,r),!(e.mode&1))e.memoizedState=null;else switch(o){case"forwards":for(n=e.child,o=null;n!==null;)t=n.alternate,t!==null&&Bp(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),Ag(e,!1,o,n,i);break;case"backwards":for(n=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&Bp(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}Ag(e,!0,n,null,i);break;case"together":Ag(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function np(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ni(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ca|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(z(153));if(e.child!==null){for(t=e.child,n=es(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=es(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function tI(t,e,n){switch(e.tag){case 3:DC(e),jl();break;case 5:dC(e);break;case 1:An(e.type)&&Ip(e);break;case 4:lx(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,o=e.memoizedProps.value;rt(jp,r._currentValue),r._currentValue=o;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(rt(pt,pt.current&1),e.flags|=128,null):n&e.child.childLanes?LC(t,e,n):(rt(pt,pt.current&1),t=ni(t,e,n),t!==null?t.sibling:null);rt(pt,pt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return jC(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),rt(pt,pt.current),r)break;return null;case 22:case 23:return e.lanes=0,AC(t,e,n)}return ni(t,e,n)}var zC,ay,FC,BC;zC=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ay=function(){};FC=function(t,e,n,r){var o=t.memoizedProps;if(o!==r){t=e.stateNode,Ks(go.current);var i=null;switch(n){case"input":o=Pv(t,o),r=Pv(t,r),i=[];break;case"select":o=gt({},o,{value:void 0}),r=gt({},r,{value:void 0}),i=[];break;case"textarea":o=Rv(t,o),r=Rv(t,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=$p)}Av(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Iu.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Iu.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&st("scroll",t),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};BC=function(t,e,n,r){n!==r&&(e.flags|=4)};function Pc(t,e){if(!lt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function nn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function nI(t,e,n){var r=e.pendingProps;switch(tx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(e),null;case 1:return An(e.type)&&Ap(),nn(e),null;case 3:return r=e.stateNode,Fl(),at($n),at(cn),ux(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Sf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zr!==null&&(my(zr),zr=null))),ay(t,e),nn(e),null;case 5:cx(e);var o=Ks(qu.current);if(n=e.type,t!==null&&e.stateNode!=null)FC(t,e,n,r,o),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(z(166));return nn(e),null}if(t=Ks(go.current),Sf(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[co]=e,r[Wu]=i,t=(e.mode&1)!==0,n){case"dialog":st("cancel",r),st("close",r);break;case"iframe":case"object":case"embed":st("load",r);break;case"video":case"audio":for(o=0;o<Hc.length;o++)st(Hc[o],r);break;case"source":st("error",r);break;case"img":case"image":case"link":st("error",r),st("load",r);break;case"details":st("toggle",r);break;case"input":Mb(r,i),st("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},st("invalid",r);break;case"textarea":Rb(r,i),st("invalid",r)}Av(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&kf(r.textContent,a,t),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&kf(r.textContent,a,t),o=["children",""+a]):Iu.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&st("scroll",r)}switch(n){case"input":hf(r),Nb(r,i,!0);break;case"textarea":hf(r),$b(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=$p)}r=o,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=h_(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/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[co]=e,t[Wu]=r,zC(t,e,!1,!1),e.stateNode=t;e:{switch(s=Iv(n,r),n){case"dialog":st("cancel",t),st("close",t),o=r;break;case"iframe":case"object":case"embed":st("load",t),o=r;break;case"video":case"audio":for(o=0;o<Hc.length;o++)st(Hc[o],t);o=r;break;case"source":st("error",t),o=r;break;case"img":case"image":case"link":st("error",t),st("load",t),o=r;break;case"details":st("toggle",t),o=r;break;case"input":Mb(t,r),o=Pv(t,r),st("invalid",t);break;case"option":o=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},o=gt({},r,{value:void 0}),st("invalid",t);break;case"textarea":Rb(t,r),o=Rv(t,r),st("invalid",t);break;default:o=r}Av(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?v_(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&m_(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Du(t,l):typeof l=="number"&&Du(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Iu.hasOwnProperty(i)?l!=null&&i==="onScroll"&&st("scroll",t):l!=null&&F0(t,i,l,s))}switch(n){case"input":hf(t),Nb(t,r,!1);break;case"textarea":hf(t),$b(t);break;case"option":r.value!=null&&t.setAttribute("value",""+cs(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?kl(t,!!r.multiple,i,!1):r.defaultValue!=null&&kl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(t.onclick=$p)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return nn(e),null;case 6:if(t&&e.stateNode!=null)BC(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(z(166));if(n=Ks(qu.current),Ks(go.current),Sf(e)){if(r=e.stateNode,n=e.memoizedProps,r[co]=e,(i=r.nodeValue!==n)&&(t=Xn,t!==null))switch(t.tag){case 3:kf(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&kf(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[co]=e,e.stateNode=r}return nn(e),null;case 13:if(at(pt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(lt&&Yn!==null&&e.mode&1&&!(e.flags&128))oC(),jl(),e.flags|=98560,i=!1;else if(i=Sf(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(z(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[co]=e}else jl(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;nn(e),i=!1}else zr!==null&&(my(zr),zr=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||pt.current&1?Rt===0&&(Rt=3):kx())),e.updateQueue!==null&&(e.flags|=4),nn(e),null);case 4:return Fl(),ay(t,e),t===null&&Uu(e.stateNode.containerInfo),nn(e),null;case 10:return ix(e.type._context),nn(e),null;case 17:return An(e.type)&&Ap(),nn(e),null;case 19:if(at(pt),i=e.memoizedState,i===null)return nn(e),null;if(r=(e.flags&128)!==0,s=i.rendering,s===null)if(r)Pc(i,!1);else{if(Rt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=Bp(t),s!==null){for(e.flags|=128,Pc(i,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,t=s.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return rt(pt,pt.current&1|2),e.child}t=t.sibling}i.tail!==null&&St()>Vl&&(e.flags|=128,r=!0,Pc(i,!1),e.lanes=4194304)}else{if(!r)if(t=Bp(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Pc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!lt)return nn(e),null}else 2*St()-i.renderingStartTime>Vl&&n!==1073741824&&(e.flags|=128,r=!0,Pc(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(n=i.last,n!==null?n.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=St(),e.sibling=null,n=pt.current,rt(pt,r?n&1|2:n&1),e):(nn(e),null);case 22:case 23:return wx(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Hn&1073741824&&(nn(e),e.subtreeFlags&6&&(e.flags|=8192)):nn(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function rI(t,e){switch(tx(e),e.tag){case 1:return An(e.type)&&Ap(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Fl(),at($n),at(cn),ux(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return cx(e),null;case 13:if(at(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));jl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return at(pt),null;case 4:return Fl(),null;case 10:return ix(e.type._context),null;case 22:case 23:return wx(),null;case 24:return null;default:return null}}var Cf=!1,an=!1,oI=typeof WeakSet=="function"?WeakSet:Set,te=null;function vl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(t,e,r)}else n.current=null}function ly(t,e,n){try{n()}catch(r){vt(t,e,r)}}var kw=!1;function iI(t,e){if(Wv=Mp,t=W_(),Q0(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Kv={focusedElem:t,selectionRange:n},Mp=!1,te=e;te!==null;)if(e=te,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,te=t;else for(;te!==null;){e=te;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,x=h.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:Dr(e.type,g),x);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(k){vt(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,te=t;break}te=e.return}return h=kw,kw=!1,h}function Su(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&t)===t){var i=o.destroy;o.destroy=void 0,i!==void 0&&ly(e,n,i)}o=o.next}while(o!==r)}}function rm(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 cy(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 VC(t){var e=t.alternate;e!==null&&(t.alternate=null,VC(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[co],delete e[Wu],delete e[Yv],delete e[BA],delete e[VA])),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 UC(t){return t.tag===5||t.tag===3||t.tag===4}function Sw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||UC(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 uy(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=$p));else if(r!==4&&(t=t.child,t!==null))for(uy(t,e,n),t=t.sibling;t!==null;)uy(t,e,n),t=t.sibling}function dy(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(dy(t,e,n),t=t.sibling;t!==null;)dy(t,e,n),t=t.sibling}var qt=null,jr=!1;function gi(t,e,n){for(n=n.child;n!==null;)HC(t,e,n),n=n.sibling}function HC(t,e,n){if(mo&&typeof mo.onCommitFiberUnmount=="function")try{mo.onCommitFiberUnmount(Yh,n)}catch{}switch(n.tag){case 5:an||vl(n,e);case 6:var r=qt,o=jr;qt=null,gi(t,e,n),qt=r,jr=o,qt!==null&&(jr?(t=qt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):qt.removeChild(n.stateNode));break;case 18:qt!==null&&(jr?(t=qt,n=n.stateNode,t.nodeType===8?Og(t.parentNode,n):t.nodeType===1&&Og(t,n),Fu(t)):Og(qt,n.stateNode));break;case 4:r=qt,o=jr,qt=n.stateNode.containerInfo,jr=!0,gi(t,e,n),qt=r,jr=o;break;case 0:case 11:case 14:case 15:if(!an&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ly(n,e,s),o=o.next}while(o!==r)}gi(t,e,n);break;case 1:if(!an&&(vl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){vt(n,e,a)}gi(t,e,n);break;case 21:gi(t,e,n);break;case 22:n.mode&1?(an=(r=an)||n.memoizedState!==null,gi(t,e,n),an=r):gi(t,e,n);break;default:gi(t,e,n)}}function Ew(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new oI),e.forEach(function(r){var o=hI.bind(null,t,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Mr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:qt=a.stateNode,jr=!1;break e;case 3:qt=a.stateNode.containerInfo,jr=!0;break e;case 4:qt=a.stateNode.containerInfo,jr=!0;break e}a=a.return}if(qt===null)throw Error(z(160));HC(i,s,o),qt=null,jr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){vt(o,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)WC(e,t),e=e.sibling}function WC(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Mr(e,t),io(t),r&4){try{Su(3,t,t.return),rm(3,t)}catch(g){vt(t,t.return,g)}try{Su(5,t,t.return)}catch(g){vt(t,t.return,g)}}break;case 1:Mr(e,t),io(t),r&512&&n!==null&&vl(n,n.return);break;case 5:if(Mr(e,t),io(t),r&512&&n!==null&&vl(n,n.return),t.flags&32){var o=t.stateNode;try{Du(o,"")}catch(g){vt(t,t.return,g)}}if(r&4&&(o=t.stateNode,o!=null)){var i=t.memoizedProps,s=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&f_(o,i),Iv(a,s);var c=Iv(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?v_(o,d):u==="dangerouslySetInnerHTML"?m_(o,d):u==="children"?Du(o,d):F0(o,u,d,c)}switch(a){case"input":Mv(o,i);break;case"textarea":p_(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?kl(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?kl(o,!!i.multiple,i.defaultValue,!0):kl(o,!!i.multiple,i.multiple?[]:"",!1))}o[Wu]=i}catch(g){vt(t,t.return,g)}}break;case 6:if(Mr(e,t),io(t),r&4){if(t.stateNode===null)throw Error(z(162));o=t.stateNode,i=t.memoizedProps;try{o.nodeValue=i}catch(g){vt(t,t.return,g)}}break;case 3:if(Mr(e,t),io(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fu(e.containerInfo)}catch(g){vt(t,t.return,g)}break;case 4:Mr(e,t),io(t);break;case 13:Mr(e,t),io(t),o=t.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(xx=St())),r&4&&Ew(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(an=(c=an)||u,Mr(e,t),an=c):Mr(e,t),io(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(te=t,u=t.child;u!==null;){for(d=te=u;te!==null;){switch(f=te,p=f.child,f.tag){case 0:case 11:case 14:case 15:Su(4,f,f.return);break;case 1:vl(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,h.props=e.memoizedProps,h.state=e.memoizedState,h.componentWillUnmount()}catch(g){vt(r,n,g)}}break;case 5:vl(f,f.return);break;case 22:if(f.memoizedState!==null){Cw(d);continue}}p!==null?(p.return=f,te=p):Cw(d)}u=u.sibling}e:for(u=null,d=t;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=g_("display",s))}catch(g){vt(t,t.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){vt(t,t.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Mr(e,t),io(t),r&4&&Ew(t);break;case 21:break;default:Mr(e,t),io(t)}}function io(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(UC(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Du(o,""),r.flags&=-33);var i=Sw(t);dy(t,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Sw(t);uy(t,a,s);break;default:throw Error(z(161))}}catch(l){vt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function sI(t,e,n){te=t,KC(t)}function KC(t,e,n){for(var r=(t.mode&1)!==0;te!==null;){var o=te,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Cf;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||an;a=Cf;var c=an;if(Cf=s,(an=l)&&!c)for(te=o;te!==null;)s=te,l=s.child,s.tag===22&&s.memoizedState!==null?Ow(o):l!==null?(l.return=s,te=l):Ow(o);for(;i!==null;)te=i,KC(i),i=i.sibling;te=o,Cf=a,an=c}_w(t)}else o.subtreeFlags&8772&&i!==null?(i.return=o,te=i):_w(t)}}function _w(t){for(;te!==null;){var e=te;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:an||rm(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!an)if(n===null)r.componentDidMount();else{var o=e.elementType===e.type?n.memoizedProps:Dr(e.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&lw(e,i,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}lw(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Fu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}an||e.flags&512&&cy(e)}catch(f){vt(e,e.return,f)}}if(e===t){te=null;break}if(n=e.sibling,n!==null){n.return=e.return,te=n;break}te=e.return}}function Cw(t){for(;te!==null;){var e=te;if(e===t){te=null;break}var n=e.sibling;if(n!==null){n.return=e.return,te=n;break}te=e.return}}function Ow(t){for(;te!==null;){var e=te;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{rm(4,e)}catch(l){vt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var o=e.return;try{r.componentDidMount()}catch(l){vt(e,o,l)}}var i=e.return;try{cy(e)}catch(l){vt(e,i,l)}break;case 5:var s=e.return;try{cy(e)}catch(l){vt(e,s,l)}}}catch(l){vt(e,e.return,l)}if(e===t){te=null;break}var a=e.sibling;if(a!==null){a.return=e.return,te=a;break}te=e.return}}var aI=Math.ceil,Hp=di.ReactCurrentDispatcher,vx=di.ReactCurrentOwner,mr=di.ReactCurrentBatchConfig,Ie=0,Vt=null,Ot=null,Xt=0,Hn=0,yl=Es(0),Rt=0,Zu=null,ca=0,om=0,yx=0,Eu=null,Mn=null,xx=0,Vl=1/0,Fo=null,Wp=!1,fy=null,Ji=null,Of=!1,Ui=null,Kp=0,_u=0,py=null,rp=-1,op=0;function vn(){return Ie&6?St():rp!==-1?rp:rp=St()}function Qi(t){return t.mode&1?Ie&2&&Xt!==0?Xt&-Xt:HA.transition!==null?(op===0&&(op=P_()),op):(t=Ke,t!==0||(t=window.event,t=t===void 0?16:D_(t.type)),t):1}function Gr(t,e,n,r){if(50<_u)throw _u=0,py=null,Error(z(185));Vd(t,n,r),(!(Ie&2)||t!==Vt)&&(t===Vt&&(!(Ie&2)&&(om|=n),Rt===4&&zi(t,Xt)),In(t,r),n===1&&Ie===0&&!(e.mode&1)&&(Vl=St()+500,em&&_s()))}function In(t,e){var n=t.callbackNode;H$(t,e);var r=Pp(t,t===Vt?Xt:0);if(r===0)n!==null&&Db(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Db(n),e===1)t.tag===0?UA(Tw.bind(null,t)):tC(Tw.bind(null,t)),zA(function(){!(Ie&6)&&_s()}),n=null;else{switch(M_(r)){case 1:n=W0;break;case 4:n=O_;break;case 16:n=Tp;break;case 536870912:n=T_;break;default:n=Tp}n=eO(n,qC.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function qC(t,e){if(rp=-1,op=0,Ie&6)throw Error(z(327));var n=t.callbackNode;if(Ol()&&t.callbackNode!==n)return null;var r=Pp(t,t===Vt?Xt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=qp(t,r);else{e=r;var o=Ie;Ie|=2;var i=YC();(Vt!==t||Xt!==e)&&(Fo=null,Vl=St()+500,Js(t,e));do try{uI();break}catch(a){GC(t,a)}while(!0);ox(),Hp.current=i,Ie=o,Ot!==null?e=0:(Vt=null,Xt=0,e=Rt)}if(e!==0){if(e===2&&(o=Fv(t),o!==0&&(r=o,e=hy(t,o))),e===1)throw n=Zu,Js(t,0),zi(t,r),In(t,St()),n;if(e===6)zi(t,r);else{if(o=t.current.alternate,!(r&30)&&!lI(o)&&(e=qp(t,r),e===2&&(i=Fv(t),i!==0&&(r=i,e=hy(t,i))),e===1))throw n=Zu,Js(t,0),zi(t,r),In(t,St()),n;switch(t.finishedWork=o,t.finishedLanes=r,e){case 0:case 1:throw Error(z(345));case 2:$s(t,Mn,Fo);break;case 3:if(zi(t,r),(r&130023424)===r&&(e=xx+500-St(),10<e)){if(Pp(t,0)!==0)break;if(o=t.suspendedLanes,(o&r)!==r){vn(),t.pingedLanes|=t.suspendedLanes&o;break}t.timeoutHandle=Gv($s.bind(null,t,Mn,Fo),e);break}$s(t,Mn,Fo);break;case 4:if(zi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,o=-1;0<r;){var s=31-qr(r);i=1<<s,s=e[s],s>o&&(o=s),r&=~i}if(r=o,r=St()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*aI(r/1960))-r,10<r){t.timeoutHandle=Gv($s.bind(null,t,Mn,Fo),r);break}$s(t,Mn,Fo);break;case 5:$s(t,Mn,Fo);break;default:throw Error(z(329))}}}return In(t,St()),t.callbackNode===n?qC.bind(null,t):null}function hy(t,e){var n=Eu;return t.current.memoizedState.isDehydrated&&(Js(t,e).flags|=256),t=qp(t,e),t!==2&&(e=Mn,Mn=n,e!==null&&my(e)),t}function my(t){Mn===null?Mn=t:Mn.push.apply(Mn,t)}function lI(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Qr(i(),o))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function zi(t,e){for(e&=~yx,e&=~om,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-qr(e),r=1<<n;t[n]=-1,e&=~r}}function Tw(t){if(Ie&6)throw Error(z(327));Ol();var e=Pp(t,0);if(!(e&1))return In(t,St()),null;var n=qp(t,e);if(t.tag!==0&&n===2){var r=Fv(t);r!==0&&(e=r,n=hy(t,r))}if(n===1)throw n=Zu,Js(t,0),zi(t,e),In(t,St()),n;if(n===6)throw Error(z(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,$s(t,Mn,Fo),In(t,St()),null}function bx(t,e){var n=Ie;Ie|=1;try{return t(e)}finally{Ie=n,Ie===0&&(Vl=St()+500,em&&_s())}}function ua(t){Ui!==null&&Ui.tag===0&&!(Ie&6)&&Ol();var e=Ie;Ie|=1;var n=mr.transition,r=Ke;try{if(mr.transition=null,Ke=1,t)return t()}finally{Ke=r,mr.transition=n,Ie=e,!(Ie&6)&&_s()}}function wx(){Hn=yl.current,at(yl)}function Js(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,jA(n)),Ot!==null)for(n=Ot.return;n!==null;){var r=n;switch(tx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ap();break;case 3:Fl(),at($n),at(cn),ux();break;case 5:cx(r);break;case 4:Fl();break;case 13:at(pt);break;case 19:at(pt);break;case 10:ix(r.type._context);break;case 22:case 23:wx()}n=n.return}if(Vt=t,Ot=t=es(t.current,null),Xt=Hn=e,Rt=0,Zu=null,yx=om=ca=0,Mn=Eu=null,Ws!==null){for(e=0;e<Ws.length;e++)if(n=Ws[e],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Ws=null}return t}function GC(t,e){do{var n=Ot;try{if(ox(),ep.current=Up,Vp){for(var r=mt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Vp=!1}if(la=0,zt=Mt=mt=null,ku=!1,Gu=0,vx.current=null,n===null||n.return===null){Rt=1,Zu=e,Ot=null;break}e:{var i=t,s=n.return,a=n,l=e;if(e=Xt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=mw(s);if(p!==null){p.flags&=-257,gw(p,s,a,i,e),p.mode&1&&hw(i,c,e),e=p,l=c;var h=e.updateQueue;if(h===null){var g=new Set;g.add(l),e.updateQueue=g}else h.add(l);break e}else{if(!(e&1)){hw(i,c,e),kx();break e}l=Error(z(426))}}else if(lt&&a.mode&1){var x=mw(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),gw(x,s,a,i,e),nx(Bl(l,a));break e}}i=l=Bl(l,a),Rt!==4&&(Rt=2),Eu===null?Eu=[i]:Eu.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=NC(i,l,e);aw(i,v);break e;case 1:a=l;var y=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ji===null||!Ji.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var k=RC(i,a,e);aw(i,k);break e}}i=i.return}while(i!==null)}ZC(n)}catch(E){e=E,Ot===n&&n!==null&&(Ot=n=n.return);continue}break}while(!0)}function YC(){var t=Hp.current;return Hp.current=Up,t===null?Up:t}function kx(){(Rt===0||Rt===3||Rt===2)&&(Rt=4),Vt===null||!(ca&268435455)&&!(om&268435455)||zi(Vt,Xt)}function qp(t,e){var n=Ie;Ie|=2;var r=YC();(Vt!==t||Xt!==e)&&(Fo=null,Js(t,e));do try{cI();break}catch(o){GC(t,o)}while(!0);if(ox(),Ie=n,Hp.current=r,Ot!==null)throw Error(z(261));return Vt=null,Xt=0,Rt}function cI(){for(;Ot!==null;)XC(Ot)}function uI(){for(;Ot!==null&&!I$();)XC(Ot)}function XC(t){var e=QC(t.alternate,t,Hn);t.memoizedProps=t.pendingProps,e===null?ZC(t):Ot=e,vx.current=null}function ZC(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=rI(n,e),n!==null){n.flags&=32767,Ot=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Rt=6,Ot=null;return}}else if(n=nI(n,e,Hn),n!==null){Ot=n;return}if(e=e.sibling,e!==null){Ot=e;return}Ot=e=t}while(e!==null);Rt===0&&(Rt=5)}function $s(t,e,n){var r=Ke,o=mr.transition;try{mr.transition=null,Ke=1,dI(t,e,n,r)}finally{mr.transition=o,Ke=r}return null}function dI(t,e,n,r){do Ol();while(Ui!==null);if(Ie&6)throw Error(z(327));n=t.finishedWork;var o=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(z(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(W$(t,i),t===Vt&&(Ot=Vt=null,Xt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Of||(Of=!0,eO(Tp,function(){return Ol(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=mr.transition,mr.transition=null;var s=Ke;Ke=1;var a=Ie;Ie|=4,vx.current=null,iI(t,n),WC(n,t),NA(Kv),Mp=!!Wv,Kv=Wv=null,t.current=n,sI(n),D$(),Ie=a,Ke=s,mr.transition=i}else t.current=n;if(Of&&(Of=!1,Ui=t,Kp=o),i=t.pendingLanes,i===0&&(Ji=null),z$(n.stateNode),In(t,St()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)o=e[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Wp)throw Wp=!1,t=fy,fy=null,t;return Kp&1&&t.tag!==0&&Ol(),i=t.pendingLanes,i&1?t===py?_u++:(_u=0,py=t):_u=0,_s(),null}function Ol(){if(Ui!==null){var t=M_(Kp),e=mr.transition,n=Ke;try{if(mr.transition=null,Ke=16>t?16:t,Ui===null)var r=!1;else{if(t=Ui,Ui=null,Kp=0,Ie&6)throw Error(z(331));var o=Ie;for(Ie|=4,te=t.current;te!==null;){var i=te,s=i.child;if(te.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(te=c;te!==null;){var u=te;switch(u.tag){case 0:case 11:case 15:Su(8,u,i)}var d=u.child;if(d!==null)d.return=u,te=d;else for(;te!==null;){u=te;var f=u.sibling,p=u.return;if(VC(u),u===c){te=null;break}if(f!==null){f.return=p,te=f;break}te=p}}}var h=i.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}te=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,te=s;else e:for(;te!==null;){if(i=te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Su(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,te=v;break e}te=i.return}}var y=t.current;for(te=y;te!==null;){s=te;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,te=w;else e:for(s=y;te!==null;){if(a=te,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:rm(9,a)}}catch(E){vt(a,a.return,E)}if(a===s){te=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,te=k;break e}te=a.return}}if(Ie=o,_s(),mo&&typeof mo.onPostCommitFiberRoot=="function")try{mo.onPostCommitFiberRoot(Yh,t)}catch{}r=!0}return r}finally{Ke=n,mr.transition=e}}return!1}function Pw(t,e,n){e=Bl(n,e),e=NC(t,e,1),t=Zi(t,e,1),e=vn(),t!==null&&(Vd(t,1,e),In(t,e))}function vt(t,e,n){if(t.tag===3)Pw(t,t,n);else for(;e!==null;){if(e.tag===3){Pw(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ji===null||!Ji.has(r))){t=Bl(n,t),t=RC(e,t,1),e=Zi(e,t,1),t=vn(),e!==null&&(Vd(e,1,t),In(e,t));break}}e=e.return}}function fI(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=vn(),t.pingedLanes|=t.suspendedLanes&n,Vt===t&&(Xt&n)===n&&(Rt===4||Rt===3&&(Xt&130023424)===Xt&&500>St()-xx?Js(t,0):yx|=n),In(t,e)}function JC(t,e){e===0&&(t.mode&1?(e=vf,vf<<=1,!(vf&130023424)&&(vf=4194304)):e=1);var n=vn();t=ti(t,e),t!==null&&(Vd(t,e,n),In(t,n))}function pI(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),JC(t,n)}function hI(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(e),JC(t,n)}var QC;QC=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||$n.current)Nn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Nn=!1,tI(t,e,n);Nn=!!(t.flags&131072)}else Nn=!1,lt&&e.flags&1048576&&nC(e,Lp,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;np(t,e),t=e.pendingProps;var o=Ll(e,cn.current);Cl(e,n),o=fx(null,e,r,t,o,n);var i=px();return e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,An(r)?(i=!0,Ip(e)):i=!1,e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ax(e),o.updater=tm,e.stateNode=o,o._reactInternals=e,ty(e,r,t,n),e=oy(null,e,r,!0,i,n)):(e.tag=0,lt&&i&&ex(e),hn(null,e,o,n),e=e.child),e;case 16:r=e.elementType;e:{switch(np(t,e),t=e.pendingProps,o=r._init,r=o(r._payload),e.type=r,o=e.tag=gI(r),t=Dr(r,t),o){case 0:e=ry(null,e,r,t,n);break e;case 1:e=xw(null,e,r,t,n);break e;case 11:e=vw(null,e,r,t,n);break e;case 14:e=yw(null,e,r,Dr(r.type,t),n);break e}throw Error(z(306,r,""))}return e;case 0:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Dr(r,o),ry(t,e,r,o,n);case 1:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Dr(r,o),xw(t,e,r,o,n);case 3:e:{if(DC(e),t===null)throw Error(z(387));r=e.pendingProps,i=e.memoizedState,o=i.element,sC(t,e),Fp(e,r,null,n);var s=e.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){o=Bl(Error(z(423)),e),e=bw(t,e,r,n,o);break e}else if(r!==o){o=Bl(Error(z(424)),e),e=bw(t,e,r,n,o);break e}else for(Yn=Xi(e.stateNode.containerInfo.firstChild),Xn=e,lt=!0,zr=null,n=uC(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jl(),r===o){e=ni(t,e,n);break e}hn(t,e,r,n)}e=e.child}return e;case 5:return dC(e),t===null&&Jv(e),r=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,s=o.children,qv(r,o)?s=null:i!==null&&qv(r,i)&&(e.flags|=32),IC(t,e),hn(t,e,s,n),e.child;case 6:return t===null&&Jv(e),null;case 13:return LC(t,e,n);case 4:return lx(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=zl(e,null,r,n):hn(t,e,r,n),e.child;case 11:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Dr(r,o),vw(t,e,r,o,n);case 7:return hn(t,e,e.pendingProps,n),e.child;case 8:return hn(t,e,e.pendingProps.children,n),e.child;case 12:return hn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,o=e.pendingProps,i=e.memoizedProps,s=o.value,rt(jp,r._currentValue),r._currentValue=s,i!==null)if(Qr(i.value,s)){if(i.children===o.children&&!$n.current){e=ni(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Xo(-1,n&-n),l.tag=2;var c=i.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}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Qv(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Qv(s,n,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}hn(t,e,o.children,n),e=e.child}return e;case 9:return o=e.type,r=e.pendingProps.children,Cl(e,n),o=yr(o),r=r(o),e.flags|=1,hn(t,e,r,n),e.child;case 14:return r=e.type,o=Dr(r,e.pendingProps),o=Dr(r.type,o),yw(t,e,r,o,n);case 15:return $C(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Dr(r,o),np(t,e),e.tag=1,An(r)?(t=!0,Ip(e)):t=!1,Cl(e,n),lC(e,r,o),ty(e,r,o,n),oy(null,e,r,!0,t,n);case 19:return jC(t,e,n);case 22:return AC(t,e,n)}throw Error(z(156,e.tag))};function eO(t,e){return C_(t,e)}function mI(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 pr(t,e,n,r){return new mI(t,e,n,r)}function Sx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gI(t){if(typeof t=="function")return Sx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===V0)return 11;if(t===U0)return 14}return 2}function es(t,e){var n=t.alternate;return n===null?(n=pr(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 ip(t,e,n,r,o,i){var s=2;if(r=t,typeof t=="function")Sx(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ll:return Qs(n.children,o,i,e);case B0:s=8,o|=8;break;case _v:return t=pr(12,n,e,o|2),t.elementType=_v,t.lanes=i,t;case Cv:return t=pr(13,n,e,o),t.elementType=Cv,t.lanes=i,t;case Ov:return t=pr(19,n,e,o),t.elementType=Ov,t.lanes=i,t;case c_:return im(n,o,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case a_:s=10;break e;case l_:s=9;break e;case V0:s=11;break e;case U0:s=14;break e;case Ai:s=16,r=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=pr(s,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Qs(t,e,n,r){return t=pr(7,t,r,e),t.lanes=n,t}function im(t,e,n,r){return t=pr(22,t,r,e),t.elementType=c_,t.lanes=n,t.stateNode={isHidden:!1},t}function Ig(t,e,n){return t=pr(6,t,null,e),t.lanes=n,t}function Dg(t,e,n){return e=pr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function vI(t,e,n,r,o){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=gg(0),this.expirationTimes=gg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gg(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ex(t,e,n,r,o,i,s,a,l){return t=new vI(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=pr(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ax(i),t}function yI(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:al,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function tO(t){if(!t)return us;t=t._reactInternals;e:{if(Oa(t)!==t||t.tag!==1)throw Error(z(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(An(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(z(171))}if(t.tag===1){var n=t.type;if(An(n))return eC(t,n,e)}return e}function nO(t,e,n,r,o,i,s,a,l){return t=Ex(n,r,!0,t,o,i,s,a,l),t.context=tO(null),n=t.current,r=vn(),o=Qi(n),i=Xo(r,o),i.callback=e??null,Zi(n,i,o),t.current.lanes=o,Vd(t,o,r),In(t,r),t}function sm(t,e,n,r){var o=e.current,i=vn(),s=Qi(o);return n=tO(n),e.context===null?e.context=n:e.pendingContext=n,e=Xo(i,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Zi(o,e,s),t!==null&&(Gr(t,o,s,i),Qf(t,o,s)),s}function Gp(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Mw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function _x(t,e){Mw(t,e),(t=t.alternate)&&Mw(t,e)}function xI(){return null}var rO=typeof reportError=="function"?reportError:function(t){console.error(t)};function Cx(t){this._internalRoot=t}am.prototype.render=Cx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(z(409));sm(t,e,null,null)};am.prototype.unmount=Cx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;ua(function(){sm(null,t,null,null)}),e[ei]=null}};function am(t){this._internalRoot=t}am.prototype.unstable_scheduleHydration=function(t){if(t){var e=$_();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ji.length&&e!==0&&e<ji[n].priority;n++);ji.splice(n,0,t),n===0&&I_(t)}};function Ox(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function lm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Nw(){}function bI(t,e,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Gp(s);i.call(c)}}var s=nO(e,r,t,0,null,!1,!1,"",Nw);return t._reactRootContainer=s,t[ei]=s.current,Uu(t.nodeType===8?t.parentNode:t),ua(),s}for(;o=t.lastChild;)t.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Gp(l);a.call(c)}}var l=Ex(t,0,!1,null,null,!1,!1,"",Nw);return t._reactRootContainer=l,t[ei]=l.current,Uu(t.nodeType===8?t.parentNode:t),ua(function(){sm(e,l,n,r)}),l}function cm(t,e,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Gp(s);a.call(l)}}sm(e,s,t,o)}else s=bI(n,e,t,o,r);return Gp(s)}N_=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Uc(e.pendingLanes);n!==0&&(K0(e,n|1),In(e,St()),!(Ie&6)&&(Vl=St()+500,_s()))}break;case 13:ua(function(){var r=ti(t,1);if(r!==null){var o=vn();Gr(r,t,1,o)}}),_x(t,1)}};q0=function(t){if(t.tag===13){var e=ti(t,134217728);if(e!==null){var n=vn();Gr(e,t,134217728,n)}_x(t,134217728)}};R_=function(t){if(t.tag===13){var e=Qi(t),n=ti(t,e);if(n!==null){var r=vn();Gr(n,t,e,r)}_x(t,e)}};$_=function(){return Ke};A_=function(t,e){var n=Ke;try{return Ke=t,e()}finally{Ke=n}};Lv=function(t,e,n){switch(e){case"input":if(Mv(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var o=Qh(r);if(!o)throw Error(z(90));d_(r),Mv(r,o)}}}break;case"textarea":p_(t,n);break;case"select":e=n.value,e!=null&&kl(t,!!n.multiple,e,!1)}};b_=bx;w_=ua;var wI={usingClientEntryPoint:!1,Events:[Hd,fl,Qh,y_,x_,bx]},Mc={findFiberByHostInstance:Hs,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},kI={bundleType:Mc.bundleType,version:Mc.version,rendererPackageName:Mc.rendererPackageName,rendererConfig:Mc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:di.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=E_(t),t===null?null:t.stateNode},findFiberByHostInstance:Mc.findFiberByHostInstance||xI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tf.isDisabled&&Tf.supportsFiber)try{Yh=Tf.inject(kI),mo=Tf}catch{}}nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wI;nr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ox(e))throw Error(z(200));return yI(t,e,null,n)};nr.createRoot=function(t,e){if(!Ox(t))throw Error(z(299));var n=!1,r="",o=rO;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=Ex(t,1,!1,null,null,n,!1,r,o),t[ei]=e.current,Uu(t.nodeType===8?t.parentNode:t),new Cx(e)};nr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(z(188)):(t=Object.keys(t).join(","),Error(z(268,t)));return t=E_(e),t=t===null?null:t.stateNode,t};nr.flushSync=function(t){return ua(t)};nr.hydrate=function(t,e,n){if(!lm(e))throw Error(z(200));return cm(null,t,e,!0,n)};nr.hydrateRoot=function(t,e,n){if(!Ox(t))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=rO;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=nO(e,null,t,1,n??null,o,!1,i,s),t[ei]=e.current,Uu(t),r)for(t=0;t<r.length;t++)n=r[t],o=n._getVersion,o=o(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,o]:e.mutableSourceEagerHydrationData.push(n,o);return new am(e)};nr.render=function(t,e,n){if(!lm(e))throw Error(z(200));return cm(null,t,e,!1,n)};nr.unmountComponentAtNode=function(t){if(!lm(t))throw Error(z(40));return t._reactRootContainer?(ua(function(){cm(null,null,t,!1,function(){t._reactRootContainer=null,t[ei]=null})}),!0):!1};nr.unstable_batchedUpdates=bx;nr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!lm(n))throw Error(z(200));if(t==null||t._reactInternals===void 0)throw Error(z(38));return cm(t,e,n,!1,r)};nr.version="18.2.0-next-9e3b772b8-20220608";function oO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oO)}catch(t){console.error(t)}}oO(),n_.exports=nr;var Sr=n_.exports;const SI=ui(Sr);var Rw=Sr;gu.createRoot=Rw.createRoot,gu.hydrateRoot=Rw.hydrateRoot;var iO={exports:{}},um={};/**
|
|
33
|
-
* @license React
|
|
34
|
-
* react-jsx-runtime.production.min.js
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var EI=m,_I=Symbol.for("react.element"),CI=Symbol.for("react.fragment"),OI=Object.prototype.hasOwnProperty,TI=EI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PI={key:!0,ref:!0,__self:!0,__source:!0};function sO(t,e,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)OI.call(e,r)&&!PI.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:_I,type:t,key:i,ref:s,props:o,_owner:TI.current}}um.Fragment=CI;um.jsx=sO;um.jsxs=sO;iO.exports=um;var b=iO.exports;function gy(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Tx(t,e){if(t){if(typeof t=="string")return gy(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 gy(t,e)}}function dm(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Tx(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function aO(t){return t.length>0}var Kd=Object.freeze({kind:"ok",value:void 0});function qd(t){return t===void 0?Kd:{kind:"ok",value:t}}function yo(t){return{kind:"err",error:t}}function cc(t){return t===Kd||t.kind==="ok"}function Px(t){return t!==Kd&&t.kind==="err"}function lO(t){var e=[],n=[],r=dm(t),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;cc(i)?e.push(i.value):n.push(i.error)}}catch(s){r.e(s)}finally{r.f()}return aO(n)?yo(n):qd(e)}function MI(t){return lO(t)}function NI(t){var e=[],n=dm(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;Px(o)&&e.push(o.error)}}catch(i){n.e(i)}finally{n.f()}return aO(e)?yo(e):Kd}function RI(t,e){return function(n){for(var r=qd(e),o=0;o<n.length&&cc(r);++o)r=t(r.value,n[o],o);return r}}function $I(t){return function(e){return cc(e)?qd(t(e.value)):e}}function AI(t){return function(e){return cc(e)?t(e.value):e}}function II(t){return function(e){return Px(e)?yo(t(e.error)):e}}function DI(t,e){return function(n){return t(n)?qd(n):yo(e(n))}}var LI=function(e,n){return function(r){return cc(r)?e(r.value)?r:yo(n(r.value)):r}},Ve=Object.freeze({__proto__:null,voidOk:Kd,ok:qd,err:yo,isOk:cc,isErr:Px,allT:lO,all:MI,allV:NI,flatMapReduce:RI,map:$I,flatMap:AI,mapErr:II,fromPredicate:DI,filterOrElse:LI});function jI(t){if(Array.isArray(t))return gy(t)}function zI(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function FI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
42
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cO(t){return jI(t)||zI(t)||Tx(t)||FI()}function me(t){"@babel/helpers - typeof";return me=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},me(t)}function BI(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uO(t){var e=BI(t,"string");return typeof e=="symbol"?e:String(e)}function ae(t,e,n){return e=uO(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function fr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$w(Object(n),!0).forEach(function(r){ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$w(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function VI(t){if(Array.isArray(t))return t}function UI(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function HI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
43
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ts(t,e){return VI(t)||UI(t,e)||Tx(t,e)||HI()}function Qt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Aw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uO(r.key),r)}}function en(t,e,n){return e&&Aw(t.prototype,e),n&&Aw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yp(t){return Yp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yp(t)}function dO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dO=function(){return!!t})()}function fO(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function WI(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fO(t)}function or(t,e,n){return e=Yp(e),WI(t,dO()?Reflect.construct(e,n||[],Yp(t).constructor):e.apply(t,n))}function vy(t,e){return vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},vy(t,e)}function ir(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vy(t,e)}var sr=function(){function t(){Qt(this,t)}return en(t,[{key:"appendValidationError",value:function(n,r,o,i){return n?(n[r]?n[r].push({message:o,value:i}):n[r]=[{message:o,value:i}],n):ae({},r,[{message:o,value:i}])}}]),t}(),Cu=Symbol("GetSchema"),gn=Symbol("Path"),Nt=Symbol("GetSource");function KI(t){return t[Cu]}var Mx=en(function t(e){Qt(this,t),this.span=e}),qI=function(t){ir(e,t);function e(n,r){var o;return Qt(this,e),o=or(this,e,[r]),ae(fO(o),"type","Sym"),o.value=n,o}return en(e,[{key:"transpile",value:function(){return this.value}}]),e}(Mx);new qI("()");var Ut="_type",Zt="_ref",Iw="_tag",GI=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.options=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?ae({},r,[{message:"Non-optional file was null or undefined.",value:o}]):typeof o[Zt]!="string"?ae({},r,[{message:"File did not have a file reference string. Got: ".concat(me(o[Zt])),value:o}]):o[Ut]!=="file"?ae({},r,[{message:"File did not have the valid file extension type. Got: ".concat(o[Ut]),value:o}]):o.metadata?ae({},r,[{message:"Found metadata, but it could not be validated. File metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["file:check-metadata"]}]):ae({},r,[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[Zt])==="file"&&(r==null?void 0:r[Ut])==="file"}},{key:"nullable",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"file",options:this.options,opt:this.opt}}}]),e}(sr),YI=function(e){return new GI(e)};function pO(t){var e,n,r;if(!t[Zt].startsWith("/public")){var o,i,s;return{url:t[Zt]+((o=t.metadata)!==null&&o!==void 0&&o.sha256?"?sha256=".concat((i=t.metadata)===null||i===void 0?void 0:i.sha256):"")+(t.patch_id?"".concat((s=t.metadata)!==null&&s!==void 0&&s.sha256?"&":"?","patch_id=").concat(t.patch_id):""),metadata:t.metadata}}return{url:t[Zt].slice(7)+((e=t.metadata)!==null&&e!==void 0&&e.sha256?"?sha256=".concat((n=t.metadata)===null||n===void 0?void 0:n.sha256):"")+(t.patch_id?"".concat((r=t.metadata)!==null&&r!==void 0&&r.sha256?"&":"?","patch_id=").concat(t.patch_id):""),metadata:t.metadata}}function hO(t){return me(t)==="object"&&t!==null&&t!==void 0&&("val"in t||"valPath"in t)}function XI(t){return me(t)==="object"&&t!==null&&t!==void 0&&gn in t&&"val"in t}function mO(t){return t[gn]}function ZI(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Dw(t,e,n){return e?Lt(t(Lt(e,n))):Lt(e,n)}function ns(t){return me(t)==="object"&&t!==null&&(Nt in t||gn in t)}function Lt(t,e,n){if(me(t)==="object"){if(ns(t))return t;if(hO(t))return Lt(t.val,t.valPath)}if(t&&t[Zt]&&t[Ut]==="file"){var r=t[Zt];if(typeof r!="string")throw Error("Invalid file ref: "+r);return Lt(pO(t),e,n)}switch(me(t)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(me(t),": ").concat(t));case"object":if(t!==null)return new Proxy(t,{has:function(i,s){return s===Nt||s===gn||s==="andThen"||s===Cu?!0:s in i},get:function(i,s){if(s===Nt)return t;if(s===gn)return e;if(s===Cu)return n;if(s==="andThen")return function(l){return Dw(l,t,e)};if(Array.isArray(i)){if(s==="filter")return function(l){var c=i.map(function(u,d){return Lt(u,hr(e,d),n==null?void 0:n.item)}).filter(function(u){return l&&l instanceof sr?l.assert(Lw(u)):Lw(l(u))});return Lt(c,e,n)};if(s==="map")return function(l){var c=i.map(function(u,d){var f=l(Lt(u,hr(e,d),n==null?void 0:n.item),Lt(d));return ns(f)?f:Lt(f)});return Lt(c,e,n)}}if(Array.isArray(i)&&s==="length")return Lt(i.length);var a=Reflect.get(i,s);return ZI(t,s)?Number.isNaN(Number(s))?Lt(a,hr(e,s),n==null?void 0:n.items[s]):Lt(a,hr(e,Number(s)),n==null?void 0:n.item):a}});default:return ae(ae(ae({eq:function(i){var s=i;if(ns(i)&&(s=i[Nt],s instanceof Mx))throw Error("TODO: Cannot evaluate equality with an Expr");return Lt(t===s,void 0)},andThen:function(i){return Dw(i,t===void 0?null:t,e)}},Nt,t===void 0?null:t),gn,e),Cu,n)}}function hr(t,e){if(me(e)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(e.toString()));if(t)return t.includes(Fe.ModuleFilePathSep)?"".concat(t,".").concat(JSON.stringify(e)):"".concat(t).concat(Fe.ModuleFilePathSep).concat(JSON.stringify(e))}function Lw(t){if(me(t)==="object"&&(Nt in t||gn in t)){var e=t[Nt];return e}return t}var Nx=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.items=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:me(o)!=="object"?ae({},r,[{message:"Expected 'object', got '".concat(me(o),"'")}]):Array.isArray(o)?ae({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var l=ts(a,2),c=l[0],u=l[1],d=hr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(c),o);else{var f=u.validate(d,o[c]);f&&s?s=fr(fr({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(this.items);o<i.length;o++){var s=ts(i[o],2),a=s[0],l=s[1];if(!l.assert(r[a]))return!1}return me(r)==="object"&&!Array.isArray(r)}},{key:"nullable",value:function(){return new e(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(r){var o=ts(r,2),i=o[0],s=o[1];return[i,s.serialize()]})),opt:this.opt}}}]),e}(sr),JI=function(e){return new Nx(e)},gO=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.item=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:me(o)!=="object"||!Array.isArray(o)?ae({},r,[{message:"Expected 'array', got '".concat(me(o),"'")}]):(o.forEach(function(a,l){var c=hr(r,l);if(!c)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at index ").concat(l),o);else{var u=i.item.validate(c,a);u&&s?s=fr(fr({},u),s):u&&(s=u)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;var o=dm(r),i;try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return me(r)==="object"&&Array.isArray(r)}},{key:"nullable",value:function(){return new e(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),e}(sr),QI=function(e){return new gO(e)},yy=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.value=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="string"?ae({},r,[{message:"Expected 'string', got '".concat(me(o),"'"),value:o}]):o!==this.value?ae({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"nullable",value:function(){return new e(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),e}(sr),eD=function(e){return new yy(e)},vO=function(t){ir(e,t);function e(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Qt(this,e),o=or(this,e),o.key=n,o.items=r,o.opt=i,o}return en(e,[{key:"validate",value:function(r,o){var i=o,s=!1;if(this.opt&&i==null)return!1;if(!this.key)return ae({},r,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return ae({},r,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(P){return!(P instanceof Nx)}))return ae({},r,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var l=this.items,c=l.map(function(P){return P.serialize()}),u=c.filter(function(P){return P.type!=="object"||P.items[a].type!=="literal"});if(u.length>0)return ae({},r,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),fatal:!0}]);var d=c,f=d.filter(function(P){return P.items[a].opt});if(f.length>1)return ae({},r,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(me(i)!=="object")return ae({},r,[{message:"Expected an object"}]);var p=i;if(p[a]===void 0)return ae({},r,[{message:"Missing required key: ".concat(a)}]);var h=[],g=dm(d),x;try{for(g.s();!(x=g.n()).done;){var v=x.value,y=v.items[a];if(y.type==="literal")if(!h.includes(y.value))h.push(y.value);else return ae({},r,[{message:"Found duplicate key in schema: ".concat(y.value),fatal:!0}])}}catch(P){g.e(P)}finally{g.f()}var w=l.find(function(P){return!P.items[a].validate(r,p[a])});if(!w){var k=hr(r,a);if(!k)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return ae({},k,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(p[a],'". Valid values: ').concat(d.map(function(P){var M=P.items[a];if(M.type==="literal"&&M.value)return'"'.concat(M.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(M,null,2)))}).join(", "))}])}var E=w.validate(r,p);if(E)return E}else if(a instanceof yy){if(this.items.some(function(P){return!(P instanceof yy)}))return ae({},r,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var O=[a].concat(cO(this.items));if(typeof i=="string"){var S=O.some(function(P){return!P.validate(r,i)});if(!S)return ae({},r,[{message:"Union must match one of the following: ".concat(O.map(function(P){return'"'.concat(P.value,'"')}).join(", "))}])}}else return ae({},r,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(r){return!0}},{key:"nullable",value:function(){return new e(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(r){return r.serialize()}),opt:this.opt}:{type:"union",key:this.key.serialize(),items:this.items.map(function(r){return r.serialize()}),opt:this.opt}}}]),e}(sr),tD=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new vO(e,r)},yO=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.options=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){return!1}},{key:"assert",value:function(r){return!0}},{key:"nullable",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt,options:this.options}}}]),e}(sr),nD=function(e){return new yO(e??{})},xO=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.options=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?ae({},r,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[Zt]!="string"?ae({},r,[{message:"Image did not have a file reference string. Got: ".concat(me(o[Zt])),value:o}]):o[Ut]!=="file"?ae({},r,[{message:"Image did not have the valid file extension type. Got: ".concat(o[Ut]),value:o}]):o.metadata?ae({},r,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):ae({},r,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[Zt])==="image"&&(r==null?void 0:r[Ut])==="file"}},{key:"nullable",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),e}(sr),rD=function(e){return new xO(e)},bO=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.item=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:me(o)!=="object"?ae({},r,[{message:"Expected 'object', got '".concat(me(o),"'")}]):Array.isArray(o)?ae({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var l=ts(a,2),c=l[0],u=l[1],d=hr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(u),o);else{var f=i.item.validate(d,u);f&&s?s=fr(fr({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(r);o<i.length;o++){var s=ts(i[o],2),a=s[1];if(!this.item.assert(a))return!1}return me(r)==="object"&&!Array.isArray(r)}},{key:"nullable",value:function(){return new e(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),e}(sr),oD=function(e){return new bO(e)};function iD(t){var e=t[Nt];if(e instanceof Mx)throw Error("Cannot get raw source of an Expr");var n=e;return n}function sD(t){var e=t.indexOf(xy);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+xy.length)]}var xy="?p=";function aD(t){return t instanceof Nx||me(t)==="object"&&"type"in t&&t.type==="object"}function lD(t){return t instanceof bO||me(t)==="object"&&"type"in t&&t.type==="record"}function cD(t){return t instanceof gO||me(t)==="object"&&"type"in t&&t.type==="array"}function uD(t){return t instanceof vO||me(t)==="object"&&"type"in t&&t.type==="union"}function dD(t){return t instanceof yO||me(t)==="object"&&"type"in t&&t.type==="richtext"}function fD(t){return t instanceof xO||me(t)==="object"&&"type"in t&&t.type==="image"}function pD(t,e,n){for(var r=wO(t),o=cO(r),i=n,s=e,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if(cD(i)){if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(t));if(me(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(me(s)));if(s[u]===void 0){var d;throw Error("Invalid path: array source (length: ".concat((d=s)===null||d===void 0?void 0:d.length,") did not have index ").concat(u," from path: ").concat(t))}s=s[u],i=i.item}else if(lD(i)){if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(me(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(me(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(t));s=s[u],i=i.item}else if(aD(i)){if(me(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(me(s)));if(!s[u])throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(t));s=s[u],i=i.items[u]}else{if(fD(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};if(uD(i)){var f=i.key;if(typeof f!="string")return{v:{path:o.map(function(g){return Number.isNaN(Number(g))?JSON.stringify(g):g}).join("."),schema:i,source:s}};var p=s[f];if(!p)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(f," in path: ").concat(t));var h=i.items.find(function(g){var x;return(g==null||(x=g.items)===null||x===void 0||(x=x[f])===null||x===void 0?void 0:x.value)===p});if(!h)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(f," of value ").concat(p," in path: ").concat(t));i=h.items[u],s=s[u]}else{if(dD(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function wO(t){for(var e=[],n=0;n<t.length;){var r="";if(t[n]==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&t[n+1]==='"'?(r+='"',n++):r+=t[n],n++;if(t[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((o=t[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(t.length,")"))}}else for(;n<t.length&&t[n]!==".";)r+=t[n],n++;r!==""&&e.push(r),n++}return e}var hD=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qt(this,e),r=or(this,e),r.options=n,r.opt=o,r}return en(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="number"?ae({},r,[{message:"Expected 'number', got '".concat(me(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="number"}},{key:"nullable",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"number",options:this.options,opt:this.opt}}}]),e}(sr),mD=function(e){return new hD(e)},kO=function(t){ir(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Qt(this,e),r=or(this,e),r.options=n,r.opt=o,r.isRaw=i,r}return en(e,[{key:"min",value:function(r){return new e(fr(fr({},this.options),{},{minLength:r}),this.opt,this.isRaw)}},{key:"max",value:function(r){return new e(fr(fr({},this.options),{},{maxLength:r}),this.opt,this.isRaw)}},{key:"regexp",value:function(r){return new e(fr(fr({},this.options),{},{regexp:r}),this.opt,this.isRaw)}},{key:"validate",value:function(r,o){var i,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return ae({},r,[{message:"Expected 'string', got '".concat(me(o),"'"),value:o}]);var l=[];return(i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?ae({},r,l):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"nullable",value:function(){return new e(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new e(this.options,this.opt,!0)}},{key:"serialize",value:function(){var r,o,i;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),e}(sr),gD=function(e){return new kO(e)},vD=function(t){ir(e,t);function e(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Qt(this,e),n=or(this,e),n.opt=r,n}return en(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?ae({},r,[{message:"Expected 'boolean', got '".concat(me(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="boolean"}},{key:"nullable",value:function(){return new e(!0)}},{key:"serialize",value:function(){return{type:"boolean",opt:this.opt}}}]),e}(sr),yD=function(){return new vD},xD=function(t){ir(e,t);function e(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Qt(this,e),o=or(this,e),o.schema=n,o.sourcePath=r,o.opt=i,o}return en(e,[{key:"validate",value:function(r,o){if(this.opt&&o==null)return!1;if(!this.schema)return ae({},r,[{message:"Schema not found for module. keyOf must be used with a Val Module"}]);var i=this.schema;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return ae({},r,[{message:"Schema in keyOf must be an 'array', 'object' or 'record'. Found '".concat(i.type,"'")}]);if(i.opt&&o==null)return!1;if(i.type==="array"&&typeof o!="number")return ae({},r,[{message:"Type of value in keyof (array) must be 'number'"}]);if(i.type==="record"&&typeof o!="string")return ae({},r,[{message:"Type of value in keyof (record) must be 'string'"}]);if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(o))return ae({},r,[{message:"Value of keyOf (object) must be: ".concat(s.join(", "),". Found: ").concat(o)}])}return!1}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;var o=this.schema;if(!o)return!1;var i=o;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return!1;if(i.opt&&r==null)return!0;if(i.type==="array"&&typeof r!="number"||i.type==="record"&&typeof r!="string")return!1;if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(r))return!1}return!0}},{key:"nullable",value:function(){return new e(this.schema,this.sourcePath,!0)}},{key:"serialize",value:function(){var r=this.sourcePath;if(!r)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module.");var o=this.schema;if(!o)throw new Error("Cannot serialize keyOf schema with empty selector.");var i;switch(o.type){case"array":i="number";break;case"record":i="string";break;case"object":i=Object.keys(o.items);break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(o.type,"'. keyOf must be used with a Val Module."))}return{type:"keyOf",path:r,schema:o,opt:this.opt,values:i}}}]),e}(sr),bD=function(e){var n;return new xD(e==null||(n=e[Cu])===null||n===void 0?void 0:n.serialize(),mO(e))};function wD(){return{string:gD,boolean:yD,array:QI,object:JI,number:mD,union:tD,richtext:nD,image:rD,literal:eD,keyOf:bD,record:oD,file:YI}}var jw="rt_image";function kD(t){return SO(_D(t))}function SD(t){return ns(t)?me(t[Nt])==="object"&&t[Nt]!==null&&Array.isArray(t[Nt]):Array.isArray(t)}function ED(t){return ns(t)?me(t[Nt])==="object"&&t[Nt]!==null&&!Array.isArray(t[Nt]):me(t)==="object"}function _D(t){var e=Lt(t);function n(r){var o=SD(r),i=ED(r);if(o){var s=Nt in r?r[Nt]:r,a=gn in r?r[gn]:void 0;return{val:s.map(function(u,d){return n(ns(u)?u:Lt(u,hr(a,d)))}),valPath:a}}else if(i){var l=Nt in r?r[Nt]:r,c=gn in r?r[gn]:void 0;return{val:l!==null&&Object.fromEntries(Object.entries(l).map(function(u){var d=ts(u,2),f=d[0],p=d[1];return[f,n(ns(p)?p:Lt(p,hr(c,f)))]})),valPath:c}}else return ns(r)?{val:n(r[Nt]),valPath:r[gn]}:r}return n(e)}function by(t){var e=hO(t)?t.val:t;switch(me(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(me(e)));case"object":return e===null?null:Array.isArray(e)?e.map(by):Object.fromEntries(Object.entries(e).map(function(n){var r=ts(n,2),o=r[0],i=r[1];return[o,i&&by(i)]}));default:return e}}function SO(t){var e=t.val;switch(me(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(me(e)));case"object":if(e!==null)return new Proxy(e,{has:function(r,o){return o==="val"||o===gn?!0:zw(r,o)},get:function(r,o){if(o===gn)return t.valPath;if(o==="val")return by(t);if(Array.isArray(r)&&o==="length")return r.length;if(zw(e,o)){var i,s;return SO({val:Reflect.get(r,o).val,valPath:(i=(s=Reflect.get(r,o))===null||s===void 0?void 0:s.valPath)!==null&&i!==void 0?i:hr(t.valPath,Array.isArray(r)?Number(o):o)})}return Reflect.get(r,o)}});default:return ae(ae({},gn,t.valPath),"val",t.val)}}function zw(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var CD=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Qe=function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t}(Qe||{}),Fw={sha256:1};function OD(t){if(t&&!Fw[t]&&!Fw[t.toLowerCase()])throw new Error("Digest method not supported");return new TD}var TD=function(){function t(){Qt(this,t),ae(this,"A",1779033703),ae(this,"B",-1150833019),ae(this,"C",1013904242),ae(this,"D",-1521486534),ae(this,"E",1359893119),ae(this,"F",-1694144372),ae(this,"G",528734635),ae(this,"H",1541459225),ae(this,"_size",0),ae(this,"_sp",0),(!Pf||Nc>=Qe.allocTotal)&&(Pf=new ArrayBuffer(Qe.allocTotal),Nc=0),this._byte=new Uint8Array(Pf,Nc,Qe.allocBytes),this._word=new Int32Array(Pf,Nc,Qe.allocWords),Nc+=Qe.allocBytes}return en(t,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+me(n));var r=n.byteOffset,o=n.byteLength,i=o/Qe.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%Qe.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*Qe.inputWords);i--;)this._int32(a,s>>2),s+=Qe.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%Qe.inputBytes,l=a;r<s&&l<Qe.inputBytes;)o[l++]=n[r++];l>=Qe.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%Qe.inputBytes,c=l;a<i&&c<Qe.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=Qe.inputBytes&&(this._int32(o),o[0]=o[Qe.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,d=this.H,f=0;for(r=r|0;f<Qe.inputWords;)Ms[f++]=Nr(n[r++]);for(f=Qe.inputWords;f<Qe.workWords;f++)Ms[f]=DD(Ms[f-2])+Ms[f-7]+ID(Ms[f-15])+Ms[f-16]|0;for(f=0;f<Qe.workWords;f++){var p=d+AD(l)+ND(l,c,u)+CD[f]+Ms[f]|0,h=$D(o)+RD(o,i,s)|0;d=u,u=c,c=l,l=a+p|0,a=s,s=i,i=o,o=p+h|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%Qe.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>Qe.highIndex){for(;i<Qe.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<Qe.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[Qe.highIndex]=Nr(l)),a&&(o[Qe.lowIndex]=Nr(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return vi(n)+vi(r)+vi(o)+vi(i)+vi(s)+vi(a)+vi(l)+vi(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,d=this._word;return d[0]=Nr(n),d[1]=Nr(r),d[2]=Nr(o),d[3]=Nr(i),d[4]=Nr(s),d[5]=Nr(a),d[6]=Nr(l),d[7]=Nr(c),u.slice(0,32)}}]),t}(),Ms=new Int32Array(Qe.workWords),Pf,Nc=0,vi=function(e){return(e+4294967296).toString(16).substr(-8)},PD=function(e){return e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255},MD=function(e){return e},Nr=LD()?MD:PD,ND=function(e,n,r){return r^e&(n^r)},RD=function(e,n,r){return e&n|r&(e|n)},$D=function(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)},AD=function(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)},ID=function(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3},DD=function(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10};function LD(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var EO=function(e){return OD().update(e).digest("hex")};function Lr(){Lr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(C,T,_){C[T]=_.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(C,T,_){return Object.defineProperty(C,T,{value:_,enumerable:!0,configurable:!0,writable:!0}),C[T]}try{c({},"")}catch{c=function(T,_,N){return T[_]=N}}function u(C,T,_,N){var R=T&&T.prototype instanceof v?T:v,L=Object.create(R.prototype),q=new K(N||[]);return o(L,"_invoke",{value:$(C,_,q)}),L}function d(C,T,_){try{return{type:"normal",arg:C.call(T,_)}}catch(N){return{type:"throw",arg:N}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",g="completed",x={};function v(){}function y(){}function w(){}var k={};c(k,s,function(){return this});var E=Object.getPrototypeOf,O=E&&E(E(H([])));O&&O!==n&&r.call(O,s)&&(k=O);var S=w.prototype=v.prototype=Object.create(k);function P(C){["next","throw","return"].forEach(function(T){c(C,T,function(_){return this._invoke(T,_)})})}function M(C,T){function _(R,L,q,ve){var he=d(C[R],C,L);if(he.type!=="throw"){var Be=he.arg,Oe=Be.value;return Oe&&typeof Oe=="object"&&r.call(Oe,"__await")?T.resolve(Oe.__await).then(function(J){_("next",J,q,ve)},function(J){_("throw",J,q,ve)}):T.resolve(Oe).then(function(J){Be.value=J,q(Be)},function(J){return _("throw",J,q,ve)})}ve(he.arg)}var N;o(this,"_invoke",{value:function(R,L){function q(){return new T(function(ve,he){_(R,L,ve,he)})}return N=N?N.then(q,q):q()}})}function $(C,T,_){var N=f;return function(R,L){if(N===h)throw new Error("Generator is already running");if(N===g){if(R==="throw")throw L;return{value:t,done:!0}}for(_.method=R,_.arg=L;;){var q=_.delegate;if(q){var ve=V(q,_);if(ve){if(ve===x)continue;return ve}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(N===f)throw N=g,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);N=h;var he=d(C,T,_);if(he.type==="normal"){if(N=_.done?g:p,he.arg===x)continue;return{value:he.arg,done:_.done}}he.type==="throw"&&(N=g,_.method="throw",_.arg=he.arg)}}}function V(C,T){var _=T.method,N=C.iterator[_];if(N===t)return T.delegate=null,_==="throw"&&C.iterator.return&&(T.method="return",T.arg=t,V(C,T),T.method==="throw")||_!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+_+"' method")),x;var R=d(N,C.iterator,T.arg);if(R.type==="throw")return T.method="throw",T.arg=R.arg,T.delegate=null,x;var L=R.arg;return L?L.done?(T[C.resultName]=L.value,T.next=C.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,x):L:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,x)}function j(C){var T={tryLoc:C[0]};1 in C&&(T.catchLoc=C[1]),2 in C&&(T.finallyLoc=C[2],T.afterLoc=C[3]),this.tryEntries.push(T)}function le(C){var T=C.completion||{};T.type="normal",delete T.arg,C.completion=T}function K(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(j,this),this.reset(!0)}function H(C){if(C||C===""){var T=C[s];if(T)return T.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var _=-1,N=function R(){for(;++_<C.length;)if(r.call(C,_))return R.value=C[_],R.done=!1,R;return R.value=t,R.done=!0,R};return N.next=N}}throw new TypeError(typeof C+" is not iterable")}return y.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:y,configurable:!0}),y.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(C){var T=typeof C=="function"&&C.constructor;return!!T&&(T===y||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,c(C,l,"GeneratorFunction")),C.prototype=Object.create(S),C},e.awrap=function(C){return{__await:C}},P(M.prototype),c(M.prototype,a,function(){return this}),e.AsyncIterator=M,e.async=function(C,T,_,N,R){R===void 0&&(R=Promise);var L=new M(u(C,T,_,N),R);return e.isGeneratorFunction(T)?L:L.next().then(function(q){return q.done?q.value:L.next()})},P(S),c(S,l,"Generator"),c(S,s,function(){return this}),c(S,"toString",function(){return"[object Generator]"}),e.keys=function(C){var T=Object(C),_=[];for(var N in T)_.push(N);return _.reverse(),function R(){for(;_.length;){var L=_.pop();if(L in T)return R.value=L,R.done=!1,R}return R.done=!0,R}},e.values=H,K.prototype={constructor:K,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(le),!C)for(var T in this)T.charAt(0)==="t"&&r.call(this,T)&&!isNaN(+T.slice(1))&&(this[T]=t)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var T=this;function _(he,Be){return L.type="throw",L.arg=C,T.next=he,Be&&(T.method="next",T.arg=t),!!Be}for(var N=this.tryEntries.length-1;N>=0;--N){var R=this.tryEntries[N],L=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var q=r.call(R,"catchLoc"),ve=r.call(R,"finallyLoc");if(q&&ve){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(q){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!ve)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(C,T){for(var _=this.tryEntries.length-1;_>=0;--_){var N=this.tryEntries[_];if(N.tryLoc<=this.prev&&r.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var R=N;break}}R&&(C==="break"||C==="continue")&&R.tryLoc<=T&&T<=R.finallyLoc&&(R=null);var L=R?R.completion:{};return L.type=C,L.arg=T,R?(this.method="next",this.next=R.finallyLoc,x):this.complete(L)},complete:function(C,T){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&T&&(this.next=T),x},finish:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var _=this.tryEntries[T];if(_.finallyLoc===C)return this.complete(_.completion,_.afterLoc),le(_),x}},catch:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var _=this.tryEntries[T];if(_.tryLoc===C){var N=_.completion;if(N.type==="throw"){var R=N.arg;le(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(C,T,_){return this.delegate={iterator:H(C),resultName:T,nextLoc:_},this.method==="next"&&(this.arg=t),x}},e}function Bw(t,e,n,r,o,i,s){try{var a=t[i](s),l=a.value}catch(c){n(c);return}a.done?e(l):Promise.resolve(l).then(r,o)}function Wc(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function s(l){Bw(i,r,o,s,a,"next",l)}function a(l){Bw(i,r,o,s,a,"throw",l)}s(void 0)})}}var Rx=function(){function t(e){Qt(this,t),this.host=e}return en(t,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var e=Wc(Lr().mark(function r(){return Lr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",fetch("".concat(this.host,"/patches/~"),{headers:{"Content-Type":"application/json"}}).then(function(s){return yi(s)}).catch(Ns));case 1:case"end":return i.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"deletePatches",value:function(){var e=Wc(Lr().mark(function r(o,i){var s;return Lr().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=new URLSearchParams,o.forEach(function(c){return s.append("id",c)}),l.abrupt("return",fetch("".concat(this.host,"/patches/~?").concat(s),{method:"DELETE",headers:i||{"Content-Type":"application/json"}}).then(function(c){return yi(c)}).catch(Ns));case 3:case"end":return l.stop()}},r,this)}));function n(r,o){return e.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"/val"}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return yi(n).catch(Ns)})}},{key:"getSchema",value:function(n){var r=n.headers;return fetch("".concat(this.host,"/schema"),{method:"GET",headers:r}).then(function(o){return yi(o)}).catch(Ns)}},{key:"putTree",value:function(n){var r=n.treePath,o=r===void 0?"/":r,i=n.patchIds,s=n.addPatch,a=n.validateAll,l=n.validateSource,c=n.validateBinaryFiles,u=n.headers,d=new URLSearchParams,f=new TextEncoder,p=EO(f.encode((i||[]).concat(JSON.stringify(s||{})).join(";")));return d.set("patches_sha",p),d.set("validate_all",(a||!1).toString()),d.set("validate_source",(l||!1).toString()),d.set("validate_binary_files",(c||!1).toString()),fetch("".concat(this.host,"/tree/~").concat(o,"?").concat(d.toString()),{method:"PUT",body:JSON.stringify({patchIds:i,addPatch:s}),headers:u}).then(function(h){return yi(h)}).catch(Ns)}},{key:"postSave",value:function(n){var r=n.patchIds;return fetch("".concat(this.host,"/save"),{method:"POST",body:JSON.stringify({patchIds:r}),headers:{"Content-Type":"application/json"}}).then(function(){var o=Wc(Lr().mark(function i(s){var a;return Lr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!s.ok){c.next=4;break}return c.abrupt("return",yi(s));case 4:if(!(s.status===400&&s.headers.get("content-type")==="application/json")){c.next=9;break}return c.next=7,s.json();case 7:a=c.sent,alert(JSON.stringify(a));case 9:return c.abrupt("return",yi(s));case 10:case"end":return c.stop()}},i)}));return function(i){return o.apply(this,arguments)}}()).catch(Ns)}},{key:"postValidate",value:function(n){var r=n.patches,o=n.headers;return fetch("".concat(this.host,"/validate"),{method:"POST",body:JSON.stringify({patches:r}),headers:o||{"Content-Type":"application/json"}}).then(function(){var i=Wc(Lr().mark(function s(a){return Lr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",yi(a));case 1:case"end":return c.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()).catch(Ns)}}]),t}();function Ns(t){return yo({statusCode:500,message:t instanceof Error||me(t)==="object"&&t&&"message"in t&&typeof t.message=="string"?t.message:"Unknown error",details:me(t)==="object"&&t&&"details"in t?t.details:void 0})}function jD(t,e,n){return yo({statusCode:t,message:e.message||n,details:e.details||Object.fromEntries(Object.entries(e).filter(function(r){var o=ts(r,1),i=o[0];return i!=="message"}))})}function yi(t){return wy.apply(this,arguments)}function wy(){return wy=Wc(Lr().mark(function t(e){var n;return Lr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,!e.ok){o.next=9;break}return o.t0=Ve,o.next=5,e.json();case 5:return o.t1=o.sent,o.abrupt("return",o.t0.ok.call(o.t0,o.t1));case 9:return o.prev=9,o.next=12,e.json();case 12:return n=o.sent,o.abrupt("return",jD(e.status,n,e.statusText));case 16:return o.prev=16,o.t2=o.catch(9),o.abrupt("return",yo({statusCode:e.status,message:e.statusText}));case 19:o.next=24;break;case 21:return o.prev=21,o.t3=o.catch(0),o.abrupt("return",yo({message:o.t3 instanceof Error?o.t3.message:"Unknown error"}));case 24:case"end":return o.stop()}},t,null,[[0,21],[9,16]])})),wy.apply(this,arguments)}var Fe={VERSION:{core:function(){try{return require("../package.json").version}catch{return null}}()},convertFileSource:pO,getSchema:KI,getValPath:mO,getVal:kD,getSource:iD,resolvePath:pD,splitModuleFilePathAndModulePath:sD,isVal:XI,createValPathOfItem:hr,getSHA256Hash:EO,initSchema:wD,ModuleFilePathSep:xy,notFileOp:function(e){return e.op!=="file"},isFileOp:function(e){return e.op==="file"&&typeof e.filePath=="string"},createPatchJSONPath:function(e){return"/".concat(e.split(".").map(function(n){return n&&zD(n)}).join("/"))},createPatchPath:function(e){return wO(e)},patchPathToModulePath:function(e){return e.map(function(n){return Number.isInteger(Number(n))?n:JSON.stringify(n)}).join(".")},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function zD(t){try{return JSON.parse(t)}catch{return t}}var _O={exports:{}};/*!
|
|
44
|
-
Copyright (c) 2018 Jed Watson.
|
|
45
|
-
Licensed under the MIT License (MIT), see
|
|
46
|
-
http://jedwatson.github.io/classnames
|
|
47
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)e.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(_O);var FD=_O.exports;const xn=ui(FD);function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},A.apply(this,arguments)}function BD(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function fm(...t){return e=>t.forEach(n=>BD(n,e))}function $e(...t){return m.useCallback(fm(...t),t)}const ri=m.forwardRef((t,e)=>{const{children:n,...r}=t,o=m.Children.toArray(n),i=o.find(UD);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(ky,A({},r,{ref:e}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(ky,A({},r,{ref:e}),n)});ri.displayName="Slot";const ky=m.forwardRef((t,e)=>{const{children:n,...r}=t;return m.isValidElement(n)?m.cloneElement(n,{...HD(r,n.props),ref:e?fm(e,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});ky.displayName="SlotClone";const VD=({children:t})=>m.createElement(m.Fragment,null,t);function UD(t){return m.isValidElement(t)&&t.type===VD}function HD(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}const WD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=WD.reduce((t,e)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ri:e;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,A({},s,{ref:o}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function CO(t,e){t&&Sr.flushSync(()=>t.dispatchEvent(e))}const er=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{};function KD(t,e){return m.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const Cn=t=>{const{present:e,children:n}=t,r=qD(e),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=$e(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Cn.displayName="Presence";function qD(t){const[e,n]=m.useState(),r=m.useRef({}),o=m.useRef(t),i=m.useRef("none"),s=t?"mounted":"unmounted",[a,l]=KD(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Mf(r.current);i.current=a==="mounted"?c:"none"},[a]),er(()=>{const c=r.current,u=o.current;if(u!==t){const f=i.current,p=Mf(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),er(()=>{if(e){const c=d=>{const p=Mf(r.current).includes(d.animationName);d.target===e&&p&&Sr.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===e&&(i.current=Mf(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Mf(t){return(t==null?void 0:t.animationName)||"none"}function Er(t,e=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...h}=d,g=(f==null?void 0:f[t][l])||a,x=m.useMemo(()=>h,Object.values(h));return m.createElement(g.Provider,{value:x},p)}function u(d,f){const p=(f==null?void 0:f[t][l])||a,h=m.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[r,GD(o,...e)]}function GD(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function Bt(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}const YD=m.createContext(void 0);function Gd(t){const e=m.useContext(YD);return t||e||"ltr"}function Sy(t,[e,n]){return Math.min(n,Math.max(e,t))}function ne(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function XD(t,e){return m.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const OO="ScrollArea",[TO,xoe]=Er(OO),[ZD,_r]=TO(OO),JD=m.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=t,[a,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(null),[p,h]=m.useState(null),[g,x]=m.useState(null),[v,y]=m.useState(0),[w,k]=m.useState(0),[E,O]=m.useState(!1),[S,P]=m.useState(!1),M=$e(e,V=>l(V)),$=Gd(o);return m.createElement(ZD,{scope:n,type:r,dir:$,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:S,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:k},m.createElement(we.div,A({dir:$},s,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})))}),QD="ScrollAreaViewport",e3=m.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...o}=t,i=_r(QD,n),s=m.useRef(null),a=$e(e,s,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(we.div,A({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),fi="ScrollAreaScrollbar",PO=m.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=_r(fi,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=t.orientation==="horizontal";return m.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.createElement(t3,A({},r,{ref:e,forceMount:n})):o.type==="scroll"?m.createElement(n3,A({},r,{ref:e,forceMount:n})):o.type==="auto"?m.createElement(MO,A({},r,{ref:e,forceMount:n})):o.type==="always"?m.createElement($x,A({},r,{ref:e})):null}),t3=m.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=_r(fi,t.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(Cn,{present:n||i},m.createElement(MO,A({"data-state":i?"visible":"hidden"},r,{ref:e})))}),n3=m.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=_r(fi,t.__scopeScrollArea),i=t.orientation==="horizontal",s=hm(()=>l("SCROLL_END"),100),[a,l]=XD("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const p=c[u];d!==p&&(l("SCROLL"),s()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),m.createElement(Cn,{present:n||a!=="hidden"},m.createElement($x,A({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:ne(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ne(t.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),MO=m.forwardRef((t,e)=>{const n=_r(fi,t.__scopeScrollArea),{forceMount:r,...o}=t,[i,s]=m.useState(!1),a=t.orientation==="horizontal",l=hm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Ul(n.viewport,l),Ul(n.content,l),m.createElement(Cn,{present:r||i},m.createElement($x,A({"data-state":i?"visible":"hidden"},o,{ref:e})))}),$x=m.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=_r(fi,t.__scopeScrollArea),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=AO(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,p){return u3(f,s.current,a,p)}return n==="horizontal"?m.createElement(r3,A({},u,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,p=Vw(f,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}})):n==="vertical"?m.createElement(o3,A({},u,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,p=Vw(f,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}})):null}),r3=m.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=_r(fi,t.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=$e(e,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(RO,A({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":pm(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.x),onDragScroll:u=>t.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;t.onWheelScroll(f),DO(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Xp(s.paddingLeft),paddingEnd:Xp(s.paddingRight)}})}}))}),o3=m.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=_r(fi,t.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=$e(e,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(RO,A({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":pm(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.y),onDragScroll:u=>t.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;t.onWheelScroll(f),DO(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Xp(s.paddingTop),paddingEnd:Xp(s.paddingBottom)}})}}))}),[i3,NO]=TO(fi),RO=m.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=t,p=_r(fi,n),[h,g]=m.useState(null),x=$e(e,M=>g(M)),v=m.useRef(null),y=m.useRef(""),w=p.viewport,k=r.content-r.viewport,E=Bt(u),O=Bt(l),S=hm(d,10);function P(M){if(v.current){const $=M.clientX-v.current.left,V=M.clientY-v.current.top;c({x:$,y:V})}}return m.useEffect(()=>{const M=$=>{const V=$.target;(h==null?void 0:h.contains(V))&&E($,k)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[w,h,k,E]),m.useEffect(O,[r,O]),Ul(h,S),Ul(p.content,S),m.createElement(i3,{scope:n,scrollbar:h,hasThumb:o,onThumbChange:Bt(i),onThumbPointerUp:Bt(s),onThumbPositionChange:O,onThumbPointerDown:Bt(a)},m.createElement(we.div,A({},f,{ref:x,style:{position:"absolute",...f.style},onPointerDown:ne(t.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),v.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(M))}),onPointerMove:ne(t.onPointerMove,P),onPointerUp:ne(t.onPointerUp,M=>{const $=M.target;$.hasPointerCapture(M.pointerId)&&$.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})))}),Ey="ScrollAreaThumb",s3=m.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=NO(Ey,t.__scopeScrollArea);return m.createElement(Cn,{present:n||o.hasThumb},m.createElement(a3,A({ref:e},r)))}),a3=m.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,i=_r(Ey,n),s=NO(Ey,n),{onThumbPositionChange:a}=s,l=$e(e,d=>s.onThumbChange(d)),c=m.useRef(),u=hm(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const p=d3(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),m.createElement(we.div,A({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ne(t.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),h=d.clientX-p.left,g=d.clientY-p.top;s.onThumbPointerDown({x:h,y:g})}),onPointerUp:ne(t.onPointerUp,s.onThumbPointerUp)}))}),$O="ScrollAreaCorner",l3=m.forwardRef((t,e)=>{const n=_r($O,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(c3,A({},t,{ref:e})):null}),c3=m.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,o=_r($O,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return Ul(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Ul(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?m.createElement(we.div,A({},r,{ref:e,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}})):null});function Xp(t){return t?parseInt(t,10):0}function AO(t,e){const n=t/e;return isNaN(n)?0:n}function pm(t){const e=AO(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function u3(t,e,n,r="ltr"){const o=pm(n),i=o/2,s=e||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return IO([l,c],d)(t)}function Vw(t,e,n="ltr"){const r=pm(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-o,s=e.content-e.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Sy(t,l);return IO([0,s],[0,a])(c)}function IO(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function DO(t,e){return t>0&&t<e}const d3=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function o(){const i={left:t.scrollLeft,top:t.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&e(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function hm(t,e){const n=Bt(t),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Ul(t,e){const n=Bt(e);er(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}const LO=JD,f3=e3,p3=l3;function jO(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=jO(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function h3(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=jO(t))&&(r&&(r+=" "),r+=e);return r}const Ax="-";function m3(t){const e=v3(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function o(s){const a=s.split(Ax);return a[0]===""&&a.length!==1&&a.shift(),zO(a,e)||g3(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function zO(t,e){var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?zO(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(Ax);return(s=e.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const Uw=/^\[(.+)\]$/;function g3(t){if(Uw.test(t)){const e=Uw.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function v3(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return x3(Object.entries(t.classGroups),n).forEach(([i,s])=>{_y(s,r,i,e)}),r}function _y(t,e,n,r){t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:Hw(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(y3(o)){_y(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{_y(s,Hw(e,i),n,r)})})}function Hw(t,e){let n=t;return e.split(Ax).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function y3(t){return t.isThemeGetter}function x3(t,e){return e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[e+s,a])):i);return[n,o]}):t}function b3(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),e++,e>t&&(e=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const FO="!";function w3(t){const e=t.separator,n=e.length===1,r=e[0],o=e.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let x=s[g];if(l===0){if(x===r&&(n||s.slice(g,g+o)===e)){a.push(s.slice(c,g)),c=g+o;continue}if(x==="/"){u=g;continue}}x==="["?l++:x==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(FO),p=f?d.substring(1):d,h=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}}}function k3(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function S3(t){return{cache:b3(t.cacheSize),splitModifiers:w3(t),...m3(t)}}const E3=/\s+/;function _3(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=new Set;return t.trim().split(E3).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=k3(a).join(":");return{isTailwindClass:!0,modifierId:l?p+FO:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function C3(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=BO(e))&&(r&&(r+=" "),r+=n);return r}function BO(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=BO(t[r]))&&(n&&(n+=" "),n+=e);return n}function O3(t,...e){let n,r,o,i=s;function s(l){const c=e.reduce((u,d)=>d(u),t());return n=S3(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=_3(l,n);return o(l,u),u}return function(){return i(C3.apply(null,arguments))}}function it(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const VO=/^\[(?:([a-z-]+):)?(.+)\]$/i,T3=/^\d+\/\d+$/,P3=new Set(["px","full","screen"]),M3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R3=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function No(t){return qs(t)||P3.has(t)||T3.test(t)}function xi(t){return uc(t,"length",B3)}function qs(t){return!!t&&!Number.isNaN(Number(t))}function Nf(t){return uc(t,"number",qs)}function Rc(t){return!!t&&Number.isInteger(Number(t))}function A3(t){return t.endsWith("%")&&qs(t.slice(0,-1))}function ke(t){return VO.test(t)}function bi(t){return M3.test(t)}const I3=new Set(["length","size","percentage"]);function D3(t){return uc(t,I3,UO)}function L3(t){return uc(t,"position",UO)}const j3=new Set(["image","url"]);function z3(t){return uc(t,j3,U3)}function F3(t){return uc(t,"",V3)}function $c(){return!0}function uc(t,e,n){const r=VO.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function B3(t){return N3.test(t)}function UO(){return!1}function V3(t){return R3.test(t)}function U3(t){return $3.test(t)}function H3(){const t=it("colors"),e=it("spacing"),n=it("blur"),r=it("brightness"),o=it("borderColor"),i=it("borderRadius"),s=it("borderSpacing"),a=it("borderWidth"),l=it("contrast"),c=it("grayscale"),u=it("hueRotate"),d=it("invert"),f=it("gap"),p=it("gradientColorStops"),h=it("gradientColorStopPositions"),g=it("inset"),x=it("margin"),v=it("opacity"),y=it("padding"),w=it("saturate"),k=it("scale"),E=it("sepia"),O=it("skew"),S=it("space"),P=it("translate"),M=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",ke,e],j=()=>[ke,e],le=()=>["",No,xi],K=()=>["auto",qs,ke],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],T=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",ke],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[qs,Nf],q=()=>[qs,ke];return{cacheSize:500,separator:":",theme:{colors:[$c],spacing:[No,xi],blur:["none","",bi,ke],brightness:L(),borderColor:[t],borderRadius:["none","","full",bi,ke],borderSpacing:j(),borderWidth:le(),contrast:L(),grayscale:N(),hueRotate:q(),invert:N(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[A3,xi],inset:V(),margin:V(),opacity:L(),padding:j(),saturate:L(),scale:L(),sepia:N(),skew:q(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[bi]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),ke]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rc,ke]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",Rc,ke]}],"grid-cols":[{"grid-cols":[$c]}],"col-start-end":[{col:["auto",{span:["full",Rc,ke]},ke]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[$c]}],"row-start-end":[{row:["auto",{span:[Rc,ke]},ke]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,e]}],"min-w":[{"min-w":[ke,e,"min","max","fit"]}],"max-w":[{"max-w":[ke,e,"none","full","min","max","fit","prose",{screen:[bi]},bi]}],h:[{h:[ke,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,e,"auto","min","max","fit"]}],"font-size":[{text:["base",bi,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nf]}],"font-family":[{font:[$c]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ke]}],"line-clamp":[{"line-clamp":["none",qs,Nf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",No,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",No,xi]}],"underline-offset":[{"underline-offset":["auto",No,ke]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),L3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",D3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},z3]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:C()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[No,ke]}],"outline-w":[{outline:[No,xi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[No,xi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",bi,F3]}],"shadow-color":[{shadow:[$c]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":T()}],"bg-blend":[{"bg-blend":T()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",bi,ke]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ke]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Rc,ke]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[No,xi,Nf]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const W3=O3(H3);function Pe(...t){return W3(h3(t))}const Tl=m.forwardRef(({className:t,children:e,innerRef:n,...r},o)=>b.jsxs(LO,{ref:o,className:Pe("relative overflow-hidden",t),...r,children:[b.jsx(f3,{className:"h-full w-full rounded-[inherit]",ref:n,children:e}),b.jsx(HO,{}),b.jsx(p3,{})]}));Tl.displayName=LO.displayName;const HO=m.forwardRef(({className:t,orientation:e="vertical",...n},r)=>b.jsx(PO,{ref:r,orientation:e,className:Pe("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:b.jsx(s3,{className:Pe("relative rounded-full bg-border",e==="vertical"&&"flex-1")})}));HO.displayName=PO.displayName;var K3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const q3=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Re=(t,e)=>{const n=m.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:a,...l},c)=>m.createElement("svg",{ref:c,...K3,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${q3(t)}`,...l},[...e.map(([u,d])=>m.createElement(u,d)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${t}`,n},G3=Re("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]),Y3=Re("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]),Ix=Re("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),WO=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),X3=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Z3=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),J3=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Q3=Re("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),e5=Re("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),Ww=Re("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),Kw=Re("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]),qw=Re("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]),Gw=Re("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]),Yw=Re("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]),Xw=Re("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]),t5=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),n5=Re("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),r5=Re("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),o5=Re("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),i5=Re("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]),Zw=Re("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),s5=Re("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),a5=Re("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),l5=Re("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),c5=Re("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),u5=Re("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),d5=Re("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),f5=Re("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),p5=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),h5=Re("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),m5=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),g5=Re("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),v5=Re("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),KO=Re("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),y5=Re("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),Dx=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ou({children:t}){const e=m.useRef(null),n=m.useRef(null),r=m.useRef(!1),o=m.useRef(0),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState(!0),c=()=>{r.current=!1,i.current=null,o.current=0,s.current=0},u=y=>{y.preventDefault();const w=i.current==="left"?e:n;if(w.current&&r.current){const k=i.current==="left"?y.screenX-o.current:o.current-y.screenX;w.current.style.width=`${Math.max(s.current+k,150)}px`}},d=y=>w=>{if(w.target){const E=y==="left"?e:y==="right"?n:null;r.current=!0,E&&E.current&&(o.current=w.screenX,i.current=y,E.current&&(s.current=E.current.offsetWidth))}},[f,p,h,g,x,v]=m.Children.toArray(t);return m.useEffect(()=>(document.addEventListener("mouseup",c),document.addEventListener("mousemove",u),()=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",u)}),[]),b.jsxs("div",{className:"relative flex h-screen",children:[b.jsxs("div",{ref:e,className:xn("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":a,"w-0 md:w-[300px]":!a}),children:[b.jsxs(Ou.Column,{children:[b.jsx(Jw,{showOnMobile:!a,onClick:()=>{l(!a)},children:f}),b.jsx(Tl,{style:{height:"calc(100vh - 50px)"},onClick:()=>{l(!1)},children:p})]}),b.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),b.jsx("div",{className:xn("w-[clamp(200px,70%,80vw)]",{"w-full":!x&&!v}),children:b.jsxs(Ou.Column,{children:[b.jsxs("span",{className:"flex w-full",children:[b.jsx(Jw,{className:"md:hidden",showOnMobile:a,onClick:()=>{l(!a)},children:f}),h]}),b.jsx(Tl,{style:{height:"calc(100vh - 50px)"},children:g})]})}),(x||v)&&b.jsxs("div",{ref:n,className:"relative w-full h-screen",children:[b.jsxs(Ou.Column,{children:[x,b.jsx(Tl,{style:{height:"calc(100vh - 50px)"},children:v})]}),b.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function Jw({className:t,showOnMobile:e,onClick:n,children:r}){return b.jsxs("div",{className:xn("flex items-center px-4 md:px-4",t,{"hidden md:flex":e}),children:[b.jsx("button",{className:"md:hidden",onClick:n,children:b.jsx(a5,{})}),b.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}Ou.Column=({children:t,className:e})=>{const[n,r]=m.Children.toArray(t);return b.jsxs("div",{className:xn("flex flex-col",e),children:[b.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};const x5=({className:t})=>b.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[b.jsx("g",{filter:"url(#filter0_d_21_1677)",children:b.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),b.jsx("g",{filter:"url(#filter1_i_21_1677)",children:b.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),b.jsxs("defs",{children:[b.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),b.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),qO=x5,Lx=X.createContext({get session(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get theme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setTheme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get editMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setEditMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function mm(){return X.useContext(Lx)}function GO(t="dark"){const[e,n]=m.useState(t);return m.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=o=>{localStorage.getItem("val-theme")||n(o.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[e,r=>{localStorage.setItem("val-theme",r),n(r)}]}var De;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},t.getValidEnumValues=o=>{const i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(const s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(De||(De={}));var Cy;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Cy||(Cy={}));const Q=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fi=t=>{switch(typeof t){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return isNaN(t)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":return Array.isArray(t)?Q.array:t===null?Q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Q.promise:typeof Map<"u"&&t instanceof Map?Q.map:typeof Set<"u"&&t instanceof Set?Q.set:typeof Date<"u"&&t instanceof Date?Q.date:Q.object;default:return Q.unknown}},F=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),b5=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Yr extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Yr.create=t=>new Yr(t);const Ju=(t,e)=>{let n;switch(t.code){case F.invalid_type:t.received===Q.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case F.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,De.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(t.keys,", ")}`;break;case F.invalid_union:n="Invalid input";break;case F.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(t.options)}`;break;case F.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(t.options)}, received '${t.received}'`;break;case F.invalid_arguments:n="Invalid function arguments";break;case F.invalid_return_type:n="Invalid function return type";break;case F.invalid_date:n="Invalid date";break;case F.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:De.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case F.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case F.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case F.custom:n="Invalid input";break;case F.invalid_intersection_types:n="Intersection results could not be merged";break;case F.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case F.not_finite:n="Number must be finite";break;default:n=e.defaultError,De.assertNever(t)}return{message:n}};let YO=Ju;function w5(t){YO=t}function Zp(){return YO}const Jp=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...o,path:i,message:o.message||a}},k5=[];function ee(t,e){const n=Jp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zp(),Ju].filter(r=>!!r)});t.common.issues.push(n)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const o of n){if(o.status==="aborted")return ye;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return un.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return ye;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const ye=Object.freeze({status:"aborted"}),XO=t=>({status:"dirty",value:t}),bn=t=>({status:"valid",value:t}),Oy=t=>t.status==="aborted",Ty=t=>t.status==="dirty",Qu=t=>t.status==="valid",Qp=t=>typeof Promise<"u"&&t instanceof Promise;var ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));class xo{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Qw=(t,e)=>{if(Qu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Yr(t.common.issues);return this._error=n,this._error}}};function be(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class _e{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Fi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Fi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new un,ctx:{common:e.parent.common,data:e.data,parsedType:Fi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qp(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fi(e)},i=this._parseSync({data:e,path:o.path,parent:o});return Qw(o,i)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fi(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Qp(o)?o:Promise.resolve(o));return Qw(r,i)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=e(o),a=()=>i.addIssue({code:F.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new eo({schema:this,typeName:pe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Zo.create(this,this._def)}nullable(){return pa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xr.create(this,this._def)}promise(){return Wl.create(this,this._def)}or(e){return rd.create([this,e],this._def)}and(e){return od.create(this,e,this._def)}transform(e){return new eo({...be(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new cd({...be(this._def),innerType:this,defaultValue:n,typeName:pe.ZodDefault})}brand(){return new JO({typeName:pe.ZodBranded,type:this,...be(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new rh({...be(this._def),innerType:this,catchValue:n,typeName:pe.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Yd.create(this,e)}readonly(){return ih.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S5=/^c[^\s-]{8,}$/i,E5=/^[a-z][a-z0-9]*$/,_5=/^[0-9A-HJKMNP-TV-Z]{26}$/,C5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,O5=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,T5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Lg;const P5=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,M5=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,N5=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function R5(t,e){return!!((e==="v4"||!e)&&P5.test(t)||(e==="v6"||!e)&&M5.test(t))}class Hr extends _e{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Q.string){const i=this._getOrReturnCtx(e);return ee(i,{code:F.invalid_type,expected:Q.string,received:i.parsedType}),ye}const r=new un;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),ee(o,{code:F.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),ee(o,{code:F.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?ee(o,{code:F.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&ee(o,{code:F.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")O5.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"email",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Lg||(Lg=new RegExp(T5,"u")),Lg.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"emoji",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")C5.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"uuid",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")S5.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"cuid",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")E5.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"cuid2",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")_5.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"ulid",code:F.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ee(o,{validation:"url",code:F.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"regex",code:F.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),ee(o,{code:F.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),ee(o,{code:F.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),ee(o,{code:F.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?N5(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ee(o,{code:F.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?R5(e.data,i.version)||(o=this._getOrReturnCtx(e,o),ee(o,{validation:"ip",code:F.invalid_string,message:i.message}),r.dirty()):De.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:F.invalid_string,...ue.errToObj(r)})}_addCheck(e){return new Hr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...ue.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Hr.create=t=>{var e;return new Hr({checks:[],typeName:pe.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...be(t)})};function $5(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(t.toFixed(o).replace(".","")),s=parseInt(e.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class ds extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Q.number){const i=this._getOrReturnCtx(e);return ee(i,{code:F.invalid_type,expected:Q.number,received:i.parsedType}),ye}let r;const o=new un;for(const i of this._def.checks)i.kind==="int"?De.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:F.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?$5(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:F.not_finite,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,o){return new ds({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(o)}]})}_addCheck(e){return new ds({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&De.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ds.create=t=>new ds({checks:[],typeName:pe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...be(t)});class fs extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Q.bigint){const i=this._getOrReturnCtx(e);return ee(i,{code:F.invalid_type,expected:Q.bigint,received:i.parsedType}),ye}let r;const o=new un;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:F.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,o){return new fs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(o)}]})}_addCheck(e){return new fs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fs.create=t=>{var e;return new fs({checks:[],typeName:pe.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...be(t)})};class ed extends _e{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Q.boolean){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.boolean,received:r.parsedType}),ye}return bn(e.data)}}ed.create=t=>new ed({typeName:pe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...be(t)});class da extends _e{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Q.date){const i=this._getOrReturnCtx(e);return ee(i,{code:F.invalid_type,expected:Q.date,received:i.parsedType}),ye}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ee(i,{code:F.invalid_date}),ye}const r=new un;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),ee(o,{code:F.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),ee(o,{code:F.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):De.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new da({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}da.create=t=>new da({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:pe.ZodDate,...be(t)});class eh extends _e{_parse(e){if(this._getType(e)!==Q.symbol){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.symbol,received:r.parsedType}),ye}return bn(e.data)}}eh.create=t=>new eh({typeName:pe.ZodSymbol,...be(t)});class td extends _e{_parse(e){if(this._getType(e)!==Q.undefined){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.undefined,received:r.parsedType}),ye}return bn(e.data)}}td.create=t=>new td({typeName:pe.ZodUndefined,...be(t)});class nd extends _e{_parse(e){if(this._getType(e)!==Q.null){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.null,received:r.parsedType}),ye}return bn(e.data)}}nd.create=t=>new nd({typeName:pe.ZodNull,...be(t)});class Hl extends _e{constructor(){super(...arguments),this._any=!0}_parse(e){return bn(e.data)}}Hl.create=t=>new Hl({typeName:pe.ZodAny,...be(t)});class ea extends _e{constructor(){super(...arguments),this._unknown=!0}_parse(e){return bn(e.data)}}ea.create=t=>new ea({typeName:pe.ZodUnknown,...be(t)});class oi extends _e{_parse(e){const n=this._getOrReturnCtx(e);return ee(n,{code:F.invalid_type,expected:Q.never,received:n.parsedType}),ye}}oi.create=t=>new oi({typeName:pe.ZodNever,...be(t)});class th extends _e{_parse(e){if(this._getType(e)!==Q.undefined){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.void,received:r.parsedType}),ye}return bn(e.data)}}th.create=t=>new th({typeName:pe.ZodVoid,...be(t)});class Xr extends _e{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Q.array)return ee(n,{code:F.invalid_type,expected:Q.array,received:n.parsedType}),ye;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(s||a)&&(ee(n,{code:s?F.too_big:F.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ee(n,{code:F.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ee(n,{code:F.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new xo(n,s,n.path,a)))).then(s=>un.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new xo(n,s,n.path,a)));return un.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Xr({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new Xr({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new Xr({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}Xr.create=(t,e)=>new Xr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...be(e)});function Xa(t){if(t instanceof ft){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Zo.create(Xa(r))}return new ft({...t._def,shape:()=>e})}else return t instanceof Xr?new Xr({...t._def,type:Xa(t.element)}):t instanceof Zo?Zo.create(Xa(t.unwrap())):t instanceof pa?pa.create(Xa(t.unwrap())):t instanceof bo?bo.create(t.items.map(e=>Xa(e))):t}class ft extends _e{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=De.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Q.object){const c=this._getOrReturnCtx(e);return ee(c,{code:F.invalid_type,expected:Q.object,received:c.parsedType}),ye}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof oi&&this._def.unknownKeys==="strip"))for(const c in o.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new xo(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof oi){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(ee(o,{code:F.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new xo(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>un.mergeObjectSync(r,c)):un.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new ft({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ue.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new ft({...this._def,unknownKeys:"strip"})}passthrough(){return new ft({...this._def,unknownKeys:"passthrough"})}extend(e){return new ft({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ft({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:pe.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ft({...this._def,catchall:e})}pick(e){const n={};return De.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}omit(e){const n={};return De.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}deepPartial(){return Xa(this)}partial(e){const n={};return De.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}),new ft({...this._def,shape:()=>n})}required(e){const n={};return De.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Zo;)i=i._def.innerType;n[r]=i}}),new ft({...this._def,shape:()=>n})}keyof(){return ZO(De.objectKeys(this.shape))}}ft.create=(t,e)=>new ft({shape:()=>t,unknownKeys:"strip",catchall:oi.create(),typeName:pe.ZodObject,...be(e)});ft.strictCreate=(t,e)=>new ft({shape:()=>t,unknownKeys:"strict",catchall:oi.create(),typeName:pe.ZodObject,...be(e)});ft.lazycreate=(t,e)=>new ft({shape:t,unknownKeys:"strip",catchall:oi.create(),typeName:pe.ZodObject,...be(e)});class rd extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new Yr(a.ctx.common.issues));return ee(n,{code:F.invalid_union,unionErrors:s}),ye}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new Yr(l));return ee(n,{code:F.invalid_union,unionErrors:a}),ye}}get options(){return this._def.options}}rd.create=(t,e)=>new rd({options:t,typeName:pe.ZodUnion,...be(e)});const sp=t=>t instanceof sd?sp(t.schema):t instanceof eo?sp(t.innerType()):t instanceof ad?[t.value]:t instanceof ps?t.options:t instanceof ld?Object.keys(t.enum):t instanceof cd?sp(t._def.innerType):t instanceof td?[void 0]:t instanceof nd?[null]:null;class gm extends _e{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Q.object)return ee(n,{code:F.invalid_type,expected:Q.object,received:n.parsedType}),ye;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const o=new Map;for(const i of n){const s=sp(i.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new gm({typeName:pe.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...be(r)})}}function Py(t,e){const n=Fi(t),r=Fi(e);if(t===e)return{valid:!0,data:t};if(n===Q.object&&r===Q.object){const o=De.objectKeys(e),i=De.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(const a of i){const l=Py(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Q.array&&r===Q.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let i=0;i<t.length;i++){const s=t[i],a=e[i],l=Py(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===Q.date&&r===Q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class od extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(i,s)=>{if(Oy(i)||Oy(s))return ye;const a=Py(i.value,s.value);return a.valid?((Ty(i)||Ty(s))&&n.dirty(),{status:n.value,value:a.data}):(ee(r,{code:F.invalid_intersection_types}),ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}od.create=(t,e,n)=>new od({left:t,right:e,typeName:pe.ZodIntersection,...be(n)});class bo extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.array)return ee(r,{code:F.invalid_type,expected:Q.array,received:r.parsedType}),ye;if(r.data.length<this._def.items.length)return ee(r,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new xo(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>un.mergeArray(n,s)):un.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new bo({...this._def,rest:e})}}bo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bo({items:t,typeName:pe.ZodTuple,rest:null,...be(e)})};class id extends _e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.object)return ee(r,{code:F.invalid_type,expected:Q.object,received:r.parsedType}),ye;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new xo(r,a,r.path,a)),value:s._parse(new xo(r,r.data[a],r.path,a))});return r.common.async?un.mergeObjectAsync(n,o):un.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof _e?new id({keyType:e,valueType:n,typeName:pe.ZodRecord,...be(r)}):new id({keyType:Hr.create(),valueType:e,typeName:pe.ZodRecord,...be(n)})}}class nh extends _e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.map)return ee(r,{code:F.invalid_type,expected:Q.map,received:r.parsedType}),ye;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new xo(r,a,r.path,[c,"key"])),value:i._parse(new xo(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ye;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ye;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}nh.create=(t,e,n)=>new nh({valueType:e,keyType:t,typeName:pe.ZodMap,...be(n)});class fa extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.set)return ee(r,{code:F.invalid_type,expected:Q.set,received:r.parsedType}),ye;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ee(r,{code:F.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ee(r,{code:F.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ye;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new xo(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new fa({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new fa({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}fa.create=(t,e)=>new fa({valueType:t,minSize:null,maxSize:null,typeName:pe.ZodSet,...be(e)});class Pl extends _e{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Q.function)return ee(n,{code:F.invalid_type,expected:Q.function,received:n.parsedType}),ye;function r(a,l){return Jp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zp(),Ju].filter(c=>!!c),issueData:{code:F.invalid_arguments,argumentsError:l}})}function o(a,l){return Jp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zp(),Ju].filter(c=>!!c),issueData:{code:F.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Wl){const a=this;return bn(async function(...l){const c=new Yr([]),u=await a._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(o(d,p)),c})})}else{const a=this;return bn(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Yr([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Yr([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Pl({...this._def,args:bo.create(e).rest(ea.create())})}returns(e){return new Pl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Pl({args:e||bo.create([]).rest(ea.create()),returns:n||ea.create(),typeName:pe.ZodFunction,...be(r)})}}class sd extends _e{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}sd.create=(t,e)=>new sd({getter:t,typeName:pe.ZodLazy,...be(e)});class ad extends _e{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ee(n,{received:n.data,code:F.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}ad.create=(t,e)=>new ad({value:t,typeName:pe.ZodLiteral,...be(e)});function ZO(t,e){return new ps({values:t,typeName:pe.ZodEnum,...be(e)})}class ps extends _e{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ee(n,{expected:De.joinValues(r),received:n.parsedType,code:F.invalid_type}),ye}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ee(n,{received:n.data,code:F.invalid_enum_value,options:r}),ye}return bn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return ps.create(e)}exclude(e){return ps.create(this.options.filter(n=>!e.includes(n)))}}ps.create=ZO;class ld extends _e{_parse(e){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Q.string&&r.parsedType!==Q.number){const o=De.objectValues(n);return ee(r,{expected:De.joinValues(o),received:r.parsedType,code:F.invalid_type}),ye}if(n.indexOf(e.data)===-1){const o=De.objectValues(n);return ee(r,{received:r.data,code:F.invalid_enum_value,options:o}),ye}return bn(e.data)}get enum(){return this._def.values}}ld.create=(t,e)=>new ld({values:t,typeName:pe.ZodNativeEnum,...be(e)});class Wl extends _e{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Q.promise&&n.common.async===!1)return ee(n,{code:F.invalid_type,expected:Q.promise,received:n.parsedType}),ye;const r=n.parsedType===Q.promise?n.data:Promise.resolve(n.data);return bn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Wl.create=(t,e)=>new Wl({type:t,typeName:pe.ZodPromise,...be(e)});class eo extends _e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{ee(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ye:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?ye:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qu(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Qu(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);De.assertNever(o)}}eo.create=(t,e,n)=>new eo({schema:t,typeName:pe.ZodEffects,effect:e,...be(n)});eo.createWithPreprocess=(t,e,n)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:pe.ZodEffects,...be(n)});class Zo extends _e{_parse(e){return this._getType(e)===Q.undefined?bn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zo.create=(t,e)=>new Zo({innerType:t,typeName:pe.ZodOptional,...be(e)});class pa extends _e{_parse(e){return this._getType(e)===Q.null?bn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pa.create=(t,e)=>new pa({innerType:t,typeName:pe.ZodNullable,...be(e)});class cd extends _e{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cd.create=(t,e)=>new cd({innerType:t,typeName:pe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...be(e)});class rh extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Qp(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yr(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}rh.create=(t,e)=>new rh({innerType:t,typeName:pe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...be(e)});class oh extends _e{_parse(e){if(this._getType(e)!==Q.nan){const r=this._getOrReturnCtx(e);return ee(r,{code:F.invalid_type,expected:Q.nan,received:r.parsedType}),ye}return{status:"valid",value:e.data}}}oh.create=t=>new oh({typeName:pe.ZodNaN,...be(t)});const A5=Symbol("zod_brand");class JO extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Yd extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ye:i.status==="dirty"?(n.dirty(),XO(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ye:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new Yd({in:e,out:n,typeName:pe.ZodPipeline})}}class ih extends _e{_parse(e){const n=this._def.innerType._parse(e);return Qu(n)&&(n.value=Object.freeze(n.value)),n}}ih.create=(t,e)=>new ih({innerType:t,typeName:pe.ZodReadonly,...be(e)});const QO=(t,e={},n)=>t?Hl.create().superRefine((r,o)=>{var i,s;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...c,fatal:l})}}):Hl.create(),I5={object:ft.lazycreate};var pe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(pe||(pe={}));const D5=(t,e={message:`Input not instance of ${t.name}`})=>QO(n=>n instanceof t,e),eT=Hr.create,tT=ds.create,L5=oh.create,j5=fs.create,nT=ed.create,z5=da.create,F5=eh.create,B5=td.create,V5=nd.create,U5=Hl.create,H5=ea.create,W5=oi.create,K5=th.create,q5=Xr.create,G5=ft.create,Y5=ft.strictCreate,X5=rd.create,Z5=gm.create,J5=od.create,Q5=bo.create,e4=id.create,t4=nh.create,n4=fa.create,r4=Pl.create,o4=sd.create,i4=ad.create,s4=ps.create,a4=ld.create,l4=Wl.create,ek=eo.create,c4=Zo.create,u4=pa.create,d4=eo.createWithPreprocess,f4=Yd.create,p4=()=>eT().optional(),h4=()=>tT().optional(),m4=()=>nT().optional(),g4={string:t=>Hr.create({...t,coerce:!0}),number:t=>ds.create({...t,coerce:!0}),boolean:t=>ed.create({...t,coerce:!0}),bigint:t=>fs.create({...t,coerce:!0}),date:t=>da.create({...t,coerce:!0})},v4=ye;var I=Object.freeze({__proto__:null,defaultErrorMap:Ju,setErrorMap:w5,getErrorMap:Zp,makeIssue:Jp,EMPTY_PATH:k5,addIssueToContext:ee,ParseStatus:un,INVALID:ye,DIRTY:XO,OK:bn,isAborted:Oy,isDirty:Ty,isValid:Qu,isAsync:Qp,get util(){return De},get objectUtil(){return Cy},ZodParsedType:Q,getParsedType:Fi,ZodType:_e,ZodString:Hr,ZodNumber:ds,ZodBigInt:fs,ZodBoolean:ed,ZodDate:da,ZodSymbol:eh,ZodUndefined:td,ZodNull:nd,ZodAny:Hl,ZodUnknown:ea,ZodNever:oi,ZodVoid:th,ZodArray:Xr,ZodObject:ft,ZodUnion:rd,ZodDiscriminatedUnion:gm,ZodIntersection:od,ZodTuple:bo,ZodRecord:id,ZodMap:nh,ZodSet:fa,ZodFunction:Pl,ZodLazy:sd,ZodLiteral:ad,ZodEnum:ps,ZodNativeEnum:ld,ZodPromise:Wl,ZodEffects:eo,ZodTransformer:eo,ZodOptional:Zo,ZodNullable:pa,ZodDefault:cd,ZodCatch:rh,ZodNaN:oh,BRAND:A5,ZodBranded:JO,ZodPipeline:Yd,ZodReadonly:ih,custom:QO,Schema:_e,ZodSchema:_e,late:I5,get ZodFirstPartyTypeKind(){return pe},coerce:g4,any:U5,array:q5,bigint:j5,boolean:nT,date:z5,discriminatedUnion:Z5,effect:ek,enum:s4,function:r4,instanceof:D5,intersection:J5,lazy:o4,literal:i4,map:t4,nan:L5,nativeEnum:a4,never:W5,null:V5,nullable:u4,number:tT,object:G5,oboolean:m4,onumber:h4,optional:c4,ostring:p4,pipeline:f4,preprocess:d4,promise:l4,record:e4,set:n4,strictObject:Y5,string:eT,symbol:F5,transformer:ek,tuple:Q5,undefined:B5,union:X5,unknown:H5,void:K5,NEVER:v4,ZodIssueCode:F,quotelessJson:b5,ZodError:Yr});const y4=I.union([I.object({id:I.string(),mode:I.literal("proxy"),full_name:I.string().optional().nullable(),username:I.string().optional().nullable(),avatar_url:I.string().url().optional().nullable(),enabled:I.boolean().optional()}),I.object({mode:I.literal("local"),enabled:I.boolean().optional()}),I.object({mode:I.literal("unauthorized"),enabled:I.boolean().optional()})]);function rT(t){const[e,n]=m.useState({status:"not-asked"}),[r,o]=m.useState(0);return m.useEffect(()=>{n({status:"loading"}),t.getSession().then(async i=>{try{if(Ve.isOk(i)){const s=i.value;n({status:"success",data:y4.parse(s)})}else i.error.statusCode===401?(console.error("Unauthorized",i.error),n({status:"success",data:{mode:"unauthorized"}})):r<3?setTimeout(()=>{o(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(s){console.error("Could not authorize:",s),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),e}function jx({children:t}){const[e,n]=t.split(Fe.ModuleFilePathSep);return e.split("/").filter(o=>o).map(o=>b.jsxs(m.Fragment,{children:[b.jsx("span",{children:o}),b.jsx("span",{className:"px-[2px] text-muted",children:"/"})]},`${t}/${o}`)).concat(...n?[b.jsx(x4,{children:n},n)]:[])}function x4({children:t}){try{if(t.includes(".")){const e=t.split(".");return e.map((n,r)=>r!==e.length-1?b.jsxs(m.Fragment,{children:[b.jsx("span",{children:JSON.parse(n)}),b.jsx("span",{className:"text-muted",children:"."})]},`${t}.${n}`):b.jsx("span",{children:JSON.parse(n)},t))}return b.jsx("span",{children:t})}catch(e){throw console.error("Parser failure",{children:t},e),new Error("Unexpected path formatting failure")}}function zx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ta=zx();function oT(t){Ta=t}const iT=/[&<>"']/,b4=new RegExp(iT.source,"g"),sT=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,w4=new RegExp(sT.source,"g"),k4={"&":"&","<":"<",">":">",'"':""","'":"'"},tk=t=>k4[t];function Wn(t,e){if(e){if(iT.test(t))return t.replace(b4,tk)}else if(sT.test(t))return t.replace(w4,tk);return t}const S4=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function E4(t){return t.replace(S4,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const _4=/(^|[^\[])\^/g;function Ue(t,e){t=typeof t=="string"?t:t.source,e=e||"";const n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(_4,"$1"),t=t.replace(r,o),n),getRegex:()=>new RegExp(t,e)};return n}function nk(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const sh={exec:()=>null};function rk(t,e){const n=t.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Rf(t,e,n){const r=t.length;if(r===0)return"";let o=0;for(;o<r;){const i=t.charAt(r-o-1);if(i===e&&!n)o++;else if(i!==e&&n)o++;else break}return t.slice(0,r-o)}function C4(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return-1}function ok(t,e,n,r){const o=e.href,i=e.title?Wn(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:Wn(s)}}function O4(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const r=n[1];return e.split(`
|
|
48
|
-
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
|
|
49
|
-
`)}class ah{constructor(e){ot(this,"options");ot(this,"rules");ot(this,"lexer");this.options=e||Ta}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Rf(r,`
|
|
50
|
-
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const r=n[0],o=O4(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=Rf(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const r=Rf(n[0].replace(/^ *>[ \t]?/gm,""),`
|
|
51
|
-
`),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const s=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",l="",c=!1;for(;e;){let u=!1;if(!(n=s.exec(e))||this.rules.block.hr.test(e))break;a=n[0],e=e.substring(a.length);let d=n[2].split(`
|
|
52
|
-
`,1)[0].replace(/^\t+/,v=>" ".repeat(3*v.length)),f=e.split(`
|
|
53
|
-
`,1)[0],p=0;this.options.pedantic?(p=2,l=d.trimStart()):(p=n[2].search(/[^ ]/),p=p>4?1:p,l=d.slice(p),p+=n[1].length);let h=!1;if(!d&&/^ *$/.test(f)&&(a+=f+`
|
|
54
|
-
`,e=e.substring(f.length+1),u=!0),!u){const v=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),y=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const E=e.split(`
|
|
55
|
-
`,1)[0];if(f=E,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(f)||k.test(f)||v.test(f)||y.test(e))break;if(f.search(/[^ ]/)>=p||!f.trim())l+=`
|
|
56
|
-
`+f.slice(p);else{if(h||d.search(/[^ ]/)>=4||w.test(d)||k.test(d)||y.test(d))break;l+=`
|
|
57
|
-
`+f}!h&&!f.trim()&&(h=!0),a+=E+`
|
|
58
|
-
`,e=e.substring(E.length+1),d=f.slice(p)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let g=null,x;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l),g&&(x=g[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!g,checked:x,loose:!1,text:l,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const d=i.items[u].tokens.filter(p=>p.type==="space"),f=d.length>0&&d.some(p=>/\n.*\n/.test(p.raw));i.loose=f}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(e){const n=this.rules.block.table.exec(e);if(n){if(!/[:|]/.test(n[2]))return;const r={type:"table",raw:n[0],header:rk(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
59
|
-
`):[]};if(r.header.length===r.align.length){let o=r.align.length,i,s,a,l;for(i=0;i<o;i++){const c=r.align[i];c&&(/^ *-+: *$/.test(c)?r.align[i]="right":/^ *:-+: *$/.test(c)?r.align[i]="center":/^ *:-+ *$/.test(c)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=rk(r.rows[i],r.header.length).map(c=>({text:c,tokens:[]}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const r=n[1].charAt(n[1].length-1)===`
|
|
60
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:Wn(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=Rf(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=C4(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),ok(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ok(r,o,r[0],this.lexer)}}emStrong(e,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(e);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const s=[...o[0]].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+s);(o=d.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...o[0]][0].length,p=e.slice(0,s+o.index+f+l);if(Math.min(s,l)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=Wn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let r,o;return n[2]==="@"?(r=Wn(n[1]),o="mailto:"+r):(r=Wn(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,o;if(n[2]==="@")r=Wn(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=Wn(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=Wn(n[0]),{type:"text",raw:n[0],text:r}}}}const ce={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:sh,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ce.def=Ue(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex();ce.bullet=/(?:[*+-]|\d{1,9}[.)])/;ce.listItemStart=Ue(/^( *)(bull) */).replace("bull",ce.bullet).getRegex();ce.list=Ue(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex();ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ce._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;ce.html=Ue(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ce.lheading=Ue(ce.lheading).replace(/bull/g,ce.bullet).getRegex();ce.paragraph=Ue(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.blockquote=Ue(ce.blockquote).replace("paragraph",ce.paragraph).getRegex();ce.normal={...ce};ce.gfm={...ce.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ce.gfm.table=Ue(ce.gfm.table).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.gfm.paragraph=Ue(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ce.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.pedantic={...ce.normal,html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ue(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
61
|
-
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sh,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};Z._punctuation="\\p{P}$+<=>`^|~";Z.punctuation=Ue(Z.punctuation,"u").replace(/punctuation/g,Z._punctuation).getRegex();Z.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;Z.anyPunctuation=/\\[punct]/g;Z._escapes=/\\([punct])/g;Z._comment=Ue(ce._comment).replace("(?:-->|$)","-->").getRegex();Z.emStrong.lDelim=Ue(Z.emStrong.lDelim,"u").replace(/punct/g,Z._punctuation).getRegex();Z.emStrong.rDelimAst=Ue(Z.emStrong.rDelimAst,"gu").replace(/punct/g,Z._punctuation).getRegex();Z.emStrong.rDelimUnd=Ue(Z.emStrong.rDelimUnd,"gu").replace(/punct/g,Z._punctuation).getRegex();Z.anyPunctuation=Ue(Z.anyPunctuation,"gu").replace(/punct/g,Z._punctuation).getRegex();Z._escapes=Ue(Z._escapes,"gu").replace(/punct/g,Z._punctuation).getRegex();Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Z.autolink=Ue(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex();Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Z.tag=Ue(Z.tag).replace("comment",Z._comment).replace("attribute",Z._attribute).getRegex();Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Z.link=Ue(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex();Z.reflink=Ue(Z.reflink).replace("label",Z._label).replace("ref",ce._label).getRegex();Z.nolink=Ue(Z.nolink).replace("ref",ce._label).getRegex();Z.reflinkSearch=Ue(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex();Z.normal={...Z};Z.pedantic={...Z.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()};Z.gfm={...Z.normal,escape:Ue(Z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Z.gfm.url=Ue(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex();Z.breaks={...Z.gfm,br:Ue(Z.br).replace("{2,}","*").getRegex(),text:Ue(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class po{constructor(e){ot(this,"tokens");ot(this,"options");ot(this,"state");ot(this,"tokenizer");ot(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ta,this.options.tokenizer=this.options.tokenizer||new ah,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:ce.normal,inline:Z.normal};this.options.pedantic?(n.block=ce.pedantic,n.inline=Z.pedantic):this.options.gfm&&(n.block=ce.gfm,this.options.breaks?n.inline=Z.breaks:n.inline=Z.gfm),this.tokenizer.rules=n}static get rules(){return{block:ce,inline:Z}}static lex(e,n){return new po(n).lex(e)}static lexInline(e,n){return new po(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
62
|
-
`),this.blockTokens(e,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,o,i,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
63
|
-
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
64
|
-
`+r.raw,o.text+=`
|
|
65
|
-
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
66
|
-
`+r.raw,o.text+=`
|
|
67
|
-
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=e.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
|
|
68
|
-
`+r.raw,o.text+=`
|
|
69
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
|
|
70
|
-
`+r.raw,o.text+=`
|
|
71
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r,o,i,s=e,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(e,s,c)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),n.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=e.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class lh{constructor(e){ot(this,"options");this.options=e||Ta}code(e,n,r){var i;const o=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return e=e.replace(/\n$/,"")+`
|
|
72
|
-
`,o?'<pre><code class="language-'+Wn(o)+'">'+(r?e:Wn(e,!0))+`</code></pre>
|
|
73
|
-
`:"<pre><code>"+(r?e:Wn(e,!0))+`</code></pre>
|
|
74
|
-
`}blockquote(e){return`<blockquote>
|
|
75
|
-
${e}</blockquote>
|
|
76
|
-
`}html(e,n){return e}heading(e,n,r){return`<h${n}>${e}</h${n}>
|
|
77
|
-
`}hr(){return`<hr>
|
|
78
|
-
`}list(e,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
|
|
79
|
-
`+e+"</"+o+`>
|
|
80
|
-
`}listitem(e,n,r){return`<li>${e}</li>
|
|
81
|
-
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
|
|
82
|
-
`}table(e,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
83
|
-
<thead>
|
|
84
|
-
`+e+`</thead>
|
|
85
|
-
`+n+`</table>
|
|
86
|
-
`}tablerow(e){return`<tr>
|
|
87
|
-
${e}</tr>
|
|
88
|
-
`}tablecell(e,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
89
|
-
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,n,r){const o=nk(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(e,n,r){const o=nk(e);if(o===null)return r;e=o;let i=`<img src="${e}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(e){return e}}class Fx{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}}class ho{constructor(e){ot(this,"options");ot(this,"renderer");ot(this,"textRenderer");this.options=e||Ta,this.options.renderer=this.options.renderer||new lh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fx}static parse(e,n){return new ho(n).parse(e)}static parseInline(e,n){return new ho(n).parseInline(e)}parse(e,n=!0){let r="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=i,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const s=i;r+=this.renderer.heading(this.parseInline(s.tokens),s.depth,E4(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=i;r+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=i;let a="",l="";for(let u=0;u<s.header.length;u++)l+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});a+=this.renderer.tablerow(l);let c="";for(let u=0;u<s.rows.length;u++){const d=s.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:s.align[f]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(a,c);continue}case"blockquote":{const s=i,a=this.parse(s.tokens);r+=this.renderer.blockquote(a);continue}case"list":{const s=i,a=s.ordered,l=s.start,c=s.loose;let u="";for(let d=0;d<s.items.length;d++){const f=s.items[d],p=f.checked,h=f.task;let g="";if(f.task){const x=this.renderer.checkbox(!!p);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=x+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=x+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:x+" "}):g+=x+" "}g+=this.parse(f.tokens,c),u+=this.renderer.listitem(g,h,!!p)}r+=this.renderer.list(u,a,l);continue}case"html":{const s=i;r+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=i;r+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=i,a=s.tokens?this.parseInline(s.tokens):s.text;for(;o+1<e.length&&e[o+1].type==="text";)s=e[++o],a+=`
|
|
90
|
-
`+(s.tokens?this.parseInline(s.tokens):s.text);r+=n?this.renderer.paragraph(a):a;continue}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}parseInline(e,n){n=n||this.renderer;let r="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=s||"";continue}}switch(i.type){case"escape":{const s=i;r+=n.text(s.text);break}case"html":{const s=i;r+=n.html(s.text);break}case"link":{const s=i;r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=i;r+=n.image(s.href,s.title,s.text);break}case"strong":{const s=i;r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=i;r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=i;r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{const s=i;r+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=i;r+=n.text(s.text);break}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}}class Tu{constructor(e){ot(this,"options");this.options=e||Ta}preprocess(e){return e}postprocess(e){return e}}ot(Tu,"passThroughHooks",new Set(["preprocess","postprocess"]));var Fd,My,Gh,aT;class T4{constructor(...e){ug(this,Fd);ug(this,Gh);ot(this,"defaults",zx());ot(this,"options",this.setOptions);ot(this,"parse",df(this,Fd,My).call(this,po.lex,ho.parse));ot(this,"parseInline",df(this,Fd,My).call(this,po.lexInline,ho.parseInline));ot(this,"Parser",ho);ot(this,"Renderer",lh);ot(this,"TextRenderer",Fx);ot(this,"Lexer",po);ot(this,"Tokenizer",ah);ot(this,"Hooks",Tu);this.use(...e)}walkTokens(e,n){var o,i;let r=[];for(const s of e)switch(r=r.concat(n.call(this,s)),s.type){case"table":{const a=s;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{const a=s;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{r=r.concat(this.walkTokens(a[l],n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=n.renderers[i.name];s?n.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[i.level];s?s.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new lh(this.defaults);for(const s in r.renderer){const a=r.renderer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new ah(this.defaults);for(const s in r.tokenizer){const a=r.tokenizer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new Tu;for(const s in r.hooks){const a=r.hooks[s],l=s,c=i[l];Tu.passThroughHooks.has(s)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(i,u)).then(f=>c.call(i,f));const d=a.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,s=r.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return po.lex(e,n??this.defaults)}parser(e,n){return ho.parse(e,n??this.defaults)}}Fd=new WeakSet,My=function(e,n){return(r,o)=>{const i={...o},s={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const a=df(this,Gh,aT).call(this,!!s.silent,!!s.async);if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(l=>e(l,s)).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>n(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));const l=e(r,s);s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=n(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return a(l)}}},Gh=new WeakSet,aT=function(e,n){return r=>{if(r.message+=`
|
|
91
|
-
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+Wn(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}};const ha=new T4;function et(t,e){return ha.parse(t,e)}et.options=et.setOptions=function(t){return ha.setOptions(t),et.defaults=ha.defaults,oT(et.defaults),et};et.getDefaults=zx;et.defaults=Ta;et.use=function(...t){return ha.use(...t),et.defaults=ha.defaults,oT(et.defaults),et};et.walkTokens=function(t,e){return ha.walkTokens(t,e)};et.parseInline=ha.parseInline;et.Parser=ho;et.parser=ho.parse;et.Renderer=lh;et.TextRenderer=Fx;et.Lexer=po;et.lexer=po.lex;et.Tokenizer=ah;et.Hooks=Tu;et.parse=et;et.options;et.setOptions;et.use;et.walkTokens;et.parseInline;ho.parse;const P4=po.lex;function M4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lT(t){var e=M4(t,"string");return typeof e=="symbol"?e:String(e)}function yt(t,e,n){return e=lT(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ny(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Bx(t,e){if(t){if(typeof t=="string")return Ny(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 Ny(t,e)}}function Vx(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Bx(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
92
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function N4(t){if(Array.isArray(t))return Ny(t)}function R4(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
93
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(t){return N4(t)||R4(t)||Bx(t)||$4()}function A4(t){if(Array.isArray(t))return t}function I4(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function D4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
94
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ry(t,e){return A4(t)||I4(t,e)||Bx(t,e)||D4()}var cT={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",qt:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},L4=Object.fromEntries(Object.entries(cT).map(function(t){var e=Ry(t,2),n=e[0],r=e[1];return[r,n]})),j4=/^data:(.*?);base64,/;function vm(t){var e=j4.exec(t);if(e&&e[1])return e[1]}function ym(t){var e=L4[t];return e||t.split("/")[1]}function z4(t){var e=t.split(".").pop(),n=e&&cT[e];if(n)return n}function F4(t){var e={},n=t.content.map(function(r){return B4(r,e)});return V4(n,e)}function B4(t,e){if(t.type==="heading"){var n,r,o="",i=((n=t.attrs)===null||n===void 0?void 0:n.level)||1;if(Number.isNaN(i))throw new Error("Invalid header depth");for(var s=0;s<Number(i);s++)o+="#";var a=["".concat(o," ")];return{type:"block",children:a.concat.apply(a,ud(((r=t.content)===null||r===void 0?void 0:r.map(function(d){return $y(d,e)}))||[]))}}else if(t.type==="paragraph"){var l;return!t.content||((l=t.content)===null||l===void 0?void 0:l.length)===0?{type:"block",children:["<br />"]}:{type:"block",children:t.content.map(function(d){return $y(d,e)})}}else if(t.type==="bulletList"||t.type==="orderedList"){var c;return{type:"block",children:((c=t.content)===null||c===void 0?void 0:c.flatMap(function(d,f){return uT(dT(t),d,0,e,f===0)}))||[]}}else{var u=t;throw new Error("Unhandled node type: ".concat("type"in u?"exhaustiveCheck.type":"unknown"))}}function V4(t,e){for(var n=[`
|
|
95
|
-
`],r=[],o=0;o<t.length;o++){var i=t[o],s=Vx(i.children),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(typeof l=="string")n[n.length-1]+=l;else{if(l._type==="file")r.push(l);else if(l._type==="link")r.push(l);else{var c=l;throw new Error("Unexpected node type: ".concat(JSON.stringify(c,null,2)))}n.push("")}}}catch(u){s.e(u)}finally{s.f()}o===t.length-1?n[n.length-1]+=`
|
|
96
|
-
`:n[n.length-1]+=`
|
|
97
|
-
|
|
98
|
-
`}return yt(yt(yt(yt({},Ut,"richtext"),"templateStrings",n),"exprs",r),"files",e)}function ik(t){var e,n=((e=t.marks)===null||e===void 0?void 0:e.flatMap(function(s){return s.type==="bold"?["bold"]:s.type==="italic"?["italic"]:s.type==="strike"?["line-through"]:[]}))||[],r=t.text.trimStart(),o=t.text.length-r.length;r=r.trimEnd();var i=t.text.length-r.length-o;return n.includes("bold")&&n.includes("italic")?r="***".concat(r,"***"):n.includes("bold")?r="**".concat(r,"**"):n.includes("italic")&&(r="_".concat(r,"_")),n.includes("line-through")&&(r="~~".concat(r,"~~")),"".concat(" ".repeat(o)).concat(r).concat(" ".repeat(i))}function $y(t,e){if(t.type==="text"){var n,r=(n=t.marks)===null||n===void 0?void 0:n.find(function(i){return i.type==="link"});return(r==null?void 0:r.type)==="link"?{_type:"link",href:r.attrs.href,children:[ik(t)]}:ik(t)}else{if(t.type==="hardBreak")return"<br />";if(t.type==="image")return H4(t,e);var o=t;throw new Error("Unexpected node type: ".concat(JSON.stringify(o)))}}function uT(t,e,n,r){var o,i,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=s?"":`
|
|
99
|
-
`,l=["".concat(a).concat(" ".repeat(n)).concat(t)];return((o=e.content)===null||o===void 0||(o=o[0])===null||o===void 0?void 0:o.type)==="bulletList"||((i=e.content)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)==="orderedList"||l.push(" "),l.concat((e.content||[]).flatMap(function(c,u){return c.type==="bulletList"||c.type==="orderedList"?(c.content||[]).flatMap(function(d){return uT(dT(c),d,n+4,r)}):(c.content||[]).flatMap(function(d){var f,p,h=[];return(f=c.content)!==null&&f!==void 0&&f.length&&((p=c.content)===null||p===void 0?void 0:p.length)>0&&u>0&&h.push(`<br />
|
|
100
|
-
`),h.push($y(d,r)),h})}))}function dT(t){if(t.type==="bulletList")return"-";if(t.type==="orderedList")return"1.";var e=t;throw new Error("Unhandled list node: ".concat(JSON.stringify(e)))}var U4=new TextEncoder;function H4(t,e){if(t.attrs&&t.attrs.src.startsWith("data:")){var n=Fe.getSHA256Hash(U4.encode(t.attrs.src)),r=vm(t.attrs.src);if(r===void 0)throw new Error("Could not detect Mime Type for image: ".concat(t.attrs.src));var o=ym(r),i=t.attrs.fileName||"".concat(n,".").concat(o),s="/public/".concat(i);return e[s]=t.attrs.src,yt(yt(yt(yt({},Ut,"file"),Zt,s),Iw,jw),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:n||"",mimeType:r})}else if(t.attrs){var a=W4("sha256",t.attrs.src),l=t.attrs.src.split("?")[0];return yt(yt(yt(yt({},Ut,"file"),Zt,"/public".concat(t.attrs.src.split("?")[0])),Iw,jw),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:a||"",mimeType:l&&z4(l)||""})}else throw new Error("Invalid image node (no attrs): "+JSON.stringify(t))}function W4(t,e){var n=e.split("?");if(!(n.length<2)){var r=n[1],o=new URLSearchParams(r);if(o.has(t))return o.get(t)}}var ch='<val value="',Ay='">',Iy="</val>";function Io(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=[];function i(l,c){var u=Io(l.tokens?l.tokens:[],e,0);o.push({tag:"span",classes:[c].concat(u.children.flatMap(function(d){return typeof d=="string"?[]:d.classes})),children:u.children.flatMap(function(d){return typeof d=="string"?d:d.children})})}for(var s=function(){var c=t[n];if(c.type==="heading")o.push({tag:"h".concat(c.depth),children:Io(c.tokens?c.tokens:[],e,0).children});else if(c.type==="paragraph")o.push({tag:"p",children:Io(c.tokens?c.tokens:[],e,0).children});else if(c.type==="strong")i(c,"bold");else if(c.type==="em")i(c,"italic");else if(c.type==="del")i(c,"line-through");else if(c.type==="text")if("tokens"in c&&Array.isArray(c.tokens))o.push.apply(o,ud(Io(c.tokens,e,n,r).children));else if(r&&typeof c.raw=="string"){var u=c.raw.split(`
|
|
101
|
-
`),d=u.flatMap(function(S,P){return P===u.length-1?[S]:P===u.length-1&&S===""?[]:S===""?{tag:"br"}:[S,{tag:"br"}]});o.push.apply(o,ud(d))}else o.push(c.raw);else if(c.type==="list")o.push({tag:c.ordered?"ol":"ul",children:Io(c.items,e,0).children});else if(c.type==="list_item")o.push({tag:"li",children:Io(c.tokens?c.tokens:[],e,0,!0).children});else if(c.type!=="space")if(c.type==="html"){if(c.text===Iy)return{v:{children:o,cursor:n}};var f=c.text.indexOf(Ay);if(c.text.startsWith(ch)&&f>-1){var p=Number(c.text.slice(ch.length,f));if(Number.isNaN(p))throw Error("Illegal val intermediate node: ".concat(JSON.stringify(c)));var h=Io(t.map(function(S){return S.type==="link"||S.type==="list"?{type:"text",raw:S.raw,text:S.raw}:S}),e,n+1),g=h.children,x=h.cursor,v=e[p];if(v._type==="link")o.push({tag:"a",href:v.href,children:g});else if(v._type==="file"){var y,w,k;o.push({tag:"img",src:Fe.convertFileSource(v).url,width:(y=v.metadata)===null||y===void 0?void 0:y.width,height:(w=v.metadata)===null||w===void 0?void 0:w.height,mimeType:(k=v.metadata)===null||k===void 0?void 0:k.mimeType})}n=x}var E=/<br\s*\/?>/gi;if(c.text.trim().match(E)){var O;o.push({tag:"br"}),((O=t[n+1])===null||O===void 0?void 0:O.raw.trim())===""&&n++}}else c.type==="link"?c.raw===c.href?o.push(c.raw):o.push({tag:"a",href:c.href,children:Io(c.tokens?c.tokens:[],e,0).children}):c.type==="br"?o.push({tag:"br"}):console.error("Could not parse markdown: unsupported token type: ".concat(c.type,". Found: ").concat(c.raw));n++},a;n<t.length;)if(a=s(),a)return a.v;return{children:o,cursor:n}}function fT(t){var e=t.templateStrings,n=t.exprs,r=e.flatMap(function(l,c){var u=n[c];return u?u[Ut]==="link"?l.concat("".concat(ch).concat(c).concat(Ay).concat(u.children[0]).concat(Iy)):l.concat("".concat(ch).concat(c).concat(Ay).concat(Iy)):l}).join(""),o=P4(r,{gfm:!0}),i=Io(o,n,0),s=i.children,a=i.cursor;if(a!==o.length)throw Error("Unexpectedly terminated markdown parsing. Possible reason: unclosed html tag?");return yt(yt({},Ut,"richtext"),"children",s)}var pT=I.object({type:I.union([I.literal("bold"),I.literal("strike"),I.literal("italic")])}),K4=I.object({type:I.literal("link"),attrs:I.object({href:I.string(),target:I.union([I.literal("_blank"),I.null()]),auto:I.boolean()})}),hT=I.intersection(I.object({type:I.literal("text"),text:I.string()}),I.object({marks:I.array(I.union([pT,K4]))}).partial()),mT=I.intersection(I.object({type:I.literal("hardBreak")}),I.object({marks:I.array(pT)}).partial()),q4=I.intersection(I.object({type:I.literal("image")}),I.object({attrs:I.intersection(I.object({src:I.string()}),I.object({align:I.union([I.literal("center"),I.literal("end"),I.literal("justify"),I.literal("left"),I.literal("match-parent"),I.literal("right"),I.literal("start"),I.null()]),alt:I.union([I.string(),I.null()]),height:I.union([I.string(),I.number(),I.null()]),width:I.union([I.string(),I.number(),I.null()]),rotate:I.union([I.string(),I.null()]),title:I.union([I.string(),I.null()]),fileName:I.union([I.string(),I.null()])}).partial())}).partial()),G4=I.intersection(I.object({type:I.literal("heading")}),I.object({attrs:I.object({level:I.number()}),content:I.array(I.union([hT,mT]))}).partial()),gT=I.lazy(function(){return I.intersection(I.object({type:I.literal("bulletList")}),I.object({content:I.array(yT)}).partial())}),vT=I.lazy(function(){return I.intersection(I.object({type:I.literal("orderedList")}),I.object({content:I.array(yT)}).partial())}),yT=I.lazy(function(){return I.intersection(I.object({type:I.literal("listItem")}),I.object({content:I.array(I.union([xT,gT,vT]))}).partial())}),xT=I.intersection(I.object({type:I.literal("paragraph")}),I.object({content:I.array(I.union([hT,q4,mT]))}).partial()),Y4=I.object({type:I.literal("doc"),content:I.array(I.union([xT,G4,gT,vT]))});function sk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function xl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sk(Object(n),!0).forEach(function(r){yt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X4(t){return{type:"doc",content:t.children.map(function(e){return Z4(e)})}}function Z4(t){switch(t.tag){case"h1":return Fa(1,t.children);case"h2":return Fa(2,t.children);case"h3":return Fa(3,t.children);case"h4":return Fa(4,t.children);case"h5":return Fa(5,t.children);case"h6":return Fa(6,t.children);case"p":return ak(t.children);case"ul":return kT(t);case"ol":return ST(t);case"br":return ak([t]);default:{var e=t;throw Error("Unexpected child node: "+JSON.stringify(e))}}}function Fa(t,e){return{type:"heading",attrs:{level:t},content:e.flatMap(bT)}}function xm(t){return{type:"text",text:t}}function bT(t){return typeof t=="string"?[xm(t)]:Ux(t)}function Ux(t){if(t.classes.length===0&&t.children.length===1){if(typeof t.children[0]=="string")return[xm(t.children[0])];throw Error("Unexpected amount of children in span node: "+JSON.stringify(t,null,2))}return t.children.map(function(e){return{type:"text",text:e,marks:t.classes.map(function(n){switch(n){case"bold":return{type:"bold"};case"italic":return{type:"italic"};case"line-through":return{type:"strike"};default:{var r=n;throw Error("Unexpected span class: "+r)}}})}})}function ak(t){return{type:"paragraph",content:t.flatMap(function(e){if(typeof e=="string")return[xm(e)];switch(e.tag){case"span":return Ux(e);case"a":return wT(e);case"img":return[Q4(e)];case"br":return[J4()];default:{var n=e;throw Error("Unexpected paragraph child: "+JSON.stringify(n))}}})}}function J4(){return{type:"hardBreak",marks:[]}}function wT(t){return t.children.flatMap(bT).map(function(e){return xl(xl({},e),{},{marks:(e.marks||[]).concat({type:"link",attrs:{href:t.href,auto:!1,target:null}})})})}function Q4(t){return{type:"image",attrs:{height:t.height,width:t.width,src:t.src}}}function kT(t){return{type:"bulletList",content:t.children.map(ET)}}function ST(t){return{type:"orderedList",content:t.children.map(ET)}}function ET(t){return{type:"listItem",content:eL(t.children)}}function eL(t){var e=[],n=Vx(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value,i=e[e.length-1];i||(i={type:"paragraph",content:[]},e.push(i));var s=i.content;if(typeof o=="string")s.push(xm(o));else switch(o.tag){case"a":{s.push.apply(s,ud(wT(o)));break}case"br":{e.push({type:"paragraph",content:[]});break}case"span":{s.push.apply(s,ud(Ux(o)));break}case"ol":{e.push(ST(o));break}case"ul":{e.push(kT(o));break}default:{var a=o;throw Error("Unexpected list item child: "+JSON.stringify(a))}}}}catch(l){n.e(l)}finally{n.f()}return e}function Do(){Do=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(C,T,_){C[T]=_.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(C,T,_){return Object.defineProperty(C,T,{value:_,enumerable:!0,configurable:!0,writable:!0}),C[T]}try{c({},"")}catch{c=function(T,_,N){return T[_]=N}}function u(C,T,_,N){var R=T&&T.prototype instanceof v?T:v,L=Object.create(R.prototype),q=new K(N||[]);return o(L,"_invoke",{value:$(C,_,q)}),L}function d(C,T,_){try{return{type:"normal",arg:C.call(T,_)}}catch(N){return{type:"throw",arg:N}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",g="completed",x={};function v(){}function y(){}function w(){}var k={};c(k,s,function(){return this});var E=Object.getPrototypeOf,O=E&&E(E(H([])));O&&O!==n&&r.call(O,s)&&(k=O);var S=w.prototype=v.prototype=Object.create(k);function P(C){["next","throw","return"].forEach(function(T){c(C,T,function(_){return this._invoke(T,_)})})}function M(C,T){function _(R,L,q,ve){var he=d(C[R],C,L);if(he.type!=="throw"){var Be=he.arg,Oe=Be.value;return Oe&&typeof Oe=="object"&&r.call(Oe,"__await")?T.resolve(Oe.__await).then(function(J){_("next",J,q,ve)},function(J){_("throw",J,q,ve)}):T.resolve(Oe).then(function(J){Be.value=J,q(Be)},function(J){return _("throw",J,q,ve)})}ve(he.arg)}var N;o(this,"_invoke",{value:function(R,L){function q(){return new T(function(ve,he){_(R,L,ve,he)})}return N=N?N.then(q,q):q()}})}function $(C,T,_){var N=f;return function(R,L){if(N===h)throw new Error("Generator is already running");if(N===g){if(R==="throw")throw L;return{value:t,done:!0}}for(_.method=R,_.arg=L;;){var q=_.delegate;if(q){var ve=V(q,_);if(ve){if(ve===x)continue;return ve}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(N===f)throw N=g,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);N=h;var he=d(C,T,_);if(he.type==="normal"){if(N=_.done?g:p,he.arg===x)continue;return{value:he.arg,done:_.done}}he.type==="throw"&&(N=g,_.method="throw",_.arg=he.arg)}}}function V(C,T){var _=T.method,N=C.iterator[_];if(N===t)return T.delegate=null,_==="throw"&&C.iterator.return&&(T.method="return",T.arg=t,V(C,T),T.method==="throw")||_!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+_+"' method")),x;var R=d(N,C.iterator,T.arg);if(R.type==="throw")return T.method="throw",T.arg=R.arg,T.delegate=null,x;var L=R.arg;return L?L.done?(T[C.resultName]=L.value,T.next=C.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,x):L:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,x)}function j(C){var T={tryLoc:C[0]};1 in C&&(T.catchLoc=C[1]),2 in C&&(T.finallyLoc=C[2],T.afterLoc=C[3]),this.tryEntries.push(T)}function le(C){var T=C.completion||{};T.type="normal",delete T.arg,C.completion=T}function K(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(j,this),this.reset(!0)}function H(C){if(C||C===""){var T=C[s];if(T)return T.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var _=-1,N=function R(){for(;++_<C.length;)if(r.call(C,_))return R.value=C[_],R.done=!1,R;return R.value=t,R.done=!0,R};return N.next=N}}throw new TypeError(typeof C+" is not iterable")}return y.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:y,configurable:!0}),y.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(C){var T=typeof C=="function"&&C.constructor;return!!T&&(T===y||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,c(C,l,"GeneratorFunction")),C.prototype=Object.create(S),C},e.awrap=function(C){return{__await:C}},P(M.prototype),c(M.prototype,a,function(){return this}),e.AsyncIterator=M,e.async=function(C,T,_,N,R){R===void 0&&(R=Promise);var L=new M(u(C,T,_,N),R);return e.isGeneratorFunction(T)?L:L.next().then(function(q){return q.done?q.value:L.next()})},P(S),c(S,l,"Generator"),c(S,s,function(){return this}),c(S,"toString",function(){return"[object Generator]"}),e.keys=function(C){var T=Object(C),_=[];for(var N in T)_.push(N);return _.reverse(),function R(){for(;_.length;){var L=_.pop();if(L in T)return R.value=L,R.done=!1,R}return R.done=!0,R}},e.values=H,K.prototype={constructor:K,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(le),!C)for(var T in this)T.charAt(0)==="t"&&r.call(this,T)&&!isNaN(+T.slice(1))&&(this[T]=t)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var T=this;function _(he,Be){return L.type="throw",L.arg=C,T.next=he,Be&&(T.method="next",T.arg=t),!!Be}for(var N=this.tryEntries.length-1;N>=0;--N){var R=this.tryEntries[N],L=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var q=r.call(R,"catchLoc"),ve=r.call(R,"finallyLoc");if(q&&ve){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(q){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!ve)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(C,T){for(var _=this.tryEntries.length-1;_>=0;--_){var N=this.tryEntries[_];if(N.tryLoc<=this.prev&&r.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var R=N;break}}R&&(C==="break"||C==="continue")&&R.tryLoc<=T&&T<=R.finallyLoc&&(R=null);var L=R?R.completion:{};return L.type=C,L.arg=T,R?(this.method="next",this.next=R.finallyLoc,x):this.complete(L)},complete:function(C,T){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&T&&(this.next=T),x},finish:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var _=this.tryEntries[T];if(_.finallyLoc===C)return this.complete(_.completion,_.afterLoc),le(_),x}},catch:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var _=this.tryEntries[T];if(_.tryLoc===C){var N=_.completion;if(N.type==="throw"){var R=N.arg;le(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(C,T,_){return this.delegate={iterator:H(C),resultName:T,nextLoc:_},this.method==="next"&&(this.arg=t),x}},e}function lk(t,e,n,r,o,i,s){try{var a=t[i](s),l=a.value}catch(c){n(c);return}a.done?e(l):Promise.resolve(l).then(r,o)}function $f(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function s(l){lk(i,r,o,s,a,"next",l)}function a(l){lk(i,r,o,s,a,"throw",l)}s(void 0)})}}function tL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ck(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lT(r.key),r)}}function nL(t,e,n){return e&&ck(t.prototype,e),n&&ck(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Hx=function(){function t(e){var n=this;tL(this,t),yt(this,"subscribe",function(r){return function(o){var i=uk(r);return n.listeners[i]||(n.listeners[i]=[],n.subscribers.set(i,{})),n.listeners[i].push(o),function(){n.listeners[i].splice(n.listeners[i].indexOf(o),1)}}}),yt(this,"getSnapshot",function(r){return function(){return n.get(r)}}),yt(this,"getServerSnapshot",function(r){return function(){return n.get(r)}}),yt(this,"get",function(r){var o=uk(r);return n.subscribers.get(o)}),this.api=e,this.subscribers=new Map,this.listeners={},this.drafts={},this.schema={}}return nL(t,[{key:"reset",value:function(){var e=$f(Do().mark(function r(){var o,i,s,a,l,c,u,d,f,p,h,g;return Do().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.api.getPatches();case 2:if(o=v.sent,!Ve.isErr(o)){v.next=6;break}return console.error("Val: failed to get patches",o.error),v.abrupt("return");case 6:return i=Object.values(o.value).flatMap(function(y){return y.map(function(w){return w.patch_id})}),v.next=9,this.api.putTree({patchIds:i});case 9:return s=v.sent,v.next=12,this.initialize();case 12:if(Ve.isOk(s))for(a=0,l=Object.keys(s.value.modules);a<l.length;a++)for(c=l[a],u=c,this.drafts[u]=s.value.modules[u].source,this.emitEvent(u,this.drafts[u]),d=0,f=Array.from(this.subscribers.entries());d<f.length;d++)p=Ry(f[d],2),h=p[0],g=p[1],g[u]&&(this.subscribers.set(h,xl(xl({},g),{},yt({},u,this.drafts[u]))),this.emitChange(h));else console.error("Val: failed to reset",s.error);case 13:case"end":return v.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getModule",value:function(){var e=$f(Do().mark(function r(o){var i,s,a,l,c=arguments;return Do().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(i=c.length>1&&c[1]!==void 0?c[1]:!1,!(!i&&this.drafts[o]&&this.schema[o])){d.next=3;break}return d.abrupt("return",Ve.ok({source:this.drafts[o],schema:this.schema[o]}));case 3:return d.next=5,this.api.putTree({treePath:o});case 5:if(s=d.sent,!Ve.isOk(s)){d.next=26;break}if(s.value.modules[o]){d.next=10;break}return console.error("Val: could not find the module",{moduleIds:Object.keys(s.value.modules),moduleId:o,data:s}),d.abrupt("return",Ve.err({message:`Could not fetch data.
|
|
102
|
-
Could not find the module:
|
|
103
|
-
`+o+`
|
|
104
|
-
|
|
105
|
-
Verify that the val.modules file includes this module.`}));case 10:if(a=s.value.modules[o].source,l=this.schema[o],this.schema[o]){d.next=17;break}return d.next=15,this.initialize();case 15:if(this.schema[o]){d.next=17;break}return d.abrupt("return",Ve.err({message:"Path not found in schema. Verify that the module exists."}));case 17:if(a===void 0){d.next=22;break}return this.drafts[o]=a,d.abrupt("return",Ve.ok({source:a,schema:l}));case 22:return console.error("Val: could not find the module source"),d.abrupt("return",Ve.err({message:"Could not fetch data. Verify that the module exists."}));case 24:d.next=33;break;case 26:if(s.error.statusCode!==504){d.next=31;break}return console.error("Val: timeout",s.error),d.abrupt("return",Ve.err({message:"Timed out while fetching data. Try again later."}));case 31:return console.error("Val: failed to get module",s.error),d.abrupt("return",Ve.err({message:"Could not fetch data. Verify that Val is correctly configured."}));case 33:case"end":return d.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"applyPatch",value:function(){var e=$f(Do().mark(function r(o,i,s){var a,l,c,u,d,f,p,h;return Do().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,this.api.putTree({treePath:o,patchIds:i,addPatch:{path:o,patch:s}});case 2:if(a=x.sent,!Ve.isOk(a)){x.next=16;break}if(l=a.value.modules[o].source,l===void 0){x.next=12;break}for(this.drafts[o]=l,this.emitEvent(o,l),u=0,d=Array.from(this.subscribers.entries());u<d.length;u++)f=Ry(d[u],2),p=f[0],h=f[1],h[o]&&(this.subscribers.set(p,xl(xl({},h),{},yt({},o,this.drafts[o]))),this.emitChange(p));return x.abrupt("return",Ve.ok(yt({},o,{patchIds:((c=a.value.modules[o].patches)===null||c===void 0?void 0:c.applied)||[]})));case 12:return console.error("Val: could not patch"),x.abrupt("return",Ve.err({message:"Val: could not fetch data. Verify that the module exists."}));case 14:x.next=18;break;case 16:return console.error("Val: failed to get module",a.error),x.abrupt("return",Ve.err({message:"Val: could not fetch data. Verify that Val is correctly configured."}));case 18:case"end":return x.stop()}},r,this)}));function n(r,o,i){return e.apply(this,arguments)}return n}()},{key:"emitEvent",value:function(n,r){var o=new CustomEvent("val-event",{detail:{type:"module-update",path:n,source:r}});window.dispatchEvent(o)}},{key:"initialize",value:function(){var e=$f(Do().mark(function r(){var o,i,s,a,l,c,u;return Do().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.api.getSchema({});case 2:if(o=f.sent,!Ve.isOk(o)){f.next=9;break}for(i=[],s=0,a=Object.keys(o.value.schemas);s<a.length;s++)l=a[s],c=o.value.schemas[l],c&&(i.push(l),this.schema[l]=c);return f.abrupt("return",Ve.ok(i));case 9:return u="Failed to fetch content. ",o.error.statusCode===401?u+="Authorization failed - check that you are logged in.":u+="Get a developer to verify that Val is correctly setup.",f.abrupt("return",Ve.err({message:u,details:{fetchError:o.error}}));case 12:case"end":return f.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"emitChange",value:function(n){var r=Vx(this.listeners[n]),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;i()}}catch(s){r.e(s)}finally{r.f()}}}]),t}();function uk(t){return t.slice().sort().join("&")}const rL=new TextEncoder;function _T(t){return new Promise((e,n)=>{var i;const r=(i=t.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=Fe.getSHA256Hash(rL.encode(s));if(a.naturalWidth&&a.naturalHeight){const c=vm(s);e({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,sha256:l,mimeType:c,fileExt:c&&ym(c)})}else e({src:s,filename:r==null?void 0:r.name,sha256:l})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function CT(t,e,n){if(!n||!t)return e;const r=n.sha256.slice(0,5),o=vm(t)??"unknown",i=ym(o)??"unknown";if(e){let s=e.split(".").slice(0,-1).join(".")||e;const a=s.lastIndexOf("_");return s.slice(a+1,s.length)===r&&(s=s.slice(0,a)),`${encodeURIComponent(s).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase()}_${r}.${i}`}return`${n.sha256}.${i}`}function OT(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=OT(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function oL(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=OT(t))&&(r&&(r+=" "),r+=e);return r}const dk=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,fk=oL,iL=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return fk(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=dk(u)||dk(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(h=>{let[g,x]=h;return Array.isArray(x)?x.includes({...i,...a}[g]):{...i,...a}[g]===x})?[...c,d,f]:c},[]);return fk(t,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},sL=iL("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),dd=m.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},i)=>{const s=r?ri:"button";return b.jsx(s,{className:Pe(sL({variant:e,size:n,className:t})),ref:i,...o})});dd.displayName="Button";const Wx=m.forwardRef(({className:t,type:e,...n},r)=>b.jsx("input",{type:e,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));Wx.displayName="Input";let bm=()=>({events:{},emit(t,...e){(this.events[t]||[]).forEach(n=>n(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(n=>n!==e)}});var Dy={exports:{}};(function(t,e){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var f=u.stack;return r(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){r(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return r(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}e=t.exports=a,e.BaseError=i})(Dy,Dy.exports);var TT=Dy.exports,pk="ProseMirror-selectednode",PT="",Hi="\0",hk="__state_override__",aL={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},Ce=aL,ii=Symbol.for("__remirror__"),Ht=(t=>(t.PlainExtension="RemirrorPlainExtension",t.NodeExtension="RemirrorNodeExtension",t.MarkExtension="RemirrorMarkExtension",t.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",t.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",t.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",t.Manager="RemirrorManager",t.Preset="RemirrorPreset",t.PresetConstructor="RemirrorPresetConstructor",t))(Ht||{}),qe=(t=>(t[t.Critical=1e6]="Critical",t[t.Highest=1e5]="Highest",t[t.High=1e4]="High",t[t.Medium=1e3]="Medium",t[t.Default=100]="Default",t[t.Low=10]="Low",t[t.Lowest=0]="Lowest",t))(qe||{}),Pn=(t=>(t[t.None=0]="None",t[t.Create=1]="Create",t[t.EditorView=2]="EditorView",t[t.Runtime=3]="Runtime",t[t.Destroy=4]="Destroy",t))(Pn||{}),U=(t=>(t.Undo="_|undo|_",t.Redo="_|redo|_",t.Bold="_|bold|_",t.Italic="_|italic|_",t.Underline="_|underline|_",t.Strike="_|strike|_",t.Code="_|code|_",t.Paragraph="_|paragraph|_",t.H1="_|h1|_",t.H2="_|h2|_",t.H3="_|h3|_",t.H4="_|h4|_",t.H5="_|h5|_",t.H6="_|h6|_",t.TaskList="_|task|_",t.BulletList="_|bullet|_",t.OrderedList="_|number|_",t.Quote="_|quote|_",t.Divider="_|divider|_",t.Codeblock="_|codeblock|_",t.ClearFormatting="_|clear|_",t.Superscript="_|sup|_",t.Subscript="_|sub|_",t.LeftAlignment="_|left-align|_",t.CenterAlignment="_|center-align|_",t.RightAlignment="_|right-align|_",t.JustifyAlignment="_|justify-align|_",t.InsertLink="_|link|_",t.Find="_|find|_",t.FindBackwards="_|find-backwards|_",t.FindReplace="_|find-replace|_",t.AddFootnote="_|footnote|_",t.AddComment="_|comment|_",t.ContextMenu="_|context-menu|_",t.IncreaseFontSize="_|inc-font-size|_",t.DecreaseFontSize="_|dec-font-size|_",t.IncreaseIndent="_|indent|_",t.DecreaseIndent="_|dedent|_",t.Shortcuts="_|shortcuts|_",t.Copy="_|copy|_",t.Cut="_|cut|_",t.Paste="_|paste|_",t.PastePlain="_|paste-plain|_",t.SelectAll="_|select-all|_",t.Format="_|format|_",t))(U||{}),B=(t=>(t.PROD="RMR0000",t.UNKNOWN="RMR0001",t.INVALID_COMMAND_ARGUMENTS="RMR0002",t.CUSTOM="RMR0003",t.CORE_HELPERS="RMR0004",t.MUTATION="RMR0005",t.INTERNAL="RMR0006",t.MISSING_REQUIRED_EXTENSION="RMR0007",t.MANAGER_PHASE_ERROR="RMR0008",t.INVALID_GET_EXTENSION="RMR0010",t.INVALID_MANAGER_ARGUMENTS="RMR0011",t.SCHEMA="RMR0012",t.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",t.INVALID_MANAGER_EXTENSION="RMR0014",t.DUPLICATE_COMMAND_NAMES="RMR0016",t.DUPLICATE_HELPER_NAMES="RMR0017",t.NON_CHAINABLE_COMMAND="RMR0018",t.INVALID_EXTENSION="RMR0019",t.INVALID_CONTENT="RMR0021",t.INVALID_NAME="RMR0050",t.EXTENSION="RMR0100",t.EXTENSION_SPEC="RMR0101",t.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",t.INVALID_SET_EXTENSION_OPTIONS="RMR0103",t.REACT_PROVIDER_CONTEXT="RMR0200",t.REACT_GET_ROOT_PROPS="RMR0201",t.REACT_EDITOR_VIEW="RMR0202",t.REACT_CONTROLLED="RMR0203",t.REACT_NODE_VIEW="RMR0204",t.REACT_GET_CONTEXT="RMR0205",t.REACT_COMPONENTS="RMR0206",t.REACT_HOOKS="RMR0207",t.I18N_CONTEXT="RMR0300",t))(B||{}),lL=function(e){return cL(e)&&!uL(e)};function cL(t){return!!t&&typeof t=="object"}function uL(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||pL(t)}var dL=typeof Symbol=="function"&&Symbol.for,fL=dL?Symbol.for("react.element"):60103;function pL(t){return t.$$typeof===fL}function hL(t){return Array.isArray(t)?[]:{}}function fd(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Kl(hL(t),t,e):t}function mL(t,e,n){return t.concat(e).map(function(r){return fd(r,n)})}function gL(t,e){if(!e.customMerge)return Kl;var n=e.customMerge(t);return typeof n=="function"?n:Kl}function vL(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function mk(t){return Object.keys(t).concat(vL(t))}function MT(t,e){try{return e in t}catch{return!1}}function yL(t,e){return MT(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function xL(t,e,n){var r={};return n.isMergeableObject(t)&&mk(t).forEach(function(o){r[o]=fd(t[o],n)}),mk(e).forEach(function(o){yL(t,o)||(MT(t,o)&&n.isMergeableObject(e[o])?r[o]=gL(o,n)(t[o],e[o],n):r[o]=fd(e[o],n))}),r}function Kl(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||mL,n.isMergeableObject=n.isMergeableObject||lL,n.cloneUnlessOtherwiseSpecified=fd;var r=Array.isArray(e),o=Array.isArray(t),i=r===o;return i?r?n.arrayMerge(t,e,n):xL(t,e,n):fd(e,n)}Kl.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,o){return Kl(r,o,n)},{})};var bL=Kl,wL=bL;const kL=ui(wL);/*!
|
|
106
|
-
* isobject <https://github.com/jonschlinkert/isobject>
|
|
107
|
-
*
|
|
108
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
109
|
-
* Released under the MIT License.
|
|
110
|
-
*/var NT=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1};/*!
|
|
111
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
112
|
-
*
|
|
113
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
114
|
-
* Released under the MIT License.
|
|
115
|
-
*/var SL=NT;function gk(t){return SL(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var EL=function(e){var n,r;return!(gk(e)===!1||(n=e.constructor,typeof n!="function")||(r=n.prototype,gk(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*!
|
|
116
|
-
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
117
|
-
*
|
|
118
|
-
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
119
|
-
* Released under the MIT License.
|
|
120
|
-
*/var _L=EL,CL=function(e){return _L(e)||typeof e=="function"||Array.isArray(e)};/*!
|
|
121
|
-
* object.omit <https://github.com/jonschlinkert/object.omit>
|
|
122
|
-
*
|
|
123
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
124
|
-
* Released under the MIT License.
|
|
125
|
-
*/var OL=CL,TL=function(e,n,r){if(!OL(e))return{};typeof n=="function"&&(r=n,n=[]),typeof n=="string"&&(n=[n]);for(var o=typeof r=="function",i=Object.keys(e),s={},a=0;a<i.length;a++){var l=i[a],c=e[l];(!n||n.indexOf(l)===-1&&(!o||r(c,l,e)))&&(s[l]=c)}return s};const Kx=ui(TL);/*!
|
|
126
|
-
* object.pick <https://github.com/jonschlinkert/object.pick>
|
|
127
|
-
*
|
|
128
|
-
* Copyright (c) 2014-2015 Jon Schlinkert, contributors.
|
|
129
|
-
* Licensed under the MIT License
|
|
130
|
-
*/var PL=NT,ML=function(e,n){if(!PL(e)&&typeof e!="function")return{};var r={};if(typeof n=="string")return n in e&&(r[n]=e[n]),r;for(var o=n.length,i=-1;++i<o;){var s=n[i];s in e&&(r[s]=e[s])}return r};const Ly=ui(ML),RT=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,NL=/\S+/g;function RL(t,e){const n={parts:[],prefixes:[]},r=t.matchAll(e);let o=0;for(const s of r){if(typeof s.index!="number")continue;const a=s[0];n.parts.push(a);const l=t.slice(o,s.index).trim();n.prefixes.push(l),o=s.index+a.length}const i=t.slice(o).trim();return i&&(n.parts.push(""),n.prefixes.push(i)),n}function $T(t,e){const{keepSpecialCharacters:n=!1,keep:r,prefix:o=""}=e||{},i=t.trim().normalize("NFC"),s=i.includes(" "),l=RL(i,s?NL:RT);return l.parts.map((c,u)=>{let d=l.prefixes[u]||"",f=c;return n===!1&&(r&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${r.join("")}]`,"g"),"")),r||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),r&&(d=d.replace(new RegExp(`[^${r.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function $L(t){const e=t.matchAll(RT).next().value,n=e?e.index:0;return t.slice(0,n+1).toUpperCase()+t.slice(n+1).toLowerCase()}function AT(t,e){return $T(t,e).reduce((n,r)=>n+$L(r),"")}function vk(t,e){return $T(t,{...e,prefix:"-"}).join("").toLowerCase()}function jy(t,e,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof e!="boolean"&&(r=n,n=e,e=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];var p=this,h=Date.now()-s;if(i)return;function g(){s=Date.now(),n.apply(p,d)}function x(){o=void 0}r&&!o&&g(),a(),r===void 0&&h>t?g():e!==!0&&(o=setTimeout(r?x:g,r===void 0?t-h:t))}return c.cancel=l,c}function AL(t,e,n){return n===void 0?jy(t,e,!1):jy(t,n,e!==!1)}function ht(t,e,n){const r=t[e];return IT(!km(r),n),r}function IT(t,e){if(!t)throw new IL(e)}var IL=class extends TT.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function $t(t){return Object.entries(t)}function pd(t){return Object.keys(t)}function wm(t){return Object.values(t)}function to(t,e,n){return t.includes(e,n)}function se(t){return Object.assign(Object.create(null),t)}function DT(t){return Object.prototype.toString.call(t)}function LT(t){return DT(t).slice(8,-1)}function Xd(t,e){return n=>typeof n!==t?!1:e?e(n):!0}function qx(t){return e=>LT(e)===t}var km=Xd("undefined"),ge=Xd("string"),tr=Xd("number",t=>!Number.isNaN(t)),tt=Xd("function");function DL(t){return t===null}function LL(t){return t===!0||t===!1}function Pa(t){if(LT(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})}function jL(t){return t==null||/^[bns]/.test(typeof t)}function hs(t){return DL(t)||km(t)}function dn(t){return!hs(t)&&(tt(t)||Xd("object")(t))}var zL=qx("RegExp");function FL(t){return qx("Map")(t)}function BL(t){return qx("Set")(t)}function uh(t){return dn(t)&&!FL(t)&&!BL(t)&&Object.keys(t).length===0}var At=Array.isArray;function ms(t){return At(t)&&t.length===0}function yk(t){return At(t)&&t.length>0}function Sm(t,e,n=r=>!!r){e.lastIndex=0;const r=[],o=e.flags;let i;o.includes("g")||(e=new RegExp(e.source,`g${o}`));do i=e.exec(t),i&&r.push(i);while(n(i));return e.lastIndex=0,r}function dh(){const t=Date.now(),e=dh.last||t;return dh.last=t>e?t:e+1}dh.last=0;function fh(t=""){return`${t}${dh().toString(36)}`}function VL(t){return Kx(t,e=>!km(e))}function UL(t){if(!Pa(t))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...t}}function hd(t,e=!1){const n=e?[...t].reverse():t,r=new Set(n);return e?[...r].reverse():[...r]}function jT(){}function HL(...t){return kL.all(t,{isMergeableObject:Pa})}function WL({min:t,max:e,value:n}){return n<t?t:n>e?e:n}function KL(t){return t[t.length-1]}function ma(t,e){return[...t].map((n,r)=>({value:n,index:r})).sort((n,r)=>e(n.value,r.value)||n.index-r.index).map(({value:n})=>n)}function qL(t,e,n){try{if(ge(e)&&e in t)return t[e];At(e)&&(e=`['${e.join("']['")}']`);let r=t;return e.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(r=r[s||a||l||c],"")),r===void 0?n:r}catch{return n}}function GL(t,e){const n=UL(e);let r=n;for(const[o,i]of t.entries()){const s=o>=t.length-1;let a=r[i];if(s){if(At(r)){const l=Number.parseInt(i.toString(),10);tr(l)&&r.splice(l,1)}else Reflect.deleteProperty(r,i);return n}if(jL(a))return n;a=At(a)?[...a]:{...a},r[i]=a,r=a}return n}function YL(t){return e=>qL(e,t)}function zT(t,e,n=!1){const r=[],o=new Set,i=tt(e)?e:YL(e),s=n?[...t].reverse():t;for(const a of s){const l=i(a);o.has(l)||(o.add(l),r.push(a))}return n?r.reverse():r}function FT(t,e){const n=At(t)?t[0]:t;return tr(e)?n<=e?Array.from({length:e+1-n},(r,o)=>o+n):Array.from({length:n+1-e},(r,o)=>-1*o+n):Array.from({length:Math.abs(n)},(r,o)=>(n<0?-1:1)*o)}function xk(t,...e){const n=e.filter(tr);return t>=Math.min(...n)&&t<=Math.max(...n)}function BT(t){return tt(t)?t():t}var VT="https://remirror.io/docs/errors",XL={[B.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[B.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[B.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[B.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[B.MUTATION]:"Mutation of immutable value detected.",[B.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[B.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[B.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[B.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[B.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[B.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[B.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[B.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[B.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[B.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[B.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[B.INVALID_EXTENSION]:"The provided extension is invalid.",[B.INVALID_CONTENT]:"The content provided to the editor is not supported.",[B.INVALID_NAME]:"An invalid name was used for the extension.",[B.EXTENSION]:"An error occurred within an extension. More details should be made available.",[B.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[B.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[B.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[B.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[B.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[B.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[B.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[B.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[B.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[B.REACT_COMPONENTS]:"An error occurred within a remirror component.",[B.REACT_HOOKS]:"An error occurred within a remirror hook.",[B.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function ZL(t){return ge(t)&&to(wm(B),t)}function JL(t,e){const n=XL[t],r=n?`${n}
|
|
131
|
-
|
|
132
|
-
`:"",o=e?`${e}
|
|
133
|
-
|
|
134
|
-
`:"";return`${r}${o}For more information visit ${VT}#${t.toLowerCase()}`}var UT=class extends TT.BaseError{constructor({code:t,message:e,disableLogging:n=!1}={}){const r=ZL(t)?t:B.CUSTOM;super(JL(r,e)),this.errorCode=r,this.url=`${VT}#${r.toLowerCase()}`,n||console.error(this.message)}static create(t={}){return new UT(t)}};function de(t,e){if(!t)throw UT.create(e)}function Gs(t,e={}){return t}function Gt(t){this.content=t}Gt.prototype={constructor:Gt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Gt(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Gt(n)},addToStart:function(t,e){return new Gt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Gt(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Gt(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Gt.from(t),t.size?new Gt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Gt.from(t),t.size?new Gt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Gt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Gt.from=function(t){if(t instanceof Gt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Gt(e)};function HT(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=HT(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function WT(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),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(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=WT(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class D{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||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,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",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?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new D(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(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),o+=a.nodeSize),s=l}return new D(r,o)}cutByIndex(e,n){return e==n?D.empty:e==0&&n==this.content.length?this:new D(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new D(o,i)}addToStart(e){return new D([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new D(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return HT(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return WT(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Af(0,e);if(e==this.size)return Af(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Af(r+1,s):Af(r,o);o=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 D.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new D(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return D.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new D(n||e,r)}static from(e){if(!e)return D.empty;if(e instanceof D)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new D([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}D.empty=new D([],0);const jg={index:0,offset:0};function Af(t,e){return jg.index=t,jg.offset=e,jg}function ph(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ph(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ph(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class Ae{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ph(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ae.none;if(e instanceof Ae)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}}Ae.none=[];class hh extends Error{}class G{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=qT(this.content,e+this.openStart,n);return r&&new G(r,this.openStart,this.openEnd)}removeBetween(e,n){return new G(KT(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 G.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new G(D.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new G(e,r,o)}}G.empty=new G(D.empty,0,0);function KT(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.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,i.copy(KT(i.content,e-o-1,n-o-1)))}function qT(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=qT(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function QL(t,e,n){if(n.openStart>t.depth)throw new hh("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hh("Inconsistent open depths");return GT(t,e,n,0)}function GT(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=GT(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return na(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=e6(n,t);return na(i,XT(t,s,a,e,r))}else return na(i,mh(t,e,r))}function YT(t,e){if(!e.type.compatibleContent(t.type))throw new hh("Cannot join "+e.type.name+" onto "+t.type.name)}function zy(t,e,n){let r=t.node(n);return YT(r,e.node(n)),r}function ta(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Pu(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ta(t.nodeAfter,r),i++));for(let a=i;a<s;a++)ta(o.child(a),r);e&&e.depth==n&&e.textOffset&&ta(e.nodeBefore,r)}function na(t,e){return t.type.checkContent(e),t.copy(e)}function XT(t,e,n,r,o){let i=t.depth>o&&zy(t,e,o+1),s=r.depth>o&&zy(n,r,o+1),a=[];return Pu(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(YT(i,s),ta(na(i,XT(t,e,n,r,o+1)),a)):(i&&ta(na(i,mh(t,e,o+1)),a),Pu(e,n,o,a),s&&ta(na(s,mh(n,r,o+1)),a)),Pu(r,null,o,a),new D(a)}function mh(t,e,n){let r=[];if(Pu(null,t,n,r),t.depth>n){let o=zy(t,e,n+1);ta(na(o,mh(t,e,n+1)),r)}return Pu(e,null,n,r),new D(r)}function e6(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(D.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ql{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ae.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ga(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new ql(n,r,i)}static resolveCached(e,n){for(let o=0;o<zg.length;o++){let i=zg[o];if(i.pos==n&&i.doc==e)return i}let r=zg[Fg]=ql.resolve(e,n);return Fg=(Fg+1)%t6,r}}let zg=[],Fg=0,t6=12;class ga{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const n6=Object.create(null);let rs=class Fy{constructor(e,n,r,o=Ae.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||D.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ph(this.attrs,n||e.defaultAttrs||n6)&&Ae.sameSet(this.marks,r||Ae.none)}copy(e=null){return e==this.content?this:new Fy(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Fy(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return G.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new G(c,o.depth-s,i.depth-s)}replace(e,n,r){return QL(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return ql.resolveCached(this,e)}resolveNoCache(e){return ql.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ZT(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=D.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Ae.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!Ae.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=D.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};rs.prototype.text=void 0;class gh extends rs{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ZT(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 gh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gh(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 ZT(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class va{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new r6(e,n);if(r.next==null)return va.empty;let o=JT(r);r.next&&r.err("Unexpected trailing text");let i=u6(c6(o));return d6(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return D.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
135
|
-
`)}}va.empty=new va(!0);class r6{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 JT(t){let e=[];do e.push(o6(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function o6(t){let e=[];do e.push(i6(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function i6(t){let e=l6(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=s6(t,e);else break;return e}function bk(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function s6(t,e){let n=bk(t),r=n;return t.eat(",")&&(t.next!="}"?r=bk(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function a6(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function l6(t){if(t.eat("(")){let e=JT(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=a6(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 c6(t){let e=[[]];return o(i(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 o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function QT(t,e){return e-t}function wk(t,e){let n=[];return r(e),n.sort(QT);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function u6(t){let e=Object.create(null);return n(wk(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);wk(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new va(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(QT);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function d6(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function e2(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function t2(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function n2(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new f6(t[n]);return e}let By=class r2{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=n2(r.attrs),this.defaultAttrs=e2(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==va.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:t2(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rs(this,this.computeAttrs(e),D.from(n),Ae.setFrom(r))}createChecked(e=null,n,r){return n=D.from(n),this.checkContent(n),new rs(this,this.computeAttrs(e),n,Ae.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=D.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(D.empty,!0);return i?new rs(this,e,n.append(i),Ae.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ae.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new r2(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class f6{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Zd{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=n2(o.attrs),this.excluded=null;let i=e2(this.attrs);this.instance=i?new Ae(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ae(this,t2(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Zd(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class p6{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Gt.from(e.nodes),n.marks=Gt.from(e.marks||{}),this.nodes=By.compile(this.spec.nodes,this),this.marks=Zd.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=va.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?kk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:kk(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,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof By){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new gh(r,r.defaultAttrs,e,Ae.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return rs.fromJSON(this,e)}markFromJSON(e){return Ae.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function kk(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Gl{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Ek(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ek(this,n,!0);return r.addAll(e,n.from,n.to),G.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(g6(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.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(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_k(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_k(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Gl(e,Gl.schemaRules(e)))}}const o2={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},h6={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},i2={ol:!0,ul:!0},vh=1,yh=2,Mu=4;function Sk(t,e,n){return e!=null?(e?vh:0)|(e==="full"?yh:0):t&&t.whitespace=="pre"?vh|yh:n&~Mu}class If{constructor(e,n,r,o,i,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Ae.none,this.stashMarks=[],this.match=s||(a&Mu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(D.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vh)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=D.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(D.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):y6(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!o2.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ek{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=Sk(null,n.preserveWhitespace,0)|(r?Mu:0);o?i=new If(o.type,o.attrs,Ae.none,Ae.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new If(null,null,Ae.none,Ae.none,!0,null,s):i=new If(e.schema.topNodeType,null,Ae.none,Ae.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.getAttribute("style");if(!r)return n();let o=this.readStyles(v6(r));if(!o)return;let[i,s]=o,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<i.length;l++)this.addPendingMark(i[l]);n();for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&yh||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&vh)r.options&yh?n=n.replace(/\r\n?/g,`
|
|
136
|
-
`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;i2.hasOwnProperty(r)&&this.parser.normalizeLists&&m6(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(i?i.ignore:h6.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let s,a=this.top,l=this.needsBlock;if(o2.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?o:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
137
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=Ae.none,r=Ae.none;for(let o=0;o<e.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(e[o],e[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(e,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(e):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=Sk(e,o,i.options);i.options&Mu&&i.content.length==0&&(s|=Mu),this.nodes.push(new If(e,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?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>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).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=x6(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function m6(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&i2.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function g6(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function v6(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function _k(t){let e={};for(let n in t)e[n]=t[n];return e}function y6(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function x6(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Wr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Bg(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Wr.renderSpec(Bg(n),this.nodes[e.type.name](e));if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Wr.renderSpec(Bg(r),o(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?e.createElementNS(r,o):e.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=Wr.renderSpec(e,d,r);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Wr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ck(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ck(e.marks)}}function Ck(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Bg(t){return t.document||window.document}const s2=65535,a2=Math.pow(2,16);function b6(t,e){return t+e*a2}function Ok(t){return t&s2}function w6(t){return(t-(t&s2))/a2}const l2=1,c2=2,ap=4,u2=8;class Vy{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&u2)>0}get deletedBefore(){return(this.delInfo&(l2|ap))>0}get deletedAfter(){return(this.delInfo&(c2|ap))>0}get deletedAcross(){return(this.delInfo&ap)>0}}class Gn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Gn.empty)return Gn.empty}recover(e){let n=0,r=Ok(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+w6(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+o+(f<0?0:u);if(r)return p;let h=e==(n<0?l:d)?null:b6(a/3,e-l),g=e==l?c2:e==d?l2:ap;return(n<0?e!=l:e!=d)&&(g|=u2),new Vy(p,g,h)}o+=u-c}return r?e+o:new Vy(e+o,0,null)}touches(e,n){let r=0,o=Ok(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*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 o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new Gn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Gn.empty:new Gn(e<0?[0,-e,0]:[0,0,e])}}Gn.empty=new Gn([]);class Ml{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new Ml(this.maps,this.mirror,e,n)}copy(){return new Ml(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Ml;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Vy(e,o,null)}}const Vg=Object.create(null);class It{getMap(){return Gn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Vg[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Vg)throw new RangeError("Duplicate use of step JSON ID "+e);return Vg[e]=n,n.prototype.jsonID=e,n}}class Et{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Et(e,null)}static fail(e){return new Et(null,e)}static fromReplace(e,n,r,o){try{return Et.ok(e.replace(n,r,o))}catch(i){if(i instanceof hh)return Et.fail(i.message);throw i}}}function Gx(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Gx(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return D.fromArray(r)}class qo extends It{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new G(Gx(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Et.fromReplace(e,this.from,this.to,i)}invert(){return new Kr(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 qo(n.pos,r.pos,this.mark)}merge(e){return e instanceof qo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qo(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 qo(n.from,n.to,e.markFromJSON(n.mark))}}It.jsonID("addMark",qo);class Kr extends It{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 G(Gx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Et.fromReplace(e,this.from,this.to,r)}invert(){return new qo(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 Kr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kr(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 Kr(n.from,n.to,e.markFromJSON(n.mark))}}It.jsonID("removeMark",Kr);class Wi extends It{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Et.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Et.fromReplace(e,this.pos,this.pos+1,new G(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Wi(this.pos,n.marks[o]);return new Wi(this.pos,this.mark)}}return new Yl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wi(n.pos,e.markFromJSON(n.mark))}}It.jsonID("addNodeMark",Wi);class Yl extends It{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Et.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Et.fromReplace(e,this.pos,this.pos+1,new G(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Wi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yl(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yl(n.pos,e.markFromJSON(n.mark))}}It.jsonID("removeNodeMark",Yl);class Ft extends It{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Uy(e,this.from,this.to)?Et.fail("Structure replace would overwrite content"):Et.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Gn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ft(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ft(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ft)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ft(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ft(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ft(n.from,n.to,G.fromJSON(e,n.slice),!!n.structure)}}It.jsonID("replace",Ft);class _t extends It{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Uy(e,this.from,this.gapFrom)||Uy(e,this.gapTo,this.to)))return Et.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Et.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Et.fromReplace(e,this.from,this.to,r):Et.fail("Content does not fit in gap")}getMap(){return new Gn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new _t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new _t(n.pos,r.pos,o,i,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 _t(n.from,n.to,n.gapFrom,n.gapTo,G.fromJSON(e,n.slice),n.insert,!!n.structure)}}It.jsonID("replaceAround",_t);function Uy(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function k6(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(h)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=p:o.push(s=new Kr(f,p,d[g])));a&&a.to==f?a.to=p:i.push(a=new qo(f,p,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function S6(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Zd){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;u<l.length;u++){let d=l[u],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==i-1&&d.eq(o[p].style)&&(f=h)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new Kr(s.from,s.to,s.style)))}function E6(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=s+l.nodeSize,u=r.matchType(l.type);if(!u)i.push(new Ft(s,c,G.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||t.step(new Kr(s,c,l.marks[d]));if(l.isText&&!n.spec.code){let d,f=/\r?\n|\r/g,p;for(;d=f.exec(l.text);)p||(p=new G(D.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),i.push(new Ft(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!r.validEnd){let a=r.fillBefore(D.empty,!0);t.replace(s,s,new G(a,0,0))}for(let a=i.length-1;a>=0;a--)t.step(i[a])}function _6(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function dc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!_6(o,i,s))break}return null}function C6(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=D.empty,d=0;for(let h=i,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,u=D.from(r.node(h).copy(u)),d++):l--;let f=D.empty,p=0;for(let h=i,g=!1;h>n;h--)g||o.after(h+1)<o.end(h)?(g=!0,f=D.from(o.node(h).copy(f)),p++):c++;t.step(new _t(l,c,s,a,new G(u.append(f),d,p),u.size-d,!0))}function Yx(t,e,n=null,r=t){let o=O6(t,e),i=o&&T6(r,e);return i?o.map(Tk).concat({type:e,attrs:n}).concat(i.map(Tk)):null}function Tk(t){return{type:t,attrs:null}}function O6(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function T6(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function P6(t,e,n){let r=D.empty;for(let s=n.length-1;s>=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=D.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new _t(o,i,o,i,new G(r,0,0),n.length,!0))}function M6(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&N6(t.doc,t.mapping.slice(i).map(a),r)){t.clearIncompatible(t.mapping.slice(i).map(a,1),r);let l=t.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return t.step(new _t(c,u,c+1,u-1,new G(D.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function N6(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function R6(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new _t(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new G(D.from(s),0,0),1,!0))}function Nl(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function $6(t,e,n=1,r){let o=t.doc.resolve(e),i=D.empty,s=D.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=D.from(o.node(a).copy(i));let u=r&&r[c];s=D.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Ft(e,e,new G(i.append(s),n,n),!0))}function Jd(t,e){let n=t.resolve(e),r=n.index();return A6(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function A6(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function I6(t,e,n){let r=new Ft(e-n,e+n,G.empty,!0);t.step(r)}function d2(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function f2(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=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(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Xx(t,e,n=e,r=G.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return p2(o,i,r)?new Ft(e,n,r):new D6(o,i,r).fit()}function p2(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class D6{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=D.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=D.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new G(i,s,a);return e>-1?new _t(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ft(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Ug(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(D.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Ug(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new G(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Ug(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new G(Kc(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new G(Kc(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),x=d.matchType(g.type);if(!x)break;c++,(c>1||l==0||g.content.size)&&(d=x,u.push(h2(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=qc(this.placed,n,D.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,x=a;g<p;g++){let v=x.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),x=v.content}this.unplaced=h?e==0?G.empty:new G(Kc(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new G(Kc(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Hg(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Hg(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Hg(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?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=qc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=qc(this.placed,this.depth,D.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(D.empty,!0);n.childCount&&(this.placed=qc(this.placed,this.frontier.length,n))}}function Kc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Kc(t.firstChild.content,e-1,n)))}function qc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(qc(t.lastChild.content,e-1,n)))}function Ug(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function h2(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,h2(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(D.empty,!0)))),t.copy(r)}function Hg(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!L6(n,i.content,s)?a:null}function L6(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function j6(t){return t.spec.defining||t.spec.definingForContent}function z6(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(p2(o,i,r))return t.step(new Ft(e,n,r));let s=g2(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=j6(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let g=0;g<s.length;g++){let x=s[(g+l)%s.length],v=!0;x<0&&(v=!1,x=-x);let y=o.node(x-1),w=o.index(x-1);if(y.canReplaceWith(w,w,h.type,h.marks))return t.replace(o.before(x),v?i.after(x):n,new G(m2(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=o.before(p),n=i.after(p))}}function m2(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(m2(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(D.empty,!0))}return t}function F6(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=d2(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new G(D.from(r),0,0))}function B6(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=g2(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function g2(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Rl extends It{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 Et.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Et.fromReplace(e,this.pos,this.pos+1,new G(D.from(o),0,n.isLeaf?0:1))}getMap(){return Gn.empty}invert(e){return new Rl(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 Rl(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 Rl(n.pos,n.attr,n.value)}}It.jsonID("attr",Rl);class md extends It{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Et.ok(r)}getMap(){return Gn.empty}invert(e){return new md(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 md(n.attr,n.value)}}It.jsonID("docAttr",md);let Xl=class extends Error{};Xl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Xl.prototype=Object.create(Error.prototype);Xl.prototype.constructor=Xl;Xl.prototype.name="TransformError";class V6{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ml}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Xl(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=G.empty){let o=Xx(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new G(D.from(r),0,0))}delete(e,n){return this.replace(e,n,G.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return z6(this,e,n,r),this}replaceRangeWith(e,n,r){return F6(this,e,n,r),this}deleteRange(e,n){return B6(this,e,n),this}lift(e,n){return C6(this,e,n),this}join(e,n=1){return I6(this,e,n),this}wrap(e,n){return P6(this,e,n),this}setBlockType(e,n=e,r,o=null){return M6(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return R6(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Rl(e,n,r)),this}setDocAttribute(e,n){return this.step(new md(e,n)),this}addNodeMark(e,n){return this.step(new Wi(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ae)){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 Yl(e,n)),this}split(e,n=1,r){return $6(this,e,n,r),this}addMark(e,n,r){return k6(this,e,n,r),this}removeMark(e,n,r){return S6(this,e,n,r),this}clearIncompatible(e,n,r){return E6(this,e,n,r),this}}const Wg=Object.create(null);class Te{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new U6(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=G.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?G.empty:n),a==0&&Nk(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),Nk(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new xe(e):Za(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Za(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Za(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new yn(e.node(0))}static atStart(e){return Za(e,e,0,0,1)||new yn(e)}static atEnd(e){return Za(e,e,e.content.size,e.childCount,-1)||new yn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Wg[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 Wg)throw new RangeError("Duplicate use of selection JSON ID "+e);return Wg[e]=n,n.prototype.jsonID=e,n}getBookmark(){return xe.between(this.$anchor,this.$head).getBookmark()}}Te.prototype.visible=!0;class U6{constructor(e,n){this.$from=e,this.$to=n}}let Pk=!1;function Mk(t){!Pk&&!t.parent.inlineContent&&(Pk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class xe extends Te{constructor(e,n=e){Mk(e),Mk(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 Te.near(r);let o=e.resolve(n.map(this.anchor));return new xe(o.parent.inlineContent?o:r,r)}replace(e,n=G.empty){if(super.replace(e,n),n==G.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof xe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Em(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 xe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Te.findFrom(n,r,!0)||Te.findFrom(n,-r,!0);if(i)n=i.$head;else return Te.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Te.findFrom(e,-r,!0)||Te.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new xe(e,n)}}Te.jsonID("text",xe);class Em{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Em(e.map(this.anchor),e.map(this.head))}resolve(e){return xe.between(e.resolve(this.anchor),e.resolve(this.head))}}class fe extends Te{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Te.near(i):new fe(i)}content(){return new G(D.from(this.node),0,0)}eq(e){return e instanceof fe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Zx(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new fe(e.resolve(n.anchor))}static create(e,n){return new fe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}fe.prototype.visible=!1;Te.jsonID("node",fe);class Zx{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Em(r,r):new Zx(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&fe.isSelectable(r)?new fe(n):Te.near(n)}}class yn extends Te{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=G.empty){if(n==G.empty){e.delete(0,e.doc.content.size);let r=Te.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new yn(e)}map(e){return new yn(e)}eq(e){return e instanceof yn}getBookmark(){return H6}}Te.jsonID("all",yn);const H6={map(){return this},resolve(t){return new yn(t)}};function Za(t,e,n,r,o,i=!1){if(e.inlineContent)return xe.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&fe.isSelectable(a))return fe.create(t,n-(o<0?a.nodeSize:0))}else{let l=Za(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Nk(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Ft||o instanceof _t))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(Te.near(t.doc.resolve(s),n))}const Rk=1,Df=2,$k=4;class W6 extends V6{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Rk)&~Df,this.storedMarks=null,this}get selectionSet(){return(this.updated&Rk)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Df,this}ensureMarks(e){return Ae.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Df)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Df,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)||Ae.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Te.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|=$k,this}get scrolledIntoView(){return(this.updated&$k)>0}}function Ak(t,e){return!e||!t?t:t.bind(e)}class Gc{constructor(e,n,r){this.name=e,this.init=Ak(n.init,r),this.apply=Ak(n.apply,r)}}const K6=[new Gc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Gc("selection",{init(t,e){return t.selection||Te.atStart(e.doc)},apply(t){return t.selection}}),new Gc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Gc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Kg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=K6.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 Gc(r.key,r.spec.state,r))})}}class Ys{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ys(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new W6(this)}static create(e){let n=new Kg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ys(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Kg(this.schema,e.plugins),r=n.fields,o=new Ys(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Kg(e.schema,e.plugins),i=new Ys(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=rs.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Te.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.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)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function v2(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=v2(o,e,{})),n[r]=o}return n}class pi{constructor(e){this.spec=e,this.props={},e.props&&v2(e.props,this,this.props),this.key=e.key?e.key.key:y2("plugin")}getState(e){return e[this.key]}}const qg=Object.create(null);function y2(t){return t in qg?t+"$"+ ++qg[t]:(qg[t]=0,t+"$")}class fc{constructor(e="key"){this.key=y2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}function x2(){return typeof document<"u"?document:null}function b2(t,e){if(typeof t!="string")return[t];var n=[t];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",i=!!e.flat;r.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var g=n.push(f.slice(l[0].length,-l[1].length))-1;return u.push(g),o+g+o}n.forEach(function(f,p){for(var h,g=0;f!=h;)if(h=f,f=f.replace(c,d),g++>1e4)throw Error("References have circular dependency. Please, check them.");n[p]=f}),u=u.reverse(),n=n.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?n:a(n[0],n)}function w2(t,e){if(e&&e.flat){var n=e&&e.escape||"___",r=t[0],o;if(!r)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),s=0;r!=o;){if(s++>1e4)throw Error("Circular references in "+t);o=r,r=r.replace(i,a)}return r}return t.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(t[c]==null)throw Error("Reference "+c+"is undefined");return t[c]}}function k2(t,e){return Array.isArray(t)?w2(t,e):b2(t,e)}k2.parse=b2;k2.stringify=w2;const q6={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},G6={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},Y6={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},X6={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},Z6={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},J6={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},Q6={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},ej={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var gs=Object.freeze({__proto__:null,COPY_DESCRIPTION:G6,COPY_LABEL:q6,CUT_DESCRIPTION:X6,CUT_LABEL:Y6,PASTE_DESCRIPTION:J6,PASTE_LABEL:Z6,SELECT_ALL_DESCRIPTION:ej,SELECT_ALL_LABEL:Q6});const tj={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},nj={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var Ik=Object.freeze({__proto__:null,DESCRIPTION:nj,LABEL:tj});const rj={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1}
|
|
138
|
-
2 {Heading 2}
|
|
139
|
-
3 {Heading 3}
|
|
140
|
-
4 {Heading 4}
|
|
141
|
-
5 {Heading 5}
|
|
142
|
-
6 {Heading 6}
|
|
143
|
-
other {Heading}}`,comment:"Label for heading command with support for levels."};var oj=Object.freeze({__proto__:null,LABEL:rj});const ij={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},sj={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},aj={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},lj={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var xh=Object.freeze({__proto__:null,REDO_DESCRIPTION:lj,REDO_LABEL:aj,UNDO_DESCRIPTION:sj,UNDO_LABEL:ij});const cj={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},uj={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var Dk=Object.freeze({__proto__:null,DESCRIPTION:uj,LABEL:cj});const dj={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},fj={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},pj={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Jx=Object.freeze({__proto__:null,BULLET_LIST_LABEL:fj,ORDERED_LIST_LABEL:dj,TASK_LIST_LABEL:pj});const hj={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},mj={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},gj={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},vj={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var bh=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:vj,CONVERT_LABEL:gj,INSERT_DESCRIPTION:mj,INSERT_LABEL:hj});const yj={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},xj={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var Lk=Object.freeze({__proto__:null,DESCRIPTION:xj,LABEL:yj});class Cr{constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?bj(n):n,this.undoable=r.undoable!==!1}}function bj(t){return function(e,n,r,o){let i=t;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}}const wj=500;function kj({rules:t}){let e=new pi({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return jk(n,r,o,i,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&jk(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function jk(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-wj),a.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c],d=u.match.exec(l),f=d&&u.handler(s,d,e-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}const Sj=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let o=n[r],i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to);e(s)}return!0}}return!1};new Cr(/--$/,"—");new Cr(/\.\.\.$/,"…");new Cr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new Cr(/"$/,"”");new Cr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new Cr(/'$/,"’");function Qx(t,e,n=null,r){return new Cr(t,(o,i,s,a)=>{let l=n instanceof Function?n(i):n,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Yx(d,e,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&Jd(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c})}function Ej(t,e,n=null){return new Cr(t,(r,o,i,s)=>{let a=r.doc.resolve(i),l=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?r.tr.delete(i,s).setBlockType(i,i,e,l):null})}const mn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},gd=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let zk=null;const Bo=function(t,e,n){let r=zk||(zk=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},ya=function(t,e,n,r){return n&&(Fk(t,e,n,r,-1)||Fk(t,e,n,r,1))},_j=/^(img|br|input|textarea|hr)$/i;function Fk(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:uo(t))){let i=t.parentNode;if(!i||i.nodeType!=1||e1(t)||_j.test(t.nodeName)||t.contentEditable=="false")return!1;e=mn(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?uo(t):0}else return!1}}function uo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Cj(t,e,n){for(let r=e==0,o=e==uo(t);r||o;){if(t==n)return!0;let i=mn(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==uo(t)}}function e1(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _m=function(t){return t.focusNode&&ya(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Us(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Oj(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Tj(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const wo=typeof navigator<"u"?navigator:null,Bk=typeof document<"u"?document:null,Cs=wo&&wo.userAgent||"",Hy=/Edge\/(\d+)/.exec(Cs),S2=/MSIE \d/.exec(Cs),Wy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cs),Dn=!!(S2||Wy||Hy),is=S2?document.documentMode:Wy?+Wy[1]:Hy?+Hy[1]:0,no=!Dn&&/gecko\/(\d+)/i.test(Cs);no&&+(/Firefox\/(\d+)/.exec(Cs)||[0,0])[1];const Ky=!Dn&&/Chrome\/(\d+)/.exec(Cs),ln=!!Ky,Pj=Ky?+Ky[1]:0,wn=!Dn&&!!wo&&/Apple Computer/.test(wo.vendor),Zl=wn&&(/Mobile\/\w+/.test(Cs)||!!wo&&wo.maxTouchPoints>2),cr=Zl||(wo?/Mac/.test(wo.platform):!1),Mj=wo?/Win/.test(wo.platform):!1,Fr=/Android \d/.test(Cs),Qd=!!Bk&&"webkitFontSmoothing"in Bk.documentElement.style,Nj=Qd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Rj(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ro(t,e){return typeof t=="number"?t:t[e]}function $j(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 Vk(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=gd(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?Rj(i):$j(a),u=0,d=0;if(e.top<c.top+Ro(r,"top")?d=-(c.top-e.top+Ro(o,"top")):e.bottom>c.bottom-Ro(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Ro(o,"top")-c.top:e.bottom-c.bottom+Ro(o,"bottom")),e.left<c.left+Ro(r,"left")?u=-(c.left-e.left+Ro(o,"left")):e.right>c.right-Ro(r,"right")&&(u=e.right-c.right+Ro(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,g=a.scrollTop-p;e={left:e.left-h,top:e.top-g,right:e.right-h,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Aj(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:E2(t.dom)}}function E2(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=gd(r));return e}function Ij({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;_2(n,r==0?0:r-e)}function _2(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Ba=null;function Dj(t){if(t.setActive)return t.setActive();if(Ba)return t.focus(Ba);let e=E2(t);t.focus(Ba==null?{get preventScroll(){return Ba={preventScroll:!0},!0}}:void 0),Ba||(Ba=!1,_2(e,0))}function C2(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Bo(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let g=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Lj(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:C2(n,o)}function Lj(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=Ci(r,1);if(i.top!=i.bottom&&t1(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function t1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function jj(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zj(t,e,n){let{node:r,offset:o}=C2(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function Fj(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!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?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function O2(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(t1(e,c))return O2(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function Bj(t,e){let n=t.dom.ownerDocument,r,o=0,i=Tj(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!t1(e,c)||(s=O2(t.dom,e,c),!s))return null}if(wn)for(let c=s;r&&c;c=gd(c))c.draggable&&(r=void 0);if(s=jj(s,e),r){if(no&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;Qd&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=Fj(t,r,o,e))}a==null&&(a=zj(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Uk(t){return t.top<t.bottom||t.left<t.right}function Ci(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Uk(r))return r}return Array.prototype.find.call(n,Uk)||t.getBoundingClientRect()}const Vj=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function T2(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Qd||no;if(r.nodeType==3)if(s&&(Vj.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Ci(Bo(r,o,o),n);if(no&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Ci(Bo(r,o-1,o-1),-1);if(c.top==l.top){let u=Ci(Bo(r,o,o+1),-1);if(u.top!=l.top)return Ac(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Ac(Ci(Bo(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==uo(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Gg(l.getBoundingClientRect(),!1)}if(i==null&&o<uo(r)){let l=r.childNodes[o];if(l.nodeType==1)return Gg(l.getBoundingClientRect(),!0)}return Gg(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==uo(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Bo(l,uo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ac(Ci(c,1),!1)}if(i==null&&o<uo(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Bo(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Ac(Ci(c,-1),!0)}return Ac(Ci(r.nodeType==3?Bo(r):r,-n),n>=0)}function Ac(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 Gg(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 P2(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function Uj(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return P2(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=T2(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Bo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Hj=/[\u0590-\u08ac]/;function Wj(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return!Hj.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:P2(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),x=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),x})}let Hk=null,Wk=null,Kk=!1;function Kj(t,e,n){return Hk==e&&Wk==n?Kk:(Hk=e,Wk=n,Kk=n=="up"||n=="down"?Uj(t,e,n):Wj(t,e,n))}const gr=0,qk=1,Xs=2,ko=3;class ef{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=gr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>mn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof N2){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof M2&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?mn(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?mn(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=mn(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=mn(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let h=this.children[f],g=p+h.size;if(i>p&&s<g)return h.setSelection(e-p-h.border,n-p-h.border,r,o);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((no||wn)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(u=!!(p&&f.nodeValue[p-1]==`
|
|
144
|
-
`),u&&p==f.nodeValue.length)for(let h=f,g;h;h=h.parentNode){if(g=h.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:mn(g)+1});break}let x=h.pmViewDesc;if(x&&x.node&&x.node.isBlock)break}}else{let h=f.childNodes[p-1];u=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(no&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&wn)&&ya(a.node,a.offset,c.anchorNode,c.anchorOffset)&&ya(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Xs:qk,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ko:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Xs:ko}r=s}this.dirty=Xs}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Xs:qk;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class M2 extends ef{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!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,i=this}matchesWidget(e){return this.dirty==gr&&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 qj extends ef{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class xa extends ef{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Wr.renderSpec(document,n.type.spec.toDOM(n,r))),new xa(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&ko||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ko&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=gr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=gr}}slice(e,n,r){let o=xa.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Yy(i,n,s,r)),e>0&&(i=Yy(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}}class ss extends ef{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Wr.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=A2(u,r,n),c?l=new Gj(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Cm(e,n,r,o,u,f,i):new ss(e,n,r,o,u,d||null,f,i,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=()=>D.empty)}return e}matchesNode(e,n,r){return this.dirty==gr&&e.eq(this.node)&&Gy(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new Xj(this,s&&s.node,e);Qj(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Ae.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xs)&&(s&&this.protectLocalComposition(e,s),R2(this.contentDOM,this.children,e),Zl&&e7(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof xe)||r<n||o>n+this.node.content.size)return null;let i=e.domSelectionRange(),s=t7(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=n7(this.node.content,a,r-n,o-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new qj(this,i,n,o);e.input.compositionNodes.push(s),this.children=Yy(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==ko||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=gr}updateOuterDeco(e){if(Gy(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$2(this.dom,this.nodeDOM,qy(this.outerDeco,this.node,n),qy(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 Gk(t,e,n,r,o){A2(r,e,t);let i=new ss(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Cm extends ss{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,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,o){return this.dirty==ko||this.dirty!=gr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=gr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=gr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Cm(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ko)}get domAtom(){return!1}}class N2 extends ef{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==gr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Gj extends ss{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==ko)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function R2(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Yk(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof xa){let l=r?r.previousSibling:t.lastChild;R2(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Yk(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Nu=function(t){t&&(this.nodeName=t)};Nu.prototype=Object.create(null);const Zs=[new Nu];function qy(t,e,n){if(t.length==0)return Zs;let r=n?Zs[0]:new Nu,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Nu(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Nu(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function $2(t,e,n,r){if(n==Zs&&r==Zs)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=Zs[0]),o=l}Yj(o,a||Zs[0],s)}return o}function Yj(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function A2(t,e,n){return $2(t,t,Zs,qy(e,n,t.nodeType!=1))}function Gy(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Yk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Xj{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Zj(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=gr,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=xa.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==ko&&s.dom==s.contentDOM&&(s.dirty=Xs),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ss){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ko&&Gy(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Xs,d.updateChildren(o,s+1),d.dirty=gr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=ss.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=ss.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new M2(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof xa;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cm)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((wn||ln)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new N2(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Zj(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof xa)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function Jj(t,e){return t.type.side-e.type.side}function Qj(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let x=o[s++];x.widget&&(u?(d||(d=[u])).push(x):u=x)}if(u)if(d){d.sort(Jj);for(let x=0;x<d.length;x++)n(d[x],c,!!l)}else n(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let x=0;x<a.length;x++)a[x].to<=i&&a.splice(x--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let x=h;s<o.length&&o[s].from<x&&(x=o[s].from);for(let v=0;v<a.length;v++)a[v].to<x&&(x=a[v].to);x<h&&(l=f.cut(x-i),f=f.cut(0,x-i),h=x,p=-1)}else for(;s<o.length&&o[s].to<h;)s++;let g=f.isInline&&!f.isLeaf?a.filter(x=>!x.inline):a.slice();r(f,g,e.forChild(i,f),p),i=h}}function e7(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 t7(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=uo(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function n7(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Yy(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function n1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(_m(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&fe.isSelectable(u)&&o.parent&&!(u.isInline&&Cj(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new fe(s==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=r1(t,l,a,u)}return c}function I2(t){return t.editable?t.hasFocus():L2(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Jo(t,e=!1){let n=t.state.selection;if(D2(t,n),!!I2(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ln){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&ya(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)o7(t);else{let{anchor:r,head:o}=n,i,s;Xk&&!(n instanceof xe)&&(n.$from.parent.inlineContent||(i=Zk(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Zk(t,n.to))),t.docView.setSelection(r,o,t.root,e),Xk&&(i&&Jk(i),s&&Jk(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&r7(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Xk=wn||ln&&Pj<63;function Zk(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(wn&&o&&o.contentEditable=="false")return Yg(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Yg(o);if(i)return Yg(i)}}function Yg(t){return t.contentEditable="true",wn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Jk(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function r7(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!I2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function o7(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,mn(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Dn&&is<=11&&(r.disabled=!0,r.disabled=!1)}function D2(t,e){if(e instanceof fe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Qk(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Qk(t)}function Qk(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function r1(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||xe.between(e,n,r)}function eS(t){return t.editable&&!t.hasFocus()?!1:L2(t)}function L2(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 i7(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ya(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Xy(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Te.findFrom(i,e)}function Di(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tS(t,e,n){let r=t.state.selection;if(r instanceof xe)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return Di(t,new xe(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Xy(t.state,e);return o&&o instanceof fe?Di(t,o):!1}else if(!(cr&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?fe.isSelectable(i)?Di(t,new fe(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Qd?Di(t,new xe(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof fe&&r.node.isInline)return Di(t,new xe(e>0?r.$to:r.$from));{let o=Xy(t.state,e);return o?Di(t,o):!1}}}function wh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ru(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Va(t,e){return e<0?s7(t):a7(t)}function s7(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(no&&n.nodeType==1&&r<wh(n)&&Ru(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ru(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(j2(n))break;{let a=n.previousSibling;for(;a&&Ru(a,-1);)o=n.parentNode,i=mn(a),a=a.previousSibling;if(a)n=a,r=wh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Zy(t,n,r):o&&Zy(t,o,i)}function a7(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=wh(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Ru(a,1))i=n,s=++r;else break}else{if(j2(n))break;{let a=n.nextSibling;for(;a&&Ru(a,1);)i=a.parentNode,s=mn(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=wh(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Zy(t,i,s)}function j2(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function l7(t,e){for(;t&&e==t.childNodes.length&&!e1(t);)e=mn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function c7(t,e){for(;t&&!e&&!e1(t);)e=mn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Zy(t,e,n){if(e.nodeType!=3){let i,s;(s=l7(e,n))?(e=s,n=0):(i=c7(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(_m(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Jo(t)},50)}function nS(t,e){let n=t.state.doc.resolve(e);if(!(ln||Mj)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function rS(t,e,n){let r=t.state.selection;if(r instanceof xe&&!r.empty||n.indexOf("s")>-1||cr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Xy(t.state,e);if(s&&s instanceof fe)return Di(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof yn?Te.near(s,e):Te.findFrom(s,e);return a?Di(t,a):!1}return!1}function oS(t,e){if(!(t.state.selection instanceof xe))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function iS(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function u7(t){if(!wn||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;iS(t,r,"true"),setTimeout(()=>iS(t,r,"false"),20)}return!1}function d7(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function f7(t,e){let n=e.keyCode,r=d7(e);if(n==8||cr&&n==72&&r=="c")return oS(t,-1)||Va(t,-1);if(n==46&&!e.shiftKey||cr&&n==68&&r=="c")return oS(t,1)||Va(t,1);if(n==13||n==27)return!0;if(n==37||cr&&n==66&&r=="c"){let o=n==37?nS(t,t.state.selection.from)=="ltr"?-1:1:-1;return tS(t,o,r)||Va(t,o)}else if(n==39||cr&&n==70&&r=="c"){let o=n==39?nS(t,t.state.selection.from)=="ltr"?1:-1:1;return tS(t,o,r)||Va(t,o)}else{if(n==38||cr&&n==80&&r=="c")return rS(t,-1,r)||Va(t,-1);if(n==40||cr&&n==78&&r=="c")return u7(t)||rS(t,1,r)||Va(t,1);if(r==(cr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function z2(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Wr.fromSchema(t.state.schema),a=W2(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=H2[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
145
|
-
|
|
146
|
-
`);return{dom:l,text:f}}function F2(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new G(D.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
147
|
-
`))),0,0):G.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)a=d;else{let f=o.marks(),{schema:p}=t.state,h=Wr.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let x=s.appendChild(document.createElement("p"));g&&x.appendChild(h.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=m7(n),Qd&&g7(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 d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Gl.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!p7.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=v7(sS(a,+u[1],+u[2]),u[4]);else if(a=G.maxOpen(h7(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=sS(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const p7=/^(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 h7(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&V2(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=U2(s[s.length-1],i.length));let u=B2(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return D.from(s)}return t}function B2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,D.from(t));return t}function V2(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=V2(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(D.from(B2(n,t,o+1))))}}function U2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,U2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(D.empty,!0);return t.copy(n.append(r))}function Jy(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Jy(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(D.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function sS(t,e,n){return e<t.openStart&&(t=new G(Jy(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G(Jy(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const H2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let aS=null;function W2(){return aS||(aS=document.implementation.createHTMLDocument("title"))}function m7(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=W2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&H2[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=t,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function g7(t){let e=t.querySelectorAll(ln?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function v7(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=D.from(l.create(r[a+1],o)),i++,s++}return new G(o,i,s)}const kn={},Sn={},y7={touchstart:!0,touchmove:!0};class x7{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function b7(t){for(let e in kn){let n=kn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{k7(t,r)&&!o1(t,r)&&(t.editable||!(r.type in Sn))&&n(t,r)},y7[e]?{passive:!0}:void 0)}wn&&t.dom.addEventListener("input",()=>null),Qy(t)}function Ki(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function w7(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 Qy(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>o1(t,r))})}function o1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function k7(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 S7(t,e){!o1(t,e)&&kn[e.type]&&(t.editable||!(e.type in Sn))&&kn[e.type](t,e)}Sn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!q2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fr&&ln&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Zl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Us(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||f7(t,n)?n.preventDefault():Ki(t,"key")};Sn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Sn.keypress=(t,e)=>{let n=e;if(q2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||cr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof xe)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Om(t){return{left:t.clientX,top:t.clientY}}function E7(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function i1(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function $l(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function _7(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&fe.isSelectable(r)?($l(t,new fe(n),"pointer"),!0):!1}function C7(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof fe&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(fe.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?($l(t,fe.create(t.state.doc,o),"pointer"),!0):!1}function O7(t,e,n,r,o){return i1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?C7(t,n):_7(t,n))}function T7(t,e,n,r){return i1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function P7(t,e,n,r){return i1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||M7(t,n,r)}function M7(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?($l(t,xe.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)$l(t,xe.create(r,a+1,a+1+s.content.size),"pointer");else if(fe.isSelectable(s))$l(t,fe.create(r,a),"pointer");else continue;return!0}}function s1(t){return kh(t)}const K2=cr?"metaKey":"ctrlKey";kn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=s1(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&E7(n,t.input.lastClick)&&!n[K2]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(Om(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new N7(t,s,n,!!r)):(i=="doubleClick"?T7:P7)(t,s.pos,s.inside,n)?n.preventDefault():Ki(t,"pointer"))};class N7{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[K2],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof fe&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&no&&!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)),Ki(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(()=>Jo(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(Om(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ki(this.view,"pointer"):O7(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||wn&&this.mightDrag&&!this.mightDrag.node.isAtom||ln&&!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)?($l(this.view,Te.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Ki(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ki(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)}}kn.touchstart=t=>{t.input.lastTouch=Date.now(),s1(t),Ki(t,"pointer")};kn.touchmove=t=>{t.input.lastTouch=Date.now(),Ki(t,"pointer")};kn.contextmenu=t=>s1(t);function q2(t,e){return t.composing?!0:wn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const R7=Fr?5e3:-1;Sn.compositionstart=Sn.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(),kh(t,!0),t.markCursor=null;else if(kh(t),no&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}G2(t,R7)};Sn.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.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,G2(t,20))};function G2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>kh(t),e))}function Y2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=$7());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function $7(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function kh(t,e=!1){if(!(Fr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Y2(t),e||t.docView&&t.docView.dirty){let n=n1(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function A7(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const vd=Dn&&is<15||Zl&&Nj<604;kn.copy=Sn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=vd?null:n.clipboardData,s=r.content(),{dom:a,text:l}=z2(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):A7(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function I7(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function D7(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 o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?yd(t,r.value,null,o,e):yd(t,r.textContent,r.innerHTML,o,e)},50)}function yd(t,e,n,r,o){let i=F2(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||G.empty)))return!0;if(!i)return!1;let s=I7(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function X2(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," "):""}Sn.paste=(t,e)=>{let n=e;if(t.composing&&!Fr)return;let r=vd?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&yd(t,X2(r),r.getData("text/html"),o,n)?n.preventDefault():D7(t,n)};class Z2{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const J2=cr?"altKey":"ctrlKey";kn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Om(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof fe?o.to-1:o.to))){if(r&&r.mightDrag)s=fe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=fe.create(t.state.doc,u.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c}=z2(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(vd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",vd||n.dataTransfer.setData("text/plain",c),t.dragging=new Z2(a,!n[J2],s)};kn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Sn.dragover=Sn.dragenter=(t,e)=>e.preventDefault();Sn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Om(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=F2(t,X2(n.dataTransfer),vd?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[J2]);if(t.someProp("handleDrop",h=>h(t,n,s||G.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?f2(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&fe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new fe(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,x,v,y)=>h=y),c.setSelection(r1(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};kn.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())&&Jo(t)},20))};kn.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)};kn.beforeinput=(t,e)=>{if(ln&&Fr&&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",i=>i(t,Us(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Sn)kn[t]=Sn[t];function xd(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 Sh{constructor(e,n){this.toDOM=e,this.spec=n||ra,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new ct(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Sh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&xd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class as{constructor(e,n){this.attrs=e,this.spec=n||ra}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new ct(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof as&&xd(this.attrs,e.attrs)&&xd(this.spec,e.spec)}static is(e){return e.type instanceof as}destroy(){}}class a1{constructor(e,n){this.attrs=e,this.spec=n||ra}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new ct(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof a1&&xd(this.attrs,e.attrs)&&xd(this.spec,e.spec)}destroy(){}}class ct{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ct(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ct(e,e,new Sh(n,r))}static inline(e,n,r,o){return new ct(e,n,new as(r,o))}static node(e,n,r,o){return new ct(e,n,new a1(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof as}get widget(){return this.type instanceof Sh}}const Ja=[],ra={};class ze{constructor(e,n){this.local=e.length?e:Ja,this.children=n.length?n:Ja}static create(e,n){return n.length?Eh(n,e,0,ra):sn}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==sn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ra)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?L7(this.children,s||[],e,n,r,o,i):s?new ze(s.sort(oa),Ja):sn}add(e,n){return n.length?this==sn?ze.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=eP(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Eh(u,a,c+1,ra)),i+=3}});let s=Q2(i?tP(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new ze(s.length?this.local.concat(s).sort(oa):this.local,o||this.children)}remove(e){return e.length==0||this==sn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=sn?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ze(o,r):sn}forChild(e,n){if(this==sn)return this;if(n.isLeaf)return ze.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof as){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new ze(o.sort(oa),Ja);return r?new Bi([a,r]):a}return r||sn}eq(e){if(this==e)return!0;if(!(e instanceof ze)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return l1(this.localsInner(e))}localsInner(e){if(this==sn)return Ja;if(e.inlineContent||!this.local.some(as.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof as||n.push(this.local[r]);return n}}ze.empty=new ze([],[]);ze.removeOverlap=l1;const sn=ze.empty;class Bi{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ra));return Bi.from(r)}forChild(e,n){if(n.isLeaf)return ze.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=sn&&(i instanceof Bi?r=r.concat(i.members):r.push(i))}return Bi.from(r)}eq(e){if(!(e instanceof Bi)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?l1(r?n:n.sort(oa)):Ja}static from(e){switch(e.length){case 0:return sn;case 1:return e[0];default:return new Bi(e.every(n=>n instanceof ze)?e:e.reduce((n,r)=>n.concat(r instanceof ze?r:r.members),[]))}}}function L7(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,h,g)=>{let x=g-h-(p-f);for(let v=0;v<a.length;v+=3){let y=a[v+1];if(y<0||f>y+u-d)continue;let w=a[v]+u-d;p>=w?a[v+1]=f<=w?-2:-1:f>=u&&x&&(a[v]+=x,a[v+1]+=x)}d+=x}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-o,{index:h,offset:g}=r.content.findIndex(d),x=r.maybeChild(h);if(x&&g==d&&g+x.nodeSize==p){let v=a[c+2].mapInner(n,x,u+1,t[c]+i+1,s);v!=sn?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=j7(a,t,e,n,o,i,s),u=Eh(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new ze(e.sort(oa),a)}function Q2(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new ct(o.from+e,o.to+e,o.type))}return n}function j7(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function eP(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function tP(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Eh(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=eP(t,a,l+n);if(c){i=!0;let u=Eh(c,a,n+l+1,r);u!=sn&&o.push(l,l+a.nodeSize,u)}});let s=Q2(i?tP(t):t,-n).sort(oa);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new ze(s,o):sn}function oa(t,e){return t.from-e.from||t.to-e.to}function l1(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),lS(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),lS(e,o,r.copy(i.from,r.to)));break}}}return e}function lS(t,e,n){for(;e<t.length&&oa(n,t[e])>0;)e++;t.splice(e,0,n)}function Xg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=sn&&e.push(r)}),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),Bi.from(e)}const z7={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},F7=Dn&&is<=11;class B7{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 V7{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new B7,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Dn&&is<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),F7&&(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,z7)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(eS(this.view)){if(this.suppressingSelectionUpdates)return Jo(this.view);if(Dn&&is<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ya(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 i=e.focusNode;i;i=gd(i))n.add(i);for(let i=e.anchorNode;i;i=gd(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let 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(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&eS(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(no&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_m(r)&&(c=n1(e))&&c.eq(Te.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jo(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),U7(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Jo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)n.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(Dn&&is<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?mn(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?mn(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let cS=new WeakMap,uS=!1;function U7(t){if(!cS.has(t)&&(cS.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=no,uS)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),uS=!0}}function H7(t){let e;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return ya(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}function W7(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],_m(l)||c.push({node:l.focusNode,offset:l.focusOffset})),ln&&t.input.lastKeyCode===8)for(let x=i;x>o;x--){let v=r.childNodes[x-1],y=v.pmViewDesc;if(v.nodeName=="BR"&&!y){i=x;break}if(!y||y.size)break}let d=t.state.doc,f=t.someProp("domParser")||Gl.fromSchema(t.state.schema),p=d.resolve(s),h=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:K7,context:p});if(c&&c[0].pos!=null){let x=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=x),h={anchor:x+s,head:v+s}}return{doc:g,sel:h,from:s,to:a}}function K7(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(wn&&/^(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||wn&&/^(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 q7=/^(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 G7(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let M=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,$=n1(t,M);if($&&!t.state.selection.eq($)){if(ln&&Fr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",j=>j(t,Us(13,"Enter"))))return;let V=t.state.tr.setSelection($);M=="pointer"?V.setMeta("pointer",!0):M=="key"&&V.scrollIntoView(),i&&V.setMeta("composition",i),t.dispatch(V)}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=W7(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=Z7(d.content,c.doc.content,c.from,f,p);if((Zl&&t.input.lastIOSEnter>Date.now()-225||Fr)&&o.some(M=>M.nodeType==1&&!q7.test(M.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",M=>M(t,Us(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof xe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let M=dS(t,t.state.doc,c.sel);if(M&&!M.eq(t.state.selection)){let $=t.state.tr.setSelection(M);i&&$.setMeta("composition",i),t.dispatch($)}}return}if(ln&&t.cursorWrapper&&c.sel&&c.sel.anchor==t.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let M=h.endB-h.start;c.sel={anchor:c.sel.anchor+M,head:c.sel.anchor+M}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof xe&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Dn&&is<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" "&&(h.start--,h.endA--,h.endB--);let g=c.doc.resolveNoCache(h.start-c.from),x=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),y=g.sameParent(x)&&g.parent.inlineContent&&v.end()>=h.endA,w;if((Zl&&t.input.lastIOSEnter>Date.now()-225&&(!y||o.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!y&&g.pos<c.doc.content.size&&!g.sameParent(x)&&(w=Te.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==x.pos)&&t.someProp("handleKeyDown",M=>M(t,Us(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&X7(u,h.start,h.endA,g,x)&&t.someProp("handleKeyDown",M=>M(t,Us(8,"Backspace")))){Fr&&ln&&t.domObserver.suppressSelectionUpdates();return}ln&&Fr&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),Fr&&!y&&g.start()!=x.start()&&x.parentOffset==0&&g.depth==x.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,x=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(M){return M(t,Us(13,"Enter"))})},20));let k=h.start,E=h.endA,O,S,P;if(y){if(g.pos==x.pos)Dn&&is<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Jo(t),20)),O=t.state.tr.delete(k,E),S=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(P=Y7(g.parent.content.cut(g.parentOffset,x.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))O=t.state.tr,P.type=="add"?O.addMark(k,E,P.mark):O.removeMark(k,E,P.mark);else if(g.parent.child(g.index()).isText&&g.index()==x.index()-(x.textOffset?0:1)){let M=g.parent.textBetween(g.parentOffset,x.parentOffset);if(t.someProp("handleTextInput",$=>$(t,k,E,M)))return;O=t.state.tr.insertText(M,k,E)}}if(O||(O=t.state.tr.replace(k,E,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let M=dS(t,O.doc,c.sel);M&&!(ln&&Fr&&t.composing&&M.empty&&(h.start!=h.endB||t.input.lastAndroidDelete<Date.now()-100)&&(M.head==k||M.head==O.mapping.map(E)-1)||Dn&&M.empty&&M.head==k)&&O.setSelection(M)}S&&O.ensureMarks(S),i&&O.setMeta("composition",i),t.dispatch(O.scrollIntoView())}function dS(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:r1(t,e.resolve(n.anchor),e.resolve(n.head))}function Y7(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(D.from(c).eq(t))return{mark:a,type:s}}function X7(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Zg(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Zg(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Zg(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Zg(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function Z7(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&fS(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&fS(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function fS(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class J7{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 x7,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(vS),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=mS(this),hS(this),this.nodeViews=gS(this),this.docView=Gk(this.state.doc,pS(this),Xg(this),this.dom,this),this.domObserver=new V7(this,(r,o,i,s)=>G7(this,r,o,i,s)),this.domObserver.start(),b7(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&&Qy(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vS),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 o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Y2(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=gS(this);e8(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Qy(this),this.editable=mS(this),hS(this);let l=Xg(this),c=pS(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Aj(this);if(s){this.domObserver.stop();let p=d&&(Dn||ln)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&Q7(o.selection,e.selection);if(d){let h=ln?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Gk(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&i7(this))?Jo(this,p):(D2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Ij(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof fe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Vk(this,n.getBoundingClientRect(),e)}else Vk(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Z2(e.slice,e.move,o<0?void 0:fe.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(Dn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Dj(this.dom),Jo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Bj(this,e)}coordsAtPos(e,n=1){return T2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return Kj(this,n||this.state,e)}pasteHTML(e,n){return yd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return yd(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(w7(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return S7(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return wn&&this.root.nodeType===11&&Oj(this.dom.ownerDocument)==this.dom?H7(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function pS(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"),[ct.node(0,t.state.doc.content.size,e)]}function hS(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:ct.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function mS(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Q7(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 gS(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function e8(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function vS(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 t8=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const n8=ui(t8);var nP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ee=(t,e,n)=>(nP(t,e,"read from private field"),n?n.call(t):e.get(t)),$o=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},nt=(t,e,n,r)=>(nP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function r8(t){return!!(t.prev&&t.next&&t.prev.text.full!==t.next.text.full)}function o8(t){return!!(t.prev&&t.next&&t.prev.range.cursor!==t.next.range.cursor)}function i8(t){return!!(!t.prev&&t.next)}function s8(t){return!!(t.prev&&!t.next)}function a8(t){return!!(t.prev&&t.next&&t.prev.range.from!==t.next.range.from)}function l8(t){return t==="invalid-exit-split"}var c8=["jump-backward-exit","jump-forward-exit"],u8=["jump-backward-change","jump-forward-change"];function d8(t){var e,n;return to(c8,(e=t.exit)==null?void 0:e.exitReason)||to(u8,(n=t.change)==null?void 0:n.changeReason)}function yS(t){return!!(t&&t.query.full.length>=t.suggester.matchOffset)}function xS(t){return dn(t)&&t instanceof xe}function Rn(t){const{match:e,changeReason:n,exitReason:r}=t;return{...e,changeReason:n,exitReason:r}}function f8(t,e){const{invalidPrefixCharacters:n,validPrefixCharacters:r}=e;return n?!new RegExp(t0(n)).test(t):new RegExp(t0(r)).test(t)}function p8(t){const{text:e,regexp:n,$pos:r,suggester:o}=t,i=r.start();let s;return Sm(e,n).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(f8(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ge(u)||!ge(d))return;const f=c+u.length,p=Math.min(f,r.pos),h=p-c;c<r.pos&&f>=r.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:r.doc.textBetween(f,r.end(),Hi,Hi),textBefore:r.doc.textBetween(i,c,Hi,Hi),suggester:o})}}),s}function rP(t){const{$pos:e,suggester:n}=t,{char:r,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=n,d=k8({char:r,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=e.doc.textBetween(e.before(),e.end(),Hi,Hi);return p8({suggester:n,text:f,regexp:d,$pos:e,char:r,name:o})}function oP(t){const{state:e,match:n}=t;try{return rP({$pos:e.doc.resolve(n.range.cursor),suggester:n.suggester})}catch{return}}function iP(t){const{prev:e,next:n,state:r}=t;return!n&&e.range.from>=r.doc.nodeSize?{exit:Rn({match:e,exitReason:"delete"})}:!n||!e.query.partial?{exit:Rn({match:e,exitReason:"invalid-exit-split"})}:e.range.to===n.range.cursor?{exit:Rn({match:n,exitReason:"exit-end"})}:e.query.partial?{exit:Rn({match:n,exitReason:"exit-split"})}:{}}function h8(t){const{prev:e,next:n,state:r}=t,o=se(),i=oP({state:r,match:e}),{exit:s}=i&&i.query.full!==e.query.full?iP({prev:e,next:i,state:r}):o;return e.range.from<n.range.from?{exit:s??Rn({match:e,exitReason:"jump-forward-exit"}),change:Rn({match:n,changeReason:"jump-forward-change"})}:{exit:s??Rn({match:e,exitReason:"jump-backward-exit"}),change:Rn({match:n,changeReason:"jump-backward-change"})}}function m8(t){const{match:e,state:n,$pos:r}=t,{selection:o}=n,i=oP({match:e,state:n});return!i||i.text.full!==e.text.full?iP({prev:e,next:i,state:n}):!o.empty&&(o.from<=e.range.from||o.to>=e.range.to)?{exit:Rn({match:e,exitReason:"selection-outside"})}:r.pos>e.range.to?{exit:Rn({match:e,exitReason:"move-end"})}:r.pos<=e.range.from?{exit:Rn({match:e,exitReason:"move-start"})}:{}}function g8(t){const{prev:e,next:n,state:r,$pos:o}=t,i=se();if(!e&&!n)return i;const s={prev:e,next:n};return a8(s)?h8({prev:s.prev,next:s.next,state:r}):i8(s)?{change:Rn({match:s.next,changeReason:"start"})}:s8(s)?m8({$pos:o,match:s.prev,state:r}):r8(s)?{change:Rn({match:s.next,changeReason:"change-character"})}:o8(s)?{change:Rn({match:s.next,changeReason:r.selection.empty?"move":"selection-inside"})}:i}function bS(t,e){for(let n=t.depth;n>0;n--){const r=t.node(n);if(e.includes(r.type.name))return!0}return!1}function e0(t,e){const{$from:n,$to:r}=t;return sP(t,e)?!0:FT(n.pos,r.pos).some(o=>v8(n.doc.resolve(o),e))}function sP(t,e){const{$from:n,$to:r}=t,o=new Set((n.marksAcross(r)??[]).map(i=>i.type.name));return e.some(i=>o.has(i))}function v8(t,e){const n=new Set(t.marks().map(r=>r.type.name));return e.some(r=>n.has(r))}function y8(t,e){const{$cursor:n}=e,{validMarks:r,validNodes:o,invalidMarks:i,invalidNodes:s}=t;return!r&&!o&&ms(i)&&ms(s)?!0:!(r&&!sP(e,r)||o&&!bS(n,o)||!r&&e0(e,i)||!o&&bS(n,s))}function wS(t){const{suggesters:e,$pos:n,selectionEmpty:r}=t;for(const o of e)if(!(o.emptySelectionsOnly&&!r))try{const i=rP({suggester:o,$pos:n});if(!i)continue;const s={$from:n.doc.resolve(i.range.from),$to:n.doc.resolve(i.range.to),$cursor:n};if(y8(o,s)&&o.isValidPosition(s,i))return i}catch{}}function t0(t){return zL(t)?t.source:t}function x8(t){return t?"^":""}function b8(t,e){return`(?:${t0(t)}){${e},}`}function w8(t){return ge(t)?new RegExp(n8(t)):t}function k8(t){const{char:e,matchOffset:n,startOfLine:r,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=t,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=w8(e).source;return i&&(u=`(${u})`),new RegExp(`${x8(r)}${u}${b8(o,n)}`,c)}var S8={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},aP="__ignore_prosemirror_suggest_update__",lp,Yc,Dt,Oi,Qa,so,Pt,Ti,el,lP=class{constructor(t){$o(this,lp,!1),$o(this,Yc,!1),$o(this,Dt,void 0),$o(this,Oi,void 0),$o(this,Qa,void 0),$o(this,so,se()),$o(this,Pt,ze.empty),$o(this,Ti,!1),$o(this,el,!1),this.setMarkRemoved=()=>{nt(this,Ti,!0)},this.findNextTextSelection=n=>{const r=n.$from.doc,o=Math.min(r.nodeSize-2,n.to+1),i=r.resolve(o),s=Te.findFrom(i,1,!0);if(xS(s))return s},this.ignoreNextExit=()=>{nt(this,Yc,!0)},this.addIgnored=({from:n,name:r,specific:o=!1})=>{const i=Ee(this,Dt).find(u=>u.name===r);if(!i)throw new Error(`No suggester exists for the name provided: ${r}`);const s=ge(i.char)?i.char.length:1,a=n+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=ct.inline(n,a,{nodeName:i.ignoredTag,...l},{name:r,specific:o,char:i.char});nt(this,Pt,Ee(this,Pt).add(this.view.state.doc,[c]))},this.removeIgnored=({from:n,name:r})=>{const o=Ee(this,Dt).find(a=>a.name===r);if(!o)throw new Error(`No suggester exists for the name provided: ${r}`);const i=ge(o.char)?o.char.length:1,s=Ee(this,Pt).find(n,n+i)[0];!s||s.spec.name!==r||nt(this,Pt,Ee(this,Pt).remove([s]))},this.clearIgnored=n=>{if(!n){nt(this,Pt,ze.empty);return}const o=Ee(this,Pt).find().filter(({spec:i})=>i.name===n);nt(this,Pt,Ee(this,Pt).remove(o))},this.findMatchAtPosition=(n,r)=>{const o=r?Ee(this,Dt).filter(i=>i.name===r):Ee(this,Dt);return wS({suggesters:o,$pos:n,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{nt(this,el,!0)};const e=kS();nt(this,Dt,t.map(e)),nt(this,Dt,ma(Ee(this,Dt),(n,r)=>r.priority-n.priority))}static create(t){return new lP(t)}get decorationSet(){return Ee(this,Pt)}get removed(){return Ee(this,Ti)}get match(){return Ee(this,Oi)?Ee(this,Oi):Ee(this,Qa)&&Ee(this,so).exit?Ee(this,Qa):void 0}init(t){return this.view=t,this}createProps(t){const{name:e,char:n}=t.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:e,char:n,...t}}shouldRunExit(){return Ee(this,Yc)?(nt(this,Yc,!1),!1):!0}updateWithNextSelection(t){var e,n,r;const o=this.findNextTextSelection(t.selection);if(o)for(const i of Ee(this,Dt)){const s=(e=Ee(this,so).change)==null?void 0:e.suggester.name,a=(n=Ee(this,so).exit)==null?void 0:n.suggester.name;(r=i.checkNextValidSelection)==null||r.call(i,o.$from,t,{change:s,exit:a})}}changeHandler(t,e){const{change:n,exit:r}=Ee(this,so),o=this.match;if(!n&&!r||!yS(o))return;const i=e===(r==null?void 0:r.suggester.appendTransaction)&&this.shouldRunExit(),s=e===(n==null?void 0:n.suggester.appendTransaction);if(!(!i&&!s)){if(n&&r&&d8({change:n,exit:r})){const a=this.createProps(r),l=this.createProps(n),c=r.range.from<n.range.from;i&&r.suggester.onChange(a,t),s&&n.suggester.onChange(l,t),i&&nt(this,Ti,!1);return}n&&s&&n.suggester.onChange(this.createProps(n),t),r&&i&&(r.suggester.onChange(this.createProps(r),t),nt(this,Ti,!1),l8(r.exitReason)&&nt(this,so,se()))}}mapIgnoredDecorations(t){const e=Ee(this,Pt).map(t.mapping,t.doc),r=e.find().filter(({from:o,to:i,spec:s})=>{const a=ge(s.char)?s.char.length:1;return i-o!==a});nt(this,Pt,e.remove(r))}shouldIgnoreMatch({range:t,suggester:{name:e}}){return Ee(this,Pt).find().some(({spec:o,from:i})=>i!==t.from?!1:o.specific?o.name===e:!0)}resetState(){nt(this,so,se()),nt(this,Oi,void 0),nt(this,Ti,!1),nt(this,el,!1)}updateReasons(t){const{$pos:e,state:n}=t,r=Ee(this,lp),o=Ee(this,Dt),i=n.selection.empty,s=xS(n.selection)?wS({suggesters:o,$pos:e,docChanged:r,selectionEmpty:i}):void 0;nt(this,Oi,s&&this.shouldIgnoreMatch(s)?void 0:s),nt(this,so,g8({next:Ee(this,Oi),prev:Ee(this,Qa),state:n,$pos:e}))}addSuggester(t){const e=Ee(this,Dt).find(r=>r.name===t.name),n=kS();if(e)nt(this,Dt,Ee(this,Dt).map(r=>r===e?n(t):r));else{const r=[...Ee(this,Dt),n(t)];nt(this,Dt,ma(r,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(t.name)}removeSuggester(t){const e=ge(t)?t:t.name;nt(this,Dt,Ee(this,Dt).filter(n=>n.name!==e)),this.clearIgnored(e)}toJSON(){return this.match}apply(t){const{exit:e,change:n}=Ee(this,so);if(Ee(this,el)&&(nt(this,el,!1),!(e!=null&&e.suggester.appendTransaction)&&!(n!=null&&n.suggester.appendTransaction)))return this;const{tr:r,state:o}=t,i=r.docChanged||r.selectionSet;return r.getMeta(aP)||!i&&!Ee(this,Ti)?this:(nt(this,lp,r.docChanged),this.mapIgnoredDecorations(r),e&&this.resetState(),nt(this,Qa,Ee(this,Oi)),this.updateReasons({$pos:r.selection.$from,state:o}),this)}createDecorations(t){const e=this.match;if(!yS(e))return Ee(this,Pt);const{disableDecorations:n}=e.suggester;if(tt(n)?n(t,e):n)return Ee(this,Pt);const{range:o,suggester:i}=e,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(e)?Ee(this,Pt):Ee(this,Pt).add(t.doc,[ct.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},E8=lP;lp=new WeakMap;Yc=new WeakMap;Dt=new WeakMap;Oi=new WeakMap;Qa=new WeakMap;so=new WeakMap;Pt=new WeakMap;Ti=new WeakMap;el=new WeakMap;function kS(){const t=new Set;return e=>{if(t.has(e.name))throw new Error(`A suggester already exists with the name '${e.name}'. The name provided must be unique.`);const n={...S8,...e};return t.add(e.name),n}}var cP=new fc("suggest");function c1(t){return cP.getState(t)}function SS(t,e){return c1(t).addSuggester(e)}function ES(t){t.setMeta(aP,!0)}function _8(t,e){return c1(t).removeSuggester(e)}function C8(...t){const e=E8.create(t);return new pi({key:cP,view:n=>(e.init(n),{update:r=>e.changeHandler(r.state.tr,!1)}),state:{init:()=>e,apply:(n,r,o,i)=>e.apply({tr:n,state:i})},appendTransaction:(n,r,o)=>{const i=o.tr;return e.updateWithNextSelection(i),e.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(e.setLastChangeFromAppend(),i):null},props:{decorations:n=>e.createDecorations(n)}})}function u1(t,e){const n=Object.getPrototypeOf(e);let r=t.selection,o=t.doc,i=t.storedMarks;const s=se();for(const[a,l]of Object.entries(e))s[a]={value:l};return Object.create(n,{...s,storedMarks:{get(){return i}},selection:{get(){return r}},doc:{get(){return o}},tr:{get(){return r=t.selection,o=t.doc,i=t.storedMarks,t}}})}function $u(t){return({state:e,dispatch:n,view:r,tr:o})=>t(u1(o,e),n,r)}function _S(t){return e=>{var n;return de(e.dispatch===void 0||e.dispatch===((n=e.view)==null?void 0:n.dispatch),{code:B.NON_CHAINABLE_COMMAND}),t(e)}}function O8(...t){return({state:e,dispatch:n,view:r,tr:o,...i})=>{for(const s of t)if(s({state:e,dispatch:n,view:r,tr:o,...i}))return!0;return!1}}var Br={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return Br.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return Br.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return Br.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return Br.isNode?process.platform==="darwin":Br.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function wi(t,e){var n;const r=Q8(t);return((n=r==null?void 0:r.getComputedStyle(t))==null?void 0:n.getPropertyValue(e))??""}function on(t,e){return Object.assign(t.style,e)}function n0(t){return dn(t)&&tr(t.nodeType)&&ge(t.nodeName)}function So(t){return n0(t)&&t.nodeType===1}function d1(t){const{types:e,node:n}=t;if(!n)return!1;const r=o=>o===n.type||o===n.type.name;return At(e)?e.some(r):r(e)}function T8(t,e){const{tr:n}=e;return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Tm(t){const{predicate:e,selection:n}=t,r=dP(n)?n.selection.$from:h1(n)?n.$from:n;for(let o=r.depth;o>0;o--){const i=r.node(o),s=o>0?r.before(o):0,a=r.start(o),l=s+i.nodeSize;if(e(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function P8(t){const{depth:e}=t,n=e>0?t.before(e):0,r=t.node(e),o=t.start(e),i=n+r.nodeSize;return{pos:n,start:o,node:r,end:i,depth:e}}function bd(t){const{types:e,selection:n}=t;return Tm({predicate:r=>d1({types:e,node:r}),selection:n})}function M8(t){const{types:e,selection:n}=t;if(!(!Mm(n)||!d1({types:e,node:n.node})))return{pos:n.$from.pos,depth:n.$from.depth,start:n.$from.start(),end:n.$from.pos+n.node.nodeSize,node:n.node}}function f1(t){return h1(t)?t.empty:t.selection.empty}function N8(t){return t.docChanged||t.selectionSet}function R8(t){return!!wd(t)}function wd(t){const{state:e,type:n,attrs:r}=t,{selection:o,doc:i}=e,s=ge(n)?i.type.schema.nodes[n]:n;de(s,{code:B.SCHEMA,message:`No node exists for ${n}`});const a=M8({selection:o,types:n})??Tm({predicate:l=>l.type===s,selection:o});return!r||uh(r)||!a||a.node.hasMarkup(s,{...a.node.attrs,...r})?a:void 0}function _h(...t){return e=>{if(!yk(t))return!1;const[n,...r]=t;let o=!1;const i=(...l)=>()=>{if(!yk(l))return!1;o=!0;const[,...c]=l;return _h(...l)({...e,next:i(...c)})},s=i(...r),a=n({...e,next:s});return o||a?a:s()}}function $8(t,e){const n=new Map,r=se();for(const o of t)for(const[i,s]of $t(o)){const l=[...n.get(i)??[],s],c=_h(...l);n.set(i,l),r[i]=e(c)}return r}function A8(t){return $8(t,e=>(n,r,o)=>e({state:n,dispatch:r,view:o,tr:n.tr,next:()=>!1}))}function p1(t,e){const n=t.attrs??{};return Object.entries(e).every(([r,o])=>n[r]===o)}function I8(t){return pP(t,[qo,_t,Ft,Kr])}function pc(t){return dn(t)}function hc(t,e){return At(e)?to(e,t[ii]):e===t[ii]}function D8(t){return dn(t)&&t instanceof By}function L8(t,e){return ge(t)?ht(e.nodes,t):t}function uP(t){return dn(t)&&t instanceof Zd}function j8(t,e){return ge(t)?ht(e.marks,t):t}function Pm(t){return dn(t)&&t instanceof rs}function z8(t){return dn(t)&&t instanceof D}function F8(t){return dn(t)&&t instanceof Ae}function dP(t){return dn(t)&&t instanceof Ys}function Ma(t){return dn(t)&&t instanceof xe}function B8(t){return dn(t)&&t instanceof yn}function h1(t){return dn(t)&&t instanceof Te}function V8(t){return dn(t)&&t instanceof ql}function CS(t){const{trState:e,from:n,to:r,type:o,attrs:i={}}=t,{doc:s}=e,a=j8(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(n,r,a);let l=!1;return r>n&&s.nodesBetween(n,r,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:p1(d,i)),!l)),l}function Mm(t){return dn(t)&&t instanceof fe}function Ch(t){const{trState:e,type:n,attrs:r={},from:o,to:i}=t,{selection:s,doc:a,storedMarks:l}=e,c=ge(n)?a.type.schema.marks[n]:n;if(de(c,{code:B.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&CS({...t,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(d=>d.type!==n?!1:p1(d,r??{})):CS({...t,from:s.from,to:s.to})}function m1(t,e={}){const n=U8(t.type.schema);if(!n)return!1;const{ignoreAttributes:r,ignoreDocAttributes:o}=e;return r?fP(n,t):o?n.content.eq(t.content):n.eq(t)}function fP(t,e){if(t===e)return!0;const n=t.type===e.type&&Ae.sameSet(t.marks,e.marks);function r(){if(t.content===e.content)return!0;if(t.content.size!==e.content.size)return!1;const o=[],i=[];t.content.forEach(s=>o.push(s)),e.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!fP(a,l))return!1}return!0}return n&&r()}function U8(t){var e;return((e=t.nodes.doc)==null?void 0:e.createAndFill())??void 0}function Nm(t){for(const e of Object.values(t.nodes))if(e.name!=="doc"&&(e.isBlock||e.isTextblock))return e;de(!1,{code:B.SCHEMA,message:"No default block node found for the provided schema."})}function H8(t){return t.type===Nm(t.type.schema)}function g1(t){return!!t&&t.type.isBlock&&!t.textContent&&!t.childCount}function si(t,e,n){const r=t.parent.childAfter(t.parentOffset);if(!r.node)return;const o=ge(e)?e:e.name,i=r.node.marks.find(({type:d})=>d.name===o);let s=t.index(),a=t.start()+r.offset,l=s+1,c=a+r.node.nodeSize;if(!i)return n&&c<n.pos?si(t.doc.resolve(c+1),e,n):void 0;for(;s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&i.isInSet(t.parent.child(l).marks);)c+=t.parent.child(l).nodeSize,l+=1;const u=t.doc.textBetween(a,c,PT,`
|
|
148
|
-
|
|
149
|
-
`);return{from:a,to:c,text:u,mark:i}}function pP(t,e){return e.length===0||e.some(n=>t instanceof n)}function W8(t){return zT(t,({from:n,to:r,prevFrom:o,prevTo:i})=>`${n}_${r}_${o}_${i}`).filter((n,r,o)=>!o.some((i,s)=>r===s?!1:n.prevFrom>=i.prevFrom&&n.prevTo<=i.prevTo&&n.from>=i.from&&n.to<=i.to))}function K8(t,e=[]){const n=[],{steps:r,mapping:o}=t,i=o.invert();r.forEach((a,l)=>{if(!pP(a,e))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&I8(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);n.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ma(n,(a,l)=>a.from-l.from);return W8(s)}function q8(t){var e;return((e=t.content.firstChild)==null?void 0:e.textContent)??""}function G8(t,e){if(!Ma(t.selection))return;let{from:n,to:r}=t.selection;const o=(s,a)=>q8(xe.between(t.doc.resolve(s),t.doc.resolve(a)).content());for(let s=o(n-1,n);s&&!e.test(s);n--,s=o(n-1,n));for(let s=o(r,r+1);s&&!e.test(s);r++,s=o(r,r+1));if(n===r)return;const i=t.doc.textBetween(n,r,PT,`
|
|
150
|
-
|
|
151
|
-
`);return{from:n,to:r,text:i}}function hP(t){return G8(t,/\W/)}function Au(t,e=0){const n=At(t)?t[e]:t;return IT(ge(n),`No match string found for match ${t}`),n??""}function Y8(t){return Ma(t)?t.$cursor:void 0}function X8(t,e){return Pm(t)?e?t.type===e.nodes.doc:t.type.name==="doc":!1}function Z8(t){return dn(t)&&tr(t.anchor)&&tr(t.head)}function br(t,e){const n=e.nodeSize-2,r=0;let o;const i=l=>WL({min:r,max:n,value:l});if(h1(t))return t;if(t==="all")return new yn(e);if(t==="start"?o=r:t==="end"?o=n:V8(t)?o=t.pos:o=t,tr(o))return o=i(o),xe.near(e.resolve(o));if(Z8(o)){const l=i(o.anchor),c=i(o.head);return xe.between(e.resolve(l),e.resolve(c))}const s=i(o.from),a=i(o.to);return xe.between(e.resolve(s),e.resolve(a))}var J8=3;function mP(t){const{content:e,schema:n,document:r,stringHandler:o,onError:i,attempts:s=0}=t,a=i&&s<=J8||s===0;if(de(a,{code:B.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ge(e))return de(o,{code:B.INVALID_CONTENT,message:`The string '${e}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:r,content:e,schema:n});if(dP(e))return e.doc;if(Pm(e))return e;try{return n.nodeFromJSON(e)}catch(l){const c=i9({schema:n,error:l,json:e}),u=i==null?void 0:i(c);return de(u,{code:B.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),mP({...t,content:u,attempts:s+1})}}function Rm(){const t=x2();if(t)return t;throw new Error(`Unable to retrieve the document from the global scope.
|
|
152
|
-
It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work.
|
|
153
|
-
If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
|
|
154
|
-
If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
|
|
155
|
-
If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function gP(t){var e;return(t==null?void 0:t.defaultView)??(typeof window<"u"?window:void 0)??((e=x2())==null?void 0:e.defaultView)}function Q8(t){return gP(t==null?void 0:t.ownerDocument)}function e9(t){const e=gP(t)??Rm().defaultView;if(e)return e;throw new Error("Unable to retrieve the window from the global scope")}function t9(t,e=Rm()){const n=X8(t,t.type.schema)?t.content:D.from(t);return Wr.fromSchema(t.type.schema).serializeFragment(n,{document:e})}function n9(t,e){return new(e9(e)).DOMParser().parseFromString(`<body>${t}</body>`,"text/html").body}function r9(t,e=Rm()){const n=e.createElement("div");return n.append(t9(t,e)),n.innerHTML}function r0(t){const{content:e,schema:n,document:r,fragment:o=!1,...i}=t,s=n9(e,r),a=Gl.fromSchema(n);return o?a.parseSlice(s,{...OS,...i}).content:a.parse(s,{...OS,...i})}var OS={preserveWhitespace:!1};function vP(t,e){const n=pd(e.defaults());return Kx({...t},n)}var o9={remove(t,e){let n=t;for(const r of e)r.invalidParentNode||(n=GL(r.path,n));return n}};function i9({json:t,schema:e,...n}){const r=new Set(pd(e.marks)),o=new Set(pd(e.nodes)),i=yP({json:t,path:[],validNodes:o,validMarks:r});return{json:t,invalidContent:i,transformers:o9,...n}}function yP(t){const{json:e,validMarks:n,validNodes:r,path:o=[]}=t,i={validMarks:n,validNodes:r},s=[],{type:a,marks:l,content:c}=e;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=t;if(l){const f=[];for(const[p,h]of l.entries()){const g=ge(h)?h:h.type;n.has(g)||(f.unshift({name:g,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(r.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...yP({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function s9(t){return!!(Ma(t)&&t.$cursor&&t.$cursor.parentOffset>=t.$cursor.parent.content.size)}function o0(t){return!!(Ma(t)&&t.$cursor&&t.$cursor.parentOffset<=0)}function TS(t){const e=Te.atStart(t.$anchor.doc);return!!(o0(t)&&e.anchor===t.anchor)}function a9(t){return({dispatch:e,tr:n})=>{const{type:r,attrs:o=se(),appendText:i,range:s}=t,a=s?xe.between(n.doc.resolve(s.from),n.doc.resolve(s.to)):n.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?n.doc.type.allowsMarkType(r):!1;return n.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(r)){d=!0;return}}),d?(e==null||e(n.addMark(c,u,r.create(o))&&i?n.insertText(i):n),!0):!1}}function l9({tr:t,dispatch:e}){const{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&dc(o);return!tr(i)||!o?!1:(e==null||e(t.lift(o,i).scrollIntoView()),!0)}function xP(t,e={},n){return function(r){const{tr:o,dispatch:i,state:s}=r,a=ge(t)?ht(s.schema.nodes,t):t,{from:l,to:c}=br(n??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Yx(f,a,e);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function c9(t,e={},n){return r=>{const{tr:o,state:i}=r,s=ge(t)?ht(i.schema.nodes,t):t;return wd({state:o,type:s,attrs:e})?l9(r):xP(t,e,n)(r)}}function Oh(t,e,n,r=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ge(t)?ht(a.schema.nodes,t):t,{from:c,to:u}=br(n??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,e))return;if(p.type===l){d=!0,f=p.attrs;return}const g=i.doc.resolve(h),x=g.index();d=g.parent.canReplaceWith(x,x+1,l),d&&(f=g.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...r?f:{},...e}).scrollIntoView()),!0):!1}}function bP(t){return e=>{const{tr:n,state:r}=e,{type:o,attrs:i,preserveAttrs:s=!0}=t,a=wd({state:n,type:o,attrs:i}),l=t.toggleType??Nm(r.schema);if(a)return Oh(l,{...s?a.node.attrs:{},...i})(e);const c=wd({state:n,type:l,attrs:i});return Oh(o,{...s?c==null?void 0:c.node.attrs:{},...i})(e)}}function u9(t=0){const e=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return e?Number.parseInt(ht(e,2),10)>=t:!1}function d9(t,e){let{head:n,empty:r,anchor:o}=t;for(const i of e.steps)n=i.getMap().map(n);r?e.setSelection(xe.near(e.doc.resolve(n))):e.setSelection(xe.between(e.doc.resolve(o),e.doc.resolve(n)))}function f9(t){const{attrs:e={},appendText:n="",content:r="",keepSelection:o=!1,range:i}=t;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=br(t.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:g}=d,x=ge(t.type)?u.nodes[t.type]??u.marks[t.type]:t.type;if(de(ge(t.type)?x:!0,{code:B.SCHEMA,message:`Schema contains no marks or nodes with name ${x}`}),D8(x)){if(!g.parent.canReplaceWith(f,f,x))return!1;a.replaceWith(p,h,x.create(e,r?u.text(r):void 0))}else de(r,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(r,uP(x)?[x.create(e)]:void 0));return n&&a.insertText(n),o&&d9(s.selection,a),l&&(u9(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function wP(t,e){const n=t.parent.childAfter(t.parentOffset);if(!n.node)return;const{marks:r,nodeSize:o}=n.node;if(r[0])return r[0].type;const s=t.start()+n.offset+o;return wP(t.doc.resolve(s+1))}function kP(t){return({dispatch:e,tr:n,state:r})=>{const{type:o,expand:i=!0,range:s}=t,a=br(t.selection??s??n.selection,n.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ge(o)?r.schema.marks[o]:o;f!==null&&de(f,{code:B.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??wP(u);if(!p)return!1;const h=si(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),n.doc.nodeSize-2)),e==null||e(n.removeMark(l,tr(c)?c:l,uP(f)?f:void 0)),!0}}function Th(t){const{regexp:e,type:n,getAttributes:r,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=t;let c;const u=new Cr(e,(d,f,p,h)=>{const{tr:g,schema:x}=d;c||(c=ge(n)?x.marks[n]:n,de(c,{code:B.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let v=f[1],y=f[0];const w=p9({captureGroup:v,fullMatch:y,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!w)return null;({start:p,end:h,captureGroup:v,fullMatch:y}=w);const k=tt(r)?r(f):r;let E=h,O=[];if(v){const S=y.search(/\S/),P=p+y.indexOf(v),M=P+v.length;O=g.storedMarks??[],M<h&&g.delete(M,h),P>p&&g.delete(p+S,P),E=p+S+v.length}return g.addMark(p,E,c.create(k)),g.setStoredMarks(O),i==null||i({tr:g,match:f,start:p,end:h}),g});return u}function p9({captureGroup:t,fullMatch:e,end:n,start:r,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(e==null)return null;const d=(a==null?void 0:a({captureGroup:t,fullMatch:e,start:r,end:n}))??{};t=d.captureGroup??t,e=d.fullMatch??e,r=d.start??r,n=d.end??n;const f=l.doc.resolve(r),p=l.doc.resolve(n);return c&&e0({$from:f,$to:p},c)||o.invalidMarks&&e0({$from:f,$to:p},o.invalidMarks)||i&&(t==null?void 0:t.trim())===""||s!=null&&s({state:l,captureGroup:t,fullMatch:e,start:r,end:n,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:t,fullMatch:e,start:r,end:n,ruleType:"mark"})?null:{captureGroup:t,end:n,fullMatch:e,start:r}}var h9=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];e.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const o=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(n[i]);return o.push(...r),o.join(" ")},m9=h9;const SP=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function g9(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const EP=(t,e,n)=>{let r=g9(t,n);if(!r)return!1;let o=_P(r);if(!o){let s=r.blockRange(),a=s&&dc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&TP(t,o,e))return!0;if(r.parent.content.size==0&&(Jl(i,"end")||fe.isSelectable(i))){let s=Xx(t.doc,r.before(),r.after(),G.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Jl(i,"end")?Te.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):fe.create(a.doc,o.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function Jl(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 v9=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=_P(r)}let s=i&&i.nodeBefore;return!s||!fe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(fe.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function _P(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 y9(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const x9=(t,e,n)=>{let r=y9(t,n);if(!r)return!1;let o=CP(r);if(!o)return!1;let i=o.nodeAfter;if(TP(t,o,e))return!0;if(r.parent.content.size==0&&(Jl(i,"start")||fe.isSelectable(i))){let s=Xx(t.doc,r.before(),r.after(),G.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Jl(i,"start")?Te.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):fe.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},b9=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=CP(r)}let s=i&&i.nodeAfter;return!s||!fe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(fe.create(t.doc,i.pos)).scrollIntoView()),!0)};function CP(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const w9=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
156
|
-
`).scrollIntoView()),!0)};function v1(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const OP=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=v1(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Te.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},k9=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof yn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=v1(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(xe.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},S9=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Nl(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&dc(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function E9(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof fe&&e.selection.node.isBlock)return!r.parentOffset||!Nl(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof xe||e.selection instanceof yn)&&s.deleteSelection();let a=r.depth==0?null:v1(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=t&&t(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=Nl(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&Nl(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const _9=E9(),C9=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(fe.create(t.doc,o))),!0)},O9=(t,e)=>(e&&e(t.tr.setSelection(new yn(t.doc))),!0);function T9(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Jd(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function TP(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(T9(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let d=e.pos+o.nodeSize,f=D.empty;for(let g=i.length-1;g>=0;g--)f=D.from(i[g].create(null,f));f=D.from(r.copy(f));let p=t.tr.step(new _t(e.pos-1,d,e.pos,d,new G(f,1,0),i.length,!0)),h=d+2*i.length;Jd(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let l=Te.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&dc(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&Jl(o,"start",!0)&&Jl(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(n){let g=D.empty;for(let v=f.length-1;v>=0;v--)g=D.from(f[v].copy(g));let x=t.tr.step(new _t(e.pos-f.length,e.pos+o.nodeSize,e.pos+h,e.pos+o.nodeSize-h,new G(g,f.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function PP(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(xe.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const P9=PP(-1),M9=PP(1);function N9(t,e,n){for(let r=0;r<e.length;r++){let{$from:o,$to:i}=e[r],s=o.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(o.pos,i.pos,a=>{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(n)}),s)return!0}return!1}function R9(t,e=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!N9(n.doc,s,t))return!1;if(r)if(i)t.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let a=!1,l=n.tr;for(let c=0;!a&&c<s.length;c++){let{$from:u,$to:d}=s[c];a=n.doc.rangeHasMark(u.pos,d.pos,t)}for(let c=0;c<s.length;c++){let{$from:u,$to:d}=s[c];if(a)l.removeMark(u.pos,d.pos,t);else{let f=u.pos,p=d.pos,h=u.nodeAfter,g=d.nodeBefore,x=h&&h.isText?/^\s*/.exec(h.text)[0].length:0,v=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;f+x<p&&(f+=x,p-=v),l.addMark(f,p,t.create(e))}}r(l.scrollIntoView())}return!0}}function $m(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Jg=$m(SP,EP,v9),PS=$m(SP,x9,b9);const Ho={Enter:$m(w9,k9,S9,_9),"Mod-Enter":OP,Backspace:Jg,"Mod-Backspace":Jg,"Shift-Backspace":Jg,Delete:PS,"Mod-Delete":PS,"Mod-a":O9},MP={"Ctrl-h":Ho.Backspace,"Alt-Backspace":Ho["Mod-Backspace"],"Ctrl-d":Ho.Delete,"Ctrl-Alt-Backspace":Ho["Mod-Delete"],"Alt-Delete":Ho["Mod-Delete"],"Alt-d":Ho["Mod-Delete"],"Ctrl-a":P9,"Ctrl-e":M9};for(let t in Ho)MP[t]=Ho[t];const $9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,Qg=$9?MP:Ho;var vs={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:"'"},Ph={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},A9=typeof navigator<"u"&&/Mac/.test(navigator.platform),I9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)vs[48+Yt]=vs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)vs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)vs[Yt]=String.fromCharCode(Yt+32),Ph[Yt]=String.fromCharCode(Yt);for(var ev in vs)Ph.hasOwnProperty(ev)||(Ph[ev]=vs[ev]);function D9(t){var e=A9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||I9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ph:vs)[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 L9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function j9(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))L9?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function z9(t){let e=Object.create(null);for(let n in t)e[j9(n)]=t[n];return e}function tv(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function NP(t){let e=z9(t);return function(n,r){let o=D9(r),i,s=e[tv(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[tv(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=vs[r.keyCode])&&i!=o){let a=e[tv(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function F9(t){const e=ma(t,(i,s)=>(s.priority??qe.Low)-(i.priority??qe.Low)),n=[],r=[];for(const i of e)q9(i)?n.push(i):r.push(i);let o;return new pi({key:B9,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of n){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(y=>d.has(y)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,g=Sm(p,f.regexp)[0];if(h&&g&&f.type==="mark"&&f.replaceSelection){const{from:y,to:w}=o.state.selection,k=o.state.doc.slice(y,w),E=k.content.textBetween(0,k.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(E):f.replaceSelection){const O=[],{getAttributes:S,markType:P}=f,M=tt(S)?S(g,!0):S,$=P.create(M);return k.content.forEach(V=>{if(V.isText){const j=$.addToSet(V.marks);O.push(V.mark(j))}}),G.maxOpen(D.fromArray(O))}}const{nodes:x,transformed:v}=W9(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new G(D.fromArray(x),0,0):new G(D.fromArray(x),i.openStart,i.openEnd))}return Z9(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of r){const g=h?d.filter(x=>h.test(x.type)):d;if(g.length!==0&&p({event:c,files:g,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=X9(u);if(h.length===0)return!1;const g=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:x,regexp:v}of r){const y=v?h.filter(w=>v.test(w.type)):h;if(y.length!==0&&x({event:u,files:y,pos:g,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var B9=new fc("pasteRule");function nv(t,e){return function n(r){const{fragment:o,rule:i,nodes:s}=r,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||G9(f)){s.push(f);return}if(!f.isText){const g=n({fragment:f.content,rule:i,nodes:[]});d||(d=g.transformed);const x=D.fromArray(g.nodes);f.type.validContent(x)?s.push(f.copy(x)):s.push(...g.nodes);return}if(f.marks.some(g=>Y9(g)||(c==null?void 0:c.includes(g.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const g of Sm(p,a)){const x=g[1],v=g[0];if(l&&(x==null?void 0:x.trim())===""||!v)return;const y=g.index,w=y+v.length;y>h&&s.push(f.cut(h,y));let k=f.cut(y,w);if(v&&x){const E=v.search(/\S/),O=y+v.indexOf(x),S=O+x.length;E&&s.push(f.cut(y,y+E)),k=f.cut(O,S)}t({nodes:s,rule:i,textNode:k,match:g,schema:e}),d=!0,h=w}p&&h<p.length&&s.push(f.cut(h))}),{nodes:s,transformed:d}}}function V9(t){const{nodes:e,rule:n,textNode:r,match:o,schema:i}=t,{transformMatch:s,getAttributes:a,markType:l}=n,c=tt(a)?a(o,!1):a,u=r.text??"",d=l.create(c),f=s==null?void 0:s(o);if(f==="")return;if(f===!1){e.push(i.text(u,r.marks));return}const p=d.addToSet(r.marks);e.push(i.text(f??u,p))}function U9(t){const{nodes:e,rule:n,textNode:r,match:o,schema:i}=t,{transformMatch:s}=n,a=s==null?void 0:s(o);if(a===""||a===!1)return;const l=a??r.text??"";e.push(i.text(l,r.marks))}function H9(t){const{nodes:e,rule:n,textNode:r,match:o}=t,{getAttributes:i,nodeType:s,getContent:a}=n,l=tt(i)?i(o,!1):i,c=(a?a(o):r)||void 0;e.push(s.createChecked(l,c))}function W9(t,e,n){const r=[];switch(e.type){case"mark":return nv(V9,n)({fragment:t,nodes:r,rule:e});case"node":return nv(H9,n)({fragment:t,nodes:r,rule:e});default:return nv(U9,n)({fragment:t,nodes:r,rule:e})}}var K9=["mark","node","text"];function q9(t){return to(K9,t.type)}function G9(t){var e;return t.type.spec.code||((e=t.type.spec.group)==null?void 0:e.split(" ").includes("code"))}function Y9(t){var e;return t.type.name==="code"||((e=t.type.spec.group)==null?void 0:e.split(" ").includes("code"))}function X9(t){var e,n;const{dataTransfer:r}=t;return r?((e=r.files)==null?void 0:e.length)>0?[...r.files]:(n=r.items)!=null&&n.length?[...r.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function Z9(t){const e=G.maxOpen(t.content);return e.openStart<t.openStart||e.openEnd<t.openEnd?e:t}var J9=Object.defineProperty,Q9=Object.getOwnPropertyDescriptor,re=(t,e,n,r)=>{for(var o=r>1?void 0:r?Q9(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&J9(e,n,o),o},RP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Y=(t,e,n)=>(RP(t,e,"read from private field"),n?n.call(t):e.get(t)),Ct=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},jt=(t,e,n,r)=>(RP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function ez(t,e){return t===e}function MS(t){const{previousOptions:e,update:n,equals:r=ez}=t,o=Gs({...e,...n}),i=se(),s=pd(e);for(const l of s){const c=e[l],u=o[l];if(r(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=se();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Gs(i),options:o,pickChanged:a}}var tz={[B.DUPLICATE_HELPER_NAMES]:"helper method",[B.DUPLICATE_COMMAND_NAMES]:"command method"};function $P(t){const{name:e,set:n,code:r}=t,o=tz[r];de(!n.has(e),{code:r,message:`There is a naming conflict for the name: ${e} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(e)}function i0(...t){return hd(m9(...t).split(" ")).join(" ")}var NS="__IGNORE__",nz="__ALL__",mc=class{constructor(t,...[e]){this["~O"]={},this._mappedHandlers=se(),this.populateMappedHandlers(),this._options=this._initialOptions=HL(t,this.constructor.defaultOptions,e??se(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const t=[],{customHandlerKeys:e,handlerKeys:n,staticKeys:r}=this.constructor;for(const o of pd(this._options))r.includes(o)||n.includes(o)||e.includes(o)||t.push(o);return t}ensureAllKeysAreDynamic(t){}setOptions(t){var e;const n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(t);const{changes:r,options:o,pickChanged:i}=MS({previousOptions:n,update:t});this.updateDynamicOptions(o),(e=this.onSetOptions)==null||e.call(this,{reason:"set",changes:r,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var t;const e=this.getDynamicOptions(),{changes:n,options:r,pickChanged:o}=MS({previousOptions:e,update:this._initialOptions});this.updateDynamicOptions(r),(t=this.onSetOptions)==null||t.call(this,{reason:"reset",options:r,changes:n,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return Kx(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(t){this._options={...this._options,...t}}populateMappedHandlers(){for(const t of this.constructor.handlerKeys)this._mappedHandlers[t]=[]}createDefaultHandlerOptions(){const t=se();for(const e of this.constructor.handlerKeys)t[e]=(...n)=>{var r;const{handlerKeyOptions:o}=this.constructor,i=(r=o[e])==null?void 0:r.reducer;let s=i==null?void 0:i.getDefault(...n);for(const[,a]of this._mappedHandlers[e]){const l=a(...n);if(s=i?i.accumulator(s,l,...n):l,rz(o,s,e))return s}return s};return t}addHandler(t,e,n=qe.Default){return this._mappedHandlers[t].push([n,e]),this.sortHandlers(t),()=>this._mappedHandlers[t]=this._mappedHandlers[t].filter(([,r])=>r!==e)}hasHandlers(t){return(this._mappedHandlers[t]??[]).length>0}sortHandlers(t){this._mappedHandlers[t]=ma(this._mappedHandlers[t],([e],[n])=>n-e)}addCustomHandler(t,e){var n;return((n=this.onAddCustomHandler)==null?void 0:n.call(this,{[t]:e}))??jT}};mc.defaultOptions={};mc.staticKeys=[];mc.handlerKeys=[];mc.handlerKeyOptions={};mc.customHandlerKeys=[];function rz(t,e,n){const{[nz]:r}=t,o=t[n];return!r&&!o?!1:!!(o&&o.earlyReturnValue!==NS&&(tt(o.earlyReturnValue)?o.earlyReturnValue(e)===!0:e===o.earlyReturnValue)||r&&r.earlyReturnValue!==NS&&(tt(r.earlyReturnValue)?r.earlyReturnValue(e)===!0:e===r.earlyReturnValue))}var Am=class extends mc{constructor(...t){super(oz,...t),this["~E"]={},this._extensions=zT(this.createExtensions(),e=>e.constructor),this.extensionMap=new Map;for(const e of this._extensions)this.extensionMap.set(e.constructor,e)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${AT(this.name)}Extension`}get store(){return de(this._store,{code:B.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Gs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(t,e){this.extensionMap.has(t)&&(this.extensionMap.set(t,e),this._extensions=this.extensions.map(n=>e.constructor===t?e:n))}createExtensions(){return[]}getExtension(t){const e=this.extensionMap.get(t);return de(e,{code:B.INVALID_GET_EXTENSION,message:`'${t.name}' does not exist within the preset: '${this.name}'`}),e}isOfType(t){return this.constructor===t}setStore(t){this._store||(this._store=t)}clone(...t){return new this.constructor(...t)}setPriority(t){this.priorityOverride=t}};Am.defaultPriority=qe.Default;var ut=class extends Am{static get[ii](){return Ht.PlainExtensionConstructor}get[ii](){return Ht.PlainExtension}},tf=class extends Am{static get[ii](){return Ht.MarkExtensionConstructor}get[ii](){return Ht.MarkExtension}get type(){return ht(this.store.schema.marks,this.name)}constructor(...t){super(...t)}};tf.disableExtraAttributes=!1;var Or=class extends Am{static get[ii](){return Ht.NodeExtensionConstructor}get[ii](){return Ht.NodeExtension}get type(){return ht(this.store.schema.nodes,this.name)}constructor(...t){super(...t)}};Or.disableExtraAttributes=!1;var oz={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function AP(t){return pc(t)&&hc(t,[Ht.PlainExtension,Ht.MarkExtension,Ht.NodeExtension])}function iz(t){return pc(t)&&hc(t,[Ht.PlainExtensionConstructor,Ht.MarkExtensionConstructor,Ht.NodeExtensionConstructor])}function IP(t){return pc(t)&&hc(t,Ht.PlainExtension)}function nf(t){return pc(t)&&hc(t,Ht.NodeExtension)}function Im(t){return pc(t)&&hc(t,Ht.MarkExtension)}function Le(t){return e=>{const{defaultOptions:n,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=t,c=e;n&&(c.defaultOptions=n),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=r??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var sz=class extends ut{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=se(),this.updateAttributes=(t=!0)=>{this.transformAttributes(),t&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var t,e,n;if(this.attributeObject=se(),(t=this.store.managerSettings.exclude)!=null&&t.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const r of this.store.extensions){if((e=r.options.exclude)!=null&&e.attributes)continue;const o=(n=r.createAttributes)==null?void 0:n.call(r),i={...o,class:i0(...r.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const r of this.attributeList)this.attributeObject={...this.attributeObject,...r,class:i0(this.attributeObject.class,r.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function bt(t={}){return(e,n,r)=>{(e.decoratedHelpers??(e.decoratedHelpers={}))[n]=t}}function oe(t={}){return(e,n,r)=>{(e.decoratedCommands??(e.decoratedCommands={}))[n]=t}}function ar(t){return(e,n,r)=>{(e.decoratedKeybindings??(e.decoratedKeybindings={}))[n]=t}}var az=class{constructor(t){this.promiseCreator=t,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>e=>{let n=!0;const{view:r,tr:o,dispatch:i}=e;if(!r)return!1;for(const a of this.validateHandlers)if(!a({...e,dispatch:()=>{}})){n=!1;break}return!i||!n?n:(this.promiseCreator(e).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),i(o),!0)}}validate(t,e="push"){return this.validateHandlers[e](t),this}success(t,e="push"){return this.successHandlers[e](t),this}failure(t,e="push"){return this.failureHandlers[e](t),this}runHandlers(t,e){var n;for(const r of t)if(!r({...e,dispatch:()=>{}}))break;(n=e.dispatch)==null||n.call(e,e.tr)}};function kd(t){const{type:e,attrs:n,range:r,selection:o}=t;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ge(e)?l.schema.marks[e]:e;if(de(c,{code:B.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),r||o){const{from:u,to:d}=br(o??r??a.selection,a.doc);return Ch({trState:a,type:e,...r})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(n))),!0}return $u(R9(c,n))(i)}}function lz(t,e,n){for(const{$from:r,$to:o}of n){let i=r.depth===0?e.type.allowsMarkType(t):!1;if(e.nodesBetween(r.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(t)}),i)return!0}return!1}function cz(t,e,n){return({tr:r,dispatch:o,state:i})=>{const s=br(n??r.selection,r.doc),a=Y8(s),l=ge(t)?i.schema.marks[t]:t;if(de(l,{code:B.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),s.empty&&!a||!lz(l,r.doc,s.ranges))return!1;if(!o)return!0;if(a)return r.removeStoredMark(l),e&&r.addStoredMark(l.create(e)),o(r),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=r.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&r.removeMark(u.pos,d.pos,l),e&&r.addMark(u.pos,d.pos,l.create(e));return o(r),!0}}function uz(t,e={}){return({tr:n,dispatch:r,state:o})=>{const i=o.schema,s=n.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=e;if(!r)return!0;n.insertText(t,a,l);const u=ht(n.steps,n.steps.length-1).getMap().map(l);for(const[d,f]of $t(c))n.addMark(a,u,ht(i.marks,d).create(f));return r(n),!0}}var Me=class extends ut{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(t,...e)=>{const{forcedUpdates:n}=this.getCommandMeta(t);return this.setCommandMeta(t,{forcedUpdates:hd([...n,...e])}),t}}get name(){return"commands"}get transaction(){const t=this.store.getState();this._transaction||(this._transaction=t.tr);const e=this._transaction.before.eq(t.doc),n=!ms(this._transaction.steps);if(!e){const r=t.tr;if(n)for(const o of this._transaction.steps)r.step(o);this._transaction=r}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(t){var e;const{extensions:n,helpers:r}=this.store,o=se(),i=new Set;let s=se();const a=c=>{var u;const d=se(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[x,v]of Object.entries(o))(u=s[x])!=null&&u.disableChaining||(d[x]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const g=x=>{de(x===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(x={})=>{const v=p;p=[];for(const y of v)if(!y(g)&&x.exitEarly)return;t.dispatch(f())},d.tr=()=>{const x=p;p=[];for(const v of x)v(g);return f()},d.enabled=()=>{for(const x of p)if(!x())return!1;return!0},d.new=x=>a(x),d};for(const c of n){const u=((e=c.createCommands)==null?void 0:e.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const g=ge(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...g}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var x;return((x=h.active)==null?void 0:x.call(h,c.options,this.store))??!1})}uh(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:t}){this._transaction=t.tr}createPlugin(){return{}}customDispatch(t){return t}insertText(t,e={}){return ge(t)?uz(t,e):this.store.createPlaceholderCommand({promise:t,placeholder:{type:"inline"},onSuccess:(n,r,o)=>this.insertText(n,{...e,...r})(o)}).generateCommand()}selectText(t,e={}){return({tr:n,dispatch:r})=>{const o=br(t,n.doc);return n.selection.anchor===o.anchor&&n.selection.head===o.head&&!e.forceUpdate?!1:(r==null||r(n.setSelection(o)),!0)}}selectMark(t){return e=>{const{tr:n}=e,r=si(n.selection.$from,t);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(e):!1}}delete(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=t??e.selection;return n==null||n(e.delete(r,o)),!0}}emptyUpdate(t){return({tr:e,dispatch:n})=>(n&&(t==null||t(),n(e)),!0)}forceUpdate(...t){return({tr:e,dispatch:n})=>(n==null||n(this.forceUpdateTransaction(e,...t)),!0)}updateNodeAttributes(t,e){return({tr:n,dispatch:r})=>(r==null||r(n.setNodeMarkup(t,void 0,e)),!0)}setContent(t,e){return n=>{const{tr:r,dispatch:o}=n,i=this.store.manager.createState({content:t,selection:e});return i?(o==null||o(r.replaceRangeWith(0,r.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return t=>{const{tr:e,dispatch:n}=t,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(t):(n==null||n(e.delete(0,e.doc.nodeSize)),!0)}}emptySelection(){return({tr:t,dispatch:e})=>t.selection.empty?!1:(e==null||e(t.setSelection(xe.near(t.selection.$anchor))),!0)}insertNewLine(){return({dispatch:t,tr:e})=>Ma(e.selection)?(t==null||t(e.insertText(`
|
|
157
|
-
`)),!0):!1}insertNode(t,e={}){return({dispatch:n,tr:r,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=e,{from:u,to:d,$from:f}=br(l??a??r.selection,r.doc);if(Pm(t)||z8(t)){const v=f.before(f.depth);return n==null||n(c&&u===d&&g1(f.parent)?r.replaceWith(v,v+f.parent.nodeSize,t):r.replaceWith(u,d,t)),!0}const p=ge(t)?o.schema.nodes[t]:t;de(p,{code:B.SCHEMA,message:`The requested node type ${t} does not exist in the schema.`});const h=(i=e.marks)==null?void 0:i.map(v=>{if(v instanceof Ae)return v;const y=ge(v)?o.schema.marks[v]:v;return de(y,{code:B.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),y.create()}),g=p.createAndFill(s,ge(e.content)?o.schema.text(e.content):e.content,h);if(!g)return!1;const x=u!==d;return n==null||n(x?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(t){return e=>{const{dispatch:n,tr:r}=e,{view:o}=this.store;if(t===!1||o.hasFocus()&&(t===void 0||t===!0))return!1;if(t===void 0||t===!0){const{from:i=0,to:s=i}=r.selection;t={from:i,to:s}}return n&&this.delayedFocus(),this.selectText(t)(e)}}blur(t){return e=>{const{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),t?this.selectText(t)(e):!0):!1}}setBlockNodeType(t,e,n,r=!0){return Oh(t,e,n,r)}toggleWrappingNode(t,e,n){return c9(t,e,n)}toggleBlockNodeItem(t){return bP(t)}wrapInNode(t,e,n){return xP(t,e,n)}applyMark(t,e,n){return cz(t,e,n)}toggleMark(t){return kd(t)}removeMark(t){return kP(t)}setMeta(t,e){return({tr:n})=>(n.setMeta(t,e),!0)}selectAll(){return this.selectText("all")}copy(){return t=>t.tr.selection.empty?!1:(t.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var t;return(t=navigator.clipboard)!=null&&t.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(t,e,n)=>this.insertNode(r0({content:t,schema:n.state.schema}),{selection:e})(n)}).generateCommand()}cut(){return t=>t.tr.selection.empty?!1:(t.dispatch&&document.execCommand("cut"),!0)}replaceText(t){return f9(t)}getAllCommandOptions(){const t={};for(const[e,n]of this.decorated)uh(n)||(t[e]=n);return t}getCommandOptions(t){return this.decorated.get(t)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(t,e){if(!e){this.decorated.delete(t);return}const n=this.decorated.get(t)??{name:""};this.decorated.set(t,{...n,...e})}handleIosFocus(){Br.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(t){return this.getCommandMeta(t).forcedUpdates}getCommandMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...dz,...e}}setCommandMeta(t,e){const n=this.getCommandMeta(t);t.setMeta(this.pluginKey,{...n,...e})}addCommands(t){const{extensionCommands:e,commands:n,names:r,active:o}=t;for(const[i,s]of $t(e))$P({name:i,set:r,code:B.DUPLICATE_COMMAND_NAMES}),de(!fz.has(i),{code:B.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),n[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(t){return(...e)=>{const{shouldDispatch:n=!0,command:r}=t,{view:o}=this.store,{state:i}=o;let s;return n&&(s=o.dispatch),r(...e)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(t,e){const n=this.unchainedFactory({command:t});return n.enabled=this.unchainedFactory({command:t,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=t,n.active=e,n}chainedFactory(t){return(...e)=>{const{chain:n,command:r,getTr:o,getChain:i}=t,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>r(...e)({state:l,dispatch:c,view:a,tr:o()})),n}}};re([oe()],Me.prototype,"customDispatch",1);re([oe()],Me.prototype,"insertText",1);re([oe()],Me.prototype,"selectText",1);re([oe()],Me.prototype,"selectMark",1);re([oe()],Me.prototype,"delete",1);re([oe()],Me.prototype,"emptyUpdate",1);re([oe()],Me.prototype,"forceUpdate",1);re([oe()],Me.prototype,"updateNodeAttributes",1);re([oe()],Me.prototype,"setContent",1);re([oe()],Me.prototype,"resetContent",1);re([oe()],Me.prototype,"emptySelection",1);re([oe()],Me.prototype,"insertNewLine",1);re([oe()],Me.prototype,"insertNode",1);re([oe()],Me.prototype,"focus",1);re([oe()],Me.prototype,"blur",1);re([oe()],Me.prototype,"setBlockNodeType",1);re([oe()],Me.prototype,"toggleWrappingNode",1);re([oe()],Me.prototype,"toggleBlockNodeItem",1);re([oe()],Me.prototype,"wrapInNode",1);re([oe()],Me.prototype,"applyMark",1);re([oe()],Me.prototype,"toggleMark",1);re([oe()],Me.prototype,"removeMark",1);re([oe()],Me.prototype,"setMeta",1);re([oe({description:({t})=>t(gs.SELECT_ALL_DESCRIPTION),label:({t})=>t(gs.SELECT_ALL_LABEL),shortcut:U.SelectAll})],Me.prototype,"selectAll",1);re([oe({description:({t})=>t(gs.COPY_DESCRIPTION),label:({t})=>t(gs.COPY_LABEL),shortcut:U.Copy,icon:"fileCopyLine"})],Me.prototype,"copy",1);re([oe({description:({t})=>t(gs.PASTE_DESCRIPTION),label:({t})=>t(gs.PASTE_LABEL),shortcut:U.Paste,icon:"clipboardLine"})],Me.prototype,"paste",1);re([oe({description:({t})=>t(gs.CUT_DESCRIPTION),label:({t})=>t(gs.CUT_LABEL),shortcut:U.Cut,icon:"scissorsFill"})],Me.prototype,"cut",1);re([oe()],Me.prototype,"replaceText",1);re([bt()],Me.prototype,"getAllCommandOptions",1);re([bt()],Me.prototype,"getCommandOptions",1);re([bt()],Me.prototype,"getCommandProp",1);Me=re([Le({defaultPriority:qe.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],Me);var dz={forcedUpdates:[]},fz=new Set(["run","chain","original","raw","enabled","tr","new"]),ro=class extends ut{constructor(){super(...arguments),this.placeholders=ze.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=t=>{const e=fh(),{promise:n,placeholder:r,onFailure:o,onSuccess:i}=t;return new az(n).validate(s=>this.addPlaceholder(e,r)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(e);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(e)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(e)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:t=>{var e,n,r,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(t);if(l){this.placeholders=ze.empty;for(const[,d]of this.placeholderWidgets)(n=(e=d.spec).onDestroy)==null||n.call(e,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(t.mapping,t.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(r=d.spec).onUpdate)==null||o.call(r,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,t);continue}if(d.type==="node"){this.addNodePlaceholder(d,t);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,t);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=ct.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(t.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Ua),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:t=>{let e=this.options.decorations(t);e=e.add(t.doc,this.placeholders.find());for(const n of this.store.extensions){if(!n.createDecorations)continue;const r=n.createDecorations(t).find();e=e.add(t.doc,r)}return e},handleDOMEvents:{blur:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(RS,!1)),!1),focus:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(RS,!0)),!1)}}}}updateDecorations(){return({tr:t,dispatch:e})=>(e==null||e(t),!0)}addPlaceholder(t,e,n){return({dispatch:r,tr:o})=>this.addPlaceholderTransaction(t,e,o,!r)?(r==null||r(n?o.deleteSelection():o),!0):!1}updatePlaceholder(t,e){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:t,data:e,tr:r,checkOnly:!n})?(n==null||n(r),!0):!1}removePlaceholder(t){return({dispatch:e,tr:n})=>this.removePlaceholderTransaction({id:t,tr:n,checkOnly:!e})?(e==null||e(n),!0):!1}clearPlaceholders(){return({tr:t,dispatch:e})=>this.clearPlaceholdersTransaction({tr:t,checkOnly:!e})?(e==null||e(t),!0):!1}findPlaceholder(t){return this.findAllPlaceholders().get(t)}findAllPlaceholders(){const t=new Map,e=this.placeholders.find(void 0,void 0,n=>n.__type===Ua);for(const n of e)t.set(n.spec.id,{from:n.from,to:n.to});return t}createDecorations(t){var e,n,r;const{persistentSelectionClass:o}=this.options;return!o||(e=this.store.view)!=null&&e.hasFocus()||(r=(n=this.store.helpers).isInteracting)!=null&&r.call(n)?ze.empty:hz(t,ze.empty,{class:ge(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(t,e){const{pos:n,createElement:r,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=t,u=(r==null?void 0:r(this.store.view,n))??document.createElement(a);u.classList.add(s);const d=ct.widget(n,u,{id:l,__type:Ua,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(e.doc,[d])}addInlinePlaceholder(t,e){const{from:n=e.selection.from,to:r=e.selection.to,className:o,nodeName:i,id:s,type:a}=t;let l;if(n===r){const c=document.createElement(i);c.classList.add(o),l=ct.widget(n,c,{id:s,type:a,__type:Ua,widget:c})}else l=ct.inline(n,r,{nodeName:i,class:o},{id:s,__type:Ua});this.placeholders=this.placeholders.add(e.doc,[l])}addNodePlaceholder(t,e){const{pos:n,className:r,nodeName:o,id:i}=t,s=tr(n)?e.doc.resolve(n):e.selection.$from,a=tr(n)?s.nodeAfter?{pos:n,end:s.nodeAfter.nodeSize}:void 0:P8(s);if(!a)return;const l=ct.node(a.pos,a.end,{nodeName:o,class:r},{id:i,__type:Ua});this.placeholders=this.placeholders.add(e.doc,[l])}withRequiredBase(t,e){const{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:o=n,className:i,...s}=e,a=(i?[r,i]:[r]).join(" ");return{nodeName:o,className:a,...s,id:t}}getMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...pz,...e}}setMeta(t,e){const n=this.getMeta(t);t.setMeta(this.pluginKey,{...n,...e})}addPlaceholderTransaction(t,e,n,r=!1){if(this.findPlaceholder(t))return!1;if(r)return!0;const{added:i}=this.getMeta(n);return this.setMeta(n,{added:[...i,this.withRequiredBase(t,e)]}),!0}updatePlaceholderTransaction(t){const{id:e,tr:n,checkOnly:r=!1,data:o}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{updated:s}=this.getMeta(n);return this.setMeta(n,{updated:hd([...s,{id:e,data:o}])}),!0}removePlaceholderTransaction(t){const{id:e,tr:n,checkOnly:r=!1}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{removed:i}=this.getMeta(n);return this.setMeta(n,{removed:hd([...i,e])}),!0}clearPlaceholdersTransaction(t){const{tr:e,checkOnly:n=!1}=t;return this.getPluginState()===ze.empty?!1:(n||this.setMeta(e,{clearTrackers:!0}),!0)}};re([oe()],ro.prototype,"updateDecorations",1);re([oe()],ro.prototype,"addPlaceholder",1);re([oe()],ro.prototype,"updatePlaceholder",1);re([oe()],ro.prototype,"removePlaceholder",1);re([oe()],ro.prototype,"clearPlaceholders",1);re([bt()],ro.prototype,"findPlaceholder",1);re([bt()],ro.prototype,"findAllPlaceholders",1);ro=re([Le({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(t,e,n)=>t.add(n.doc,e.find()),getDefault:()=>ze.empty}}},defaultPriority:qe.Low})],ro);var pz={added:[],updated:[],clearTrackers:!1,removed:[]},Ua="placeholderDecoration",RS="persistentSelectionFocus";function hz(t,e,n){const{selection:r,doc:o}=t;if(r.empty)return e;const{from:i,to:s}=r,a=Mm(r)?ct.node(i,s,n):ct.inline(i,s,n);return e.add(o,[a])}var Mh=class extends ut{get name(){return"docChanged"}onStateUpdate(t){const{firstUpdate:e,transactions:n,tr:r}=t;e||(n??[r]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(t)}};Mh=re([Le({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:qe.Lowest})],Mh);var wr=class extends ut{get name(){return"helpers"}onCreate(){var t;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",r0);const e=se(),n=se(),r=se(),o=new Set;for(const i of this.store.extensions){nf(i)&&(n[i.name]=a=>R8({state:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{var l;return(l=wd({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Im(i)&&(n[i.name]=a=>Ch({trState:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{const l=si(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(p1(l.mark,a))return l.mark.attrs});const s=((t=i.createHelpers)==null?void 0:t.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!uh(s))for(const[a,l]of $t(s))$P({name:a,set:o,code:B.DUPLICATE_HELPER_NAMES}),e[a]=l}this.store.setStoreKey("attrs",r),this.store.setStoreKey("active",n),this.store.setStoreKey("helpers",e),this.store.setExtensionStore("attrs",r),this.store.setExtensionStore("active",n),this.store.setExtensionStore("helpers",e)}isSelectionEmpty(t=this.store.getState()){return f1(t)}isViewEditable(t=this.store.getState()){var e,n;return((n=(e=this.store.view.props).editable)==null?void 0:n.call(e,t))??!1}getStateJSON(t=this.store.getState()){return t.toJSON()}getJSON(t=this.store.getState()){return t.doc.toJSON()}getRemirrorJSON(t=this.store.getState()){return this.getJSON(t)}insertHtml(t,e){return n=>{const{state:r}=n,o=r0({content:t,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(o,e)(n)}}getText({lineBreakDivider:t=`
|
|
158
|
-
|
|
159
|
-
`,state:e=this.store.getState()}={}){return e.doc.textBetween(0,e.doc.content.size,t,Hi)}getTextBetween(t,e,n=this.store.getState().doc){return n.textBetween(t,e,`
|
|
160
|
-
|
|
161
|
-
`,Hi)}getHTML(t=this.store.getState()){return r9(t.doc,this.store.document)}textToProsemirrorNode(t){const e=`<pre>${t.content}</pre>`;return this.store.stringHandlers.html({...t,content:e})}};re([bt()],wr.prototype,"isSelectionEmpty",1);re([bt()],wr.prototype,"isViewEditable",1);re([bt()],wr.prototype,"getStateJSON",1);re([bt()],wr.prototype,"getJSON",1);re([bt()],wr.prototype,"getRemirrorJSON",1);re([oe()],wr.prototype,"insertHtml",1);re([bt()],wr.prototype,"getText",1);re([bt()],wr.prototype,"getTextBetween",1);re([bt()],wr.prototype,"getHTML",1);wr=re([Le({})],wr);var s0=class extends ut{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var t,e;const n=[],r=this.store.markTags[Ce.ExcludeInputRules];for(const o of this.store.extensions)if(!((t=this.store.managerSettings.exclude)!=null&&t.inputRules||!o.createInputRules||(e=o.options.exclude)!=null&&e.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=r,n.push(i);return kj({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};s0=re([Le({defaultPriority:qe.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],s0);var Vr=class extends ut{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:t})=>{var e,n;if(t)return this.extraKeyBindings=[...this.extraKeyBindings,t],(n=(e=this.store).rebuildKeymap)==null||n.call(e),()=>{var r,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==t),(o=(r=this.store).rebuildKeymap)==null||o.call(r)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:t}=this.options;return ge(t)?yz[t]:t}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var t;return(t=this.store.managerSettings.exclude)!=null&&t.keymap?[]:(this.setupKeydownHandler(),[new pi({props:{handleKeyDown:(e,n)=>{var r;return(r=this.keydownHandler)==null?void 0:r.call(this,e,n)}}})])}setupKeydownHandler(){const t=this.generateKeymapBindings();this.keydownHandler=NP(t)}generateKeymapBindings(){var t;const e=[],n=this.shortcutMap,r=this.store.getExtension(Me),o=a=>l=>cp({shortcut:l,map:n,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((t=a.options.exclude)!=null&&t.keymap)){a.createKeymap&&e.push(gz(a.createKeymap(o(a)),n));for(const[c,u]of $t(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=cp({shortcut:u.shortcut,map:n,options:a.options,store:this.store}),p=tt(u.priority)?u.priority(a.options,this.store):u.priority??qe.Low,h=se();for(const g of f)h[g]=d;e.push([p,h]),u.command&&r.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...e]);return A8(i)}arrowRightShortcut(t){const e=this.store.markTags[Ce.PreventExits],n=this.store.nodeTags[Ce.PreventExits];return this.exitMarkForwards(e,n)(t)}arrowLeftShortcut(t){const e=this.store.markTags[Ce.PreventExits],n=this.store.nodeTags[Ce.PreventExits];return _h(this.exitNodeBackwards(n),this.exitMarkBackwards(e,n))(t)}backspace(t){const e=this.store.markTags[Ce.PreventExits],n=this.store.nodeTags[Ce.PreventExits];return _h(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(e,n,!0))(t)}createKeymap(){const{selectParentNodeOnEscape:t,undoInputRuleOnBackspace:e,excludeBaseKeymap:n}=this.options,r=se();if(!n)for(const[o,i]of $t(Qg))r[o]=$u(i);return e&&Qg.Backspace&&(r.Backspace=$u($m(Sj,Qg.Backspace))),t&&(r.Escape=$u(C9)),[qe.Low,r]}getNamedShortcut(t,e={}){return t.startsWith("_|")?cp({shortcut:t,map:this.shortcutMap,store:this.store,options:e}):[t]}onSetOptions(t){var e,n;const{changes:r}=t;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(e=this.store).rebuildKeymap)==null||n.call(e))}sortKeymaps(t){return ma(t.map(e=>At(e)?e:[qe.Default,e]),(e,n)=>n[0]-e[0]).map(e=>e[1])}exitMarkForwards(t,e){return n=>{const{tr:r,dispatch:o}=n;if(!s9(r.selection)||bd({selection:r.selection,types:e}))return!1;const a=r.selection.$from.marks().filter(l=>!t.includes(l.type.name));if(ms(a))return!1;if(!o)return!0;for(const l of a)r.removeStoredMark(l);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(t,e=!1){return n=>{const{tr:r}=n;if(!(e?TS:o0)(r.selection))return!1;const i=r.selection.$anchor.node();return!g1(i)||H8(i)||t.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(n)}}exitMarkBackwards(t,e,n=!1){return r=>{const{tr:o,dispatch:i}=r;if(!(n?TS:o0)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(bd({selection:o.selection,types:e}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!t.includes(c.type.name));if(ms(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};re([ar({shortcut:"ArrowRight",isActive:t=>t.exitMarksOnArrowPress})],Vr.prototype,"arrowRightShortcut",1);re([ar({shortcut:"ArrowLeft",isActive:t=>t.exitMarksOnArrowPress})],Vr.prototype,"arrowLeftShortcut",1);re([ar({shortcut:"Backspace",isActive:t=>t.exitMarksOnArrowPress})],Vr.prototype,"backspace",1);re([bt()],Vr.prototype,"getNamedShortcut",1);Vr=re([Le({defaultPriority:qe.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Vr);function mz(t){return to(wm(U),t)}function cp({shortcut:t,map:e,options:n,store:r}){return ge(t)?[a0(t,e)]:At(t)?t.map(o=>a0(o,e)):(t=t(n,r),cp({shortcut:t,map:e,options:n,store:r}))}function a0(t,e){return mz(t)?e[t]:t}function gz(t,e){const n={};let r,o;At(t)?[o,r]=t:r=t;for(const[i,s]of $t(r))n[a0(i,e)]=s;return km(o)?n:[o,n]}var DP={[U.Copy]:"Mod-c",[U.Cut]:"Mod-x",[U.Paste]:"Mod-v",[U.PastePlain]:"Mod-Shift-v",[U.SelectAll]:"Mod-a",[U.Undo]:"Mod-z",[U.Redo]:Br.isMac?"Shift-Mod-z":"Mod-y",[U.Bold]:"Mod-b",[U.Italic]:"Mod-i",[U.Underline]:"Mod-u",[U.Strike]:"Mod-d",[U.Code]:"Mod-`",[U.Paragraph]:"Mod-Shift-0",[U.H1]:"Mod-Shift-1",[U.H2]:"Mod-Shift-2",[U.H3]:"Mod-Shift-3",[U.H4]:"Mod-Shift-4",[U.H5]:"Mod-Shift-5",[U.H6]:"Mod-Shift-6",[U.TaskList]:"Mod-Shift-7",[U.BulletList]:"Mod-Shift-8",[U.OrderedList]:"Mod-Shift-9",[U.Quote]:"Mod->",[U.Divider]:"Mod-Shift-|",[U.Codeblock]:"Mod-Shift-~",[U.ClearFormatting]:"Mod-Shift-C",[U.Superscript]:"Mod-.",[U.Subscript]:"Mod-,",[U.LeftAlignment]:"Mod-Shift-L",[U.CenterAlignment]:"Mod-Shift-E",[U.RightAlignment]:"Mod-Shift-R",[U.JustifyAlignment]:"Mod-Shift-J",[U.InsertLink]:"Mod-k",[U.Find]:"Mod-f",[U.FindBackwards]:"Mod-Shift-f",[U.FindReplace]:"Mod-Shift-H",[U.AddFootnote]:"Mod-Alt-f",[U.AddComment]:"Mod-Alt-m",[U.ContextMenu]:"Mod-Shift-\\",[U.IncreaseFontSize]:"Mod-Shift-.",[U.DecreaseFontSize]:"Mod-Shift-,",[U.IncreaseIndent]:"Tab",[U.DecreaseIndent]:"Shift-Tab",[U.Shortcuts]:"Mod-/",[U.Format]:Br.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},vz={...DP,[U.Strike]:"Mod-Shift-S",[U.Code]:"Mod-Shift-M",[U.Paragraph]:"Mod-Alt-0",[U.H1]:"Mod-Alt-1",[U.H2]:"Mod-Alt-2",[U.H3]:"Mod-Alt-3",[U.H4]:"Mod-Alt-4",[U.H5]:"Mod-Alt-5",[U.H6]:"Mod-Alt-6",[U.OrderedList]:"Mod-Alt-7",[U.BulletList]:"Mod-Alt-8",[U.Quote]:"Mod-Alt-9",[U.ClearFormatting]:"Mod-\\",[U.IncreaseIndent]:"Mod-[",[U.DecreaseIndent]:"Mod-]"},yz={default:DP,googleDoc:vz},xz=class extends ut{get name(){return"nodeViews"}createPlugin(){const t=[],e=se();for(const n of this.store.extensions){if(!n.createNodeViews)continue;const r=n.createNodeViews();t.unshift(tt(r)?{[n.name]:r}:r)}t.unshift(this.store.managerSettings.nodeViews??{});for(const n of t)Object.assign(e,n);return{props:{nodeViews:e}}}},bz=class extends ut{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var t,e;const n=[];for(const r of this.store.extensions){if((t=this.store.managerSettings.exclude)!=null&&t.pasteRules||!r.createPasteRules||(e=r.options.exclude)!=null&&e.pasteRules)continue;const o=r.createPasteRules(),i=At(o)?o:[o];n.push(...i)}return F9(n)}},l0=class extends ut{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=se(),this.stateGetters=new Map,this.getPluginStateCreator=t=>e=>t.getState(e??this.store.getState()),this.getStateByName=t=>{const e=this.stateGetters.get(t);return de(e,{message:"No plugin exists for the requested extension name."}),e()}}get name(){return"plugins"}onCreate(){const{setStoreKey:t,setExtensionStore:e,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();const{plugins:o=[]}=n;this.updatePlugins(o,this.managerPlugins);for(const i of r)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),t("pluginKeys",this.pluginKeys),t("getPluginState",this.getStateByName),e("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(t,e,n)=>{const r=n.tr,o={previousState:e,tr:r,transactions:t,state:n};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(t,e)=>{for(const n of this.initStateHandlers)n(e)},apply:(t,e,n,r)=>{const o={previousState:n,state:r,tr:t};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(t){var e,n;if(!(!t.createPlugin&&!t.createExternalPlugins||(e=this.store.managerSettings.exclude)!=null&&e.plugins||(n=t.options.exclude)!=null&&n.plugins)){if(t.createPlugin){const o=new fc(t.name);this.pluginKeys[t.name]=o;const i=this.getPluginStateCreator(o);t.pluginKey=o,t.getPluginState=i,this.stateGetters.set(t.name,i),this.stateGetters.set(t.constructor,i);const s={...t.createPlugin(),key:o},a=new pi(s);this.updatePlugins([a],t.plugin?[t.plugin]:void 0),t.plugin=a}if(t.createExternalPlugins){const o=t.createExternalPlugins();this.updatePlugins(o,t.externalPlugins),t.externalPlugins=o}}}updatePlugins(t,e){if(!e||ms(e)){this.plugins=[...this.plugins,...t];return}if(t.length!==e.length){this.plugins=[...this.plugins.filter(r=>!e.includes(r)),...t];return}const n=new Map;for(const[r,o]of t.entries())n.set(ht(e,r),o);this.plugins=this.plugins.map(r=>e.includes(r)?n.get(r):r)}updateExtensionStore(){const{setExtensionStore:t}=this.store;t("updatePlugins",this.updatePlugins.bind(this)),t("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),t("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(t){const e=AP(t)?t:iz(t)?this.store.manager.getExtension(t):this.store.extensions.find(n=>n.name===t);de(e,{code:B.INVALID_MANAGER_EXTENSION,message:`The extension ${t} does not exist within the editor.`}),this.extractExtensionPlugins(e),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){de(this.store.phase>=Pn.EditorView,{code:B.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:t,updateState:e}=this.store,n=t.state.reconfigure({plugins:this.plugins});e(n)}};l0=re([Le({defaultPriority:qe.Highest,handlerKeys:["applyState","appendTransaction"]})],l0);var c0=class extends ut{constructor(){super(...arguments),this.dynamicAttributes={marks:se(),nodes:se()}}get name(){return"schema"}onCreate(){const{managerSettings:t,tags:e,markNames:n,nodeNames:r,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=t,c=h=>!!(h&&e[Ce.Block].includes(h));if(t.schema){const{nodes:h,marks:g}=Tz(t.schema);this.addSchema(t.schema,h,g);return}const u=c(i)?{doc:se(),[i]:se()}:se(),d=se(),f=wz({settings:t,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:r,markNames:n,tags:e});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const g=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(nf(h)){const{spec:x,dynamic:v}=$S({createExtensionSpec:(y,w)=>h.createNodeSpec(y,w),extraAttributes:ht(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:g,name:h.constructorName,tags:h.tags});h.spec=x,u[h.name]=x,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Im(h)){const{spec:x,dynamic:v}=$S({createExtensionSpec:(y,w)=>h.createMarkSpec(y,w),extraAttributes:ht(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:g,name:h.constructorName,tags:h.tags??[]});h.spec=x,d[h.name]=x,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new p6({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(t,e,n)=>{const{tr:r}=n;return!t.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,r),this.checkAndUpdateDynamicMarks(i,s,r),!0)),r.steps.length>0?r:null)}}}addSchema(t,e,n){this.store.setStoreKey("nodes",e),this.store.setStoreKey("marks",n),this.store.setStoreKey("schema",t),this.store.setExtensionStore("schema",t),this.store.setStoreKey("defaultBlockNode",Nm(t).name);for(const r of Object.values(t.nodes))if(r.name!=="doc"&&(r.isBlock||r.isTextblock))break}checkAndUpdateDynamicNodes(t,e,n){for(const[r,o]of $t(this.dynamicAttributes.nodes))if(t.type.name===r)for(const[i,s]of $t(o)){if(!hs(t.attrs[i]))continue;const a={...t.attrs,[i]:s(t)};n.setNodeMarkup(e,void 0,a),ES(n)}}checkAndUpdateDynamicMarks(t,e,n){for(const[r,o]of $t(this.dynamicAttributes.marks)){const i=ht(this.store.schema.marks,r),s=t.marks.find(a=>a.type.name===r);if(s)for(const[a,l]of $t(o)){if(!hs(s.attrs[a]))continue;const c=si(n.doc.resolve(e),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});n.removeMark(u,d,i).addMark(u,d,f),ES(n)}}}gatherExtraAttributes(t){const e=[];for(const n of t)n.createSchemaAttributes&&e.push(...n.createSchemaAttributes());return e}};c0=re([Le({defaultPriority:qe.Highest})],c0);function wz(t){const{settings:e,gatheredSchemaAttributes:n,nodeNames:r,markNames:o,tags:i}=t,s=se();if(e.disableExtraAttributes)return s;const a=[...n,...e.extraAttributes??[]];for(const l of a??[]){const c=Sz({identifiers:l.identifiers,nodeNames:r,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function kz(t){return Pa(t)&&At(t.tags)}function Sz(t){const{identifiers:e,nodeNames:n,markNames:r,tags:o}=t;if(e==="nodes")return n;if(e==="marks")return r;if(e==="all")return[...n,...r];if(At(e))return e;de(kz(e),{code:B.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=e,d=new Set,f=u==="mark"?r:u==="node"?n:[...r,...n],p=g=>f.includes(g)&&!(l!=null&&l.includes(g));for(const g of s)p(g)&&d.add(g);const h=new Map;for(const g of i)if(!(c!=null&&c.includes(g)))for(const x of o[g]){if(!p(x))continue;if(a==="any"){d.add(x);continue}const v=h.get(x)??new Set;v.add(g),h.set(x,v)}for(const[g,x]of h)x.size===i.length&&d.add(g);return[...d]}function $S(t){var e;const{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:o,name:i,tags:s,override:a}=t,l=se();function c(x,v){l[x]=v}let u=!1;function d(){u=!0}const f=Ez(r,o,d,c),p=_z(r,o),h=Cz(r,o),g=n({defaults:f,parse:p,dom:h},a);return de(o||u,{code:B.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),g.group=[...((e=g.group)==null?void 0:e.split(" "))??[],...s].join(" ")||void 0,{spec:g,dynamic:l}}function y1(t){return ge(t)||tt(t)?{default:t}:(de(t,{message:`${DT(t)} is not supported`,code:B.EXTENSION_EXTRA_ATTRIBUTES}),t)}function Ez(t,e,n,r){return()=>{n();const o=se();if(e)return o;for(const[i,s]of $t(t)){let l=y1(s).default;tt(l)&&(r(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function _z(t,e){return n=>{const r=se();if(e)return r;for(const[o,i]of $t(t)){const{parseDOM:s,...a}=y1(i);if(So(n)){if(hs(s)){r[o]=n.getAttribute(o)??a.default;continue}if(tt(s)){r[o]=s(n)??a.default;continue}r[o]=n.getAttribute(s)??a.default}}return r}}function Cz(t,e){return n=>{const r=se();if(e)return r;function o(i,s){if(i){if(ge(i)){r[s]=i;return}if(At(i)){const[a,l]=i;r[a]=l??n.attrs[s];return}for(const[a,l]of $t(i))r[a]=l}}for(const[i,s]of $t(t)){const{toDOM:a,parseDOM:l}=y1(s);if(hs(a)){const c=ge(l)?l:i;r[c]=n.attrs[i];continue}if(tt(a)){o(a(n.attrs,Oz(n)),i);continue}o(a,i)}return r}}function Oz(t){return Pm(t)?{node:t}:F8(t)?{mark:t}:{}}function Tz(t){const e=se(),n=se();for(const[r,o]of Object.entries(t.nodes))e[r]=o.spec;for(const[r,o]of Object.entries(t.marks))n[r]=o.spec;return{nodes:e,marks:n}}var Ql=class extends ut{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:t})=>{var e;if(!(!t||(e=this.store.managerSettings.exclude)!=null&&e.suggesters))return SS(this.store.getState(),t)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",t=>SS(this.store.getState(),t)),this.store.setExtensionStore("removeSuggester",t=>_8(this.store.getState(),t))}createExternalPlugins(){var t,e;const n=[];for(const r of this.store.extensions){if((t=this.store.managerSettings.exclude)!=null&&t.suggesters)break;if(!r.createSuggesters||(e=r.options.exclude)!=null&&e.suggesters)continue;const o=r.createSuggesters(),i=At(o)?o:[o];n.push(...i)}return[C8(...n)]}getSuggestState(t){return c1(t??this.store.getState())}getSuggestMethods(){const{addIgnored:t,clearIgnored:e,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:t,clearIgnored:e,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(t){var e;return to(At(t)?t:[t],(e=this.getSuggestState().match)==null?void 0:e.suggester.name)}};re([bt()],Ql.prototype,"getSuggestState",1);re([bt()],Ql.prototype,"getSuggestMethods",1);re([bt()],Ql.prototype,"isSuggesterActive",1);Ql=re([Le({customHandlerKeys:["suggester"]})],Ql);var u0=class extends ut{constructor(){super(...arguments),this.allTags=se(),this.plainTags=se(),this.markTags=se(),this.nodeTags=se()}get name(){return"tags"}onCreate(){this.resetTags();for(const t of this.store.extensions)this.updateTagForExtension(t);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const t=se(),e=se(),n=se(),r=se();for(const o of wm(Ce))t[o]=[],e[o]=[],n[o]=[],r[o]=[];this.allTags=t,this.plainTags=e,this.markTags=n,this.nodeTags=r}updateTagForExtension(t){var e,n;const r=new Set([...t.tags??[],...((e=t.createTags)==null?void 0:e.call(t))??[],...t.options.extraTags??[],...((n=this.store.managerSettings.extraTags)==null?void 0:n[t.name])??[]]);for(const o of r)de(Pz(o),{code:B.EXTENSION,message:`The tag provided by the extension: ${t.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(t.name),IP(t)&&this.plainTags[o].push(t.name),Im(t)&&this.markTags[o].push(t.name),nf(t)&&this.nodeTags[o].push(t.name);t.tags=[...r]}};u0=re([Le({defaultPriority:qe.Highest})],u0);function Pz(t){return to(wm(Ce),t)}var Mz=new fc("remirrorFilePlaceholderPlugin");function Nz(){const t=new pi({key:Mz,state:{init(){return{set:ze.empty,payloads:new Map}},apply(e,{set:n,payloads:r}){n=n.map(e.mapping,e.doc);const o=e.getMeta(t);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=ct.widget(o.pos,i,{id:o.id});n=n.add(e.doc,[s]),r.set(o.id,o.payload)}else o.type===1&&(n=n.remove(n.find(void 0,void 0,i=>i.id===o.id)),r.delete(o.id));return{set:n,payloads:r}}},props:{decorations(e){var n;return((n=t.getState(e))==null?void 0:n.set)??null}}});return t}var Rz=class extends ut{get name(){return"upload"}createExternalPlugins(){return[Nz()]}};function $z(t={}){t={...{exitMarksOnArrowPress:Vr.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Vr.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Vr.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Vr.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:ro.defaultOptions.persistentSelectionClass},...t};const n=Ly(t,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=Ly(t,["persistentSelectionClass"]);return[new u0,new c0,new sz,new l0,new s0,new bz,new xz,new Ql,new Me,new wr,new Vr(n),new Mh,new Rz,new ro(r)]}var AS=class extends ut{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const t of this.store.extensions)this.captureCommands(t),this.captureKeybindings(t)}createPlugin(){return{}}captureCommands(t){const e=t.decoratedCommands??{},n=t.createCommands;for(const r of Object.keys(e)){const o=t[r];t[r]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:r,extension:t.name,decorated:!0}),l}}n&&(t.createCommands=()=>{const r=n();for(const[o,i]of Object.entries(r))r[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:t.name,decorated:!1}),c};return r})}captureKeybindings(t){}getCommandMeta(t){return t.getMeta(this.pluginKey)??[]}setCommandMeta(t,e){const n=this.getCommandMeta(t);t.setMeta(this.pluginKey,[...n,e])}};AS=re([Le({defaultOptions:{capture:Br.isDevelopment},staticKeys:["capture"],defaultPriority:qe.Highest})],AS);var up,Xc,dp,tl,Pi,fp,pp,Az=class{constructor(t){Ct(this,up,fh()),Ct(this,Xc,void 0),Ct(this,dp,void 0),Ct(this,tl,!0),Ct(this,Pi,bm()),Ct(this,fp,void 0),Ct(this,pp,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;de(!this.manager.destroyed,{code:B.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);jt(this,dp,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);ms(d)||this.updateViewProps(...d)},this.onChange=(i=se())=>{var s,a;const l=this.eventListenerProps(i);Y(this,tl)&&jt(this,tl,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),Y(this,Pi).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),Y(this,Pi).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:e,initialEditorState:n,element:r}=t;if(jt(this,Xc,e),jt(this,pp,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(n,r);this.manager.addView(o)}get addHandler(){return Y(this,fp)??jt(this,fp,Y(this,Pi).on.bind(Y(this,Pi)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return Y(this,tl)}get props(){return Y(this,Xc).call(this)}get previousState(){return this.previousStateOverride??Y(this,dp)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return Y(this,up)}get initialEditorState(){return Y(this,pp)}updateListener(t){const{state:e,tr:n}=t;return Y(this,Pi).emit("updated",this.eventListenerProps({state:e,tr:n}))}update(t){const{getProps:e}=t;return jt(this,Xc,e),this}updateViewProps(...t){const e=Ly(this.updatableViewProps,t);this.view.setProps({...this.view.props,...e})}getAttributes(t){var e;const{attributes:n,autoFocus:r,classNames:o=[],label:i,editable:s}=this.props,a=(e=this.manager.store)==null?void 0:e.attributes,l=tt(n)?n(this.eventListenerProps()):n;let c={};(r||tr(r))&&(c=t?{autoFocus:!0}:{autofocus:"true"});const u=hd(i0(t&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return VL({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){Y(this,Pi).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(t=se()){const{state:e,tr:n,transactions:r}=t;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:Y(this,tl),state:e??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:Y(this,up),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};up=new WeakMap;Xc=new WeakMap;dp=new WeakMap;tl=new WeakMap;Pi=new WeakMap;fp=new WeakMap;pp=new WeakMap;function Iz(t,e){const n=[],r=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:e};for(const d of t)LP(a,{extension:d});s=ma(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);de(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:B.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),n.push(d),r.set(f,d),h.forEach(g=>g==null?void 0:g.replaceChildExtension(f,d)))}const u=[];for(const d of n)Dz({extension:d,found:l,missing:u});return de(ms(u),{code:B.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(`
|
|
162
|
-
`)}),{extensions:n,extensionMap:r}}function LP(t,e){var n;const{gatheredExtensions:r,duplicateMap:o,parentExtensions:i,settings:s}=t,{extension:a,parentExtension:l}=e;let{names:c=[]}=e;de(AP(a),{code:B.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((n=s.priority)==null?void 0:n[a.name]),r.push(a),Lz({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)LP(t,{names:c,extension:d,parentExtension:a})}}function Dz(t){const{extension:e,found:n,missing:r}=t;if(e.requiredExtensions)for(const o of e.requiredExtensions??[])n.has(o)||r.push({Constructor:o,extension:e})}function Lz(t){const{duplicateMap:e,extension:n,parentExtension:r}=t,o=n.constructor,i=e.get(o),s=r?[r]:[];e.set(o,i?[...i,...s]:s)}function jz(t){var e,n,r,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=t;i.setStore(c);const d=(e=i.onCreate)==null?void 0:e.bind(i),f=(n=i.onView)==null?void 0:n.bind(i),p=(r=i.onStateUpdate)==null?void 0:r.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Im(i)&&a.push(i.name),nf(i)&&i.name!=="doc"&&s.push(i.name),IP(i)&&l.push(i.name)}var Mi,Zc,Rr,Lo,Jc,Bn,As,Qc,Is,eu,Ds,$r,tu,hp=class{constructor(t,e={}){Ct(this,Mi,void 0),Ct(this,Zc,se()),Ct(this,Rr,se()),Ct(this,Lo,void 0),Ct(this,Jc,void 0),Ct(this,Bn,Pn.None),Ct(this,As,void 0),Ct(this,Qc,!0),Ct(this,Is,{create:[],view:[],update:[],destroy:[]}),Ct(this,eu,[]),Ct(this,Ds,bm()),Ct(this,$r,void 0),Ct(this,tu,void 0),this.getState=()=>{var o;return Y(this,Bn)>=Pn.EditorView?this.view.state:(de(Y(this,$r),{code:B.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=Y(this,$r))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:n,extensionMap:r}=Iz(t,e);jt(this,As,e),jt(this,Lo,Gs(n)),jt(this,Jc,r),jt(this,Mi,this.createExtensionStore()),jt(this,Bn,Pn.Create),this.setupLifecycleHandlers();for(const o of Y(this,Is).create){const i=o();i&&Y(this,eu).push(i)}}static create(t,e={}){return new hp([...BT(t),...$z(e.builtin)],e)}get[ii](){return Ht.Manager}get destroyed(){return Y(this,Bn)===Pn.Destroy}get mounted(){return Y(this,Bn)>=Pn.EditorView&&Y(this,Bn)<Pn.Destroy}get output(){var t;return(t=Y(this,$r))==null?void 0:t.frameworkOutput}get frameworkAttached(){return!!Y(this,$r)}get extensions(){return Y(this,Lo)}get stringHandlers(){return Y(this,Zc)}get store(){return Gs(Y(this,Rr))}get extensionStore(){return Gs(Y(this,Mi))}get tr(){return this.getExtension(Me).transaction}get nodes(){return Y(this,Rr).nodes}get marks(){return Y(this,Rr).marks}get schema(){return Y(this,Rr).schema}get extensionTags(){return Y(this,Rr).tags}get view(){return Y(this,Rr).view}get settings(){return Y(this,As)}get document(){return Y(this,As).document??Rm()}setupLifecycleHandlers(){const t=Y(this,Mi),e=Y(this,Is),n=[],r=[],o=[];t.nodeNames=n,t.markNames=r,t.plainNames=o;for(const i of Y(this,Lo))jz({extension:i,nodeNames:n,markNames:r,plainNames:o,handlers:e,store:t})}setStringHandler(t,e){Y(this,Zc)[t]=e}setStoreKey(t,e){Y(this,Rr)[t]=e}getStoreKey(t){const e=Y(this,Rr)[t];return de(!hs(e),{code:B.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),e}setExtensionStore(t,e){de(Y(this,Bn)<=Pn.EditorView,{code:B.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),Y(this,Mi)[t]=e}createExtensionStore(){const t=se(),e=!0;let n,r;return Object.defineProperties(t,{extensions:{get:()=>Y(this,Lo),enumerable:e},phase:{get:()=>Y(this,Bn),enumerable:e},view:{get:()=>this.view,enumerable:e},managerSettings:{get:()=>Gs(Y(this,As)),enumerable:e},getState:{value:this.getState,enumerable:e},updateState:{value:this.updateState,enumerable:e},isMounted:{value:()=>this.mounted,enumerable:e},getExtension:{value:this.getExtension.bind(this),enumerable:e},manager:{get:()=>this,enumerable:e},document:{get:()=>this.document,enumerable:e},stringHandlers:{get:()=>Y(this,Zc),enumerable:e},currentState:{get:()=>n??(n=this.getState()),set:o=>{n=o},enumerable:e},previousState:{get:()=>r,set:o=>{r=o},enumerable:e}}),t.getStoreKey=this.getStoreKey.bind(this),t.setStoreKey=this.setStoreKey.bind(this),t.setExtensionStore=this.setExtensionStore.bind(this),t.setStringHandler=this.setStringHandler.bind(this),t}addView(t){if(Y(this,Bn)>=Pn.EditorView)return this;jt(this,Qc,!0),jt(this,Bn,Pn.EditorView),Y(this,Rr).view=t;for(const e of Y(this,Is).view){const n=e(t);n&&Y(this,eu).push(n)}return this}attachFramework(t,e){var n;Y(this,$r)!==t&&(Y(this,$r)&&(Y(this,$r).destroy(),(n=Y(this,tu))==null||n.call(this)),jt(this,$r,t),jt(this,tu,this.addHandler("stateUpdate",e)))}createEmptyDoc(){var t;const e=(t=this.schema.nodes.doc)==null?void 0:t.createAndFill();return de(e,{code:B.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),e}createState(t={}){const{onError:e,defaultSelection:n="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=n,stringHandler:i=this.settings.stringHandler}=t,{schema:s,plugins:a}=this.store,l=mP({stringHandler:ge(i)?this.stringHandlers[i]:i,document:this.document,content:r,onError:e,schema:s,selection:o});return Ys.create({schema:s,doc:l,plugins:a,selection:br(o,l)})}addHandler(t,e){return Y(this,Ds).on(t,e)}onStateUpdate(t){const e=Y(this,Qc);Y(this,Mi).currentState=t.state,Y(this,Mi).previousState=t.previousState,e&&(jt(this,Bn,Pn.Runtime),jt(this,Qc,!1));const n={...t,firstUpdate:e};for(const r of Y(this,Is).update)r(n);Y(this,Ds).emit("stateUpdate",n)}getExtension(t){const e=Y(this,Jc).get(t);return de(e,{code:B.INVALID_MANAGER_EXTENSION,message:`'${t.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),e}hasExtension(t){return!!Y(this,Jc).get(t)}clone(){const t=Y(this,Lo).map(n=>n.clone(n.options)),e=hp.create(()=>t,Y(this,As));return Y(this,Ds).emit("clone",e),e}recreate(t=[],e={}){const n=Y(this,Lo).map(o=>o.clone(o.initialOptions)),r=hp.create(()=>[...n,...t],e);return Y(this,Ds).emit("recreate",r),r}destroy(){var t,e,n,r,o,i;jt(this,Bn,Pn.Destroy);for(const s of((t=this.view)==null?void 0:t.state.plugins)??[])(n=(e=s.getState(this.view.state))==null?void 0:e.destroy)==null||n.call(e);(r=Y(this,$r))==null||r.destroy(),(o=Y(this,tu))==null||o.call(this);for(const s of Y(this,eu))s();for(const s of Y(this,Is).destroy)s();(i=this.view)==null||i.destroy(),Y(this,Ds).emit("destroy")}includes(t){const e=[],n=[];for(const r of Y(this,Lo))e.push(r.name,r.constructorName),n.push(r.constructor);return t.every(r=>ge(r)?to(e,r):to(n,r))}},zz=hp;Mi=new WeakMap;Zc=new WeakMap;Rr=new WeakMap;Lo=new WeakMap;Jc=new WeakMap;Bn=new WeakMap;As=new WeakMap;Qc=new WeakMap;Is=new WeakMap;eu=new WeakMap;Ds=new WeakMap;$r=new WeakMap;tu=new WeakMap;function Fz(t,e){return!pc(t)||!hc(t,Ht.Manager)?!1:e?t.includes(e):!0}var Bz=Object.defineProperty,Vz=Object.getOwnPropertyDescriptor,Uz=(t,e,n,r)=>{for(var o=r>1?void 0:r?Vz(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&Bz(e,n,o),o},jP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(jP(t,e,"read from private field"),n?n.call(t):e.get(t)),Vn=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Fn=(t,e,n,r)=>(jP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),nu,Hz=class{constructor(){this.portals=new Map,Vn(this,nu,bm()),this.on=t=>ie(this,nu).on("update",t),this.once=t=>{const e=ie(this,nu).on("update",n=>{e(),t(n)});return e}}update(){ie(this,nu).emit("update",this.portals)}render({Component:t,container:e}){const n=this.portals.get(e);this.portals.set(e,{Component:t,key:(n==null?void 0:n.key)??fh()}),this.update()}forceUpdate(){for(const[t,{Component:e}]of this.portals)this.portals.set(t,{Component:e,key:fh()})}remove(t){this.portals.delete(t),this.update()}};nu=new WeakMap;var Wz=t=>{const{portals:e}=t;return X.createElement(X.Fragment,null,e.map(([n,{Component:r,key:o}])=>Sr.createPortal(X.createElement(r,null),n,o)))};function Kz(t){const[e,n]=m.useState(()=>Array.from(t.portals.entries()));return m.useEffect(()=>t.on(r=>{n(Array.from(r.entries()))}),[t]),m.useMemo(()=>e,[e])}var dt,ru,Ls,ou,mp,iu,nl,su,gp,jo,fn,d0,zP=class{constructor({getPosition:t,node:e,portalContainer:n,view:r,ReactComponent:o,options:i}){Vn(this,dt,void 0),Vn(this,ru,[]),Vn(this,Ls,void 0),Vn(this,ou,void 0),Vn(this,mp,void 0),Vn(this,iu,void 0),Vn(this,nl,void 0),Vn(this,su,!1),Vn(this,gp,void 0),Vn(this,jo,void 0),Vn(this,fn,void 0),Vn(this,d0,l=>{l&&(de(ie(this,jo),{code:B.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${ie(this,dt).type.name}' which doesn't support content.`}),l.append(ie(this,jo)))}),this.Component=()=>{const l=ie(this,mp);return de(l,{code:B.REACT_NODE_VIEW,message:`The custom react node view provided for ${ie(this,dt).type.name} doesn't have a valid ReactComponent`}),X.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:ie(this,Ls),getPosition:ie(this,iu),node:ie(this,dt),forwardRef:ie(this,d0),decorations:ie(this,ru)})},this.updateAttributes=l=>{if(!ie(this,Ls).editable)return;const c=ie(this,iu).call(this);if(c==null)return;const u=ie(this,Ls).state.tr.setNodeMarkup(c,void 0,{...ie(this,dt).attrs,...l});ie(this,Ls).dispatch(u)},de(tt(t),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Fn(this,dt,e),Fn(this,Ls,r),Fn(this,ou,n),Fn(this,mp,o),Fn(this,iu,t),Fn(this,nl,i),Fn(this,fn,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Fn(this,gp,s??void 0),Fn(this,jo,a),ie(this,jo)&&ie(this,fn).append(ie(this,jo)),this.setDomAttributes(ie(this,dt),ie(this,fn)),this.Component.displayName=AT(`${ie(this,dt).type.name}NodeView`),this.renderComponent()}static create(t){const{portalContainer:e,ReactComponent:n,options:r}=t;return(o,i,s)=>new zP({options:r,node:o,view:i,getPosition:s,portalContainer:e,ReactComponent:n})}get selected(){return ie(this,su)}get contentDOM(){return ie(this,gp)}get dom(){return ie(this,fn)}renderComponent(){ie(this,ou).render({Component:this.Component,container:ie(this,fn)})}createDom(){const{defaultBlockNode:t,defaultInlineNode:e}=ie(this,nl),n=ie(this,dt).isInline?document.createElement(e):document.createElement(t);return n.classList.add(`${vk(ie(this,dt).type.name)}-node-view-wrapper`),n}createContentDom(){var t,e;if(ie(this,dt).isLeaf)return;const n=(e=(t=ie(this,dt).type.spec).toDOM)==null?void 0:e.call(t,ie(this,dt));if(!n)return;const{contentDOM:r,dom:o}=Wr.renderSpec(document,n);let i;if(So(o))return i=o,o===r&&(i=document.createElement("span"),i.classList.add(`${vk(ie(this,dt).type.name)}-node-view-content-wrapper`),i.append(r)),So(r),{wrapper:i,contentDOM:r}}update(t,e){return d1({types:ie(this,dt).type,node:t})?(ie(this,dt)===t&&ie(this,ru)===e||(ie(this,dt).sameMarkup(t)||this.setDomAttributes(t,ie(this,fn)),Fn(this,dt,t),Fn(this,ru,e),this.renderComponent()),!0):!1}setDomAttributes(t,e){const{toDOM:n}=ie(this,dt).type.spec;let r=t.attrs;if(n){const o=n(t);if(ge(o)||qz(o))return;Pa(o[1])&&(r=o[1])}for(const[o,i]of $t(r))e.setAttribute(o,i)}selectNode(){Fn(this,su,!0),ie(this,fn)&&ie(this,fn).classList.add(pk),this.renderComponent()}deselectNode(){Fn(this,su,!1),ie(this,fn)&&ie(this,fn).classList.remove(pk),this.renderComponent()}destroy(){ie(this,ou).remove(ie(this,fn))}ignoreMutation(t){return t.type==="selection"?!ie(this,dt).type.spec.selectable:ie(this,jo)?!ie(this,jo).contains(t.target):!0}stopEvent(t){var e;if(!ie(this,fn))return!1;if(tt(ie(this,nl).stopEvent))return ie(this,nl).stopEvent({event:t});const n=t.target;if(!(ie(this,fn).contains(n)&&!((e=this.contentDOM)!=null&&e.contains(n))))return!1;const o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o)return!0;const s=!!ie(this,dt).type.spec.draggable,a=fe.isSelectable(ie(this,dt)),l=t.type==="copy",c=t.type==="paste",u=t.type==="cut",d=t.type==="mousedown",f=t.type.startsWith("drag");return!s&&a&&f&&t.preventDefault(),!(f||o||l||c||u||d&&a)}},IS=zP;dt=new WeakMap;ru=new WeakMap;Ls=new WeakMap;ou=new WeakMap;mp=new WeakMap;iu=new WeakMap;nl=new WeakMap;su=new WeakMap;gp=new WeakMap;jo=new WeakMap;fn=new WeakMap;d0=new WeakMap;function qz(t){return n0(t)||Pa(t)&&n0(t.dom)}var Sd=class extends ut{constructor(){super(...arguments),this.portalContainer=new Hz}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const t=se(),e=this.store.managerSettings.nodeViewComponents??{};for(const r of this.store.extensions)!r.ReactComponent||!nf(r)||r.reactComponentEnvironment==="ssr"||(t[r.name]=IS.create({options:this.options,ReactComponent:r.ReactComponent,portalContainer:this.portalContainer}));const n=$t({...this.options.nodeViewComponents,...e});for(const[r,o]of n)t[r]=IS.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return t}};Sd=Uz([Le({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],Sd);function Gz(t){const e=m.createContext(null),n=Yz(e);return[o=>{const i=t(o);return X.createElement(e.Provider,{value:i},o.children)},n,e]}function Yz(t){return(e,n)=>{const r=m.useContext(t),o=Xz(r);if(!r)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!e)return r;if(typeof e!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=e(r);if(!o||!n)return i;const s=e(o);return n(s,i)?s:i}}function Xz(t){const e=m.useRef();return Zz(()=>{e.current=t}),e.current}var Zz=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Jz(t,e){return Gz(n=>{const r=m.useRef(null),o=m.useRef(),i=e==null?void 0:e(n),[s,a]=m.useState(()=>t({get:DS(r),set:LS(o),previousContext:void 0,props:n,state:i})),l=[...Object.values(n),i];return m.useEffect(()=>{l.length!==0&&a(c=>t({get:DS(r),set:LS(o),previousContext:c,props:n,state:i}))},l),r.current=s,o.current=a,s})}function DS(t){return e=>{if(!t.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!e)return t.current;if(typeof e!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return e(t.current)}}function LS(t){return e=>{if(!t.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");t.current(n=>({...n,...typeof e=="function"?e(n):e}))}}var FP={},BP={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessages=t.ErrorType=void 0;var e;(function(n){n.MalformedUnicode="MALFORMED_UNICODE",n.MalformedHexadecimal="MALFORMED_HEXADECIMAL",n.CodePointLimit="CODE_POINT_LIMIT",n.OctalDeprecation="OCTAL_DEPRECATION",n.EndOfString="END_OF_STRING"})(e=t.ErrorType||(t.ErrorType={})),t.errorMessages=new Map([[e.MalformedUnicode,"malformed Unicode character escape sequence"],[e.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[e.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[e.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[e.EndOfString,"malformed escape sequence at end of string"]])})(BP);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unraw=t.errorMessages=t.ErrorType=void 0;const e=BP;Object.defineProperty(t,"ErrorType",{enumerable:!0,get:function(){return e.ErrorType}}),Object.defineProperty(t,"errorMessages",{enumerable:!0,get:function(){return e.errorMessages}});function n(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function r(p,h,g){const x=n(p);if(Number.isNaN(x)||g!==void 0&&g!==p.length)throw new SyntaxError(e.errorMessages.get(h));return x}function o(p){const h=r(p,e.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const g=r(p,e.ErrorType.MalformedUnicode,4);if(h!==void 0){const x=r(h,e.ErrorType.MalformedUnicode,4);return String.fromCharCode(g,x)}return String.fromCharCode(g)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(e.errorMessages.get(e.ErrorType.MalformedUnicode));const h=p.slice(1,-1),g=r(h,e.ErrorType.MalformedUnicode);try{return String.fromCodePoint(g)}catch(x){throw x instanceof RangeError?new SyntaxError(e.errorMessages.get(e.ErrorType.CodePointLimit)):x}}function l(p,h=!1){if(h)throw new SyntaxError(e.errorMessages.get(e.ErrorType.OctalDeprecation));const g=parseInt(p,8);return String.fromCharCode(g)}const c=new Map([["b","\b"],["f","\f"],["n",`
|
|
163
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(g,x,v,y,w,k,E,O,S){if(x!==void 0)return"\\";if(v!==void 0)return o(v);if(y!==void 0)return a(y);if(w!==void 0)return i(w,k);if(E!==void 0)return i(E);if(O==="0")return"\0";if(O!==void 0)return l(O,!h);if(S!==void 0)return u(S);throw new SyntaxError(e.errorMessages.get(e.ErrorType.EndOfString))})}t.unraw=f,t.default=f})(FP);const Qz=ui(FP),ia=t=>typeof t=="string",eF=t=>typeof t=="function",jS=new Map,VP="en";function x1(t){return[...Array.isArray(t)?t:[t],VP]}function UP(t,e,n){const r=x1(t);return Nh(()=>Rh("date",r,n),()=>new Intl.DateTimeFormat(r,n)).format(ia(e)?new Date(e):e)}function f0(t,e,n){const r=x1(t);return Nh(()=>Rh("number",r,n),()=>new Intl.NumberFormat(r,n)).format(e)}function zS(t,e,n,{offset:r=0,...o}){const i=x1(t),s=e?Nh(()=>Rh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):Nh(()=>Rh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[n]??o[s.select(n-r)]??o.other}function Nh(t,e){const n=t();let r=jS.get(n);return r||(r=e(),jS.set(n,r)),r}function Rh(t,e,n){const r=e.join("-");return`${t}-${r}-${JSON.stringify(n)}`}const HP=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,tF=(t,e,n={})=>{const r=e||t,o=s=>typeof s=="object"?s:n[s]||{style:s},i=(s,a)=>{const l=Object.keys(n).length?o("number"):void 0,c=f0(r,s,l);return a.replace("#",c)};return{plural:(s,a)=>{const{offset:l=0}=a,c=zS(r,!1,s,a);return i(s-l,c)},selectordinal:(s,a)=>{const{offset:l=0}=a,c=zS(r,!0,s,a);return i(s-l,c)},select:nF,number:(s,a)=>f0(r,s,o(a)),date:(s,a)=>UP(r,s,o(a)),undefined:rF}},nF=(t,e)=>e[t]??e.other,rF=t=>t;function oF(t,e,n){return(r={},o)=>{const i=tF(e,n,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(ia(u))return c+u;const[d,f,p]=u;let h={};p!=null&&typeof p=="object"?Object.entries(p).forEach(([v,y])=>{h[v]=s(y)}):h=p;const g=i[f],x=g(r[d],h);return x==null?c:c+x},""):l,a=s(t);return ia(a)&&HP.test(a)?Qz(a.trim()):ia(a)?a.trim():a?String(a):""}}var iF=Object.defineProperty,sF=(t,e,n)=>e in t?iF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aF=(t,e,n)=>(sF(t,typeof e!="symbol"?e+"":e,n),n);class lF{constructor(){aF(this,"_events",{})}on(e,n){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push(n),()=>this.removeListener(e,n)}removeListener(e,n){const r=this._getListeners(e);if(!r)return;const o=r.indexOf(n);~o&&r.splice(o,1)}emit(e,...n){const r=this._getListeners(e);r&&r.map(o=>o.apply(this,n))}_getListeners(e){const n=this._events[e];return Array.isArray(n)?n:!1}}var cF=Object.defineProperty,uF=(t,e,n)=>e in t?cF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ha=(t,e,n)=>(uF(t,typeof e!="symbol"?e+"":e,n),n);class dF extends lF{constructor(e){super(),Ha(this,"_locale",""),Ha(this,"_locales"),Ha(this,"_localeData",{}),Ha(this,"_messages",{}),Ha(this,"_missing"),Ha(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??VP,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,n){const r=this._localeData[e];r?Object.assign(r,n):this._localeData[e]=n}loadLocaleData(e,n){n!=null?this._loadLocaleData(e,n):Object.keys(e).forEach(r=>this._loadLocaleData(r,e[r])),this.emit("change")}_load(e,n){const r=this._messages[e];r?Object.assign(r,n):this._messages[e]=n}load(e,n){typeof e=="string"&&typeof n=="object"?this._load(e,n):Object.entries(e).forEach(([r,o])=>this._load(r,o)),this.emit("change")}loadAndActivate({locale:e,locales:n,messages:r}){this._locale=e,this._locales=n||void 0,this._messages[this._locale]=r,this.emit("change")}activate(e,n){this._locale=e,this._locales=n,this.emit("change")}_(e,n,r){let o=r==null?void 0:r.message;ia(e)||(n=e.values||n,o=e.message,e=e.id);const i=this.messages[e],s=i===void 0,a=this._missing;if(a&&s)return eF(a)?a(this._locale,e):a;s&&this.emit("missing",{id:e,locale:this._locale});let l=i||o||e;return ia(l)&&HP.test(l)?JSON.parse(`"${l}"`):ia(l)?l:oF(l,this._locale,this._locales)(n,r==null?void 0:r.formats)}date(e,n){return UP(this._locales||this._locale,e,n)}number(e,n){return f0(this._locales||this._locale,e,n)}}function fF(t={}){return new dF(t)}const Dm=fF();function W(t,e){return e?"other":t==1?"one":"other"}function hi(t,e){return e?"other":t==0||t==1?"one":"other"}function Ln(t,e){var n=String(t).split("."),r=!n[1];return e?"other":t==1&&r?"one":"other"}function He(t,e){return"other"}function Os(t,e){return e?"other":t==1?"one":t==2?"two":"other"}const pF=He,hF=W,mF=hi;function gF(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const vF=W;function yF(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function xF(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function bF(t,e){return e?t==1||t==5||t==7||t==8||t==9||t==10?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const wF=W,kF=Ln;function SF(t,e){var n=String(t).split("."),r=n[0],o=r.slice(-1),i=r.slice(-2),s=r.slice(-3);return e?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":r==0||o==6||i==40||i==60||i==90?"many":"other":t==1?"one":"other"}function EF(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return e?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":r&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const _F=W,CF=W,OF=W,TF=hi,PF=He;function MF(t,e){return e?t==1||t==5||t==7||t==8||t==9||t==10?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const NF=He;function RF(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2),s=r&&n[0].slice(-6);return e?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":t!=0&&r&&s==0?"many":"other"}const $F=W;function AF(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function IF(t,e){var n=String(t).split("."),r=!n[1];return e?t==1||t==3?"one":t==2?"two":t==4?"few":"other":t==1&&r?"one":"other"}const DF=W;function LF(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const jF=W,zF=W,FF=W;function BF(t,e){var n=String(t).split("."),r=n[0],o=!n[1];return e?"other":t==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function VF(t,e){return e?t==0||t==7||t==8||t==9?"zero":t==1?"one":t==2?"two":t==3||t==4?"few":t==5||t==6?"many":"other":t==0?"zero":t==1?"one":t==2?"two":t==3?"few":t==6?"many":"other"}function UF(t,e){var n=String(t).split("."),r=n[0],o=Number(n[0])==t;return e?"other":t==1||!o&&(r==0||r==1)?"one":"other"}const HF=Ln;function WF(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return e?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const KF=W,qF=He,GF=W,YF=W;function XF(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":t==1&&r?"one":"other"}const ZF=W,JF=W,QF=Ln,eB=W;function tB(t,e){return e?"other":t>=0&&t<=1?"one":"other"}function nB(t,e){return e?"other":t>=0&&t<2?"one":"other"}const rB=Ln;function oB(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?t==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const iB=W;function sB(t,e){return e?t==1?"one":"other":t>=0&&t<2?"one":"other"}const aB=W,lB=Ln;function cB(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1?"one":"other":t==1?"one":t==2?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"}function uB(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1||t==11?"one":t==2||t==12?"two":t==3||t==13?"few":"other":t==1||t==11?"one":t==2||t==12?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"}const dB=Ln,fB=W;function pB(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const hB=hi;function mB(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const gB=W,vB=W;function yB(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1);return e?"other":t==1&&o?"one":r==2&&o?"two":o&&(t<0||t>10)&&i&&s==0?"many":"other"}function xB(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}function bB(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function wB(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return e?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function kB(t,e){return e?t==1||t==5?"one":"other":t==1?"one":"other"}function SB(t,e){return e?t==1?"one":"other":t>=0&&t<2?"one":"other"}const EB=Ln,_B=He,CB=He,OB=He,TB=Ln;function PB(t,e){var n=String(t).split("."),r=n[0],o=Number(n[0])==t,i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1&&s!=11||!o?"one":"other"}function MB(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}const NB=Os;function RB(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1);return e?"other":t==1&&o?"one":r==2&&o?"two":o&&(t<0||t>10)&&i&&s==0?"many":"other"}const $B=He,AB=He,IB=W,DB=Ln,LB=W,jB=He,zB=He;function FB(t,e){var n=String(t).split("."),r=n[0],o=r.slice(-2);return e?r==1?"one":r==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":t==1?"one":"other"}function BB(t,e){return e?"other":t>=0&&t<2?"one":"other"}const VB=W,UB=W,HB=He,WB=He;function KB(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1);return e?o==6||o==9||r&&o==0&&t!=0?"many":"other":t==1?"one":"other"}const qB=W,GB=W,YB=He;function XB(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const ZB=He,JB=W,QB=W;function eV(t,e){return e?"other":t==0?"zero":t==1?"one":"other"}const tV=W;function nV(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2),i=r&&n[0].slice(-3),s=r&&n[0].slice(-5),a=r&&n[0].slice(-6);return e?r&&t>=1&&t<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":t==5||o==5?"many":"other":t==0?"zero":t==1?"one":o==2||o==22||o==42||o==62||o==82||r&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||t!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":t!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const rV=W;function oV(t,e){var n=String(t).split("."),r=n[0];return e?"other":t==0?"zero":(r==0||r==1)&&t!=0?"one":"other"}const iV=W,sV=W,aV=He,lV=hi;function cV(t,e){return e&&t==1?"one":"other"}function uV(t,e){var n=String(t).split("."),r=n[1]||"",o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":r!=0?"many":"other"}function dV(t,e){var n=String(t).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return e?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const fV=W,pV=hi,hV=W;function mV(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const gV=W,vV=W;function yV(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-2);return e?t==1?"one":"other":t==1&&r?"one":!r||t==0||i>=2&&i<=19?"few":"other"}function xV(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":"other":t==1?"one":"other"}function bV(t,e){return e&&t==1?"one":"other"}function wV(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==1?"one":t==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const kV=He,SV=W,EV=Os,_V=W,CV=W;function OV(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?r&&t>=1&&t<=4?"one":"other":t==1?"one":"other"}const TV=Ln,PV=W,MV=W,NV=W,RV=He,$V=W,AV=hi,IV=W,DV=W,LV=W;function jV(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1||t==5||r&&t>=7&&t<=9?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t==1?"one":"other"}const zV=W,FV=He,BV=hi,VV=W;function UV(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":t==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&r!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function HV(t,e){var n=String(t).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return e?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const WV=W;function KV(t,e){var n=String(t).split("."),r=n[0];return e?"other":r==0||r==1?"one":"other"}const qV=Ln,GV=W;function YV(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-2);return e?t==1?"one":"other":t==1&&r?"one":!r||t==0||i>=2&&i<=19?"few":"other"}const XV=W,ZV=He;function JV(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const QV=W,eU=He,tU=W;function nU(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}function rU(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}const oU=W,iU=W,sU=Os,aU=W,lU=He,cU=He;function uU(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function dU(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?"other":t>=0&&t<=1?"one":r&&t>=2&&t<=10?"few":"other"}function fU(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"";return e?"other":t==0||t==1||r==0&&o==1?"one":"other"}function pU(t,e){var n=String(t).split("."),r=n[0],o=!n[1];return e?"other":t==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function hU(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-2);return e?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const mU=Os,gU=Os,vU=Os,yU=Os,xU=Os,bU=W,wU=W;function kU(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return e?t==1?"one":o==4&&i!=14?"many":"other":t==1?"one":"other"}function SU(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const EU=W,_U=W,CU=W,OU=He;function TU(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?(i==1||i==2)&&s!=11&&s!=12?"one":"other":t==1&&r?"one":"other"}const PU=Ln,MU=W,NU=W,RU=W,$U=W,AU=He,IU=hi,DU=W;function LU(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1);return e?o==6||o==9||t==10?"few":"other":t==1?"one":"other"}function jU(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?t==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const zU=W,FU=He,BU=W,VU=W;function UU(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?"other":t==0||t==1||r&&t>=11&&t<=99?"one":"other"}const HU=W;function WU(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return e?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const KU=Ln,qU=W,GU=W;function YU(t,e){return e&&t==1?"one":"other"}const XU=W,ZU=W,JU=hi,QU=W,eH=He,tH=W,nH=W,rH=Ln,oH=He,iH=He,sH=He;function aH(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const lH=Object.freeze(Object.defineProperty({__proto__:null,_in:pF,af:hF,ak:mF,am:gF,an:vF,ar:yF,ars:xF,as:bF,asa:wF,ast:kF,az:SF,be:EF,bem:_F,bez:CF,bg:OF,bho:TF,bm:PF,bn:MF,bo:NF,br:RF,brx:$F,bs:AF,ca:IF,ce:DF,ceb:LF,cgg:jF,chr:zF,ckb:FF,cs:BF,cy:VF,da:UF,de:HF,dsb:WF,dv:KF,dz:qF,ee:GF,el:YF,en:XF,eo:ZF,es:JF,et:QF,eu:eB,fa:tB,ff:nB,fi:rB,fil:oB,fo:iB,fr:sB,fur:aB,fy:lB,ga:cB,gd:uB,gl:dB,gsw:fB,gu:pB,guw:hB,gv:mB,ha:gB,haw:vB,he:yB,hi:xB,hr:bB,hsb:wB,hu:kB,hy:SB,ia:EB,id:_B,ig:CB,ii:OB,io:TB,is:PB,it:MB,iu:NB,iw:RB,ja:$B,jbo:AB,jgo:IB,ji:DB,jmc:LB,jv:jB,jw:zB,ka:FB,kab:BB,kaj:VB,kcg:UB,kde:HB,kea:WB,kk:KB,kkj:qB,kl:GB,km:YB,kn:XB,ko:ZB,ks:JB,ksb:QB,ksh:eV,ku:tV,kw:nV,ky:rV,lag:oV,lb:iV,lg:sV,lkt:aV,ln:lV,lo:cV,lt:uV,lv:dV,mas:fV,mg:pV,mgo:hV,mk:mV,ml:gV,mn:vV,mo:yV,mr:xV,ms:bV,mt:wV,my:kV,nah:SV,naq:EV,nb:_V,nd:CV,ne:OV,nl:TV,nn:PV,nnh:MV,no:NV,nqo:RV,nr:$V,nso:AV,ny:IV,nyn:DV,om:LV,or:jV,os:zV,osa:FV,pa:BV,pap:VV,pl:UV,prg:HV,ps:WV,pt:KV,pt_PT:qV,rm:GV,ro:YV,rof:XV,root:ZV,ru:JV,rwk:QV,sah:eU,saq:tU,sc:nU,scn:rU,sd:oU,sdh:iU,se:sU,seh:aU,ses:lU,sg:cU,sh:uU,shi:dU,si:fU,sk:pU,sl:hU,sma:mU,smi:gU,smj:vU,smn:yU,sms:xU,sn:bU,so:wU,sq:kU,sr:SU,ss:EU,ssy:_U,st:CU,su:OU,sv:TU,sw:PU,syr:MU,ta:NU,te:RU,teo:$U,th:AU,ti:IU,tig:DU,tk:LU,tl:jU,tn:zU,to:FU,tr:BU,ts:VU,tzm:UU,ug:HU,uk:WU,ur:KU,uz:qU,ve:GU,vi:YU,vo:XU,vun:ZU,wa:JU,wae:QU,wo:eH,xh:tH,xog:nH,yi:rH,yo:oH,yue:iH,zh:sH,zu:aH},Symbol.toStringTag,{value:"Module"}));var cH=Object.defineProperty,uH=Object.getOwnPropertyDescriptor,dH=Object.getOwnPropertyNames,fH=Object.prototype.hasOwnProperty,FS=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of dH(e))!fH.call(t,o)&&o!==n&&cH(t,o,{get:()=>e[o],enumerable:!(r=uH(e,o))||r.enumerable});return t},pH=(t,e,n)=>(FS(t,e,"default"),n&&FS(n,e,"default")),hH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),WP={};pH(WP,lH);Dm.loadLocaleData("en",{plurals:WP.en});Dm.load("en",hH);Dm.activate("en");var mH=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,b1=(t,e,n,r)=>{for(var o=r>1?void 0:r?gH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&mH(e,n,o),o},ec=class extends Or{get name(){return"doc"}createNodeSpec(t,e){const{docAttributes:n,content:r}=this.options,o=se();if(Pa(n))for(const[i,s]of $t(n))o[i]={default:s};else for(const i of n)o[i]={default:null};return{attrs:o,content:r,...e}}setDocAttributes(t){return({tr:e,dispatch:n})=>{if(n){for(const[r,o]of Object.entries(t))e.step(new Ed(r,o));n(e)}return!0}}isDefaultDocNode({state:t=this.store.getState(),options:e}={}){return m1(t.doc,e)}};b1([oe()],ec.prototype,"setDocAttributes",1);b1([bt()],ec.prototype,"isDefaultDocNode",1);ec=b1([Le({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:qe.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],ec);var KP="SetDocAttribute",qP="RevertSetDocAttribute",Ed=class extends It{constructor(t,e,n=KP){super(),this.stepType=n,this.key=t,this.value=e}static fromJSON(t,e){return new Ed(e.key,e.value,e.stepType)}apply(t){this.previous=t.attrs[this.key];const e={...t.attrs,[this.key]:this.value};return Et.ok(t.type.create(e,t.content,t.marks))}invert(){return new Ed(this.key,this.previous,qP)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{It.jsonID(KP,Ed),It.jsonID(qP,Ed)}catch(t){if(!t.message.startsWith("Duplicate use of step JSON ID"))throw t}var vH=Object.defineProperty,yH=Object.getOwnPropertyDescriptor,GP=(t,e,n,r)=>{for(var o=r>1?void 0:r?yH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&vH(e,n,o),o};function xH(t,e,n,r){const o=t.docView.posFromDOM(e,n,r);return o===null||o<0?null:o}function bH(t,e){const n=e.target;if(n){const r=xH(t,n,0);if(r!==null){const o=t.state.doc.resolve(r),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:r,inside:s}}}return t.posAtCoords({left:e.clientX,top:e.clientY})??void 0}var $h=class extends ut{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=t=>(e,n)=>{const r=n,o=bH(e,r);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=e.state.doc.resolve(l),u=c.depth+1;for(const d of FT(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=si(c,d);f&&s.push(f)}return t(r,{view:e,nodes:i,marks:s,getMark:d=>{const f=ge(d)?e.state.schema.marks[d]:d;return de(f,{code:B.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ge(d)?e.state.schema.nodes[d]:d;de(p,{code:B.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:g})=>g.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var t,e;if(!((t=this.store.managerSettings.exclude)!=null&&t.clickHandler))for(const n of this.store.extensions){if(!n.createEventHandlers||(e=n.options.exclude)!=null&&e.clickHandler)continue;const r=n.createEventHandlers();for(const[o,i]of $t(r))this.addHandler(o,i)}}createPlugin(){const t=new WeakMap,e=(n,r,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=t.has(l),g=wH({$pos:p,handled:h,view:o,state:u});let x=!1;h||(x=n(l,g)||x);const v={...g,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:y=>{const w=ge(y)?d.nodes[y]:y;return de(w,{code:B.EXTENSION,message:"The node being checked does not exist"}),w===s.type?{node:s,pos:a}:void 0}};return t.set(l,!0),r(l,v)||x};return{props:{handleKeyPress:(n,r)=>this.options.keypress(r)||!1,handleKeyDown:(n,r)=>this.options.keydown(r)||!1,handleTextInput:(n,r,o,i)=>this.options.textInput({from:r,to:o,text:i})||!1,handleClickOn:(n,r,o,i,s,a)=>e(this.options.clickMark,this.options.click,n,r,o,i,s,a),handleDoubleClickOn:(n,r,o,i,s,a)=>e(this.options.doubleClickMark,this.options.doubleClick,n,r,o,i,s,a),handleTripleClickOn:(n,r,o,i,s,a)=>e(this.options.tripleClickMark,this.options.tripleClick,n,r,o,i,s,a),handleDOMEvents:{focus:(n,r)=>this.options.focus(r)||!1,blur:(n,r)=>this.options.blur(r)||!1,mousedown:(n,r)=>(this.startMouseover(),this.options.mousedown(r)||!1),mouseup:(n,r)=>(this.endMouseover(),this.options.mouseup(r)||!1),mouseleave:(n,r)=>(this.mouseover=!1,this.options.mouseleave(r)||!1),mouseenter:(n,r)=>(this.mouseover=!0,this.options.mouseenter(r)||!1),keyup:(n,r)=>this.options.keyup(r)||!1,mouseout:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!1};return this.options.hover(n,o)||!1}),mouseover:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!0};return this.options.hover(n,o)||!1}),contextmenu:this.createMouseEventHandler((n,r)=>this.options.contextmenu(n,r)||!1),scroll:(n,r)=>this.options.scroll(r)||!1,copy:(n,r)=>this.options.copy(r)||!1,cut:(n,r)=>this.options.cut(r)||!1,paste:(n,r)=>this.options.paste(r)||!1}},view:n=>{let r=n.editable;const o=this.options;return{update(i){const s=i.editable;s!==r&&(o.editable(s),r=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};GP([bt()],$h.prototype,"isInteracting",1);$h=GP([Le({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:qe.High})],$h);function wH(t){const{handled:e,view:n,$pos:r,state:o}=t,i={getMark:jT,markRanges:[],view:n,state:o};if(e)return i;for(const{type:s}of r.marksAcross(r)??[]){const a=si(r,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ge(s)?o.schema.marks[s]:s;return de(a,{code:B.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class xt extends Te{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return xt.valid(r)?new xt(r):Te.near(r)}content(){return G.empty}eq(e){return e instanceof xt&&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 xt(e.resolve(n.pos))}getBookmark(){return new w1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!kH(e)||!SH(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&xt.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(xt.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!fe.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(xt.valid(a))return a}return null}}}xt.prototype.visible=!1;xt.findFrom=xt.findGapCursorFrom;Te.jsonID("gapcursor",xt);class w1{constructor(e){this.pos=e}map(e){return new w1(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xt.valid(n)?new xt(n):Te.near(n)}}function kH(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function SH(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function EH(){return new pi({props:{decorations:TH,createSelectionBetween(t,e,n){return e.pos==n.pos&&xt.valid(n)?new xt(n):null},handleClick:CH,handleKeyDown:_H,handleDOMEvents:{beforeinput:OH}}})}const _H=NP({ArrowLeft:Lf("horiz",-1),ArrowRight:Lf("horiz",1),ArrowUp:Lf("vert",-1),ArrowDown:Lf("vert",1)});function Lf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof xe){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=xt.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new xt(c))),!0):!1}}function CH(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!xt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&fe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new xt(r))),!0)}function OH(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof xt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=D.empty;for(let s=r.length-1;s>=0;s--)o=D.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new G(o,0,0));return i.setSelection(xe.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function TH(t){if(!(t.selection instanceof xt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ze.create(t.doc,[ct.widget(t.selection.head,e,{key:"gapcursor"})])}var PH=Object.defineProperty,MH=Object.getOwnPropertyDescriptor,NH=(t,e,n,r)=>{for(var o=r>1?void 0:r?MH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&PH(e,n,o),o},p0=class extends ut{get name(){return"gapCursor"}createExternalPlugins(){return[EH()]}};p0=NH([Le({})],p0);var Ah=200,Wt=function(){};Wt.prototype.append=function(e){return e.length?(e=Wt.from(e),!this.length&&e||e.length<Ah&&this.leafAppend(e)||this.length<Ah&&e.leafPrepend(this)||this.appendInner(e)):this};Wt.prototype.prepend=function(e){return e.length?Wt.from(e).append(this):this};Wt.prototype.appendInner=function(e){return new RH(this,e)};Wt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Wt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Wt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Wt.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)};Wt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o};Wt.from=function(e){return e instanceof Wt?e:e&&e.length?new YP(e):Wt.empty};var YP=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(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Ah)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Ah)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Wt);Wt.empty=new YP([]);var RH=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 r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,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}(Wt);const $H=500;class Ur{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new lo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new lo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Ur(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,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new lo(e.mapping.maps[u],d,n),p;(p=l&&l.merge(f))&&(f=p,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>IH&&(a=AH(a,c),s-=c),new Ur(a.append(i),s)}remapping(e,n){let r=new Ml;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ur(this.items.append(e.map(n=>new lo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),x=f.selection&&f.selection.map(i.slice(l+1,p));x&&a++,r.push(new lo(h,g,x))}else r.push(new lo(h))},o);let c=[];for(let f=n;f<s;f++)c.push(new lo(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Ur(u,a);return d.emptyItemCount()>$H&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;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&&i++;let d=new lo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Ur(Wt.from(o.reverse()),i)}}Ur.empty=new Ur(Wt.empty,0);function AH(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class lo{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new lo(n.getMap().invert(),n,this.selection)}}}class Li{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const IH=20;function DH(t,e,n,r){let o=n.getMeta(vo),i;if(o)return o.historyState;n.getMeta(jH)&&(t=new Li(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(vo))return s.getMeta(vo).redo?new Li(t.done.addTransform(n,void 0,r,vp(e)),t.undone,BS(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Li(t.done,t.undone.addTransform(n,void 0,r,vp(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||!LH(n,t.prevRanges)),c=s?rv(t.prevRanges,n.mapping):BS(n.mapping.maps[n.steps.length-1]);return new Li(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,vp(e)),Ur.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Li(t.done.rebased(n,i),t.undone.rebased(n,i),rv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Li(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),rv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function LH(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function BS(t){let e=[];return t.forEach((n,r,o,i)=>e.push(o,i)),e}function rv(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function XP(t,e,n,r){let o=vp(e),i=vo.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new Li(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(vo,{redo:r,historyState:c}).scrollIntoView())}let ov=!1,VS=null;function vp(t){let e=t.plugins;if(VS!=e){ov=!1,VS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){ov=!0;break}}return ov}const vo=new fc("history"),jH=new fc("closeHistory");function zH(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new pi({key:vo,state:{init(){return new Li(Ur.empty,Ur.empty,null,0,-1)},apply(e,n,r){return DH(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?yp:r=="historyRedo"?au:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}const yp=(t,e)=>{let n=vo.getState(t);return!n||n.done.eventCount==0?!1:(e&&XP(n,t,e,!1),!0)},au=(t,e)=>{let n=vo.getState(t);return!n||n.undone.eventCount==0?!1:(e&&XP(n,t,e,!0),!0)};function h0(t){let e=vo.getState(t);return e?e.done.eventCount:0}function FH(t){let e=vo.getState(t);return e?e.undone.eventCount:0}var BH=Object.defineProperty,VH=Object.getOwnPropertyDescriptor,Na=(t,e,n,r)=>{for(var o=r>1?void 0:r?VH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&BH(e,n,o),o},Eo=class extends ut{constructor(){super(...arguments),this.wrapMethod=(t,e)=>({state:n,dispatch:r,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=tt(i)?i():n,l=tt(s)&&r?s():r,c=t(a,l,o);return e==null||e(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":Br.isMac?()=>!1:this.wrapMethod(au,this.options.onRedo),"Mod-z":this.wrapMethod(yp,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(au,this.options.onRedo)}}undoShortcut(t){return this.wrapMethod(yp,this.options.onUndo)(t)}redoShortcut(t){return this.wrapMethod(au,this.options.onRedo)(t)}createExternalPlugins(){const{depth:t,newGroupDelay:e}=this.options;return[zH({depth:t,newGroupDelay:e})]}undo(){return _S(this.wrapMethod(yp,this.options.onUndo))}redo(){return _S(this.wrapMethod(au,this.options.onRedo))}undoDepth(t=this.store.getState()){return h0(t)}redoDepth(t=this.store.getState()){return FH(t)}};Na([ar({shortcut:U.Undo,command:"undo"})],Eo.prototype,"undoShortcut",1);Na([ar({shortcut:U.Redo,command:"redo"})],Eo.prototype,"redoShortcut",1);Na([oe({disableChaining:!0,description:({t})=>t(xh.UNDO_DESCRIPTION),label:({t})=>t(xh.UNDO_LABEL),icon:"arrowGoBackFill"})],Eo.prototype,"undo",1);Na([oe({disableChaining:!0,description:({t})=>t(xh.REDO_DESCRIPTION),label:({t})=>t(xh.REDO_LABEL),icon:"arrowGoForwardFill"})],Eo.prototype,"redo",1);Na([bt()],Eo.prototype,"undoDepth",1);Na([bt()],Eo.prototype,"redoDepth",1);Eo=Na([Le({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Eo);var UH=Object.defineProperty,HH=Object.getOwnPropertyDescriptor,Lm=(t,e,n,r)=>{for(var o=r>1?void 0:r?HH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&UH(e,n,o),o},WH={icon:"paragraph",label:({t})=>t(bh.INSERT_LABEL),description:({t})=>t(bh.INSERT_DESCRIPTION)},KH={icon:"paragraph",label:({t})=>t(bh.CONVERT_LABEL),description:({t})=>t(bh.CONVERT_DESCRIPTION)},ba=class extends Or{get name(){return"paragraph"}createTags(){return[Ce.LastNodeCompatible,Ce.TextBlock,Ce.Block,Ce.FormattingNode]}createNodeSpec(t,e){return{content:"inline*",draggable:!1,...e,attrs:{...t.defaults()},parseDOM:[{tag:"p",getAttrs:n=>({...t.parse(n)})},...e.parseDOM??[]],toDOM:n=>["p",t.dom(n),0]}}convertParagraph(t={}){const{attrs:e,selection:n,preserveAttrs:r}=t;return this.store.commands.setBlockNodeType.original(this.type,e,n,r)}insertParagraph(t,e={}){const{selection:n,attrs:r}=e;return this.store.commands.insertNode.original(this.type,{content:t,selection:n,attrs:r})}shortcut(t){return this.convertParagraph()(t)}};Lm([oe(KH)],ba.prototype,"convertParagraph",1);Lm([oe(WH)],ba.prototype,"insertParagraph",1);Lm([ar({shortcut:U.Paragraph,command:"convertParagraph"})],ba.prototype,"shortcut",1);ba=Lm([Le({defaultPriority:qe.Medium})],ba);function Go(t,e,n){return Math.min(Math.max(t,n),e)}class qH extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var lu=qH;function k1(t){if(typeof t!="string")throw new lu(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=tW.test(t)?XH(t):t;const n=ZH.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(_d(a,2),16)),parseInt(_d(s[3]||"f",2),16)/255]}const r=JH.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=QH.exec(e);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=eW.exec(e);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Go(0,100,a)!==a)throw new lu(t);if(Go(0,100,l)!==l)throw new lu(t);return[...nW(s,a,l),Number.isNaN(c)?1:c]}throw new lu(t)}function GH(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const US=t=>parseInt(t.replace(/_/g,""),36),YH="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=US(e.substring(0,3)),r=US(e.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return t[n]=`${o}${r}`,t},{});function XH(t){const e=t.toLowerCase().trim(),n=YH[GH(e)];if(!n)throw new lu(t);return`#${n}`}const _d=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),ZH=new RegExp(`^#${_d("([a-f0-9])",3)}([a-f0-9])?$`,"i"),JH=new RegExp(`^#${_d("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),QH=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_d(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),eW=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,tW=/^[a-z]+$/i,HS=t=>Math.round(t*255),nW=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map(HS);const o=(t%360+360)%360/60,i=(1-Math.abs(2*r-1))*(e/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(HS)};function rW(t){const[e,n,r,o]=k1(t).map((d,f)=>f===3?d:d/255),i=Math.max(e,n,r),s=Math.min(e,n,r),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(e===i?(n-r)/l+(n<r?6:0):n===i?(r-e)/l+2:(e-n)/l+4),c,a,o]}function oW(t,e,n,r){return`hsla(${(t%360).toFixed()}, ${Go(0,100,e*100).toFixed()}%, ${Go(0,100,n*100).toFixed()}%, ${parseFloat(Go(0,1,r).toFixed(3))})`}function Kn(t,e){const[n,r,o,i]=rW(t);return oW(n,r,o-e,i)}function iW(t){if(t==="transparent")return 0;function e(i){const s=i/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,o]=k1(t);return .2126*e(n)+.7152*e(r)+.0722*e(o)}function sW(t,e,n,r){return`rgba(${Go(0,255,t).toFixed()}, ${Go(0,255,e).toFixed()}, ${Go(0,255,n).toFixed()}, ${parseFloat(Go(0,1,r).toFixed(3))})`}function xp(t,e){return Kn(t,-e)}function Ih(t,e){const[n,r,o,i]=k1(t);return sW(n,r,o,i-e)}function aW(t){return iW(t)>.179}function Al(t){return aW(t)?"#000":"#fff"}const lW="remirror-editor-wrapper",cW="remirror-button-active",uW="remirror-button",dW="remirror-composite",fW="remirror-dialog",pW="remirror-dialog-backdrop",hW="remirror-form",mW="remirror-form-message",gW="remirror-form-label",vW="remirror-form-group",yW="remirror-group",xW="remirror-input",bW="remirror-menu",wW="remirror-menu-pane",kW="remirror-menu-pane-active",SW="remirror-menu-dropdown-label",EW="remirror-menu-pane-icon",_W="remirror-menu-pane-label",CW="remirror-menu-pane-shortcut",OW="remirror-menu-button-left",TW="remirror-menu-button-right",PW="remirror-menu-button-nested-left",MW="remirror-menu-button-nested-right",NW="remirror-menu-button",RW="remirror-menu-bar",$W="remirror-flex-column",AW="remirror-flex-row",IW="remirror-menu-item",DW="remirror-menu-item-row",LW="remirror-menu-item-column",jW="remirror-menu-item-checkbox",zW="remirror-menu-item-radio",FW="remirror-menu-group",BW="remirror-floating-popover",VW="remirror-popover",UW="remirror-animated-popover",HW="remirror-role",WW="remirror-separator",KW="remirror-tab",qW="remirror-tab-list",GW="remirror-tabbable",YW="remirror-toolbar",XW="remirror-tooltip",ZW="remirror-table-size-editor",JW="remirror-table-size-editor-body",QW="remirror-table-size-editor-cell",eK="remirror-table-size-editor-cell-selected",tK="remirror-table-size-editor-footer",nK="remirror-color-picker",rK="remirror-color-picker-cell",oK="remirror-color-picker-cell-selected";var iK=Object.freeze({__proto__:null,ANIMATED_POPOVER:UW,BUTTON:uW,BUTTON_ACTIVE:cW,COLOR_PICKER:nK,COLOR_PICKER_CELL:rK,COLOR_PICKER_CELL_SELECTED:oK,COMPOSITE:dW,DIALOG:fW,DIALOG_BACKDROP:pW,EDITOR_WRAPPER:lW,FLEX_COLUMN:$W,FLEX_ROW:AW,FLOATING_POPOVER:BW,FORM:hW,FORM_GROUP:vW,FORM_LABEL:gW,FORM_MESSAGE:mW,GROUP:yW,INPUT:xW,MENU:bW,MENU_BAR:RW,MENU_BUTTON:NW,MENU_BUTTON_LEFT:OW,MENU_BUTTON_NESTED_LEFT:PW,MENU_BUTTON_NESTED_RIGHT:MW,MENU_BUTTON_RIGHT:TW,MENU_DROPDOWN_LABEL:SW,MENU_GROUP:FW,MENU_ITEM:IW,MENU_ITEM_CHECKBOX:jW,MENU_ITEM_COLUMN:LW,MENU_ITEM_RADIO:zW,MENU_ITEM_ROW:DW,MENU_PANE:wW,MENU_PANE_ACTIVE:kW,MENU_PANE_ICON:EW,MENU_PANE_LABEL:_W,MENU_PANE_SHORTCUT:CW,POPOVER:VW,ROLE:HW,SEPARATOR:WW,TAB:KW,TABBABLE:GW,TABLE_SIZE_EDITOR:ZW,TABLE_SIZE_EDITOR_BODY:JW,TABLE_SIZE_EDITOR_CELL:QW,TABLE_SIZE_EDITOR_CELL_SELECTED:eK,TABLE_SIZE_EDITOR_FOOTER:tK,TAB_LIST:qW,TOOLBAR:YW,TOOLTIP:XW});const sK="remirror-image-loader";var aK=Object.freeze({__proto__:null,IMAGE_LOADER:sK});const lK="remirror-list-item-with-custom-mark",cK="remirror-ul-list-content",uK="remirror-editor",dK="remirror-list-item-marker-container",fK="remirror-list-item-checkbox",pK="remirror-collapsible-list-item-closed",hK="remirror-collapsible-list-item-button",mK="remirror-list-spine";var ys=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:hK,COLLAPSIBLE_LIST_ITEM_CLOSED:pK,EDITOR:uK,LIST_ITEM_CHECKBOX:fK,LIST_ITEM_MARKER_CONTAINER:dK,LIST_ITEM_WITH_CUSTOM_MARKER:lK,LIST_SPINE:mK,UL_LIST_CONTENT:cK});const gK="remirror-is-empty";var vK=Object.freeze({__proto__:null,IS_EMPTY:gK});const yK="remirror-editor",xK="remirror-positioner",bK="remirror-positioner-widget";var wK=Object.freeze({__proto__:null,EDITOR:yK,POSITIONER:xK,POSITIONER_WIDGET:bK});const Ar={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Yo="#000000",S1="#ffffff",kK="#252103",E1=Ih(Yo,.75),jm="#7963d2",_1="#bcd263",SK="#fff",EK="#fff",C1=Ar.gray[1],WS="rgba(10,31,68,0.08)",KS="rgba(10,31,68,0.10)",qS="rgba(10,31,68,0.12)",_K=xp(Ih(Yo,.1),.13),O1={background:S1,border:E1,foreground:Yo,muted:C1,primary:jm,secondary:_1,primaryText:SK,secondaryText:EK,text:kK,faded:_K},CK={...O1,background:Kn(S1,.15),border:Kn(E1,.15),foreground:Kn(Yo,.15),muted:Kn(C1,.15),primary:Kn(jm,.15),secondary:Kn(_1,.15),get text(){return Al(this.background)},get primaryText(){return Al(this.primary)},get secondaryText(){return Al(this.secondary)}},OK={...O1,background:Kn(S1,.075),border:Kn(E1,.075),foreground:Kn(Yo,.075),muted:Kn(C1,.075),primary:Kn(jm,.075),secondary:Kn(_1,.075),get text(){return Al(this.background)},get primaryText(){return Al(this.primary)},get secondaryText(){return Al(this.secondary)}};({...O1,backdrop:Ih(Yo,.1),outline:Ih(jm,.6),table:(xp(Yo,.8),xp(Yo,.4),Ar.gray[3],Ar.blue[7],Ar.blue[1],Ar.blue[5],Ar.blue[7],xp(Yo,.4),Ar.blue[5],Ar.red[7],Ar.red[1],Ar.red[5])},`${WS}`,`${KS}`,`${qS}`);var TK=Object.defineProperty,PK=Object.getOwnPropertyDescriptor,T1=(t,e,n,r)=>{for(var o=r>1?void 0:r?PK(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&TK(e,n,o),o},ZP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Tt=(t,e,n)=>(ZP(t,e,"read from private field"),n?n.call(t):e.get(t)),Ao=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ki=(t,e,n,r)=>(ZP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),cu,uu,rl,du,bp,fu,pu,hu,mu,wp=class{constructor(t){Ao(this,cu,bm()),Ao(this,uu,[]),Ao(this,rl,new Map),Ao(this,du,[]),Ao(this,bp,!1),Ao(this,fu,void 0),Ao(this,pu,void 0),Ao(this,hu,void 0),Ao(this,mu,void 0),this.addListener=(e,n)=>Tt(this,cu).on(e,n),ki(this,fu,t),ki(this,pu,t.getActive),ki(this,mu,t.getPosition),ki(this,hu,t.getID),this.hasChanged=t.hasChanged,this.events=t.events??["state","scroll"]}static create(t){return new wp(t)}static fromPositioner(t,e){return wp.create({...t.basePositioner,...e})}get basePositioner(){return{getActive:Tt(this,pu),getPosition:Tt(this,mu),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,hu)}}onActiveChanged(t){this.recentUpdate=t;const e=Tt(this,pu).call(this,t);ki(this,uu,e),ki(this,rl,new Map),ki(this,bp,!1),ki(this,du,[]);const n=[];for(const[r,o]of e.entries()){const i=this.getID(o,r);Tt(this,du).push(i),n.push({setElement:s=>this.addProps({...t,data:o,element:s},r),id:i,data:o})}Tt(this,cu).emit("update",n)}getID(t,e){var n;return((n=Tt(this,hu))==null?void 0:n.call(this,t,e))??e.toString()}addProps(t,e){if(Tt(this,bp)||(Tt(this,rl).set(e,t),Tt(this,rl).size<Tt(this,uu).length))return;const n=[];for(const r of Tt(this,uu).keys()){const o=Tt(this,rl).get(r);de(o,{code:B.INTERNAL,message:"Something went wrong when retrieving the parameters"});const i=Tt(this,du)[r];if(!i)return;n.push({position:Tt(this,mu).call(this,o),element:o.element,id:i})}Tt(this,cu).emit("done",n)}clone(t){return wp.create({...Tt(this,fu),...tt(t)?t(Tt(this,fu)):t})}active(t){const e=tt(t)?t:()=>t;return this.clone(n=>({getActive:r=>n.getActive(r).filter(e)}))}},Zr=wp;cu=new WeakMap;uu=new WeakMap;rl=new WeakMap;du=new WeakMap;bp=new WeakMap;fu=new WeakMap;pu=new WeakMap;hu=new WeakMap;mu=new WeakMap;Zr.EMPTY=[];function MK(t,e=tM){const{key:n}=(t==null?void 0:t.getMeta(eM))??{};return n===e}function JP(t){const{tr:e,state:n,previousState:r}=t;return!r||e&&MK(e)?!0:e?N8(e):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function QP(t,e,n={}){const r=e.getBoundingClientRect(),{accountForPadding:o=!1}=n;let i=0,s=0,a=0,l=0;if(So(e)&&o){const u=Number.parseFloat(wi(e,"padding-left").replace("px","")),d=Number.parseFloat(wi(e,"padding-right").replace("px","")),f=Number.parseFloat(wi(e,"padding-top").replace("px","")),p=Number.parseFloat(wi(e,"padding-bottom").replace("px","")),h=Number.parseFloat(wi(e,"border-left").replace("px","")),g=Number.parseFloat(wi(e,"border-right").replace("px","")),x=Number.parseFloat(wi(e,"border-top").replace("px","")),v=Number.parseFloat(wi(e,"border-bottom").replace("px","")),y=e.offsetWidth-e.clientWidth,w=e.offsetHeight-e.clientHeight;i+=u+h+(e.dir==="rtl"?y:0),s+=d+g+(e.dir==="rtl"?0:y),a+=f+x,l+=p+v+w}const c=new DOMRect(r.left+i,r.top+a,r.width-s,r.height-l);for(const[u,d]of[[t.top,t.left],[t.top,t.right],[t.bottom,t.left],[t.bottom,t.right]])if(xk(u,c.top,c.bottom)&&xk(d,c.left,c.right))return!0;return!1}var NK="remirror-positioner-widget",eM="positionerUpdate",tM="__all_positioners__",nM={y:-999999,x:-999999,width:0,height:0},GS={...nM,left:-999999,top:-999999,bottom:-999999,right:-999999},RK={...nM,rect:{...GS,toJSON:()=>GS},visible:!1},$K=Zr.create({hasChanged:JP,getActive(t){const{state:e}=t;if(!f1(e)||e.selection.$anchor.depth>2)return Zr.EMPTY;const n=Tm({predicate:r=>r.type.isBlock,selection:e});return n?[n]:Zr.EMPTY},getPosition(t){const{view:e,data:n}=t,r=e.nodeDOM(n.pos);if(!So(r))return RK;const o=r.getBoundingClientRect(),i=e.dom.getBoundingClientRect(),s=o.height,a=o.width,l=e.dom.scrollLeft+o.left-i.left,c=e.dom.scrollTop+o.top-i.top,u=QP(o,e.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),rM=$K.clone(({getActive:t})=>({getActive:e=>{const[n]=t(e);return n&&g1(n.node)&&n.node.type===Nm(e.state.schema)?[n]:Zr.EMPTY}}));rM.clone(({getPosition:t})=>({getPosition:e=>({...t(e),width:1})}));rM.clone(({getPosition:t})=>({getPosition:e=>{const{width:n,x:r,y:o,height:i}=t(e);return{...t(e),width:1,x:n+r,rect:new DOMRect(n+r,o,1,i)}}}));function P1(t){return Zr.create({hasChanged:JP,getActive:e=>{const{state:n,view:r}=e;if(!t(n)||!Ma(n.selection))return Zr.EMPTY;try{const{head:o,anchor:i}=n.selection;return[{from:r.coordsAtPos(i),to:r.coordsAtPos(o)}]}catch{return Zr.EMPTY}},getPosition(e){const{element:n,data:r,view:o}=e,{from:i,to:s}=r,a=n.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,g=u?1:Math.abs(i.left-s.right),x=new DOMRect(u?s.left:d,f,g,c),v=QP(x,o.dom);return{rect:x,y:h,x:p,height:c,width:g,visible:v}}})}var AK=P1(t=>!t.selection.empty);P1(t=>t.selection.empty);P1(()=>!0);AK.clone(()=>({getActive:t=>{const{state:e,view:n}=t;if(!e.selection.empty)return Zr.EMPTY;const r=hP(e);if(!r)return Zr.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return Zr.EMPTY}}}));var Cd=class extends ut{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:t})=>{if(t)return this.positioners=[...this.positioners,t],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(e=>e!==t)}}}get name(){return"positioner"}createAttributes(){return{class:wK.EDITOR}}init(){this.onScroll=AL(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(t,e)=>(this.positioner(this.getBaseProps("hover",{hover:e})),!1),contextmenu:(t,e)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:e})),!1)}}onStateUpdate(t){this.positioner({...t,previousState:t.firstUpdate?void 0:t.previousState,event:"state",helpers:this.store.helpers})}createDecorations(t){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return ze.empty;const e=ct.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return ze.create(t.doc,[e])}forceUpdatePositioners(t=tM){return({tr:e,dispatch:n})=>(n==null||n(e.setMeta(eM,{key:t})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const t=document.createElement("span");return t.dataset.id=NK,t.setAttribute("role","presentation"),t}triggerPositioner(t,e){t.hasChanged(e)&&t.onActiveChanged({...e,view:this.store.view})}positioner(t){for(const e of this.positioners)e.events.includes(t.event)&&this.triggerPositioner(e,t)}getBaseProps(t,e){const n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:t,firstUpdate:!1,previousState:r,state:n,...e}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};T1([oe()],Cd.prototype,"forceUpdatePositioners",1);T1([bt()],Cd.prototype,"getPositionerWidget",1);Cd=T1([Le({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Cd);var IK=Object.defineProperty,DK=Object.getOwnPropertyDescriptor,LK=(t,e,n,r)=>{for(var o=r>1?void 0:r?DK(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&IK(e,n,o),o},m0=class extends Or{get name(){return"text"}createTags(){return[Ce.InlineNode]}createNodeSpec(){return{}}};m0=LK([Le({disableExtraAttributes:!0,defaultPriority:qe.Medium})],m0);var jK={...ec.defaultOptions,...ba.defaultOptions,...Eo.defaultOptions,excludeExtensions:[]};function zK(t={}){t={...jK,...t};const{content:e,depth:n,getDispatch:r,getState:o,newGroupDelay:i,excludeExtensions:s}=t,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Eo({depth:n,getDispatch:r,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new ec({content:e})),a.text||l.push(new m0),a.paragraph||l.push(new ba),a.positioner||l.push(new Cd),a.gapCursor||l.push(new p0),a.events||l.push(new $h),l}var FK=Object.defineProperty,BK=Object.getOwnPropertyDescriptor,VK=(t,e,n,r)=>{for(var o=r>1?void 0:r?BK(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&FK(e,n,o),o},wa=class extends ut{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(t,e)=>({...this.options,empty:m1(e.doc,{ignoreAttributes:!0})}),apply:(t,e,n,r)=>UK({pluginState:e,tr:t,extension:this,state:r})},props:{decorations:t=>HK({state:t,extension:this})}}}onSetOptions(t){const{changes:e}=t;e.placeholder.changed&&this.store.phase>=Pn.EditorView&&this.store.updateAttributes()}};wa=VK([Le({defaultOptions:{emptyNodeClass:vK.IS_EMPTY,placeholder:""}})],wa);function UK(t){const{pluginState:e,extension:n,tr:r,state:o}=t;return r.docChanged?{...n.options,empty:m1(o.doc)}:e}function HK(t){const{extension:e,state:n}=t,{empty:r}=e.pluginKey.getState(n),{emptyNodeClass:o,placeholder:i}=e.options;if(!r)return null;const s=[];return n.doc.descendants((a,l)=>{const c=ct.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),ze.create(n.doc,s)}var WK=Object.defineProperty,KK=Object.getOwnPropertyDescriptor,qK=(t,e,n,r)=>{for(var o=r>1?void 0:r?KK(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&WK(e,n,o),o},GK={...wa.defaultOptions,...Sd.defaultOptions},YK=[...wa.staticKeys,...Sd.staticKeys],Od=class extends ut{get name(){return"react"}onSetOptions(t){const{pickChanged:e}=t;this.getExtension(wa).setOptions(e(["placeholder"]))}createExtensions(){const{emptyNodeClass:t,placeholder:e,defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new wa({emptyNodeClass:t,placeholder:e,priority:qe.Low}),new Sd({defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};Od=qK([Le({defaultOptions:GK,staticKeys:YK})],Od);var oM={};Object.defineProperty(oM,"__esModule",{value:!0});function XK(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===2)return XS(t[0],t[1])||null;var n=t.slice(1).reduce(function(r,o){return XS(r,o)},t[0]);return n||null}var Ic=oM.default=XK,YS=new WeakMap;function XS(t,e){if(t&&e){var n=YS.get(t)||new WeakMap;YS.set(t,n);var r=n.get(e)||function(o){ZS(t,o),ZS(e,o)};return n.set(e,r),r}return t||e}function ZS(t,e){typeof t=="function"?t(e):t.current=e}var iM=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},iv=(t,e,n)=>(iM(t,e,"read from private field"),n?n.call(t):e.get(t)),ZK=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},JK=(t,e,n,r)=>(iM(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function QK(){const[,t]=m.useState(se());return m.useCallback(()=>{t(se())},[])}var sM=m.createContext(null);function gc(t){const e=m.useContext(sM),n=m.useRef(QK());de(e,{code:B.REACT_PROVIDER_CONTEXT});const{addHandler:r}=e;return m.useEffect(()=>{let o=t;if(o){if(Pa(o)){const{autoUpdate:i}=o;o=i?()=>n.current():void 0}if(tt(o))return r("updated",o)}},[r,t]),e}function eq(t=!0){return gc({autoUpdate:t}).active}function tq(t=!1){return gc(t?{autoUpdate:!0}:void 0).attrs}function M1(){return gc().chain.new()}function nq(t,e=void 0,n){const{getExtension:r}=gc(),o=m.useMemo(()=>r(t),[t,r]);let i;if(tt(e)?i=n?[o,...n]:[o,e]:i=e?[o,...Object.values(e)]:[],m.useEffect(()=>{tt(e)||!e||o.setOptions(e)},i),m.useEffect(()=>{if(tt(e))return e({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!e)return o}function rq(t,e,n){const r=m.useCallback(({addHandler:o})=>o(e,n),[n,e]);return nq(t,r)}function oq(t){rq(Mh,"docChanged",t)}function iq(t=!1){return gc(t?{autoUpdate:!0}:void 0).helpers}var[sq,boe]=Jz(({props:t})=>{const e=t.locale??"en",n=t.i18n??Dm,r=t.supportedLocales??[e],o=n._.bind(n);return{locale:e,i18n:n,supportedLocales:r,t:o}});function JS(t,e={}){const{core:n,react:r,...o}=e;return Fz(t)?t:zz.create(()=>[...BT(t),new Od(r),...zK(n)],o)}function aq(t,e={}){const n=m.useRef(t),r=m.useRef(e),[o,i]=m.useState(()=>JS(t,e));return n.current=t,r.current=e,m.useEffect(()=>o.addHandler("destroy",()=>{i(()=>JS(n.current,r.current))}),[o]),o}var lq=typeof Ic=="object"&&Ic.__esModule&&Ic.default?Ic.default:Ic,ol,cq=class extends Az{constructor(t){if(super(t),ZK(this,ol,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=e=>this.internalGetRootProps(e,null),this.internalGetRootProps=(e,n)=>{this.rootPropsConfig.called=!0;const{refKey:r="ref",ref:o,...i}=e??se();return{[r]:lq(o,this.onRef),key:this.uid,...i,children:n}},this.onRef=e=>{e&&(this.rootPropsConfig.count+=1,de(this.rootPropsConfig.count<=1,{code:B.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),JK(this,ol,e),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(wa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(t){return super.update(t),this}createView(t){return new J7(null,{state:t,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:t,...e}){const{triggerChange:n=!0,tr:r,transactions:o}=e;if(this.props.state){const{onChange:i}=this.props;de(i,{code:B.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),de(n,{code:B.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:t,tr:r,transactions:o});return}!r&&!o&&(t=t.apply(t.tr.setMeta(hk,{}))),this.view.updateState(t),n&&(o==null?void 0:o.length)!==0&&this.onChange({state:t,tr:r,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:t,tr:r,transactions:o})}updateControlledState(t,e){this.previousStateOverride=e,t=t.apply(t.tr.setMeta(hk,{})),this.view.updateState(t),this.manager.onStateUpdate({previousState:this.previousState,state:t}),this.previousStateOverride=void 0}addProsemirrorViewToDom(t,e){this.props.insertPosition==="start"?t.insertBefore(e,t.firstChild):t.append(e)}onRefLoad(){de(iv(this,ol),{code:B.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:t}=this.props;this.addProsemirrorViewToDom(iv(this,ol),this.view.dom),t&&this.focus(t),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&iv(this,ol)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};ol=new WeakMap;var aM=typeof document<"u"?m.useLayoutEffect:m.useEffect;function uq(t){const e=m.useRef();return aM(()=>{e.current=t}),e.current}function dq(t){const{manager:e,state:n}=t,{placeholder:r,editable:o}=t;m.useRef(!0).current&&!hs(r)&&e.getExtension(Od).setOptions({placeholder:r}),m.useEffect(()=>{r!=null&&e.getExtension(Od).setOptions({placeholder:r})},[r,e]);const[s]=m.useState(()=>{if(n)return n;const l=e.createEmptyDoc(),[c,u]=At(t.initialContent)?t.initialContent:[t.initialContent??l];return e.createState({content:c,selection:u})}),a=fq({initialEditorState:s,getProps:()=>t});return m.useEffect(()=>()=>{a.destroy()},[a]),m.useEffect(()=>{a.onUpdate()},[o,a]),pq(a),a.frameworkOutput}function fq(t){const e=m.useRef(t);e.current=t;const n=m.useMemo(()=>new cq(e.current),[]);return n.update(t),n}function pq(t){const{state:e}=t.props,n=m.useRef(!!e),r=uq(e);aM(()=>{const o=e?n.current===!0:n.current===!1;de(o,{code:B.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!e||e===r)&&t.updateControlledState(e,r??void 0)},[e,r,t])}function hq(t={}){const{content:e,document:n,selection:r,extensions:o,...i}=t,s=aq(o??(()=>[]),i),[a,l]=m.useState(()=>s.createState({selection:r,content:e??s.createEmptyDoc()})),c=m.useCallback(({state:d})=>{l(d)},[]),u=m.useCallback(()=>s.output,[s]);return m.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var mq=({onChange:t})=>{const{getJSON:e}=iq();return oq(m.useCallback(({state:n})=>{const r=e(n);t(r)},[t,e])),null},g0=()=>X.createElement("div",{className:iK.EDITOR_WRAPPER,...gc().getRootProps()}),gq=t=>(t.hook(),null);function vq(t){const{children:e,autoRender:n,i18n:r,locale:o,supportedLocales:i,hooks:s=[],...a}=t,l=dq(a),c=Kz(l.portalContainer),u=n==="start"||n===!0||!e&&hs(n),d=n==="end";return X.createElement(sq,{i18n:r,locale:o,supportedLocales:i},X.createElement(sM.Provider,{value:l},X.createElement(Wz,{portals:c}),s.map((f,p)=>X.createElement(gq,{hook:f,key:p})),u&&X.createElement(g0,null),e,d&&X.createElement(g0,null)))}var lM={exports:{}},yq="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xq=yq,bq=xq;function cM(){}function uM(){}uM.resetWarningCache=cM;var wq=function(){function t(r,o,i,s,a,l){if(l!==bq){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:uM,resetWarningCache:cM};return n.PropTypes=n,n};lM.exports=wq();var zm=lM.exports;const kq=["top","right","bottom","left"],xs=Math.min,qn=Math.max,Dh=Math.round,jf=Math.floor,bs=t=>({x:t,y:t}),Sq={left:"right",right:"left",bottom:"top",top:"bottom"},Eq={start:"end",end:"start"};function v0(t,e,n){return qn(t,xs(e,n))}function ai(t,e){return typeof t=="function"?t(e):t}function li(t){return t.split("-")[0]}function vc(t){return t.split("-")[1]}function N1(t){return t==="x"?"y":"x"}function R1(t){return t==="y"?"height":"width"}function yc(t){return["top","bottom"].includes(li(t))?"y":"x"}function $1(t){return N1(yc(t))}function _q(t,e,n){n===void 0&&(n=!1);const r=vc(t),o=$1(t),i=R1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Lh(s)),[s,Lh(s)]}function Cq(t){const e=Lh(t);return[y0(t),e,y0(e)]}function y0(t){return t.replace(/start|end/g,e=>Eq[e])}function Oq(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:s;default:return[]}}function Tq(t,e,n,r){const o=vc(t);let i=Oq(li(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(y0)))),i}function Lh(t){return t.replace(/left|right|bottom|top/g,e=>Sq[e])}function Pq(t){return{top:0,right:0,bottom:0,left:0,...t}}function dM(t){return typeof t!="number"?Pq(t):{top:t,right:t,bottom:t,left:t}}function jh(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function QS(t,e,n){let{reference:r,floating:o}=t;const i=yc(e),s=$1(e),a=R1(s),l=li(e),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vc(e)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1);break}return p}const Mq=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=QS(c,r,l),f=r,p={},h=0;for(let g=0;g<a.length;g++){const{name:x,fn:v}=a[g],{x:y,y:w,data:k,reset:E}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});if(u=y??u,d=w??d,p={...p,[x]:{...p[x],...k}},E&&h<=50){h++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):E.rects),{x:u,y:d}=QS(c,f,l)),g=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function Td(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=ai(e,t),h=dM(p),x=a[f?d==="floating"?"reference":"floating":d],v=jh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),k=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},E=jh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-E.top+h.top)/k.y,bottom:(E.bottom-v.bottom+h.bottom)/k.y,left:(v.left-E.left+h.left)/k.x,right:(E.right-v.right+h.right)/k.x}}const Nq=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=ai(t,e)||{};if(c==null)return{};const d=dM(u),f={x:n,y:r},p=$1(o),h=R1(p),g=await s.getDimensions(c),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",k=i.reference[h]+i.reference[p]-f[p]-i.floating[h],E=f[p]-i.reference[p],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let S=O?O[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(O)))&&(S=a.floating[w]||i.floating[h]);const P=k/2-E/2,M=S/2-g[h]/2-1,$=xs(d[v],M),V=xs(d[y],M),j=$,le=S-g[h]-V,K=S/2-g[h]/2+P,H=v0(j,K,le),C=!l.arrow&&vc(o)!=null&&K!=H&&i.reference[h]/2-(K<j?$:V)-g[h]/2<0,T=C?K<j?K-j:K-le:0;return{[p]:f[p]+T,data:{[p]:H,centerOffset:K-H-T,...C&&{alignmentOffset:T}},reset:C}}}),Rq=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=ai(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=li(o),y=li(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(y||!g?[Lh(a)]:Cq(a));!f&&h!=="none"&&k.push(...Tq(a,g,h,w));const E=[a,...k],O=await Td(e,x),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(O[v]),d){const j=_q(o,s,w);S.push(O[j[0]],O[j[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(j=>j<=0)){var M,$;const j=(((M=i.flip)==null?void 0:M.index)||0)+1,le=E[j];if(le)return{data:{index:j,overflows:P},reset:{placement:le}};let K=($=P.filter(H=>H.overflows[0]<=0).sort((H,C)=>H.overflows[1]-C.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(p){case"bestFit":{var V;const H=(V=P.map(C=>[C.placement,C.overflows.filter(T=>T>0).reduce((T,_)=>T+_,0)]).sort((C,T)=>C[1]-T[1])[0])==null?void 0:V[0];H&&(K=H);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function eE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function tE(t){return kq.some(e=>t[e]>=0)}const $q=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=ai(t,e);switch(r){case"referenceHidden":{const i=await Td(e,{...o,elementContext:"reference"}),s=eE(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:tE(s)}}}case"escaped":{const i=await Td(e,{...o,altBoundary:!0}),s=eE(i,n.floating);return{data:{escapedOffsets:s,escaped:tE(s)}}}default:return{}}}}};async function Aq(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=li(n),a=vc(n),l=yc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=ai(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const Iq=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=e,l=await Aq(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Dq=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...l}=ai(t,e),c={x:n,y:r},u=await Td(e,l),d=yc(li(o)),f=N1(d);let p=c[f],h=c[d];if(i){const x=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=p+u[x],w=p-u[v];p=v0(y,p,w)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[x],w=h-u[v];h=v0(y,h,w)}const g=a.fn({...e,[f]:p,[d]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},Lq=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ai(t,e),u={x:n,y:r},d=yc(o),f=N1(d);let p=u[f],h=u[d];const g=ai(a,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",k=i.reference[f]-i.floating[w]+x.mainAxis,E=i.reference[f]+i.reference[w]-x.mainAxis;p<k?p=k:p>E&&(p=E)}if(c){var v,y;const w=f==="y"?"width":"height",k=["top","left"].includes(li(o)),E=i.reference[d]-i.floating[w]+(k&&((v=s.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),O=i.reference[d]+i.reference[w]+(k?0:((y=s.offset)==null?void 0:y[d])||0)-(k?x.crossAxis:0);h<E?h=E:h>O&&(h=O)}return{[f]:p,[d]:h}}}},jq=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=()=>{},...a}=ai(t,e),l=await Td(e,a),c=li(n),u=vc(n),d=yc(n)==="y",{width:f,height:p}=r.floating;let h,g;c==="top"||c==="bottom"?(h=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,h=u==="end"?"top":"bottom");const x=p-l[h],v=f-l[g],y=!e.middlewareData.shift;let w=x,k=v;if(d){const O=f-l.left-l.right;k=u||y?xs(v,O):O}else{const O=p-l.top-l.bottom;w=u||y?xs(x,O):O}if(y&&!u){const O=qn(l.left,0),S=qn(l.right,0),P=qn(l.top,0),M=qn(l.bottom,0);d?k=f-2*(O!==0||S!==0?O+S:qn(l.left,l.right)):w=p-2*(P!==0||M!==0?P+M:qn(l.top,l.bottom))}await s({...e,availableWidth:k,availableHeight:w});const E=await o.getDimensions(i.floating);return f!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function ws(t){return fM(t)?(t.nodeName||"").toLowerCase():"#document"}function Zn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function mi(t){var e;return(e=(fM(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fM(t){return t instanceof Node||t instanceof Zn(t).Node}function ci(t){return t instanceof Element||t instanceof Zn(t).Element}function _o(t){return t instanceof HTMLElement||t instanceof Zn(t).HTMLElement}function nE(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zn(t).ShadowRoot}function rf(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function zq(t){return["table","td","th"].includes(ws(t))}function A1(t){const e=I1(),n=kr(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Fq(t){let e=tc(t);for(;_o(e)&&!Fm(e);){if(A1(e))return e;e=tc(e)}return null}function I1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fm(t){return["html","body","#document"].includes(ws(t))}function kr(t){return Zn(t).getComputedStyle(t)}function Bm(t){return ci(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tc(t){if(ws(t)==="html")return t;const e=t.assignedSlot||t.parentNode||nE(t)&&t.host||mi(t);return nE(e)?e.host:e}function pM(t){const e=tc(t);return Fm(e)?t.ownerDocument?t.ownerDocument.body:t.body:_o(e)&&rf(e)?e:pM(e)}function Pd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=pM(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=Zn(o);return i?e.concat(s,s.visualViewport||[],rf(o)?o:[],s.frameElement&&n?Pd(s.frameElement):[]):e.concat(o,Pd(o,[],n))}function hM(t){const e=kr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=_o(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,a=Dh(n)!==i||Dh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function D1(t){return ci(t)?t:t.contextElement}function Il(t){const e=D1(t);if(!_o(e))return bs(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=hM(e);let s=(i?Dh(n.width):n.width)/r,a=(i?Dh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Bq=bs(0);function mM(t){const e=Zn(t);return!I1()||!e.visualViewport?Bq:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Vq(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Zn(t)?!1:e}function ka(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=D1(t);let s=bs(1);e&&(r?ci(r)&&(s=Il(r)):s=Il(t));const a=Vq(i,n,r)?mM(i):bs(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Zn(i),p=r&&ci(r)?Zn(r):r;let h=f.frameElement;for(;h&&r&&p!==f;){const g=Il(h),x=h.getBoundingClientRect(),v=kr(h),y=x.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,w=x.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=w,h=Zn(h).frameElement}}return jh({width:u,height:d,x:l,y:c})}function Uq(t){let{rect:e,offsetParent:n,strategy:r}=t;const o=_o(n),i=mi(n);if(n===i)return e;let s={scrollLeft:0,scrollTop:0},a=bs(1);const l=bs(0);if((o||!o&&r!=="fixed")&&((ws(n)!=="body"||rf(i))&&(s=Bm(n)),_o(n))){const c=ka(n);a=Il(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+l.x,y:e.y*a.y-s.scrollTop*a.y+l.y}}function Hq(t){return Array.from(t.getClientRects())}function gM(t){return ka(mi(t)).left+Bm(t).scrollLeft}function Wq(t){const e=mi(t),n=Bm(t),r=t.ownerDocument.body,o=qn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=qn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+gM(t);const a=-n.scrollTop;return kr(r).direction==="rtl"&&(s+=qn(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Kq(t,e){const n=Zn(t),r=mi(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=I1();(!c||c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function qq(t,e){const n=ka(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=_o(t)?Il(t):bs(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function rE(t,e,n){let r;if(e==="viewport")r=Kq(t,n);else if(e==="document")r=Wq(mi(t));else if(ci(e))r=qq(e,n);else{const o=mM(t);r={...e,x:e.x-o.x,y:e.y-o.y}}return jh(r)}function vM(t,e){const n=tc(t);return n===e||!ci(n)||Fm(n)?!1:kr(n).position==="fixed"||vM(n,e)}function Gq(t,e){const n=e.get(t);if(n)return n;let r=Pd(t,[],!1).filter(a=>ci(a)&&ws(a)!=="body"),o=null;const i=kr(t).position==="fixed";let s=i?tc(t):t;for(;ci(s)&&!Fm(s);){const a=kr(s),l=A1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||rf(s)&&!l&&vM(t,s))?r=r.filter(u=>u!==s):o=a,s=tc(s)}return e.set(t,r),r}function Yq(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?Gq(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=rE(e,u,o);return c.top=qn(d.top,c.top),c.right=xs(d.right,c.right),c.bottom=xs(d.bottom,c.bottom),c.left=qn(d.left,c.left),c},rE(e,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Xq(t){const{width:e,height:n}=hM(t);return{width:e,height:n}}function Zq(t,e,n){const r=_o(e),o=mi(e),i=n==="fixed",s=ka(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=bs(0);if(r||!r&&!i)if((ws(e)!=="body"||rf(o))&&(a=Bm(e)),r){const c=ka(e,!0,i,e);l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}else o&&(l.x=gM(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function oE(t,e){return!_o(t)||kr(t).position==="fixed"?null:e?e(t):t.offsetParent}function yM(t,e){const n=Zn(t);if(!_o(t))return n;let r=oE(t,e);for(;r&&zq(r)&&kr(r).position==="static";)r=oE(r,e);return r&&(ws(r)==="html"||ws(r)==="body"&&kr(r).position==="static"&&!A1(r))?n:r||Fq(t)||n}const Jq=async function(t){let{reference:e,floating:n,strategy:r}=t;const o=this.getOffsetParent||yM,i=this.getDimensions;return{reference:Zq(e,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function Qq(t){return kr(t).direction==="rtl"}const eG={convertOffsetParentRelativeRectToViewportRelativeRect:Uq,getDocumentElement:mi,getClippingRect:Yq,getOffsetParent:yM,getElementRects:Jq,getClientRects:Hq,getDimensions:Xq,getScale:Il,isElement:ci,isRTL:Qq};function tG(t,e){let n=null,r;const o=mi(t);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(a||e(),!d||!f)return;const p=jf(u),h=jf(o.clientWidth-(c+d)),g=jf(o.clientHeight-(u+f)),x=jf(c),y={rootMargin:-p+"px "+-h+"px "+-g+"px "+-x+"px",threshold:qn(0,xs(1,l))||1};let w=!0;function k(E){const O=E[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(t)}return s(!0),i}function nG(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=D1(t),u=o||i?[...c?Pd(c):[],...Pd(e)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?tG(c,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let h,g=l?ka(t):null;l&&x();function x(){const v=ka(t);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,h=requestAnimationFrame(x)}return n(),()=>{u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const rG=Dq,oG=Rq,iG=jq,sG=$q,iE=Nq,aG=Lq,lG=(t,e,n)=>{const r=new Map,o={platform:eG,...n},i={...o.platform,_c:r};return Mq(t,e,{...o,platform:i})},cG=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?iE({element:r.current,padding:o}).fn(n):{}:r?iE({element:r,padding:o}).fn(n):{}}}};var kp=typeof document<"u"?m.useLayoutEffect:m.useEffect;function zh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!zh(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!zh(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function xM(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sE(t,e){const n=xM(t);return Math.round(e*n)/n}function aE(t){const e=m.useRef(t);return kp(()=>{e.current=t}),e}function uG(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,d]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);zh(f,r)||p(r);const[h,g]=m.useState(null),[x,v]=m.useState(null),y=m.useCallback(C=>{C!=O.current&&(O.current=C,g(C))},[g]),w=m.useCallback(C=>{C!==S.current&&(S.current=C,v(C))},[v]),k=i||h,E=s||x,O=m.useRef(null),S=m.useRef(null),P=m.useRef(u),M=aE(l),$=aE(o),V=m.useCallback(()=>{if(!O.current||!S.current)return;const C={placement:e,strategy:n,middleware:f};$.current&&(C.platform=$.current),lG(O.current,S.current,C).then(T=>{const _={...T,isPositioned:!0};j.current&&!zh(P.current,_)&&(P.current=_,Sr.flushSync(()=>{d(_)}))})},[f,e,n,$]);kp(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[c]);const j=m.useRef(!1);kp(()=>(j.current=!0,()=>{j.current=!1}),[]),kp(()=>{if(k&&(O.current=k),E&&(S.current=E),k&&E){if(M.current)return M.current(k,E,V);V()}},[k,E,V,M]);const le=m.useMemo(()=>({reference:O,floating:S,setReference:y,setFloating:w}),[y,w]),K=m.useMemo(()=>({reference:k,floating:E}),[k,E]),H=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!K.floating)return C;const T=sE(K.floating,u.x),_=sE(K.floating,u.y);return a?{...C,transform:"translate("+T+"px, "+_+"px)",...xM(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:_}},[n,a,K.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:V,refs:le,elements:K,floatingStyles:H}),[u,V,le,K,H])}function dG(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new ga(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new ga(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=Yx(l,t,e,s);return c?(r&&r(fG(n.tr,s,c,a,t).scrollIntoView()),!0):!1}}function fG(t,e,n,r,o){let i=D.empty;for(let u=n.length-1;u>=0;u--)i=D.from(n[u].type.create(n[u].attrs,i));t.step(new _t(e.start-(r?2:0),e.end,e.start,e.end,new G(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Nl(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function pG(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?hG(e,n,t,i):mG(e,n,i):!0:!1}}function hG(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new _t(i-1,s,i,s,new G(D.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ga(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=dc(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;return Jd(o.doc,l)&&o.join(l),e(o.scrollIntoView()),!0}function mG(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,h=n.endIndex-1,g=n.startIndex;h>g;h--)p-=o.child(h).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?D.empty:D.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new _t(d-(a?1:0),f+(l?1:0),d+1,f-1,new G((a?D.empty:D.from(o.copy(D.empty))).append(l?D.empty:D.from(o.copy(D.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}var gG=Object.defineProperty,vG=Object.getOwnPropertyDescriptor,Tr=(t,e,n,r)=>{for(var o=r>1?void 0:r?vG(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&gG(e,n,o),o};function x0(t){var e;return!!((e=t.spec.group)!=null&&e.includes(Ce.ListContainerNode))}function yG(t){var e;return!!((e=t.spec.group)!=null&&e.includes(Ce.ListItemNode))}function ks(t){return x0(t.type)}function ls(t){return yG(t.type)}function L1(t,e){return n=>{const{dispatch:r,tr:o}=n,i=u1(o,n.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Tm({predicate:u=>x0(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===t)return kM(e)(n);if(x0(c.node.type))return t.validContent(c.node.content)?(r==null||r(o.setNodeMarkup(c.pos,t)),!0):xG(o,c,t,e)?(r==null||r(o.scrollIntoView()),!0):!1}return dG(t)(i,r)}}function bM(t,e=["checked"]){return function({tr:n,dispatch:r,state:o}){var i,s;const a=L8(t,o.schema),{$from:l,$to:c}=n.selection;if(Mm(n.selection)&&n.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){const g=l.index(-1)>0;let x=D.empty;for(let w=l.depth-(g?1:2);w>=l.depth-3;w--)x=D.from(l.node(w).copy(x));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;x=x.append(D.from(a.createAndFill(null,v)||void 0));const y=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3;n.replace(l.before(g?void 0:-1),l.after(-y),new G(x,g?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(l.pos+(g?3:2)))),r(n.scrollIntoView())}return!0}if(u.attrs.closed&&l.sameParent(c)&&c.pos===c.end()){if(r){const g=l.after(-1),x=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill())||void 0,v=a.createAndFill(null,x);v&&(n.insert(g,v),n.setSelection(xe.near(n.doc.resolve(g+1)))),n.delete(l.pos,c.pos),r(n.scrollIntoView())}return!0}const d=Object.fromEntries(Object.entries(u.attrs).filter(([g])=>!e.includes(g))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};n.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return Nl(n.doc,l.pos,2)?(r&&r(n.split(l.pos,2,h).scrollIntoView()),!0):!1}}function xG(t,e,n,r){const o=e.node,i=t.doc.resolve(e.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,D.from(n.create())))return!1;const l=[];for(let p=0;p<o.childCount;p++){const h=o.child(p);if(!r.validContent(h.content))return!1;const g=r.createChecked(null,h.content);l.push(g)}const c=n.createChecked(null,l),u=e.pos,d=u+o.nodeSize,f=t.selection.from;return t.replaceRangeWith(u,d,c),t.setSelection(t.selection.constructor.near(t.doc.resolve(f))),!0}function bG({listType:t,itemType:e,tr:n,range:r}){var o;const i=r.parent,s=n.doc.slice(r.start,r.end);if(i.type===t&&((o=s.content.firstChild)==null?void 0:o.type)===e)return!1;const a=[];for(let c=0;c<s.content.childCount;c++){const u=s.content.child(c);if(!e.validContent(u.content))return!1;const d=e.createChecked(null,u.content);a.push(d)}const l=t.createChecked(null,a);return n.replaceRange(r.start,r.end,new G(D.from(l),0,0)),!0}function nc({listType:t,itemType:e,tr:n}){const r=Fh(n.selection);if(!r)return!1;const o=r.startIndex===0,{from:i,to:s}=n.selection;return bG({listType:t,itemType:e,tr:n,range:r})?(n.setSelection(xe.between(n.doc.resolve(o?i:i+2),n.doc.resolve(o?s:s+2))),n.scrollIntoView(),!0):!1}function wG(t,e,n){const r=t.tr,o=n.parent,i=r.mapping.maps.length;for(let h=n.end,g=n.endIndex-1,x=n.startIndex;g>x;g--)h-=o.child(g).nodeSize,r.delete(h-1,h+1);const s=r.doc.resolve(n.start),a=s.nodeAfter;if(!a||r.mapping.slice(i).map(n.end)!==n.start+a.nodeSize)return!1;const l=n.startIndex===0,c=n.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?D.empty:D.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return r.step(new _t(f-(l?1:0),p+(c?1:0),f+1,p-1,new G((l?D.empty:D.from(o.copy(D.empty))).append(c?D.empty:D.from(o.copy(D.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function wM(t,e){const n=e||t.selection.$from;let r=[],o,i,s,a;for(let c=n.depth;c>=0;c--){if(i=n.node(c),o=n.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&ks(s)){const u=n.before(c+1);r.push(u)}if(o=n.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&ks(s)){const u=n.after(c+1);r.push(u)}}r=[...new Set(r)].sort((c,u)=>u-c);let l=!1;for(const c of r)Jd(t.doc,c)&&(t.join(c),l=!0);return l}function kM(t){return e=>{const{dispatch:n,tr:r}=e,o=u1(r,e.state),i=kG(t,r.selection);return i?(n&&wG(o,n,i),!0):!1}}function kG(t,e){const{$from:n,$to:r}=e;return n.blockRange(r,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===t})}function Fh(t){const{$from:e,$to:n}=t;return e.blockRange(n,ks)}function SG(t){const e=t.selection.$from,n=e.blockRange();if(!n||!ls(n.parent)||n.startIndex!==0)return!1;const r=e.node(n.depth-2),o=e.index(n.depth),i=e.index(n.depth-1),s=e.index(n.depth-2),a=r.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&ks(a)&&l&&ls(l))return nc({listType:a.type,itemType:l.type,tr:t});if(ls(r)){const c=r,u=e.node(n.depth-3);if(ks(u))return nc({listType:u.type,itemType:c.type,tr:t})}return!1}function lE({view:t}){if(!t)return!1;{const e=t.state.selection.$cursor;if(!e||e.parentOffset>0)return!1;const n=e.blockRange();if(!n||!ls(n.parent)||n.startIndex!==0)return!1}{const e=t.state.tr;SG(e)&&t.dispatch(e)}{const e=t.state.selection.$cursor;if(!e||e.parentOffset>0)return!1;const n=e.blockRange();if(!n||!ls(n.parent)||n.startIndex!==0)return!1;const r=e.index(n.depth),o=e.index(n.depth-1),i=e.index(n.depth-2),s=n.depth-2>=1&&ls(e.node(n.depth-2));r===0&&o===0&&i<=1&&s&&pG(n.parent.type)(t.state,t.dispatch)}return EP(t.state,t.dispatch,t),!0}function SM({node:t,mark:e,updateDOM:n,updateMark:r}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ys.LIST_ITEM_MARKER_CONTAINER),o.append(e);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ys.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==t.type?!1:(t=l,n(t,s),r(t,e),!0);return a(t),{dom:s,contentDOM:i,update:a}}function EG(t,e){const n=t.node(e.depth-1),r=t.node(e.depth-2);return!ls(n)||!ks(r)?!1:{parentItem:n,parentList:r}}function _G(t,e){const n=e.parent,r=e.parent.child(e.endIndex-1),o=e.end,i=e.$to.end(e.depth);return o<i?(t.step(new _t(o-1,i,o,i,new G(D.from(r.type.create(null,n.copy())),1,0),1,!0)),new ga(t.doc.resolve(e.$from.pos),t.doc.resolve(i),e.depth)):e}function CG(t,e){const n=e.parent,r=e.parent.child(e.endIndex-1),o=e.end,i=e.$to.end(e.depth-1);return o+1<i?(t.step(new _t(o-1,i,o+1,i,new G(D.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new ga(t.selection.$from,t.selection.$to,e.depth)):e}function OG(t,e,n,r){return nc({listType:n.type,itemType:r.type,tr:t})?new ga(t.selection.$from,t.selection.$to,e.depth):e}function TG(t){let e=Fh(t.selection);if(!e)return!1;const n=EG(t.selection.$from,e);if(!n)return!1;const{parentItem:r,parentList:o}=n;e=_G(t,e),e=CG(t,e),e=OG(t,e,o,r);const i=dc(e);return typeof i!="number"||(t.lift(e,i),e=Fh(t.selection),e&&wM(t,t.doc.resolve(e.end-2))),!0}var PG=({tr:t,dispatch:e})=>TG(t)?(e==null||e(t.scrollIntoView()),!0):!1;function MG(t,e,n){let r,o,i,s;const a=e.doc;if(n.startIndex>=1){r=t.child(n.startIndex-1),o=t,s=a.resolve(n.start).start(n.depth),i=s+1;for(let l=0;l<n.startIndex-1;l++)i+=o.child(l).nodeSize}else{const l=e.index(n.depth-1);if(l>=1){const c=e.node(n.depth-1),u=e.start(n.depth-1);if(o=c.child(l-1),!ks(o))return!1;s=u+1;for(let d=0;d<l-1;d++)s+=c.child(d).nodeSize;if(r=o.child(o.childCount-1),i=s+o.nodeSize-r.nodeSize-1,!ls(r))return!1}else return!1}return{previousItem:r,previousList:o,previousItemStart:i,previousListStart:s}}function NG(t,e,n){let r,o;const i=n.start,s=e.depth>=n.depth+2?e.end(n.depth+2):n.end-1,a=n.end;return s+1>=a?(r=t.slice(i,a),o=null):(r=t.slice(i,s),o=t.slice(s+1,a-1)),{selectedSlice:r,unselectedSlice:o}}function RG(t){const{$from:e,$to:n}=t.selection,r=Fh(t.selection);if(!r)return!1;const o=t.doc.resolve(r.start).node();if(!ks(o))return!1;const i=MG(o,e,r);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=NG(t.doc,n,r),d=s.content.append(D.fromArray([o.copy(c.content)])).append(u?u.content:D.empty);t.deleteRange(r.start,r.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),t.replaceRangeWith(l-1,f+1,p),t.setSelection(a===o?xe.between(t.doc.resolve(e.pos),t.doc.resolve(n.pos)):xe.between(t.doc.resolve(e.pos-2),t.doc.resolve(n.pos-2))),!0}var $G=({tr:t,dispatch:e})=>RG(t)?(e==null||e(t.scrollIntoView()),!0):!1,EM=class extends ut{get name(){return"listItemShared"}createKeymap(){const t={Tab:$G,"Shift-Tab":PG,Backspace:lE,"Mod-Backspace":lE};if(Br.isMac){const e={"Ctrl-h":t.Backspace,"Alt-Backspace":t["Mod-Backspace"]};return{...t,...e}}return t}createPlugin(){return{appendTransaction:(t,e,n)=>{const r=n.tr;return wM(r)?r:null}}}},rc=class extends Or{get name(){return"listItem"}createTags(){return[Ce.ListItemNode]}createNodeSpec(t,e){return{content:"paragraph block*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:t.parse,priority:qe.Lowest},...e.parseDOM??[]],toDOM:n=>["li",t.dom(n),0]}}createNodeViews(){return this.options.enableCollapsible?(t,e,n)=>{const r=document.createElement("div");return r.classList.add(ys.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable="false",r.addEventListener("click",()=>{if(r.classList.contains("disabled"))return;const o=n(),i=fe.create(e.state.doc,o);return e.dispatch(e.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),SM({mark:r,node:t,updateDOM:AG,updateMark:IG})}:{}}createKeymap(){return{Enter:bM(this.type)}}createExtensions(){return[new EM]}toggleListItemClosed(t){return({state:{tr:e,selection:n},dispatch:r})=>{if(!Mm(n)||n.node.type.name!==this.name)return!1;const{node:o,from:i}=n;return t=LL(t)?t:!o.attrs.closed,r==null||r(e.setNodeMarkup(i,void 0,{...o.attrs,closed:t})),!0}}liftListItemOutOfList(t){return kM(t??this.type)}};Tr([oe()],rc.prototype,"toggleListItemClosed",1);Tr([oe()],rc.prototype,"liftListItemOutOfList",1);rc=Tr([Le({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],rc);function AG(t,e){t.attrs.closed?e.classList.add(ys.COLLAPSIBLE_LIST_ITEM_CLOSED):e.classList.remove(ys.COLLAPSIBLE_LIST_ITEM_CLOSED)}function IG(t,e){t.childCount<=1?e.classList.add("disabled"):e.classList.remove("disabled")}var Md=class extends Or{get name(){return"bulletList"}createTags(){return[Ce.Block,Ce.ListContainerNode]}createNodeSpec(t,e){return{content:"listItem+",...e,attrs:t.defaults(),parseDOM:[{tag:"ul",getAttrs:t.parse},...e.parseDOM??[]],toDOM:n=>["ul",t.dom(n),0]}}createNodeViews(){return this.options.enableSpine?(t,e,n)=>{var r;const o=document.createElement("div");o.style.position="relative";const i=n(),s=e.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((r=a==null?void 0:a.type)==null?void 0:r.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ys.LIST_SPINE),u.addEventListener("click",d=>{const f=n(),p=e.state.doc.resolve(f+1),h=p.start(p.depth-1),g=fe.create(e.state.doc,h-1);e.dispatch(e.state.tr.setSelection(g)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ys.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new rc({priority:qe.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return L1(this.type,ht(this.store.schema.nodes,"listItem"))}listShortcut(t){return this.toggleBulletList()(t)}createInputRules(){const t=/^\s*([*+-])\s$/;return[Qx(t,this.type),new Cr(t,(e,n,r,o)=>{const i=e.tr;return i.deleteRange(r,o),nc({listType:this.type,itemType:ht(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Tr([oe({icon:"listUnordered",label:({t})=>t(Jx.BULLET_LIST_LABEL)})],Md.prototype,"toggleBulletList",1);Tr([ar({shortcut:U.BulletList,command:"toggleBulletList"})],Md.prototype,"listShortcut",1);Md=Tr([Le({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],Md);var Nd=class extends Or{get name(){return"orderedList"}createTags(){return[Ce.Block,Ce.ListContainerNode]}createNodeSpec(t,e){return{content:"listItem+",...e,attrs:{...t.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:n=>So(n)?{...t.parse(n),order:+(n.getAttribute("start")??1)}:{}},...e.parseDOM??[]],toDOM:n=>{const r=t.dom(n);return n.attrs.order===1?["ol",r,0]:["ol",{...r,start:n.attrs.order},0]}}}createExtensions(){return[new rc({priority:qe.Low})]}toggleOrderedList(){return L1(this.type,ht(this.store.schema.nodes,"listItem"))}listShortcut(t){return this.toggleOrderedList()(t)}createInputRules(){const t=/^(\d+)\.\s$/;return[Qx(t,this.type,e=>({order:+ht(e,1)}),(e,n)=>n.childCount+n.attrs.order===+ht(e,1)),new Cr(t,(e,n,r,o)=>{const i=e.tr;if(i.deleteRange(r,o),!nc({listType:this.type,itemType:ht(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+ht(n,1);if(a!==1){const l=bd({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Tr([oe({icon:"listOrdered",label:({t})=>t(Jx.ORDERED_LIST_LABEL)})],Nd.prototype,"toggleOrderedList",1);Tr([ar({shortcut:U.OrderedList,command:"toggleOrderedList"})],Nd.prototype,"listShortcut",1);Nd=Tr([Le({})],Nd);var _M=class extends Or{get name(){return"taskListItem"}createTags(){return[Ce.ListItemNode]}createNodeSpec(t,e){return{content:"paragraph block*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:n=>{let r=!1;return So(n)&&n.getAttribute("data-checked")!==null&&(r=!0),{checked:r,...t.parse(n)}},priority:qe.Medium},...e.parseDOM??[]],toDOM:n=>["li",{...t.dom(n),"data-task-list-item":"","data-checked":n.attrs.checked?"":void 0},0]}}createNodeViews(){return(t,e,n)=>{const r=document.createElement("input");return r.type="checkbox",r.classList.add(ys.LIST_ITEM_CHECKBOX),r.contentEditable="false",r.addEventListener("click",o=>{e.editable||o.preventDefault()}),r.addEventListener("change",()=>{const o=n(),i=e.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),r.checked=t.attrs.checked,SM({node:t,mark:r,updateDOM:DG,updateMark:LG})}}createKeymap(){return{Enter:bM(this.type)}}createExtensions(){return[new EM]}toggleCheckboxChecked(t){let e,n;return typeof t=="boolean"?e=t:t&&(e=t.checked,n=t.$pos),({tr:r,dispatch:o})=>{const i=bd({selection:n??r.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:e??!s.attrs.checked};return o==null||o(r.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const t=/^\s*(\[( ?|x|X)]\s)$/;return[Qx(t,this.type,e=>({checked:["x","X"].includes(Au(e,2))})),new Cr(t,(e,n,r,o)=>{const i=e.tr;if(i.deleteRange(r,o),!nc({listType:ht(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Au(n,2));if(a){const l=bd({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Tr([oe()],_M.prototype,"toggleCheckboxChecked",1);function DG(t,e){t.attrs.checked?e.setAttribute("data-checked",""):e.removeAttribute("data-checked"),e.setAttribute("data-task-list-item","")}function LG(t,e){e.checked=!!t.attrs.checked}var CM=class extends Or{get name(){return"taskList"}createTags(){return[Ce.Block,Ce.ListContainerNode]}createNodeSpec(t,e){return{content:"taskListItem+",...e,attrs:t.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:t.parse,priority:qe.Medium},...e.parseDOM??[]],toDOM:n=>["ul",{...t.dom(n),"data-task-list":""},0]}}createExtensions(){return[new _M({})]}toggleTaskList(){return L1(this.type,ht(this.store.schema.nodes,"taskListItem"))}listShortcut(t){return this.toggleTaskList()(t)}};Tr([oe({icon:"checkboxMultipleLine",label:({t})=>t(Jx.TASK_LIST_LABEL)})],CM.prototype,"toggleTaskList",1);Tr([ar({shortcut:U.TaskList,command:"toggleTaskList"})],CM.prototype,"listShortcut",1);var jG=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Wa=new WeakMap,zf=new WeakMap,Ff={},sv=0,OM=function(t){return t&&(t.host||OM(t.parentNode))},zG=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=OM(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},FG=function(t,e,n,r){var o=zG(e,Array.isArray(t)?t:[t]);Ff[n]||(Ff[n]=new WeakMap);var i=Ff[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),h=p!==null&&p!=="false",g=(Wa.get(f)||0)+1,x=(i.get(f)||0)+1;Wa.set(f,g),i.set(f,x),s.push(f),g===1&&h&&zf.set(f,!0),x===1&&f.setAttribute(n,"true"),h||f.setAttribute(r,"true")}})};return u(e),a.clear(),sv++,function(){s.forEach(function(d){var f=Wa.get(d)-1,p=i.get(d)-1;Wa.set(d,f),i.set(d,p),f||(zf.has(d)||d.removeAttribute(r),zf.delete(d)),p||d.removeAttribute(n)}),sv--,sv||(Wa=new WeakMap,Wa=new WeakMap,zf=new WeakMap,Ff={})}},Vm=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=e||jG(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),FG(r,o,n,"aria-hidden")):function(){return null}};function Co({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=BG({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,a=Bt(n),l=m.useCallback(c=>{if(i){const d=typeof c=="function"?c(t):c;d!==t&&a(d)}else o(c)},[i,t,o,a]);return[s,l]}function BG({defaultProp:t,onChange:e}){const n=m.useState(t),[r]=n,o=m.useRef(r),i=Bt(e);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Um(t){const e=t+"CollectionProvider",[n,r]=Er(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:h,children:g}=p,x=X.useRef(null),v=X.useRef(new Map).current;return X.createElement(o,{scope:h,itemMap:v,collectionRef:x},g)},a=t+"CollectionSlot",l=X.forwardRef((p,h)=>{const{scope:g,children:x}=p,v=i(a,g),y=$e(h,v.collectionRef);return X.createElement(ri,{ref:y},x)}),c=t+"CollectionItemSlot",u="data-radix-collection-item",d=X.forwardRef((p,h)=>{const{scope:g,children:x,...v}=p,y=X.useRef(null),w=$e(h,y),k=i(c,g);return X.useEffect(()=>(k.itemMap.set(y,{ref:y,...v}),()=>void k.itemMap.delete(y))),X.createElement(ri,{[u]:"",ref:w},x)});function f(p){const h=i(t+"CollectionConsumer",p);return X.useCallback(()=>{const x=h.collectionRef.current;if(!x)return[];const v=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((k,E)=>v.indexOf(k.ref.current)-v.indexOf(E.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}function VG(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const b0="dismissableLayer.update",UG="dismissableLayer.pointerDownOutside",HG="dismissableLayer.focusOutside";let cE;const WG=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hm=m.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,u=m.useContext(WG),[d,f]=m.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=m.useState({}),g=$e(e,P=>f(P)),x=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=x.indexOf(v),w=d?x.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,O=KG(P=>{const M=P.target,$=[...u.branches].some(V=>V.contains(M));!E||$||(i==null||i(P),a==null||a(P),P.defaultPrevented||l==null||l())},p),S=qG(P=>{const M=P.target;[...u.branches].some(V=>V.contains(M))||(s==null||s(P),a==null||a(P),P.defaultPrevented||l==null||l())},p);return VG(P=>{w===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))},p),m.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cE=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),uE(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=cE)}},[d,p,r,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),uE())},[d,u]),m.useEffect(()=>{const P=()=>h({});return document.addEventListener(b0,P),()=>document.removeEventListener(b0,P)},[]),m.createElement(we.div,A({},c,{ref:g,style:{pointerEvents:k?E?"auto":"none":void 0,...t.style},onFocusCapture:ne(t.onFocusCapture,S.onFocusCapture),onBlurCapture:ne(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ne(t.onPointerDownCapture,O.onPointerDownCapture)}))});function KG(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){TM(UG,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function qG(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&TM(HG,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uE(){const t=new CustomEvent(b0);document.dispatchEvent(t)}function TM(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?CO(o,i):o.dispatchEvent(i)}let av=0;function Wm(){m.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:dE()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:dE()),av++,()=>{av===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),av--}},[])}function dE(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const lv="focusScope.autoFocusOnMount",cv="focusScope.autoFocusOnUnmount",fE={bubbles:!1,cancelable:!0},Km=m.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=m.useState(null),c=Bt(o),u=Bt(i),d=m.useRef(null),f=$e(e,g=>l(g)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(O){if(p.paused||!a)return;const S=O.target;a.contains(S)?d.current=S:Ni(d.current,{select:!0})},w=function(O){if(p.paused||!a)return;const S=O.relatedTarget;S!==null&&(a.contains(S)||Ni(d.current,{select:!0}))},k=function(O){if(document.activeElement===document.body)for(const P of O)P.removedNodes.length>0&&Ni(a)};var g=y,x=w,v=k;document.addEventListener("focusin",y),document.addEventListener("focusout",w);const E=new MutationObserver(k);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),E.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){hE.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(lv,fE);a.addEventListener(lv,c),a.dispatchEvent(v),v.defaultPrevented||(GG(QG(PM(a)),{select:!0}),document.activeElement===g&&Ni(a))}return()=>{a.removeEventListener(lv,c),setTimeout(()=>{const v=new CustomEvent(cv,fE);a.addEventListener(cv,u),a.dispatchEvent(v),v.defaultPrevented||Ni(g??document.body,{select:!0}),a.removeEventListener(cv,u),hE.remove(p)},0)}}},[a,c,u,p]);const h=m.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const y=g.currentTarget,[w,k]=YG(y);w&&k?!g.shiftKey&&v===k?(g.preventDefault(),n&&Ni(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),n&&Ni(k,{select:!0})):v===y&&g.preventDefault()}},[n,r,p.paused]);return m.createElement(we.div,A({tabIndex:-1},s,{ref:f,onKeyDown:h}))});function GG(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ni(r,{select:e}),document.activeElement!==n)return}function YG(t){const e=PM(t),n=pE(e,t),r=pE(e.reverse(),t);return[n,r]}function PM(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function pE(t,e){for(const n of t)if(!XG(n,{upTo:e}))return n}function XG(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ZG(t){return t instanceof HTMLInputElement&&"select"in t}function Ni(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ZG(t)&&e&&t.select()}}const hE=JG();function JG(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=mE(t,e),t.unshift(e)},remove(e){var n;t=mE(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function mE(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function QG(t){return t.filter(e=>e.tagName!=="A")}const eY=x$.useId||(()=>{});let tY=0;function vr(t){const[e,n]=m.useState(eY());return er(()=>{t||n(r=>r??String(tY++))},[t]),t||(e?`radix-${e}`:"")}function MM(t){const[e,n]=m.useState(void 0);return er(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const NM="Popper",[RM,xc]=Er(NM),[nY,$M]=RM(NM),rY=t=>{const{__scopePopper:e,children:n}=t,[r,o]=m.useState(null);return m.createElement(nY,{scope:e,anchor:r,onAnchorChange:o},n)},oY="PopperAnchor",iY=m.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=$M(oY,n),s=m.useRef(null),a=$e(e,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(we.div,A({},o,{ref:a}))}),AM="PopperContent",[sY,woe]=RM(AM),aY=m.forwardRef((t,e)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:p="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:x=!0,collisionBoundary:v=[],collisionPadding:y=0,sticky:w="partial",hideWhenDetached:k=!1,updatePositionStrategy:E="optimized",onPlaced:O,...S}=t,P=$M(AM,u),[M,$]=m.useState(null),V=$e(e,Mo=>$(Mo)),[j,le]=m.useState(null),K=MM(j),H=(n=K==null?void 0:K.width)!==null&&n!==void 0?n:0,C=(r=K==null?void 0:K.height)!==null&&r!==void 0?r:0,T=d+(p!=="center"?"-"+p:""),_=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},N=Array.isArray(v)?v:[v],R=N.length>0,L={padding:_,boundary:N.filter(lY),altBoundary:R},{refs:q,floatingStyles:ve,placement:he,isPositioned:Be,middlewareData:Oe}=uG({strategy:"fixed",placement:T,whileElementsMounted:(...Mo)=>nG(...Mo,{animationFrame:E==="always"}),elements:{reference:P.anchor},middleware:[Iq({mainAxis:f+C,alignmentAxis:h}),x&&rG({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?aG():void 0,...L}),x&&oG({...L}),iG({...L,apply:({elements:Mo,rects:ja,availableWidth:kc,availableHeight:YR})=>{const{width:XR,height:ZR}=ja.reference,uf=Mo.floating.style;uf.setProperty("--radix-popper-available-width",`${kc}px`),uf.setProperty("--radix-popper-available-height",`${YR}px`),uf.setProperty("--radix-popper-anchor-width",`${XR}px`),uf.setProperty("--radix-popper-anchor-height",`${ZR}px`)}}),j&&cG({element:j,padding:g}),cY({arrowWidth:H,arrowHeight:C}),k&&sG({strategy:"referenceHidden",...L})]}),[J,Ge]=IM(he),Ye=Bt(O);er(()=>{Be&&(Ye==null||Ye())},[Be,Ye]);const Xe=(o=Oe.arrow)===null||o===void 0?void 0:o.x,Ze=(i=Oe.arrow)===null||i===void 0?void 0:i.y,Je=((s=Oe.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[jn,zn]=m.useState();return er(()=>{M&&zn(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:Be?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:jn,"--radix-popper-transform-origin":[(a=Oe.transformOrigin)===null||a===void 0?void 0:a.x,(l=Oe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},m.createElement(sY,{scope:u,placedSide:J,onArrowChange:le,arrowX:Xe,arrowY:Ze,shouldHideArrow:Je},m.createElement(we.div,A({"data-side":J,"data-align":Ge},S,{ref:V,style:{...S.style,animation:Be?void 0:"none",opacity:(c=Oe.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function lY(t){return t!==null}const cY=t=>({name:"transformOrigin",options:t,fn(e){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=e,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:t.arrowWidth,p=d?0:t.arrowHeight,[h,g]=IM(a),x={start:"0%",center:"50%",end:"100%"}[g],v=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,y=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2;let w="",k="";return h==="bottom"?(w=d?x:`${v}px`,k=`${-p}px`):h==="top"?(w=d?x:`${v}px`,k=`${l.floating.height+p}px`):h==="right"?(w=`${-p}px`,k=d?x:`${y}px`):h==="left"&&(w=`${l.floating.width+p}px`,k=d?x:`${y}px`),{data:{x:w,y:k}}}});function IM(t){const[e,n="center"]=t.split("-");return[e,n]}const j1=rY,z1=iY,F1=aY,qm=m.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=t;return r?SI.createPortal(m.createElement(we.div,A({},o,{ref:e})),r):null}),uv="rovingFocusGroup.onEntryFocus",uY={bubbles:!1,cancelable:!0},B1="RovingFocusGroup",[w0,DM,dY]=Um(B1),[fY,LM]=Er(B1,[dY]),[pY,hY]=fY(B1),mY=m.forwardRef((t,e)=>m.createElement(w0.Provider,{scope:t.__scopeRovingFocusGroup},m.createElement(w0.Slot,{scope:t.__scopeRovingFocusGroup},m.createElement(gY,A({},t,{ref:e}))))),gY=m.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=t,d=m.useRef(null),f=$e(e,d),p=Gd(i),[h=null,g]=Co({prop:s,defaultProp:a,onChange:l}),[x,v]=m.useState(!1),y=Bt(c),w=DM(n),k=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const S=d.current;if(S)return S.addEventListener(uv,y),()=>S.removeEventListener(uv,y)},[y]),m.createElement(pY,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:h,onItemFocus:m.useCallback(S=>g(S),[g]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(S=>S+1),[]),onFocusableItemRemove:m.useCallback(()=>O(S=>S-1),[])},m.createElement(we.div,A({tabIndex:x||E===0?-1:0,"data-orientation":r},u,{ref:f,style:{outline:"none",...t.style},onMouseDown:ne(t.onMouseDown,()=>{k.current=!0}),onFocus:ne(t.onFocus,S=>{const P=!k.current;if(S.target===S.currentTarget&&P&&!x){const M=new CustomEvent(uv,uY);if(S.currentTarget.dispatchEvent(M),!M.defaultPrevented){const $=w().filter(H=>H.focusable),V=$.find(H=>H.active),j=$.find(H=>H.id===h),K=[V,j,...$].filter(Boolean).map(H=>H.ref.current);jM(K)}}k.current=!1}),onBlur:ne(t.onBlur,()=>v(!1))})))}),vY="RovingFocusGroupItem",yY=m.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,a=vr(),l=i||a,c=hY(vY,n),u=c.currentTabStopId===l,d=DM(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),m.createElement(w0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(we.span,A({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:ne(t.onMouseDown,h=>{r?c.onItemFocus(l):h.preventDefault()}),onFocus:ne(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:ne(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){c.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const g=wY(h,c.orientation,c.dir);if(g!==void 0){h.preventDefault();let v=d().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(h.currentTarget);v=c.loop?kY(v,y+1):v.slice(y+1)}setTimeout(()=>jM(v))}})})))}),xY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bY(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function wY(t,e,n){const r=bY(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xY[r]}function jM(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function kY(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const SY=mY,EY=yY;var fo=function(){return fo=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fo.apply(this,arguments)};function zM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function _Y(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Sp="right-scroll-bar-position",Ep="width-before-scroll-bar",CY="with-scroll-bars-hidden",OY="--removed-body-scroll-bar-size";function dv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function TY(t,e){var n=m.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var gE=new WeakMap;function PY(t,e){var n=TY(e||null,function(r){return t.forEach(function(o){return dv(o,r)})});return m.useLayoutEffect(function(){var r=gE.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(a){i.has(a)||dv(a,null)}),i.forEach(function(a){o.has(a)||dv(a,s)})}gE.set(n,t)},[t]),n}function MY(t){return t}function NY(t,e){e===void 0&&(e=MY);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function RY(t){t===void 0&&(t={});var e=NY(null);return e.options=fo({async:!0,ssr:!1},t),e}var FM=function(t){var e=t.sideCar,n=zM(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,fo({},n))};FM.isSideCarExport=!0;function $Y(t,e){return t.useMedium(e),FM}var BM=RY(),fv=function(){},Gm=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:fv,onWheelCapture:fv,onTouchMoveCapture:fv}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,p=t.noIsolation,h=t.inert,g=t.allowPinchZoom,x=t.as,v=x===void 0?"div":x,y=zM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=f,k=PY([n,e]),E=fo(fo({},y),o);return m.createElement(m.Fragment,null,u&&m.createElement(w,{sideCar:BM,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!g,lockRef:n}),s?m.cloneElement(m.Children.only(a),fo(fo({},E),{ref:k})):m.createElement(v,fo({},E,{className:l,ref:k}),a))});Gm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gm.classNames={fullWidth:Ep,zeroRight:Sp};var AY=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IY(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=AY();return e&&t.setAttribute("nonce",e),t}function DY(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function LY(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jY=function(){var t=0,e=null;return{add:function(n){t==0&&(e=IY())&&(DY(e,n),LY(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},zY=function(){var t=jY();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},VM=function(){var t=zY(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},FY={left:0,top:0,right:0,gap:0},pv=function(t){return parseInt(t||"",10)||0},BY=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[pv(n),pv(r),pv(o)]},VY=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return FY;var e=BY(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},UY=VM(),HY=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
164
|
-
.`.concat(CY,` {
|
|
165
|
-
overflow: hidden `).concat(r,`;
|
|
166
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
167
|
-
}
|
|
168
|
-
body {
|
|
169
|
-
overflow: hidden `).concat(r,`;
|
|
170
|
-
overscroll-behavior: contain;
|
|
171
|
-
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
172
|
-
padding-left: `.concat(o,`px;
|
|
173
|
-
padding-top: `).concat(i,`px;
|
|
174
|
-
padding-right: `).concat(s,`px;
|
|
175
|
-
margin-left:0;
|
|
176
|
-
margin-top:0;
|
|
177
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
178
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.`).concat(Sp,` {
|
|
182
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.`).concat(Ep,` {
|
|
186
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.`).concat(Sp," .").concat(Sp,` {
|
|
190
|
-
right: 0 `).concat(r,`;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.`).concat(Ep," .").concat(Ep,` {
|
|
194
|
-
margin-right: 0 `).concat(r,`;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
body {
|
|
198
|
-
`).concat(OY,": ").concat(a,`px;
|
|
199
|
-
}
|
|
200
|
-
`)},WY=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r,i=m.useMemo(function(){return VY(o)},[o]);return m.createElement(UY,{styles:HY(i,!e,o,n?"":"!important")})},k0=!1;if(typeof window<"u")try{var Bf=Object.defineProperty({},"passive",{get:function(){return k0=!0,!0}});window.addEventListener("test",Bf,Bf),window.removeEventListener("test",Bf,Bf)}catch{k0=!1}var Ka=k0?{passive:!1}:!1,KY=function(t){return t.tagName==="TEXTAREA"},UM=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!KY(t)&&n[e]==="visible")},qY=function(t){return UM(t,"overflowY")},GY=function(t){return UM(t,"overflowX")},vE=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=HM(t,n);if(r){var o=WM(t,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},YY=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},XY=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},HM=function(t,e){return t==="v"?qY(e):GY(e)},WM=function(t,e){return t==="v"?YY(e):XY(e)},ZY=function(t,e){return t==="h"&&e==="rtl"?-1:1},JY=function(t,e,n,r,o){var i=ZY(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=WM(t,a),h=p[0],g=p[1],x=p[2],v=g-x-i*h;(h||v)&&HM(t,a)&&(d+=v,f+=h),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},Vf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yE=function(t){return[t.deltaX,t.deltaY]},xE=function(t){return t&&"current"in t?t.current:t},QY=function(t,e){return t[0]===e[0]&&t[1]===e[1]},eX=function(t){return`
|
|
201
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
202
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
203
|
-
`)},tX=0,qa=[];function nX(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(tX++)[0],i=m.useState(function(){return VM()})[0],s=m.useRef(t);m.useEffect(function(){s.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var g=_Y([t.lockRef.current],(t.shards||[]).map(xE),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=m.useCallback(function(g,x){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var v=Vf(g),y=n.current,w="deltaX"in g?g.deltaX:y[0]-v[0],k="deltaY"in g?g.deltaY:y[1]-v[1],E,O=g.target,S=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in g&&S==="h"&&O.type==="range")return!1;var P=vE(S,O);if(!P)return!0;if(P?E=S:(E=S==="v"?"h":"v",P=vE(S,O)),!P)return!1;if(!r.current&&"changedTouches"in g&&(w||k)&&(r.current=E),!E)return!0;var M=r.current||E;return JY(M,x,g,M==="h"?w:k,!0)},[]),l=m.useCallback(function(g){var x=g;if(!(!qa.length||qa[qa.length-1]!==i)){var v="deltaY"in x?yE(x):Vf(x),y=e.current.filter(function(E){return E.name===x.type&&E.target===x.target&&QY(E.delta,v)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(xE).filter(Boolean).filter(function(E){return E.contains(x.target)}),k=w.length>0?a(x,w[0]):!s.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),c=m.useCallback(function(g,x,v,y){var w={name:g,delta:x,target:v,should:y};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(k){return k!==w})},1)},[]),u=m.useCallback(function(g){n.current=Vf(g),r.current=void 0},[]),d=m.useCallback(function(g){c(g.type,yE(g),g.target,a(g,t.lockRef.current))},[]),f=m.useCallback(function(g){c(g.type,Vf(g),g.target,a(g,t.lockRef.current))},[]);m.useEffect(function(){return qa.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ka),document.addEventListener("touchmove",l,Ka),document.addEventListener("touchstart",u,Ka),function(){qa=qa.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Ka),document.removeEventListener("touchmove",l,Ka),document.removeEventListener("touchstart",u,Ka)}},[]);var p=t.removeScrollBar,h=t.inert;return m.createElement(m.Fragment,null,h?m.createElement(i,{styles:eX(o)}):null,p?m.createElement(WY,{gapMode:"margin"}):null)}const rX=$Y(BM,nX);var KM=m.forwardRef(function(t,e){return m.createElement(Gm,fo({},t,{ref:e,sideCar:rX}))});KM.classNames=Gm.classNames;const Ym=KM,S0=["Enter"," "],oX=["ArrowDown","PageUp","Home"],qM=["ArrowUp","PageDown","End"],iX=[...oX,...qM],sX={ltr:[...S0,"ArrowRight"],rtl:[...S0,"ArrowLeft"]},aX={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xm="Menu",[Rd,lX,cX]=Um(Xm),[Ra,GM]=Er(Xm,[cX,xc,LM]),V1=xc(),YM=LM(),[uX,$a]=Ra(Xm),[dX,of]=Ra(Xm),fX=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,a=V1(e),[l,c]=m.useState(null),u=m.useRef(!1),d=Bt(i),f=Gd(o);return m.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),m.createElement(j1,a,m.createElement(uX,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c},m.createElement(dX,{scope:e,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s},r)))},XM=m.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=V1(n);return m.createElement(z1,A({},o,r,{ref:e}))}),ZM="MenuPortal",[pX,JM]=Ra(ZM,{forceMount:void 0}),hX=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=$a(ZM,e);return m.createElement(pX,{scope:e,forceMount:n},m.createElement(Cn,{present:n||i.open},m.createElement(qm,{asChild:!0,container:o},r)))},Jr="MenuContent",[mX,U1]=Ra(Jr),gX=m.forwardRef((t,e)=>{const n=JM(Jr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=$a(Jr,t.__scopeMenu),s=of(Jr,t.__scopeMenu);return m.createElement(Rd.Provider,{scope:t.__scopeMenu},m.createElement(Cn,{present:r||i.open},m.createElement(Rd.Slot,{scope:t.__scopeMenu},s.modal?m.createElement(vX,A({},o,{ref:e})):m.createElement(yX,A({},o,{ref:e})))))}),vX=m.forwardRef((t,e)=>{const n=$a(Jr,t.__scopeMenu),r=m.useRef(null),o=$e(e,r);return m.useEffect(()=>{const i=r.current;if(i)return Vm(i)},[]),m.createElement(H1,A({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),yX=m.forwardRef((t,e)=>{const n=$a(Jr,t.__scopeMenu);return m.createElement(H1,A({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),H1=m.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...g}=t,x=$a(Jr,n),v=of(Jr,n),y=V1(n),w=YM(n),k=lX(n),[E,O]=m.useState(null),S=m.useRef(null),P=$e(e,S,x.onContentChange),M=m.useRef(0),$=m.useRef(""),V=m.useRef(0),j=m.useRef(null),le=m.useRef("right"),K=m.useRef(0),H=h?Ym:m.Fragment,C=h?{as:ri,allowPinchZoom:!0}:void 0,T=N=>{var R,L;const q=$.current+N,ve=k().filter(Ye=>!Ye.disabled),he=document.activeElement,Be=(R=ve.find(Ye=>Ye.ref.current===he))===null||R===void 0?void 0:R.textValue,Oe=ve.map(Ye=>Ye.textValue),J=AX(Oe,q,Be),Ge=(L=ve.find(Ye=>Ye.textValue===J))===null||L===void 0?void 0:L.ref.current;(function Ye(Xe){$.current=Xe,window.clearTimeout(M.current),Xe!==""&&(M.current=window.setTimeout(()=>Ye(""),1e3))})(q),Ge&&setTimeout(()=>Ge.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Wm();const _=m.useCallback(N=>{var R,L;return le.current===((R=j.current)===null||R===void 0?void 0:R.side)&&DX(N,(L=j.current)===null||L===void 0?void 0:L.area)},[]);return m.createElement(mX,{scope:n,searchRef:$,onItemEnter:m.useCallback(N=>{_(N)&&N.preventDefault()},[_]),onItemLeave:m.useCallback(N=>{var R;_(N)||((R=S.current)===null||R===void 0||R.focus(),O(null))},[_]),onTriggerLeave:m.useCallback(N=>{_(N)&&N.preventDefault()},[_]),pointerGraceTimerRef:V,onPointerGraceIntentChange:m.useCallback(N=>{j.current=N},[])},m.createElement(H,C,m.createElement(Km,{asChild:!0,trapped:o,onMountAutoFocus:ne(i,N=>{var R;N.preventDefault(),(R=S.current)===null||R===void 0||R.focus()}),onUnmountAutoFocus:s},m.createElement(Hm,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p},m.createElement(SY,A({asChild:!0},w,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:ne(l,N=>{v.isUsingKeyboardRef.current||N.preventDefault()})}),m.createElement(F1,A({role:"menu","aria-orientation":"vertical","data-state":rN(x.open),"data-radix-menu-content":"",dir:v.dir},y,g,{ref:P,style:{outline:"none",...g.style},onKeyDown:ne(g.onKeyDown,N=>{const L=N.target.closest("[data-radix-menu-content]")===N.currentTarget,q=N.ctrlKey||N.altKey||N.metaKey,ve=N.key.length===1;L&&(N.key==="Tab"&&N.preventDefault(),!q&&ve&&T(N.key));const he=S.current;if(N.target!==he||!iX.includes(N.key))return;N.preventDefault();const Oe=k().filter(J=>!J.disabled).map(J=>J.ref.current);qM.includes(N.key)&&Oe.reverse(),RX(Oe)}),onBlur:ne(t.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(M.current),$.current="")}),onPointerMove:ne(t.onPointerMove,$d(N=>{const R=N.target,L=K.current!==N.clientX;if(N.currentTarget.contains(R)&&L){const q=N.clientX>K.current?"right":"left";le.current=q,K.current=N.clientX}}))})))))))}),xX=m.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.createElement(we.div,A({},r,{ref:e}))}),E0="MenuItem",bE="menu.itemSelect",W1=m.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=m.useRef(null),s=of(E0,t.__scopeMenu),a=U1(E0,t.__scopeMenu),l=$e(e,i),c=m.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(bE,{bubbles:!0,cancelable:!0});d.addEventListener(bE,p=>r==null?void 0:r(p),{once:!0}),CO(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(QM,A({},o,{ref:l,disabled:n,onClick:ne(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)===null||f===void 0||f.call(t,d),c.current=!0},onPointerUp:ne(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)===null||f===void 0||f.click()}),onKeyDown:ne(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||S0.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),QM=m.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=U1(E0,n),a=YM(n),l=m.useRef(null),c=$e(e,l),[u,d]=m.useState(!1),[f,p]=m.useState("");return m.useEffect(()=>{const h=l.current;if(h){var g;p(((g=h.textContent)!==null&&g!==void 0?g:"").trim())}},[i.children]),m.createElement(Rd.ItemSlot,{scope:n,disabled:r,textValue:o??f},m.createElement(EY,A({asChild:!0},a,{focusable:!r}),m.createElement(we.div,A({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:ne(t.onPointerMove,$d(h=>{r?s.onItemLeave(h):(s.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus())})),onPointerLeave:ne(t.onPointerLeave,$d(h=>s.onItemLeave(h))),onFocus:ne(t.onFocus,()=>d(!0)),onBlur:ne(t.onBlur,()=>d(!1))}))))}),bX=m.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return m.createElement(tN,{scope:t.__scopeMenu,checked:n},m.createElement(W1,A({role:"menuitemcheckbox","aria-checked":Bh(n)?"mixed":n},o,{ref:e,"data-state":K1(n),onSelect:ne(o.onSelect,()=>r==null?void 0:r(Bh(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),wX="MenuRadioGroup",[koe,kX]=Ra(wX,{value:void 0,onValueChange:()=>{}}),SX="MenuRadioItem",EX=m.forwardRef((t,e)=>{const{value:n,...r}=t,o=kX(SX,t.__scopeMenu),i=n===o.value;return m.createElement(tN,{scope:t.__scopeMenu,checked:i},m.createElement(W1,A({role:"menuitemradio","aria-checked":i},r,{ref:e,"data-state":K1(i),onSelect:ne(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),eN="MenuItemIndicator",[tN,_X]=Ra(eN,{checked:!1}),CX=m.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=_X(eN,n);return m.createElement(Cn,{present:r||Bh(i.checked)||i.checked===!0},m.createElement(we.span,A({},o,{ref:e,"data-state":K1(i.checked)})))}),OX=m.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.createElement(we.div,A({role:"separator","aria-orientation":"horizontal"},r,{ref:e}))}),TX="MenuSub",[Soe,nN]=Ra(TX),Uf="MenuSubTrigger",PX=m.forwardRef((t,e)=>{const n=$a(Uf,t.__scopeMenu),r=of(Uf,t.__scopeMenu),o=nN(Uf,t.__scopeMenu),i=U1(Uf,t.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),m.createElement(XM,A({asChild:!0},c),m.createElement(QM,A({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":rN(n.open)},t,{ref:fm(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)===null||f===void 0||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(t.onPointerMove,$d(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ne(t.onPointerLeave,$d(d=>{var f;u();const p=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(p){var h;const g=(h=n.content)===null||h===void 0?void 0:h.dataset.side,x=g==="right",v=x?-5:5,y=p[x?"left":"right"],w=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:y,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:y,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ne(t.onKeyDown,d=>{const f=i.searchRef.current!=="";if(!(t.disabled||f&&d.key===" ")&&sX[r.dir].includes(d.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),d.preventDefault()}})})))}),MX="MenuSubContent",NX=m.forwardRef((t,e)=>{const n=JM(Jr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=$a(Jr,t.__scopeMenu),s=of(Jr,t.__scopeMenu),a=nN(MX,t.__scopeMenu),l=m.useRef(null),c=$e(e,l);return m.createElement(Rd.Provider,{scope:t.__scopeMenu},m.createElement(Cn,{present:r||i.open},m.createElement(Rd.Slot,{scope:t.__scopeMenu},m.createElement(H1,A({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)===null||d===void 0||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ne(t.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ne(t.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:ne(t.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=aX[s.dir].includes(u.key);if(d&&f){var p;i.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function rN(t){return t?"open":"closed"}function Bh(t){return t==="indeterminate"}function K1(t){return Bh(t)?"indeterminate":t?"checked":"unchecked"}function RX(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function $X(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function AX(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=$X(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function IX(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,u=e[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function DX(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return IX(n,e)}function $d(t){return e=>e.pointerType==="mouse"?t(e):void 0}const LX=fX,jX=XM,zX=hX,FX=gX,BX=xX,VX=W1,UX=bX,HX=EX,WX=CX,KX=OX,qX=PX,GX=NX,oN="DropdownMenu",[YX,Eoe]=Er(oN,[GM]),Pr=GM(),[XX,iN]=YX(oN),ZX=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=Pr(e),c=m.useRef(null),[u=!1,d]=Co({prop:o,defaultProp:i,onChange:s});return m.createElement(XX,{scope:e,triggerId:vr(),triggerRef:c,contentId:vr(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:a},m.createElement(LX,A({},l,{open:u,onOpenChange:d,dir:r,modal:a}),n))},JX="DropdownMenuTrigger",QX=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=iN(JX,n),s=Pr(n);return m.createElement(jX,A({asChild:!0},s),m.createElement(we.button,A({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:fm(e,i.triggerRef),onPointerDown:ne(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ne(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),eZ=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Pr(e);return m.createElement(zX,A({},r,n))},tZ="DropdownMenuContent",nZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=iN(tZ,n),i=Pr(n),s=m.useRef(!1);return m.createElement(FX,A({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:e,onCloseAutoFocus:ne(t.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:ne(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),rZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(BX,A({},o,r,{ref:e}))}),oZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(VX,A({},o,r,{ref:e}))}),iZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(UX,A({},o,r,{ref:e}))}),sZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(HX,A({},o,r,{ref:e}))}),aZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(WX,A({},o,r,{ref:e}))}),lZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(KX,A({},o,r,{ref:e}))}),cZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(qX,A({},o,r,{ref:e}))}),uZ=m.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Pr(n);return m.createElement(GX,A({},o,r,{ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),dZ=ZX,fZ=QX,pZ=eZ,sN=nZ,aN=rZ,lN=oZ,cN=iZ,uN=sZ,dN=aZ,fN=lZ,pN=cZ,hN=uZ,hZ=dZ,mZ=fZ,gZ=m.forwardRef(({className:t,inset:e,children:n,...r},o)=>b.jsxs(pN,{ref:o,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,b.jsx(Z3,{className:"w-4 h-4 ml-auto"})]}));gZ.displayName=pN.displayName;const vZ=m.forwardRef(({className:t,...e},n)=>b.jsx(hN,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));vZ.displayName=hN.displayName;const mN=m.forwardRef(({className:t,sideOffset:e=4,container:n,...r},o)=>b.jsx(pZ,{container:n,children:b.jsx(sN,{ref:o,sideOffset:e,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));mN.displayName=sN.displayName;const Ri=m.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(lN,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));Ri.displayName=lN.displayName;const yZ=m.forwardRef(({className:t,children:e,checked:n,...r},o)=>b.jsxs(cN,{ref:o,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(dN,{children:b.jsx(Ix,{className:"w-4 h-4"})})}),e]}));yZ.displayName=cN.displayName;const xZ=m.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(uN,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(dN,{children:b.jsx(J3,{className:"w-2 h-2 fill-current"})})}),e]}));xZ.displayName=uN.displayName;const bZ=m.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(aN,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));bZ.displayName=aN.displayName;const wZ=m.forwardRef(({className:t,...e},n)=>b.jsx(fN,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));wZ.displayName=fN.displayName;function Vh(t){"@babel/helpers - typeof";return Vh=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},Vh(t)}function Sa(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Kt(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function lr(t){Kt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Vh(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function kZ(t,e){Kt(2,arguments);var n=lr(t).getTime(),r=Sa(e);return new Date(n+r)}var SZ={};function Zm(){return SZ}function EZ(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function wE(t){Kt(1,arguments);var e=lr(t);return e.setHours(0,0,0,0),e}function _Z(t){return Kt(1,arguments),t instanceof Date||Vh(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function CZ(t){if(Kt(1,arguments),!_Z(t)&&typeof t!="number")return!1;var e=lr(t);return!isNaN(Number(e))}function OZ(t){Kt(1,arguments);var e=lr(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function TZ(t){Kt(1,arguments);var e=lr(t);return e.setDate(1),e.setHours(0,0,0,0),e}function PZ(t,e){Kt(2,arguments);var n=Sa(e);return kZ(t,-n)}var MZ=864e5;function NZ(t){Kt(1,arguments);var e=lr(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/MZ)+1}function Uh(t){Kt(1,arguments);var e=1,n=lr(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function gN(t){Kt(1,arguments);var e=lr(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Uh(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=Uh(i);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function RZ(t){Kt(1,arguments);var e=gN(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Uh(n);return r}var $Z=6048e5;function AZ(t){Kt(1,arguments);var e=lr(t),n=Uh(e).getTime()-RZ(e).getTime();return Math.round(n/$Z)+1}function Hh(t,e){var n,r,o,i,s,a,l,c;Kt(1,arguments);var u=Zm(),d=Sa((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=lr(t),p=f.getUTCDay(),h=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-h),f.setUTCHours(0,0,0,0),f}function vN(t,e){var n,r,o,i,s,a,l,c;Kt(1,arguments);var u=lr(t),d=u.getUTCFullYear(),f=Zm(),p=Sa((n=(r=(o=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,p),h.setUTCHours(0,0,0,0);var g=Hh(h,e),x=new Date(0);x.setUTCFullYear(d,0,p),x.setUTCHours(0,0,0,0);var v=Hh(x,e);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function IZ(t,e){var n,r,o,i,s,a,l,c;Kt(1,arguments);var u=Zm(),d=Sa((n=(r=(o=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=vN(t,e),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var h=Hh(p,e);return h}var DZ=6048e5;function LZ(t,e){Kt(1,arguments);var n=lr(t),r=Hh(n,e).getTime()-IZ(n,e).getTime();return Math.round(r/DZ)+1}function We(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var jZ={y:function(e,n){var r=e.getUTCFullYear(),o=r>0?r:1-r;return We(n==="yy"?o%100:o,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):We(r+1,2)},d:function(e,n){return We(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return We(e.getUTCHours()%12||12,n.length)},H:function(e,n){return We(e.getUTCHours(),n.length)},m:function(e,n){return We(e.getUTCMinutes(),n.length)},s:function(e,n){return We(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,o=e.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return We(i,n.length)}};const Si=jZ;var Ga={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},zZ={G:function(e,n,r){var o=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var o=e.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Si.y(e,n)},Y:function(e,n,r,o){var i=vN(e,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return We(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):We(s,n.length)},R:function(e,n){var r=gN(e);return We(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return We(r,n.length)},Q:function(e,n,r){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return We(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,n,r){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return We(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,n,r){var o=e.getUTCMonth();switch(n){case"M":case"MM":return Si.M(e,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(e,n,r){var o=e.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return We(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(e,n,r,o){var i=LZ(e,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):We(i,n.length)},I:function(e,n,r){var o=AZ(e);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):We(o,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Si.d(e,n)},D:function(e,n,r){var o=NZ(e);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):We(o,n.length)},E:function(e,n,r){var o=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(e,n,r,o){var i=e.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return We(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,n,r,o){var i=e.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return We(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,n,r){var o=e.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return We(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(e,n,r){var o=e.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,n,r){var o=e.getUTCHours(),i;switch(o===12?i=Ga.noon:o===0?i=Ga.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,n,r){var o=e.getUTCHours(),i;switch(o>=17?i=Ga.evening:o>=12?i=Ga.afternoon:o>=4?i=Ga.morning:i=Ga.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var o=e.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Si.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Si.H(e,n)},K:function(e,n,r){var o=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):We(o,n.length)},k:function(e,n,r){var o=e.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):We(o,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Si.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Si.s(e,n)},S:function(e,n){return Si.S(e,n)},X:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return SE(s);case"XXXX":case"XX":return js(s);case"XXXXX":case"XXX":default:return js(s,":")}},x:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"x":return SE(s);case"xxxx":case"xx":return js(s);case"xxxxx":case"xxx":default:return js(s,":")}},O:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+kE(s,":");case"OOOO":default:return"GMT"+js(s,":")}},z:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+kE(s,":");case"zzzz":default:return"GMT"+js(s,":")}},t:function(e,n,r,o){var i=o._originalDate||e,s=Math.floor(i.getTime()/1e3);return We(s,n.length)},T:function(e,n,r,o){var i=o._originalDate||e,s=i.getTime();return We(s,n.length)}};function kE(t,e){var n=t>0?"-":"+",r=Math.abs(t),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=e||"";return n+String(o)+s+We(i,2)}function SE(t,e){if(t%60===0){var n=t>0?"-":"+";return n+We(Math.abs(t)/60,2)}return js(t,e)}function js(t,e){var n=e||"",r=t>0?"-":"+",o=Math.abs(t),i=We(Math.floor(o/60),2),s=We(o%60,2);return r+i+n+s}var EE=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},yN=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},FZ=function(e,n){var r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return EE(e,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",EE(o,n)).replace("{{time}}",yN(i,n))},BZ={p:yN,P:FZ},VZ=["D","DD"],UZ=["YY","YYYY"];function HZ(t){return VZ.indexOf(t)!==-1}function WZ(t){return UZ.indexOf(t)!==-1}function _E(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var KZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qZ=function(e,n,r){var o,i=KZ[e];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const GZ=qZ;function hv(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var YZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},XZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ZZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},JZ={date:hv({formats:YZ,defaultWidth:"full"}),time:hv({formats:XZ,defaultWidth:"full"}),dateTime:hv({formats:ZZ,defaultWidth:"full"})};const QZ=JZ;var eJ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},tJ=function(e,n,r,o){return eJ[e]};const nJ=tJ;function Dc(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=t.formattingValues[s]||t.formattingValues[i]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return o[c]}}var rJ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oJ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},iJ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},sJ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},aJ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},lJ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},cJ=function(e,n){var r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},uJ={ordinalNumber:cJ,era:Dc({values:rJ,defaultWidth:"wide"}),quarter:Dc({values:oJ,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Dc({values:iJ,defaultWidth:"wide"}),day:Dc({values:sJ,defaultWidth:"wide"}),dayPeriod:Dc({values:aJ,defaultWidth:"wide",formattingValues:lJ,defaultFormattingWidth:"wide"})};const dJ=uJ;function Lc(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;var s=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?pJ(a,function(d){return d.test(s)}):fJ(a,function(d){return d.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function fJ(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function pJ(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}function hJ(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var o=r[0],i=e.match(t.parsePattern);if(!i)return null;var s=t.valueCallback?t.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(o.length);return{value:s,rest:a}}}var mJ=/^(\d+)(th|st|nd|rd)?/i,gJ=/\d+/i,vJ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yJ={any:[/^b/i,/^(a|c)/i]},xJ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bJ={any:[/1/i,/2/i,/3/i,/4/i]},wJ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kJ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},SJ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EJ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_J={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},CJ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OJ={ordinalNumber:hJ({matchPattern:mJ,parsePattern:gJ,valueCallback:function(e){return parseInt(e,10)}}),era:Lc({matchPatterns:vJ,defaultMatchWidth:"wide",parsePatterns:yJ,defaultParseWidth:"any"}),quarter:Lc({matchPatterns:xJ,defaultMatchWidth:"wide",parsePatterns:bJ,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Lc({matchPatterns:wJ,defaultMatchWidth:"wide",parsePatterns:kJ,defaultParseWidth:"any"}),day:Lc({matchPatterns:SJ,defaultMatchWidth:"wide",parsePatterns:EJ,defaultParseWidth:"any"}),dayPeriod:Lc({matchPatterns:_J,defaultMatchWidth:"any",parsePatterns:CJ,defaultParseWidth:"any"})};const TJ=OJ;var PJ={code:"en-US",formatDistance:GZ,formatLong:QZ,formatRelative:nJ,localize:dJ,match:TJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};const xN=PJ;var MJ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,NJ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RJ=/^'([^]*?)'?$/,$J=/''/g,AJ=/[a-zA-Z]/;function Aa(t,e,n){var r,o,i,s,a,l,c,u,d,f,p,h,g,x,v,y,w,k;Kt(2,arguments);var E=String(e),O=Zm(),S=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:O.locale)!==null&&r!==void 0?r:xN,P=Sa((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:O.firstWeekContainsDate)!==null&&s!==void 0?s:(d=O.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(P>=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=Sa((p=(h=(g=(x=n==null?void 0:n.weekStartsOn)!==null&&x!==void 0?x:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:O.weekStartsOn)!==null&&h!==void 0?h:(w=O.locale)===null||w===void 0||(k=w.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&p!==void 0?p:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var $=lr(t);if(!CZ($))throw new RangeError("Invalid time value");var V=EZ($),j=PZ($,V),le={firstWeekContainsDate:P,weekStartsOn:M,locale:S,_originalDate:$},K=E.match(NJ).map(function(H){var C=H[0];if(C==="p"||C==="P"){var T=BZ[C];return T(H,S.formatLong)}return H}).join("").match(MJ).map(function(H){if(H==="''")return"'";var C=H[0];if(C==="'")return IJ(H);var T=zZ[C];if(T)return!(n!=null&&n.useAdditionalWeekYearTokens)&&WZ(H)&&_E(H,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&HZ(H)&&_E(H,e,String(t)),T(j,H,S.localize,le);if(C.match(AJ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return H}).join("");return K}function IJ(t){var e=t.match(RJ);return e?e[1].replace($J,"'"):t}var kt=function(){return kt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},kt.apply(this,arguments)};var bN={exports:{}},jc={};/**
|
|
204
|
-
* @license React
|
|
205
|
-
* react-jsx-runtime.production.min.js
|
|
206
|
-
*
|
|
207
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the MIT license found in the
|
|
210
|
-
* LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/var CE;function DJ(){if(CE)return jc;CE=1;var t=X,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:e,type:a,key:f,ref:p,props:d,_owner:o.current}}return jc.Fragment=n,jc.jsx=s,jc.jsxs=s,jc}bN.exports=DJ();var wN=bN.exports;function LJ(t){return t.mode==="multiple"}function jJ(t){return t.mode==="range"}function zJ(t){return t.mode==="single"}var FJ={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function BJ(t,e){return Aa(t,"LLLL y",e)}function VJ(t,e){return Aa(t,"d",e)}function UJ(t,e){return Aa(t,"LLLL",e)}function HJ(t){return"".concat(t)}function WJ(t,e){return Aa(t,"cccccc",e)}function KJ(t,e){return Aa(t,"yyyy",e)}var qJ=Object.freeze({__proto__:null,formatCaption:BJ,formatDay:VJ,formatMonthCaption:UJ,formatWeekNumber:HJ,formatWeekdayName:WJ,formatYearCaption:KJ}),GJ=function(t,e,n){return Aa(t,"do MMMM (EEEE)",n)},YJ=function(){return"Month: "},XJ=function(){return"Go to next month"},ZJ=function(){return"Go to previous month"},JJ=function(t,e){return Aa(t,"cccc",e)},QJ=function(t){return"Week n. ".concat(t)},eQ=function(){return"Year: "},tQ=Object.freeze({__proto__:null,labelDay:GJ,labelMonthDropdown:YJ,labelNext:XJ,labelPrevious:ZJ,labelWeekNumber:QJ,labelWeekday:JJ,labelYearDropdown:eQ});function nQ(){var t="buttons",e=FJ,n=xN,r={},o={},i=1,s={},a=new Date;return{captionLayout:t,classNames:e,formatters:qJ,labels:tQ,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function rQ(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,o=t.toMonth,i=t.fromDate,s=t.toDate;return r?i=TZ(r):e&&(i=new Date(e,0,1)),o?s=OZ(o):n&&(s=new Date(n,11,31)),{fromDate:i?wE(i):void 0,toDate:s?wE(s):void 0}}var kN=m.createContext(void 0);function oQ(t){var e,n=t.initialProps,r=nQ(),o=rQ(n),i=o.fromDate,s=o.toDate,a=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(zJ(n)||LJ(n)||jJ(n))&&(l=n.onSelect);var c=kt(kt(kt({},r),n),{captionLayout:a,classNames:kt(kt({},r.classNames),n.classNames),components:kt({},n.components),formatters:kt(kt({},r.formatters),n.formatters),fromDate:i,labels:kt(kt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:kt(kt({},r.modifiers),n.modifiers),modifiersClassNames:kt(kt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:kt(kt({},r.styles),n.styles),toDate:s});return wN.jsx(kN.Provider,{value:c,children:t.children})}function iQ(){var t=m.useContext(kN);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}m.createContext(void 0);m.forwardRef(function(t,e){var n=iQ(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];t.className&&i.push(t.className);var s=i.join(" "),a=kt(kt({},o.button_reset),o.button);return t.style&&Object.assign(a,t.style),wN.jsx("button",kt({},t,{ref:e,type:"button",className:s,style:a}))});m.createContext(void 0);m.createContext(void 0);var Oo;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Oo||(Oo={}));Oo.Selected;Oo.Disabled;Oo.Hidden;Oo.Today;Oo.RangeEnd;Oo.RangeMiddle;Oo.RangeStart;Oo.Outside;m.createContext(void 0);m.createContext(void 0);m.createContext(void 0);var sQ=Object.defineProperty,aQ=Object.getOwnPropertyDescriptor,sf=(t,e,n,r)=>{for(var o=r>1?void 0:r?aQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&sQ(e,n,o),o},lQ={icon:"bold",label:({t})=>t(Ik.LABEL),description:({t})=>t(Ik.DESCRIPTION)},Ea=class extends tf{get name(){return"bold"}createTags(){return[Ce.FormattingMark,Ce.FontStyle]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"strong",getAttrs:t.parse},{tag:"b",getAttrs:n=>So(n)&&n.style.fontWeight!=="normal"?t.parse(n):!1},{style:"font-weight",getAttrs:n=>ge(n)&&/^(bold(er)?|[5-9]\d{2,})$/.test(n)?null:!1},...e.parseDOM??[]],toDOM:n=>{const{weight:r}=this.options;return r?["strong",{"font-weight":r.toString()},0]:["strong",t.dom(n),0]}}}createInputRules(){return[Th({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(t){return kd({type:this.type,selection:t})}setBold(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=br(t??e.selection,e.doc);return n==null||n(e.addMark(r,o,this.type.create())),!0}}removeBold(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=br(t??e.selection,e.doc);return e.doc.rangeHasMark(r,o,this.type)?(n==null||n(e.removeMark(r,o,this.type)),!0):!1}}shortcut(t){return this.toggleBold()(t)}};sf([oe(lQ)],Ea.prototype,"toggleBold",1);sf([oe()],Ea.prototype,"setBold",1);sf([oe()],Ea.prototype,"removeBold",1);sf([ar({shortcut:U.Bold,command:"toggleBold"})],Ea.prototype,"shortcut",1);Ea=sf([Le({defaultOptions:{weight:void 0},staticKeys:["weight"]})],Ea);var cQ=Object.defineProperty,uQ=Object.getOwnPropertyDescriptor,q1=(t,e,n,r)=>{for(var o=r>1?void 0:r?uQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&cQ(e,n,o),o},dQ={icon:"italic",label:({t})=>t(Dk.LABEL),description:({t})=>t(Dk.DESCRIPTION)},Ad=class extends tf{get name(){return"italic"}createTags(){return[Ce.FontStyle,Ce.FormattingMark]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"i",getAttrs:t.parse},{tag:"em",getAttrs:t.parse},{style:"font-style=italic"},...e.parseDOM??[]],toDOM:n=>["em",t.dom(n),0]}}createKeymap(){return{"Mod-i":kd({type:this.type})}}createInputRules(){return[Th({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:t,start:e})=>t.startsWith("*")?{}:{fullMatch:t.slice(1),start:e+1}}),Th({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:t,start:e})=>t.startsWith("_")?{}:{fullMatch:t.slice(1),start:e+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(t){return kd({type:this.type,selection:t})}shortcut(t){return this.toggleItalic()(t)}};q1([oe(dQ)],Ad.prototype,"toggleItalic",1);q1([ar({shortcut:U.Italic,command:"toggleItalic"})],Ad.prototype,"shortcut",1);Ad=q1([Le({})],Ad);var fQ=Object.defineProperty,pQ=Object.getOwnPropertyDescriptor,G1=(t,e,n,r)=>{for(var o=r>1?void 0:r?pQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&fQ(e,n,o),o},hQ={icon:"strikethrough",label:({t})=>t(Lk.LABEL),description:({t})=>t(Lk.DESCRIPTION)},Id=class extends tf{get name(){return"strike"}createTags(){return[Ce.FontStyle,Ce.FormattingMark]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"s",getAttrs:t.parse},{tag:"del",getAttrs:t.parse},{tag:"strike",getAttrs:t.parse},{style:"text-decoration",getAttrs:n=>n==="line-through"?{}:!1},...e.parseDOM??[]],toDOM:n=>["s",t.dom(n),0]}}toggleStrike(){return kd({type:this.type})}shortcut(t){return this.toggleStrike()(t)}createInputRules(){return[Th({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};G1([oe(hQ)],Id.prototype,"toggleStrike",1);G1([ar({shortcut:U.Strike,command:"toggleStrike"})],Id.prototype,"shortcut",1);Id=G1([Le({})],Id);var SN=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},je=(t,e,n)=>(SN(t,e,"read from private field"),n?n.call(t):e.get(t)),il=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},$i=(t,e,n,r)=>(SN(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),mQ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="rotate(90)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',gQ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="matrix(0 1 1 0 0 0)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',vQ=encodeURIComponent(mQ),yQ=encodeURIComponent(gQ),Tn,xQ=class{constructor(t){il(this,Tn,void 0);const e=document.createElement("div"),n=document.createElement("div");this.dom=e,$i(this,Tn,n),this.type=t,this.createHandle(t)}createHandle(t){switch(on(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),on(je(this,Tn),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),je(this,Tn).dataset.dragging="",t){case 0:on(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),on(je(this,Tn),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:on(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),on(je(this,Tn),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:on(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),on(je(this,Tn),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:on(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),on(je(this,Tn),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${yQ}") `});break;case 4:on(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),on(je(this,Tn),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${vQ}") `});break}this.dom.append(je(this,Tn))}setHandleVisibility(t){const e=t||!!je(this,Tn).dataset.dragging;je(this,Tn).style.opacity=e?"1":"0"}dataSetDragging(t){je(this,Tn).dataset.dragging=t?"true":""}};Tn=new WeakMap;var Hf=50,EN=(t=>(t[t.Fixed=0]="Fixed",t[t.Flexible=1]="Flexible",t))(EN||{}),zs,Fs,Bs,zo,Vs,bQ=class{constructor({node:t,view:e,getPos:n,aspectRatio:r=0,options:o,initialSize:i}){il(this,zs,void 0),il(this,Fs,void 0),il(this,Bs,[]),il(this,zo,void 0),il(this,Vs,void 0);const s=this.createWrapper(t,i),a=this.createElement({node:t,view:e,getPos:n,options:o}),c=(r===1?[0,1,2,3,4]:[0,1]).map(f=>new xQ(f));for(const f of c){const p=h=>{this.startResizing(h,e,n,f)};f.dom.addEventListener("mousedown",p),je(this,Bs).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),je(this,Bs).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,$i(this,Fs,t),$i(this,zs,a),this.aspectRatio=r}createWrapper(t,e){const n=document.createElement("div");return n.classList.add("remirror-resizable-view"),n.style.position="relative",e?on(n,{width:OE(e.width),aspectRatio:`${e.width} / ${e.height}`}):on(n,{width:OE(t.attrs.width),aspectRatio:`${t.attrs.width} / ${t.attrs.height}`}),on(n,{maxWidth:"100%",minWidth:`${Hf}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),n}startResizing(t,e,n,r){var o,i;t.preventDefault(),r.dataSetDragging(!0),je(this,zs).style.pointerEvents="none";const s=t.pageX,a=t.pageY,l=((o=je(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=je(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=jy(100,!1,f=>{const p=f.pageX,h=f.pageY,g=p-s,x=h-a;let v=null,y=null;if(this.aspectRatio===0&&l&&c)switch(r.type){case 0:case 3:v=l+g,y=c/l*v;break;case 1:case 4:v=l-g,y=c/l*v;break;case 2:y=c+x,v=l/c*y;break}else if(this.aspectRatio===1)switch(r.type){case 0:v=l+g;break;case 1:v=l-g;break;case 2:y=c+x;break;case 3:v=l+g,y=c+x;break;case 4:v=l-g,y=c+x;break}typeof v=="number"&&v<Hf&&(this.aspectRatio===0&&l&&c?(v=Hf,y=c/l*v):this.aspectRatio===1&&(v=Hf)),v&&($i(this,zo,Math.round(v)),this.dom.style.width=`${je(this,zo)}px`),y&&$i(this,Vs,Math.round(y)),(v||y)&&(this.dom.style.aspectRatio=`${je(this,zo)} / ${je(this,Vs)}`)}),d=f=>{f.preventDefault(),r.dataSetDragging(!1),r.setHandleVisibility(!1),je(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=n(),h=e.state.tr.setNodeMarkup(p,void 0,{...je(this,Fs).attrs,width:je(this,zo),height:je(this,Vs)});e.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),je(this,Bs).push(()=>document.removeEventListener("mousemove",u)),je(this,Bs).push(()=>document.removeEventListener("mouseup",d))}update(t){return t.type!==je(this,Fs).type||this.aspectRatio===0&&t.attrs.width&&t.attrs.width!==je(this,zo)||this.aspectRatio===1&&t.attrs.width&&t.attrs.height&&t.attrs.width!==je(this,zo)&&t.attrs.height!==je(this,Vs)||!wQ(je(this,Fs),t,["width","height"])?!1:($i(this,Fs,t),$i(this,zo,t.attrs.width),$i(this,Vs,t.attrs.height),!0)}destroy(){je(this,Bs).forEach(t=>t())}};zs=new WeakMap;Fs=new WeakMap;Bs=new WeakMap;zo=new WeakMap;Vs=new WeakMap;function wQ(t,e,n){return t===e||kQ(t,e,n)&&t.content.eq(e.content)}function kQ(t,e,n){const r=t.attrs,o=e.attrs,i={};for(const a of n)i[a]=null;t.attrs={...r,...i},e.attrs={...o,...i};const s=t.sameMarkup(e);return t.attrs=r,e.attrs=o,s}function OE(t){return typeof t=="number"?`${t}px`:t||void 0}var SQ=Object.defineProperty,EQ=Object.getOwnPropertyDescriptor,Y1=(t,e,n,r)=>{for(var o=r>1?void 0:r?EQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&SQ(e,n,o),o},_Q=class extends bQ{constructor(t,e,n){super({node:t,view:e,getPos:n,aspectRatio:EN.Fixed})}createElement({node:t}){const e=document.createElement("img");return e.setAttribute("src",t.attrs.src),on(e,{width:"100%",minWidth:"50px",objectFit:"contain"}),e}},Dd=class extends Or{get name(){return"image"}createTags(){return[Ce.InlineNode,Ce.Media]}createNodeSpec(t,e){const{preferPastedTextContent:n}=this.options;return{inline:!0,draggable:!0,selectable:!1,...e,attrs:{...t.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:r=>{var o;if(So(r)){const i=OQ({element:r,parse:t.parse});return n&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...e.parseDOM??[]],toDOM:r=>{const o=vP(r.attrs,t);return["img",{...t.dom(r),...o}]}}}insertImage(t,e){return({tr:n,dispatch:r})=>{const{from:o,to:i}=br(e??n.selection,n.doc),s=this.type.create(t);return r==null||r(n.replaceRangeWith(o,i,s)),!0}}uploadImage(t,e){const{updatePlaceholder:n,destroyPlaceholder:r,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:t,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return e==null||e(u),u},onUpdate:(l,c,u,d)=>{n(l,c,u,d)},onDestroy:(l,c)=>{r(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=d2(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(t,e,n){var r;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&MQ(e)&&((r=e.clipboardData)!=null&&r.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=t.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);tr(n)&&a.selectText(n);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:t=>{const e=t.type==="drop"?t.pos:void 0;return this.fileUploadFileHandler(t.files,t.event,e)}}]}createNodeViews(){return this.options.enableResizing?(t,e,n)=>new _Q(t,e,n):{}}};Y1([oe()],Dd.prototype,"insertImage",1);Y1([oe()],Dd.prototype,"uploadImage",1);Dd=Y1([Le({defaultOptions:{createPlaceholder:TQ,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:PQ,enableResizing:!1,preferPastedTextContent:!0}})],Dd);function CQ(t){let{width:e,height:n}=t.style;return e=e||t.getAttribute("width")||"",n=n||t.getAttribute("height")||"",{width:e,height:n}}function OQ({element:t,parse:e}){const{width:n,height:r}=CQ(t);return{...e(t),alt:t.getAttribute("alt")??"",height:Number.parseInt(r||"0",10)||null,src:t.getAttribute("src")??null,title:t.getAttribute("title")??"",width:Number.parseInt(n||"0",10)||null,fileName:t.getAttribute("data-file-name")??null}}function TQ(t,e){const n=document.createElement("div");return n.classList.add(aK.IMAGE_LOADER),n}function PQ(t){de(t.length>0,{code:B.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let e=0;const n=[];for(const{file:r,progress:o}of t)n.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;e+=1,o(e/t.length),i({src:(l=a.target)==null?void 0:l.result,fileName:r.name})},{once:!0}),s.readAsDataURL(r)}));return n}function MQ(t){return t.clipboardData!==void 0}function NQ(t={}){return new pi({view(e){return new RQ(e,t)}})}class RQ{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"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),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=f2(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)}}var $Q=Object.defineProperty,AQ=Object.getOwnPropertyDescriptor,IQ=(t,e,n,r)=>{for(var o=r>1?void 0:r?AQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&$Q(e,n,o),o},_0=class extends ut{get name(){return"dropCursor"}createExternalPlugins(){const{color:t,width:e}=this.options;return[NQ({color:t,width:e})]}};_0=IQ([Le({defaultOptions:{color:"black",width:1}})],_0);var DQ=Object.defineProperty,LQ=Object.getOwnPropertyDescriptor,_N=(t,e,n,r)=>{for(var o=r>1?void 0:r?LQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&DQ(e,n,o),o},{LABEL:jQ}=oj,zQ={icon:({attrs:t})=>`h${(t==null?void 0:t.level)??"1"}`,label:({t,attrs:e})=>t({...jQ,values:{level:e==null?void 0:e.level}})},FQ=[U.H1,U.H2,U.H3,U.H4,U.H5,U.H6],Wh=class extends Or{get name(){return"heading"}createTags(){return[Ce.Block,Ce.TextBlock,Ce.FormattingNode]}createNodeSpec(t,e){return{content:"inline*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(n=>({tag:`h${n}`,getAttrs:r=>({...t.parse(r),level:n})})),...e.parseDOM??[]],toDOM:n=>this.options.levels.includes(n.attrs.level)?[`h${n.attrs.level}`,t.dom(n),0]:[`h${this.options.defaultLevel}`,t.dom(n),0]}}toggleHeading(t={}){return bP({type:this.type,toggleType:"paragraph",attrs:t})}createKeymap(t){const e=this.store.getExtension(Me),n=se(),r=[];for(const o of this.options.levels){const i=FQ[o-1]??U.H1;n[i]=Oh(this.type,{level:o}),r.push({attrs:{level:o},shortcut:t(i)[0]})}return e.updateDecorated("toggleHeading",{shortcut:r}),n}createInputRules(){return this.options.levels.map(t=>Ej(new RegExp(`^(#{1,${t}})\\s$`),this.type,()=>({level:t})))}createPasteRules(){return this.options.levels.map(t=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${t}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:t}),startOfTextBlock:!0}))}};_N([oe(zQ)],Wh.prototype,"toggleHeading",1);Wh=_N([Le({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],Wh);var CN={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(typeof self<"u"?self:n$,function(){return function(n){function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}var o={};return r.m=n,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="",r(r.s=0)}([function(n,r,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1<a.indexOf(c[h]));)c[h]==="."&&(++u,d=h);for(u=h,h=d;h--;)if(l.indexOf(c[h])!==-1){f=h+1;break}return 2>f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];n.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f<d;f++)u.push(s(c[f]));return u}i()}}])})})(CN);var BQ=CN.exports;const VQ=ui(BQ);var UQ=Object.defineProperty,HQ=Object.getOwnPropertyDescriptor,af=(t,e,n,r)=>{for(var o=r>1?void 0:r?HQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&UQ(e,n,o),o},WQ=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],TE="updateLink",KQ=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,_a=class extends tf{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[Ce.Link,Ce.ExcludeInputRules]}createMarkSpec(t,e){const n="data-link-auto",r=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&to(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...e,attrs:{...t.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!So(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(n)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...t.parse(o),href:i,auto:a,...r(o.getAttribute("target"))}}},...e.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=vP(o.attrs,t),l=o.attrs.auto?{[n]:""}:{};return["a",{...t.dom(o),...a,rel:"noopener noreferrer nofollow",...l,...r(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:t}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${t.source}$`,t.flags.replace("g",""))}shortcut({tr:t}){let e="",{from:n,to:r,empty:o,$from:i}=t.selection,s=!1;const a=si(i,this.type);if(o){const l=a??hP(t);if(!l)return!1;({text:e,from:n,to:r}=l),s=!0}return n===r?!1:(s||(e=t.doc.textBetween(n,r)),this.options.onActivateLink(e),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:e,from:n,to:r}),!0)}updateLink(t,e){return n=>{const{tr:r}=n;return!(Ma(r.selection)&&!f1(r.selection)||B8(r.selection)||Ch({trState:r,type:this.type}))&&!e?!1:(r.setMeta(this.name,{command:TE,attrs:t,range:e}),a9({type:this.type,attrs:t,range:e})(n))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(t){return e=>{const{tr:n}=e;return Ch({trState:n,type:this.type,...t})?kP({type:this.type,expand:!0,range:t})(e):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(t,e)=>({href:this.buildHref(Au(t)),auto:!e}),transformMatch:t=>{const e=Au(t);return!e||!this.isValidUrl(e)?!1:e}}]}createEventHandlers(){return{clickMark:(t,e)=>{const n=e.getMark(this.type);if(!n)return;const r=n.mark.attrs,o={...r,...n};if(this.options.onClick(t,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=r.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(n)),i}}}createPlugin(){return{appendTransaction:(t,e,n)=>{if(t.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===TE){const{range:g,attrs:x}=h,{selection:v,doc:y}=n,w={range:g,selection:v,doc:y,attrs:x},{from:k,to:E}=g??v;this.options.onUpdateLink(y.textBetween(k,E),w)}}),!this.options.autoLink||h0(e)-h0(n)===1||!t.some(p=>p.docChanged))return;const s=T8(t,e),a=K8(s,[_t,Ft]),{mapping:l}=s,{tr:c,doc:u}=n,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:g,to:x})=>{const v=[],y=x-g===2,w=this.getLinkMarksInRange(e.doc,p,h,!0).filter(k=>k.mark.type===this.type).map(({from:k,to:E,text:O})=>({mappedFrom:l.map(k),mappedTo:l.map(E),text:O,from:k,to:E}));w.forEach(({mappedFrom:k,mappedTo:E,from:O,to:S},P)=>this.getLinkMarksInRange(u,k,E,!0).filter(M=>M.mark.type===this.type).forEach(M=>{const $=e.doc.textBetween(O,S,void 0," "),V=u.textBetween(M.from,M.to+1,void 0," ").trim(),j=this.isValidUrl($);this.isValidUrl(V)||(j&&(f({from:M.from,to:M.to}).tr(),w.splice(P,1)),!y&&g===x&&this.findAutoLinks(V).map(K=>this.addLinkProperties({...K,from:k+K.start,to:k+K.end})).forEach(({attrs:K,range:H,text:C})=>{d(K,H).tr(),v.push({attrs:K,range:H,text:C})}))})),this.findTextBlocksInRange(u,{from:g,to:x}).forEach(({text:k,positionStart:E})=>{this.findAutoLinks(k).map(O=>this.addLinkProperties({...O,from:E+O.start+1,to:E+O.end+1})).filter(({range:O})=>{const S=g>=O.from&&g<=O.to,P=x>=O.from&&x<=O.to;return S||P||y}).filter(({range:O})=>this.getLinkMarksInRange(c.doc,O.from,O.to,!1).length===0).filter(({range:{from:O},text:S})=>!w.some(({text:P,mappedFrom:M})=>M===O&&P===S)).forEach(({attrs:O,text:S,range:P})=>{d(O,P).tr(),v.push({attrs:O,range:P,text:S})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:k,range:E,text:O})=>{const{doc:S,selection:P}=c;this.options.onUpdateLink(O,{attrs:k,doc:S,range:E,selection:P})})})}),c.steps.length!==0)return c}}}buildHref(t){return this.options.extractHref({url:t,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(t,e,n,r){const o=[];if(e===n){const i=Math.max(e-1,0),s=t.resolve(i),a=si(s,this.type);(a==null?void 0:a.mark.attrs.auto)===r&&o.push(a)}else t.nodesBetween(e,n,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===r);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(t,e){const n=[];return t.nodesBetween(e.from,e.to,(r,o)=>{!r.isTextblock||!r.type.allowsMarkType(this.type)||n.push({node:r,pos:o})}),n.map(r=>({text:t.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," "),positionStart:r.pos}))}addLinkProperties({from:t,to:e,href:n,...r}){return{...r,range:{from:t,to:e},attrs:{href:n,auto:!0}}}findAutoLinks(t){if(this.options.findAutoLinks)return this.options.findAutoLinks(t,this.options.defaultProtocol);const e=[];for(const n of Sm(t,this.options.autoLinkRegex)){const r=Au(n);if(!r)continue;const o=this.buildHref(r);!this.isValidTLD(o)&&!o.startsWith("tel:")||e.push({text:r,href:o,start:n.index,end:n.index+r.length})}return e}isValidUrl(t){var e;return this.options.isValidUrl?this.options.isValidUrl(t,this.options.defaultProtocol):this.isValidTLD(this.buildHref(t))&&!!((e=this._autoLinkRegexNonGlobal)!=null&&e.test(t))}isValidTLD(t){const{autoLinkAllowedTLDs:e}=this.options;if(e.length===0)return!0;const n=VQ(t);if(n==="")return!0;const r=KL(n.split("."));return e.includes(r)}};af([ar({shortcut:U.InsertLink})],_a.prototype,"shortcut",1);af([oe()],_a.prototype,"updateLink",1);af([oe()],_a.prototype,"selectLink",1);af([oe()],_a.prototype,"removeLink",1);_a=af([Le({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:KQ,autoLinkAllowedTLDs:WQ,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:qQ},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:qe.Medium})],_a);function qQ({url:t,defaultProtocol:e}){const n=/^((?:https?|ftp)?:)\/\//.test(t);return!n&&t.includes("@")?`mailto:${t}`:n?t:`${e}//${t}`}var GQ=Object.defineProperty,YQ=Object.getOwnPropertyDescriptor,ON=(t,e,n,r)=>{for(var o=r>1?void 0:r?YQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&GQ(e,n,o),o},Kh=class extends Or{get name(){return"hardBreak"}createTags(){return[Ce.InlineNode]}createNodeSpec(t,e){return{inline:!0,selectable:!1,atom:!0,leafText:()=>`
|
|
212
|
-
`,...e,attrs:t.defaults(),parseDOM:[{tag:"br",getAttrs:t.parse},...e.parseDOM??[]],toDOM:n=>["br",t.dom(n)]}}createKeymap(){const t=O8($u(OP),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":t,"Shift-Enter":t}}insertHardBreak(){return t=>{const{tr:e,dispatch:n}=t;return n==null||n(e.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};ON([oe()],Kh.prototype,"insertHardBreak",1);Kh=ON([Le({defaultPriority:qe.Low})],Kh);const XQ=[new Ea,new Ad,new Id,new Dd({enableResizing:!1}),new _0,new Wh({levels:[1,2,3,4,5,6],defaultLevel:1}),new Md,new Nd,new _a({autoLink:!0}),new Kh];function ZQ(t){const{manager:e,state:n}=hq({extensions:()=>XQ.slice(),content:t,selection:"start"});return{manager:e,state:n}}function JQ({state:t,manager:e,options:n,onChange:r,debug:o}){const i=n&&Object.entries(n).some(([,c])=>c),[s,a]=m.useState(i),l=xn("p-4 border rounded-md outline-none appearance-none border-input bg-background",{"rounded-t-none border-t-0":s});return b.jsx("div",{className:"text-base val-rich-text-editor",children:b.jsx(vq,{manager:e,initialContent:t,classNames:[l],children:b.jsxs(oQ,{initialProps:{mode:"default"},children:[b.jsx(QQ,{hasOptions:i,options:n,debug:o,onShowToolbar:c=>{a(c)}}),b.jsx(g0,{}),r&&b.jsx(mq,{onChange:r})]})})})}const QQ=({options:t,hasOptions:e,onShowToolbar:n,debug:r})=>{var l,c,u,d,f,p;const o=M1(),i=eq(),s=e||i.heading()||i.image()||i.link()||i.bulletList()||i.orderedList()||i.bold()||i.italic()||i.strike();m.useEffect(()=>{n(s)},[s]);const a=m.useRef(null);return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"h-0",ref:a}),b.jsxs("div",{className:xn("sticky top-0 flex flex-col py-2 z-[40] border divide-y rounded-md rounded-b-none border-input bg-background",{hidden:!s}),children:[b.jsxs("div",{className:"flex flex-row items-center justify-start px-4 py-1 gap-x-3",children:[((t==null?void 0:t.headings)||i.heading())&&b.jsxs(hZ,{children:[b.jsx(mZ,{asChild:!0,className:"pr-4",children:b.jsxs("button",{children:[i.heading({level:1})&&b.jsx(Ww,{size:22}),i.heading({level:2})&&b.jsx(Kw,{size:22}),i.heading({level:3})&&b.jsx(qw,{size:22}),i.heading({level:4})&&b.jsx(Gw,{size:22}),i.heading({level:5})&&b.jsx(Yw,{size:22}),i.heading({level:6})&&b.jsx(Xw,{size:22}),!i.heading()&&"Normal"]})}),b.jsxs(mN,{container:a.current,children:[b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("paragraph").focus().run()},children:"Normal"}),((l=t==null?void 0:t.headings)==null?void 0:l.includes("h1"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:1}).focus().run()},children:b.jsx(Ww,{size:16})}),((c=t==null?void 0:t.headings)==null?void 0:c.includes("h2"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:2}).focus().run()},children:b.jsx(Kw,{size:16})}),((u=t==null?void 0:t.headings)==null?void 0:u.includes("h3"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:3}).focus().run()},children:b.jsx(qw,{size:16})}),((d=t==null?void 0:t.headings)==null?void 0:d.includes("h4"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:4}).focus().run()},children:b.jsx(Gw,{size:16})}),((f=t==null?void 0:t.headings)==null?void 0:f.includes("h5"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:5}).focus().run()},children:b.jsx(Yw,{size:16})}),((p=t==null?void 0:t.headings)==null?void 0:p.includes("h5"))&&b.jsx(Ri,{onClick:()=>{o.setBlockNodeType("heading",{level:6}).focus().run()},children:b.jsx(Xw,{size:16})})]})]}),b.jsx(Ya,{icon:b.jsx(Y3,{size:18}),stroke:3,mark:"bold",isOption:t==null?void 0:t.bold,isActive:i.bold(),onToggle:h=>h.toggleBold().focus().run()}),b.jsx(Ya,{icon:b.jsx(g5,{size:18}),stroke:3,mark:"strike",isOption:t==null?void 0:t.lineThrough,isActive:i.strike(),onToggle:h=>h.toggleStrike().focus().run()}),b.jsx(Ya,{icon:b.jsx(n5,{size:18}),stroke:3,mark:"italic",isOption:t==null?void 0:t.italic,isActive:i.italic(),onToggle:h=>h.toggleItalic().focus().run()}),b.jsx(Ya,{icon:b.jsx(i5,{size:18}),stroke:3,mark:"bulletList",isOption:t==null?void 0:t.ul,isActive:i.bulletList(),onToggle:h=>h.toggleBulletList().focus().run()}),b.jsx(Ya,{icon:b.jsx(o5,{size:18}),stroke:3,mark:"list",isOption:t==null?void 0:t.ol,isActive:i.orderedList(),onToggle:h=>h.toggleOrderedList().focus().run()}),b.jsx(Ya,{icon:b.jsx(r5,{size:18}),stroke:3,mark:"link",isOption:t==null?void 0:t.ol,isActive:i.link(),onToggle:h=>h.selectMark("link").updateLink({href:""}).focus().run()}),((t==null?void 0:t.img)||i.image())&&b.jsxs("label",{className:"cursor-pointer",htmlFor:"val-toolbar-image-select",children:[b.jsx("input",{hidden:!0,id:"val-toolbar-image-select",accept:"image/*",type:"file",onChange:h=>{_T(h).then(g=>{o.insertImage({src:g.src,width:g.width,height:g.height,fileName:CT(g.src,g.filename??null,{width:g.width,height:g.height,sha256:g.sha256,mimeType:g.mimeType})??void 0}).focus().run()})}}),b.jsx(t5,{size:18,className:`${i.image()&&"stroke-[3px]"}`})]}),r&&b.jsx("button",{onMouseDown:h=>h.preventDefault(),onClick:()=>o.insertHardBreak().run(),children:"Br"})]}),b.jsx(eee,{})]})]})};function eee(){const t=M1(),[e,n]=m.useState(),r=tq().link();return m.useEffect(()=>{const i=typeof r=="object"&&"href"in r&&typeof r.href=="string"?r.href:void 0;n(i)},[r==null?void 0:r.href]),r!==void 0?b.jsxs("div",{className:"flex items-center justify-start px-4 pt-1 gap-x-2",children:[b.jsx("input",{className:"bg-transparent text-accent",onChange:i=>{n(i.target.value)},defaultValue:e,placeholder:"https://"}),b.jsx("button",{className:"p-2",title:"Update",disabled:e===void 0,onClick:()=>{e!==void 0&&t.selectMark("link").updateLink({href:e}).focus().run()},children:b.jsx(Ix,{size:14})}),b.jsx("button",{className:"p-2",title:"Remove",onClick:()=>{t.removeLink().focus().run()},children:b.jsx(y5,{size:13})})]}):null}function Ya({stroke:t,mark:e,isOption:n,isActive:r,onToggle:o,icon:i}){const s=M1();return!n&&!r?null:b.jsx("button",{className:xn({"text-accent":r,"stroke-[2px]":r&&t===2,"stroke-[3px]":r&&t===3}),onClick:a=>{a.preventDefault(),o(n?s:s.selectMark(e))},children:i})}function TN(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const tee=m.forwardRef((t,e)=>m.createElement(we.span,A({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),nee=[" ","Enter","ArrowUp","ArrowDown"],ree=[" ","Enter"],Jm="Select",[Qm,X1,oee]=Um(Jm),[bc,_oe]=Er(Jm,[oee,xc]),Z1=xc(),[iee,Ia]=bc(Jm),[see,aee]=bc(Jm),lee=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p}=t,h=Z1(e),[g,x]=m.useState(null),[v,y]=m.useState(null),[w,k]=m.useState(!1),E=Gd(c),[O=!1,S]=Co({prop:r,defaultProp:o,onChange:i}),[P,M]=Co({prop:s,defaultProp:a,onChange:l}),$=m.useRef(null),V=g?!!g.closest("form"):!0,[j,le]=m.useState(new Set),K=Array.from(j).map(H=>H.props.value).join(";");return m.createElement(j1,h,m.createElement(iee,{required:p,scope:e,trigger:g,onTriggerChange:x,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:vr(),value:P,onValueChange:M,open:O,onOpenChange:S,dir:E,triggerPointerDownPosRef:$,disabled:f},m.createElement(Qm.Provider,{scope:e},m.createElement(see,{scope:t.__scopeSelect,onNativeOptionAdd:m.useCallback(H=>{le(C=>new Set(C).add(H))},[]),onNativeOptionRemove:m.useCallback(H=>{le(C=>{const T=new Set(C);return T.delete(H),T})},[])},n)),V?m.createElement(RN,{key:K,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:H=>M(H.target.value),disabled:f},P===void 0?m.createElement("option",{value:""}):null,Array.from(j)):null))},cee="SelectTrigger",uee=m.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,i=Z1(n),s=Ia(cee,n),a=s.disabled||r,l=$e(e,s.onTriggerChange),c=X1(n),[u,d,f]=$N(h=>{const g=c().filter(y=>!y.disabled),x=g.find(y=>y.value===s.value),v=AN(g,h,x);v!==void 0&&s.onValueChange(v.value)}),p=()=>{a||(s.onOpenChange(!0),f())};return m.createElement(z1,A({asChild:!0},i),m.createElement(we.button,A({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":NN(s.value)?"":void 0},o,{ref:l,onClick:ne(o.onClick,h=>{h.currentTarget.focus()}),onPointerDown:ne(o.onPointerDown,h=>{const g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:ne(o.onKeyDown,h=>{const g=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&d(h.key),!(g&&h.key===" ")&&nee.includes(h.key)&&(p(),h.preventDefault())})})))}),dee="SelectValue",fee=m.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=t,l=Ia(dee,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=$e(e,l.onValueNodeChange);return er(()=>{c(u)},[c,u]),m.createElement(we.span,A({},a,{ref:d,style:{pointerEvents:"none"}}),NN(l.value)?m.createElement(m.Fragment,null,s):i)}),pee=m.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return m.createElement(we.span,A({"aria-hidden":!0},o,{ref:e}),r||"▼")}),hee=t=>m.createElement(qm,A({asChild:!0},t)),oc="SelectContent",mee=m.forwardRef((t,e)=>{const n=Ia(oc,t.__scopeSelect),[r,o]=m.useState();if(er(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Sr.createPortal(m.createElement(PN,{scope:t.__scopeSelect},m.createElement(Qm.Slot,{scope:t.__scopeSelect},m.createElement("div",null,t.children))),i):null}return m.createElement(gee,A({},t,{ref:e}))}),Vo=10,[PN,eg]=bc(oc),gee=m.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:x,...v}=t,y=Ia(oc,n),[w,k]=m.useState(null),[E,O]=m.useState(null),S=$e(e,J=>k(J)),[P,M]=m.useState(null),[$,V]=m.useState(null),j=X1(n),[le,K]=m.useState(!1),H=m.useRef(!1);m.useEffect(()=>{if(w)return Vm(w)},[w]),Wm();const C=m.useCallback(J=>{const[Ge,...Ye]=j().map(Je=>Je.ref.current),[Xe]=Ye.slice(-1),Ze=document.activeElement;for(const Je of J)if(Je===Ze||(Je==null||Je.scrollIntoView({block:"nearest"}),Je===Ge&&E&&(E.scrollTop=0),Je===Xe&&E&&(E.scrollTop=E.scrollHeight),Je==null||Je.focus(),document.activeElement!==Ze))return},[j,E]),T=m.useCallback(()=>C([P,w]),[C,P,w]);m.useEffect(()=>{le&&T()},[le,T]);const{onOpenChange:_,triggerPointerDownPosRef:N}=y;m.useEffect(()=>{if(w){let J={x:0,y:0};const Ge=Xe=>{var Ze,Je,jn,zn;J={x:Math.abs(Math.round(Xe.pageX)-((Ze=(Je=N.current)===null||Je===void 0?void 0:Je.x)!==null&&Ze!==void 0?Ze:0)),y:Math.abs(Math.round(Xe.pageY)-((jn=(zn=N.current)===null||zn===void 0?void 0:zn.y)!==null&&jn!==void 0?jn:0))}},Ye=Xe=>{J.x<=10&&J.y<=10?Xe.preventDefault():w.contains(Xe.target)||_(!1),document.removeEventListener("pointermove",Ge),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",Ge),document.addEventListener("pointerup",Ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ge),document.removeEventListener("pointerup",Ye,{capture:!0})}}},[w,_,N]),m.useEffect(()=>{const J=()=>_(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[_]);const[R,L]=$N(J=>{const Ge=j().filter(Ze=>!Ze.disabled),Ye=Ge.find(Ze=>Ze.ref.current===document.activeElement),Xe=AN(Ge,J,Ye);Xe&&setTimeout(()=>Xe.ref.current.focus())}),q=m.useCallback((J,Ge,Ye)=>{const Xe=!H.current&&!Ye;(y.value!==void 0&&y.value===Ge||Xe)&&(M(J),Xe&&(H.current=!0))},[y.value]),ve=m.useCallback(()=>w==null?void 0:w.focus(),[w]),he=m.useCallback((J,Ge,Ye)=>{const Xe=!H.current&&!Ye;(y.value!==void 0&&y.value===Ge||Xe)&&V(J)},[y.value]),Be=r==="popper"?PE:vee,Oe=Be===PE?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:x}:{};return m.createElement(PN,{scope:n,content:w,viewport:E,onViewportChange:O,itemRefCallback:q,selectedItem:P,onItemLeave:ve,itemTextRefCallback:he,focusSelectedItem:T,selectedItemText:$,position:r,isPositioned:le,searchRef:R},m.createElement(Ym,{as:ri,allowPinchZoom:!0},m.createElement(Km,{asChild:!0,trapped:y.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ne(o,J=>{var Ge;(Ge=y.trigger)===null||Ge===void 0||Ge.focus({preventScroll:!0}),J.preventDefault()})},m.createElement(Hm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>y.onOpenChange(!1)},m.createElement(Be,A({role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:J=>J.preventDefault()},v,Oe,{onPlaced:()=>K(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ne(v.onKeyDown,J=>{const Ge=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!Ge&&J.key.length===1&&L(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Xe=j().filter(Ze=>!Ze.disabled).map(Ze=>Ze.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Xe=Xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Ze=J.target,Je=Xe.indexOf(Ze);Xe=Xe.slice(Je+1)}setTimeout(()=>C(Xe)),J.preventDefault()}})}))))))}),vee=m.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=Ia(oc,n),s=eg(oc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),d=$e(e,S=>u(S)),f=X1(n),p=m.useRef(!1),h=m.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:v,focusSelectedItem:y}=s,w=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&x&&v){const S=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),$=v.getBoundingClientRect();if(i.dir!=="rtl"){const Ze=$.left-P.left,Je=M.left-Ze,jn=S.left-Je,zn=S.width+jn,Mo=Math.max(zn,P.width),ja=window.innerWidth-Vo,kc=Sy(Je,[Vo,ja-Mo]);a.style.minWidth=zn+"px",a.style.left=kc+"px"}else{const Ze=P.right-$.right,Je=window.innerWidth-M.right-Ze,jn=window.innerWidth-S.right-Je,zn=S.width+jn,Mo=Math.max(zn,P.width),ja=window.innerWidth-Vo,kc=Sy(Je,[Vo,ja-Mo]);a.style.minWidth=zn+"px",a.style.right=kc+"px"}const V=f(),j=window.innerHeight-Vo*2,le=g.scrollHeight,K=window.getComputedStyle(c),H=parseInt(K.borderTopWidth,10),C=parseInt(K.paddingTop,10),T=parseInt(K.borderBottomWidth,10),_=parseInt(K.paddingBottom,10),N=H+C+le+_+T,R=Math.min(x.offsetHeight*5,N),L=window.getComputedStyle(g),q=parseInt(L.paddingTop,10),ve=parseInt(L.paddingBottom,10),he=S.top+S.height/2-Vo,Be=j-he,Oe=x.offsetHeight/2,J=x.offsetTop+Oe,Ge=H+C+J,Ye=N-Ge;if(Ge<=he){const Ze=x===V[V.length-1].ref.current;a.style.bottom="0px";const Je=c.clientHeight-g.offsetTop-g.offsetHeight,jn=Math.max(Be,Oe+(Ze?ve:0)+Je+T),zn=Ge+jn;a.style.height=zn+"px"}else{const Ze=x===V[0].ref.current;a.style.top="0px";const jn=Math.max(he,H+g.offsetTop+(Ze?q:0)+Oe)+Ye;a.style.height=jn+"px",g.scrollTop=Ge-he+g.offsetTop}a.style.margin=`${Vo}px 0`,a.style.minHeight=R+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,a,c,g,x,v,i.dir,r]);er(()=>w(),[w]);const[k,E]=m.useState();er(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(S=>{S&&h.current===!0&&(w(),y==null||y(),h.current=!1)},[w,y]);return m.createElement(yee,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k}},m.createElement(we.div,A({},o,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),PE=m.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Vo,...i}=t,s=Z1(n);return m.createElement(F1,A({},s,i,{ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[yee,xee]=bc(oc,{}),ME="SelectViewport",bee=m.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=eg(ME,n),i=xee(ME,n),s=$e(e,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Qm.Slot,{scope:n},m.createElement(we.div,A({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:ne(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const f=Math.abs(a.current-c.scrollTop);if(f>0){const p=window.innerHeight-Vo*2,h=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),x=Math.max(h,g);if(x<p){const v=x+f,y=Math.min(p,v),w=v-y;u.style.height=y+"px",u.style.bottom==="0px"&&(c.scrollTop=w>0?w:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),wee="SelectGroup",[kee,See]=bc(wee),Eee=m.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=vr();return m.createElement(kee,{scope:n,id:o},m.createElement(we.div,A({role:"group","aria-labelledby":o},r,{ref:e})))}),_ee="SelectLabel",Cee=m.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=See(_ee,n);return m.createElement(we.div,A({id:o.id},r,{ref:e}))}),C0="SelectItem",[Oee,MN]=bc(C0),Tee=m.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=t,a=Ia(C0,n),l=eg(C0,n),c=a.value===r,[u,d]=m.useState(i??""),[f,p]=m.useState(!1),h=$e(e,v=>{var y;return(y=l.itemRefCallback)===null||y===void 0?void 0:y.call(l,v,r,o)}),g=vr(),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(Oee,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:m.useCallback(v=>{d(y=>{var w;return y||((w=v==null?void 0:v.textContent)!==null&&w!==void 0?w:"").trim()})},[])},m.createElement(Qm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(we.div,A({role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:h,onFocus:ne(s.onFocus,()=>p(!0)),onBlur:ne(s.onBlur,()=>p(!1)),onPointerUp:ne(s.onPointerUp,x),onPointerMove:ne(s.onPointerMove,v=>{if(o){var y;(y=l.onItemLeave)===null||y===void 0||y.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(s.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var y;(y=l.onItemLeave)===null||y===void 0||y.call(l)}}),onKeyDown:ne(s.onKeyDown,v=>{var y;((y=l.searchRef)===null||y===void 0?void 0:y.current)!==""&&v.key===" "||(ree.includes(v.key)&&x(),v.key===" "&&v.preventDefault())})}))))}),Wf="SelectItemText",Pee=m.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,s=Ia(Wf,n),a=eg(Wf,n),l=MN(Wf,n),c=aee(Wf,n),[u,d]=m.useState(null),f=$e(e,v=>d(v),l.onItemTextChange,v=>{var y;return(y=a.itemTextRefCallback)===null||y===void 0?void 0:y.call(a,v,l.value,l.disabled)}),p=u==null?void 0:u.textContent,h=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=c;return er(()=>(g(h),()=>x(h)),[g,x,h]),m.createElement(m.Fragment,null,m.createElement(we.span,A({id:l.textId},i,{ref:f})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Sr.createPortal(i.children,s.valueNode):null)}),Mee="SelectItemIndicator",Nee=m.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return MN(Mee,n).isSelected?m.createElement(we.span,A({"aria-hidden":!0},r,{ref:e})):null}),Ree=m.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return m.createElement(we.div,A({"aria-hidden":!0},r,{ref:e}))});function NN(t){return t===""||t===void 0}const RN=m.forwardRef((t,e)=>{const{value:n,...r}=t,o=m.useRef(null),i=$e(e,o),s=TN(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),m.createElement(tee,{asChild:!0},m.createElement("select",A({},r,{ref:i,defaultValue:n})))});RN.displayName="BubbleSelect";function $N(t){const e=Bt(t),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function AN(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=$ee(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $ee(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const Aee=lee,IN=uee,Iee=fee,Dee=pee,Lee=hee,DN=mee,jee=bee,zee=Eee,LN=Cee,jN=Tee,Fee=Pee,Bee=Nee,zN=Ree,FN=Aee,Vee=zee,BN=Iee,J1=m.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(IN,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,b.jsx(Dee,{asChild:!0,children:b.jsx(WO,{className:"w-4 h-4 opacity-50"})})]}));J1.displayName=IN.displayName;const Q1=m.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>b.jsx(Lee,{children:b.jsx(DN,{ref:o,className:Pe("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:b.jsx(jee,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));Q1.displayName=DN.displayName;const Uee=m.forwardRef(({className:t,...e},n)=>b.jsx(LN,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));Uee.displayName=LN.displayName;const eb=m.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(jN,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(Bee,{children:b.jsx(Ix,{className:"w-4 h-4"})})}),b.jsx(Fee,{children:e})]}));eb.displayName=jN.displayName;const Hee=m.forwardRef(({className:t,...e},n)=>b.jsx(zN,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));Hee.displayName=zN.displayName;function VN({path:t,disabled:e,source:n,schema:r,onSubmit:o}){if((typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="string")return b.jsx(Qee,{path:t,defaultValue:n,disabled:e,schema:r,onSubmit:o});if((typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number")return b.jsx(RE,{defaultValue:n,disabled:e,onSubmit:o});if((typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf")return b.jsx(NE,{defaultValue:n,disabled:e,onSubmit:o,selector:r.path});if((typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number")return b.jsx(RE,{defaultValue:n,disabled:e,onSubmit:o});if((typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf")return b.jsx(NE,{defaultValue:n,disabled:e,onSubmit:o,selector:r.path});if((typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="richtext")return b.jsx(Jee,{schema:r,onSubmit:o,defaultValue:n});if((typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="image")return b.jsx(Xee,{path:t,onSubmit:o,defaultValue:n});if((typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="file")return b.jsx(Yee,{path:t,onSubmit:o,defaultValue:n});if((typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="union"&&typeof r.key!="string")if(r.key.type!=="literal")console.error("Val: found union with non-literal key type. Check schema corresponding to path:",t);else return b.jsx(Wee,{path:t,options:r.items.flatMap(i=>i.type==="literal"?[i.value]:[]),onSubmit:o,defaultValue:n});return b.jsxs("div",{children:["Unsupported schema: ",r.type," (source type: ",typeof n," source:"," ",JSON.stringify(n),")"]})}function Wee({onSubmit:t,options:e,defaultValue:n}){const[r,o]=m.useState();m.useEffect(()=>{n!=null&&o(n)},[n]);const[i,s]=m.useState(!1);return b.jsxs(Ts,{children:[b.jsxs(FN,{value:r,onValueChange:a=>o(a),children:[b.jsx(J1,{className:"w-[180px]",children:b.jsx(BN,{placeholder:"Select"})}),b.jsx(Q1,{children:b.jsx(Vee,{children:e.map(a=>b.jsx(eb,{value:a,children:a},a))})})]}),t&&b.jsx(Da,{loading:i,enabled:!!r&&e.includes(r),onClick:()=>{r&&(s(!0),t(a=>Promise.resolve(Kee(a,r))).finally(()=>{s(!1)}))}})]})}function Kee(t,e){return[{value:e,op:"replace",path:t}]}function UN(t,e,n,r){const o=CT(e,n,r);return!o||!r?[]:[{value:{[Zt]:`/public/${o}`,[Ut]:"file",metadata:r},op:"replace",path:t},{value:e,op:"file",path:t,filePath:`/public/${o}`}]}function HN(t,e){const n=t.concat("metadata");return[{value:e,op:"replace",path:n}]}const qee=new TextEncoder;function Gee(t){return new Promise((e,n)=>{var i;const r=(i=t.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=Fe.getSHA256Hash(qee.encode(s)),l=vm(s);e({src:s,filename:r==null?void 0:r.name,sha256:a,mimeType:l,fileExt:l&&ym(l)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function Yee({path:t,defaultValue:e,onSubmit:n}){var d,f;const[r,o]=m.useState(null),[i,s]=m.useState(!1),[a,l]=m.useState(),[c,u]=m.useState();return m.useEffect(()=>{const p=e&&Fe.convertFileSource(e).url;u(p)},[e]),b.jsxs(Ts,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||c?b.jsxs("div",{className:"relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]",children:[b.jsx("div",{children:b.jsx(e5,{})}),b.jsx("div",{children:r==null?void 0:r.filename})]}):b.jsx("div",{children:"Select file below"})},t),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",onChange:p=>{Gee(p).then(h=>{o({src:h.src,filename:h.filename}),h.mimeType?l({sha256:h.sha256,mimeType:h.mimeType}):l(void 0)}).catch(h=>{console.error(h.message),o(null),l(void 0)})}})]})]}),n&&b.jsx(Da,{loading:i,enabled:!!r||((d=e==null?void 0:e.metadata)==null?void 0:d.mimeType)!==(a==null?void 0:a.mimeType)||((f=e==null?void 0:e.metadata)==null?void 0:f.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{r?(s(!0),n(p=>Promise.resolve(UN(p,r.src,r.filename??null,a))).finally(()=>{s(!1),o(null),l(void 0)})):a&&(s(!0),n(p=>Promise.resolve(HN(p,a))).finally(()=>{s(!1),o(null),l(void 0)}))}})]})}function Xee({path:t,defaultValue:e,onSubmit:n}){var p,h,g,x,v,y,w,k,E,O,S,P;const[r,o]=m.useState(null),[i,s]=m.useState(!1),[a,l]=m.useState(),[c,u]=m.useState(),[d,f]=m.useState();return m.useEffect(()=>{f(e&&"/api/val/files/public"+Fe.convertFileSource(e).url)},[e]),m.useEffect(()=>{var M;if(c)if(a){const $={...a,hotspot:c};l($)}else e!=null&&e.metadata?l({...e.metadata,hotspot:c}):console.error("Neither image metadata nor value is set");else(M=e==null?void 0:e.metadata)!=null&&M.hotspot&&u(e.metadata.hotspot)},[c,e]),b.jsxs(Ts,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||d?b.jsxs("div",{className:"relative",children:[c&&b.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${c.y*100}%`,left:`${c.x*100}%`}}),b.jsx("img",{src:(r==null?void 0:r.src)||d,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:M=>{const{width:$,height:V,left:j,top:le}=M.currentTarget.getBoundingClientRect(),K=(M.clientX-6-j)/$,H=(M.clientY-6-le)/V;u({x:K,y:H,width:1,height:1})}})]}):b.jsx("div",{children:"Select image below"})},t),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",accept:"image/*",onChange:M=>{_T(M).then($=>{o({src:$.src,filename:$.filename}),$.width&&$.height&&$.mimeType?l({sha256:$.sha256,width:$.width,height:$.height,mimeType:$.mimeType,hotspot:c}):(l(void 0),u(void 0))}).catch($=>{console.error($.message),o(null),u(void 0),l(void 0)})}})]})]}),n&&b.jsx(Da,{loading:i,enabled:!!r||((h=(p=e==null?void 0:e.metadata)==null?void 0:p.hotspot)==null?void 0:h.height)!==(c==null?void 0:c.height)||((x=(g=e==null?void 0:e.metadata)==null?void 0:g.hotspot)==null?void 0:x.width)!==(c==null?void 0:c.width)||((y=(v=e==null?void 0:e.metadata)==null?void 0:v.hotspot)==null?void 0:y.x)!==(c==null?void 0:c.x)||((k=(w=e==null?void 0:e.metadata)==null?void 0:w.hotspot)==null?void 0:k.y)!==(c==null?void 0:c.y)||((E=e==null?void 0:e.metadata)==null?void 0:E.width)!==(a==null?void 0:a.width)||((O=e==null?void 0:e.metadata)==null?void 0:O.height)!==(a==null?void 0:a.height)||((S=e==null?void 0:e.metadata)==null?void 0:S.mimeType)!==(a==null?void 0:a.mimeType)||((P=e==null?void 0:e.metadata)==null?void 0:P.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{r?(s(!0),n(M=>Promise.resolve(UN(M,r.src,r.filename??null,a))).finally(()=>{s(!1)})):a&&(s(!0),n(M=>Promise.resolve(HN(M,a))).finally(()=>{s(!1)}))}})]})}function Zee(t,e){const{templateStrings:n,exprs:r,files:o}=e?F4(e):{[Ut]:"richtext",templateStrings:[""],exprs:[],files:{}};return[{op:"replace",path:t,value:{templateStrings:n,exprs:r,[Ut]:"richtext"}},...Object.entries(o).map(([i,s])=>({op:"file",path:t,filePath:i,value:s}))]}function Jee({defaultValue:t,schema:e,onSubmit:n}){const[r,o]=m.useState(!1),[i,s]=m.useState(!1),[a,l]=m.useState();m.useEffect(()=>{o(!0),l(void 0)},[t]);const{state:c,manager:u}=ZQ(t&&X4(fT(t)));return b.jsxs(Ts,{children:[b.jsx(JQ,{options:e.options,onChange:d=>{o(!0),l(d)},state:c,manager:u}),n&&b.jsx(Da,{loading:i,enabled:r,onClick:()=>{if(a){s(!0);const d=Y4.safeParse(a);d.success?n(async f=>Zee(f,d.data)).finally(()=>{s(!1),o(!1)}):(s(!1),alert(`Could not parse Rich Text
|
|
213
|
-
`+JSON.stringify(d.error,null,2)))}}})]})}function NE({disabled:t,defaultValue:e,onSubmit:n,selector:r}){return b.jsx("div",{children:"TODO"})}function RE({disabled:t,defaultValue:e,onSubmit:n}){const[r,o]=m.useState(e||0),[i,s]=m.useState(!1);m.useEffect(()=>{s(t)},[t]);const a=m.useRef(null);return b.jsxs(Ts,{children:[b.jsx(Wx,{ref:a,disabled:i,defaultValue:r??0,onChange:l=>o(Number(l.target.value)),type:"number"}),n&&b.jsx(Da,{loading:i,enabled:e!==r,onClick:()=>{s(!0),n(async l=>{var c;return[{op:"replace",path:l,value:Number((c=a.current)==null?void 0:c.value)||0}]}).finally(()=>{s(!1)})}})]})}function Qee({disabled:t,defaultValue:e,path:n,schema:r,onSubmit:o}){const[i,s]=m.useState(e||""),[a,l]=m.useState(!1);m.useEffect(()=>{l(t)},[t]);const c=m.useRef(null),d=new kO(r.options?{...r.options,regexp:r.options.regexp?new RegExp(r.options.regexp.source,r.options.regexp.flags):void 0}:void 0).validate(n,i);return b.jsxs(Ts,{children:[b.jsx(Wx,{ref:c,disabled:a,defaultValue:i??"",onChange:f=>s(f.target.value)}),o&&b.jsx(Da,{validationErrors:d&&d[n],loading:a,enabled:!0,onClick:()=>{l(!0),o(async f=>{var p;return[{op:"replace",path:f,value:((p=c.current)==null?void 0:p.value)||""}]}).finally(()=>{l(!1)})}})]})}function ete({errors:t}){return b.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:t.map((e,n)=>b.jsx("div",{children:e.message},n))})}function Ts({children:t,className:e}){return b.jsx("div",{className:xn("relative max-w-lg px-4 pt-4",e),children:t})}function Da({loading:t,enabled:e,validationErrors:n,onClick:r}){const{session:o}=mm(),i=o.status==="success"&&o.data.mode==="proxy";return b.jsx("div",{className:"sticky bottom-0 m-4 mt-2 ml-0",children:b.jsxs("div",{className:"grid justify-start gap-2 text",children:[n?b.jsx(ete,{errors:n||[]}):b.jsx("span",{}),b.jsx(dd,{disabled:t||!e,onClick:r,children:t?i?"Staging...":"Saving...":i?"Stage":"Save"})," "]})})}const tb=m.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));tb.displayName="Card";const tte=m.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",t),...e}));tte.displayName="CardHeader";const nte=m.forwardRef(({className:t,...e},n)=>b.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",t),...e}));nte.displayName="CardTitle";const rte=m.forwardRef(({className:t,...e},n)=>b.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));rte.displayName="CardDescription";const ote=m.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:Pe("p-6 pt-0",t),...e}));ote.displayName="CardContent";const ite=m.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",t),...e}));ite.displayName="CardFooter";const WN="Switch",[ste,Coe]=Er(WN),[ate,lte]=ste(WN),cte=m.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=t,[d,f]=m.useState(null),p=$e(e,y=>f(y)),h=m.useRef(!1),g=d?!!d.closest("form"):!0,[x=!1,v]=Co({prop:o,defaultProp:i,onChange:c});return m.createElement(ate,{scope:n,checked:x,disabled:a},m.createElement(we.button,A({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":qN(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:ne(t.onClick,y=>{v(w=>!w),g&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})),g&&m.createElement(dte,{control:d,bubbles:!h.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ute="SwitchThumb",KN=m.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=lte(ute,n);return m.createElement(we.span,A({"data-state":qN(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),dte=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=m.useRef(null),s=TN(n),a=MM(e);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),m.createElement("input",A({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function qN(t){return t?"checked":"unchecked"}const nb=cte,fte=KN,GN=m.forwardRef(({className:t,...e},n)=>b.jsx(nb,{className:Pe("peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-primary",t),...e,ref:n,children:b.jsx(fte,{className:Pe("pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));GN.displayName=nb.displayName;const YN="Dialog",[XN,Ooe]=Er(YN),[pte,oo]=XN(YN),hte=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=t,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=Co({prop:r,defaultProp:o,onChange:i});return m.createElement(pte,{scope:e,triggerRef:a,contentRef:l,contentId:vr(),titleId:vr(),descriptionId:vr(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),modal:s},n)},mte="DialogTrigger",gte=m.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=oo(mte,n),i=$e(e,o.triggerRef);return m.createElement(we.button,A({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rb(o.open)},r,{ref:i,onClick:ne(t.onClick,o.onOpenToggle)}))}),ZN="DialogPortal",[vte,JN]=XN(ZN,{forceMount:void 0}),yte=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=oo(ZN,e);return m.createElement(vte,{scope:e,forceMount:n},m.Children.map(r,s=>m.createElement(Cn,{present:n||i.open},m.createElement(qm,{asChild:!0,container:o},s))))},O0="DialogOverlay",xte=m.forwardRef((t,e)=>{const n=JN(O0,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=oo(O0,t.__scopeDialog);return i.modal?m.createElement(Cn,{present:r||i.open},m.createElement(bte,A({},o,{ref:e}))):null}),bte=m.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=oo(O0,n);return m.createElement(Ym,{as:ri,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(we.div,A({"data-state":rb(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),Ld="DialogContent",wte=m.forwardRef((t,e)=>{const n=JN(Ld,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=oo(Ld,t.__scopeDialog);return m.createElement(Cn,{present:r||i.open},i.modal?m.createElement(kte,A({},o,{ref:e})):m.createElement(Ste,A({},o,{ref:e})))}),kte=m.forwardRef((t,e)=>{const n=oo(Ld,t.__scopeDialog),r=m.useRef(null),o=$e(e,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Vm(i)},[]),m.createElement(QN,A({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(t.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:ne(t.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ne(t.onFocusOutside,i=>i.preventDefault())}))}),Ste=m.forwardRef((t,e)=>{const n=oo(Ld,t.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(QN,A({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),QN=m.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=t,a=oo(Ld,n),l=m.useRef(null),c=$e(e,l);return Wm(),m.createElement(m.Fragment,null,m.createElement(Km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Hm,A({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":rb(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Ete="DialogTitle",_te=m.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=oo(Ete,n);return m.createElement(we.h2,A({id:o.titleId},r,{ref:e}))}),Cte="DialogDescription",Ote=m.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=oo(Cte,n);return m.createElement(we.p,A({id:o.descriptionId},r,{ref:e}))}),Tte="DialogClose",Pte=m.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=oo(Tte,n);return m.createElement(we.button,A({type:"button"},r,{ref:e,onClick:ne(t.onClick,()=>o.onOpenChange(!1))}))});function rb(t){return t?"open":"closed"}const Mte=hte,Nte=gte,Rte=yte,eR=xte,tR=wte,nR=_te,rR=Ote,oR=Pte,$te=Mte,Ate=Nte,Ite=Rte,$E=oR,iR=m.forwardRef(({className:t,...e},n)=>b.jsx(eR,{ref:n,className:Pe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));iR.displayName=eR.displayName;const sR=m.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(Ite,{children:[b.jsx(iR,{}),b.jsxs(tR,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[e,b.jsxs(oR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(Dx,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sR.displayName=tR.displayName;const aR=({className:t,...e})=>b.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});aR.displayName="DialogHeader";const lR=({className:t,...e})=>b.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});lR.displayName="DialogFooter";const cR=m.forwardRef(({className:t,...e},n)=>b.jsx(nR,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",t),...e}));cR.displayName=nR.displayName;const Dte=m.forwardRef(({className:t,...e},n)=>b.jsx(rR,{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));Dte.displayName=rR.displayName;const ob=X.createContext({hardLink:!1,useNavigate:tg,basePath:"",sourcePath:"",moduleFilePath:"",modulePath:""});function mv(t){return t?`/${decodeURIComponent(t)}`:""}function ib({children:t,overlay:e}){const[n,r]=X.useState(""),[o,i]=X.useState(mv(n));m.useEffect(()=>{if(!e){const l=zte();l&&i(mv(l)),window.onpopstate=()=>{const c=window.location.pathname.split("/"),u=sb(c),d=(u===-1?c:c.slice(u+1)).join("/");i(mv(d)),r(d)}}},[]);const[s,a]=Fe.splitModuleFilePathAndModulePath(o);return b.jsx(ob.Provider,{value:{hardLink:!!e,useNavigate:()=>l=>{e?window.location.href=`/val${l}`:(i(l),Lte(l),r(l))},basePath:n,moduleFilePath:s,modulePath:a,sourcePath:o},children:t})}function Lte(t){const e=window.location.pathname.split("/"),n=sb(e),r=`${e.slice(0,n+1).concat(...t.split("/").slice(1)).join("/")}`;window.history.pushState(null,"",r)}function tg(){return m.useContext(ob).useNavigate()}function jte(){const t=m.useContext(ob);return{basePath:t.basePath,sourcePath:t.sourcePath,moduleFilePath:t.moduleFilePath,modulePath:t.modulePath}}function zte(){const t=window.location.pathname.split("/"),e=sb(t);return(e===-1?t:t.slice(e+1)).join("/")}function sb(t){const e=t.indexOf("static"),n=e===-1?t.indexOf("val"):e;return n===-1&&console.error("Router error",t,n),n}function ng({path:t,source:e,schema:n,field:r,initOnSubmit:o,top:i}){if(n.opt)return b.jsx(Hte,{path:t,source:e,schema:n,field:r,initOnSubmit:o});if(e===null)return b.jsx(fR,{source:e,schema:n,path:t,initOnSubmit:o});if(n.type==="object")return typeof e!="object"||bl(e)?b.jsxs("div",{children:["ERROR: expected object, but found ",typeof e]}):b.jsxs("div",{children:[r&&b.jsx("div",{className:"text-left",children:r}),b.jsx(uR,{source:e,path:t,schema:n,initOnSubmit:o,top:i})]});if(n.type==="array")return typeof e!="object"||!bl(e)?b.jsxs("div",{children:["ERROR: expected array, but found ",typeof e]}):b.jsxs("div",{children:[r&&b.jsx("div",{className:"text-left",children:r}),b.jsx(dR,{source:e,path:t,schema:n,initOnSubmit:o})]});if(n.type==="record")return typeof e!="object"?b.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof e]}):bl(e)?b.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):b.jsxs("div",{children:[r&&b.jsx("div",{className:"text-left",children:r}),b.jsx(Bte,{source:e,path:t,schema:n})]});if((n==null?void 0:n.type)==="union"){if(typeof n.key=="string"&&typeof e=="object"&&!bl(e))return b.jsx(Fte,{field:r,tag:n.key,source:e,path:t,schema:n,initOnSubmit:o,top:i})}else if((n==null?void 0:n.type)==="literal")return b.jsx(b.Fragment,{});return b.jsxs("div",{className:"py-2 gap-y-4",children:[r&&b.jsx("div",{className:"text-left",children:r}),b.jsx(VN,{path:t,disabled:!1,source:e,schema:n,onSubmit:o(t)})]})}function Fte({tag:t,field:e,path:n,source:r,schema:o,initOnSubmit:i,top:s}){const[a,l]=m.useState(null),[c,u]=m.useState(null),d=o.items.flatMap(h=>{if(h.type==="object"&&h.items[t]){const g=h.items[t];if(g.type==="literal")return[g.value]}return[]});m.useEffect(()=>{if(a){const h=r[t],g=o.items.find(x=>{if(x.type==="object"&&x.items[t]){const v=x.items[t];return v.type==="literal"?v.value===a:!1}});h&&typeof h=="string"&&g?u({source:r,schema:g}):g?u({schema:g}):(console.error("Could not find source or schema of key",a,r,o),u(null))}else{const h=r==null?void 0:r[t];h&&typeof h=="string"&&l(h)}},[a,r,t,o,d]),d.length!==o.items.length&&console.warn("Not all items have tag:",t);const f=!1,p=i(n);return b.jsxs(Ts,{className:xn("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!s}),children:[(e||o.key)&&b.jsx("div",{className:"text-left",children:e||o.key}),b.jsxs(FN,{value:a??void 0,disabled:f,onValueChange:h=>{l(h)},children:[b.jsx(J1,{children:b.jsx(BN,{placeholder:"Select type"})}),b.jsx(Q1,{children:d.map(h=>b.jsx(eb,{value:h.toString(),children:h.toString()},h))})]}),b.jsx(Da,{loading:f,enabled:!1,onClick:()=>p(async()=>[])}),c&&b.jsx(ng,{path:n,source:c.source??null,schema:c.schema,initOnSubmit:i,top:s})]},n)}function uR({path:t,source:e,schema:n,initOnSubmit:r,top:o}){return b.jsx("div",{className:xn("flex flex-col gap-y-1",{"border-l-2 border-border pl-6":!o}),children:Object.entries(n.items).map(([i,s])=>{const a=ic(t,i);return b.jsx(ng,{path:a,source:(e==null?void 0:e[i])??null,schema:s,field:i,initOnSubmit:r},a)})},t)}function Bte({path:t,source:e,schema:n}){const r=tg();return b.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(e).map(([o,i])=>{const s=ic(t,o);return b.jsx("button",{onClick:()=>{r(s)},children:b.jsx(Vte,{recordKey:o,path:s,source:i,schema:n.item})},s)})},t)}const T0=170;function Vte({recordKey:t,path:e,source:n,schema:r}){const o=X.useRef(null),[i,s]=m.useState(!1);return m.useEffect(()=>{o.current&&o.current.getBoundingClientRect().height>=T0&&s(!0)},[]),b.jsxs(tb,{ref:o,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:T0},children:[b.jsx("div",{className:"pb-4 font-serif text-left text-accent",children:t}),b.jsx("div",{className:"text-xs",children:b.jsx(ab,{path:e,source:n,schema:r})}),i&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]},e)}function dR({path:t,source:e,schema:n,initOnSubmit:r}){const o=r(t),[,i]=Fe.splitModuleFilePathAndModulePath(t);return b.jsxs(Ts,{className:"flex flex-col gap-4 p-2 pb-8",children:[b.jsx("button",{onClick:()=>{o(async()=>{const s=[];return e===null&&s.push({op:"replace",path:Fe.createPatchPath(i),value:[]}),s.push({op:"add",path:Fe.createPatchPath(ic(i,e.length)),value:jd(n.item)}),s})},children:b.jsx(p5,{})}),e.map((s,a)=>{const l=ic(t,a),c=r(l);return b.jsx(Ute,{index:a,path:l,source:s,loading:!1,schema:n.item,onDelete:()=>{c(async u=>u.length>0?[{op:"remove",path:u}]:(console.error("Cannot delete a root element"),[]))}},l)})]},t)}const AE=T0;function Ute({index:t,path:e,source:n,schema:r,loading:o,onDelete:i}){const s=tg(),a=X.useRef(null),[l,c]=m.useState(!1);return m.useEffect(()=>{a.current&&a.current.getBoundingClientRect().height>=AE&&c(!0)},[]),b.jsxs(tb,{ref:a,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:AE},children:[b.jsx("button",{className:"block",disabled:o,onClick:i,children:o?b.jsx(h5,{className:"animate-spin"}):b.jsx(KO,{})}),b.jsxs("button",{className:"block",disabled:o,onClick:()=>{s(e)},children:[b.jsx("div",{className:"pb-4 font-serif text-left uppercase text-accent",children:t+1<10?`0${t+1}`:t+1}),b.jsx("div",{className:"text-xs",children:b.jsx(ab,{path:e,source:n,schema:r})}),l&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})]})}function ic(t,e){const n=Fe.createValPathOfItem(t,e);if(!n)throw Error(`Could not create val path: ${t} of ${e==null?void 0:e.toString()}`);return n}function ab({path:t,source:e,schema:n}){var s;const[r,o]=m.useState(null),i=(s=Gte())==null?void 0:s.hoverElem;if(n.type==="object")return b.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([a])=>b.jsxs(m.Fragment,{children:[b.jsxs("span",{className:"text-muted",children:[a,":"]}),b.jsx("span",{children:b.jsx(ab,{source:(e==null?void 0:e[a])??null,schema:n.items[a],path:ic(t,a)})})]},ic(t,a)))},t);if(n.type==="array")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):Array.isArray(e)?b.jsxs("span",{children:[b.jsx("span",{className:"text-accent",children:e.length}),b.jsx("span",{children:e.length===1?" item":" items"})]},t):b.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},t);if(n.type==="richtext")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):typeof e!="object"?b.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof e," not an object"]},t):!(Ut in e)||e[Ut]!=="richtext"?b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},t):b.jsx(qte,{children:fT(e)},t);if(n.type==="string")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{children:e});if(n.type==="image"){if(e===null)return b.jsx("span",{className:"text-accent",children:"Empty"},t);if(typeof e!="object")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},t);if(!(Zt in e)||typeof e[Zt]!="string")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},t);const a=Fe.convertFileSource(e).url;return b.jsxs("span",{onMouseOver:l=>{o({x:l.clientX,y:l.clientY})},onMouseLeave:()=>{o(null)},className:"relative flex items-center justify-start gap-1",children:[b.jsx("a",{href:a,className:"overflow-hidden underline truncate ",children:e[Zt]}),r&&i&&Sr.createPortal(b.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:r.x+10,top:r.y+10},src:a}),i)]},t)}else{if(n.type==="boolean")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e?"true":"false"},t);if(n.type==="number")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e.toString()});if(n.type==="keyOf")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e.toString()},t)}return b.jsxs("div",{children:["TODO: ",n.type]},t)}function Hte({path:t,source:e,schema:n,initOnSubmit:r,field:o}){const[i,s]=m.useState(e!==null),{editMode:a}=mm(),l=r(t),[c,u]=m.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-y-2",children:[b.jsxs("div",{className:"relative flex items-center justify-start gap-x-4",children:[a==="full"&&!i&&b.jsx(GN,{disabled:c,checked:i,onClick:()=>{s(d=>!d)}}),a==="full"&&i&&b.jsxs($te,{children:[b.jsx(Ate,{children:b.jsx(KO,{})}),b.jsx(sR,{children:b.jsxs(aR,{children:[b.jsx(cR,{children:"About to delete. Are you sure?"}),b.jsxs(lR,{className:"sm:justify-start",children:[b.jsx($E,{asChild:!0,children:b.jsx(dd,{type:"button",variant:"secondary",onClick:async()=>{u(!0),s(!1);const[,d]=Fe.splitModuleFilePathAndModulePath(t);l(async()=>[{op:"replace",path:Fe.createPatchPath(d),value:null}]).catch(f=>{console.error(f),s(!0)}).finally(()=>{u(!1)})},children:"Yes"})}),b.jsx($E,{asChild:!0,children:b.jsx(dd,{type:"button",children:"Cancel"})})]})]})})]}),b.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:o||b.jsx(jx,{children:t})})]}),i&&b.jsx(fR,{source:e===null?jd(n):e,schema:n,path:t,initOnSubmit:d=>async f=>{const[,p]=Fe.splitModuleFilePathAndModulePath(t),[,h]=Fe.splitModuleFilePathAndModulePath(d),g=await f(Fe.createPatchPath(h));l(async()=>e===null?[{op:"replace",path:Fe.createPatchPath(p),value:jd(n)}].concat(g):g)}})]},t)}function jd(t){if(t.type==="object")return Object.fromEntries(Object.keys(t.items).map(n=>[n,jd(t.items[n])]));if(t.type==="array")return[];if(t.type==="record")return{};if(t.opt)return null;if(t.type==="richtext")return{[Ut]:"richtext",templateStrings:[""],exprs:[]};if(t.type==="string")return"";if(t.type==="boolean")return!1;if(t.type==="number")return 0;if(t.type==="keyOf")return t.values==="number"?0:t.values==="string"?"":t.values[0];if(t.type==="file")return{_ref:"/public/",_type:"file",metadata:{sha256:""}};if(t.type==="image")return{_ref:"/public/",_type:"file",metadata:{height:0,width:0,mimeType:"application/octet-stream",sha256:""}};if(t.type==="literal")return t.value;if(t.type==="union")return jd(t.items[0]);throw Error("Unexpected schema type: "+JSON.stringify(t))}function fR({source:t,path:e,schema:n,initOnSubmit:r}){if(n.type==="array"){if(typeof t=="object"&&(t===null||bl(t)))return b.jsx(dR,{initOnSubmit:r,source:t===null?[]:t,path:e,schema:n})}else if(n.type==="object"){if(typeof t=="object"&&(t===null||!bl(t)))return b.jsx(uR,{source:t,path:e,schema:n,initOnSubmit:r})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf"||n.type==="boolean"||n.type==="literal"||n.type==="union")return b.jsx(VN,{path:e,disabled:!1,source:t,schema:n,onSubmit:r(e)},e);return b.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof t," for schema type"," ",n.type]})}function bl(t){return Array.isArray(t)}function Wte(t){const e={};return t.forEach(n=>{const r=n.split("/").filter(o=>o!=="");if(r.length===1)e[""]||(e[""]=[]),e[""].push(r[0]);else if(r.length>1){const o=r.slice(0,r.length-1).join("/"),i=r.slice(-1)[0];e[o]||(e[o]=[]),e[o].push(i)}}),e}function Kte({selectedPath:t,paths:e}){const n=Wte(e),r=t&&Fe.splitModuleFilePathAndModulePath(t)[0],o=tg();return b.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(n).map(([i,s])=>b.jsxs("div",{className:"px-4 py-2",children:[i&&b.jsx("div",{className:"font-bold truncate max-w-[300px] text-left",title:i,children:b.jsx(jx,{children:i})}),b.jsx("div",{className:xn({"flex flex-col py-2 justify-start items-start":!!i}),children:s.map(a=>{const l=`/${i}/${a}`;return b.jsx("button",{className:xn("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":r===l}),onClick:()=>{o(l)},children:a},l)})})]},`/${i}`))})}const IE={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function qte({children:t}){const e=t;function n(i,s){const a=IE.tags[i];return a&&s?[s,a].join(" "):a||s}function r(i,s){const a=IE.classes[i];return a&&s?[s,a].join(" "):a||s}function o(i,s){var c,u;if(typeof i=="string")return i;if(i.tag==="p")return b.jsx("p",{className:n("p"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="img")return b.jsx("img",{className:n("img"),src:i.src},s);if(i.tag==="ul")return b.jsx("ul",{className:n("ul"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="ol")return b.jsx("ol",{className:n("ol"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="li")return b.jsx("li",{className:n("li"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="span")return b.jsx("span",{className:i.classes.map(d=>{switch(d){case"bold":return r("bold");case"line-through":return r("lineThrough");case"italic":return r("italic")}}).join(" "),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h1")return b.jsx("h1",{className:n("h1"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h2")return b.jsx("h2",{className:n("h2"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h3")return b.jsx("h3",{className:n("h3"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h4")return b.jsx("h4",{className:n("h4"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h5")return b.jsx("h5",{className:n("h5"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h6")return b.jsx("h6",{className:n("h6"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="br")return b.jsx("br",{},s);if(i.tag==="a")return b.jsx("a",{href:i.href,children:i.children.map((d,f)=>o(d,f))},s);console.error("Unknown tag",i.tag);const l=i.tag;return l!=null&&l.tag?X.createElement(l.tag,{key:s,className:(c=l.class)==null?void 0:c.join(" "),children:(u=l.children)==null?void 0:u.map(o)}):null}return b.jsx("span",{"data-val-path":e.valPath,children:e.children.map((i,s)=>o(i,s))})}const pR=X.createContext({hoverElem:null}),Gte=()=>X.useContext(pR),hR=({api:t,store:e})=>{const[n,r]=m.useState(null),i=jte().sourcePath||"",[s,a]=m.useState(),[l,c]=m.useState("not-asked");m.useEffect(()=>{l==="not-asked"&&(c("running"),e.initialize().then(v=>{Ve.isOk(v)?(a(v.value),c("complete")):(r(v.error.message),c("failed"))}))},[l]);const u=rT(t),[d,f]=GO(),p=X.useRef(null),[h,g]=m.useState([]),x=m.useCallback(v=>async y=>{const[w,k]=Fe.splitModuleFilePathAndModulePath(v),E=await y(Fe.createPatchPath(k)),O=await e.applyPatch(w,h,E);if(Ve.isOk(O)){const S=[];for(const P of Object.values(O.value))S.push(...P.patchIds);g(S)}},[h]);return m.useEffect(()=>{t.getPatches().then(v=>{if(Ve.isOk(v)){const y=[];for(const w of Object.values(v.value).flat())w.applied_at_base_sha||y.push(w.patch_id);g(y)}else console.error("Could not get patches",v.error)})},[]),b.jsx(Lx.Provider,{value:{theme:d,setTheme:f,editMode:"full",session:u,setEditMode:()=>{},setWindowSize:()=>{}},children:b.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":d,children:[b.jsx("div",{id:"val-fullscreen-hover",ref:p}),b.jsx(pR.Provider,{value:{hoverElem:p==null?void 0:p.current},children:b.jsx("div",{className:"text-primary",children:b.jsxs(Ou,{children:[b.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:b.jsx(qO,{})}),b.jsx(Tl,{className:"px-4",children:s?b.jsx(Kte,{selectedPath:i,paths:s}):!n&&b.jsx("div",{className:"py-4",children:"Loading..."})}),b.jsxs("div",{className:"flex items-center justify-between h-[50px] w-full px-4",children:[b.jsxs("div",{className:"flex items-center justify-start gap-2 font-serif text-xs",children:[b.jsx("button",{onClick:()=>{history.back()},children:b.jsx(X3,{})}),b.jsx("div",{className:"truncate max-w-[300px] text-left",dir:"rtl",title:i,children:b.jsx(jx,{children:i||"/"})})]}),b.jsxs(dd,{disabled:!(u.status==="success"&&u.data.enabled)||h.length===0,onClick:()=>{t.postSave({patchIds:h}).then(async v=>{if(Ve.isOk(v)){const y=await t.deletePatches(h);Ve.isOk(y)?(g([]),alert("Success")):r("Could not clean up")}else r("Could not publish")})},children:["Publish ",h.length>0&&`(${h.length})`]})]}),b.jsx(Yte,{path:i,error:n,initOnSubmit:x,session:u,api:t,store:e})]})})})]})})};function Yte({path:t,api:e,store:n,error:r,session:o,initOnSubmit:i}){var p;const[s,a]=m.useState(!1),[l,c]=m.useState(),[u,d]=m.useState(null),[f]=t?Fe.splitModuleFilePathAndModulePath(t):[void 0,void 0];return m.useEffect(()=>{let h=!1;return f?(d(null),a(!0),c(void 0),n.getModule(f).then(g=>{h||o.status==="success"&&o.data.enabled&&(Ve.isOk(g)?d(g.value):c(g.error.message))}).finally(()=>{h||a(!1)})):d(null),()=>{h=!0}},[f,t,o]),b.jsxs("div",{className:"p-4",children:[(r||l)&&b.jsxs("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",r||l]}),o.status==="success"&&o.data.mode==="unauthorized"&&b.jsx("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:"Not authorized"}),o.status==="success"&&!o.data.enabled&&b.jsxs("div",{className:"max-w-xl p-4 text-lg",children:[b.jsx("div",{children:"Val is currently not enabled"}),b.jsx("a",{href:e.getEnableUrl(((p=window==null?void 0:window.location)==null?void 0:p.href)||"/val"),children:"Enable Val"})]}),s&&b.jsx("div",{className:"flex place-content-center",children:"Loading..."}),u&&t&&b.jsx(Xte,{path:t,source:u.source,schema:u.schema,initOnSubmit:i})]})}function Xte({path:t,source:e,schema:n,initOnSubmit:r}){const[,o]=Fe.splitModuleFilePathAndModulePath(t),i=Fe.resolvePath(o,e,n);if(!i)throw console.error("Could not resolve module: "+t,{modulePath:o,moduleSource:e,moduleSchema:n}),Error("Could not resolve module: "+t);return b.jsx(ng,{path:t,source:i.source,schema:i.schema,initOnSubmit:r,top:!0})}const Zte=m.createContext(null),gv={didCatch:!1,error:null};class lb extends m.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gv}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(gv)}}componentDidCatch(e,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Jte(e.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(gv)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=e;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=m.createElement(r,l);else if(o===null||m.isValidElement(o))a=o;else throw s}return m.createElement(Zte.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Jte(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const mR="Collapsible",[Qte,gR]=Er(mR),[ene,cb]=Qte(mR),tne=m.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=t,[l=!1,c]=Co({prop:r,defaultProp:o,onChange:s});return m.createElement(ene,{scope:n,disabled:i,contentId:vr(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(we.div,A({"data-state":ub(l),"data-disabled":i?"":void 0},a,{ref:e})))}),nne="CollapsibleTrigger",rne=m.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=cb(nne,n);return m.createElement(we.button,A({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ub(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:e,onClick:ne(t.onClick,o.onOpenToggle)}))}),vR="CollapsibleContent",one=m.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cb(vR,t.__scopeCollapsible);return m.createElement(Cn,{present:n||o.open},({present:i})=>m.createElement(ine,A({},r,{ref:e,present:i})))}),ine=m.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=t,s=cb(vR,n),[a,l]=m.useState(r),c=m.useRef(null),u=$e(e,c),d=m.useRef(0),f=d.current,p=m.useRef(0),h=p.current,g=s.open||a,x=m.useRef(g),v=m.useRef();return m.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),er(()=>{const y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();d.current=w.height,p.current=w.width,x.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),m.createElement(we.div,A({"data-state":ub(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},i,{ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style}}),g&&o)});function ub(t){return t?"open":"closed"}const sne=tne,ane=rne,lne=one,Ps="Accordion",cne=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[db,une,dne]=Um(Ps),[rg,Toe]=Er(Ps,[dne,gR]),fb=gR(),yR=X.forwardRef((t,e)=>{const{type:n,...r}=t,o=r,i=r;return X.createElement(db.Provider,{scope:t.__scopeAccordion},n==="multiple"?X.createElement(mne,A({},i,{ref:e})):X.createElement(hne,A({},o,{ref:e})))});yR.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[xR,fne]=rg(Ps),[bR,pne]=rg(Ps,{collapsible:!1}),hne=X.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=t,[a,l]=Co({prop:n,defaultProp:r,onChange:o});return X.createElement(xR,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:X.useCallback(()=>i&&l(""),[i,l])},X.createElement(bR,{scope:t.__scopeAccordion,collapsible:i},X.createElement(wR,A({},s,{ref:e}))))}),mne=X.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=t,[s=[],a]=Co({prop:n,defaultProp:r,onChange:o}),l=X.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=X.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return X.createElement(xR,{scope:t.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},X.createElement(bR,{scope:t.__scopeAccordion,collapsible:!0},X.createElement(wR,A({},i,{ref:e}))))}),[gne,og]=rg(Ps),wR=X.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=t,a=X.useRef(null),l=$e(a,e),c=une(n),d=Gd(o)==="ltr",f=ne(t.onKeyDown,p=>{var h;if(!cne.includes(p.key))return;const g=p.target,x=c().filter(M=>{var $;return!(($=M.ref.current)!==null&&$!==void 0&&$.disabled)}),v=x.findIndex(M=>M.ref.current===g),y=x.length;if(v===-1)return;p.preventDefault();let w=v;const k=0,E=y-1,O=()=>{w=v+1,w>E&&(w=k)},S=()=>{w=v-1,w<k&&(w=E)};switch(p.key){case"Home":w=k;break;case"End":w=E;break;case"ArrowRight":i==="horizontal"&&(d?O():S());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(d?S():O());break;case"ArrowUp":i==="vertical"&&S();break}const P=w%y;(h=x[P].ref.current)===null||h===void 0||h.focus()});return X.createElement(gne,{scope:n,disabled:r,direction:o,orientation:i},X.createElement(db.Slot,{scope:n},X.createElement(we.div,A({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),P0="AccordionItem",[vne,pb]=rg(P0),yne=X.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...o}=t,i=og(P0,n),s=fne(P0,n),a=fb(n),l=vr(),c=r&&s.value.includes(r)||!1,u=i.disabled||t.disabled;return X.createElement(vne,{scope:n,open:c,disabled:u,triggerId:l},X.createElement(sne,A({"data-orientation":i.orientation,"data-state":kR(c)},a,o,{ref:e,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})))}),xne="AccordionHeader",bne=X.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=og(Ps,n),i=pb(xne,n);return X.createElement(we.h3,A({"data-orientation":o.orientation,"data-state":kR(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),DE="AccordionTrigger",wne=X.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=og(Ps,n),i=pb(DE,n),s=pne(DE,n),a=fb(n);return X.createElement(db.ItemSlot,{scope:n},X.createElement(ane,A({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:e})))}),kne="AccordionContent",Sne=X.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=og(Ps,n),i=pb(kne,n),s=fb(n);return X.createElement(lne,A({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function kR(t){return t?"open":"closed"}const Ene=yR,_ne=yne,Cne=bne,SR=wne,ER=Sne,One=Ene,_R=m.forwardRef(({className:t,...e},n)=>b.jsx(_ne,{ref:n,className:Pe("border-b",t),...e}));_R.displayName="AccordionItem";const CR=m.forwardRef(({className:t,children:e,...n},r)=>b.jsx(Cne,{className:"flex",children:b.jsxs(SR,{ref:r,className:Pe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,b.jsx(WO,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));CR.displayName=SR.displayName;const OR=m.forwardRef(({className:t,children:e,...n},r)=>b.jsx(ER,{ref:r,className:Pe("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...n,children:b.jsx("div",{className:"pt-0 pb-4",children:e})}));OR.displayName=ER.displayName;function hb({error:t,resetErrorBoundary:e}){return console.error(t),b.jsx("div",{className:"absolute top-0 left-0 flex items-center justify-center w-screen h-screen bg-card-foreground",children:b.jsx("div",{className:"w-full h-full p-10",children:b.jsxs("div",{className:"w-full h-full p-10 bg-card text-primary",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[0.5em] text-lg font-bold text-center py-2",children:[b.jsx(qO,{})," encountered an error"]}),b.jsx("button",{onClick:e,children:b.jsx(Dx,{})})]}),b.jsx("div",{className:"text-4xl font-normal ",children:"Message:"}),b.jsx("pre",{children:t.message}),t.stack&&b.jsx(One,{type:"single",className:"font-serif",collapsible:!0,defaultValue:"error",children:b.jsxs(_R,{value:"error",children:[b.jsx(CR,{children:"Stack trace:"}),b.jsx(OR,{className:"p-4 bg-popover text-popover-foreground",children:t.stack&&b.jsx("pre",{children:t.stack})})]})})]})})})}function Tne(){const{api:t,store:e}=m.useMemo(()=>{const n=new Rx("/api/val"),r=new Hx(n);return{api:n,store:r}},[]);return b.jsx(lb,{fallbackRender:hb,children:b.jsx(ib,{children:b.jsx(hR,{api:t,store:e})})})}function Pne(){const t=new Rx("/api/val"),e=new Hx(t);return b.jsx(lb,{fallbackRender:hb,children:b.jsx(ib,{children:b.jsx(hR,{api:t,store:e})})})}function Mne({root:t,children:e}){return Sr.createPortal(e,t)}const Nne=({children:t,style:e})=>{const n=m.useRef(null),[r,o]=m.useState(null);return m.useLayoutEffect(()=>{if(n.current)if(n.current.shadowRoot)o(n.current.shadowRoot);else{const i=n.current.attachShadow({mode:"open"});o(i)}},[]),b.jsx("div",{ref:n,style:e,id:"val-shadow-root",children:r&&b.jsx(Mne,{root:r,children:t})})},Rne="/spa/index.css",$ne="val-app",Ane="val-overlay",TR="Popover",[PR,Poe]=Er(TR,[xc]),mb=xc(),[Ine,wc]=PR(TR),Dne=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=t,a=mb(e),l=m.useRef(null),[c,u]=m.useState(!1),[d=!1,f]=Co({prop:r,defaultProp:o,onChange:i});return m.createElement(j1,a,m.createElement(Ine,{scope:e,contentId:vr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},Lne="PopoverTrigger",jne=m.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=wc(Lne,n),i=mb(n),s=$e(e,o.triggerRef),a=m.createElement(we.button,A({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":RR(o.open)},r,{ref:s,onClick:ne(t.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(z1,A({asChild:!0},i),a)}),MR="PopoverPortal",[zne,Fne]=PR(MR,{forceMount:void 0}),Bne=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=wc(MR,e);return m.createElement(zne,{scope:e,forceMount:n},m.createElement(Cn,{present:n||i.open},m.createElement(qm,{asChild:!0,container:o},r)))},zd="PopoverContent",Vne=m.forwardRef((t,e)=>{const n=Fne(zd,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=wc(zd,t.__scopePopover);return m.createElement(Cn,{present:r||i.open},i.modal?m.createElement(Une,A({},o,{ref:e})):m.createElement(Hne,A({},o,{ref:e})))}),Une=m.forwardRef((t,e)=>{const n=wc(zd,t.__scopePopover),r=m.useRef(null),o=$e(e,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Vm(s)},[]),m.createElement(Ym,{as:ri,allowPinchZoom:!0},m.createElement(NR,A({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:ne(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ne(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Hne=m.forwardRef((t,e)=>{const n=wc(zd,t.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(NR,A({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),NR=m.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=wc(zd,n),p=mb(n);return Wm(),m.createElement(Km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Hm,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},m.createElement(F1,A({"data-state":RR(f.open),role:"dialog",id:f.contentId},p,d,{ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function RR(t){return t?"open":"closed"}const Wne=Dne,Kne=jne,$R=Bne,gb=Vne,qne=Wne,Gne=Kne,Yne=m.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},o)=>b.jsx($R,{children:b.jsx(gb,{ref:o,align:e,sideOffset:n,className:Pe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Yne.displayName=gb.displayName;const vb="p-1 border rounded-full shadow border-accent",LE="valbuild:urlBeforeNavigation";function Xne({api:t,patches:e,direction:n,onClickPatches:r}){const{theme:o,setTheme:i,editMode:s,setEditMode:a,session:l}=mm();if(l.status==="success"&&l.data.mode==="unauthorized")return b.jsxs(jE,{direction:n,href:t.getLoginUrl(window.location.href),children:[b.jsx("span",{children:"Login"}),b.jsx(Zw,{size:18})]});if(l.status==="success"&&!l.data.enabled)return b.jsxs(jE,{direction:n,href:t.getEnableUrl(window.location.href),children:[b.jsx("span",{children:"Enable"}),b.jsx(Zw,{size:18})]});const[c,u]=m.useState();return m.useEffect(()=>{u(e.length)},[e]),b.jsxs(AR,{direction:n,children:[b.jsx(vv,{active:s==="hover"||s==="window",onClick:()=>{a(d=>d==="hover"||s==="window"?"off":"hover")},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="hover"||s==="window"?b.jsx(d5,{size:18}):b.jsx(f5,{size:18})})}),b.jsx(vv,{active:s==="full",onClick:()=>{if(s!=="full")localStorage.setItem(LE,window.location.href),window.location.href=t.getEditUrl();else if(s==="full"){const d=localStorage.getItem(LE);window.location.href=d||"/"}},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="full"?b.jsx(l5,{size:15}):b.jsx(s5,{size:15})})}),c!==void 0&&b.jsx(vv,{onClick:()=>{c>0&&r()},children:b.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[b.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:c}),b.jsx(m5,{size:18})]})}),b.jsx(Gne,{className:vb,children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:b.jsx(u5,{size:18})})}),b.jsx(gb,{align:"start",sideOffset:12,side:"right",className:"z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",children:b.jsxs("div",{className:"flex flex-col items-start justify-center p-4 gap-x-4",children:[b.jsx("div",{className:"flex items-end justify-end w-full",children:b.jsx("div",{className:"h-[34px] w-[34px] flex justify-center items-center",children:b.jsxs(nb,{className:"relative peer inline-flex h-[24px] w-[34px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-800 data-[state=unchecked]:bg-slate-800",defaultChecked:o==="light",onClick:()=>{i(o==="dark"?"light":"dark")},children:[o==="dark"&&b.jsx(c5,{size:13,className:"absolute top-[4px] left-[17px] text-white"}),b.jsx(KN,{className:"pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[15px] data-[state=unchecked]:translate-x-0"}),o==="light"&&b.jsx(v5,{size:13,className:"absolute top-[4px] left-[1px] text-white"})]})})}),b.jsx("div",{children:b.jsxs("a",{className:"flex items-center justify-center font-bold h-[34px] gap-x-1",href:t.getDisableUrl(window.location.href),children:[b.jsx("span",{children:"Disable"}),b.jsx(Q3,{size:18})]})})]})})]})}function jE({href:t,direction:e,children:n}){return b.jsx(AR,{direction:e,border:!1,children:b.jsx("a",{className:vb,href:t,children:b.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function AR({children:t,direction:e,border:n=!0}){return b.jsx("div",{className:xn("flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"},{border:n}),children:t})}function vv({active:t,onClick:e,children:n}){return b.jsx("button",{className:xn(vb,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":t}),onClick:e,children:n})}var yb={exports:{}},lf={},ig={exports:{}},IR={};function DR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=DR(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function zE(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=DR(t))&&(r&&(r+=" "),r+=e);return r}const Zne=Object.freeze(Object.defineProperty({__proto__:null,clsx:zE,default:zE},Symbol.toStringTag,{value:"Module"})),Jne=r$(Zne);var wt={},To={};Object.defineProperty(To,"__esModule",{value:!0});To.dontSetMe=rre;To.findInArray=Qne;To.int=nre;To.isFunction=ere;To.isNum=tre;function Qne(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function ere(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function tre(t){return typeof t=="number"&&!isNaN(t)}function nre(t){return parseInt(t,10)}function rre(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var La={};Object.defineProperty(La,"__esModule",{value:!0});La.browserPrefixToKey=jR;La.browserPrefixToStyle=ore;La.default=void 0;La.getPrefix=LR;const yv=["Moz","Webkit","O","ms"];function LR(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;r<yv.length;r++)if(jR(e,yv[r])in n)return yv[r];return""}function jR(t,e){return e?"".concat(e).concat(ire(t)):t}function ore(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t}function ire(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}La.default=LR();Object.defineProperty(wt,"__esModule",{value:!0});wt.addClassName=BR;wt.addEvent=lre;wt.addUserSelectStyles=xre;wt.createCSSTransform=mre;wt.createSVGTransform=gre;wt.getTouch=vre;wt.getTouchIdentifier=yre;wt.getTranslation=xb;wt.innerHeight=fre;wt.innerWidth=pre;wt.matchesSelector=FR;wt.matchesSelectorAndParentsTo=are;wt.offsetXYFromParent=hre;wt.outerHeight=ure;wt.outerWidth=dre;wt.removeClassName=VR;wt.removeEvent=cre;wt.removeUserSelectStyles=bre;var Jn=To,FE=sre(La);function zR(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(zR=function(r){return r?n:e})(t)}function sre(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=zR(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}let Kf="";function FR(t,e){return Kf||(Kf=(0,Jn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Jn.isFunction)(t[n])})),(0,Jn.isFunction)(t[Kf])?t[Kf](e):!1}function are(t,e,n){let r=t;do{if(FR(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function lre(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,o):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function cre(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function ure(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Jn.int)(n.borderTopWidth),e+=(0,Jn.int)(n.borderBottomWidth),e}function dre(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Jn.int)(n.borderLeftWidth),e+=(0,Jn.int)(n.borderRightWidth),e}function fre(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Jn.int)(n.paddingTop),e-=(0,Jn.int)(n.paddingBottom),e}function pre(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Jn.int)(n.paddingLeft),e-=(0,Jn.int)(n.paddingRight),e}function hre(t,e,n){const o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),i=(t.clientX+e.scrollLeft-o.left)/n,s=(t.clientY+e.scrollTop-o.top)/n;return{x:i,y:s}}function mre(t,e){const n=xb(t,e,"px");return{[(0,FE.browserPrefixToKey)("transform",FE.default)]:n}}function gre(t,e){return xb(t,e,"")}function xb(t,e,n){let{x:r,y:o}=t,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(e){const s="".concat(typeof e.x=="string"?e.x:e.x+n),a="".concat(typeof e.y=="string"?e.y:e.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function vre(t,e){return t.targetTouches&&(0,Jn.findInArray)(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&(0,Jn.findInArray)(t.changedTouches,n=>e===n.identifier)}function yre(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function xre(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
214
|
-
`,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
215
|
-
`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&BR(t.body,"react-draggable-transparent-selection")}function bre(t){if(t)try{if(t.body&&VR(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function BR(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function VR(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.canDragX=Sre;Po.canDragY=Ere;Po.createCoreData=Cre;Po.createDraggableData=Ore;Po.getBoundPosition=wre;Po.getControlPosition=_re;Po.snapToGrid=kre;var Un=To,wl=wt;function wre(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:Tre(r);const o=bb(t);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Un.int)(u.paddingLeft)+(0,Un.int)(c.marginLeft),top:-o.offsetTop+(0,Un.int)(u.paddingTop)+(0,Un.int)(c.marginTop),right:(0,wl.innerWidth)(l)-(0,wl.outerWidth)(o)-o.offsetLeft+(0,Un.int)(u.paddingRight)-(0,Un.int)(c.marginRight),bottom:(0,wl.innerHeight)(l)-(0,wl.outerHeight)(o)-o.offsetTop+(0,Un.int)(u.paddingBottom)-(0,Un.int)(c.marginBottom)}}return(0,Un.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Un.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Un.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Un.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function kre(t,e,n){const r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function Sre(t){return t.props.axis==="both"||t.props.axis==="x"}function Ere(t){return t.props.axis==="both"||t.props.axis==="y"}function _re(t,e,n){const r=typeof e=="number"?(0,wl.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const o=bb(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,wl.offsetXYFromParent)(r||t,i,n.props.scale)}function Cre(t,e,n){const r=!(0,Un.isNum)(t.lastX),o=bb(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function Ore(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function Tre(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function bb(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var sg={},ag={};Object.defineProperty(ag,"__esModule",{value:!0});ag.default=Pre;function Pre(){}Object.defineProperty(sg,"__esModule",{value:!0});sg.default=void 0;var xv=Nre(m),On=wb(zm),Mre=wb(Sr),rn=wt,Ei=Po,bv=To,zc=wb(ag);function wb(t){return t&&t.__esModule?t:{default:t}}function UR(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(UR=function(r){return r?n:e})(t)}function Nre(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=UR(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function pn(t,e,n){return e=Rre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rre(t){var e=$re(t,"string");return typeof e=="symbol"?e:String(e)}function $re(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ir={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let _i=Ir.mouse,lg=class extends xv.Component{constructor(){super(...arguments),pn(this,"dragging",!1),pn(this,"lastX",NaN),pn(this,"lastY",NaN),pn(this,"touchIdentifier",null),pn(this,"mounted",!1),pn(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,rn.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,rn.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const o=(0,rn.getTouchIdentifier)(e);this.touchIdentifier=o;const i=(0,Ei.getControlPosition)(e,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ei.createCoreData)(this,s,a);(0,zc.default)("DraggableCore: handleDragStart: %j",l),(0,zc.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,rn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,rn.addEvent)(r,_i.move,this.handleDrag),(0,rn.addEvent)(r,_i.stop,this.handleDragStop))}),pn(this,"handleDrag",e=>{const n=(0,Ei.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Ei.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ei.createCoreData)(this,r,o);if((0,zc.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),pn(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Ei.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Ei.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Ei.createCoreData)(this,r,o);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,rn.removeUserSelectStyles)(a.ownerDocument),(0,zc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,zc.default)("DraggableCore: Removing handlers"),(0,rn.removeEvent)(a.ownerDocument,_i.move,this.handleDrag),(0,rn.removeEvent)(a.ownerDocument,_i.stop,this.handleDragStop))}),pn(this,"onMouseDown",e=>(_i=Ir.mouse,this.handleDragStart(e))),pn(this,"onMouseUp",e=>(_i=Ir.mouse,this.handleDragStop(e))),pn(this,"onTouchStart",e=>(_i=Ir.touch,this.handleDragStart(e))),pn(this,"onTouchEnd",e=>(_i=Ir.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,rn.addEvent)(e,Ir.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,rn.removeEvent)(n,Ir.mouse.move,this.handleDrag),(0,rn.removeEvent)(n,Ir.touch.move,this.handleDrag),(0,rn.removeEvent)(n,Ir.mouse.stop,this.handleDragStop),(0,rn.removeEvent)(n,Ir.touch.stop,this.handleDragStop),(0,rn.removeEvent)(e,Ir.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,rn.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Mre.default.findDOMNode(this)}render(){return xv.cloneElement(xv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};sg.default=lg;pn(lg,"displayName","DraggableCore");pn(lg,"propTypes",{allowAnyClick:On.default.bool,children:On.default.node.isRequired,disabled:On.default.bool,enableUserSelectHack:On.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:On.default.arrayOf(On.default.number),handle:On.default.string,cancel:On.default.string,nodeRef:On.default.object,onStart:On.default.func,onDrag:On.default.func,onStop:On.default.func,onMouseDown:On.default.func,scale:On.default.number,className:bv.dontSetMe,style:bv.dontSetMe,transform:bv.dontSetMe});pn(lg,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=f(m),n=u(zm),r=u(Sr),o=u(Jne),i=wt,s=Po,a=To,l=u(sg),c=u(ag);function u(y){return y&&y.__esModule?y:{default:y}}function d(y){if(typeof WeakMap!="function")return null;var w=new WeakMap,k=new WeakMap;return(d=function(E){return E?k:w})(y)}function f(y,w){if(!w&&y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var k=d(w);if(k&&k.has(y))return k.get(y);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in y)if(S!=="default"&&Object.prototype.hasOwnProperty.call(y,S)){var P=O?Object.getOwnPropertyDescriptor(y,S):null;P&&(P.get||P.set)?Object.defineProperty(E,S,P):E[S]=y[S]}return E.default=y,k&&k.set(y,E),E}function p(){return p=Object.assign?Object.assign.bind():function(y){for(var w=1;w<arguments.length;w++){var k=arguments[w];for(var E in k)Object.prototype.hasOwnProperty.call(k,E)&&(y[E]=k[E])}return y},p.apply(this,arguments)}function h(y,w,k){return w=g(w),w in y?Object.defineProperty(y,w,{value:k,enumerable:!0,configurable:!0,writable:!0}):y[w]=k,y}function g(y){var w=x(y,"string");return typeof w=="symbol"?w:String(w)}function x(y,w){if(typeof y!="object"||y===null)return y;var k=y[Symbol.toPrimitive];if(k!==void 0){var E=k.call(y,w||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(y)}class v extends e.Component{static getDerivedStateFromProps(w,k){let{position:E}=w,{prevPropsPosition:O}=k;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(w){super(w),h(this,"onDragStart",(k,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(k,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(k,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const O=(0,s.createDraggableData)(this,E),S={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:$}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[V,j]=(0,s.getBoundPosition)(this,S.x,S.y);S.x=V,S.y=j,S.slackX=this.state.slackX+(M-S.x),S.slackY=this.state.slackY+($-S.y),O.x=S.x,O.y=S.y,O.deltaX=S.x-this.state.x,O.deltaY=S.y-this.state.y}if(this.props.onDrag(k,O)===!1)return!1;this.setState(S)}),h(this,"onDragStop",(k,E)=>{if(!this.state.dragging||this.props.onStop(k,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:$}=this.props.position;S.x=M,S.y=$}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,k;return(w=(k=this.props)===null||k===void 0||(k=k.nodeRef)===null||k===void 0?void 0:k.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:k,children:E,defaultPosition:O,defaultClassName:S,defaultClassNameDragging:P,defaultClassNameDragged:M,position:$,positionOffset:V,scale:j,...le}=this.props;let K={},H=null;const T=!!!$||this.state.dragging,_=$||O,N={x:(0,s.canDragX)(this)&&T?this.state.x:_.x,y:(0,s.canDragY)(this)&&T?this.state.y:_.y};this.state.isElementSVG?H=(0,i.createSVGTransform)(N,V):K=(0,i.createCSSTransform)(N,V);const R=(0,o.default)(E.props.className||"",S,{[P]:this.state.dragging,[M]:this.state.dragged});return e.createElement(l.default,p({},le,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(E),{className:R,style:{...E.props.style,...K},transform:H}))}}t.default=v,h(v,"displayName","Draggable"),h(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),h(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(IR);const{default:HR,DraggableCore:Are}=IR;ig.exports=HR;ig.exports.default=HR;ig.exports.DraggableCore=Are;var Ire=ig.exports,kb={};kb.__esModule=!0;kb.cloneElement=Bre;var Dre=Lre(m);function Lre(t){return t&&t.__esModule?t:{default:t}}function BE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function VE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?BE(Object(n),!0).forEach(function(r){jre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):BE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jre(t,e,n){return e=zre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zre(t){var e=Fre(t,"string");return typeof e=="symbol"?e:String(e)}function Fre(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bre(t,e){return e.style&&t.props.style&&(e.style=VE(VE({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),Dre.default.cloneElement(t,e)}var cf={};cf.__esModule=!0;cf.resizableProps=void 0;var Se=Vre(zm);function Vre(t){return t&&t.__esModule?t:{default:t}}var Ure={axis:Se.default.oneOf(["both","x","y","none"]),className:Se.default.string,children:Se.default.element.isRequired,draggableOpts:Se.default.shape({allowAnyClick:Se.default.bool,cancel:Se.default.string,children:Se.default.node,disabled:Se.default.bool,enableUserSelectHack:Se.default.bool,offsetParent:Se.default.node,grid:Se.default.arrayOf(Se.default.number),handle:Se.default.string,nodeRef:Se.default.object,onStart:Se.default.func,onDrag:Se.default.func,onStop:Se.default.func,onMouseDown:Se.default.func,scale:Se.default.number}),height:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Se.default.number).isRequired.apply(i,n)}return Se.default.number.apply(Se.default,n)},handle:Se.default.oneOfType([Se.default.node,Se.default.func]),handleSize:Se.default.arrayOf(Se.default.number),lockAspectRatio:Se.default.bool,maxConstraints:Se.default.arrayOf(Se.default.number),minConstraints:Se.default.arrayOf(Se.default.number),onResizeStop:Se.default.func,onResizeStart:Se.default.func,onResize:Se.default.func,resizeHandles:Se.default.arrayOf(Se.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Se.default.number,width:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Se.default.number).isRequired.apply(i,n)}return Se.default.number.apply(Se.default,n)}};cf.resizableProps=Ure;lf.__esModule=!0;lf.default=void 0;var Fc=Gre(m),Hre=Ire,Wre=kb,Kre=cf,qre=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function WR(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(WR=function(o){return o?n:e})(t)}function Gre(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=WR(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function M0(){return M0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},M0.apply(this,arguments)}function Yre(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function UE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function wv(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UE(Object(n),!0).forEach(function(r){Xre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xre(t,e,n){return e=Zre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zre(t){var e=Jre(t,"string");return typeof e=="symbol"?e:String(e)}function Jre(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qre(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,N0(t,e)}function N0(t,e){return N0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},N0(t,e)}var Sb=function(t){Qre(e,t);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=e.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var p=o,h=i,g=this.slack||[0,0],x=g[0],v=g[1];return o+=x,i+=v,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(p-o),v+(h-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!p)){var h=i[0],g=i[i.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=x.left-s.lastHandleRect.left;u+=v}if(h==="n"){var y=x.top-s.lastHandleRect.top;d+=y}}s.lastHandleRect=x,g==="w"&&(u=-u),h==="n"&&(d=-d);var w=s.props.width+(f?u/s.props.transformScale:0),k=s.props.height+(p?d/s.props.transformScale:0),E=s.runConstraints(w,k);w=E[0],k=E[1];var O=w!==s.props.width||k!==s.props.height,S=typeof s.props[o]=="function"?s.props[o]:null,P=o==="onResize"&&!O;S&&!P&&(a.persist==null||a.persist(),S(a,{node:c,size:{width:w,height:k},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Fc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=wv({ref:i},a?{}:{handleAxis:o});return Fc.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=Yre(i,qre);return(0,Wre.cloneElement)(s,wv(wv({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var f,p=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=Fc.createRef();return Fc.createElement(Hre.DraggableCore,M0({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},e}(Fc.Component);lf.default=Sb;Sb.propTypes=Kre.resizableProps;Sb.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var cg={};cg.__esModule=!0;cg.default=void 0;var kv=ooe(m),eoe=KR(zm),toe=KR(lf),noe=cf,roe=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function KR(t){return t&&t.__esModule?t:{default:t}}function qR(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(qR=function(o){return o?n:e})(t)}function ooe(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=qR(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function R0(){return R0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},R0.apply(this,arguments)}function HE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function qh(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?HE(Object(n),!0).forEach(function(r){ioe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ioe(t,e,n){return e=soe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function soe(t){var e=aoe(t,"string");return typeof e=="symbol"?e:String(e)}function aoe(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function loe(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function coe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,$0(t,e)}function $0(t,e){return $0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},$0(t,e)}var GR=function(t){coe(e,t);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}e.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=e.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,p=o.axis;o.width,o.height;var h=o.resizeHandles,g=o.style,x=o.transformScale,v=loe(o,roe);return kv.createElement(toe.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:h,transformScale:x,width:this.state.width},kv.createElement("div",R0({},v,{style:qh(qh({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},e}(kv.Component);cg.default=GR;GR.propTypes=qh(qh({},noe.resizableProps),{},{children:eoe.default.element});yb.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var uoe=yb.exports.Resizable=lf.default;yb.exports.ResizableBox=cg.default;const sl=400,Sv=250;function doe({position:t,onClose:e,children:n}){const[r,o]=m.useState({height:window.innerHeight,width:window.innerWidth});m.useEffect(()=>{const g=()=>{window.visualViewport?o({height:window.visualViewport.height,width:window.visualViewport.width}):o({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),()=>{window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g)}},[]);const[i,s,a,l,c]=foe({position:t,globalSize:r});m.useEffect(()=>{c({left:r.width-sl-74,top:16})},[r]),m.useEffect(()=>{const g=x=>{x.key==="Escape"&&e()};return document.addEventListener("keyup",g),()=>{document.removeEventListener("keyup",g)}},[]);const{windowSize:u,setWindowSize:d}=mm(),f=r.width<=600||r.height<=600;m.useEffect(()=>{var g,x;d({height:window.innerHeight-30,width:sl,innerHeight:window.innerHeight-30-(64+(((x=(g=p.current)==null?void 0:g.getBoundingClientRect())==null?void 0:x.height)||0))})},[]);const p=m.useRef(null);m.useEffect(()=>{if(f){c({top:0,left:0}),d({height:window.innerHeight,width:window.innerWidth,innerHeight:window.innerHeight-64});const g=document.ownerDocument||document,x=g.body.style.overflow;return g.body.style.overflow="hidden",()=>{g.body.style.overflow=x}}},[f,r]);const h=m.useRef();return b.jsx(uoe,{minConstraints:f?void 0:[sl,Sv],width:(u==null?void 0:u.width)||sl,height:(u==null?void 0:u.height)||Sv,onResize:(g,{size:x})=>{var v,y;return!f&&d({...x,innerHeight:x.height-(64+(((y=(v=p.current)==null?void 0:v.getBoundingClientRect())==null?void 0:y.height)||0))})},handle:f?null:b.jsx("div",{className:"fixed bottom-0 right-0 cursor-se-resize",children:b.jsx("svg",{height:"18",viewBox:"0 0 18 18",width:"18",xmlns:"http://www.w3.org/2000/svg",children:b.jsx("path",{d:"m14.228 16.227a1 1 0 0 1 -.707-1.707l1-1a1 1 0 0 1 1.416 1.414l-1 1a1 1 0 0 1 -.707.293zm-5.638 0a1 1 0 0 1 -.707-1.707l6.638-6.638a1 1 0 0 1 1.416 1.414l-6.638 6.638a1 1 0 0 1 -.707.293zm-5.84 0a1 1 0 0 1 -.707-1.707l12.477-12.477a1 1 0 1 1 1.415 1.414l-12.478 12.477a1 1 0 0 1 -.707.293z",fill:"currentColor"})})}),className:xn("absolute inset-0 tablet:w-auto tablet:h-auto tablet:min-h-fit max-h-svh bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl min-w-[320px]",{"opacity-0":!s,"opacity-100":s,"rounded-lg":!f}),children:b.jsxs("div",{style:{width:(u==null?void 0:u.width)||sl,height:(u==null?void 0:u.height)||Sv,left:i.left,top:i.top,right:i.right,bottom:i.bottom},children:[b.jsxs("div",{ref:a,className:"relative flex items-center justify-center px-2 py-2 text-primary",onTouchStart:g=>{var v;const x=(v=g.changedTouches)==null?void 0:v[0];x&&(h.current={time:Date.now(),y:x.clientY})},onTouchEnd:g=>{var v;const x=(v=g.changedTouches)==null?void 0:v[0];x&&h.current&&x.clientY-h.current.y>20&&x.clientY-h.current.y<100&&Date.now()-h.current.time<150&&(g.preventDefault(),e())},children:[f?b.jsx("div",{className:"py-6",children:b.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 h-[8px] w-[80px] top-4 bg-primary rounded-lg"})}):b.jsx(G3,{size:16,className:"block w-full cursor-grab",onMouseDown:g=>{f||(g.preventDefault(),g.stopPropagation(),l())}}),b.jsx("button",{className:"absolute top-0 right-0 px-4 py-2 focus:outline-none focus-visible:outline-accent",onClick:e,children:b.jsx(Dx,{size:f?32:16})})]}),b.jsxs("div",{children:[Array.isArray(n)&&n.slice(0,1),b.jsx(Tl,{className:"relative",style:{height:u==null?void 0:u.innerHeight},children:Array.isArray(n)?n.slice(1,-1):n}),b.jsx("div",{ref:p,className:"w-full px-4 pb-0",children:Array.isArray(n)&&n.slice(-1)})]})]})})}function foe({position:t,globalSize:e}){var c,u;const[n,r]=m.useState({left:e.width-sl-74,top:16});m.useEffect(()=>{t&&r(t)},[t]);const[o,i]=m.useState(!1),s=m.useRef(null);m.useEffect(()=>{const d=()=>{i(!1)},f=p=>{var h,g,x,v;if(o){p.preventDefault(),p.stopPropagation();const y=-((((g=(h=s==null?void 0:s.current)==null?void 0:h.getBoundingClientRect())==null?void 0:g.width)||0)/2)+p.clientX,w=-((((v=(x=s==null?void 0:s.current)==null?void 0:x.getBoundingClientRect())==null?void 0:v.height)||0)/2)+ +p.clientY;r({left:y<0?0:y,top:w<0?0:w})}};return document.addEventListener("mouseup",d),document.addEventListener("mousemove",f),()=>{document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",f)}},[o]);const a=()=>i(!0),l=!!((u=(c=s==null?void 0:s.current)==null?void 0:c.getBoundingClientRect())!=null&&u.width);return[n,l,s,a,r]}function poe({defaultTheme:t,api:e,store:n,onSubmit:r}){const[o,i]=GO(t),s=rT(e),[a,l]=goe(),[c,u]=moe(a),[d,f]=m.useState(null),p=d!=null&&d.path?d.path.split(","):[];m.useEffect(()=>{n.reset()},[n]);const[h,g]=m.useState(Object.fromEntries(p.map(S=>[S,{status:"not-asked"}])));m.useEffect(()=>{g(Object.fromEntries(p.map(P=>[P,{status:"loading"}])));async function S(){const P=await Promise.all(p.map(async M=>{const[$,V]=Fe.splitModuleFilePathAndModulePath(M),j=await n.getModule($,!1);if(Ve.isErr(j))return[$,{status:"error",error:j.error.message}];{const{source:le,schema:K}=j.value;if(!le||!K)return[$,{status:"error",error:"Val could load this content. Please try again."}];{const H=Fe.resolvePath(V,le,K);return!H.source||!H.schema?[$,{status:"error",error:"Val could not internally resolve this content. This is possibly due to a misconfiguration or a bug in Val."}]:[M,{status:"success",data:{source:H.source,schema:H.schema}}]}}}));g(Object.fromEntries(P))}S()},[p.join(";")]);const[x,v]=m.useState(),[y,w]=m.useState([]),[k,E]=m.useState(0);m.useEffect(()=>{e.getPatches().then(S=>{if(Ve.isErr(S)){console.error(S.error);return}w(Object.values(S.value).flatMap(P=>P.map(M=>M.patch_id)))})},[k]);const O=m.useCallback(S=>async P=>{const[M,$]=Fe.splitModuleFilePathAndModulePath(S),V=await P(Fe.createPatchPath($)),j=await n.applyPatch(M,y,V);if(Ve.isOk(j)){const le=[];for(const K of Object.values(j.value))le.push(...K.patchIds);w(le)}E(le=>le+1),r(!0)},[]);return b.jsx(Lx.Provider,{value:{theme:o,session:s,editMode:a,setEditMode:l,setTheme:i,windowSize:x,setWindowSize:v},children:b.jsxs("div",{id:"val-overlay-container","data-mode":o,className:"font-serif antialiased",style:{position:"fixed",top:0,left:0,zIndex:8999},children:[b.jsxs(qne,{children:[b.jsx($R,{}),b.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:b.jsx(Xne,{direction:"vertical",api:e,patches:y,onClickPatches:()=>{e.postSave({patchIds:y}).then(async S=>{if(Ve.isOk(S)){const P=await e.deletePatches(y);Ve.isOk(P)?(w([]),await n.reset()):alert("Could not clean up")}else alert("Could not publish")})}})})]}),s.status==="success"&&s.data.enabled&&(a==="hover"||a==="window")&&c.path&&b.jsx(hoe,{hoverTarget:c,setHoverTarget:u,setEditMode:l,setWindowTarget:f}),a==="window"&&d&&b.jsx(doe,{onClose:()=>{f(null),l("hover")},children:b.jsx("div",{className:"p-4",style:{maxHeight:x==null?void 0:x.innerHeight,maxWidth:x==null?void 0:x.width},children:Object.entries(h).map(([S,P])=>{if(P.status!=="success")return b.jsxs("div",{children:[b.jsxs("span",{children:[S,P.status!=="error"&&b.jsxs("span",{children:[": ",P.status]})]}),P.status==="error"&&b.jsx("pre",{className:"text-red-600 whitespace-pre-wrap",children:P.error})]},S);const{source:M,schema:$}=P.data;return!M||!$?b.jsxs("div",{children:["Module: ",S," is missing source or schema"]}):b.jsx(ng,{initOnSubmit:O,path:S,schema:$,source:M,top:!0},S)})})})]})})}function hoe({hoverTarget:t,setEditMode:e,setWindowTarget:n,setHoverTarget:r}){var i;const o=(i=t.element)==null?void 0:i.getBoundingClientRect();return m.useEffect(()=>{if(t.path){const s=a=>{a.target&&a.target instanceof HTMLElement&&a.target.id!=="val-shadow-root"&&n({...t,path:t.path,mouse:{x:a.pageX,y:a.pageY}}),e("window"),r(null),a.stopPropagation()};return document.body.addEventListener("click",s),()=>{document.body.removeEventListener("click",s)}}},[t]),b.jsx("div",{id:"val-hover",className:"fixed border-2 cursor-pointer z-overlay-hover border-accent",style:{pointerEvents:"none",top:o==null?void 0:o.top,left:o==null?void 0:o.left,width:o==null?void 0:o.width,height:o==null?void 0:o.height},children:b.jsx("div",{className:"flex items-center justify-end w-full text-xs",children:b.jsx("div",{className:"flex items-center justify-center px-3 py-1 border-b-2 border-l-2 text-accent-foreground bg-accent border-accent",style:{maxHeight:(o==null?void 0:o.height)&&o.height-4,fontSize:o!=null&&o.height&&o.height<=16?o.height-4:void 0},children:"Edit"})})})}function moe(t){const[e,n]=m.useState(),[r,o]=m.useState(),[i,s]=m.useState();function a(l){if(l){const c=[];l.dataset.valPath&&c.push(l.dataset.valPath);for(const u of Array.from(l.querySelectorAll("*")))if(u instanceof HTMLElement){const d=u.dataset.valPath;d&&c.push(d)}c.length>0&&(n(l),o(c.join(",")),s(l.getBoundingClientRect()))}}return m.useEffect(()=>{if(t==="hover"||t==="window"){const l=c=>{a(c.target)};return document.addEventListener("mouseover",l),()=>{n(void 0),o(void 0),document.removeEventListener("mouseover",l)}}},[t]),m.useEffect(()=>{const l=()=>{e&&s(e.getBoundingClientRect())},c=new ResizeObserver(()=>{e&&s(e.getBoundingClientRect())}),u=document.getElementById("val-shadow-root");return e&&u&&c.observe(u),document.addEventListener("scroll",l,{passive:!0}),()=>{document.removeEventListener("scroll",l),c.disconnect()}},[e]),[{path:r,element:e,rect:i},l=>{var c;n(l==null?void 0:l.element),o(l==null?void 0:l.path),s((c=l==null?void 0:l.element)==null?void 0:c.getBoundingClientRect())}]}const qf="val-edit-mode";function goe(){const[t,e]=m.useState("off");m.useEffect(()=>{try{const r=localStorage.getItem(qf);r==="off"||r==="hover"||r==="window"||r==="full"?e(r==="window"?"hover":r):(localStorage.removeItem(qf),e("off"))}catch{e("off")}},[]);const n=m.useCallback(r=>{typeof r=="function"?e(o=>{const i=r(o);return localStorage.setItem(qf,i),i}):(localStorage.setItem(qf,r),e(r))},[]);return[t,n]}function voe(){const t="/api/val",e=new Rx(t),n=new Hx(e);return b.jsx(lb,{fallbackRender:hb,children:b.jsxs(Nne,{children:[b.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),b.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),b.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),b.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),b.jsx("style",{children:`
|
|
216
|
-
#val-overlay-container {
|
|
217
|
-
visibility: hidden;
|
|
218
|
-
}
|
|
219
|
-
`}),b.jsx("link",{rel:"stylesheet",href:`${t}/static${Rne}`}),b.jsx(ib,{overlay:!0,children:b.jsx(poe,{api:e,store:n,onSubmit:()=>{const r=new CustomEvent("val-event",{detail:{type:"overlay-submit",refreshRequired:!0}});window.dispatchEvent(r)}})})]})})}const WE=document.getElementById($ne),KE=document.getElementById(Ane),qE=document.getElementById("val-app-static");WE?gu.createRoot(WE).render(X.createElement(X.StrictMode,null,X.createElement(Tne,null))):qE?gu.createRoot(qE).render(X.createElement(X.StrictMode,null,X.createElement(Pne,null))):KE?gu.createRoot(KE).render(X.createElement(X.StrictMode,null,X.createElement(voe,null))):console.error("Val: could not mount Val element. Check your configuration.");
|