@kdrgny/justjson 1.6.0 → 1.8.0

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.
@@ -0,0 +1,720 @@
1
+ var g2=t=>{throw TypeError(t)};var y2=(t,e,n)=>e.has(t)||g2("Cannot "+n);var Tn=(t,e,n)=>(y2(t,e,"read from private field"),n?n.call(t):e.get(t)),x2=(t,e,n)=>e.has(t)?g2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),q0=(t,e,n,r)=>(y2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function i5(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 s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(t,o,s.get?s:{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 s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Py(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K0={exports:{}},hu={},G0={exports:{}},Ke={};/**
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 v2;function a5(){if(v2)return Ke;v2=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;function g(L){return L===null||typeof L!="object"?null:(L=f&&L[f]||L["@@iterator"],typeof L=="function"?L:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(L,V,re){this.props=L,this.context=V,this.refs=b,this.updater=re||x}k.prototype.isReactComponent={},k.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,V,"setState")},k.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=k.prototype;function _(L,V,re){this.props=L,this.context=V,this.refs=b,this.updater=re||x}var T=_.prototype=new E;T.constructor=_,v(T,k.prototype),T.isPureReactComponent=!0;var A=Array.isArray,D=Object.prototype.hasOwnProperty,R={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function P(L,V,re){var he,ce={},pe=null,Re=null;if(V!=null)for(he in V.ref!==void 0&&(Re=V.ref),V.key!==void 0&&(pe=""+V.key),V)D.call(V,he)&&!O.hasOwnProperty(he)&&(ce[he]=V[he]);var Q=arguments.length-2;if(Q===1)ce.children=re;else if(1<Q){for(var de=Array(Q),me=0;me<Q;me++)de[me]=arguments[me+2];ce.children=de}if(L&&L.defaultProps)for(he in Q=L.defaultProps,Q)ce[he]===void 0&&(ce[he]=Q[he]);return{$$typeof:t,type:L,key:pe,ref:Re,props:ce,_owner:R.current}}function j(L,V){return{$$typeof:t,type:L.type,key:V,ref:L.ref,props:L.props,_owner:L._owner}}function W(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function Z(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(re){return V[re]})}var J=/\/+/g;function K(L,V){return typeof L=="object"&&L!==null&&L.key!=null?Z(""+L.key):V.toString(36)}function Y(L,V,re,he,ce){var pe=typeof L;(pe==="undefined"||pe==="boolean")&&(L=null);var Re=!1;if(L===null)Re=!0;else switch(pe){case"string":case"number":Re=!0;break;case"object":switch(L.$$typeof){case t:case e:Re=!0}}if(Re)return Re=L,ce=ce(Re),L=he===""?"."+K(Re,0):he,A(ce)?(re="",L!=null&&(re=L.replace(J,"$&/")+"/"),Y(ce,V,re,"",function(me){return me})):ce!=null&&(W(ce)&&(ce=j(ce,re+(!ce.key||Re&&Re.key===ce.key?"":(""+ce.key).replace(J,"$&/")+"/")+L)),V.push(ce)),1;if(Re=0,he=he===""?".":he+":",A(L))for(var Q=0;Q<L.length;Q++){pe=L[Q];var de=he+K(pe,Q);Re+=Y(pe,V,re,de,ce)}else if(de=g(L),typeof de=="function")for(L=de.call(L),Q=0;!(pe=L.next()).done;)pe=pe.value,de=he+K(pe,Q++),Re+=Y(pe,V,re,de,ce);else if(pe==="object")throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return Re}function ee(L,V,re){if(L==null)return L;var he=[],ce=0;return Y(L,he,"","",function(pe){return V.call(re,pe,ce++)}),he}function G(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(re){(L._status===0||L._status===-1)&&(L._status=1,L._result=re)},function(re){(L._status===0||L._status===-1)&&(L._status=2,L._result=re)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var X={current:null},q={transition:null},te={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:q,ReactCurrentOwner:R};function F(){throw Error("act(...) is not supported in production builds of React.")}return Ke.Children={map:ee,forEach:function(L,V,re){ee(L,function(){V.apply(this,arguments)},re)},count:function(L){var V=0;return ee(L,function(){V++}),V},toArray:function(L){return ee(L,function(V){return V})||[]},only:function(L){if(!W(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},Ke.Component=k,Ke.Fragment=n,Ke.Profiler=o,Ke.PureComponent=_,Ke.StrictMode=r,Ke.Suspense=u,Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ke.act=F,Ke.cloneElement=function(L,V,re){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var he=v({},L.props),ce=L.key,pe=L.ref,Re=L._owner;if(V!=null){if(V.ref!==void 0&&(pe=V.ref,Re=R.current),V.key!==void 0&&(ce=""+V.key),L.type&&L.type.defaultProps)var Q=L.type.defaultProps;for(de in V)D.call(V,de)&&!O.hasOwnProperty(de)&&(he[de]=V[de]===void 0&&Q!==void 0?Q[de]:V[de])}var de=arguments.length-2;if(de===1)he.children=re;else if(1<de){Q=Array(de);for(var me=0;me<de;me++)Q[me]=arguments[me+2];he.children=Q}return{$$typeof:t,type:L.type,key:ce,ref:pe,props:he,_owner:Re}},Ke.createContext=function(L){return L={$$typeof:i,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:s,_context:L},L.Consumer=L},Ke.createElement=P,Ke.createFactory=function(L){var V=P.bind(null,L);return V.type=L,V},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(L){return{$$typeof:a,render:L}},Ke.isValidElement=W,Ke.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:G}},Ke.memo=function(L,V){return{$$typeof:d,type:L,compare:V===void 0?null:V}},Ke.startTransition=function(L){var V=q.transition;q.transition={};try{L()}finally{q.transition=V}},Ke.unstable_act=F,Ke.useCallback=function(L,V){return X.current.useCallback(L,V)},Ke.useContext=function(L){return X.current.useContext(L)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(L){return X.current.useDeferredValue(L)},Ke.useEffect=function(L,V){return X.current.useEffect(L,V)},Ke.useId=function(){return X.current.useId()},Ke.useImperativeHandle=function(L,V,re){return X.current.useImperativeHandle(L,V,re)},Ke.useInsertionEffect=function(L,V){return X.current.useInsertionEffect(L,V)},Ke.useLayoutEffect=function(L,V){return X.current.useLayoutEffect(L,V)},Ke.useMemo=function(L,V){return X.current.useMemo(L,V)},Ke.useReducer=function(L,V,re){return X.current.useReducer(L,V,re)},Ke.useRef=function(L){return X.current.useRef(L)},Ke.useState=function(L){return X.current.useState(L)},Ke.useSyncExternalStore=function(L,V,re){return X.current.useSyncExternalStore(L,V,re)},Ke.useTransition=function(){return X.current.useTransition()},Ke.version="18.3.1",Ke}var b2;function Nc(){return b2||(b2=1,G0.exports=a5()),G0.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.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
+ */var k2;function l5(){if(k2)return hu;k2=1;var t=Nc(),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,s={key:!0,ref:!0,__self:!0,__source:!0};function i(a,u,d){var h,f={},g=null,x=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(x=u.ref);for(h in u)r.call(u,h)&&!s.hasOwnProperty(h)&&(f[h]=u[h]);if(a&&a.defaultProps)for(h in u=a.defaultProps,u)f[h]===void 0&&(f[h]=u[h]);return{$$typeof:e,type:a,key:g,ref:x,props:f,_owner:o.current}}return hu.Fragment=n,hu.jsx=i,hu.jsxs=i,hu}var w2;function u5(){return w2||(w2=1,K0.exports=l5()),K0.exports}var m=u5(),C=Nc();const ne=Py(C),kl=i5({__proto__:null,default:ne},[C]);var df={},J0={exports:{}},Qn={},Z0={exports:{}},Y0={};/**
18
+ * @license React
19
+ * scheduler.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 C2;function c5(){return C2||(C2=1,(function(t){function e(q,te){var F=q.length;q.push(te);e:for(;0<F;){var L=F-1>>>1,V=q[L];if(0<o(V,te))q[L]=te,q[F]=V,F=L;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var te=q[0],F=q.pop();if(F!==te){q[0]=F;e:for(var L=0,V=q.length,re=V>>>1;L<re;){var he=2*(L+1)-1,ce=q[he],pe=he+1,Re=q[pe];if(0>o(ce,F))pe<V&&0>o(Re,ce)?(q[L]=Re,q[pe]=F,L=pe):(q[L]=ce,q[he]=F,L=he);else if(pe<V&&0>o(Re,F))q[L]=Re,q[pe]=F,L=pe;else break e}}return te}function o(q,te){var F=q.sortIndex-te.sortIndex;return F!==0?F:q.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();t.unstable_now=function(){return i.now()-a}}var u=[],d=[],h=1,f=null,g=3,x=!1,v=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(q){for(var te=n(d);te!==null;){if(te.callback===null)r(d);else if(te.startTime<=q)r(d),te.sortIndex=te.expirationTime,e(u,te);else break;te=n(d)}}function A(q){if(b=!1,T(q),!v)if(n(u)!==null)v=!0,G(D);else{var te=n(d);te!==null&&X(A,te.startTime-q)}}function D(q,te){v=!1,b&&(b=!1,E(P),P=-1),x=!0;var F=g;try{for(T(te),f=n(u);f!==null&&(!(f.expirationTime>te)||q&&!Z());){var L=f.callback;if(typeof L=="function"){f.callback=null,g=f.priorityLevel;var V=L(f.expirationTime<=te);te=t.unstable_now(),typeof V=="function"?f.callback=V:f===n(u)&&r(u),T(te)}else r(u);f=n(u)}if(f!==null)var re=!0;else{var he=n(d);he!==null&&X(A,he.startTime-te),re=!1}return re}finally{f=null,g=F,x=!1}}var R=!1,O=null,P=-1,j=5,W=-1;function Z(){return!(t.unstable_now()-W<j)}function J(){if(O!==null){var q=t.unstable_now();W=q;var te=!0;try{te=O(!0,q)}finally{te?K():(R=!1,O=null)}}else R=!1}var K;if(typeof _=="function")K=function(){_(J)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,ee=Y.port2;Y.port1.onmessage=J,K=function(){ee.postMessage(null)}}else K=function(){k(J,0)};function G(q){O=q,R||(R=!0,K())}function X(q,te){P=k(function(){q(t.unstable_now())},te)}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(q){q.callback=null},t.unstable_continueExecution=function(){v||x||(v=!0,G(D))},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(q){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var F=g;g=te;try{return q()}finally{g=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(q,te){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var F=g;g=q;try{return te()}finally{g=F}},t.unstable_scheduleCallback=function(q,te,F){var L=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?L+F:L):F=L,q){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=F+V,q={id:h++,callback:te,priorityLevel:q,startTime:F,expirationTime:V,sortIndex:-1},F>L?(q.sortIndex=F,e(d,q),n(u)===null&&q===n(d)&&(b?(E(P),P=-1):b=!0,X(A,F-L))):(q.sortIndex=V,e(u,q),v||x||(v=!0,G(D))),q},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(q){var te=g;return function(){var F=g;g=te;try{return q.apply(this,arguments)}finally{g=F}}}})(Y0)),Y0}var S2;function d5(){return S2||(S2=1,Z0.exports=c5()),Z0.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var E2;function f5(){if(E2)return Qn;E2=1;var t=Nc(),e=d5();function n(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function s(l,c){i(l,c),i(l+"Capture",c)}function i(l,c){for(o[l]=c,l=0;l<c.length;l++)r.add(c[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},f={};function g(l){return u.call(f,l)?!0:u.call(h,l)?!1:d.test(l)?f[l]=!0:(h[l]=!0,!1)}function x(l,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function v(l,c,p,y){if(c===null||typeof c>"u"||x(l,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(l,c,p,y,w,S,N){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=l,this.type=c,this.sanitizeURL=S,this.removeEmptyString=N}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];k[c]=new b(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new b(l,2,!1,l,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(l){k[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function _(l){return l[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(l){var c=l.replace(E,_);k[c]=new b(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(E,_);k[c]=new b(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(E,_);k[c]=new b(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function T(l,c,p,y){var w=k.hasOwnProperty(c)?k[c]:null;(w!==null?w.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(v(c,p,w,y)&&(p=null),y||w===null?g(c)&&(p===null?l.removeAttribute(c):l.setAttribute(c,""+p)):w.mustUseProperty?l[w.propertyName]=p===null?w.type===3?!1:"":p:(c=w.attributeName,y=w.attributeNamespace,p===null?l.removeAttribute(c):(w=w.type,p=w===3||w===4&&p===!0?"":""+p,y?l.setAttributeNS(y,c,p):l.setAttribute(c,p))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),R=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),Z=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),q=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=q&&l[q]||l["@@iterator"],typeof l=="function"?l:null)}var F=Object.assign,L;function V(l){if(L===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);L=c&&c[1]||""}return`
34
+ `+L+l}var re=!1;function he(l,c){if(!l||re)return"";re=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(U){var y=U}Reflect.construct(l,[],c)}else{try{c.call()}catch(U){y=U}l.call(c.prototype)}else{try{throw Error()}catch(U){y=U}l()}}catch(U){if(U&&y&&typeof U.stack=="string"){for(var w=U.stack.split(`
35
+ `),S=y.stack.split(`
36
+ `),N=w.length-1,I=S.length-1;1<=N&&0<=I&&w[N]!==S[I];)I--;for(;1<=N&&0<=I;N--,I--)if(w[N]!==S[I]){if(N!==1||I!==1)do if(N--,I--,0>I||w[N]!==S[I]){var z=`
37
+ `+w[N].replace(" at new "," at ");return l.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",l.displayName)),z}while(1<=N&&0<=I);break}}}finally{re=!1,Error.prepareStackTrace=p}return(l=l?l.displayName||l.name:"")?V(l):""}function ce(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=he(l.type,!1),l;case 11:return l=he(l.type.render,!1),l;case 1:return l=he(l.type,!0),l;default:return""}}function pe(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case R:return"Portal";case j:return"Profiler";case P:return"StrictMode";case K:return"Suspense";case Y:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case Z:return(l.displayName||"Context")+".Consumer";case W:return(l._context.displayName||"Context")+".Provider";case J:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ee:return c=l.displayName||null,c!==null?c:pe(l.type)||"Memo";case G:c=l._payload,l=l._init;try{return pe(l(c))}catch{}}return null}function Re(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(c);case 8:return c===P?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Q(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function de(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function me(l){var c=de(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),y=""+l[c];if(!l.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,S=p.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return w.call(this)},set:function(N){y=""+N,S.call(this,N)}}),Object.defineProperty(l,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(N){y=""+N},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Fe(l){l._valueTracker||(l._valueTracker=me(l))}function Oe(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return l&&(y=de(l)?l.checked?"true":"false":l.value),l=y,l!==p?(c.setValue(l),!0):!1}function Be(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ye(l,c){var p=c.checked;return F({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??l._wrapperState.initialChecked})}function Mt(l,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=Q(c.value!=null?c.value:p),l._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function zt(l,c){c=c.checked,c!=null&&T(l,"checked",c,!1)}function qt(l,c){zt(l,c);var p=Q(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&l.value===""||l.value!=p)&&(l.value=""+p):l.value!==""+p&&(l.value=""+p);else if(y==="submit"||y==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?Kt(l,c.type,p):c.hasOwnProperty("defaultValue")&&Kt(l,c.type,Q(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function Hn(l,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,p||c===l.value||(l.value=c),l.defaultValue=c}p=l.name,p!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,p!==""&&(l.name=p)}function Kt(l,c,p){(c!=="number"||Be(l.ownerDocument)!==l)&&(p==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+p&&(l.defaultValue=""+p))}var nn=Array.isArray;function On(l,c,p,y){if(l=l.options,c){c={};for(var w=0;w<p.length;w++)c["$"+p[w]]=!0;for(p=0;p<l.length;p++)w=c.hasOwnProperty("$"+l[p].value),l[p].selected!==w&&(l[p].selected=w),w&&y&&(l[p].defaultSelected=!0)}else{for(p=""+Q(p),c=null,w=0;w<l.length;w++){if(l[w].value===p){l[w].selected=!0,y&&(l[w].defaultSelected=!0);return}c!==null||l[w].disabled||(c=l[w])}c!==null&&(c.selected=!0)}}function pt(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return F({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function yr(l,c){var p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(nn(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}l._wrapperState={initialValue:Q(p)}}function ki(l,c){var p=Q(c.value),y=Q(c.defaultValue);p!=null&&(p=""+p,p!==l.value&&(l.value=p),c.defaultValue==null&&l.defaultValue!==p&&(l.defaultValue=p)),y!=null&&(l.defaultValue=""+y)}function ya(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function Oo(l){switch(l){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 xr(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?Oo(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Un,vr=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,w){MSApp.execUnsafeLocalFunction(function(){return l(c,p,y,w)})}:l})(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(Un=Un||document.createElement("div"),Un.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Un.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function jn(l,c){if(c){var p=l.firstChild;if(p&&p===l.lastChild&&p.nodeType===3){p.nodeValue=c;return}}l.textContent=c}var mn={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},Pr=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(l){Pr.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),mn[c]=mn[l]})});function xa(l,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||mn.hasOwnProperty(l)&&mn[l]?(""+c).trim():c+"px"}function va(l,c){l=l.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,w=xa(p,c[p],y);p==="float"&&(p="cssFloat"),y?l.setProperty(p,w):l[p]=w}}var ys=F({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 jo(l,c){if(c){if(ys[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function wi(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){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 ro=null;function Wn(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ci=null,oo=null,gt=null;function Gt(l){if(l=Xl(l)){if(typeof Ci!="function")throw Error(n(280));var c=l.stateNode;c&&(c=Ed(c),Ci(l.stateNode,l.type,c))}}function Me(l){oo?gt?gt.push(l):gt=[l]:oo=l}function it(){if(oo){var l=oo,c=gt;if(gt=oo=null,Gt(l),c)for(l=0;l<c.length;l++)Gt(c[l])}}function tt(l,c){return l(c)}function at(){}var Jt=!1;function mt(l,c,p){if(Jt)return l(c,p);Jt=!0;try{return tt(l,c,p)}finally{Jt=!1,(oo!==null||gt!==null)&&(at(),it())}}function Je(l,c){var p=l.stateNode;if(p===null)return null;var y=Ed(p);if(y===null)return null;p=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(l=l.type,y=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!y;break e;default:l=!1}if(l)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var gn=!1;if(a)try{var ft={};Object.defineProperty(ft,"passive",{get:function(){gn=!0}}),window.addEventListener("test",ft,ft),window.removeEventListener("test",ft,ft)}catch{gn=!1}function Tt(l,c,p,y,w,S,N,I,z){var U=Array.prototype.slice.call(arguments,3);try{c.apply(p,U)}catch(ie){this.onError(ie)}}var qn=!1,rn=null,Kn=!1,Io=null,Ol={onError:function(l){qn=!0,rn=l}};function pA(l,c,p,y,w,S,N,I,z){qn=!1,rn=null,Tt.apply(Ol,arguments)}function mA(l,c,p,y,w,S,N,I,z){if(pA.apply(this,arguments),qn){if(qn){var U=rn;qn=!1,rn=null}else throw Error(n(198));Kn||(Kn=!0,Io=U)}}function Si(l){var c=l,p=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(p=c.return),l=c.return;while(l)}return c.tag===3?p:null}function Fv(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function $v(l){if(Si(l)!==l)throw Error(n(188))}function gA(l){var c=l.alternate;if(!c){if(c=Si(l),c===null)throw Error(n(188));return c!==l?null:l}for(var p=l,y=c;;){var w=p.return;if(w===null)break;var S=w.alternate;if(S===null){if(y=w.return,y!==null){p=y;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===p)return $v(w),l;if(S===y)return $v(w),c;S=S.sibling}throw Error(n(188))}if(p.return!==y.return)p=w,y=S;else{for(var N=!1,I=w.child;I;){if(I===p){N=!0,p=w,y=S;break}if(I===y){N=!0,y=w,p=S;break}I=I.sibling}if(!N){for(I=S.child;I;){if(I===p){N=!0,p=S,y=w;break}if(I===y){N=!0,y=S,p=w;break}I=I.sibling}if(!N)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?l:c}function Bv(l){return l=gA(l),l!==null?Vv(l):null}function Vv(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=Vv(l);if(c!==null)return c;l=l.sibling}return null}var Hv=e.unstable_scheduleCallback,Uv=e.unstable_cancelCallback,yA=e.unstable_shouldYield,xA=e.unstable_requestPaint,Pt=e.unstable_now,vA=e.unstable_getCurrentPriorityLevel,fm=e.unstable_ImmediatePriority,Wv=e.unstable_UserBlockingPriority,sd=e.unstable_NormalPriority,bA=e.unstable_LowPriority,qv=e.unstable_IdlePriority,id=null,so=null;function kA(l){if(so&&typeof so.onCommitFiberRoot=="function")try{so.onCommitFiberRoot(id,l,void 0,(l.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:SA,wA=Math.log,CA=Math.LN2;function SA(l){return l>>>=0,l===0?32:31-(wA(l)/CA|0)|0}var ad=64,ld=4194304;function jl(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function ud(l,c){var p=l.pendingLanes;if(p===0)return 0;var y=0,w=l.suspendedLanes,S=l.pingedLanes,N=p&268435455;if(N!==0){var I=N&~w;I!==0?y=jl(I):(S&=N,S!==0&&(y=jl(S)))}else N=p&~w,N!==0?y=jl(N):S!==0&&(y=jl(S));if(y===0)return 0;if(c!==0&&c!==y&&(c&w)===0&&(w=y&-y,S=c&-c,w>=S||w===16&&(S&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)p=31-Lr(c),w=1<<p,y|=l[p],c&=~w;return y}function EA(l,c){switch(l){case 1:case 2:case 4:return c+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 c+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 _A(l,c){for(var p=l.suspendedLanes,y=l.pingedLanes,w=l.expirationTimes,S=l.pendingLanes;0<S;){var N=31-Lr(S),I=1<<N,z=w[N];z===-1?((I&p)===0||(I&y)!==0)&&(w[N]=EA(I,c)):z<=c&&(l.expiredLanes|=I),S&=~I}}function hm(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Kv(){var l=ad;return ad<<=1,(ad&4194240)===0&&(ad=64),l}function pm(l){for(var c=[],p=0;31>p;p++)c.push(l);return c}function Il(l,c,p){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Lr(c),l[c]=p}function TA(l,c){var p=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<p;){var w=31-Lr(p),S=1<<w;c[w]=0,y[w]=-1,l[w]=-1,p&=~S}}function mm(l,c){var p=l.entangledLanes|=c;for(l=l.entanglements;p;){var y=31-Lr(p),w=1<<y;w&c|l[y]&c&&(l[y]|=c),p&=~w}}var ct=0;function Gv(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Jv,gm,Zv,Yv,Xv,ym=!1,cd=[],xs=null,vs=null,bs=null,Pl=new Map,Ll=new Map,ks=[],NA="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 Qv(l,c){switch(l){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":Pl.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(c.pointerId)}}function zl(l,c,p,y,w,S){return l===null||l.nativeEvent!==S?(l={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:S,targetContainers:[w]},c!==null&&(c=Xl(c),c!==null&&gm(c)),l):(l.eventSystemFlags|=y,c=l.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),l)}function AA(l,c,p,y,w){switch(c){case"focusin":return xs=zl(xs,l,c,p,y,w),!0;case"dragenter":return vs=zl(vs,l,c,p,y,w),!0;case"mouseover":return bs=zl(bs,l,c,p,y,w),!0;case"pointerover":var S=w.pointerId;return Pl.set(S,zl(Pl.get(S)||null,l,c,p,y,w)),!0;case"gotpointercapture":return S=w.pointerId,Ll.set(S,zl(Ll.get(S)||null,l,c,p,y,w)),!0}return!1}function eb(l){var c=Ei(l.target);if(c!==null){var p=Si(c);if(p!==null){if(c=p.tag,c===13){if(c=Fv(p),c!==null){l.blockedOn=c,Xv(l.priority,function(){Zv(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){l.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}l.blockedOn=null}function dd(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var p=vm(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(p===null){p=l.nativeEvent;var y=new p.constructor(p.type,p);ro=y,p.target.dispatchEvent(y),ro=null}else return c=Xl(p),c!==null&&gm(c),l.blockedOn=p,!1;c.shift()}return!0}function tb(l,c,p){dd(l)&&p.delete(c)}function MA(){ym=!1,xs!==null&&dd(xs)&&(xs=null),vs!==null&&dd(vs)&&(vs=null),bs!==null&&dd(bs)&&(bs=null),Pl.forEach(tb),Ll.forEach(tb)}function Fl(l,c){l.blockedOn===c&&(l.blockedOn=null,ym||(ym=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MA)))}function $l(l){function c(w){return Fl(w,l)}if(0<cd.length){Fl(cd[0],l);for(var p=1;p<cd.length;p++){var y=cd[p];y.blockedOn===l&&(y.blockedOn=null)}}for(xs!==null&&Fl(xs,l),vs!==null&&Fl(vs,l),bs!==null&&Fl(bs,l),Pl.forEach(c),Ll.forEach(c),p=0;p<ks.length;p++)y=ks[p],y.blockedOn===l&&(y.blockedOn=null);for(;0<ks.length&&(p=ks[0],p.blockedOn===null);)eb(p),p.blockedOn===null&&ks.shift()}var ba=A.ReactCurrentBatchConfig,fd=!0;function DA(l,c,p,y){var w=ct,S=ba.transition;ba.transition=null;try{ct=1,xm(l,c,p,y)}finally{ct=w,ba.transition=S}}function RA(l,c,p,y){var w=ct,S=ba.transition;ba.transition=null;try{ct=4,xm(l,c,p,y)}finally{ct=w,ba.transition=S}}function xm(l,c,p,y){if(fd){var w=vm(l,c,p,y);if(w===null)Pm(l,c,y,hd,p),Qv(l,y);else if(AA(w,l,c,p,y))y.stopPropagation();else if(Qv(l,y),c&4&&-1<NA.indexOf(l)){for(;w!==null;){var S=Xl(w);if(S!==null&&Jv(S),S=vm(l,c,p,y),S===null&&Pm(l,c,y,hd,p),S===w)break;w=S}w!==null&&y.stopPropagation()}else Pm(l,c,y,null,p)}}var hd=null;function vm(l,c,p,y){if(hd=null,l=Wn(y),l=Ei(l),l!==null)if(c=Si(l),c===null)l=null;else if(p=c.tag,p===13){if(l=Fv(c),l!==null)return l;l=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return hd=l,null}function nb(l){switch(l){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(vA()){case fm:return 1;case Wv:return 4;case sd:case bA:return 16;case qv:return 536870912;default:return 16}default:return 16}}var ws=null,bm=null,pd=null;function rb(){if(pd)return pd;var l,c=bm,p=c.length,y,w="value"in ws?ws.value:ws.textContent,S=w.length;for(l=0;l<p&&c[l]===w[l];l++);var N=p-l;for(y=1;y<=N&&c[p-y]===w[S-y];y++);return pd=w.slice(l,1<y?1-y:void 0)}function md(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function gd(){return!0}function ob(){return!1}function ir(l){function c(p,y,w,S,N){this._reactName=p,this._targetInst=w,this.type=y,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var I in l)l.hasOwnProperty(I)&&(p=l[I],this[I]=p?p(S):S[I]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?gd:ob,this.isPropagationStopped=ob,this}return F(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=gd)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=gd)},persist:function(){},isPersistent:gd}),c}var ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},km=ir(ka),Bl=F({},ka,{view:0,detail:0}),OA=ir(Bl),wm,Cm,Vl,yd=F({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Em,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Vl&&(Vl&&l.type==="mousemove"?(wm=l.screenX-Vl.screenX,Cm=l.screenY-Vl.screenY):Cm=wm=0,Vl=l),wm)},movementY:function(l){return"movementY"in l?l.movementY:Cm}}),sb=ir(yd),jA=F({},yd,{dataTransfer:0}),IA=ir(jA),PA=F({},Bl,{relatedTarget:0}),Sm=ir(PA),LA=F({},ka,{animationName:0,elapsedTime:0,pseudoElement:0}),zA=ir(LA),FA=F({},ka,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),$A=ir(FA),BA=F({},ka,{data:0}),ib=ir(BA),VA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HA={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"},UA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WA(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=UA[l])?!!c[l]:!1}function Em(){return WA}var qA=F({},Bl,{key:function(l){if(l.key){var c=VA[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=md(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?HA[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Em,charCode:function(l){return l.type==="keypress"?md(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?md(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),KA=ir(qA),GA=F({},yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ab=ir(GA),JA=F({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Em}),ZA=ir(JA),YA=F({},ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),XA=ir(YA),QA=F({},yd,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),eM=ir(QA),tM=[9,13,27,32],_m=a&&"CompositionEvent"in window,Hl=null;a&&"documentMode"in document&&(Hl=document.documentMode);var nM=a&&"TextEvent"in window&&!Hl,lb=a&&(!_m||Hl&&8<Hl&&11>=Hl),ub=" ",cb=!1;function db(l,c){switch(l){case"keyup":return tM.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fb(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var wa=!1;function rM(l,c){switch(l){case"compositionend":return fb(c);case"keypress":return c.which!==32?null:(cb=!0,ub);case"textInput":return l=c.data,l===ub&&cb?null:l;default:return null}}function oM(l,c){if(wa)return l==="compositionend"||!_m&&db(l,c)?(l=rb(),pd=bm=ws=null,wa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return lb&&c.locale!=="ko"?null:c.data;default:return null}}var sM={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 hb(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!sM[l.type]:c==="textarea"}function pb(l,c,p,y){Me(y),c=wd(c,"onChange"),0<c.length&&(p=new km("onChange","change",null,p,y),l.push({event:p,listeners:c}))}var Ul=null,Wl=null;function iM(l){Rb(l,0)}function xd(l){var c=Ta(l);if(Oe(c))return l}function aM(l,c){if(l==="change")return c}var mb=!1;if(a){var Tm;if(a){var Nm="oninput"in document;if(!Nm){var gb=document.createElement("div");gb.setAttribute("oninput","return;"),Nm=typeof gb.oninput=="function"}Tm=Nm}else Tm=!1;mb=Tm&&(!document.documentMode||9<document.documentMode)}function yb(){Ul&&(Ul.detachEvent("onpropertychange",xb),Wl=Ul=null)}function xb(l){if(l.propertyName==="value"&&xd(Wl)){var c=[];pb(c,Wl,l,Wn(l)),mt(iM,c)}}function lM(l,c,p){l==="focusin"?(yb(),Ul=c,Wl=p,Ul.attachEvent("onpropertychange",xb)):l==="focusout"&&yb()}function uM(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return xd(Wl)}function cM(l,c){if(l==="click")return xd(c)}function dM(l,c){if(l==="input"||l==="change")return xd(c)}function fM(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var zr=typeof Object.is=="function"?Object.is:fM;function ql(l,c){if(zr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var p=Object.keys(l),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var w=p[y];if(!u.call(c,w)||!zr(l[w],c[w]))return!1}return!0}function vb(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function bb(l,c){var p=vb(l);l=0;for(var y;p;){if(p.nodeType===3){if(y=l+p.textContent.length,l<=c&&y>=c)return{node:p,offset:c-l};l=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=vb(p)}}function kb(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?kb(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function wb(){for(var l=window,c=Be();c instanceof l.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)l=c.contentWindow;else break;c=Be(l.document)}return c}function Am(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function hM(l){var c=wb(),p=l.focusedElem,y=l.selectionRange;if(c!==p&&p&&p.ownerDocument&&kb(p.ownerDocument.documentElement,p)){if(y!==null&&Am(p)){if(c=y.start,l=y.end,l===void 0&&(l=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(l,p.value.length);else if(l=(c=p.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var w=p.textContent.length,S=Math.min(y.start,w);y=y.end===void 0?S:Math.min(y.end,w),!l.extend&&S>y&&(w=y,y=S,S=w),w=bb(p,S);var N=bb(p,y);w&&N&&(l.rangeCount!==1||l.anchorNode!==w.node||l.anchorOffset!==w.offset||l.focusNode!==N.node||l.focusOffset!==N.offset)&&(c=c.createRange(),c.setStart(w.node,w.offset),l.removeAllRanges(),S>y?(l.addRange(c),l.extend(N.node,N.offset)):(c.setEnd(N.node,N.offset),l.addRange(c)))}}for(c=[],l=p;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)l=c[p],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var pM=a&&"documentMode"in document&&11>=document.documentMode,Ca=null,Mm=null,Kl=null,Dm=!1;function Cb(l,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Dm||Ca==null||Ca!==Be(y)||(y=Ca,"selectionStart"in y&&Am(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Kl&&ql(Kl,y)||(Kl=y,y=wd(Mm,"onSelect"),0<y.length&&(c=new km("onSelect","select",null,c,p),l.push({event:c,listeners:y}),c.target=Ca)))}function vd(l,c){var p={};return p[l.toLowerCase()]=c.toLowerCase(),p["Webkit"+l]="webkit"+c,p["Moz"+l]="moz"+c,p}var Sa={animationend:vd("Animation","AnimationEnd"),animationiteration:vd("Animation","AnimationIteration"),animationstart:vd("Animation","AnimationStart"),transitionend:vd("Transition","TransitionEnd")},Rm={},Sb={};a&&(Sb=document.createElement("div").style,"AnimationEvent"in window||(delete Sa.animationend.animation,delete Sa.animationiteration.animation,delete Sa.animationstart.animation),"TransitionEvent"in window||delete Sa.transitionend.transition);function bd(l){if(Rm[l])return Rm[l];if(!Sa[l])return l;var c=Sa[l],p;for(p in c)if(c.hasOwnProperty(p)&&p in Sb)return Rm[l]=c[p];return l}var Eb=bd("animationend"),_b=bd("animationiteration"),Tb=bd("animationstart"),Nb=bd("transitionend"),Ab=new Map,Mb="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 Cs(l,c){Ab.set(l,c),s(c,[l])}for(var Om=0;Om<Mb.length;Om++){var jm=Mb[Om],mM=jm.toLowerCase(),gM=jm[0].toUpperCase()+jm.slice(1);Cs(mM,"on"+gM)}Cs(Eb,"onAnimationEnd"),Cs(_b,"onAnimationIteration"),Cs(Tb,"onAnimationStart"),Cs("dblclick","onDoubleClick"),Cs("focusin","onFocus"),Cs("focusout","onBlur"),Cs(Nb,"onTransitionEnd"),i("onMouseEnter",["mouseout","mouseover"]),i("onMouseLeave",["mouseout","mouseover"]),i("onPointerEnter",["pointerout","pointerover"]),i("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gl="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(" "),yM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gl));function Db(l,c,p){var y=l.type||"unknown-event";l.currentTarget=p,mA(y,c,void 0,l),l.currentTarget=null}function Rb(l,c){c=(c&4)!==0;for(var p=0;p<l.length;p++){var y=l[p],w=y.event;y=y.listeners;e:{var S=void 0;if(c)for(var N=y.length-1;0<=N;N--){var I=y[N],z=I.instance,U=I.currentTarget;if(I=I.listener,z!==S&&w.isPropagationStopped())break e;Db(w,I,U),S=z}else for(N=0;N<y.length;N++){if(I=y[N],z=I.instance,U=I.currentTarget,I=I.listener,z!==S&&w.isPropagationStopped())break e;Db(w,I,U),S=z}}}if(Kn)throw l=Io,Kn=!1,Io=null,l}function bt(l,c){var p=c[Vm];p===void 0&&(p=c[Vm]=new Set);var y=l+"__bubble";p.has(y)||(Ob(c,l,2,!1),p.add(y))}function Im(l,c,p){var y=0;c&&(y|=4),Ob(p,l,y,c)}var kd="_reactListening"+Math.random().toString(36).slice(2);function Jl(l){if(!l[kd]){l[kd]=!0,r.forEach(function(p){p!=="selectionchange"&&(yM.has(p)||Im(p,!1,l),Im(p,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[kd]||(c[kd]=!0,Im("selectionchange",!1,c))}}function Ob(l,c,p,y){switch(nb(c)){case 1:var w=DA;break;case 4:w=RA;break;default:w=xm}p=w.bind(null,c,p,l),w=void 0,!gn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),y?w!==void 0?l.addEventListener(c,p,{capture:!0,passive:w}):l.addEventListener(c,p,!0):w!==void 0?l.addEventListener(c,p,{passive:w}):l.addEventListener(c,p,!1)}function Pm(l,c,p,y,w){var S=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var N=y.tag;if(N===3||N===4){var I=y.stateNode.containerInfo;if(I===w||I.nodeType===8&&I.parentNode===w)break;if(N===4)for(N=y.return;N!==null;){var z=N.tag;if((z===3||z===4)&&(z=N.stateNode.containerInfo,z===w||z.nodeType===8&&z.parentNode===w))return;N=N.return}for(;I!==null;){if(N=Ei(I),N===null)return;if(z=N.tag,z===5||z===6){y=S=N;continue e}I=I.parentNode}}y=y.return}mt(function(){var U=S,ie=Wn(p),ae=[];e:{var se=Ab.get(l);if(se!==void 0){var ye=km,Se=l;switch(l){case"keypress":if(md(p)===0)break e;case"keydown":case"keyup":ye=KA;break;case"focusin":Se="focus",ye=Sm;break;case"focusout":Se="blur",ye=Sm;break;case"beforeblur":case"afterblur":ye=Sm;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=sb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=IA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=ZA;break;case Eb:case _b:case Tb:ye=zA;break;case Nb:ye=XA;break;case"scroll":ye=OA;break;case"wheel":ye=eM;break;case"copy":case"cut":case"paste":ye=$A;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=ab}var _e=(c&4)!==0,Lt=!_e&&l==="scroll",B=_e?se!==null?se+"Capture":null:se;_e=[];for(var $=U,H;$!==null;){H=$;var fe=H.stateNode;if(H.tag===5&&fe!==null&&(H=fe,B!==null&&(fe=Je($,B),fe!=null&&_e.push(Zl($,fe,H)))),Lt)break;$=$.return}0<_e.length&&(se=new ye(se,Se,null,p,ie),ae.push({event:se,listeners:_e}))}}if((c&7)===0){e:{if(se=l==="mouseover"||l==="pointerover",ye=l==="mouseout"||l==="pointerout",se&&p!==ro&&(Se=p.relatedTarget||p.fromElement)&&(Ei(Se)||Se[Po]))break e;if((ye||se)&&(se=ie.window===ie?ie:(se=ie.ownerDocument)?se.defaultView||se.parentWindow:window,ye?(Se=p.relatedTarget||p.toElement,ye=U,Se=Se?Ei(Se):null,Se!==null&&(Lt=Si(Se),Se!==Lt||Se.tag!==5&&Se.tag!==6)&&(Se=null)):(ye=null,Se=U),ye!==Se)){if(_e=sb,fe="onMouseLeave",B="onMouseEnter",$="mouse",(l==="pointerout"||l==="pointerover")&&(_e=ab,fe="onPointerLeave",B="onPointerEnter",$="pointer"),Lt=ye==null?se:Ta(ye),H=Se==null?se:Ta(Se),se=new _e(fe,$+"leave",ye,p,ie),se.target=Lt,se.relatedTarget=H,fe=null,Ei(ie)===U&&(_e=new _e(B,$+"enter",Se,p,ie),_e.target=H,_e.relatedTarget=Lt,fe=_e),Lt=fe,ye&&Se)t:{for(_e=ye,B=Se,$=0,H=_e;H;H=Ea(H))$++;for(H=0,fe=B;fe;fe=Ea(fe))H++;for(;0<$-H;)_e=Ea(_e),$--;for(;0<H-$;)B=Ea(B),H--;for(;$--;){if(_e===B||B!==null&&_e===B.alternate)break t;_e=Ea(_e),B=Ea(B)}_e=null}else _e=null;ye!==null&&jb(ae,se,ye,_e,!1),Se!==null&&Lt!==null&&jb(ae,Lt,Se,_e,!0)}}e:{if(se=U?Ta(U):window,ye=se.nodeName&&se.nodeName.toLowerCase(),ye==="select"||ye==="input"&&se.type==="file")var Ne=aM;else if(hb(se))if(mb)Ne=dM;else{Ne=uM;var Pe=lM}else(ye=se.nodeName)&&ye.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(Ne=cM);if(Ne&&(Ne=Ne(l,U))){pb(ae,Ne,p,ie);break e}Pe&&Pe(l,se,U),l==="focusout"&&(Pe=se._wrapperState)&&Pe.controlled&&se.type==="number"&&Kt(se,"number",se.value)}switch(Pe=U?Ta(U):window,l){case"focusin":(hb(Pe)||Pe.contentEditable==="true")&&(Ca=Pe,Mm=U,Kl=null);break;case"focusout":Kl=Mm=Ca=null;break;case"mousedown":Dm=!0;break;case"contextmenu":case"mouseup":case"dragend":Dm=!1,Cb(ae,p,ie);break;case"selectionchange":if(pM)break;case"keydown":case"keyup":Cb(ae,p,ie)}var Le;if(_m)e:{switch(l){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else wa?db(l,p)&&($e="onCompositionEnd"):l==="keydown"&&p.keyCode===229&&($e="onCompositionStart");$e&&(lb&&p.locale!=="ko"&&(wa||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&wa&&(Le=rb()):(ws=ie,bm="value"in ws?ws.value:ws.textContent,wa=!0)),Pe=wd(U,$e),0<Pe.length&&($e=new ib($e,l,null,p,ie),ae.push({event:$e,listeners:Pe}),Le?$e.data=Le:(Le=fb(p),Le!==null&&($e.data=Le)))),(Le=nM?rM(l,p):oM(l,p))&&(U=wd(U,"onBeforeInput"),0<U.length&&(ie=new ib("onBeforeInput","beforeinput",null,p,ie),ae.push({event:ie,listeners:U}),ie.data=Le))}Rb(ae,c)})}function Zl(l,c,p){return{instance:l,listener:c,currentTarget:p}}function wd(l,c){for(var p=c+"Capture",y=[];l!==null;){var w=l,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=Je(l,p),S!=null&&y.unshift(Zl(l,S,w)),S=Je(l,c),S!=null&&y.push(Zl(l,S,w))),l=l.return}return y}function Ea(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function jb(l,c,p,y,w){for(var S=c._reactName,N=[];p!==null&&p!==y;){var I=p,z=I.alternate,U=I.stateNode;if(z!==null&&z===y)break;I.tag===5&&U!==null&&(I=U,w?(z=Je(p,S),z!=null&&N.unshift(Zl(p,z,I))):w||(z=Je(p,S),z!=null&&N.push(Zl(p,z,I)))),p=p.return}N.length!==0&&l.push({event:c,listeners:N})}var xM=/\r\n?/g,vM=/\u0000|\uFFFD/g;function Ib(l){return(typeof l=="string"?l:""+l).replace(xM,`
38
+ `).replace(vM,"")}function Cd(l,c,p){if(c=Ib(c),Ib(l)!==c&&p)throw Error(n(425))}function Sd(){}var Lm=null,zm=null;function Fm(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var $m=typeof setTimeout=="function"?setTimeout:void 0,bM=typeof clearTimeout=="function"?clearTimeout:void 0,Pb=typeof Promise=="function"?Promise:void 0,kM=typeof queueMicrotask=="function"?queueMicrotask:typeof Pb<"u"?function(l){return Pb.resolve(null).then(l).catch(wM)}:$m;function wM(l){setTimeout(function(){throw l})}function Bm(l,c){var p=c,y=0;do{var w=p.nextSibling;if(l.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"){if(y===0){l.removeChild(w),$l(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=w}while(p);$l(c)}function Ss(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function Lb(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return l;c--}else p==="/$"&&c++}l=l.previousSibling}return null}var _a=Math.random().toString(36).slice(2),io="__reactFiber$"+_a,Yl="__reactProps$"+_a,Po="__reactContainer$"+_a,Vm="__reactEvents$"+_a,CM="__reactListeners$"+_a,SM="__reactHandles$"+_a;function Ei(l){var c=l[io];if(c)return c;for(var p=l.parentNode;p;){if(c=p[Po]||p[io]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(l=Lb(l);l!==null;){if(p=l[io])return p;l=Lb(l)}return c}l=p,p=l.parentNode}return null}function Xl(l){return l=l[io]||l[Po],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ta(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Ed(l){return l[Yl]||null}var Hm=[],Na=-1;function Es(l){return{current:l}}function kt(l){0>Na||(l.current=Hm[Na],Hm[Na]=null,Na--)}function yt(l,c){Na++,Hm[Na]=l.current,l.current=c}var _s={},Cn=Es(_s),Gn=Es(!1),_i=_s;function Aa(l,c){var p=l.type.contextTypes;if(!p)return _s;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in p)w[S]=c[S];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=w),w}function Jn(l){return l=l.childContextTypes,l!=null}function _d(){kt(Gn),kt(Cn)}function zb(l,c,p){if(Cn.current!==_s)throw Error(n(168));yt(Cn,c),yt(Gn,p)}function Fb(l,c,p){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var w in y)if(!(w in c))throw Error(n(108,Re(l)||"Unknown",w));return F({},p,y)}function Td(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||_s,_i=Cn.current,yt(Cn,l),yt(Gn,Gn.current),!0}function $b(l,c,p){var y=l.stateNode;if(!y)throw Error(n(169));p?(l=Fb(l,c,_i),y.__reactInternalMemoizedMergedChildContext=l,kt(Gn),kt(Cn),yt(Cn,l)):kt(Gn),yt(Gn,p)}var Lo=null,Nd=!1,Um=!1;function Bb(l){Lo===null?Lo=[l]:Lo.push(l)}function EM(l){Nd=!0,Bb(l)}function Ts(){if(!Um&&Lo!==null){Um=!0;var l=0,c=ct;try{var p=Lo;for(ct=1;l<p.length;l++){var y=p[l];do y=y(!0);while(y!==null)}Lo=null,Nd=!1}catch(w){throw Lo!==null&&(Lo=Lo.slice(l+1)),Hv(fm,Ts),w}finally{ct=c,Um=!1}}return null}var Ma=[],Da=0,Ad=null,Md=0,br=[],kr=0,Ti=null,zo=1,Fo="";function Ni(l,c){Ma[Da++]=Md,Ma[Da++]=Ad,Ad=l,Md=c}function Vb(l,c,p){br[kr++]=zo,br[kr++]=Fo,br[kr++]=Ti,Ti=l;var y=zo;l=Fo;var w=32-Lr(y)-1;y&=~(1<<w),p+=1;var S=32-Lr(c)+w;if(30<S){var N=w-w%5;S=(y&(1<<N)-1).toString(32),y>>=N,w-=N,zo=1<<32-Lr(c)+w|p<<w|y,Fo=S+l}else zo=1<<S|p<<w|y,Fo=l}function Wm(l){l.return!==null&&(Ni(l,1),Vb(l,1,0))}function qm(l){for(;l===Ad;)Ad=Ma[--Da],Ma[Da]=null,Md=Ma[--Da],Ma[Da]=null;for(;l===Ti;)Ti=br[--kr],br[kr]=null,Fo=br[--kr],br[kr]=null,zo=br[--kr],br[kr]=null}var ar=null,lr=null,_t=!1,Fr=null;function Hb(l,c){var p=Er(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=l,c=l.deletions,c===null?(l.deletions=[p],l.flags|=16):c.push(p)}function Ub(l,c){switch(l.tag){case 5:var p=l.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,ar=l,lr=Ss(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,ar=l,lr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=Ti!==null?{id:zo,overflow:Fo}:null,l.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=Er(18,null,null,0),p.stateNode=c,p.return=l,l.child=p,ar=l,lr=null,!0):!1;default:return!1}}function Km(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Gm(l){if(_t){var c=lr;if(c){var p=c;if(!Ub(l,c)){if(Km(l))throw Error(n(418));c=Ss(p.nextSibling);var y=ar;c&&Ub(l,c)?Hb(y,p):(l.flags=l.flags&-4097|2,_t=!1,ar=l)}}else{if(Km(l))throw Error(n(418));l.flags=l.flags&-4097|2,_t=!1,ar=l}}}function Wb(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ar=l}function Dd(l){if(l!==ar)return!1;if(!_t)return Wb(l),_t=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!Fm(l.type,l.memoizedProps)),c&&(c=lr)){if(Km(l))throw qb(),Error(n(418));for(;c;)Hb(l,c),c=Ss(c.nextSibling)}if(Wb(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="/$"){if(c===0){lr=Ss(l.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}l=l.nextSibling}lr=null}}else lr=ar?Ss(l.stateNode.nextSibling):null;return!0}function qb(){for(var l=lr;l;)l=Ss(l.nextSibling)}function Ra(){lr=ar=null,_t=!1}function Jm(l){Fr===null?Fr=[l]:Fr.push(l)}var _M=A.ReactCurrentBatchConfig;function Ql(l,c,p){if(l=p.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,l));var w=y,S=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(N){var I=w.refs;N===null?delete I[S]:I[S]=N},c._stringRef=S,c)}if(typeof l!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,l))}return l}function Rd(l,c){throw l=Object.prototype.toString.call(c),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function Kb(l){var c=l._init;return c(l._payload)}function Gb(l){function c(B,$){if(l){var H=B.deletions;H===null?(B.deletions=[$],B.flags|=16):H.push($)}}function p(B,$){if(!l)return null;for(;$!==null;)c(B,$),$=$.sibling;return null}function y(B,$){for(B=new Map;$!==null;)$.key!==null?B.set($.key,$):B.set($.index,$),$=$.sibling;return B}function w(B,$){return B=Is(B,$),B.index=0,B.sibling=null,B}function S(B,$,H){return B.index=H,l?(H=B.alternate,H!==null?(H=H.index,H<$?(B.flags|=2,$):H):(B.flags|=2,$)):(B.flags|=1048576,$)}function N(B){return l&&B.alternate===null&&(B.flags|=2),B}function I(B,$,H,fe){return $===null||$.tag!==6?($=$0(H,B.mode,fe),$.return=B,$):($=w($,H),$.return=B,$)}function z(B,$,H,fe){var Ne=H.type;return Ne===O?ie(B,$,H.props.children,fe,H.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===G&&Kb(Ne)===$.type)?(fe=w($,H.props),fe.ref=Ql(B,$,H),fe.return=B,fe):(fe=nf(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Ql(B,$,H),fe.return=B,fe)}function U(B,$,H,fe){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=B0(H,B.mode,fe),$.return=B,$):($=w($,H.children||[]),$.return=B,$)}function ie(B,$,H,fe,Ne){return $===null||$.tag!==7?($=Pi(H,B.mode,fe,Ne),$.return=B,$):($=w($,H),$.return=B,$)}function ae(B,$,H){if(typeof $=="string"&&$!==""||typeof $=="number")return $=$0(""+$,B.mode,H),$.return=B,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case D:return H=nf($.type,$.key,$.props,null,B.mode,H),H.ref=Ql(B,null,$),H.return=B,H;case R:return $=B0($,B.mode,H),$.return=B,$;case G:var fe=$._init;return ae(B,fe($._payload),H)}if(nn($)||te($))return $=Pi($,B.mode,H,null),$.return=B,$;Rd(B,$)}return null}function se(B,$,H,fe){var Ne=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ne!==null?null:I(B,$,""+H,fe);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case D:return H.key===Ne?z(B,$,H,fe):null;case R:return H.key===Ne?U(B,$,H,fe):null;case G:return Ne=H._init,se(B,$,Ne(H._payload),fe)}if(nn(H)||te(H))return Ne!==null?null:ie(B,$,H,fe,null);Rd(B,H)}return null}function ye(B,$,H,fe,Ne){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return B=B.get(H)||null,I($,B,""+fe,Ne);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case D:return B=B.get(fe.key===null?H:fe.key)||null,z($,B,fe,Ne);case R:return B=B.get(fe.key===null?H:fe.key)||null,U($,B,fe,Ne);case G:var Pe=fe._init;return ye(B,$,H,Pe(fe._payload),Ne)}if(nn(fe)||te(fe))return B=B.get(H)||null,ie($,B,fe,Ne,null);Rd($,fe)}return null}function Se(B,$,H,fe){for(var Ne=null,Pe=null,Le=$,$e=$=0,an=null;Le!==null&&$e<H.length;$e++){Le.index>$e?(an=Le,Le=null):an=Le.sibling;var nt=se(B,Le,H[$e],fe);if(nt===null){Le===null&&(Le=an);break}l&&Le&&nt.alternate===null&&c(B,Le),$=S(nt,$,$e),Pe===null?Ne=nt:Pe.sibling=nt,Pe=nt,Le=an}if($e===H.length)return p(B,Le),_t&&Ni(B,$e),Ne;if(Le===null){for(;$e<H.length;$e++)Le=ae(B,H[$e],fe),Le!==null&&($=S(Le,$,$e),Pe===null?Ne=Le:Pe.sibling=Le,Pe=Le);return _t&&Ni(B,$e),Ne}for(Le=y(B,Le);$e<H.length;$e++)an=ye(Le,B,$e,H[$e],fe),an!==null&&(l&&an.alternate!==null&&Le.delete(an.key===null?$e:an.key),$=S(an,$,$e),Pe===null?Ne=an:Pe.sibling=an,Pe=an);return l&&Le.forEach(function(Ps){return c(B,Ps)}),_t&&Ni(B,$e),Ne}function _e(B,$,H,fe){var Ne=te(H);if(typeof Ne!="function")throw Error(n(150));if(H=Ne.call(H),H==null)throw Error(n(151));for(var Pe=Ne=null,Le=$,$e=$=0,an=null,nt=H.next();Le!==null&&!nt.done;$e++,nt=H.next()){Le.index>$e?(an=Le,Le=null):an=Le.sibling;var Ps=se(B,Le,nt.value,fe);if(Ps===null){Le===null&&(Le=an);break}l&&Le&&Ps.alternate===null&&c(B,Le),$=S(Ps,$,$e),Pe===null?Ne=Ps:Pe.sibling=Ps,Pe=Ps,Le=an}if(nt.done)return p(B,Le),_t&&Ni(B,$e),Ne;if(Le===null){for(;!nt.done;$e++,nt=H.next())nt=ae(B,nt.value,fe),nt!==null&&($=S(nt,$,$e),Pe===null?Ne=nt:Pe.sibling=nt,Pe=nt);return _t&&Ni(B,$e),Ne}for(Le=y(B,Le);!nt.done;$e++,nt=H.next())nt=ye(Le,B,$e,nt.value,fe),nt!==null&&(l&&nt.alternate!==null&&Le.delete(nt.key===null?$e:nt.key),$=S(nt,$,$e),Pe===null?Ne=nt:Pe.sibling=nt,Pe=nt);return l&&Le.forEach(function(s5){return c(B,s5)}),_t&&Ni(B,$e),Ne}function Lt(B,$,H,fe){if(typeof H=="object"&&H!==null&&H.type===O&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case D:e:{for(var Ne=H.key,Pe=$;Pe!==null;){if(Pe.key===Ne){if(Ne=H.type,Ne===O){if(Pe.tag===7){p(B,Pe.sibling),$=w(Pe,H.props.children),$.return=B,B=$;break e}}else if(Pe.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===G&&Kb(Ne)===Pe.type){p(B,Pe.sibling),$=w(Pe,H.props),$.ref=Ql(B,Pe,H),$.return=B,B=$;break e}p(B,Pe);break}else c(B,Pe);Pe=Pe.sibling}H.type===O?($=Pi(H.props.children,B.mode,fe,H.key),$.return=B,B=$):(fe=nf(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Ql(B,$,H),fe.return=B,B=fe)}return N(B);case R:e:{for(Pe=H.key;$!==null;){if($.key===Pe)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){p(B,$.sibling),$=w($,H.children||[]),$.return=B,B=$;break e}else{p(B,$);break}else c(B,$);$=$.sibling}$=B0(H,B.mode,fe),$.return=B,B=$}return N(B);case G:return Pe=H._init,Lt(B,$,Pe(H._payload),fe)}if(nn(H))return Se(B,$,H,fe);if(te(H))return _e(B,$,H,fe);Rd(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,$!==null&&$.tag===6?(p(B,$.sibling),$=w($,H),$.return=B,B=$):(p(B,$),$=$0(H,B.mode,fe),$.return=B,B=$),N(B)):p(B,$)}return Lt}var Oa=Gb(!0),Jb=Gb(!1),Od=Es(null),jd=null,ja=null,Zm=null;function Ym(){Zm=ja=jd=null}function Xm(l){var c=Od.current;kt(Od),l._currentValue=c}function Qm(l,c,p){for(;l!==null;){var y=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),l===p)break;l=l.return}}function Ia(l,c){jd=l,Zm=ja=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(Zn=!0),l.firstContext=null)}function wr(l){var c=l._currentValue;if(Zm!==l)if(l={context:l,memoizedValue:c,next:null},ja===null){if(jd===null)throw Error(n(308));ja=l,jd.dependencies={lanes:0,firstContext:l}}else ja=ja.next=l;return c}var Ai=null;function e0(l){Ai===null?Ai=[l]:Ai.push(l)}function Zb(l,c,p,y){var w=c.interleaved;return w===null?(p.next=p,e0(c)):(p.next=w.next,w.next=p),c.interleaved=p,$o(l,y)}function $o(l,c){l.lanes|=c;var p=l.alternate;for(p!==null&&(p.lanes|=c),p=l,l=l.return;l!==null;)l.childLanes|=c,p=l.alternate,p!==null&&(p.childLanes|=c),p=l,l=l.return;return p.tag===3?p.stateNode:null}var Ns=!1;function t0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yb(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Bo(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function As(l,c,p){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,(Xe&2)!==0){var w=y.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),y.pending=c,$o(l,p)}return w=y.interleaved,w===null?(c.next=c,e0(y)):(c.next=w.next,w.next=c),y.interleaved=c,$o(l,p)}function Id(l,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,mm(l,p)}}function Xb(l,c){var p=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var w=null,S=null;if(p=p.firstBaseUpdate,p!==null){do{var N={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};S===null?w=S=N:S=S.next=N,p=p.next}while(p!==null);S===null?w=S=c:S=S.next=c}else w=S=c;p={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:y.shared,effects:y.effects},l.updateQueue=p;return}l=p.lastBaseUpdate,l===null?p.firstBaseUpdate=c:l.next=c,p.lastBaseUpdate=c}function Pd(l,c,p,y){var w=l.updateQueue;Ns=!1;var S=w.firstBaseUpdate,N=w.lastBaseUpdate,I=w.shared.pending;if(I!==null){w.shared.pending=null;var z=I,U=z.next;z.next=null,N===null?S=U:N.next=U,N=z;var ie=l.alternate;ie!==null&&(ie=ie.updateQueue,I=ie.lastBaseUpdate,I!==N&&(I===null?ie.firstBaseUpdate=U:I.next=U,ie.lastBaseUpdate=z))}if(S!==null){var ae=w.baseState;N=0,ie=U=z=null,I=S;do{var se=I.lane,ye=I.eventTime;if((y&se)===se){ie!==null&&(ie=ie.next={eventTime:ye,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Se=l,_e=I;switch(se=c,ye=p,_e.tag){case 1:if(Se=_e.payload,typeof Se=="function"){ae=Se.call(ye,ae,se);break e}ae=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=_e.payload,se=typeof Se=="function"?Se.call(ye,ae,se):Se,se==null)break e;ae=F({},ae,se);break e;case 2:Ns=!0}}I.callback!==null&&I.lane!==0&&(l.flags|=64,se=w.effects,se===null?w.effects=[I]:se.push(I))}else ye={eventTime:ye,lane:se,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ie===null?(U=ie=ye,z=ae):ie=ie.next=ye,N|=se;if(I=I.next,I===null){if(I=w.shared.pending,I===null)break;se=I,I=se.next,se.next=null,w.lastBaseUpdate=se,w.shared.pending=null}}while(!0);if(ie===null&&(z=ae),w.baseState=z,w.firstBaseUpdate=U,w.lastBaseUpdate=ie,c=w.shared.interleaved,c!==null){w=c;do N|=w.lane,w=w.next;while(w!==c)}else S===null&&(w.shared.lanes=0);Ri|=N,l.lanes=N,l.memoizedState=ae}}function Qb(l,c,p){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var y=l[c],w=y.callback;if(w!==null){if(y.callback=null,y=p,typeof w!="function")throw Error(n(191,w));w.call(y)}}}var eu={},ao=Es(eu),tu=Es(eu),nu=Es(eu);function Mi(l){if(l===eu)throw Error(n(174));return l}function n0(l,c){switch(yt(nu,c),yt(tu,l),yt(ao,eu),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:xr(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=xr(c,l)}kt(ao),yt(ao,c)}function Pa(){kt(ao),kt(tu),kt(nu)}function ek(l){Mi(nu.current);var c=Mi(ao.current),p=xr(c,l.type);c!==p&&(yt(tu,l),yt(ao,p))}function r0(l){tu.current===l&&(kt(ao),kt(tu))}var Nt=Es(0);function Ld(l){for(var c=l;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var o0=[];function s0(){for(var l=0;l<o0.length;l++)o0[l]._workInProgressVersionPrimary=null;o0.length=0}var zd=A.ReactCurrentDispatcher,i0=A.ReactCurrentBatchConfig,Di=0,At=null,Zt=null,on=null,Fd=!1,ru=!1,ou=0,TM=0;function Sn(){throw Error(n(321))}function a0(l,c){if(c===null)return!1;for(var p=0;p<c.length&&p<l.length;p++)if(!zr(l[p],c[p]))return!1;return!0}function l0(l,c,p,y,w,S){if(Di=S,At=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,zd.current=l===null||l.memoizedState===null?DM:RM,l=p(y,w),ru){S=0;do{if(ru=!1,ou=0,25<=S)throw Error(n(301));S+=1,on=Zt=null,c.updateQueue=null,zd.current=OM,l=p(y,w)}while(ru)}if(zd.current=Vd,c=Zt!==null&&Zt.next!==null,Di=0,on=Zt=At=null,Fd=!1,c)throw Error(n(300));return l}function u0(){var l=ou!==0;return ou=0,l}function lo(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?At.memoizedState=on=l:on=on.next=l,on}function Cr(){if(Zt===null){var l=At.alternate;l=l!==null?l.memoizedState:null}else l=Zt.next;var c=on===null?At.memoizedState:on.next;if(c!==null)on=c,Zt=l;else{if(l===null)throw Error(n(310));Zt=l,l={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},on===null?At.memoizedState=on=l:on=on.next=l}return on}function su(l,c){return typeof c=="function"?c(l):c}function c0(l){var c=Cr(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=Zt,w=y.baseQueue,S=p.pending;if(S!==null){if(w!==null){var N=w.next;w.next=S.next,S.next=N}y.baseQueue=w=S,p.pending=null}if(w!==null){S=w.next,y=y.baseState;var I=N=null,z=null,U=S;do{var ie=U.lane;if((Di&ie)===ie)z!==null&&(z=z.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),y=U.hasEagerState?U.eagerState:l(y,U.action);else{var ae={lane:ie,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};z===null?(I=z=ae,N=y):z=z.next=ae,At.lanes|=ie,Ri|=ie}U=U.next}while(U!==null&&U!==S);z===null?N=y:z.next=I,zr(y,c.memoizedState)||(Zn=!0),c.memoizedState=y,c.baseState=N,c.baseQueue=z,p.lastRenderedState=y}if(l=p.interleaved,l!==null){w=l;do S=w.lane,At.lanes|=S,Ri|=S,w=w.next;while(w!==l)}else w===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function d0(l){var c=Cr(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=p.dispatch,w=p.pending,S=c.memoizedState;if(w!==null){p.pending=null;var N=w=w.next;do S=l(S,N.action),N=N.next;while(N!==w);zr(S,c.memoizedState)||(Zn=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),p.lastRenderedState=S}return[S,y]}function tk(){}function nk(l,c){var p=At,y=Cr(),w=c(),S=!zr(y.memoizedState,w);if(S&&(y.memoizedState=w,Zn=!0),y=y.queue,f0(sk.bind(null,p,y,l),[l]),y.getSnapshot!==c||S||on!==null&&on.memoizedState.tag&1){if(p.flags|=2048,iu(9,ok.bind(null,p,y,w,c),void 0,null),sn===null)throw Error(n(349));(Di&30)!==0||rk(p,c,w)}return w}function rk(l,c,p){l.flags|=16384,l={getSnapshot:c,value:p},c=At.updateQueue,c===null?(c={lastEffect:null,stores:null},At.updateQueue=c,c.stores=[l]):(p=c.stores,p===null?c.stores=[l]:p.push(l))}function ok(l,c,p,y){c.value=p,c.getSnapshot=y,ik(c)&&ak(l)}function sk(l,c,p){return p(function(){ik(c)&&ak(l)})}function ik(l){var c=l.getSnapshot;l=l.value;try{var p=c();return!zr(l,p)}catch{return!0}}function ak(l){var c=$o(l,1);c!==null&&Hr(c,l,1,-1)}function lk(l){var c=lo();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:l},c.queue=l,l=l.dispatch=MM.bind(null,At,l),[c.memoizedState,l]}function iu(l,c,p,y){return l={tag:l,create:c,destroy:p,deps:y,next:null},c=At.updateQueue,c===null?(c={lastEffect:null,stores:null},At.updateQueue=c,c.lastEffect=l.next=l):(p=c.lastEffect,p===null?c.lastEffect=l.next=l:(y=p.next,p.next=l,l.next=y,c.lastEffect=l)),l}function uk(){return Cr().memoizedState}function $d(l,c,p,y){var w=lo();At.flags|=l,w.memoizedState=iu(1|c,p,void 0,y===void 0?null:y)}function Bd(l,c,p,y){var w=Cr();y=y===void 0?null:y;var S=void 0;if(Zt!==null){var N=Zt.memoizedState;if(S=N.destroy,y!==null&&a0(y,N.deps)){w.memoizedState=iu(c,p,S,y);return}}At.flags|=l,w.memoizedState=iu(1|c,p,S,y)}function ck(l,c){return $d(8390656,8,l,c)}function f0(l,c){return Bd(2048,8,l,c)}function dk(l,c){return Bd(4,2,l,c)}function fk(l,c){return Bd(4,4,l,c)}function hk(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function pk(l,c,p){return p=p!=null?p.concat([l]):null,Bd(4,4,hk.bind(null,c,l),p)}function h0(){}function mk(l,c){var p=Cr();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&a0(c,y[1])?y[0]:(p.memoizedState=[l,c],l)}function gk(l,c){var p=Cr();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&a0(c,y[1])?y[0]:(l=l(),p.memoizedState=[l,c],l)}function yk(l,c,p){return(Di&21)===0?(l.baseState&&(l.baseState=!1,Zn=!0),l.memoizedState=p):(zr(p,c)||(p=Kv(),At.lanes|=p,Ri|=p,l.baseState=!0),c)}function NM(l,c){var p=ct;ct=p!==0&&4>p?p:4,l(!0);var y=i0.transition;i0.transition={};try{l(!1),c()}finally{ct=p,i0.transition=y}}function xk(){return Cr().memoizedState}function AM(l,c,p){var y=Os(l);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},vk(l))bk(c,p);else if(p=Zb(l,c,p,y),p!==null){var w=Pn();Hr(p,l,y,w),kk(p,c,y)}}function MM(l,c,p){var y=Os(l),w={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(vk(l))bk(c,w);else{var S=l.alternate;if(l.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var N=c.lastRenderedState,I=S(N,p);if(w.hasEagerState=!0,w.eagerState=I,zr(I,N)){var z=c.interleaved;z===null?(w.next=w,e0(c)):(w.next=z.next,z.next=w),c.interleaved=w;return}}catch{}finally{}p=Zb(l,c,w,y),p!==null&&(w=Pn(),Hr(p,l,y,w),kk(p,c,y))}}function vk(l){var c=l.alternate;return l===At||c!==null&&c===At}function bk(l,c){ru=Fd=!0;var p=l.pending;p===null?c.next=c:(c.next=p.next,p.next=c),l.pending=c}function kk(l,c,p){if((p&4194240)!==0){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,mm(l,p)}}var Vd={readContext:wr,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},DM={readContext:wr,useCallback:function(l,c){return lo().memoizedState=[l,c===void 0?null:c],l},useContext:wr,useEffect:ck,useImperativeHandle:function(l,c,p){return p=p!=null?p.concat([l]):null,$d(4194308,4,hk.bind(null,c,l),p)},useLayoutEffect:function(l,c){return $d(4194308,4,l,c)},useInsertionEffect:function(l,c){return $d(4,2,l,c)},useMemo:function(l,c){var p=lo();return c=c===void 0?null:c,l=l(),p.memoizedState=[l,c],l},useReducer:function(l,c,p){var y=lo();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},y.queue=l,l=l.dispatch=AM.bind(null,At,l),[y.memoizedState,l]},useRef:function(l){var c=lo();return l={current:l},c.memoizedState=l},useState:lk,useDebugValue:h0,useDeferredValue:function(l){return lo().memoizedState=l},useTransition:function(){var l=lk(!1),c=l[0];return l=NM.bind(null,l[1]),lo().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,p){var y=At,w=lo();if(_t){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),sn===null)throw Error(n(349));(Di&30)!==0||rk(y,c,p)}w.memoizedState=p;var S={value:p,getSnapshot:c};return w.queue=S,ck(sk.bind(null,y,S,l),[l]),y.flags|=2048,iu(9,ok.bind(null,y,S,p,c),void 0,null),p},useId:function(){var l=lo(),c=sn.identifierPrefix;if(_t){var p=Fo,y=zo;p=(y&~(1<<32-Lr(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=ou++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=TM++,c=":"+c+"r"+p.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},RM={readContext:wr,useCallback:mk,useContext:wr,useEffect:f0,useImperativeHandle:pk,useInsertionEffect:dk,useLayoutEffect:fk,useMemo:gk,useReducer:c0,useRef:uk,useState:function(){return c0(su)},useDebugValue:h0,useDeferredValue:function(l){var c=Cr();return yk(c,Zt.memoizedState,l)},useTransition:function(){var l=c0(su)[0],c=Cr().memoizedState;return[l,c]},useMutableSource:tk,useSyncExternalStore:nk,useId:xk,unstable_isNewReconciler:!1},OM={readContext:wr,useCallback:mk,useContext:wr,useEffect:f0,useImperativeHandle:pk,useInsertionEffect:dk,useLayoutEffect:fk,useMemo:gk,useReducer:d0,useRef:uk,useState:function(){return d0(su)},useDebugValue:h0,useDeferredValue:function(l){var c=Cr();return Zt===null?c.memoizedState=l:yk(c,Zt.memoizedState,l)},useTransition:function(){var l=d0(su)[0],c=Cr().memoizedState;return[l,c]},useMutableSource:tk,useSyncExternalStore:nk,useId:xk,unstable_isNewReconciler:!1};function $r(l,c){if(l&&l.defaultProps){c=F({},c),l=l.defaultProps;for(var p in l)c[p]===void 0&&(c[p]=l[p]);return c}return c}function p0(l,c,p,y){c=l.memoizedState,p=p(y,c),p=p==null?c:F({},c,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}var Hd={isMounted:function(l){return(l=l._reactInternals)?Si(l)===l:!1},enqueueSetState:function(l,c,p){l=l._reactInternals;var y=Pn(),w=Os(l),S=Bo(y,w);S.payload=c,p!=null&&(S.callback=p),c=As(l,S,w),c!==null&&(Hr(c,l,w,y),Id(c,l,w))},enqueueReplaceState:function(l,c,p){l=l._reactInternals;var y=Pn(),w=Os(l),S=Bo(y,w);S.tag=1,S.payload=c,p!=null&&(S.callback=p),c=As(l,S,w),c!==null&&(Hr(c,l,w,y),Id(c,l,w))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var p=Pn(),y=Os(l),w=Bo(p,y);w.tag=2,c!=null&&(w.callback=c),c=As(l,w,y),c!==null&&(Hr(c,l,y,p),Id(c,l,y))}};function wk(l,c,p,y,w,S,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,S,N):c.prototype&&c.prototype.isPureReactComponent?!ql(p,y)||!ql(w,S):!0}function Ck(l,c,p){var y=!1,w=_s,S=c.contextType;return typeof S=="object"&&S!==null?S=wr(S):(w=Jn(c)?_i:Cn.current,y=c.contextTypes,S=(y=y!=null)?Aa(l,w):_s),c=new c(p,S),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Hd,l.stateNode=c,c._reactInternals=l,y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=w,l.__reactInternalMemoizedMaskedChildContext=S),c}function Sk(l,c,p,y){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==l&&Hd.enqueueReplaceState(c,c.state,null)}function m0(l,c,p,y){var w=l.stateNode;w.props=p,w.state=l.memoizedState,w.refs={},t0(l);var S=c.contextType;typeof S=="object"&&S!==null?w.context=wr(S):(S=Jn(c)?_i:Cn.current,w.context=Aa(l,S)),w.state=l.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(p0(l,c,S,p),w.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(c=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),c!==w.state&&Hd.enqueueReplaceState(w,w.state,null),Pd(l,p,w,y),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308)}function La(l,c){try{var p="",y=c;do p+=ce(y),y=y.return;while(y);var w=p}catch(S){w=`
39
+ Error generating stack: `+S.message+`
40
+ `+S.stack}return{value:l,source:c,stack:w,digest:null}}function g0(l,c,p){return{value:l,source:null,stack:p??null,digest:c??null}}function y0(l,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var jM=typeof WeakMap=="function"?WeakMap:Map;function Ek(l,c,p){p=Bo(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){Zd||(Zd=!0,R0=y),y0(l,c)},p}function _k(l,c,p){p=Bo(-1,p),p.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var w=c.value;p.payload=function(){return y(w)},p.callback=function(){y0(l,c)}}var S=l.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(p.callback=function(){y0(l,c),typeof y!="function"&&(Ds===null?Ds=new Set([this]):Ds.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})}),p}function Tk(l,c,p){var y=l.pingCache;if(y===null){y=l.pingCache=new jM;var w=new Set;y.set(c,w)}else w=y.get(c),w===void 0&&(w=new Set,y.set(c,w));w.has(p)||(w.add(p),l=GM.bind(null,l,c,p),c.then(l,l))}function Nk(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Ak(l,c,p,y,w){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=Bo(-1,1),c.tag=2,As(p,c,1))),p.lanes|=1),l):(l.flags|=65536,l.lanes=w,l)}var IM=A.ReactCurrentOwner,Zn=!1;function In(l,c,p,y){c.child=l===null?Jb(c,null,p,y):Oa(c,l.child,p,y)}function Mk(l,c,p,y,w){p=p.render;var S=c.ref;return Ia(c,w),y=l0(l,c,p,y,S,w),p=u0(),l!==null&&!Zn?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~w,Vo(l,c,w)):(_t&&p&&Wm(c),c.flags|=1,In(l,c,y,w),c.child)}function Dk(l,c,p,y,w){if(l===null){var S=p.type;return typeof S=="function"&&!F0(S)&&S.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=S,Rk(l,c,S,y,w)):(l=nf(p.type,null,y,c,c.mode,w),l.ref=c.ref,l.return=c,c.child=l)}if(S=l.child,(l.lanes&w)===0){var N=S.memoizedProps;if(p=p.compare,p=p!==null?p:ql,p(N,y)&&l.ref===c.ref)return Vo(l,c,w)}return c.flags|=1,l=Is(S,y),l.ref=c.ref,l.return=c,c.child=l}function Rk(l,c,p,y,w){if(l!==null){var S=l.memoizedProps;if(ql(S,y)&&l.ref===c.ref)if(Zn=!1,c.pendingProps=y=S,(l.lanes&w)!==0)(l.flags&131072)!==0&&(Zn=!0);else return c.lanes=l.lanes,Vo(l,c,w)}return x0(l,c,p,y,w)}function Ok(l,c,p){var y=c.pendingProps,w=y.children,S=l!==null?l.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(Fa,ur),ur|=p;else{if((p&1073741824)===0)return l=S!==null?S.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,yt(Fa,ur),ur|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=S!==null?S.baseLanes:p,yt(Fa,ur),ur|=y}else S!==null?(y=S.baseLanes|p,c.memoizedState=null):y=p,yt(Fa,ur),ur|=y;return In(l,c,w,p),c.child}function jk(l,c){var p=c.ref;(l===null&&p!==null||l!==null&&l.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function x0(l,c,p,y,w){var S=Jn(p)?_i:Cn.current;return S=Aa(c,S),Ia(c,w),p=l0(l,c,p,y,S,w),y=u0(),l!==null&&!Zn?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~w,Vo(l,c,w)):(_t&&y&&Wm(c),c.flags|=1,In(l,c,p,w),c.child)}function Ik(l,c,p,y,w){if(Jn(p)){var S=!0;Td(c)}else S=!1;if(Ia(c,w),c.stateNode===null)Wd(l,c),Ck(c,p,y),m0(c,p,y,w),y=!0;else if(l===null){var N=c.stateNode,I=c.memoizedProps;N.props=I;var z=N.context,U=p.contextType;typeof U=="object"&&U!==null?U=wr(U):(U=Jn(p)?_i:Cn.current,U=Aa(c,U));var ie=p.getDerivedStateFromProps,ae=typeof ie=="function"||typeof N.getSnapshotBeforeUpdate=="function";ae||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(I!==y||z!==U)&&Sk(c,N,y,U),Ns=!1;var se=c.memoizedState;N.state=se,Pd(c,y,N,w),z=c.memoizedState,I!==y||se!==z||Gn.current||Ns?(typeof ie=="function"&&(p0(c,p,ie,y),z=c.memoizedState),(I=Ns||wk(c,p,I,y,se,z,U))?(ae||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=z),N.props=y,N.state=z,N.context=U,y=I):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,Yb(l,c),I=c.memoizedProps,U=c.type===c.elementType?I:$r(c.type,I),N.props=U,ae=c.pendingProps,se=N.context,z=p.contextType,typeof z=="object"&&z!==null?z=wr(z):(z=Jn(p)?_i:Cn.current,z=Aa(c,z));var ye=p.getDerivedStateFromProps;(ie=typeof ye=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(I!==ae||se!==z)&&Sk(c,N,y,z),Ns=!1,se=c.memoizedState,N.state=se,Pd(c,y,N,w);var Se=c.memoizedState;I!==ae||se!==Se||Gn.current||Ns?(typeof ye=="function"&&(p0(c,p,ye,y),Se=c.memoizedState),(U=Ns||wk(c,p,U,y,se,Se,z)||!1)?(ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Se,z),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Se,z)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||I===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||I===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Se),N.props=y,N.state=Se,N.context=z,y=U):(typeof N.componentDidUpdate!="function"||I===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||I===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),y=!1)}return v0(l,c,p,y,S,w)}function v0(l,c,p,y,w,S){jk(l,c);var N=(c.flags&128)!==0;if(!y&&!N)return w&&$b(c,p,!1),Vo(l,c,S);y=c.stateNode,IM.current=c;var I=N&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,l!==null&&N?(c.child=Oa(c,l.child,null,S),c.child=Oa(c,null,I,S)):In(l,c,I,S),c.memoizedState=y.state,w&&$b(c,p,!0),c.child}function Pk(l){var c=l.stateNode;c.pendingContext?zb(l,c.pendingContext,c.pendingContext!==c.context):c.context&&zb(l,c.context,!1),n0(l,c.containerInfo)}function Lk(l,c,p,y,w){return Ra(),Jm(w),c.flags|=256,In(l,c,p,y),c.child}var b0={dehydrated:null,treeContext:null,retryLane:0};function k0(l){return{baseLanes:l,cachePool:null,transitions:null}}function zk(l,c,p){var y=c.pendingProps,w=Nt.current,S=!1,N=(c.flags&128)!==0,I;if((I=N)||(I=l!==null&&l.memoizedState===null?!1:(w&2)!==0),I?(S=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(w|=1),yt(Nt,w&1),l===null)return Gm(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(N=y.children,l=y.fallback,S?(y=c.mode,S=c.child,N={mode:"hidden",children:N},(y&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=N):S=rf(N,y,0,null),l=Pi(l,y,p,null),S.return=c,l.return=c,S.sibling=l,c.child=S,c.child.memoizedState=k0(p),c.memoizedState=b0,l):w0(c,N));if(w=l.memoizedState,w!==null&&(I=w.dehydrated,I!==null))return PM(l,c,N,y,I,w,p);if(S){S=y.fallback,N=c.mode,w=l.child,I=w.sibling;var z={mode:"hidden",children:y.children};return(N&1)===0&&c.child!==w?(y=c.child,y.childLanes=0,y.pendingProps=z,c.deletions=null):(y=Is(w,z),y.subtreeFlags=w.subtreeFlags&14680064),I!==null?S=Is(I,S):(S=Pi(S,N,p,null),S.flags|=2),S.return=c,y.return=c,y.sibling=S,c.child=y,y=S,S=c.child,N=l.child.memoizedState,N=N===null?k0(p):{baseLanes:N.baseLanes|p,cachePool:null,transitions:N.transitions},S.memoizedState=N,S.childLanes=l.childLanes&~p,c.memoizedState=b0,y}return S=l.child,l=S.sibling,y=Is(S,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,l!==null&&(p=c.deletions,p===null?(c.deletions=[l],c.flags|=16):p.push(l)),c.child=y,c.memoizedState=null,y}function w0(l,c){return c=rf({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function Ud(l,c,p,y){return y!==null&&Jm(y),Oa(c,l.child,null,p),l=w0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function PM(l,c,p,y,w,S,N){if(p)return c.flags&256?(c.flags&=-257,y=g0(Error(n(422))),Ud(l,c,N,y)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(S=y.fallback,w=c.mode,y=rf({mode:"visible",children:y.children},w,0,null),S=Pi(S,w,N,null),S.flags|=2,y.return=c,S.return=c,y.sibling=S,c.child=y,(c.mode&1)!==0&&Oa(c,l.child,null,N),c.child.memoizedState=k0(N),c.memoizedState=b0,S);if((c.mode&1)===0)return Ud(l,c,N,null);if(w.data==="$!"){if(y=w.nextSibling&&w.nextSibling.dataset,y)var I=y.dgst;return y=I,S=Error(n(419)),y=g0(S,y,void 0),Ud(l,c,N,y)}if(I=(N&l.childLanes)!==0,Zn||I){if(y=sn,y!==null){switch(N&-N){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(y.suspendedLanes|N))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,$o(l,w),Hr(y,l,w,-1))}return z0(),y=g0(Error(n(421))),Ud(l,c,N,y)}return w.data==="$?"?(c.flags|=128,c.child=l.child,c=JM.bind(null,l),w._reactRetry=c,null):(l=S.treeContext,lr=Ss(w.nextSibling),ar=c,_t=!0,Fr=null,l!==null&&(br[kr++]=zo,br[kr++]=Fo,br[kr++]=Ti,zo=l.id,Fo=l.overflow,Ti=c),c=w0(c,y.children),c.flags|=4096,c)}function Fk(l,c,p){l.lanes|=c;var y=l.alternate;y!==null&&(y.lanes|=c),Qm(l.return,c,p)}function C0(l,c,p,y,w){var S=l.memoizedState;S===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:w}:(S.isBackwards=c,S.rendering=null,S.renderingStartTime=0,S.last=y,S.tail=p,S.tailMode=w)}function $k(l,c,p){var y=c.pendingProps,w=y.revealOrder,S=y.tail;if(In(l,c,y.children,p),y=Nt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Fk(l,p,c);else if(l.tag===19)Fk(l,p,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}y&=1}if(yt(Nt,y),(c.mode&1)===0)c.memoizedState=null;else switch(w){case"forwards":for(p=c.child,w=null;p!==null;)l=p.alternate,l!==null&&Ld(l)===null&&(w=p),p=p.sibling;p=w,p===null?(w=c.child,c.child=null):(w=p.sibling,p.sibling=null),C0(c,!1,w,p,S);break;case"backwards":for(p=null,w=c.child,c.child=null;w!==null;){if(l=w.alternate,l!==null&&Ld(l)===null){c.child=w;break}l=w.sibling,w.sibling=p,p=w,w=l}C0(c,!0,p,null,S);break;case"together":C0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Wd(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function Vo(l,c,p){if(l!==null&&(c.dependencies=l.dependencies),Ri|=c.lanes,(p&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(n(153));if(c.child!==null){for(l=c.child,p=Is(l,l.pendingProps),c.child=p,p.return=c;l.sibling!==null;)l=l.sibling,p=p.sibling=Is(l,l.pendingProps),p.return=c;p.sibling=null}return c.child}function LM(l,c,p){switch(c.tag){case 3:Pk(c),Ra();break;case 5:ek(c);break;case 1:Jn(c.type)&&Td(c);break;case 4:n0(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,w=c.memoizedProps.value;yt(Od,y._currentValue),y._currentValue=w;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(yt(Nt,Nt.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?zk(l,c,p):(yt(Nt,Nt.current&1),l=Vo(l,c,p),l!==null?l.sibling:null);yt(Nt,Nt.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(l.flags&128)!==0){if(y)return $k(l,c,p);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),yt(Nt,Nt.current),y)break;return null;case 22:case 23:return c.lanes=0,Ok(l,c,p)}return Vo(l,c,p)}var Bk,S0,Vk,Hk;Bk=function(l,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)l.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},S0=function(){},Vk=function(l,c,p,y){var w=l.memoizedProps;if(w!==y){l=c.stateNode,Mi(ao.current);var S=null;switch(p){case"input":w=Ye(l,w),y=Ye(l,y),S=[];break;case"select":w=F({},w,{value:void 0}),y=F({},y,{value:void 0}),S=[];break;case"textarea":w=pt(l,w),y=pt(l,y),S=[];break;default:typeof w.onClick!="function"&&typeof y.onClick=="function"&&(l.onclick=Sd)}jo(p,y);var N;p=null;for(U in w)if(!y.hasOwnProperty(U)&&w.hasOwnProperty(U)&&w[U]!=null)if(U==="style"){var I=w[U];for(N in I)I.hasOwnProperty(N)&&(p||(p={}),p[N]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(o.hasOwnProperty(U)?S||(S=[]):(S=S||[]).push(U,null));for(U in y){var z=y[U];if(I=w!=null?w[U]:void 0,y.hasOwnProperty(U)&&z!==I&&(z!=null||I!=null))if(U==="style")if(I){for(N in I)!I.hasOwnProperty(N)||z&&z.hasOwnProperty(N)||(p||(p={}),p[N]="");for(N in z)z.hasOwnProperty(N)&&I[N]!==z[N]&&(p||(p={}),p[N]=z[N])}else p||(S||(S=[]),S.push(U,p)),p=z;else U==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,I=I?I.__html:void 0,z!=null&&I!==z&&(S=S||[]).push(U,z)):U==="children"?typeof z!="string"&&typeof z!="number"||(S=S||[]).push(U,""+z):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(o.hasOwnProperty(U)?(z!=null&&U==="onScroll"&&bt("scroll",l),S||I===z||(S=[])):(S=S||[]).push(U,z))}p&&(S=S||[]).push("style",p);var U=S;(c.updateQueue=U)&&(c.flags|=4)}},Hk=function(l,c,p,y){p!==y&&(c.flags|=4)};function au(l,c){if(!_t)switch(l.tailMode){case"hidden":c=l.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?l.tail=null:p.sibling=null;break;case"collapsed":p=l.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function En(l){var c=l.alternate!==null&&l.alternate.child===l.child,p=0,y=0;if(c)for(var w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags&14680064,y|=w.flags&14680064,w.return=l,w=w.sibling;else for(w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=l,w=w.sibling;return l.subtreeFlags|=y,l.childLanes=p,c}function zM(l,c,p){var y=c.pendingProps;switch(qm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(c),null;case 1:return Jn(c.type)&&_d(),En(c),null;case 3:return y=c.stateNode,Pa(),kt(Gn),kt(Cn),s0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(l===null||l.child===null)&&(Dd(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Fr!==null&&(I0(Fr),Fr=null))),S0(l,c),En(c),null;case 5:r0(c);var w=Mi(nu.current);if(p=c.type,l!==null&&c.stateNode!=null)Vk(l,c,p,y,w),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return En(c),null}if(l=Mi(ao.current),Dd(c)){y=c.stateNode,p=c.type;var S=c.memoizedProps;switch(y[io]=c,y[Yl]=S,l=(c.mode&1)!==0,p){case"dialog":bt("cancel",y),bt("close",y);break;case"iframe":case"object":case"embed":bt("load",y);break;case"video":case"audio":for(w=0;w<Gl.length;w++)bt(Gl[w],y);break;case"source":bt("error",y);break;case"img":case"image":case"link":bt("error",y),bt("load",y);break;case"details":bt("toggle",y);break;case"input":Mt(y,S),bt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!S.multiple},bt("invalid",y);break;case"textarea":yr(y,S),bt("invalid",y)}jo(p,S),w=null;for(var N in S)if(S.hasOwnProperty(N)){var I=S[N];N==="children"?typeof I=="string"?y.textContent!==I&&(S.suppressHydrationWarning!==!0&&Cd(y.textContent,I,l),w=["children",I]):typeof I=="number"&&y.textContent!==""+I&&(S.suppressHydrationWarning!==!0&&Cd(y.textContent,I,l),w=["children",""+I]):o.hasOwnProperty(N)&&I!=null&&N==="onScroll"&&bt("scroll",y)}switch(p){case"input":Fe(y),Hn(y,S,!0);break;case"textarea":Fe(y),ya(y);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(y.onclick=Sd)}y=w,c.updateQueue=y,y!==null&&(c.flags|=4)}else{N=w.nodeType===9?w:w.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Oo(p)),l==="http://www.w3.org/1999/xhtml"?p==="script"?(l=N.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof y.is=="string"?l=N.createElement(p,{is:y.is}):(l=N.createElement(p),p==="select"&&(N=l,y.multiple?N.multiple=!0:y.size&&(N.size=y.size))):l=N.createElementNS(l,p),l[io]=c,l[Yl]=y,Bk(l,c,!1,!1),c.stateNode=l;e:{switch(N=wi(p,y),p){case"dialog":bt("cancel",l),bt("close",l),w=y;break;case"iframe":case"object":case"embed":bt("load",l),w=y;break;case"video":case"audio":for(w=0;w<Gl.length;w++)bt(Gl[w],l);w=y;break;case"source":bt("error",l),w=y;break;case"img":case"image":case"link":bt("error",l),bt("load",l),w=y;break;case"details":bt("toggle",l),w=y;break;case"input":Mt(l,y),w=Ye(l,y),bt("invalid",l);break;case"option":w=y;break;case"select":l._wrapperState={wasMultiple:!!y.multiple},w=F({},y,{value:void 0}),bt("invalid",l);break;case"textarea":yr(l,y),w=pt(l,y),bt("invalid",l);break;default:w=y}jo(p,w),I=w;for(S in I)if(I.hasOwnProperty(S)){var z=I[S];S==="style"?va(l,z):S==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&vr(l,z)):S==="children"?typeof z=="string"?(p!=="textarea"||z!=="")&&jn(l,z):typeof z=="number"&&jn(l,""+z):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(o.hasOwnProperty(S)?z!=null&&S==="onScroll"&&bt("scroll",l):z!=null&&T(l,S,z,N))}switch(p){case"input":Fe(l),Hn(l,y,!1);break;case"textarea":Fe(l),ya(l);break;case"option":y.value!=null&&l.setAttribute("value",""+Q(y.value));break;case"select":l.multiple=!!y.multiple,S=y.value,S!=null?On(l,!!y.multiple,S,!1):y.defaultValue!=null&&On(l,!!y.multiple,y.defaultValue,!0);break;default:typeof w.onClick=="function"&&(l.onclick=Sd)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return En(c),null;case 6:if(l&&c.stateNode!=null)Hk(l,c,l.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=Mi(nu.current),Mi(ao.current),Dd(c)){if(y=c.stateNode,p=c.memoizedProps,y[io]=c,(S=y.nodeValue!==p)&&(l=ar,l!==null))switch(l.tag){case 3:Cd(y.nodeValue,p,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Cd(y.nodeValue,p,(l.mode&1)!==0)}S&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[io]=c,c.stateNode=y}return En(c),null;case 13:if(kt(Nt),y=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(_t&&lr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)qb(),Ra(),c.flags|=98560,S=!1;else if(S=Dd(c),y!==null&&y.dehydrated!==null){if(l===null){if(!S)throw Error(n(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[io]=c}else Ra(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),S=!1}else Fr!==null&&(I0(Fr),Fr=null),S=!0;if(!S)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(l!==null&&l.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(Nt.current&1)!==0?Yt===0&&(Yt=3):z0())),c.updateQueue!==null&&(c.flags|=4),En(c),null);case 4:return Pa(),S0(l,c),l===null&&Jl(c.stateNode.containerInfo),En(c),null;case 10:return Xm(c.type._context),En(c),null;case 17:return Jn(c.type)&&_d(),En(c),null;case 19:if(kt(Nt),S=c.memoizedState,S===null)return En(c),null;if(y=(c.flags&128)!==0,N=S.rendering,N===null)if(y)au(S,!1);else{if(Yt!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(N=Ld(l),N!==null){for(c.flags|=128,au(S,!1),y=N.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)S=p,l=y,S.flags&=14680066,N=S.alternate,N===null?(S.childLanes=0,S.lanes=l,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=N.childLanes,S.lanes=N.lanes,S.child=N.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=N.memoizedProps,S.memoizedState=N.memoizedState,S.updateQueue=N.updateQueue,S.type=N.type,l=N.dependencies,S.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),p=p.sibling;return yt(Nt,Nt.current&1|2),c.child}l=l.sibling}S.tail!==null&&Pt()>$a&&(c.flags|=128,y=!0,au(S,!1),c.lanes=4194304)}else{if(!y)if(l=Ld(N),l!==null){if(c.flags|=128,y=!0,p=l.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),au(S,!0),S.tail===null&&S.tailMode==="hidden"&&!N.alternate&&!_t)return En(c),null}else 2*Pt()-S.renderingStartTime>$a&&p!==1073741824&&(c.flags|=128,y=!0,au(S,!1),c.lanes=4194304);S.isBackwards?(N.sibling=c.child,c.child=N):(p=S.last,p!==null?p.sibling=N:c.child=N,S.last=N)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=Pt(),c.sibling=null,p=Nt.current,yt(Nt,y?p&1|2:p&1),c):(En(c),null);case 22:case 23:return L0(),y=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ur&1073741824)!==0&&(En(c),c.subtreeFlags&6&&(c.flags|=8192)):En(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function FM(l,c){switch(qm(c),c.tag){case 1:return Jn(c.type)&&_d(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Pa(),kt(Gn),kt(Cn),s0(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return r0(c),null;case 13:if(kt(Nt),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Ra()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return kt(Nt),null;case 4:return Pa(),null;case 10:return Xm(c.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var qd=!1,_n=!1,$M=typeof WeakSet=="function"?WeakSet:Set,ke=null;function za(l,c){var p=l.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Dt(l,c,y)}else p.current=null}function E0(l,c,p){try{p()}catch(y){Dt(l,c,y)}}var Uk=!1;function BM(l,c){if(Lm=fd,l=wb(),Am(l)){if("selectionStart"in l)var p={start:l.selectionStart,end:l.selectionEnd};else e:{p=(p=l.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var w=y.anchorOffset,S=y.focusNode;y=y.focusOffset;try{p.nodeType,S.nodeType}catch{p=null;break e}var N=0,I=-1,z=-1,U=0,ie=0,ae=l,se=null;t:for(;;){for(var ye;ae!==p||w!==0&&ae.nodeType!==3||(I=N+w),ae!==S||y!==0&&ae.nodeType!==3||(z=N+y),ae.nodeType===3&&(N+=ae.nodeValue.length),(ye=ae.firstChild)!==null;)se=ae,ae=ye;for(;;){if(ae===l)break t;if(se===p&&++U===w&&(I=N),se===S&&++ie===y&&(z=N),(ye=ae.nextSibling)!==null)break;ae=se,se=ae.parentNode}ae=ye}p=I===-1||z===-1?null:{start:I,end:z}}else p=null}p=p||{start:0,end:0}}else p=null;for(zm={focusedElem:l,selectionRange:p},fd=!1,ke=c;ke!==null;)if(c=ke,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,ke=l;else for(;ke!==null;){c=ke;try{var Se=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var _e=Se.memoizedProps,Lt=Se.memoizedState,B=c.stateNode,$=B.getSnapshotBeforeUpdate(c.elementType===c.type?_e:$r(c.type,_e),Lt);B.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var H=c.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(fe){Dt(c,c.return,fe)}if(l=c.sibling,l!==null){l.return=c.return,ke=l;break}ke=c.return}return Se=Uk,Uk=!1,Se}function lu(l,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var w=y=y.next;do{if((w.tag&l)===l){var S=w.destroy;w.destroy=void 0,S!==void 0&&E0(c,p,S)}w=w.next}while(w!==y)}}function Kd(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&l)===l){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function _0(l){var c=l.ref;if(c!==null){var p=l.stateNode;switch(l.tag){case 5:l=p;break;default:l=p}typeof c=="function"?c(l):c.current=l}}function Wk(l){var c=l.alternate;c!==null&&(l.alternate=null,Wk(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[io],delete c[Yl],delete c[Vm],delete c[CM],delete c[SM])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function qk(l){return l.tag===5||l.tag===3||l.tag===4}function Kk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||qk(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function T0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(l,c):p.insertBefore(l,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(l,p)):(c=p,c.appendChild(l)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Sd));else if(y!==4&&(l=l.child,l!==null))for(T0(l,c,p),l=l.sibling;l!==null;)T0(l,c,p),l=l.sibling}function N0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.insertBefore(l,c):p.appendChild(l);else if(y!==4&&(l=l.child,l!==null))for(N0(l,c,p),l=l.sibling;l!==null;)N0(l,c,p),l=l.sibling}var yn=null,Br=!1;function Ms(l,c,p){for(p=p.child;p!==null;)Gk(l,c,p),p=p.sibling}function Gk(l,c,p){if(so&&typeof so.onCommitFiberUnmount=="function")try{so.onCommitFiberUnmount(id,p)}catch{}switch(p.tag){case 5:_n||za(p,c);case 6:var y=yn,w=Br;yn=null,Ms(l,c,p),yn=y,Br=w,yn!==null&&(Br?(l=yn,p=p.stateNode,l.nodeType===8?l.parentNode.removeChild(p):l.removeChild(p)):yn.removeChild(p.stateNode));break;case 18:yn!==null&&(Br?(l=yn,p=p.stateNode,l.nodeType===8?Bm(l.parentNode,p):l.nodeType===1&&Bm(l,p),$l(l)):Bm(yn,p.stateNode));break;case 4:y=yn,w=Br,yn=p.stateNode.containerInfo,Br=!0,Ms(l,c,p),yn=y,Br=w;break;case 0:case 11:case 14:case 15:if(!_n&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){w=y=y.next;do{var S=w,N=S.destroy;S=S.tag,N!==void 0&&((S&2)!==0||(S&4)!==0)&&E0(p,c,N),w=w.next}while(w!==y)}Ms(l,c,p);break;case 1:if(!_n&&(za(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(I){Dt(p,c,I)}Ms(l,c,p);break;case 21:Ms(l,c,p);break;case 22:p.mode&1?(_n=(y=_n)||p.memoizedState!==null,Ms(l,c,p),_n=y):Ms(l,c,p);break;default:Ms(l,c,p)}}function Jk(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var p=l.stateNode;p===null&&(p=l.stateNode=new $M),c.forEach(function(y){var w=ZM.bind(null,l,y);p.has(y)||(p.add(y),y.then(w,w))})}}function Vr(l,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var w=p[y];try{var S=l,N=c,I=N;e:for(;I!==null;){switch(I.tag){case 5:yn=I.stateNode,Br=!1;break e;case 3:yn=I.stateNode.containerInfo,Br=!0;break e;case 4:yn=I.stateNode.containerInfo,Br=!0;break e}I=I.return}if(yn===null)throw Error(n(160));Gk(S,N,w),yn=null,Br=!1;var z=w.alternate;z!==null&&(z.return=null),w.return=null}catch(U){Dt(w,c,U)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Zk(c,l),c=c.sibling}function Zk(l,c){var p=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Vr(c,l),uo(l),y&4){try{lu(3,l,l.return),Kd(3,l)}catch(_e){Dt(l,l.return,_e)}try{lu(5,l,l.return)}catch(_e){Dt(l,l.return,_e)}}break;case 1:Vr(c,l),uo(l),y&512&&p!==null&&za(p,p.return);break;case 5:if(Vr(c,l),uo(l),y&512&&p!==null&&za(p,p.return),l.flags&32){var w=l.stateNode;try{jn(w,"")}catch(_e){Dt(l,l.return,_e)}}if(y&4&&(w=l.stateNode,w!=null)){var S=l.memoizedProps,N=p!==null?p.memoizedProps:S,I=l.type,z=l.updateQueue;if(l.updateQueue=null,z!==null)try{I==="input"&&S.type==="radio"&&S.name!=null&&zt(w,S),wi(I,N);var U=wi(I,S);for(N=0;N<z.length;N+=2){var ie=z[N],ae=z[N+1];ie==="style"?va(w,ae):ie==="dangerouslySetInnerHTML"?vr(w,ae):ie==="children"?jn(w,ae):T(w,ie,ae,U)}switch(I){case"input":qt(w,S);break;case"textarea":ki(w,S);break;case"select":var se=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var ye=S.value;ye!=null?On(w,!!S.multiple,ye,!1):se!==!!S.multiple&&(S.defaultValue!=null?On(w,!!S.multiple,S.defaultValue,!0):On(w,!!S.multiple,S.multiple?[]:"",!1))}w[Yl]=S}catch(_e){Dt(l,l.return,_e)}}break;case 6:if(Vr(c,l),uo(l),y&4){if(l.stateNode===null)throw Error(n(162));w=l.stateNode,S=l.memoizedProps;try{w.nodeValue=S}catch(_e){Dt(l,l.return,_e)}}break;case 3:if(Vr(c,l),uo(l),y&4&&p!==null&&p.memoizedState.isDehydrated)try{$l(c.containerInfo)}catch(_e){Dt(l,l.return,_e)}break;case 4:Vr(c,l),uo(l);break;case 13:Vr(c,l),uo(l),w=l.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(D0=Pt())),y&4&&Jk(l);break;case 22:if(ie=p!==null&&p.memoizedState!==null,l.mode&1?(_n=(U=_n)||ie,Vr(c,l),_n=U):Vr(c,l),uo(l),y&8192){if(U=l.memoizedState!==null,(l.stateNode.isHidden=U)&&!ie&&(l.mode&1)!==0)for(ke=l,ie=l.child;ie!==null;){for(ae=ke=ie;ke!==null;){switch(se=ke,ye=se.child,se.tag){case 0:case 11:case 14:case 15:lu(4,se,se.return);break;case 1:za(se,se.return);var Se=se.stateNode;if(typeof Se.componentWillUnmount=="function"){y=se,p=se.return;try{c=y,Se.props=c.memoizedProps,Se.state=c.memoizedState,Se.componentWillUnmount()}catch(_e){Dt(y,p,_e)}}break;case 5:za(se,se.return);break;case 22:if(se.memoizedState!==null){Qk(ae);continue}}ye!==null?(ye.return=se,ke=ye):Qk(ae)}ie=ie.sibling}e:for(ie=null,ae=l;;){if(ae.tag===5){if(ie===null){ie=ae;try{w=ae.stateNode,U?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(I=ae.stateNode,z=ae.memoizedProps.style,N=z!=null&&z.hasOwnProperty("display")?z.display:null,I.style.display=xa("display",N))}catch(_e){Dt(l,l.return,_e)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=U?"":ae.memoizedProps}catch(_e){Dt(l,l.return,_e)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===l)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===l)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===l)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Vr(c,l),uo(l),y&4&&Jk(l);break;case 21:break;default:Vr(c,l),uo(l)}}function uo(l){var c=l.flags;if(c&2){try{e:{for(var p=l.return;p!==null;){if(qk(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var w=y.stateNode;y.flags&32&&(jn(w,""),y.flags&=-33);var S=Kk(l);N0(l,S,w);break;case 3:case 4:var N=y.stateNode.containerInfo,I=Kk(l);T0(l,I,N);break;default:throw Error(n(161))}}catch(z){Dt(l,l.return,z)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function VM(l,c,p){ke=l,Yk(l)}function Yk(l,c,p){for(var y=(l.mode&1)!==0;ke!==null;){var w=ke,S=w.child;if(w.tag===22&&y){var N=w.memoizedState!==null||qd;if(!N){var I=w.alternate,z=I!==null&&I.memoizedState!==null||_n;I=qd;var U=_n;if(qd=N,(_n=z)&&!U)for(ke=w;ke!==null;)N=ke,z=N.child,N.tag===22&&N.memoizedState!==null?e2(w):z!==null?(z.return=N,ke=z):e2(w);for(;S!==null;)ke=S,Yk(S),S=S.sibling;ke=w,qd=I,_n=U}Xk(l)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,ke=S):Xk(l)}}function Xk(l){for(;ke!==null;){var c=ke;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:_n||Kd(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!_n)if(p===null)y.componentDidMount();else{var w=c.elementType===c.type?p.memoizedProps:$r(c.type,p.memoizedProps);y.componentDidUpdate(w,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var S=c.updateQueue;S!==null&&Qb(c,S,y);break;case 3:var N=c.updateQueue;if(N!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}Qb(c,N,p)}break;case 5:var I=c.stateNode;if(p===null&&c.flags&4){p=I;var z=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&p.focus();break;case"img":z.src&&(p.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var U=c.alternate;if(U!==null){var ie=U.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&$l(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||c.flags&512&&_0(c)}catch(se){Dt(c,c.return,se)}}if(c===l){ke=null;break}if(p=c.sibling,p!==null){p.return=c.return,ke=p;break}ke=c.return}}function Qk(l){for(;ke!==null;){var c=ke;if(c===l){ke=null;break}var p=c.sibling;if(p!==null){p.return=c.return,ke=p;break}ke=c.return}}function e2(l){for(;ke!==null;){var c=ke;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{Kd(4,c)}catch(z){Dt(c,p,z)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var w=c.return;try{y.componentDidMount()}catch(z){Dt(c,w,z)}}var S=c.return;try{_0(c)}catch(z){Dt(c,S,z)}break;case 5:var N=c.return;try{_0(c)}catch(z){Dt(c,N,z)}}}catch(z){Dt(c,c.return,z)}if(c===l){ke=null;break}var I=c.sibling;if(I!==null){I.return=c.return,ke=I;break}ke=c.return}}var HM=Math.ceil,Gd=A.ReactCurrentDispatcher,A0=A.ReactCurrentOwner,Sr=A.ReactCurrentBatchConfig,Xe=0,sn=null,Ft=null,xn=0,ur=0,Fa=Es(0),Yt=0,uu=null,Ri=0,Jd=0,M0=0,cu=null,Yn=null,D0=0,$a=1/0,Ho=null,Zd=!1,R0=null,Ds=null,Yd=!1,Rs=null,Xd=0,du=0,O0=null,Qd=-1,ef=0;function Pn(){return(Xe&6)!==0?Pt():Qd!==-1?Qd:Qd=Pt()}function Os(l){return(l.mode&1)===0?1:(Xe&2)!==0&&xn!==0?xn&-xn:_M.transition!==null?(ef===0&&(ef=Kv()),ef):(l=ct,l!==0||(l=window.event,l=l===void 0?16:nb(l.type)),l)}function Hr(l,c,p,y){if(50<du)throw du=0,O0=null,Error(n(185));Il(l,p,y),((Xe&2)===0||l!==sn)&&(l===sn&&((Xe&2)===0&&(Jd|=p),Yt===4&&js(l,xn)),Xn(l,y),p===1&&Xe===0&&(c.mode&1)===0&&($a=Pt()+500,Nd&&Ts()))}function Xn(l,c){var p=l.callbackNode;_A(l,c);var y=ud(l,l===sn?xn:0);if(y===0)p!==null&&Uv(p),l.callbackNode=null,l.callbackPriority=0;else if(c=y&-y,l.callbackPriority!==c){if(p!=null&&Uv(p),c===1)l.tag===0?EM(n2.bind(null,l)):Bb(n2.bind(null,l)),kM(function(){(Xe&6)===0&&Ts()}),p=null;else{switch(Gv(y)){case 1:p=fm;break;case 4:p=Wv;break;case 16:p=sd;break;case 536870912:p=qv;break;default:p=sd}p=c2(p,t2.bind(null,l))}l.callbackPriority=c,l.callbackNode=p}}function t2(l,c){if(Qd=-1,ef=0,(Xe&6)!==0)throw Error(n(327));var p=l.callbackNode;if(Ba()&&l.callbackNode!==p)return null;var y=ud(l,l===sn?xn:0);if(y===0)return null;if((y&30)!==0||(y&l.expiredLanes)!==0||c)c=tf(l,y);else{c=y;var w=Xe;Xe|=2;var S=o2();(sn!==l||xn!==c)&&(Ho=null,$a=Pt()+500,ji(l,c));do try{qM();break}catch(I){r2(l,I)}while(!0);Ym(),Gd.current=S,Xe=w,Ft!==null?c=0:(sn=null,xn=0,c=Yt)}if(c!==0){if(c===2&&(w=hm(l),w!==0&&(y=w,c=j0(l,w))),c===1)throw p=uu,ji(l,0),js(l,y),Xn(l,Pt()),p;if(c===6)js(l,y);else{if(w=l.current.alternate,(y&30)===0&&!UM(w)&&(c=tf(l,y),c===2&&(S=hm(l),S!==0&&(y=S,c=j0(l,S))),c===1))throw p=uu,ji(l,0),js(l,y),Xn(l,Pt()),p;switch(l.finishedWork=w,l.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Ii(l,Yn,Ho);break;case 3:if(js(l,y),(y&130023424)===y&&(c=D0+500-Pt(),10<c)){if(ud(l,0)!==0)break;if(w=l.suspendedLanes,(w&y)!==y){Pn(),l.pingedLanes|=l.suspendedLanes&w;break}l.timeoutHandle=$m(Ii.bind(null,l,Yn,Ho),c);break}Ii(l,Yn,Ho);break;case 4:if(js(l,y),(y&4194240)===y)break;for(c=l.eventTimes,w=-1;0<y;){var N=31-Lr(y);S=1<<N,N=c[N],N>w&&(w=N),y&=~S}if(y=w,y=Pt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*HM(y/1960))-y,10<y){l.timeoutHandle=$m(Ii.bind(null,l,Yn,Ho),y);break}Ii(l,Yn,Ho);break;case 5:Ii(l,Yn,Ho);break;default:throw Error(n(329))}}}return Xn(l,Pt()),l.callbackNode===p?t2.bind(null,l):null}function j0(l,c){var p=cu;return l.current.memoizedState.isDehydrated&&(ji(l,c).flags|=256),l=tf(l,c),l!==2&&(c=Yn,Yn=p,c!==null&&I0(c)),l}function I0(l){Yn===null?Yn=l:Yn.push.apply(Yn,l)}function UM(l){for(var c=l;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var w=p[y],S=w.getSnapshot;w=w.value;try{if(!zr(S(),w))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function js(l,c){for(c&=~M0,c&=~Jd,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var p=31-Lr(c),y=1<<p;l[p]=-1,c&=~y}}function n2(l){if((Xe&6)!==0)throw Error(n(327));Ba();var c=ud(l,0);if((c&1)===0)return Xn(l,Pt()),null;var p=tf(l,c);if(l.tag!==0&&p===2){var y=hm(l);y!==0&&(c=y,p=j0(l,y))}if(p===1)throw p=uu,ji(l,0),js(l,c),Xn(l,Pt()),p;if(p===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,Ii(l,Yn,Ho),Xn(l,Pt()),null}function P0(l,c){var p=Xe;Xe|=1;try{return l(c)}finally{Xe=p,Xe===0&&($a=Pt()+500,Nd&&Ts())}}function Oi(l){Rs!==null&&Rs.tag===0&&(Xe&6)===0&&Ba();var c=Xe;Xe|=1;var p=Sr.transition,y=ct;try{if(Sr.transition=null,ct=1,l)return l()}finally{ct=y,Sr.transition=p,Xe=c,(Xe&6)===0&&Ts()}}function L0(){ur=Fa.current,kt(Fa)}function ji(l,c){l.finishedWork=null,l.finishedLanes=0;var p=l.timeoutHandle;if(p!==-1&&(l.timeoutHandle=-1,bM(p)),Ft!==null)for(p=Ft.return;p!==null;){var y=p;switch(qm(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&_d();break;case 3:Pa(),kt(Gn),kt(Cn),s0();break;case 5:r0(y);break;case 4:Pa();break;case 13:kt(Nt);break;case 19:kt(Nt);break;case 10:Xm(y.type._context);break;case 22:case 23:L0()}p=p.return}if(sn=l,Ft=l=Is(l.current,null),xn=ur=c,Yt=0,uu=null,M0=Jd=Ri=0,Yn=cu=null,Ai!==null){for(c=0;c<Ai.length;c++)if(p=Ai[c],y=p.interleaved,y!==null){p.interleaved=null;var w=y.next,S=p.pending;if(S!==null){var N=S.next;S.next=w,y.next=N}p.pending=y}Ai=null}return l}function r2(l,c){do{var p=Ft;try{if(Ym(),zd.current=Vd,Fd){for(var y=At.memoizedState;y!==null;){var w=y.queue;w!==null&&(w.pending=null),y=y.next}Fd=!1}if(Di=0,on=Zt=At=null,ru=!1,ou=0,A0.current=null,p===null||p.return===null){Yt=1,uu=c,Ft=null;break}e:{var S=l,N=p.return,I=p,z=c;if(c=xn,I.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var U=z,ie=I,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var se=ie.alternate;se?(ie.updateQueue=se.updateQueue,ie.memoizedState=se.memoizedState,ie.lanes=se.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var ye=Nk(N);if(ye!==null){ye.flags&=-257,Ak(ye,N,I,S,c),ye.mode&1&&Tk(S,U,c),c=ye,z=U;var Se=c.updateQueue;if(Se===null){var _e=new Set;_e.add(z),c.updateQueue=_e}else Se.add(z);break e}else{if((c&1)===0){Tk(S,U,c),z0();break e}z=Error(n(426))}}else if(_t&&I.mode&1){var Lt=Nk(N);if(Lt!==null){(Lt.flags&65536)===0&&(Lt.flags|=256),Ak(Lt,N,I,S,c),Jm(La(z,I));break e}}S=z=La(z,I),Yt!==4&&(Yt=2),cu===null?cu=[S]:cu.push(S),S=N;do{switch(S.tag){case 3:S.flags|=65536,c&=-c,S.lanes|=c;var B=Ek(S,z,c);Xb(S,B);break e;case 1:I=z;var $=S.type,H=S.stateNode;if((S.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(Ds===null||!Ds.has(H)))){S.flags|=65536,c&=-c,S.lanes|=c;var fe=_k(S,I,c);Xb(S,fe);break e}}S=S.return}while(S!==null)}i2(p)}catch(Ne){c=Ne,Ft===p&&p!==null&&(Ft=p=p.return);continue}break}while(!0)}function o2(){var l=Gd.current;return Gd.current=Vd,l===null?Vd:l}function z0(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),sn===null||(Ri&268435455)===0&&(Jd&268435455)===0||js(sn,xn)}function tf(l,c){var p=Xe;Xe|=2;var y=o2();(sn!==l||xn!==c)&&(Ho=null,ji(l,c));do try{WM();break}catch(w){r2(l,w)}while(!0);if(Ym(),Xe=p,Gd.current=y,Ft!==null)throw Error(n(261));return sn=null,xn=0,Yt}function WM(){for(;Ft!==null;)s2(Ft)}function qM(){for(;Ft!==null&&!yA();)s2(Ft)}function s2(l){var c=u2(l.alternate,l,ur);l.memoizedProps=l.pendingProps,c===null?i2(l):Ft=c,A0.current=null}function i2(l){var c=l;do{var p=c.alternate;if(l=c.return,(c.flags&32768)===0){if(p=zM(p,c,ur),p!==null){Ft=p;return}}else{if(p=FM(p,c),p!==null){p.flags&=32767,Ft=p;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Yt=6,Ft=null;return}}if(c=c.sibling,c!==null){Ft=c;return}Ft=c=l}while(c!==null);Yt===0&&(Yt=5)}function Ii(l,c,p){var y=ct,w=Sr.transition;try{Sr.transition=null,ct=1,KM(l,c,p,y)}finally{Sr.transition=w,ct=y}return null}function KM(l,c,p,y){do Ba();while(Rs!==null);if((Xe&6)!==0)throw Error(n(327));p=l.finishedWork;var w=l.finishedLanes;if(p===null)return null;if(l.finishedWork=null,l.finishedLanes=0,p===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var S=p.lanes|p.childLanes;if(TA(l,S),l===sn&&(Ft=sn=null,xn=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||Yd||(Yd=!0,c2(sd,function(){return Ba(),null})),S=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||S){S=Sr.transition,Sr.transition=null;var N=ct;ct=1;var I=Xe;Xe|=4,A0.current=null,BM(l,p),Zk(p,l),hM(zm),fd=!!Lm,zm=Lm=null,l.current=p,VM(p),xA(),Xe=I,ct=N,Sr.transition=S}else l.current=p;if(Yd&&(Yd=!1,Rs=l,Xd=w),S=l.pendingLanes,S===0&&(Ds=null),kA(p.stateNode),Xn(l,Pt()),c!==null)for(y=l.onRecoverableError,p=0;p<c.length;p++)w=c[p],y(w.value,{componentStack:w.stack,digest:w.digest});if(Zd)throw Zd=!1,l=R0,R0=null,l;return(Xd&1)!==0&&l.tag!==0&&Ba(),S=l.pendingLanes,(S&1)!==0?l===O0?du++:(du=0,O0=l):du=0,Ts(),null}function Ba(){if(Rs!==null){var l=Gv(Xd),c=Sr.transition,p=ct;try{if(Sr.transition=null,ct=16>l?16:l,Rs===null)var y=!1;else{if(l=Rs,Rs=null,Xd=0,(Xe&6)!==0)throw Error(n(331));var w=Xe;for(Xe|=4,ke=l.current;ke!==null;){var S=ke,N=S.child;if((ke.flags&16)!==0){var I=S.deletions;if(I!==null){for(var z=0;z<I.length;z++){var U=I[z];for(ke=U;ke!==null;){var ie=ke;switch(ie.tag){case 0:case 11:case 15:lu(8,ie,S)}var ae=ie.child;if(ae!==null)ae.return=ie,ke=ae;else for(;ke!==null;){ie=ke;var se=ie.sibling,ye=ie.return;if(Wk(ie),ie===U){ke=null;break}if(se!==null){se.return=ye,ke=se;break}ke=ye}}}var Se=S.alternate;if(Se!==null){var _e=Se.child;if(_e!==null){Se.child=null;do{var Lt=_e.sibling;_e.sibling=null,_e=Lt}while(_e!==null)}}ke=S}}if((S.subtreeFlags&2064)!==0&&N!==null)N.return=S,ke=N;else e:for(;ke!==null;){if(S=ke,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:lu(9,S,S.return)}var B=S.sibling;if(B!==null){B.return=S.return,ke=B;break e}ke=S.return}}var $=l.current;for(ke=$;ke!==null;){N=ke;var H=N.child;if((N.subtreeFlags&2064)!==0&&H!==null)H.return=N,ke=H;else e:for(N=$;ke!==null;){if(I=ke,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:Kd(9,I)}}catch(Ne){Dt(I,I.return,Ne)}if(I===N){ke=null;break e}var fe=I.sibling;if(fe!==null){fe.return=I.return,ke=fe;break e}ke=I.return}}if(Xe=w,Ts(),so&&typeof so.onPostCommitFiberRoot=="function")try{so.onPostCommitFiberRoot(id,l)}catch{}y=!0}return y}finally{ct=p,Sr.transition=c}}return!1}function a2(l,c,p){c=La(p,c),c=Ek(l,c,1),l=As(l,c,1),c=Pn(),l!==null&&(Il(l,1,c),Xn(l,c))}function Dt(l,c,p){if(l.tag===3)a2(l,l,p);else for(;c!==null;){if(c.tag===3){a2(c,l,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ds===null||!Ds.has(y))){l=La(p,l),l=_k(c,l,1),c=As(c,l,1),l=Pn(),c!==null&&(Il(c,1,l),Xn(c,l));break}}c=c.return}}function GM(l,c,p){var y=l.pingCache;y!==null&&y.delete(c),c=Pn(),l.pingedLanes|=l.suspendedLanes&p,sn===l&&(xn&p)===p&&(Yt===4||Yt===3&&(xn&130023424)===xn&&500>Pt()-D0?ji(l,0):M0|=p),Xn(l,c)}function l2(l,c){c===0&&((l.mode&1)===0?c=1:(c=ld,ld<<=1,(ld&130023424)===0&&(ld=4194304)));var p=Pn();l=$o(l,c),l!==null&&(Il(l,c,p),Xn(l,p))}function JM(l){var c=l.memoizedState,p=0;c!==null&&(p=c.retryLane),l2(l,p)}function ZM(l,c){var p=0;switch(l.tag){case 13:var y=l.stateNode,w=l.memoizedState;w!==null&&(p=w.retryLane);break;case 19:y=l.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),l2(l,p)}var u2;u2=function(l,c,p){if(l!==null)if(l.memoizedProps!==c.pendingProps||Gn.current)Zn=!0;else{if((l.lanes&p)===0&&(c.flags&128)===0)return Zn=!1,LM(l,c,p);Zn=(l.flags&131072)!==0}else Zn=!1,_t&&(c.flags&1048576)!==0&&Vb(c,Md,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Wd(l,c),l=c.pendingProps;var w=Aa(c,Cn.current);Ia(c,p),w=l0(null,c,y,l,w,p);var S=u0();return c.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Jn(y)?(S=!0,Td(c)):S=!1,c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,t0(c),w.updater=Hd,c.stateNode=w,w._reactInternals=c,m0(c,y,l,p),c=v0(null,c,y,!0,S,p)):(c.tag=0,_t&&S&&Wm(c),In(null,c,w,p),c=c.child),c;case 16:y=c.elementType;e:{switch(Wd(l,c),l=c.pendingProps,w=y._init,y=w(y._payload),c.type=y,w=c.tag=XM(y),l=$r(y,l),w){case 0:c=x0(null,c,y,l,p);break e;case 1:c=Ik(null,c,y,l,p);break e;case 11:c=Mk(null,c,y,l,p);break e;case 14:c=Dk(null,c,y,$r(y.type,l),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:$r(y,w),x0(l,c,y,w,p);case 1:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:$r(y,w),Ik(l,c,y,w,p);case 3:e:{if(Pk(c),l===null)throw Error(n(387));y=c.pendingProps,S=c.memoizedState,w=S.element,Yb(l,c),Pd(c,y,null,p);var N=c.memoizedState;if(y=N.element,S.isDehydrated)if(S={element:y,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){w=La(Error(n(423)),c),c=Lk(l,c,y,p,w);break e}else if(y!==w){w=La(Error(n(424)),c),c=Lk(l,c,y,p,w);break e}else for(lr=Ss(c.stateNode.containerInfo.firstChild),ar=c,_t=!0,Fr=null,p=Jb(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Ra(),y===w){c=Vo(l,c,p);break e}In(l,c,y,p)}c=c.child}return c;case 5:return ek(c),l===null&&Gm(c),y=c.type,w=c.pendingProps,S=l!==null?l.memoizedProps:null,N=w.children,Fm(y,w)?N=null:S!==null&&Fm(y,S)&&(c.flags|=32),jk(l,c),In(l,c,N,p),c.child;case 6:return l===null&&Gm(c),null;case 13:return zk(l,c,p);case 4:return n0(c,c.stateNode.containerInfo),y=c.pendingProps,l===null?c.child=Oa(c,null,y,p):In(l,c,y,p),c.child;case 11:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:$r(y,w),Mk(l,c,y,w,p);case 7:return In(l,c,c.pendingProps,p),c.child;case 8:return In(l,c,c.pendingProps.children,p),c.child;case 12:return In(l,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,w=c.pendingProps,S=c.memoizedProps,N=w.value,yt(Od,y._currentValue),y._currentValue=N,S!==null)if(zr(S.value,N)){if(S.children===w.children&&!Gn.current){c=Vo(l,c,p);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var I=S.dependencies;if(I!==null){N=S.child;for(var z=I.firstContext;z!==null;){if(z.context===y){if(S.tag===1){z=Bo(-1,p&-p),z.tag=2;var U=S.updateQueue;if(U!==null){U=U.shared;var ie=U.pending;ie===null?z.next=z:(z.next=ie.next,ie.next=z),U.pending=z}}S.lanes|=p,z=S.alternate,z!==null&&(z.lanes|=p),Qm(S.return,p,c),I.lanes|=p;break}z=z.next}}else if(S.tag===10)N=S.type===c.type?null:S.child;else if(S.tag===18){if(N=S.return,N===null)throw Error(n(341));N.lanes|=p,I=N.alternate,I!==null&&(I.lanes|=p),Qm(N,p,c),N=S.sibling}else N=S.child;if(N!==null)N.return=S;else for(N=S;N!==null;){if(N===c){N=null;break}if(S=N.sibling,S!==null){S.return=N.return,N=S;break}N=N.return}S=N}In(l,c,w.children,p),c=c.child}return c;case 9:return w=c.type,y=c.pendingProps.children,Ia(c,p),w=wr(w),y=y(w),c.flags|=1,In(l,c,y,p),c.child;case 14:return y=c.type,w=$r(y,c.pendingProps),w=$r(y.type,w),Dk(l,c,y,w,p);case 15:return Rk(l,c,c.type,c.pendingProps,p);case 17:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:$r(y,w),Wd(l,c),c.tag=1,Jn(y)?(l=!0,Td(c)):l=!1,Ia(c,p),Ck(c,y,w),m0(c,y,w,p),v0(null,c,y,!0,l,p);case 19:return $k(l,c,p);case 22:return Ok(l,c,p)}throw Error(n(156,c.tag))};function c2(l,c){return Hv(l,c)}function YM(l,c,p,y){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(l,c,p,y){return new YM(l,c,p,y)}function F0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function XM(l){if(typeof l=="function")return F0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===J)return 11;if(l===ee)return 14}return 2}function Is(l,c){var p=l.alternate;return p===null?(p=Er(l.tag,c,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=c,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&14680064,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,c=l.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p}function nf(l,c,p,y,w,S){var N=2;if(y=l,typeof l=="function")F0(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case O:return Pi(p.children,w,S,c);case P:N=8,w|=8;break;case j:return l=Er(12,p,c,w|2),l.elementType=j,l.lanes=S,l;case K:return l=Er(13,p,c,w),l.elementType=K,l.lanes=S,l;case Y:return l=Er(19,p,c,w),l.elementType=Y,l.lanes=S,l;case X:return rf(p,w,S,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case W:N=10;break e;case Z:N=9;break e;case J:N=11;break e;case ee:N=14;break e;case G:N=16,y=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return c=Er(N,p,c,w),c.elementType=l,c.type=y,c.lanes=S,c}function Pi(l,c,p,y){return l=Er(7,l,y,c),l.lanes=p,l}function rf(l,c,p,y){return l=Er(22,l,y,c),l.elementType=X,l.lanes=p,l.stateNode={isHidden:!1},l}function $0(l,c,p){return l=Er(6,l,null,c),l.lanes=p,l}function B0(l,c,p){return c=Er(4,l.children!==null?l.children:[],l.key,c),c.lanes=p,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function QM(l,c,p,y,w){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pm(0),this.expirationTimes=pm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pm(0),this.identifierPrefix=y,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function V0(l,c,p,y,w,S,N,I,z){return l=new QM(l,c,p,I,z),c===1?(c=1,S===!0&&(c|=8)):c=0,S=Er(3,null,null,c),l.current=S,S.stateNode=l,S.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},t0(S),l}function e5(l,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:y==null?null:""+y,children:l,containerInfo:c,implementation:p}}function d2(l){if(!l)return _s;l=l._reactInternals;e:{if(Si(l)!==l||l.tag!==1)throw Error(n(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Jn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(l.tag===1){var p=l.type;if(Jn(p))return Fb(l,p,c)}return c}function f2(l,c,p,y,w,S,N,I,z){return l=V0(p,y,!0,l,w,S,N,I,z),l.context=d2(null),p=l.current,y=Pn(),w=Os(p),S=Bo(y,w),S.callback=c??null,As(p,S,w),l.current.lanes=w,Il(l,w,y),Xn(l,y),l}function of(l,c,p,y){var w=c.current,S=Pn(),N=Os(w);return p=d2(p),c.context===null?c.context=p:c.pendingContext=p,c=Bo(S,N),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=As(w,c,N),l!==null&&(Hr(l,w,N,S),Id(l,w,N)),N}function sf(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function h2(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p<c?p:c}}function H0(l,c){h2(l,c),(l=l.alternate)&&h2(l,c)}function t5(){return null}var p2=typeof reportError=="function"?reportError:function(l){console.error(l)};function U0(l){this._internalRoot=l}af.prototype.render=U0.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(n(409));of(l,c,null,null)},af.prototype.unmount=U0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;Oi(function(){of(null,l,null,null)}),c[Po]=null}};function af(l){this._internalRoot=l}af.prototype.unstable_scheduleHydration=function(l){if(l){var c=Yv();l={blockedOn:null,target:l,priority:c};for(var p=0;p<ks.length&&c!==0&&c<ks[p].priority;p++);ks.splice(p,0,l),p===0&&eb(l)}};function W0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function lf(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function m2(){}function n5(l,c,p,y,w){if(w){if(typeof y=="function"){var S=y;y=function(){var U=sf(N);S.call(U)}}var N=f2(c,y,l,0,null,!1,!1,"",m2);return l._reactRootContainer=N,l[Po]=N.current,Jl(l.nodeType===8?l.parentNode:l),Oi(),N}for(;w=l.lastChild;)l.removeChild(w);if(typeof y=="function"){var I=y;y=function(){var U=sf(z);I.call(U)}}var z=V0(l,0,!1,null,null,!1,!1,"",m2);return l._reactRootContainer=z,l[Po]=z.current,Jl(l.nodeType===8?l.parentNode:l),Oi(function(){of(c,z,p,y)}),z}function uf(l,c,p,y,w){var S=p._reactRootContainer;if(S){var N=S;if(typeof w=="function"){var I=w;w=function(){var z=sf(N);I.call(z)}}of(c,N,l,w)}else N=n5(p,c,l,w,y);return sf(N)}Jv=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var p=jl(c.pendingLanes);p!==0&&(mm(c,p|1),Xn(c,Pt()),(Xe&6)===0&&($a=Pt()+500,Ts()))}break;case 13:Oi(function(){var y=$o(l,1);if(y!==null){var w=Pn();Hr(y,l,1,w)}}),H0(l,1)}},gm=function(l){if(l.tag===13){var c=$o(l,134217728);if(c!==null){var p=Pn();Hr(c,l,134217728,p)}H0(l,134217728)}},Zv=function(l){if(l.tag===13){var c=Os(l),p=$o(l,c);if(p!==null){var y=Pn();Hr(p,l,c,y)}H0(l,c)}},Yv=function(){return ct},Xv=function(l,c){var p=ct;try{return ct=l,c()}finally{ct=p}},Ci=function(l,c,p){switch(c){case"input":if(qt(l,p),c=p.name,p.type==="radio"&&c!=null){for(p=l;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==l&&y.form===l.form){var w=Ed(y);if(!w)throw Error(n(90));Oe(y),qt(y,w)}}}break;case"textarea":ki(l,p);break;case"select":c=p.value,c!=null&&On(l,!!p.multiple,c,!1)}},tt=P0,at=Oi;var r5={usingClientEntryPoint:!1,Events:[Xl,Ta,Ed,Me,it,P0]},fu={findFiberByHostInstance:Ei,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o5={bundleType:fu.bundleType,version:fu.version,rendererPackageName:fu.rendererPackageName,rendererConfig:fu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Bv(l),l===null?null:l.stateNode},findFiberByHostInstance:fu.findFiberByHostInstance||t5,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cf.isDisabled&&cf.supportsFiber)try{id=cf.inject(o5),so=cf}catch{}}return Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r5,Qn.createPortal=function(l,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!W0(c))throw Error(n(200));return e5(l,c,null,p)},Qn.createRoot=function(l,c){if(!W0(l))throw Error(n(299));var p=!1,y="",w=p2;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),c=V0(l,1,!1,null,null,p,!1,y,w),l[Po]=c.current,Jl(l.nodeType===8?l.parentNode:l),new U0(c)},Qn.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Bv(c),l=l===null?null:l.stateNode,l},Qn.flushSync=function(l){return Oi(l)},Qn.hydrate=function(l,c,p){if(!lf(c))throw Error(n(200));return uf(null,l,c,!0,p)},Qn.hydrateRoot=function(l,c,p){if(!W0(l))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,w=!1,S="",N=p2;if(p!=null&&(p.unstable_strictMode===!0&&(w=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onRecoverableError!==void 0&&(N=p.onRecoverableError)),c=f2(c,null,l,1,p??null,w,!1,S,N),l[Po]=c.current,Jl(l),y)for(l=0;l<y.length;l++)p=y[l],w=p._getVersion,w=w(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,w]:c.mutableSourceEagerHydrationData.push(p,w);return new af(c)},Qn.render=function(l,c,p){if(!lf(c))throw Error(n(200));return uf(null,l,c,!1,p)},Qn.unmountComponentAtNode=function(l){if(!lf(l))throw Error(n(40));return l._reactRootContainer?(Oi(function(){uf(null,null,l,!1,function(){l._reactRootContainer=null,l[Po]=null})}),!0):!1},Qn.unstable_batchedUpdates=P0,Qn.unstable_renderSubtreeIntoContainer=function(l,c,p,y){if(!lf(p))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return uf(l,c,p,!1,y)},Qn.version="18.3.1-next-f1338f8080-20240426",Qn}var _2;function e3(){if(_2)return J0.exports;_2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),J0.exports=f5(),J0.exports}var T2;function h5(){if(T2)return df;T2=1;var t=e3();return df.createRoot=t.createRoot,df.hydrateRoot=t.hydrateRoot,df}var p5=h5();function t3(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=t3(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function n3(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=t3(t))&&(r&&(r+=" "),r+=e);return r}const N2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,A2=n3,r3=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return A2(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=e,i=Object.keys(o).map(d=>{const h=n==null?void 0:n[d],f=s==null?void 0:s[d];if(h===null)return null;const g=N2(h)||N2(f);return o[d][g]}),a=n&&Object.entries(n).reduce((d,h)=>{let[f,g]=h;return g===void 0||(d[f]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:f,className:g,...x}=h;return Object.entries(x).every(v=>{let[b,k]=v;return Array.isArray(k)?k.includes({...s,...a}[b]):{...s,...a}[b]===k})?[...d,f,g]:d},[]);return A2(t,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};var Kr=e3();const o3=Py(Kr);var m5=Object.defineProperty,Ly=(t,e)=>m5(t,"name",{value:e,configurable:!0});function p1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ly(p1,"setRef");function s3(...t){return e=>{let n=!1;const r=t.map(o=>{const s=p1(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():p1(t[o],null)}}}}Ly(s3,"composeRefs");function ot(...t){return C.useCallback(s3(...t),t)}Ly(ot,"useComposedRefs");var g5=Object.defineProperty,eo=(t,e)=>g5(t,"name",{value:e,configurable:!0});function Eo(t){const e=C.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const u=[];m1(o)&&typeof ff=="function"&&(o=ff(o._payload)),C.Children.forEach(o,g=>{var x;if(d3(g)){a=!0;const v=g;let b="child"in v.props?v.props.child:v.props.children;m1(b)&&typeof ff=="function"&&(b=ff(b._payload)),i=y5(v,b),u.push((x=i==null?void 0:i.props)==null?void 0:x.children)}else u.push(g)}),i?i=C.cloneElement(i,void 0,u):!a&&C.Children.count(o)===1&&C.isValidElement(o)&&(i=o);const d=i?c3(i):void 0,h=ot(r,d);if(!i){if(o||o===0)throw new Error(a?b5(t):v5(t));return o}const f=u3(s,i.props??{});return i.type!==C.Fragment&&(f.ref=r?h:d),C.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}eo(Eo,"createSlot");var i3=Eo("Slot"),a3=Symbol.for("radix.slottable");function l3(t){const e=eo(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=a3,e}eo(l3,"createSlottable");var y5=eo((t,e)=>{if("child"in t.props){const n=t.props.child;return C.isValidElement(n)?C.cloneElement(n,void 0,t.props.children(n.props.children)):null}return C.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function u3(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}eo(u3,"mergeProps");function c3(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}eo(c3,"getElementRef");function d3(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===a3}eo(d3,"isSlottable");var x5=Symbol.for("react.lazy");function m1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===x5&&"_payload"in t&&f3(t._payload)}eo(m1,"isLazyComponent");function f3(t){return typeof t=="object"&&t!==null&&"then"in t}eo(f3,"isPromiseLike");var v5=eo(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),b5=eo(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ff=kl[" use ".trim().toString()],k5=Object.defineProperty,w5=(t,e)=>k5(t,"name",{value:e,configurable:!0}),C5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=C5.reduce((t,e)=>{const n=Eo(`Primitive.${e}`),r=C.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function zy(t,e){t&&Kr.flushSync(()=>t.dispatchEvent(e))}w5(zy,"dispatchDiscreteCustomEvent");var S5=Object.defineProperty,E5=(t,e)=>S5(t,"name",{value:e,configurable:!0}),h3=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_5=C.forwardRef(E5(function(e,n){return m.jsx(st.span,{...e,ref:n,style:{...h3,...e.style}})},"VisuallyHidden")),T5=_5,N5=Object.defineProperty,Mr=(t,e)=>N5(t,"name",{value:e,configurable:!0});function A5(t,e){const n=C.createContext(e);n.displayName=t+"Context";const r=Mr(s=>{const{children:i,...a}=s,u=C.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,u=C.useContext(n);if(u)return u;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return Mr(o,"useContext"),[r,o]}Mr(A5,"createContext");function Ao(t,e=[]){let n=[];function r(s,i){const a=C.createContext(i);a.displayName=s+"Context";const u=n.length;n=[...n,i];const d=Mr(f=>{var E;const{scope:g,children:x,...v}=f,b=((E=g==null?void 0:g[t])==null?void 0:E[u])||a,k=C.useMemo(()=>v,Object.values(v));return m.jsx(b.Provider,{value:k,children:x})},"Provider");d.displayName=s+"Provider";function h(f,g,x={}){var E;const{optional:v=!1}=x,b=((E=g==null?void 0:g[t])==null?void 0:E[u])||a,k=C.useContext(b);if(k)return k;if(i!==void 0)return i;if(!v)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Mr(h,"useContext"),[d,h]}Mr(r,"createContext");const o=Mr(()=>{const s=n.map(i=>C.createContext(i));return Mr(function(a){const u=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:u}}),[a,u])},"useScope")},"createScope");return o.scopeName=t,[r,p3(o,...e)]}Mr(Ao,"createContextScope");function p3(...t){const e=t[0];if(t.length===1)return e;const n=Mr(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return Mr(function(s){const i=r.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Mr(p3,"composeContextScopes");var M5=Object.defineProperty,dn=(t,e)=>M5(t,"name",{value:e,configurable:!0});function fp(t){const e=t+"CollectionProvider",[n,r]=Ao(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=dn(b=>{const{scope:k,children:E}=b,_=C.useRef(null),T=C.useRef(new Map).current;return m.jsx(o,{scope:k,itemMap:T,collectionRef:_,children:E})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",u=Eo(a),d=C.forwardRef((b,k)=>{const{scope:E,children:_}=b,T=s(a,E),A=ot(k,T.collectionRef);return m.jsx(u,{ref:A,children:_})});d.displayName=a;const h=t+"CollectionItemSlot",f="data-radix-collection-item",g=Eo(h),x=C.forwardRef((b,k)=>{const{scope:E,children:_,...T}=b,A=C.useRef(null),D=ot(k,A),R=s(h,E);return C.useEffect(()=>(R.itemMap.set(A,{ref:A,...T}),()=>void R.itemMap.delete(A))),m.jsx(g,{[f]:"",ref:D,children:_})});x.displayName=h;function v(b){const k=s(t+"CollectionConsumer",b);return C.useCallback(()=>{const _=k.collectionRef.current;if(!_)return[];const T=Array.from(_.querySelectorAll(`[${f}]`));return Array.from(k.itemMap.values()).sort((R,O)=>T.indexOf(R.ref.current)-T.indexOf(O.ref.current))},[k.collectionRef,k.itemMap])}return dn(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:x},v,r]}dn(fp,"createCollection");var M2=new WeakMap,$t,cr,X0=(cr=class extends Map{constructor(n){super(n);x2(this,$t);q0(this,$t,[...super.keys()]),M2.set(this,!0)}set(n,r){return M2.get(this)&&(this.has(n)?Tn(this,$t)[Tn(this,$t).indexOf(n)]=n:Tn(this,$t).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Tn(this,$t).length,a=Fy(n);let u=a>=0?a:i+a;const d=u<0||u>=i?-1:u;if(d===this.size||s&&d===this.size-1||d===-1)return this.set(r,o),this;const h=this.size+(s?0:1);a<0&&u++;const f=[...Tn(this,$t)];let g,x=!1;for(let v=u;v<h;v++)if(u===v){let b=f[v];f[v]===r&&(b=f[v+1]),s&&this.delete(r),g=this.get(b),this.set(r,o)}else{!x&&f[v-1]===r&&(x=!0);const b=f[x?v:v-1],k=g;g=this.get(b),this.delete(b),this.set(b,k)}return this}with(n,r,o){const s=new cr(this);return s.insert(n,r,o),s}before(n){const r=Tn(this,$t).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Tn(this,$t).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Tn(this,$t).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Tn(this,$t).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return q0(this,$t,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Tn(this,$t).splice(Tn(this,$t).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Wf(Tn(this,$t),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Wf(Tn(this,$t),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Tn(this,$t).indexOf(n)}keyAt(n){return Wf(Tn(this,$t),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new cr(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new cr(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new cr(r)}toReversed(){const n=new cr;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new cr(r)}slice(n,r){const o=new cr;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),u=this.get(a);o.set(a,u)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},$t=new WeakMap,dn(cr,"OrderedDict"),cr);function Wf(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=m3(t,e);return n===-1?void 0:t[n]}dn(Wf,"at");function m3(t,e){const n=t.length,r=Fy(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}dn(m3,"toSafeIndex");function Fy(t){return t!==t||t===0?0:Math.trunc(t)}dn(Fy,"toSafeInteger");function D5(t){const e=t+"CollectionProvider",[n,r]=Ao(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new X0,setItemMap:dn(()=>{},"setItemMap")}),i=dn(({state:T,...A})=>T?m.jsx(u,{...A,state:T}):m.jsx(a,{...A}),"CollectionProvider");i.displayName=e;const a=dn(T=>{const A=k();return m.jsx(u,{...T,state:A})},"CollectionInit");a.displayName=e+"Init";const u=dn(T=>{const{scope:A,children:D,state:R}=T,O=C.useRef(null),[P,j]=C.useState(null),W=ot(O,j),[Z,J]=R;return C.useEffect(()=>{if(!P)return;const K=x3(()=>{});return K.observe(P,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[P]),m.jsx(o,{scope:A,itemMap:Z,setItemMap:J,collectionRef:W,collectionRefObject:O,collectionElement:P,children:D})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",h=Eo(d),f=C.forwardRef((T,A)=>{const{scope:D,children:R}=T,O=s(d,D),P=ot(A,O.collectionRef);return m.jsx(h,{ref:P,children:R})});f.displayName=d;const g=t+"CollectionItemSlot",x="data-radix-collection-item",v=Eo(g),b=C.forwardRef((T,A)=>{const{scope:D,children:R,...O}=T,P=C.useRef(null),[j,W]=C.useState(null),Z=ot(A,P,W),J=s(g,D),{setItemMap:K}=J,Y=C.useRef(O);g3(Y.current,O)||(Y.current=O);const ee=Y.current;return C.useEffect(()=>{const G=ee;return K(X=>j?X.has(j)?X.set(j,{...G,element:j}).toSorted(g1):(X.set(j,{...G,element:j}),X.toSorted(g1)):X),()=>{K(X=>!j||!X.has(j)?X:(X.delete(j),new X0(X)))}},[j,ee,K]),m.jsx(v,{[x]:"",ref:Z,children:R})});b.displayName=g;function k(){return C.useState(new X0)}dn(k,"useInitCollection");function E(T){const{itemMap:A}=s(t+"CollectionConsumer",T);return A}return dn(E,"useCollection"),[{Provider:i,Slot:f,ItemSlot:b},{createCollectionScope:r,useCollection:E,useInitCollection:k}]}dn(D5,"createCollection");function g3(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}dn(g3,"shallowEqual");function y3(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}dn(y3,"isElementPreceding");function g1(t,e){return!t[1].element||!e[1].element?0:y3(t[1].element,e[1].element)?-1:1}dn(g1,"sortByDocumentPosition");function x3(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}dn(x3,"getChildListObserver");var R5=Object.defineProperty,wl=(t,e)=>R5(t,"name",{value:e,configurable:!0}),v3=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(t,e,{checkForDefaultPrevented:n=!0}={}){return wl(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}wl(je,"composeEventHandlers");function O5(t){var e;if(!v3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}wl(O5,"getOwnerWindow");function y1(t){if(!v3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}wl(y1,"getOwnerDocument");function b3(t,e=!1){const{activeElement:n}=y1(t);if(!(n!=null&&n.nodeName))return null;if(k3(n)&&n.contentDocument)return b3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=y1(n).getElementById(r);if(o)return o}}return n}wl(b3,"getActiveElement");function k3(t){return t.tagName==="IFRAME"}wl(k3,"isFrame");var It=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},j5=Object.defineProperty,I5=(t,e)=>j5(t,"name",{value:e,configurable:!0}),D2=kl[" useEffectEvent ".trim().toString()],R2=kl[" useInsertionEffect ".trim().toString()];function w3(t){if(typeof D2=="function")return D2(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof R2=="function"?R2(()=>{e.current=t}):It(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}I5(w3,"useEffectEvent");var P5=Object.defineProperty,Ac=(t,e)=>P5(t,"name",{value:e,configurable:!0}),L5=kl[" useInsertionEffect ".trim().toString()]||It;function Qi({prop:t,defaultProp:e,onChange:n=Ac(()=>{},"onChange"),caller:r}){const[o,s,i]=C3({defaultProp:e,onChange:n}),a=t!==void 0,u=a?t:o,d=C.useCallback(h=>{var f;if(a){const g=S3(h)?h(t):h;g!==t&&((f=i.current)==null||f.call(i,g))}else s(h)},[a,t,s,i]);return[u,d]}Ac(Qi,"useControllableState");function C3({defaultProp:t,onChange:e}){const[n,r]=C.useState(t),o=C.useRef(n),s=C.useRef(e);return L5(()=>{s.current=e},[e]),C.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}Ac(C3,"useUncontrolledState");function S3(t){return typeof t=="function"}Ac(S3,"isFunction");var O2=Symbol("RADIX:SYNC_STATE");function z5(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,u=o!==void 0,d=w3(i),h=[{...n,state:s}];r&&h.push(r);const[f,g]=C.useReducer((k,E)=>{if(E.type===O2)return{...k,state:E.state};const _=t(k,E);return u&&!Object.is(_.state,k.state)&&d(_.state),_},...h),x=f.state,v=C.useRef(x);C.useEffect(()=>{v.current!==x&&(v.current=x,u||d(x))},[x,v,u]);const b=C.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return C.useEffect(()=>{u&&!Object.is(o,f.state)&&g({type:O2,state:o})},[o,f.state,u]),[b,g]}Ac(z5,"useControllableStateReducer");var F5=Object.defineProperty,ls=(t,e)=>F5(t,"name",{value:e,configurable:!0});function E3(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}ls(E3,"useStateMachine");var fs=ls(t=>{const{present:e,children:n}=t,r=_3(e),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=T3(r.ref,N3(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null},"Presence");function _3(t){const[e,n]=C.useState(),r=C.useRef(null),o=C.useRef(t),s=C.useRef("none"),i=C.useRef(void 0),a=t?"mounted":"unmounted",[u,d]=E3(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{u==="mounted"?(s.current=i.current??Ga(r.current),i.current=void 0):s.current="none"},[u]),It(()=>{const h=r.current,f=o.current;if(f!==t){const x=s.current,v=Ga(h);t?(i.current=v,d("MOUNT")):v==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(f&&x!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),It(()=>{if(e){let h;const f=e.ownerDocument.defaultView??window,g=ls(v=>{const k=Ga(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&k&&(d("ANIMATION_END"),!o.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),x=ls(v=>{v.target===e&&(s.current=Ga(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{f.clearTimeout(h),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(h=>{if(h){const f=getComputedStyle(h);r.current=f,i.current=Ga(f)}else r.current=null;n(h)},[])}}ls(_3,"usePresence");function x1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ls(x1,"setRef");function T3(...t){const e=C.useRef(t);return e.current=t,C.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=x1(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():x1(r[i],null)}}},[])}ls(T3,"useStableComposedRefs");function Ga(t){return(t==null?void 0:t.animationName)||"none"}ls(Ga,"getAnimationName");function N3(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ls(N3,"getElementRef");var $5=Object.defineProperty,B5=(t,e)=>$5(t,"name",{value:e,configurable:!0}),V5=kl[" useId ".trim().toString()]||(()=>{}),H5=0;function Co(t){const[e,n]=C.useState(V5());return It(()=>{t||n(r=>r??String(H5++))},[t]),t||(e?`radix-${e}`:"")}B5(Co,"useId");var U5=Object.defineProperty,W5=(t,e)=>U5(t,"name",{value:e,configurable:!0}),q5=C.createContext(void 0);function hp(t){const e=C.useContext(q5);return t||e||"ltr"}W5(hp,"useDirection");var K5=Object.defineProperty,G5=(t,e)=>K5(t,"name",{value:e,configurable:!0});function jr(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}G5(jr,"useCallbackRef");var J5=Object.defineProperty,cn=(t,e)=>J5(t,"name",{value:e,configurable:!0}),v1="dismissableLayer.update",Z5="dismissableLayer.pointerDownOutside",Y5="dismissableLayer.focusOutside",j2,A3=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pp=C.forwardRef(cn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:u,onDismiss:d,...h}=e,f=C.useContext(A3),[g,x]=C.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=C.useState({}),k=ot(n,x),E=Array.from(f.layers),[_]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),T=_?E.indexOf(_):-1,A=g?E.indexOf(g):-1,D=f.layersWithOutsidePointerEventsDisabled.size>0,R=A>=T,O=C.useRef(!1),P=D3(J=>{i==null||i(J),u==null||u(J),J.defaultPrevented||d==null||d()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(J=>{if(!(J instanceof Node))return!1;const K=[...f.branches].some(Y=>Y.contains(J));return R&&!K},[f.branches,R])}),j=R3(J=>{if(o&&O.current)return;const K=J.target;[...f.branches].some(ee=>ee.contains(K))||(a==null||a(J),u==null||u(J),J.defaultPrevented||d==null||d())},v),W=g?A===E.length-1:!1,Z=jr(J=>{J.key==="Escape"&&(s==null||s(J),!J.defaultPrevented&&d&&(J.preventDefault(),d()))});return C.useEffect(()=>{if(W)return v.addEventListener("keydown",Z,{capture:!0}),()=>v.removeEventListener("keydown",Z,{capture:!0})},[v,W,Z]),C.useEffect(()=>{if(g)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(j2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),b1(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(g),f.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=j2))}},[g,v,r,f]),C.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),b1())},[g,f]),C.useEffect(()=>{const J=cn(()=>b({}),"handleUpdate");return document.addEventListener(v1,J),()=>document.removeEventListener(v1,J)},[]),m.jsx(st.div,{...h,ref:k,style:{pointerEvents:D?R?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,j.onFocusCapture),onBlurCapture:je(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function M3(){const t=C.useContext(A3),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}cn(M3,"useDismissableLayerSurface");var X5=cn(()=>!0,"IS_TRUE");function D3(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=X5}=e,a=jr(t),u=C.useRef(!1),d=C.useRef(!1),h=C.useRef(new Map),f=C.useRef(()=>{});return C.useEffect(()=>{function g(){d.current=!1,o.current=!1,h.current.clear()}cn(g,"resetOutsideInteraction");function x(){return Array.from(h.current.values()).some(Boolean)}cn(x,"isOutsideInteractionIntercepted");function v(T){if(!d.current)return;const A=T.target;A instanceof Node&&[...s].some(R=>R.contains(A))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&f.current()},0)}cn(v,"handleInteractionCapture");function b(T){d.current&&h.current.set(T.type,!1)}cn(b,"handleInteractionBubble");const k=cn(T=>{if(T.target&&!u.current){let A=function(){n.removeEventListener("click",f.current);const R=x();g(),R||$y(Z5,a,D,{discrete:!0})};if(cn(A,"handleAndDispatchPointerDownOutsideEvent"),!i(T.target)){n.removeEventListener("click",f.current),g(),u.current=!1;return}const D={originalEvent:T};d.current=!0,o.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?A():(n.removeEventListener("click",f.current),f.current=A,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),g();u.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)n.addEventListener(T,v,!0),n.addEventListener(T,b);const _=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(_),n.removeEventListener("pointerdown",k),n.removeEventListener("click",f.current);for(const T of E)n.removeEventListener(T,v,!0),n.removeEventListener(T,b)}},[n,a,r,o,s,i]),{onPointerDownCapture:cn(()=>u.current=!0,"onPointerDownCapture")}}cn(D3,"usePointerDownOutside");function R3(t,e=globalThis==null?void 0:globalThis.document){const n=jr(t),r=C.useRef(!1);return C.useEffect(()=>{const o=cn(s=>{s.target&&!r.current&&$y(Y5,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:cn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:cn(()=>r.current=!1,"onBlurCapture")}}cn(R3,"useFocusOutside");function b1(){const t=new CustomEvent(v1);document.dispatchEvent(t)}cn(b1,"dispatchUpdate");function $y(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?zy(o,s):o.dispatchEvent(s)}cn($y,"handleAndDispatchCustomEvent");var Q5=Object.defineProperty,zn=(t,e)=>Q5(t,"name",{value:e,configurable:!0}),Q0="focusScope.autoFocusOnMount",eg="focusScope.autoFocusOnUnmount",I2={bubbles:!1,cancelable:!0},By=C.forwardRef(zn(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[u,d]=C.useState(null),h=jr(s),f=jr(i),g=C.useRef(null),x=ot(n,d),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(o){let k=function(A){if(v.paused||!u)return;const D=A.target;u.contains(D)?g.current=D:Zo(g.current,{select:!0})},E=function(A){if(v.paused||!u)return;const D=A.relatedTarget;D!==null&&(u.contains(D)||Zo(g.current,{select:!0}))},_=function(A){if(document.activeElement===document.body)for(const R of A)R.removedNodes.length>0&&Zo(u)};zn(k,"handleFocusIn"),zn(E,"handleFocusOut"),zn(_,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",E);const T=new MutationObserver(_);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",E),T.disconnect()}}},[o,u,v.paused]),C.useEffect(()=>{if(u){P2.add(v);const k=document.activeElement;if(!u.contains(k)){const _=new CustomEvent(Q0,I2);u.addEventListener(Q0,h),u.dispatchEvent(_),_.defaultPrevented||(O3(z3(Vy(u)),{select:!0}),document.activeElement===k&&Zo(u))}return()=>{u.removeEventListener(Q0,h),setTimeout(()=>{const _=new CustomEvent(eg,I2);u.addEventListener(eg,f),u.dispatchEvent(_),_.defaultPrevented||Zo(k??document.body,{select:!0}),u.removeEventListener(eg,f),P2.remove(v)},0)}}},[u,h,f,v]);const b=C.useCallback(k=>{if(!r&&!o||v.paused)return;const E=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,_=document.activeElement;if(E&&_){const T=k.currentTarget,[A,D]=j3(T);A&&D?!k.shiftKey&&_===D?(k.preventDefault(),r&&Zo(A,{select:!0})):k.shiftKey&&_===A&&(k.preventDefault(),r&&Zo(D,{select:!0})):_===T&&k.preventDefault()}},[r,o,v.paused]);return m.jsx(st.div,{tabIndex:-1,...a,ref:x,onKeyDown:b})},"FocusScope"));function O3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Zo(r,{select:e}),document.activeElement!==n)return}zn(O3,"focusFirst");function j3(t){const e=Vy(t),n=k1(e,t),r=k1(e.reverse(),t);return[n,r]}zn(j3,"getTabbableEdges");function Vy(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:zn(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},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}zn(Vy,"getTabbableCandidates");function k1(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):I3(r,{upTo:e})))return r}zn(k1,"findVisible");function I3(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}zn(I3,"isHidden");function P3(t){return t instanceof HTMLInputElement&&"select"in t}zn(P3,"isSelectableInput");function Zo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&P3(t)&&e&&t.select()}}zn(Zo,"focus");var P2=L3();function L3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=w1(t,e),t.unshift(e)},remove(e){var n;t=w1(t,e),(n=t[0])==null||n.resume()}}}zn(L3,"createFocusScopesStack");function w1(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}zn(w1,"arrayRemove");function z3(t){return t.filter(e=>e.tagName!=="A")}zn(z3,"removeLinks");var eD=Object.defineProperty,tD=(t,e)=>eD(t,"name",{value:e,configurable:!0}),mp=C.forwardRef(tD(function(e,n){var u;const{container:r,...o}=e,[s,i]=C.useState(!1);It(()=>i(!0),[]);const a=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?Kr.createPortal(m.jsx(st.div,{...o,ref:n}),a):null},"Portal")),nD=Object.defineProperty,Hy=(t,e)=>nD(t,"name",{value:e,configurable:!0}),hf=0,co=null;function rD(t){return Mc(),t.children}Hy(rD,"FocusGuards");function Mc(){C.useEffect(()=>{co||(co={start:C1(),end:C1()});const{start:t,end:e}=co;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),hf++,()=>{hf===1&&(co==null||co.start.remove(),co==null||co.end.remove(),co=null),hf=Math.max(0,hf-1)}},[])}Hy(Mc,"useFocusGuards");function C1(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Hy(C1,"createFocusGuard");var xo=function(){return xo=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},xo.apply(this,arguments)};function F3(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 oD(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var qf="right-scroll-bar-position",Kf="width-before-scroll-bar",sD="with-scroll-bars-hidden",iD="--removed-body-scroll-bar-size";function tg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function aD(t,e){var n=C.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 lD=typeof window<"u"?C.useLayoutEffect:C.useEffect,L2=new WeakMap;function uD(t,e){var n=aD(null,function(r){return t.forEach(function(o){return tg(o,r)})});return lD(function(){var r=L2.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||tg(a,null)}),s.forEach(function(a){o.has(a)||tg(a,i)})}L2.set(n,t)},[t]),n}function cD(t){return t}function dD(t,e){e===void 0&&(e=cD);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(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var h=i;i=[],h.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){i.push(h),d()},filter:function(h){return i=i.filter(h),n}}}};return o}function fD(t){t===void 0&&(t={});var e=dD(null);return e.options=xo({async:!0,ssr:!1},t),e}var $3=function(t){var e=t.sideCar,n=F3(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 C.createElement(r,xo({},n))};$3.isSideCarExport=!0;function hD(t,e){return t.useMedium(e),$3}var B3=fD(),ng=function(){},gp=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:ng,onWheelCapture:ng,onTouchMoveCapture:ng}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,u=t.className,d=t.removeScrollBar,h=t.enabled,f=t.shards,g=t.sideCar,x=t.noRelative,v=t.noIsolation,b=t.inert,k=t.allowPinchZoom,E=t.as,_=E===void 0?"div":E,T=t.gapMode,A=F3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=g,R=uD([n,e]),O=xo(xo({},A),o);return C.createElement(C.Fragment,null,h&&C.createElement(D,{sideCar:B3,removeScrollBar:d,shards:f,noRelative:x,noIsolation:v,inert:b,setCallbacks:s,allowPinchZoom:!!k,lockRef:n,gapMode:T}),i?C.cloneElement(C.Children.only(a),xo(xo({},O),{ref:R})):C.createElement(_,xo({},O,{className:u,ref:R}),a))});gp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gp.classNames={fullWidth:Kf,zeroRight:qf};var pD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=pD();return e&&t.setAttribute("nonce",e),t}function gD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function yD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=mD())&&(gD(e,n),yD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},vD=function(){var t=xD();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},V3=function(){var t=vD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},bD={left:0,top:0,right:0,gap:0},rg=function(t){return parseInt(t||"",10)||0},kD=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[rg(n),rg(r),rg(o)]},wD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return bD;var e=kD(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])}},CD=V3(),Qa="data-scroll-locked",SD=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
41
+ .`.concat(sD,` {
42
+ overflow: hidden `).concat(r,`;
43
+ padding-right: `).concat(a,"px ").concat(r,`;
44
+ }
45
+ body[`).concat(Qa,`] {
46
+ overflow: hidden `).concat(r,`;
47
+ overscroll-behavior: contain;
48
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
49
+ padding-left: `.concat(o,`px;
50
+ padding-top: `).concat(s,`px;
51
+ padding-right: `).concat(i,`px;
52
+ margin-left:0;
53
+ margin-top:0;
54
+ margin-right: `).concat(a,"px ").concat(r,`;
55
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
56
+ }
57
+
58
+ .`).concat(qf,` {
59
+ right: `).concat(a,"px ").concat(r,`;
60
+ }
61
+
62
+ .`).concat(Kf,` {
63
+ margin-right: `).concat(a,"px ").concat(r,`;
64
+ }
65
+
66
+ .`).concat(qf," .").concat(qf,` {
67
+ right: 0 `).concat(r,`;
68
+ }
69
+
70
+ .`).concat(Kf," .").concat(Kf,` {
71
+ margin-right: 0 `).concat(r,`;
72
+ }
73
+
74
+ body[`).concat(Qa,`] {
75
+ `).concat(iD,": ").concat(a,`px;
76
+ }
77
+ `)},z2=function(){var t=parseInt(document.body.getAttribute(Qa)||"0",10);return isFinite(t)?t:0},ED=function(){C.useEffect(function(){return document.body.setAttribute(Qa,(z2()+1).toString()),function(){var t=z2()-1;t<=0?document.body.removeAttribute(Qa):document.body.setAttribute(Qa,t.toString())}},[])},_D=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;ED();var s=C.useMemo(function(){return wD(o)},[o]);return C.createElement(CD,{styles:SD(s,!e,o,n?"":"!important")})},S1=!1;if(typeof window<"u")try{var pf=Object.defineProperty({},"passive",{get:function(){return S1=!0,!0}});window.addEventListener("test",pf,pf),window.removeEventListener("test",pf,pf)}catch{S1=!1}var Va=S1?{passive:!1}:!1,TD=function(t){return t.tagName==="TEXTAREA"},H3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!TD(t)&&n[e]==="visible")},ND=function(t){return H3(t,"overflowY")},AD=function(t){return H3(t,"overflowX")},F2=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=U3(t,r);if(o){var s=W3(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},MD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},DD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},U3=function(t,e){return t==="v"?ND(e):AD(e)},W3=function(t,e){return t==="v"?MD(e):DD(e)},RD=function(t,e){return t==="h"&&e==="rtl"?-1:1},OD=function(t,e,n,r,o){var s=RD(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,u=e.contains(a),d=!1,h=i>0,f=0,g=0;do{if(!a)break;var x=W3(t,a),v=x[0],b=x[1],k=x[2],E=b-k-s*v;(v||E)&&U3(t,a)&&(f+=E,g+=v);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(h&&Math.abs(f)<1||!h&&Math.abs(g)<1)&&(d=!0),d},mf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},$2=function(t){return[t.deltaX,t.deltaY]},B2=function(t){return t&&"current"in t?t.current:t},jD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ID=function(t){return`
78
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
79
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
80
+ `)},PD=0,Ha=[];function LD(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),o=C.useState(PD++)[0],s=C.useState(V3)[0],i=C.useRef(t);C.useEffect(function(){i.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=oD([t.lockRef.current],(t.shards||[]).map(B2),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=C.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var E=mf(b),_=n.current,T="deltaX"in b?b.deltaX:_[0]-E[0],A="deltaY"in b?b.deltaY:_[1]-E[1],D,R=b.target,O=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in b&&O==="h"&&R.type==="range")return!1;var P=window.getSelection(),j=P&&P.anchorNode,W=j?j===R||j.contains(R):!1;if(W)return!1;var Z=F2(O,R);if(!Z)return!0;if(Z?D=O:(D=O==="v"?"h":"v",Z=F2(O,R)),!Z)return!1;if(!r.current&&"changedTouches"in b&&(T||A)&&(r.current=D),!D)return!0;var J=r.current||D;return OD(J,k,b,J==="h"?T:A)},[]),u=C.useCallback(function(b){var k=b;if(!(!Ha.length||Ha[Ha.length-1]!==s)){var E="deltaY"in k?$2(k):mf(k),_=e.current.filter(function(D){return D.name===k.type&&(D.target===k.target||k.target===D.shadowParent)&&jD(D.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(i.current.shards||[]).map(B2).filter(Boolean).filter(function(D){return D.contains(k.target)}),A=T.length>0?a(k,T[0]):!i.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),d=C.useCallback(function(b,k,E,_){var T={name:b,delta:k,target:E,should:_,shadowParent:zD(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(A){return A!==T})},1)},[]),h=C.useCallback(function(b){n.current=mf(b),r.current=void 0},[]),f=C.useCallback(function(b){d(b.type,$2(b),b.target,a(b,t.lockRef.current))},[]),g=C.useCallback(function(b){d(b.type,mf(b),b.target,a(b,t.lockRef.current))},[]);C.useEffect(function(){return Ha.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Va),document.addEventListener("touchmove",u,Va),document.addEventListener("touchstart",h,Va),function(){Ha=Ha.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Va),document.removeEventListener("touchmove",u,Va),document.removeEventListener("touchstart",h,Va)}},[]);var x=t.removeScrollBar,v=t.inert;return C.createElement(C.Fragment,null,v?C.createElement(s,{styles:ID(o)}):null,x?C.createElement(_D,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function zD(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const FD=hD(B3,LD);var yp=C.forwardRef(function(t,e){return C.createElement(gp,xo({},t,{ref:e,sideCar:FD}))});yp.classNames=gp.classNames;var $D=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ua=new WeakMap,gf=new WeakMap,yf={},og=0,q3=function(t){return t&&(t.host||q3(t.parentNode))},BD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=q3(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})},VD=function(t,e,n,r){var o=BD(e,Array.isArray(t)?t:[t]);yf[n]||(yf[n]=new WeakMap);var s=yf[n],i=[],a=new Set,u=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))h(g);else try{var x=g.getAttribute(r),v=x!==null&&x!=="false",b=(Ua.get(g)||0)+1,k=(s.get(g)||0)+1;Ua.set(g,b),s.set(g,k),i.push(g),b===1&&v&&gf.set(g,!0),k===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return h(e),a.clear(),og++,function(){i.forEach(function(f){var g=Ua.get(f)-1,x=s.get(f)-1;Ua.set(f,g),s.set(f,x),g||(gf.has(f)||f.removeAttribute(r),gf.delete(f)),x||f.removeAttribute(n)}),og--,og||(Ua=new WeakMap,Ua=new WeakMap,gf=new WeakMap,yf={})}},Uy=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=$D(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),VD(r,o,n,"aria-hidden")):function(){return null}},HD=Object.defineProperty,mr=(t,e)=>HD(t,"name",{value:e,configurable:!0}),Wy="Dialog",[K3,pee]=Ao(Wy),[UD,to]=K3(Wy),WD=mr(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=C.useRef(null),u=C.useRef(null),[d,h]=Qi({prop:r,defaultProp:o??!1,onChange:s,caller:Wy}),[f,g]=C.useState(0),[x,v]=C.useState(0);return m.jsx(UD,{scope:e,triggerRef:a,contentRef:u,contentId:Co(),titleId:Co(),descriptionId:Co(),titlePresent:f>0,descriptionPresent:x>0,setTitleCount:g,setDescriptionCount:v,open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(b=>!b),[h]),modal:i,children:n})},"Dialog"),qD="DialogTrigger",KD=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,...o}=e,s=to(qD,r),i=ot(n,s.triggerRef);return m.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":xp(s.open),...o,ref:i,onClick:je(e.onClick,s.onOpenToggle)})},"DialogTrigger")),G3="DialogPortal",[GD,J3]=K3(G3,{forceMount:void 0}),JD=mr(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=to(G3,e);return m.jsx(GD,{scope:e,forceMount:n,children:C.Children.map(r,i=>m.jsx(fs,{present:n||s.open,children:m.jsx(mp,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),E1="DialogOverlay",ZD=C.forwardRef(mr(function(e,n){const r=J3(E1,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=to(E1,e.__scopeDialog);return i.modal?m.jsx(fs,{present:o||i.open,children:m.jsx(XD,{...s,ref:n})}):null},"DialogOverlay")),YD=Eo("DialogOverlay.RemoveScroll"),XD=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,...o}=e,s=to(E1,r),i=M3(),a=ot(n,i);return m.jsx(yp,{as:YD,allowPinchZoom:!0,shards:[s.contentRef],children:m.jsx(st.div,{"data-state":xp(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Ku="DialogContent",QD=C.forwardRef(mr(function(e,n){const r=J3(Ku,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=to(Ku,e.__scopeDialog);return m.jsx(fs,{present:o||i.open,children:i.modal?m.jsx(eR,{...s,ref:n}):m.jsx(tR,{...s,ref:n})})},"DialogContent")),eR=C.forwardRef(mr(function(e,n){const r=to(Ku,e.__scopeDialog),o=C.useRef(null),s=ot(n,r.contentRef,o);return C.useEffect(()=>{const i=o.current;if(i)return Uy(i)},[]),m.jsx(Z3,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:je(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&i.preventDefault()}),onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),tR=C.forwardRef(mr(function(e,n){const r=to(Ku,e.__scopeDialog),o=C.useRef(!1),s=C.useRef(!1);return m.jsx(Z3,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((h=r.triggerRef.current)==null?void 0:h.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Z3=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,u=to(Ku,r);return Mc(),m.jsx(m.Fragment,{children:m.jsx(By,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(pp,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":xp(u.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),nR="DialogTitle",rR=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,...o}=e,s=to(nR,r),{setTitleCount:i}=s;return It(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(st.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),oR="DialogDescription",sR=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,...o}=e,s=to(oR,r),{setDescriptionCount:i}=s;return It(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(st.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),iR="DialogClose",qy=C.forwardRef(mr(function(e,n){const{__scopeDialog:r,...o}=e,s=to(iR,r);return m.jsx(st.button,{type:"button",...o,ref:n,onClick:je(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function xp(t){return t?"open":"closed"}mr(xp,"getState");var aR=Object.defineProperty,lR=(t,e)=>aR(t,"name",{value:e,configurable:!0});function Y3(t){const[e,n]=C.useState(void 0);return It(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,a=d.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}lR(Y3,"useSize");const uR=["top","right","bottom","left"],ii=Math.min,ts=Math.max,nh=Math.round,xf=Math.floor,ns=t=>({x:t,y:t}),cR={left:"right",right:"left",bottom:"top",top:"bottom"};function X3(t,e,n){return ts(t,ii(e,n))}function us(t,e){return typeof t=="function"?t(e):t}function ai(t){return t.split("-")[0]}function Cl(t){return t.split("-")[1]}function Ky(t){return t==="x"?"y":"x"}function Gy(t){return t==="y"?"height":"width"}function vo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Jy(t){return Ky(vo(t))}function dR(t,e,n){n===void 0&&(n=!1);const r=Cl(t),o=Jy(t),s=Gy(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=rh(i)),[i,rh(i)]}function fR(t){const e=rh(t);return[_1(t),e,_1(e)]}function _1(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const V2=["left","right"],H2=["right","left"],hR=["top","bottom"],pR=["bottom","top"];function mR(t,e,n){switch(t){case"top":case"bottom":return n?e?H2:V2:e?V2:H2;case"left":case"right":return e?hR:pR;default:return[]}}function gR(t,e,n,r){const o=Cl(t);let s=mR(ai(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(_1)))),s}function rh(t){const e=ai(t);return cR[e]+t.slice(e.length)}function yR(t){var e,n,r,o;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(o=t.left)!=null?o:0}}function Q3(t){return typeof t!="number"?yR(t):{top:t,right:t,bottom:t,left:t}}function oh(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function U2(t,e,n){let{reference:r,floating:o}=t;const s=vo(e),i=Jy(e),a=Gy(i),u=ai(e),d=s==="y",h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let x;switch(u){case"top":x={x:h,y:r.y-o.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:f};break;case"left":x={x:r.x-o.width,y:f};break;default:x={x:r.x,y:r.y}}const v=Cl(e);return v&&(x[i]+=g*(v==="end"?1:-1)*(n&&d?-1:1)),x}async function xR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:x=0}=us(e,t),v=Q3(x),k=a[g?f==="floating"?"reference":"floating":f],E=oh(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:h,strategy:u})),_=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},D=oh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:T,strategy:u}):_);return{top:(E.top-D.top+v.top)/A.y,bottom:(D.bottom-E.bottom+v.bottom)/A.y,left:(E.left-D.left+v.left)/A.x,right:(D.right-E.right+v.right)/A.x}}const vR=50,bR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:xR},u=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:h,y:f}=U2(d,r,u),g=r,x=0;const v={};for(let b=0;b<s.length;b++){const k=s[b];if(!k)continue;const{name:E,fn:_}=k,{x:T,y:A,data:D,reset:R}=await _({x:h,y:f,initialPlacement:r,placement:g,strategy:o,middlewareData:v,rects:d,platform:a,elements:{reference:t,floating:e}});h=T??h,f=A??f,v[E]={...v[E],...D},R&&x<vR&&(x++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(d=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:h,y:f}=U2(d,g,u)),b=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:v}},kR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=e,{element:d,padding:h=0}=us(t,e)||{};if(d==null)return{};const f=Q3(h),g={x:n,y:r},x=Jy(o),v=Gy(x),b=await i.getDimensions(d),k=x==="y",E=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",A=s.reference[v]+s.reference[x]-g[x]-s.floating[v],D=g[x]-s.reference[x],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let O=R?R[T]:0;(!O||!await(i.isElement==null?void 0:i.isElement(R)))&&(O=a.floating[T]||s.floating[v]);const P=A/2-D/2,j=O/2-b[v]/2-1,W=ii(f[E],j),Z=ii(f[_],j),J=O-b[v]-Z,K=O/2-b[v]/2+P,Y=X3(W,K,J),ee=!u.arrow&&Cl(o)!=null&&K!==Y&&s.reference[v]/2-(K<W?W:Z)-b[v]/2<0,G=ee?K<W?K-W:K-J:0;return{[x]:g[x]+G,data:{[x]:Y,centerOffset:K-Y-G,...ee&&{alignmentOffset:G}},reset:ee}}}),wR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...k}=us(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=ai(o),_=vo(a),T=ai(a)===a,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),D=g||(T||!b?[rh(a)]:fR(a)),R=v!=="none";!g&&R&&D.push(...gR(a,b,v,A));const O=[a,...D],P=await u.detectOverflow(e,k),j=[];let W=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&j.push(P[E]),f){const Y=dR(o,i,A);j.push(P[Y[0]],P[Y[1]])}if(W=[...W,{placement:o,overflows:j}],!j.every(Y=>Y<=0)){var Z,J;const Y=(((Z=s.flip)==null?void 0:Z.index)||0)+1,ee=O[Y];if(ee&&(!(f==="alignment"?_!==vo(ee):!1)||W.every(q=>vo(q.placement)===_?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:W},reset:{placement:ee}};let G=(J=W.filter(X=>X.overflows[0]<=0).sort((X,q)=>X.overflows[1]-q.overflows[1])[0])==null?void 0:J.placement;if(!G)switch(x){case"bestFit":{var K;const X=(K=W.filter(q=>{if(R){const te=vo(q.placement);return te===_||te==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(te=>te>0).reduce((te,F)=>te+F,0)]).sort((q,te)=>q[1]-te[1])[0])==null?void 0:K[0];X&&(G=X);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function W2(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function q2(t){return uR.some(e=>t[e]>=0)}const CR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=us(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=W2(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:q2(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=W2(i,n.floating);return{data:{escapedOffsets:a,escaped:q2(a)}}}default:return{}}}}},eE=new Set(["left","top"]);async function SR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ai(n),a=Cl(n),u=vo(n)==="y",d=eE.has(i)?-1:1,h=s&&u?-1:1,f=us(e,t);let{mainAxis:g,crossAxis:x,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(x=a==="end"?v*-1:v),u?{x:x*h,y:g*d}:{x:g*d,y:x*h}}const ER=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,u=await SR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},_R=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:_=>{let{x:T,y:A}=_;return{x:T,y:A}}},...d}=us(t,e),h={x:n,y:r},f=await s.detectOverflow(e,d),g=vo(o),x=Ky(g);let v=h[x],b=h[g];const k=(_,T)=>X3(T+f[_==="y"?"top":"left"],T,T-f[_==="y"?"bottom":"right"]);i&&(v=k(x,v)),a&&(b=k(g,b));const E=u.fn({...e,[x]:v,[g]:b});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[x]:i,[g]:a}}}}}},TR=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:u}=e,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=us(t,e),g={x:o,y:s},x=vo(i),v=Ky(x);let b=g[v],k=g[x];const E=us(d,e),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(h){const D=v==="y"?"height":"width",R=a.reference[v]-a.floating[D]+_.mainAxis,O=a.reference[v]+a.reference[D]-_.mainAxis;b<R?b=R:b>O&&(b=O)}if(f){var T,A;const D=v==="y"?"width":"height",R=eE.has(ai(i)),O=a.reference[x]-a.floating[D]+(R&&((T=u.offset)==null?void 0:T[x])||0)+(R?0:_.crossAxis),P=a.reference[x]+a.reference[D]+(R?0:((A=u.offset)==null?void 0:A[x])||0)-(R?_.crossAxis:0);k<O?k=O:k>P&&(k=P)}return{[v]:b,[x]:k}}}},NR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:s}=e,{apply:i=()=>{},...a}=us(t,e),u=await o.detectOverflow(e,a),d=ai(n),h=Cl(n),f=vo(n)==="y",{width:g,height:x}=r.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,v=h==="end"?"top":"bottom");const k=x-u.top-u.bottom,E=g-u.left-u.right,_=ii(x-u[v],k),T=ii(g-u[b],E),A=e.middlewareData.shift,D=!A;let R=_,O=T;A!=null&&A.enabled.x&&(O=E),A!=null&&A.enabled.y&&(R=k),D&&!h&&(f?O=g-2*ts(u.left,u.right):R=x-2*ts(u.top,u.bottom)),await i({...e,availableWidth:O,availableHeight:R});const P=await o.getDimensions(s.floating);return g!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function vp(){return typeof window<"u"}function Sl(t){return tE(t)?(t.nodeName||"").toLowerCase():"#document"}function nr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hs(t){var e;return(e=(tE(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function tE(t){return vp()?t instanceof Node||t instanceof nr(t).Node:!1}function _o(t){return vp()?t instanceof Element||t instanceof nr(t).Element:!1}function mi(t){return vp()?t instanceof HTMLElement||t instanceof nr(t).HTMLElement:!1}function K2(t){return!vp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nr(t).ShadowRoot}function bp(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=To(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function AR(t){return/^(table|td|th)$/.test(Sl(t))}function kp(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const MR=/transform|translate|scale|rotate|perspective|filter/,DR=/paint|layout|strict|content/,Li=t=>!!t&&t!=="none";let sg;function Zy(t){const e=_o(t)?To(t):t;return Li(e.transform)||Li(e.translate)||Li(e.scale)||Li(e.rotate)||Li(e.perspective)||!Yy()&&(Li(e.backdropFilter)||Li(e.filter))||MR.test(e.willChange||"")||DR.test(e.contain||"")}function RR(t){let e=ea(t);for(;mi(e)&&!Gu(e);){if(Zy(e))return e;if(kp(e))return null;e=ea(e)}return null}function Yy(){return sg==null&&(sg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),sg}function Gu(t){return/^(html|body|#document)$/.test(Sl(t))}function To(t){return nr(t).getComputedStyle(t)}function wp(t){return _o(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ea(t){if(Sl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||K2(t)&&t.host||hs(t);return K2(e)?e.host:e}function nE(t){const e=ea(t);return Gu(e)?(t.ownerDocument||t).body:mi(e)&&bp(e)?e:nE(e)}function Ju(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=nE(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=nr(o);if(s){const a=T1(i);return e.concat(i,i.visualViewport||[],bp(o)?o:[],a&&n?Ju(a):[])}else return e.concat(o,Ju(o,[],n))}function T1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function rE(t){const e=To(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=mi(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=nh(n)!==s||nh(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Xy(t){return _o(t)?t:t.contextElement}function el(t){const e=Xy(t);if(!mi(e))return ns(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=rE(e);let i=(s?nh(n.width):n.width)/r,a=(s?nh(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const OR=ns(0);function oE(t){const e=nr(t);return!Yy()||!e.visualViewport?OR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jR(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===nr(t)}function ta(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Xy(t);let i=ns(1);e&&(r?_o(r)&&(i=el(r)):i=el(t));const a=jR(s,n,r)?oE(s):ns(0);let u=(o.left+a.x)/i.x,d=(o.top+a.y)/i.y,h=o.width/i.x,f=o.height/i.y;if(s&&r){const g=nr(s),x=_o(r)?nr(r):r;let v=g,b=T1(v);for(;b&&x!==v;){const k=el(b),E=b.getBoundingClientRect(),_=To(b),T=E.left+(b.clientLeft+parseFloat(_.paddingLeft))*k.x,A=E.top+(b.clientTop+parseFloat(_.paddingTop))*k.y;u*=k.x,d*=k.y,h*=k.x,f*=k.y,u+=T,d+=A,v=nr(b),b=T1(v)}}return oh({width:h,height:f,x:u,y:d})}function Cp(t,e){const n=wp(t).scrollLeft;return e?e.left+n:ta(hs(t)).left+n}function sE(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Cp(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function IR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=hs(r),a=e?kp(e.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},d=ns(1);const h=ns(0),f=mi(r);if((f||!s)&&((Sl(r)!=="body"||bp(i))&&(u=wp(r)),f)){const x=ta(r);d=el(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=i&&!f&&!s?sE(i,u):ns(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function PR(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function LR(t){const e=wp(t),n=t.ownerDocument.body,r=ts(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=ts(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Cp(t);const i=-e.scrollTop;return To(n).direction==="rtl"&&(s+=ts(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const zR=25;function FR(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=nr(t),s=hs(t),i=o.visualViewport;let a=s.clientWidth,u=s.clientHeight,d=0,h=0;if(i){const g=!Yy()||e==="fixed";r?g||(d=-i.offsetLeft,h=-i.offsetTop):(a=i.width,u=i.height,g&&(d=i.offsetLeft,h=i.offsetTop))}if(Cp(s)<=0){const g=s.ownerDocument,x=g.body,v=getComputedStyle(x),b=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(s.clientWidth-x.clientWidth-b),E=getComputedStyle(s).scrollbarGutter==="stable both-edges"?k/2:k;E<=zR&&(a-=E)}return{width:a,height:u,x:d,y:h}}function $R(t,e){const n=ta(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=el(t),i=t.clientWidth*s.x,a=t.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:a,x:u,y:d}}function G2(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=FR(t,n,e);else if(e==="document")r=LR(hs(t));else if(_o(e))r=$R(e,n);else{const o=oE(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return oh(r)}function BR(t,e){const n=e.get(t);if(n)return n;let r=Ju(t,[],!1).filter(a=>_o(a)&&Sl(a)!=="body"),o=null;const s=To(t).position==="fixed";let i=s?ea(t):t;for(;_o(i)&&!Gu(i);){const a=To(i),u=Zy(i),d=o?o.position:s?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&a.position==="static")?r=r.filter(f=>f!==i):o=a,i=ea(i)}return e.set(t,r),r}function VR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?kp(e)?[]:BR(e,this._c):[].concat(n),r],a=G2(e,i[0],o);let u=a.top,d=a.right,h=a.bottom,f=a.left;for(let g=1;g<i.length;g++){const x=G2(e,i[g],o);u=ts(x.top,u),d=ii(x.right,d),h=ii(x.bottom,h),f=ts(x.left,f)}return{width:d-f,height:h-u,x:f,y:u}}function HR(t){const{width:e,height:n}=rE(t);return{width:e,height:n}}function UR(t,e,n){const r=mi(e),o=hs(e),s=n==="fixed",i=ta(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const u=ns(0);if((r||!s)&&((Sl(e)!=="body"||bp(o))&&(a=wp(e)),r)){const g=ta(e,!0,s,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&o&&(u.x=Cp(o));const d=o&&!r&&!s?sE(o,a):ns(0),h=i.left+a.scrollLeft-u.x-d.x,f=i.top+a.scrollTop-u.y-d.y;return{x:h,y:f,width:i.width,height:i.height}}function ig(t){return To(t).position==="static"}function J2(t,e){if(!mi(t)||To(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hs(t)===n&&(n=n.ownerDocument.body),n}function iE(t,e){const n=nr(t);if(kp(t))return n;if(!mi(t)){let o=ea(t);for(;o&&!Gu(o);){if(_o(o)&&!ig(o))return o;o=ea(o)}return n}let r=J2(t,e);for(;r&&AR(r)&&ig(r);)r=J2(r,e);return r&&Gu(r)&&ig(r)&&!Zy(r)?n:r||RR(t)||n}const WR=async function(t){const e=this.getOffsetParent||iE,n=this.getDimensions,r=await n(t.floating);return{reference:UR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qR(t){return To(t).direction==="rtl"}const KR={convertOffsetParentRelativeRectToViewportRelativeRect:IR,getDocumentElement:hs,getClippingRect:VR,getOffsetParent:iE,getElementRects:WR,getClientRects:PR,getDimensions:HR,getScale:el,isElement:_o,isRTL:qR};function aE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function GR(t,e,n){let r=null,o;const s=hs(t);function i(){var h;clearTimeout(o),(h=r)==null||h.disconnect(),r=null}function a(h,f){h===void 0&&(h=!1),f===void 0&&(f=1),i();const g=t.getBoundingClientRect(),{left:x,top:v,width:b,height:k}=g;if(h||e(),!b||!k)return;const E=xf(v),_=xf(s.clientWidth-(x+b)),T=xf(s.clientHeight-(v+k)),A=xf(x),R={rootMargin:-E+"px "+-_+"px "+-T+"px "+-A+"px",threshold:ts(0,ii(1,f))||1};let O=!0;function P(j){const W=j[0].intersectionRatio;if(!aE(g,t.getBoundingClientRect()))return a();if(W!==f){if(!O)return a();W?a(!1,W):o=setTimeout(()=>{a(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(P,{...R,root:s.ownerDocument})}catch{r=new IntersectionObserver(P,R)}r.observe(t)}const u=nr(t),d=()=>a(n);return u.addEventListener("resize",d),a(!0),()=>{u.removeEventListener("resize",d),i()}}function JR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Xy(t),h=o||s?[...d?Ju(d):[],...e?Ju(e):[]]:[];h.forEach(E=>{o&&E.addEventListener("scroll",n),s&&E.addEventListener("resize",n)});const f=d&&a?GR(d,n,s):null;let g=-1,x=null;i&&(x=new ResizeObserver(E=>{let[_]=E;_&&_.target===d&&x&&e&&(x.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(e)})),n()}),d&&!u&&x.observe(d),e&&x.observe(e));let v,b=u?ta(t):null;u&&k();function k(){const E=ta(t);b&&!aE(b,E)&&n(),b=E,v=requestAnimationFrame(k)}return n(),()=>{var E;h.forEach(_=>{o&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),f==null||f(),(E=x)==null||E.disconnect(),x=null,u&&cancelAnimationFrame(v)}}const ZR=ER,YR=_R,XR=wR,QR=NR,e8=CR,Z2=kR,t8=TR,n8=(t,e,n)=>{const r=new Map,o=n??{},s={...KR,...o.platform,_c:r};return bR(t,e,{...o,platform:s})};var r8=typeof document<"u",o8=function(){},Gf=r8?C.useLayoutEffect:o8;function sh(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(!sh(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 s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!sh(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function lE(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Y2(t,e){const n=lE(t);return Math.round(e*n)/n}function ag(t){const e=C.useRef(t);return Gf(()=>{e.current=t}),e}function s8(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:d}=t,[h,f]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,x]=C.useState(r);sh(g,r)||x(r);const[v,b]=C.useState(null),[k,E]=C.useState(null),_=C.useCallback(q=>{q!==R.current&&(R.current=q,b(q))},[]),T=C.useCallback(q=>{q!==O.current&&(O.current=q,E(q))},[]),A=s||v,D=i||k,R=C.useRef(null),O=C.useRef(null),P=C.useRef(h),j=u!=null,W=ag(u),Z=ag(o),J=ag(d),K=C.useCallback(()=>{if(!R.current||!O.current)return;const q={placement:e,strategy:n,middleware:g};Z.current&&(q.platform=Z.current),n8(R.current,O.current,q).then(te=>{const F={...te,isPositioned:J.current!==!1};Y.current&&!sh(P.current,F)&&(P.current=F,Kr.flushSync(()=>{f(F)}))})},[g,e,n,Z,J]);Gf(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[d]);const Y=C.useRef(!1);Gf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Gf(()=>{if(A&&(R.current=A),D&&(O.current=D),A&&D){if(W.current)return W.current(A,D,K);K()}},[A,D,K,W,j]);const ee=C.useMemo(()=>({reference:R,floating:O,setReference:_,setFloating:T}),[_,T]),G=C.useMemo(()=>({reference:A,floating:D}),[A,D]),X=C.useMemo(()=>{const q={position:n,left:0,top:0};if(!G.floating)return q;const te=Y2(G.floating,h.x),F=Y2(G.floating,h.y);return a?{...q,transform:"translate("+te+"px, "+F+"px)",...lE(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:F}},[n,a,G.floating,h.x,h.y]);return C.useMemo(()=>({...h,update:K,refs:ee,elements:G,floatingStyles:X}),[h,K,ee,G,X])}const i8=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?Z2({element:r.current,padding:o}).fn(n):{}:r?Z2({element:r,padding:o}).fn(n):{}}}},a8=(t,e)=>{const n=ZR(t);return{name:n.name,fn:n.fn,options:[t,e]}},l8=(t,e)=>{const n=YR(t);return{name:n.name,fn:n.fn,options:[t,e]}},u8=(t,e)=>({fn:t8(t).fn,options:[t,e]}),c8=(t,e)=>{const n=XR(t);return{name:n.name,fn:n.fn,options:[t,e]}},d8=(t,e)=>{const n=QR(t);return{name:n.name,fn:n.fn,options:[t,e]}},f8=(t,e)=>{const n=e8(t);return{name:n.name,fn:n.fn,options:[t,e]}},h8=(t,e)=>{const n=i8(t);return{name:n.name,fn:n.fn,options:[t,e]}};var p8=Object.defineProperty,m8=(t,e)=>p8(t,"name",{value:e,configurable:!0}),g8=C.forwardRef(m8(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return m.jsx(st.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:m.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),y8=g8,x8=Object.defineProperty,rs=(t,e)=>x8(t,"name",{value:e,configurable:!0}),uE="Popper",[cE,El]=Ao(uE),[v8,dE]=cE(uE),b8=rs(t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null),[s,i]=C.useState(void 0);return m.jsx(v8,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),k8="PopperAnchor",w8=C.forwardRef(rs(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=dE(k8,r),a=C.useRef(null),u=i.onAnchorChange,d=C.useCallback(b=>{a.current=b,b&&u(b)},[u]),h=ot(n,d),f=C.useRef(null);C.useEffect(()=>{if(!o)return;const b=f.current;f.current=o.current,b!==f.current&&u(f.current)});const g=i.placementState&&Sp(i.placementState),x=g==null?void 0:g[0],v=g==null?void 0:g[1];return o?null:m.jsx(st.div,{"data-radix-popper-side":x,"data-radix-popper-align":v,...s,ref:h})},"PopperAnchor")),fE="PopperContent",[C8,S8]=cE(fE),E8=C.forwardRef(rs(function(e,n){var de,me,Fe,Oe,Be,Ye,Mt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:b,...k}=e,E=dE(fE,r),[_,T]=C.useState(null),A=ot(n,T),[D,R]=C.useState(null),O=Y3(D),P=(O==null?void 0:O.width)??0,j=(O==null?void 0:O.height)??0,W=o+(i!=="center"?"-"+i:""),Z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},J=Array.isArray(h)?h:[h],K=J.length>0,Y={padding:Z,boundary:J.filter(hE),altBoundary:K},{refs:ee,floatingStyles:G,placement:X,isPositioned:q,middlewareData:te}=s8({strategy:"fixed",placement:W,whileElementsMounted:rs((...zt)=>JR(...zt,{animationFrame:v==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[a8({mainAxis:s+j,alignmentAxis:a}),d&&l8({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?u8():void 0,...Y}),d&&c8({...Y}),d8({...Y,apply:rs(({elements:zt,rects:qt,availableWidth:Hn,availableHeight:Kt})=>{const{width:nn,height:On}=qt.reference,pt=zt.floating.style;pt.setProperty("--radix-popper-available-width",`${Hn}px`),pt.setProperty("--radix-popper-available-height",`${Kt}px`),pt.setProperty("--radix-popper-anchor-width",`${nn}px`),pt.setProperty("--radix-popper-anchor-height",`${On}px`)},"apply")}),D&&h8({element:D,padding:u}),A8({arrowWidth:P,arrowHeight:j}),x&&f8({strategy:"referenceHidden",...Y,boundary:K?Y.boundary:void 0})]}),F=E.setPlacementState;It(()=>(F(X),()=>{F(void 0)}),[X,F]);const[L,V]=Sp(X),re=jr(b);It(()=>{q&&(re==null||re())},[q,re]);const he=(de=te.arrow)==null?void 0:de.x,ce=(me=te.arrow)==null?void 0:me.y,pe=((Fe=te.arrow)==null?void 0:Fe.centerOffset)!==0,[Re,Q]=C.useState();return It(()=>{_&&Q(window.getComputedStyle(_).zIndex)},[_]),m.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[(Oe=te.transformOrigin)==null?void 0:Oe.x,(Be=te.transformOrigin)==null?void 0:Be.y].join(" "),...((Ye=te.hide)==null?void 0:Ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(C8,{scope:r,placedSide:L,placedAlign:V,onArrowChange:R,arrowX:he,arrowY:ce,shouldHideArrow:pe,children:m.jsx(st.div,{"data-side":L,"data-align":V,...k,ref:A,style:{...k.style,animation:q?(Mt=k.style)==null?void 0:Mt.animation:"none"}})})})},"PopperContent")),_8="PopperArrow",T8={top:"bottom",right:"left",bottom:"top",left:"right"},N8=C.forwardRef(rs(function(e,n){const{__scopePopper:r,...o}=e,s=S8(_8,r),i=T8[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(y8,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function hE(t){return t!==null}rs(hE,"isNotNull");var A8=rs(t=>({name:"transformOrigin",options:t,fn(e){var k,E,_;const{placement:n,rects:r,middlewareData:o}=e,i=((k=o.arrow)==null?void 0:k.centerOffset)!==0,a=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[d,h]=Sp(n),f={start:"0%",center:"50%",end:"100%"}[h],g=(((E=o.arrow)==null?void 0:E.x)??0)+a/2,x=(((_=o.arrow)==null?void 0:_.y)??0)+u/2;let v="",b="";return d==="bottom"?(v=i?f:`${g}px`,b=`${-u}px`):d==="top"?(v=i?f:`${g}px`,b=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,b=i?f:`${x}px`):d==="left"&&(v=`${r.floating.width+u}px`,b=i?f:`${x}px`),{data:{x:v,y:b}}}}),"transformOrigin");function Sp(t){const[e,n="center"]=t.split("-");return[e,n]}rs(Sp,"getSideAndAlignFromPlacement");var Qy=b8,ex=w8,tx=E8,M8=N8,D8=Object.defineProperty,nx=(t,e)=>D8(t,"name",{value:e,configurable:!0}),lg=!1;function pE(){const[t,e]=C.useState(lg);return C.useEffect(()=>{lg||(lg=!0,e(!0))},[]),t}nx(pE,"useIsHydrated");var mE=kl[" useSyncExternalStore ".trim().toString()];function gE(){return()=>{}}nx(gE,"subscribe");function yE(){return mE(gE,()=>!0,()=>!1)}nx(yE,"useIsHydratedModern");var R8=typeof mE=="function"?yE:pE,O8=Object.defineProperty,ua=(t,e)=>O8(t,"name",{value:e,configurable:!0}),ug="rovingFocusGroup.onEntryFocus",j8={bubbles:!1,cancelable:!0},Ep="RovingFocusGroup",[N1,xE,I8]=fp(Ep),[P8,vE]=Ao(Ep,[I8]),[L8,z8]=P8(Ep),F8=C.forwardRef(ua(function(e,n){return m.jsx(N1.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(N1.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx($8,{...e,ref:n})})})},"RovingFocusGroup")),$8=C.forwardRef(ua(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:f=!1,...g}=e,x=C.useRef(null),v=ot(n,x),b=hp(i),[k,E]=Qi({prop:a,defaultProp:u??null,onChange:d,caller:Ep}),[_,T]=C.useState(!1),A=jr(h),D=xE(r),R=C.useRef(!1),[O,P]=C.useState(0);return C.useEffect(()=>{const j=x.current;if(j)return j.addEventListener(ug,A),()=>j.removeEventListener(ug,A)},[A]),m.jsx(L8,{scope:r,orientation:o,dir:b,loop:s,currentTabStopId:k,onItemFocus:C.useCallback(j=>E(j),[E]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>P(j=>j+1),[]),onFocusableItemRemove:C.useCallback(()=>P(j=>j-1),[]),children:m.jsx(st.div,{tabIndex:_||O===0?-1:0,"data-orientation":o,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{R.current=!0}),onFocus:je(e.onFocus,j=>{const W=!R.current;if(j.target===j.currentTarget&&W&&!_){const Z=new CustomEvent(ug,j8);if(j.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const J=D().filter(X=>X.focusable),K=J.find(X=>X.active),Y=J.find(X=>X.id===k),G=[K,Y,...J].filter(Boolean).map(X=>X.ref.current);rx(G,f)}}R.current=!1}),onBlur:je(e.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),B8="RovingFocusGroupItem",V8=C.forwardRef(ua(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...u}=e,d=Co(),h=i||d,f=z8(B8,r),g=f.currentTabStopId===h,x=xE(r),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:k}=f,E=R8();return It(()=>{if(!(!E||!o))return v(),()=>b()},[E,o,v,b]),C.useEffect(()=>{if(!(E||!o))return v(),()=>b()},[E,o,v,b]),m.jsx(N1.ItemSlot,{scope:r,id:h,focusable:o,active:s,children:m.jsx(st.span,{tabIndex:g?0:-1,"data-orientation":f.orientation,...u,ref:n,onMouseDown:je(e.onMouseDown,_=>{o?f.onItemFocus(h):_.preventDefault()}),onFocus:je(e.onFocus,()=>f.onItemFocus(h)),onKeyDown:je(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){f.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=kE(_,f.orientation,f.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let D=x().filter(R=>R.focusable).map(R=>R.ref.current);if(T==="last")D.reverse();else if(T==="prev"||T==="next"){T==="prev"&&D.reverse();const R=D.indexOf(_.currentTarget);D=f.loop?wE(D,R+1):D.slice(R+1)}setTimeout(()=>rx(D))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:k!=null}):a})})},"RovingFocusGroupItem")),H8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bE(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}ua(bE,"getDirectionAwareKey");function kE(t,e,n){const r=bE(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return H8[r]}ua(kE,"getFocusIntent");function rx(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}ua(rx,"focusFirst");function wE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ua(wE,"wrapArray");var U8=F8,W8=V8,q8=Object.defineProperty,dt=(t,e)=>q8(t,"name",{value:e,configurable:!0}),K8=["Enter"," "],G8=["ArrowDown","PageUp","Home"],CE=["ArrowUp","PageDown","End"],J8=[...G8,...CE],_p="Menu",[A1,Z8,Y8]=fp(_p),[ca,SE]=Ao(_p,[Y8,El,vE]),ox=El(),EE=vE(),[X8,Dc]=ca(_p),[Q8,sx]=ca(_p),eO=dt(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=ox(e),[u,d]=C.useState(null),h=C.useRef(!1),f=jr(s),g=hp(o);return C.useEffect(()=>{const x=dt(()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=dt(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),C.useEffect(()=>{if(!n)return;const x=dt(()=>f(!1),"handleBlur");return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[n,f]),m.jsx(Qy,{...a,children:m.jsx(X8,{scope:e,open:n,onOpenChange:f,content:u,onContentChange:d,children:m.jsx(Q8,{scope:e,onClose:C.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:h,dir:g,modal:i,children:r})})})},"Menu"),tO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e,s=ox(r);return m.jsx(ex,{...s,...o,ref:n})},"MenuAnchor")),_E="MenuPortal",[nO,rO]=ca(_E,{forceMount:void 0}),oO=dt(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=Dc(_E,e);return m.jsx(nO,{scope:e,forceMount:n,children:m.jsx(fs,{present:n||s.open,children:m.jsx(mp,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Qs="MenuContent",[sO,TE]=ca(Qs),iO=C.forwardRef(dt(function(e,n){const r=rO(Qs,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=Dc(Qs,e.__scopeMenu),a=sx(Qs,e.__scopeMenu);return m.jsx(A1.Provider,{scope:e.__scopeMenu,children:m.jsx(fs,{present:o||i.open,children:m.jsx(A1.Slot,{scope:e.__scopeMenu,children:a.modal?m.jsx(aO,{...s,ref:n}):m.jsx(lO,{...s,ref:n})})})})},"MenuContent")),aO=C.forwardRef(dt(function(e,n){const r=Dc(Qs,e.__scopeMenu),o=C.useRef(null),s=ot(n,o);return C.useEffect(()=>{const i=o.current;if(i)return Uy(i)},[]),m.jsx(NE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),lO=C.forwardRef(dt(function(e,n){const r=Dc(Qs,e.__scopeMenu);return m.jsx(NE,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),uO=Eo("MenuContent.ScrollLock"),NE=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:x,onDismiss:v,disableOutsideScroll:b,...k}=e,E=Dc(Qs,r),_=sx(Qs,r),T=ox(r),A=EE(r),D=Z8(r),[R,O]=C.useState(null),P=C.useRef(null),j=ot(n,P,E.onContentChange),W=C.useRef(0),Z=C.useRef(""),J=C.useRef(0),K=C.useRef(null),Y=C.useRef("right"),ee=C.useRef(0),G=b?yp:C.Fragment,X=b?{as:uO,allowPinchZoom:!0}:void 0,q=dt(F=>{var Q,de;const L=Z.current+F,V=D().filter(me=>!me.disabled),re=document.activeElement,he=(Q=V.find(me=>me.ref.current===re))==null?void 0:Q.textValue,ce=V.map(me=>me.textValue),pe=jE(ce,L,he),Re=(de=V.find(me=>me.textValue===pe))==null?void 0:de.ref.current;dt((function me(Fe){Z.current=Fe,window.clearTimeout(W.current),Fe!==""&&(W.current=window.setTimeout(()=>me(""),1e3))}),"updateSearch")(L),Re&&setTimeout(()=>Re.focus())},"handleTypeaheadSearch");C.useEffect(()=>()=>window.clearTimeout(W.current),[]),Mc();const te=C.useCallback(F=>{var V,re;return Y.current===((V=K.current)==null?void 0:V.side)&&PE(F,(re=K.current)==null?void 0:re.area)},[]);return m.jsx(sO,{scope:r,searchRef:Z,onItemEnter:C.useCallback(F=>{te(F)&&F.preventDefault()},[te]),onItemLeave:C.useCallback(F=>{var L;te(F)||((L=P.current)==null||L.focus(),O(null))},[te]),onTriggerLeave:C.useCallback(F=>{te(F)&&F.preventDefault()},[te]),pointerGraceTimerRef:J,onPointerGraceIntentChange:C.useCallback(F=>{K.current=F},[]),children:m.jsx(G,{...X,children:m.jsx(By,{asChild:!0,trapped:s,onMountAutoFocus:je(i,F=>{var L;F.preventDefault(),(L=P.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(pp,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:x,onDismiss:v,children:m.jsx(U8,{asChild:!0,...A,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:O,onEntryFocus:je(d,F=>{_.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(tx,{role:"menu","aria-orientation":"vertical","data-state":DE(E.open),"data-radix-menu-content":"",dir:_.dir,...T,...k,ref:j,style:{outline:"none",...k.style},onKeyDown:je(k.onKeyDown,F=>{const V=F.target.closest("[data-radix-menu-content]")===F.currentTarget,re=F.ctrlKey||F.altKey||F.metaKey,he=F.key.length===1;V&&(F.key==="Tab"&&F.preventDefault(),!re&&he&&q(F.key));const ce=P.current;if(F.target!==ce||!J8.includes(F.key))return;F.preventDefault();const Re=D().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);CE.includes(F.key)&&Re.reverse(),RE(Re)}),onBlur:je(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(W.current),Z.current="")}),onPointerMove:je(e.onPointerMove,ih(F=>{const L=F.target,V=ee.current!==F.clientX;if(F.currentTarget.contains(L)&&V){const re=F.clientX>ee.current?"right":"left";Y.current=re,ee.current=F.clientX}}))})})})})})})},"MenuContentImpl")),cO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return m.jsx(st.div,{...o,ref:n})},"MenuLabel")),M1="MenuItem",X2="menu.itemSelect",AE=C.forwardRef(dt(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=C.useRef(null),a=sx(M1,e.__scopeMenu),u=TE(M1,e.__scopeMenu),d=ot(n,i),h=C.useRef(!1),f=dt(()=>{const g=i.current;if(!r&&g){const x=new CustomEvent(X2,{bubbles:!0,cancelable:!0});g.addEventListener(X2,v=>o==null?void 0:o(v),{once:!0}),zy(g,x),x.defaultPrevented?h.current=!1:a.onClose()}},"handleSelect");return m.jsx(dO,{...s,ref:d,disabled:r,onClick:je(e.onClick,f),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),h.current=!0},onPointerUp:je(e.onPointerUp,g=>{var x;h.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:je(e.onKeyDown,g=>{r||g.target!==g.currentTarget||u.searchRef.current!==""&&g.key===" "||K8.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})},"MenuItem")),dO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=TE(M1,r),u=EE(r),d=C.useRef(null),h=ot(n,d),[f,g]=C.useState(!1),[x,v]=C.useState("");return C.useEffect(()=>{const b=d.current;b&&v((b.textContent??"").trim())},[i.children]),m.jsx(A1.ItemSlot,{scope:r,disabled:o,textValue:s??x,children:m.jsx(W8,{asChild:!0,...u,focusable:!o,children:m.jsx(st.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:h,onPointerMove:je(e.onPointerMove,ih(b=>{o?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,ih(b=>a.onItemLeave(b))),onFocus:je(e.onFocus,()=>g(!0)),onBlur:je(e.onBlur,()=>g(!1))})})})},"MenuItemImpl")),fO=C.forwardRef(dt(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return m.jsx(pO,{scope:e.__scopeMenu,checked:r,children:m.jsx(AE,{role:"menuitemcheckbox","aria-checked":Zu(r)?"mixed":r,...s,ref:n,"data-state":ix(r),onSelect:je(s.onSelect,()=>o==null?void 0:o(Zu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),hO="MenuRadioGroup",[mee,gee]=ca(hO,{value:void 0,onValueChange:dt(()=>{},"onValueChange")}),ME="MenuItemIndicator",[pO,mO]=ca(ME,{checked:!1}),gO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=mO(ME,r);return m.jsx(fs,{present:o||Zu(i.checked)||i.checked===!0,children:m.jsx(st.span,{...s,ref:n,"data-state":ix(i.checked)})})},"MenuItemIndicator")),yO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return m.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),xO="MenuSub",[yee,xee]=ca(xO);function DE(t){return t?"open":"closed"}dt(DE,"getOpenState");function Zu(t){return t==="indeterminate"}dt(Zu,"isIndeterminate");function ix(t){return Zu(t)?"indeterminate":t?"checked":"unchecked"}dt(ix,"getCheckedState");function RE(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}dt(RE,"focusFirst");function OE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}dt(OE,"wrapArray");function jE(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=OE(t,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}dt(jE,"getNextMatch");function IE(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],u=e[i],d=a.x,h=a.y,f=u.x,g=u.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(o=!o)}return o}dt(IE,"isPointInPolygon");function PE(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return IE(n,e)}dt(PE,"isPointerInGraceArea");function ih(t){return e=>e.pointerType==="mouse"?t(e):void 0}dt(ih,"whenMouse");var vO=eO,bO=tO,kO=oO,wO=iO,CO=cO,SO=AE,EO=fO,_O=gO,TO=yO,NO=Object.defineProperty,ps=(t,e)=>NO(t,"name",{value:e,configurable:!0}),ax="DropdownMenu",[AO,vee]=Ao(ax,[SE]),ms=SE(),[MO,LE]=AO(ax),DO=ps(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=ms(e),d=C.useRef(null),[h,f]=Qi({prop:o,defaultProp:s??!1,onChange:i,caller:ax});return m.jsx(MO,{scope:e,triggerId:Co(),triggerRef:d,contentId:Co(),open:h,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(g=>!g),[f]),modal:a,children:m.jsx(vO,{...u,open:h,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),RO="DropdownMenuTrigger",OO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=LE(RO,r),a=ms(r),u=ot(n,i.triggerRef);return m.jsx(bO,{asChild:!0,...a,children:m.jsx(st.button,{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":o?"":void 0,disabled:o,...s,ref:u,onPointerDown:je(e.onPointerDown,d=>{!o&&d.button===0&&d.ctrlKey===!1&&(i.onOpenToggle(),i.open||d.preventDefault())}),onKeyDown:je(e.onKeyDown,d=>{o||(["Enter"," "].includes(d.key)&&i.onOpenToggle(),d.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})},"DropdownMenuTrigger")),jO=ps(t=>{const{__scopeDropdownMenu:e,...n}=t,r=ms(e);return m.jsx(kO,{...r,...n})},"DropdownMenuPortal"),IO="DropdownMenuContent",PO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=LE(IO,r),i=ms(r),a=C.useRef(!1);return m.jsx(wO,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:je(e.onCloseAutoFocus,u=>{var d;a.current||(d=s.triggerRef.current)==null||d.focus(),a.current=!1,u.preventDefault()}),onInteractOutside:je(e.onInteractOutside,u=>{const d=u.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,f=d.button===2||h;(!s.modal||f)&&(a.current=!0)}),style:{...e.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)"}})},"DropdownMenuContent")),LO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ms(r);return m.jsx(CO,{...s,...o,ref:n})},"DropdownMenuLabel")),zO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ms(r);return m.jsx(SO,{...s,...o,ref:n})},"DropdownMenuItem")),FO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ms(r);return m.jsx(EO,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),$O=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ms(r);return m.jsx(_O,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),BO=C.forwardRef(ps(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ms(r);return m.jsx(TO,{...s,...o,ref:n})},"DropdownMenuSeparator")),VO=DO,HO=OO,UO=jO,WO=PO,qO=LO,KO=zO,GO=FO,JO=$O,ZO=BO,YO=Object.defineProperty,XO=(t,e)=>YO(t,"name",{value:e,configurable:!0}),QO=C.forwardRef(XO(function(e,n){return m.jsx(st.label,{...e,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),ej=QO,tj=Object.defineProperty,nj=(t,e)=>tj(t,"name",{value:e,configurable:!0});function zE(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}nj(zE,"usePrevious");var rj=Object.defineProperty,oj=(t,e)=>rj(t,"name",{value:e,configurable:!0});function D1(t,[e,n]){return Math.min(n,Math.max(e,t))}oj(D1,"clamp");var sj=Object.defineProperty,Qe=(t,e)=>sj(t,"name",{value:e,configurable:!0}),ij=[" ","Enter","ArrowUp","ArrowDown"],aj=[" ","Enter"],sl="Select",[Tp,Np,lj]=fp(sl),[da,bee]=Ao(sl,[lj,El]),lx=El(),[uj,gi]=da(sl),[cj,dj]=da(sl);function FE(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:g,required:x,form:v,internal_do_not_use_render:b}=t,k=lx(e),[E,_]=C.useState(null),[T,A]=C.useState(null),[D,R]=C.useState(!1),O=hp(d),[P,j]=Qi({prop:r,defaultProp:o??!1,onChange:s,caller:sl}),[W,Z]=Qi({prop:i,defaultProp:a,onChange:u,caller:sl}),J=C.useRef(null),K=C.useRef(W);C.useEffect(()=>{const V=v?E==null?void 0:E.ownerDocument.getElementById(v):E==null?void 0:E.form;if(V instanceof HTMLFormElement){const re=Qe(()=>Z(K.current),"reset");return V.addEventListener("reset",re),()=>V.removeEventListener("reset",re)}},[v,E,Z]);const Y=E?!!v||!!E.closest("form"):!0,[ee,G]=C.useState(new Set),X=Co(),q=Array.from(ee).map(V=>V.props.value).join(";"),te=C.useCallback(V=>{G(re=>new Set(re).add(V))},[]),F=C.useCallback(V=>{G(re=>{const he=new Set(re);return he.delete(V),he})},[]),L={required:x,trigger:E,onTriggerChange:_,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:D,onValueNodeHasChildrenChange:R,contentId:X,value:W,onValueChange:Z,open:P,onOpenChange:j,dir:O,triggerPointerDownPosRef:J,disabled:g,name:h,autoComplete:f,form:v,nativeOptions:ee,nativeSelectKey:q,isFormControl:Y};return m.jsx(Qy,{...k,children:m.jsx(uj,{scope:e,...L,children:m.jsx(Tp.Provider,{scope:e,children:m.jsx(cj,{scope:e,onNativeOptionAdd:te,onNativeOptionRemove:F,children:HE(b)?b(L):n})})})})}Qe(FE,"SelectProvider");var fj=Qe(t=>{const{__scopeSelect:e,children:n,...r}=t;return m.jsx(FE,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>m.jsxs(m.Fragment,{children:[n,o?m.jsx(zj,{__scopeSelect:e}):null]})})},"Select"),hj="SelectTrigger",pj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=lx(r),a=gi(hj,r),u=a.disabled||o,d=ot(n,a.onTriggerChange),h=Np(r),f=C.useRef("touch"),[g,x,v]=cx(k=>{const E=h().filter(A=>!A.disabled),_=E.find(A=>A.value===a.value),T=dx(E,k,_);T!==void 0&&a.onValueChange(T.value)}),b=Qe(k=>{u||(a.onOpenChange(!0),v()),k&&(a.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return m.jsx(ex,{asChild:!0,...i,children:m.jsx(st.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Rc(a.value)?"":void 0,...s,ref:d,onClick:je(s.onClick,k=>{k.currentTarget.focus(),f.current!=="mouse"&&b(k)}),onPointerDown:je(s.onPointerDown,k=>{f.current=k.pointerType;const E=k.target;E.hasPointerCapture(k.pointerId)&&E.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(b(k),k.preventDefault())}),onKeyDown:je(s.onKeyDown,k=>{const E=g.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&x(k.key),!(E&&k.key===" ")&&ij.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),mj="SelectValue",gj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...u}=e,d=gi(mj,r),{onValueNodeHasChildrenChange:h}=d,f=i!==void 0,g=ot(n,d.onValueNodeChange);It(()=>{h(f)},[h,f]);const x=Rc(d.value);return m.jsx(st.span,{...u,asChild:x?!1:u.asChild,ref:g,style:{pointerEvents:"none"},children:m.jsx(C.Fragment,{children:x?a:i},x?"placeholder":"value")})},"SelectValue")),yj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return m.jsx(st.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),xj="SelectPortal",[vj,bj]=da(xj,{forceMount:void 0}),kj=Qe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return m.jsx(vj,{scope:t.__scopeSelect,forceMount:n,children:m.jsx(mp,{asChild:!0,...r})})},"SelectPortal"),na="SelectContent",wj=C.forwardRef(Qe(function(e,n){const r=bj(na,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=gi(na,e.__scopeSelect),[a,u]=C.useState();return It(()=>{u(new DocumentFragment)},[]),m.jsx(fs,{present:o||i.open,children:({present:d})=>d?m.jsx(Ej,{...s,ref:n}):m.jsx(Cj,{...s,fragment:a})})},"SelectContent")),Cj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Kr.createPortal(m.jsx($E,{scope:r,children:m.jsx(Tp.Slot,{scope:r,children:m.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),Ur=10,[$E,fa]=da(na),Sj=Eo("SelectContent.RemoveScroll"),Ej=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:u,sideOffset:d,align:h,alignOffset:f,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E,..._}=e,T=gi(na,r),[A,D]=C.useState(null),[R,O]=C.useState(null),P=ot(n,D),[j,W]=C.useState(null),[Z,J]=C.useState(null),K=Np(r),[Y,ee]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(A)return Uy(A)},[A]),Mc();const X=C.useCallback(Q=>{const[de,...me]=K().map(Be=>Be.ref.current),[Fe]=me.slice(-1),Oe=document.activeElement;for(const Be of Q)if(Be===Oe||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===de&&R&&(R.scrollTop=0),Be===Fe&&R&&(R.scrollTop=R.scrollHeight),Be==null||Be.focus(),document.activeElement!==Oe))return},[K,R]),q=C.useCallback(()=>X([j,A]),[X,j,A]);C.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:te,triggerPointerDownPosRef:F}=T;C.useEffect(()=>{if(A){let Q={x:0,y:0};const de=Qe(Fe=>{var Oe,Be;Q={x:Math.abs(Math.round(Fe.pageX)-(((Oe=F.current)==null?void 0:Oe.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Be=F.current)==null?void 0:Be.y)??0))}},"handlePointerMove"),me=Qe(Fe=>{Q.x<=10&&Q.y<=10?Fe.preventDefault():Fe.composedPath().includes(A)||te(!1),document.removeEventListener("pointermove",de),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",me,{capture:!0})}}},[A,te,F]),C.useEffect(()=>{const Q=Qe(()=>te(!1),"close");return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[te]);const[L,V]=cx(Q=>{const de=K().filter(Oe=>!Oe.disabled),me=de.find(Oe=>Oe.ref.current===document.activeElement),Fe=dx(de,Q,me);Fe&&setTimeout(()=>{var Oe;return(Oe=Fe.ref.current)==null?void 0:Oe.focus()})}),re=C.useCallback((Q,de,me)=>{const Fe=!G.current&&!me;(T.value!==void 0&&T.value===de||Fe)&&(W(Q),Fe&&(G.current=!0))},[T.value]),he=C.useCallback(()=>A==null?void 0:A.focus(),[A]),ce=C.useCallback((Q,de,me)=>{const Fe=!G.current&&!me;(T.value!==void 0&&T.value===de||Fe)&&J(Q)},[T.value]),pe=o==="popper"?Q2:_j,Re=pe===Q2?{side:u,sideOffset:d,align:h,alignOffset:f,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E}:{};return m.jsx($E,{scope:r,content:A,viewport:R,onViewportChange:O,itemRefCallback:re,selectedItem:j,onItemLeave:he,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:Z,position:o,isPositioned:Y,searchRef:L,children:m.jsx(yp,{as:Sj,allowPinchZoom:!0,children:m.jsx(By,{asChild:!0,trapped:T.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:je(s,Q=>{var de;(de=T.trigger)==null||de.focus({preventScroll:!0}),Q.preventDefault()}),children:m.jsx(pp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:m.jsx(pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:Q=>Q.preventDefault(),..._,...Re,onPlaced:()=>ee(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:je(_.onKeyDown,Q=>{const de=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!de&&Q.key.length===1&&V(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Fe=K().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Oe=Q.target,Be=Fe.indexOf(Oe);Fe=Fe.slice(Be+1)}setTimeout(()=>X(Fe)),Q.preventDefault()}})})})})})})},"SelectContentImpl")),_j=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=gi(na,r),a=fa(na,r),[u,d]=C.useState(null),[h,f]=C.useState(null),g=ot(n,f),x=Np(r),v=C.useRef(!1),b=C.useRef(!0),{viewport:k,selectedItem:E,selectedItemText:_,focusSelectedItem:T}=a,A=C.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&h&&k&&E&&_){const P=i.trigger.getBoundingClientRect(),j=h.getBoundingClientRect(),W=i.valueNode.getBoundingClientRect(),Z=_.getBoundingClientRect();if(i.dir!=="rtl"){const Oe=Z.left-j.left,Be=W.left-Oe,Ye=P.left-Be,Mt=P.width+Ye,zt=Math.max(Mt,j.width),qt=window.innerWidth-Ur,Hn=D1(Be,[Ur,Math.max(Ur,qt-zt)]);u.style.minWidth=Mt+"px",u.style.left=Hn+"px"}else{const Oe=j.right-Z.right,Be=window.innerWidth-W.right-Oe,Ye=window.innerWidth-P.right-Be,Mt=P.width+Ye,zt=Math.max(Mt,j.width),qt=window.innerWidth-Ur,Hn=D1(Be,[Ur,Math.max(Ur,qt-zt)]);u.style.minWidth=Mt+"px",u.style.right=Hn+"px"}const J=x(),K=window.innerHeight-Ur*2,Y=k.scrollHeight,ee=window.getComputedStyle(h),G=parseInt(ee.borderTopWidth,10),X=parseInt(ee.paddingTop,10),q=parseInt(ee.borderBottomWidth,10),te=parseInt(ee.paddingBottom,10),F=G+X+Y+te+q,L=Math.min(E.offsetHeight*5,F),V=window.getComputedStyle(k),re=parseInt(V.paddingTop,10),he=parseInt(V.paddingBottom,10),ce=P.top+P.height/2-Ur,pe=K-ce,Re=E.offsetHeight/2,Q=E.offsetTop+Re,de=G+X+Q,me=F-de;if(de<=ce){const Oe=J.length>0&&E===J[J.length-1].ref.current;u.style.bottom="0px";const Be=h.clientHeight-k.offsetTop-k.offsetHeight,Ye=Math.max(pe,Re+(Oe?he:0)+Be+q),Mt=de+Ye;u.style.height=Mt+"px"}else{const Oe=J.length>0&&E===J[0].ref.current;u.style.top="0px";const Ye=Math.max(ce,G+k.offsetTop+(Oe?re:0)+Re)+me;u.style.height=Ye+"px",k.scrollTop=de-ce+k.offsetTop}u.style.margin=`${Ur}px 0`,u.style.minHeight=L+"px",u.style.maxHeight=K+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,h,k,E,_,i.dir,o]);It(()=>A(),[A]);const[D,R]=C.useState();It(()=>{h&&R(window.getComputedStyle(h).zIndex)},[h]);const O=C.useCallback(P=>{P&&b.current===!0&&(A(),T==null||T(),b.current=!1)},[A,T]);return m.jsx(Tj,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:m.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:m.jsx(st.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Q2=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=Ur,...i}=e,a=lx(r);return m.jsx(tx,{...a,...i,ref:n,align:o,collisionPadding:s,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)"}})},"SelectPopperPosition")),[Tj,ux]=da(na,{}),ew="SelectViewport",Nj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=fa(ew,r),a=ux(ew,r),u=ot(n,i.onViewportChange),d=C.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("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}"},nonce:o}),m.jsx(Tp.Slot,{scope:r,children:m.jsx(st.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:je(s.onScroll,h=>{const f=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=a;if(x!=null&&x.current&&g){const v=Math.abs(d.current-f.scrollTop);if(v>0){const b=window.innerHeight-Ur*2,k=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),_=Math.max(k,E);if(_<b){const T=_+v,A=Math.min(b,T),D=T-A;g.style.height=A+"px",g.style.bottom==="0px"&&(f.scrollTop=D>0?D:0,g.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})},"SelectViewport")),Aj="SelectGroup",[kee,wee]=da(Aj),R1="SelectItem",[Mj,BE]=da(R1),Dj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,u=gi(R1,r),d=fa(R1,r),h=u.value===o,[f,g]=C.useState(i??""),[x,v]=C.useState(!1),b=jr(A=>{var D;return(D=d.itemRefCallback)==null?void 0:D.call(d,A,o,s)}),k=ot(n,b),E=Co(),_=C.useRef("touch"),T=Qe(()=>{s||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return m.jsx(Mj,{scope:r,value:o,disabled:s,textId:E,isSelected:h,onItemTextChange:C.useCallback(A=>{g(D=>D||((A==null?void 0:A.textContent)??"").trim())},[]),children:m.jsx(Tp.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:m.jsx(st.div,{role:"option","aria-labelledby":E,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:k,onFocus:je(a.onFocus,()=>v(!0)),onBlur:je(a.onBlur,()=>v(!1)),onClick:je(a.onClick,()=>{_.current!=="mouse"&&T()}),onPointerUp:je(a.onPointerUp,()=>{_.current==="mouse"&&T()}),onPointerDown:je(a.onPointerDown,A=>{_.current=A.pointerType}),onPointerMove:je(a.onPointerMove,A=>{var D;_.current=A.pointerType,s?(D=d.onItemLeave)==null||D.call(d):_.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(a.onPointerLeave,A=>{var D;A.currentTarget===document.activeElement&&((D=d.onItemLeave)==null||D.call(d))}),onKeyDown:je(a.onKeyDown,A=>{var R;s||A.target!==A.currentTarget||((R=d.searchRef)==null?void 0:R.current)!==""&&A.key===" "||(aj.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),vf="SelectItemText",Rj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=gi(vf,r),u=fa(vf,r),d=BE(vf,r),h=dj(vf,r),[f,g]=C.useState(null),x=jr(T=>{var A;return(A=u.itemTextRefCallback)==null?void 0:A.call(u,T,d.value,d.disabled)}),v=ot(n,g,d.onItemTextChange,x),b=f==null?void 0:f.textContent,k=C.useMemo(()=>m.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return It(()=>(E(k),()=>_(k)),[E,_,k]),m.jsxs(m.Fragment,{children:[m.jsx(st.span,{id:d.textId,...i,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Rc(a.value)?Kr.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),Oj="SelectItemIndicator",jj=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,...o}=e;return BE(Oj,r).isSelected?m.jsx(st.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),tw="SelectScrollUpButton",Ij=C.forwardRef(Qe(function(e,n){const r=fa(tw,e.__scopeSelect),o=ux(tw,e.__scopeSelect),[s,i]=C.useState(!1),a=ot(n,o.onScrollButtonChange);return It(()=>{if(r.viewport&&r.isPositioned){let u=function(){const h=d.scrollTop>0;i(h)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?m.jsx(VE,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),nw="SelectScrollDownButton",Pj=C.forwardRef(Qe(function(e,n){const r=fa(nw,e.__scopeSelect),o=ux(nw,e.__scopeSelect),[s,i]=C.useState(!1),a=ot(n,o.onScrollButtonChange);return It(()=>{if(r.viewport&&r.isPositioned){let u=function(){const h=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<h;i(f)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?m.jsx(VE,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),VE=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onAutoScroll:o,...s}=e,i=fa("SelectScrollButton",r),a=C.useRef(null),u=Np(r),d=C.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return C.useEffect(()=>()=>d(),[d]),It(()=>{var f;const h=u().find(g=>g.ref.current===document.activeElement);(f=h==null?void 0:h.ref.current)==null||f.scrollIntoView({block:"nearest"})},[u]),m.jsx(st.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:je(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:je(s.onPointerMove,()=>{var h;(h=i.onItemLeave)==null||h.call(i),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:je(s.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),Lj="SelectBubbleInput",zj=C.forwardRef(Qe(function({__scopeSelect:e,...n},r){const o=gi(Lj,e),{value:s,onValueChange:i,required:a,disabled:u,name:d,autoComplete:h,form:f}=o,{nativeOptions:g,nativeSelectKey:x}=o,v=C.useRef(null),b=ot(r,v),k=s??"",E=zE(k),_=Array.from(g).some(T=>(T.props.value??"")==="");return C.useEffect(()=>{const T=v.current;if(!T)return;const A=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(A,"value").set;if(E!==k&&R){const O=new Event("change",{bubbles:!0});R.call(T,k),T.dispatchEvent(O)}},[E,k]),m.jsxs(st.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:d,autoComplete:h,disabled:u,form:f,onChange:T=>i(T.target.value),...n,style:{...h3,...n.style},ref:b,defaultValue:k,children:[Rc(s)&&!_?m.jsx("option",{value:""}):null,Array.from(g)]},x)},"SelectBubbleInput"));function HE(t){return typeof t=="function"}Qe(HE,"isFunction");function Rc(t){return t===""||t===void 0}Qe(Rc,"shouldShowPlaceholder");function cx(t){const e=jr(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(i=>{const a=n.current+i;e(a),Qe((function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(a)},[e]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Qe(cx,"useTypeaheadSearch");function dx(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=UE(t,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}Qe(dx,"findNextItem");function UE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Qe(UE,"wrapArray");var Fj=Object.defineProperty,en=(t,e)=>Fj(t,"name",{value:e,configurable:!0}),[fx,Cee]=Ao("Tooltip",[El]),Ap=El(),$j="TooltipProvider",Bj=700,O1="tooltip.open",[Vj,hx]=fx($j),Hj=en(t=>{const{__scopeTooltip:e,delayDuration:n=Bj,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=C.useRef(!0),a=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),m.jsx(Vj,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:C.useCallback(()=>{r<=0||(window.clearTimeout(u.current),i.current=!1)},[r]),onClose:C.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),j1="Tooltip",[Uj,Oc]=fx(j1),Wj=en(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,u=hx(j1,t.__scopeTooltip),d=Ap(e),[h,f]=C.useState(null),[g,x]=C.useState(void 0),v=Co(),b=C.useRef(0),k=i??u.disableHoverableContent,E=a??u.delayDuration,_=C.useRef(!1),[T,A]=Qi({prop:r,defaultProp:o??!1,onChange:en(W=>{W?(u.onOpen(),document.dispatchEvent(new CustomEvent(O1))):u.onClose(),s==null||s(W)},"onChange"),caller:j1}),D=C.useMemo(()=>T?_.current?"delayed-open":"instant-open":"closed",[T]),R=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,A(!0)},[A]),O=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,A(!1)},[A]),P=C.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,A(!0),b.current=0},E)},[E,A]);C.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=g??v;return m.jsx(Qy,{...d,children:m.jsx(Uj,{scope:e,contentId:j,setContentId:x,open:T,stateAttribute:D,trigger:h,onTriggerChange:f,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?P():R()},[u.isOpenDelayedRef,P,R]),onTriggerLeave:C.useCallback(()=>{k?O():(window.clearTimeout(b.current),b.current=0)},[O,k]),onOpen:R,onClose:O,disableHoverableContent:k,children:n})})},"Tooltip"),rw="TooltipTrigger",qj=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Oc(rw,r),i=hx(rw,r),a=Ap(r),u=C.useRef(null),d=ot(n,u,s.onTriggerChange),h=C.useRef(!1),f=C.useRef(!1),g=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),m.jsx(ex,{asChild:!0,...a,children:m.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:d,onPointerMove:je(e.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:je(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:je(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:je(e.onBlur,s.onClose),onClick:je(e.onClick,s.onClose)})})},"TooltipTrigger")),WE="TooltipPortal",[Kj,Gj]=fx(WE,{forceMount:void 0}),Jj=en(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Oc(WE,e);return m.jsx(Kj,{scope:e,forceMount:n,children:m.jsx(fs,{present:n||s.open,children:m.jsx(mp,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Yu="TooltipContent",Zj=C.forwardRef(en(function(e,n){const r=Gj(Yu,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=Oc(Yu,e.__scopeTooltip);return m.jsx(fs,{present:o||a.open,children:a.disableHoverableContent?m.jsx(qE,{side:s,...i,ref:n}):m.jsx(Yj,{side:s,...i,ref:n})})},"TooltipContent")),Yj=C.forwardRef(en(function(e,n){const r=Oc(Yu,e.__scopeTooltip),o=hx(Yu,e.__scopeTooltip),s=C.useRef(null),i=ot(n,s),[a,u]=C.useState(null),{trigger:d,onClose:h}=r,f=s.current,{onPointerInTransitChange:g}=o,x=C.useCallback(()=>{u(null),g(!1)},[g]),v=C.useCallback((b,k)=>{const E=b.currentTarget,_={x:b.clientX,y:b.clientY},T=KE(_,E.getBoundingClientRect()),A=GE(_,T),D=JE(k.getBoundingClientRect()),R=YE([...A,...D]);u(R),g(!0)},[g]);return C.useEffect(()=>()=>x(),[x]),C.useEffect(()=>{if(d&&f){const b=en(E=>v(E,f),"handleTriggerLeave"),k=en(E=>v(E,d),"handleContentLeave");return d.addEventListener("pointerleave",b),f.addEventListener("pointerleave",k),()=>{d.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",k)}}},[d,f,v,x]),C.useEffect(()=>{if(a){const b=en(k=>{const E=k.target,_={x:k.clientX,y:k.clientY},T=(d==null?void 0:d.contains(E))||(f==null?void 0:f.contains(E)),A=!ZE(_,a);T?x():A&&(x(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,f,a,h,x]),m.jsx(qE,{...e,ref:i})},"TooltipContentHoverable")),Xj=l3("TooltipContent"),qE=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:u,...d}=e,h=Oc(Yu,r),f=Ap(r),{onClose:g}=h;C.useEffect(()=>(document.addEventListener(O1,g),()=>document.removeEventListener(O1,g)),[g]),C.useEffect(()=>{if(h.trigger){const v=en(b=>{b.target instanceof Node&&b.target.contains(h.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,g]);const{setContentId:x}=h;return It(()=>(x(i),()=>{x(void 0)}),[i,x]),m.jsx(pp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:g,children:m.jsxs(tx,{"data-state":h.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:h.contentId,...f,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Xj,{children:o}),s?m.jsx(T5,{id:h.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),Qj=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Ap(r);return m.jsx(M8,{...s,...o,ref:n})},"TooltipArrow"));function KE(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}en(KE,"getExitSideFromRect");function GE(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}en(GE,"getPaddedExitPoints");function JE(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}en(JE,"getPointsFromRect");function ZE(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],u=e[i],d=a.x,h=a.y,f=u.x,g=u.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(o=!o)}return o}en(ZE,"isPointInPolygon");function YE(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),XE(e)}en(YE,"getHull");function XE(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}en(XE,"getHullPresorted");var eI=Hj,tI=Wj,nI=qj,rI=Jj,oI=Zj,sI=Qj;const iI=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},aI=(t,e)=>({classGroupId:t,validator:e}),QE=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),ah="-",ow=[],lI="arbitrary..",uI=t=>{const e=dI(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return cI(i);const a=i.split(ah),u=a[0]===""&&a.length>1?1:0;return e_(a,u,e)},getConflictingClassGroupIds:(i,a)=>{if(a){const u=r[i],d=n[i];return u?d?iI(d,u):u:d||ow}return n[i]||ow}}},e_=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],s=n.nextPart.get(o);if(s){const d=e_(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const a=e===0?t.join(ah):t.slice(e).join(ah),u=i.length;for(let d=0;d<u;d++){const h=i[d];if(h.validator(a))return h.classGroupId}},cI=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?lI+r:void 0})(),dI=t=>{const{theme:e,classGroups:n}=t;return fI(n,e)},fI=(t,e)=>{const n=QE();for(const r in t){const o=t[r];px(o,n,r,e)}return n},px=(t,e,n,r)=>{const o=t.length;for(let s=0;s<o;s++){const i=t[s];hI(i,e,n,r)}},hI=(t,e,n,r)=>{if(typeof t=="string"){pI(t,e,n);return}if(typeof t=="function"){mI(t,e,n,r);return}gI(t,e,n,r)},pI=(t,e,n)=>{const r=t===""?e:t_(e,t);r.classGroupId=n},mI=(t,e,n,r)=>{if(yI(t)){px(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(aI(n,t))},gI=(t,e,n,r)=>{const o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[a,u]=o[i];px(u,t_(e,a),n,r)}},t_=(t,e)=>{let n=t;const r=e.split(ah),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=QE(),n.nextPart.set(i,a)),n=a}return n},yI=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,xI=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},I1="!",sw=":",vI=[],iw=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),bI=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const s=[];let i=0,a=0,u=0,d;const h=o.length;for(let b=0;b<h;b++){const k=o[b];if(i===0&&a===0){if(k===sw){s.push(o.slice(u,b)),u=b+1;continue}if(k==="/"){d=b;continue}}k==="["?i++:k==="]"?i--:k==="("?a++:k===")"&&a--}const f=s.length===0?o:o.slice(u);let g=f,x=!1;f.endsWith(I1)?(g=f.slice(0,-1),x=!0):f.startsWith(I1)&&(g=f.slice(1),x=!0);const v=d&&d>u?d-u:void 0;return iw(s,x,g,v)};if(e){const o=e+sw,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):iw(vI,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},kI=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",u=e.has(i);a||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},wI=t=>({cache:xI(t.cacheSize),parseClassName:bI(t),sortModifiers:kI(t),postfixLookupClassGroupIds:CI(t),...uI(t)}),CI=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},SI=/\s+/,EI=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=e,a=[],u=t.trim().split(SI);let d="";for(let h=u.length-1;h>=0;h-=1){const f=u[h],{isExternal:g,modifiers:x,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(f);if(g){d=f+(d.length>0?" "+d:d);continue}let E=!!k,_;if(E){const O=b.substring(0,k);_=r(O);const P=_&&i[_]?r(b):void 0;P&&P!==_&&(_=P,E=!1)}else _=r(b);if(!_){if(!E){d=f+(d.length>0?" "+d:d);continue}if(_=r(b),!_){d=f+(d.length>0?" "+d:d);continue}E=!1}const T=x.length===0?"":x.length===1?x[0]:s(x).join(":"),A=v?T+I1:T,D=A+_;if(a.indexOf(D)>-1)continue;a.push(D);const R=o(_,E);for(let O=0;O<R.length;++O){const P=R[O];a.push(A+P)}d=f+(d.length>0?" "+d:d)}return d},_I=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=n_(n))&&(o&&(o+=" "),o+=r);return o},n_=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=n_(t[r]))&&(n&&(n+=" "),n+=e);return n},TI=(t,...e)=>{let n,r,o,s;const i=u=>{const d=e.reduce((h,f)=>f(h),t());return n=wI(d),r=n.cache.get,o=n.cache.set,s=a,a(u)},a=u=>{const d=r(u);if(d)return d;const h=EI(u,n);return o(u,h),h};return s=i,(...u)=>s(_I(...u))},NI=[],Xt=t=>{const e=n=>n[t]||NI;return e.isThemeGetter=!0,e},r_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,o_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,MI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DI=/\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$/,RI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ls=t=>AI.test(t),qe=t=>!!t&&!Number.isNaN(Number(t)),fo=t=>!!t&&Number.isInteger(Number(t)),cg=t=>t.endsWith("%")&&qe(t.slice(0,-1)),Uo=t=>MI.test(t),s_=()=>!0,II=t=>DI.test(t)&&!RI.test(t),mx=()=>!1,PI=t=>OI.test(t),LI=t=>jI.test(t),zI=t=>!be(t)&&!we(t),FI=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),$I=t=>yi(t,l_,mx),be=t=>r_.test(t),zi=t=>yi(t,u_,II),aw=t=>yi(t,GI,qe),BI=t=>yi(t,d_,s_),VI=t=>yi(t,c_,mx),lw=t=>yi(t,i_,mx),HI=t=>yi(t,a_,LI),bf=t=>yi(t,f_,PI),we=t=>o_.test(t),pu=t=>ha(t,u_),UI=t=>ha(t,c_),uw=t=>ha(t,i_),WI=t=>ha(t,l_),qI=t=>ha(t,a_),kf=t=>ha(t,f_,!0),KI=t=>ha(t,d_,!0),yi=(t,e,n)=>{const r=r_.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},ha=(t,e,n=!1)=>{const r=o_.exec(t);return r?r[1]?e(r[1]):n:!1},i_=t=>t==="position"||t==="percentage",a_=t=>t==="image"||t==="url",l_=t=>t==="length"||t==="size"||t==="bg-size",u_=t=>t==="length",GI=t=>t==="number",c_=t=>t==="family-name",d_=t=>t==="number"||t==="weight",f_=t=>t==="shadow",JI=()=>{const t=Xt("color"),e=Xt("font"),n=Xt("text"),r=Xt("font-weight"),o=Xt("tracking"),s=Xt("leading"),i=Xt("breakpoint"),a=Xt("container"),u=Xt("spacing"),d=Xt("radius"),h=Xt("shadow"),f=Xt("inset-shadow"),g=Xt("text-shadow"),x=Xt("drop-shadow"),v=Xt("blur"),b=Xt("perspective"),k=Xt("aspect"),E=Xt("ease"),_=Xt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),we,be],R=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],P=()=>[we,be,u],j=()=>[Ls,"full","auto",...P()],W=()=>[fo,"none","subgrid",we,be],Z=()=>["auto",{span:["full",fo,we,be]},fo,we,be],J=()=>[fo,"auto",we,be],K=()=>["auto","min","max","fr",we,be],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...P()],X=()=>[Ls,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],q=()=>[Ls,"screen","full","dvw","lvw","svw","min","max","fit",...P()],te=()=>[Ls,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],F=()=>[t,we,be],L=()=>[...A(),uw,lw,{position:[we,be]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",WI,$I,{size:[we,be]}],he=()=>[cg,pu,zi],ce=()=>["","none","full",d,we,be],pe=()=>["",qe,pu,zi],Re=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[qe,cg,uw,lw],me=()=>["","none",v,we,be],Fe=()=>["none",qe,we,be],Oe=()=>["none",qe,we,be],Be=()=>[qe,we,be],Ye=()=>[Ls,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Uo],breakpoint:[Uo],color:[s_],container:[Uo],"drop-shadow":[Uo],ease:["in","out","in-out"],font:[zI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Uo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Uo],shadow:[Uo],spacing:["px",qe],text:[Uo],"text-shadow":[Uo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ls,be,we,k]}],container:["container"],"container-type":[{"@container":["","normal","size",we,be]}],"container-named":[FI],columns:[{columns:[qe,be,we,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],sr:["sr-only","not-sr-only"],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:D()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[fo,"auto",we,be]}],basis:[{basis:[Ls,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Ls,"auto","initial","none",be]}],grow:[{grow:["",qe,we,be]}],shrink:[{shrink:["",qe,we,be]}],order:[{order:[fo,"first","last","none",we,be]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,pu,zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,KI,BI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cg,be]}],"font-family":[{font:[UI,VI,e]}],"font-features":[{"font-features":[be]}],"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-fractions"],tracking:[{tracking:[o,we,be]}],"line-clamp":[{"line-clamp":[qe,"none",we,aw]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",we,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,zi]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[qe,"auto",we,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[fo,we,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fo,we,be],radial:["",we,be],conic:[fo,we,be]},qI,HI]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,be]}],"outline-w":[{outline:["",qe,pu,zi]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",h,kf,bf]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",f,kf,bf]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[qe,zi]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",g,kf,bf]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[qe,we,be]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[we,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,be]}],filter:[{filter:["","none",we,be]}],blur:[{blur:me()}],brightness:[{brightness:[qe,we,be]}],contrast:[{contrast:[qe,we,be]}],"drop-shadow":[{"drop-shadow":["","none",x,kf,bf]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",qe,we,be]}],"hue-rotate":[{"hue-rotate":[qe,we,be]}],invert:[{invert:["",qe,we,be]}],saturate:[{saturate:[qe,we,be]}],sepia:[{sepia:["",qe,we,be]}],"backdrop-filter":[{"backdrop-filter":["","none",we,be]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,be]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,be]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,be]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,be]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,be]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,be]}],ease:[{ease:["linear","initial",E,we,be]}],delay:[{delay:[qe,we,be]}],animate:[{animate:["none",_,we,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,we,be]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Oe()}],"scale-x":[{"scale-x":Oe()}],"scale-y":[{"scale-y":Oe()}],"scale-z":[{"scale-z":Oe()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[we,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],zoom:[{zoom:[fo,we,be]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",we,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",we,be]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[qe,pu,zi,aw]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ZI=TI(JI);function Ce(...t){return ZI(n3(t))}const YI=r3("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function _l({className:t,variant:e="default",asChild:n=!1,...r}){const o=n?i3:"span";return m.jsx(o,{"data-slot":"badge","data-variant":e,className:Ce(YI({variant:e}),t),...r})}const Mp=r3("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}}),Ee=C.forwardRef(({className:t,variant:e="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?i3:"button";return m.jsx(i,{ref:s,"data-slot":"button","data-variant":e,"data-size":n,className:Ce(Mp({variant:e,size:n,className:t})),...o})});Ee.displayName="Button";/**
81
+ * @license lucide-react v1.27.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const h_=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
86
+ * @license lucide-react v1.27.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const XI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
91
+ * @license lucide-react v1.27.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const QI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
96
+ * @license lucide-react v1.27.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const cw=t=>{const e=QI(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
101
+ * @license lucide-react v1.27.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */var dg={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"};/**
106
+ * @license lucide-react v1.27.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const eP=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},tP=C.createContext({}),nP=()=>C.useContext(tP),rP=C.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:x=""}=nP()??{},v=r??f?Number(n??h)*24/Number(e??d):n??h;return C.createElement("svg",{ref:u,...dg,width:e??d??dg.width,height:e??d??dg.height,stroke:t??g,strokeWidth:v,className:h_("lucide",x,o),...!s&&!eP(a)&&{"aria-hidden":"true"},...a},[...i.map(([b,k])=>C.createElement(b,k)),...Array.isArray(s)?s:[s]])});/**
111
+ * @license lucide-react v1.27.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const ge=(t,e)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(rP,{ref:s,iconNode:e,className:h_(`lucide-${XI(cw(t))}`,`lucide-${t}`,r),...o}));return n.displayName=cw(t),n};/**
116
+ * @license lucide-react v1.27.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const oP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],sP=ge("arrow-right",oP);/**
121
+ * @license lucide-react v1.27.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const iP=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],aP=ge("at-sign",iP);/**
126
+ * @license lucide-react v1.27.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const lP=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],uP=ge("bold",lP);/**
131
+ * @license lucide-react v1.27.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const cP=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],dP=ge("book-open",cP);/**
136
+ * @license lucide-react v1.27.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const fP=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],jc=ge("boxes",fP);/**
141
+ * @license lucide-react v1.27.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const hP=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Tl=ge("braces",hP);/**
146
+ * @license lucide-react v1.27.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const pP=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],mP=ge("calendar-days",pP);/**
151
+ * @license lucide-react v1.27.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const gP=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],yP=ge("calendar",gP);/**
156
+ * @license lucide-react v1.27.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const xP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ic=ge("check",xP);/**
161
+ * @license lucide-react v1.27.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const vP=[["path",{d:"M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",key:"1qvrer"}],["path",{d:"M6 17h12",key:"1jwigz"}]],bP=ge("chef-hat",vP);/**
166
+ * @license lucide-react v1.27.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const kP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gx=ge("chevron-down",kP);/**
171
+ * @license lucide-react v1.27.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const wP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],CP=ge("chevron-left",wP);/**
176
+ * @license lucide-react v1.27.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const SP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dp=ge("chevron-right",SP);/**
181
+ * @license lucide-react v1.27.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const EP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],_P=ge("chevrons-down-up",EP);/**
186
+ * @license lucide-react v1.27.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const TP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],NP=ge("chevron-up",TP);/**
191
+ * @license lucide-react v1.27.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const AP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],p_=ge("chevrons-up-down",AP);/**
196
+ * @license lucide-react v1.27.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const MP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],yx=ge("circle-alert",MP);/**
201
+ * @license lucide-react v1.27.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const DP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],RP=ge("circle-check",DP);/**
206
+ * @license lucide-react v1.27.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const OP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],jP=ge("code",OP);/**
211
+ * @license lucide-react v1.27.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const IP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],m_=ge("copy",IP);/**
216
+ * @license lucide-react v1.27.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const PP=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],LP=ge("download",PP);/**
221
+ * @license lucide-react v1.27.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const zP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],g_=ge("external-link",zP);/**
226
+ * @license lucide-react v1.27.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const FP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$P=ge("eye",FP);/**
231
+ * @license lucide-react v1.27.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const BP=[["path",{d:"M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6",key:"14cnrg"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1",key:"sr0ebq"}],["path",{d:"M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1",key:"w793db"}]],VP=ge("file-braces-corner",BP);/**
236
+ * @license lucide-react v1.27.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const HP=[["path",{d:"M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",key:"1ckgky"}],["path",{d:"M20 8v12a2 2 0 0 1-2 2h-4.182",key:"1726p0"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"M4 10.592V4a2 2 0 0 1 2-2h8",key:"1foop0"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],UP=ge("file-cog",HP);/**
241
+ * @license lucide-react v1.27.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const WP=[["path",{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1",key:"likhh7"}],["path",{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1",key:"17ky3x"}],["path",{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z",key:"1hyeo0"}]],qP=ge("file-stack",WP);/**
246
+ * @license lucide-react v1.27.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const KP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],GP=ge("file-text",KP);/**
251
+ * @license lucide-react v1.27.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const JP=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],y_=ge("folder-git-2",JP);/**
256
+ * @license lucide-react v1.27.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const ZP=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],YP=ge("git-branch",ZP);/**
261
+ * @license lucide-react v1.27.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const XP=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],xx=ge("grip-vertical",XP);/**
266
+ * @license lucide-react v1.27.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const QP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],e9=ge("hash",QP);/**
271
+ * @license lucide-react v1.27.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const t9=[["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"}]],n9=ge("heading-2",t9);/**
276
+ * @license lucide-react v1.27.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const r9=[["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"}]],o9=ge("heading-3",r9);/**
281
+ * @license lucide-react v1.27.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const s9=[["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"}]],x_=ge("image",s9);/**
286
+ * @license lucide-react v1.27.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const i9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],a9=ge("info",i9);/**
291
+ * @license lucide-react v1.27.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const l9=[["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"}]],u9=ge("italic",l9);/**
296
+ * @license lucide-react v1.27.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const c9=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],d9=ge("key-round",c9);/**
301
+ * @license lucide-react v1.27.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const f9=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],h9=ge("layout-grid",f9);/**
306
+ * @license lucide-react v1.27.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const p9=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],v_=ge("link-2",p9);/**
311
+ * @license lucide-react v1.27.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const m9=[["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"}]],g9=ge("link",m9);/**
316
+ * @license lucide-react v1.27.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const y9=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],x9=ge("list-ordered",y9);/**
321
+ * @license lucide-react v1.27.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const v9=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],b_=ge("list",v9);/**
326
+ * @license lucide-react v1.27.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const b9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ln=ge("loader-circle",b9);/**
331
+ * @license lucide-react v1.27.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const k9=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],w9=ge("newspaper",k9);/**
336
+ * @license lucide-react v1.27.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const C9=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],S9=ge("octagon-x",C9);/**
341
+ * @license lucide-react v1.27.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const E9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],k_=ge("palette",E9);/**
346
+ * @license lucide-react v1.27.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const _9=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],w_=ge("pencil-ruler",_9);/**
351
+ * @license lucide-react v1.27.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const T9=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],fg=ge("play",T9);/**
356
+ * @license lucide-react v1.27.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const N9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],li=ge("plus",N9);/**
361
+ * @license lucide-react v1.27.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const A9=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],M9=ge("quote",A9);/**
366
+ * @license lucide-react v1.27.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const D9=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],R9=ge("redo-2",D9);/**
371
+ * @license lucide-react v1.27.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const O9=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],C_=ge("refresh-cw",O9);/**
376
+ * @license lucide-react v1.27.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const j9=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],S_=ge("rocket",j9);/**
381
+ * @license lucide-react v1.27.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const I9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],P9=ge("rotate-ccw-clock",I9);/**
386
+ * @license lucide-react v1.27.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const L9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],z9=ge("rotate-ccw",L9);/**
391
+ * @license lucide-react v1.27.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const F9=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],$9=ge("save",F9);/**
396
+ * @license lucide-react v1.27.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const B9=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],V9=ge("search-x",B9);/**
401
+ * @license lucide-react v1.27.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const H9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],U9=ge("search",H9);/**
406
+ * @license lucide-react v1.27.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const W9=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],q9=ge("shopping-bag",W9);/**
411
+ * @license lucide-react v1.27.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const K9=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],il=ge("sparkles",K9);/**
416
+ * @license lucide-react v1.27.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const G9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],J9=ge("square",G9);/**
421
+ * @license lucide-react v1.27.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const Z9=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Y9=ge("tags",Z9);/**
426
+ * @license lucide-react v1.27.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const X9=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Q9=ge("terminal",X9);/**
431
+ * @license lucide-react v1.27.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const eL=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],tL=ge("toggle-left",eL);/**
436
+ * @license lucide-react v1.27.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const nL=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],E_=ge("trash-2",nL);/**
441
+ * @license lucide-react v1.27.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const rL=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pc=ge("triangle-alert",rL);/**
446
+ * @license lucide-react v1.27.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const oL=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],sL=ge("type",oL);/**
451
+ * @license lucide-react v1.27.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const iL=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],aL=ge("undo-2",iL);/**
456
+ * @license lucide-react v1.27.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const lL=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Xu=ge("upload",lL);/**
461
+ * @license lucide-react v1.27.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const uL=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],cL=ge("user",uL);/**
466
+ * @license lucide-react v1.27.0 - ISC
467
+ *
468
+ * This source code is licensed under the ISC license.
469
+ * See the LICENSE file in the root directory of this source tree.
470
+ */const dL=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pa=ge("x",dL);function Lc({...t}){return m.jsx(WD,{"data-slot":"dialog",...t})}function fL({...t}){return m.jsx(KD,{"data-slot":"dialog-trigger",...t})}function hL({...t}){return m.jsx(JD,{"data-slot":"dialog-portal",...t})}function Rp({...t}){return m.jsx(qy,{"data-slot":"dialog-close",...t})}function pL({className:t,...e}){return m.jsx(ZD,{"data-slot":"dialog-overlay",className:Ce("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...e})}function zc({className:t,children:e,showCloseButton:n=!0,...r}){return m.jsxs(hL,{children:[m.jsx(pL,{}),m.jsxs(QD,{"data-slot":"dialog-content",className:Ce("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r,children:[e,n&&m.jsx(qy,{"data-slot":"dialog-close",asChild:!0,children:m.jsxs(Ee,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[m.jsx(pa,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Fc({className:t,...e}){return m.jsx("div",{"data-slot":"dialog-header",className:Ce("flex flex-col gap-2",t),...e})}function Op({className:t,showCloseButton:e=!1,children:n,...r}){return m.jsxs("div",{"data-slot":"dialog-footer",className:Ce("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...r,children:[n,e&&m.jsx(qy,{asChild:!0,children:m.jsx(Ee,{variant:"outline",children:"Close"})})]})}function $c({className:t,...e}){return m.jsx(rR,{"data-slot":"dialog-title",className:Ce("font-heading text-base leading-none font-medium",t),...e})}function Bc({className:t,...e}){return m.jsx(sR,{"data-slot":"dialog-description",className:Ce("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...e})}function __({...t}){return m.jsx(VO,{"data-slot":"dropdown-menu",...t})}function T_({...t}){return m.jsx(HO,{"data-slot":"dropdown-menu-trigger",...t})}function N_({className:t,align:e="start",sideOffset:n=4,...r}){return m.jsx(UO,{children:m.jsx(WO,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:Ce("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r})})}function hg({className:t,inset:e,variant:n="default",...r}){return m.jsx(KO,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Ce("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function A_({className:t,children:e,checked:n,inset:r,...o}){return m.jsxs(GO,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:Ce("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...o,children:[m.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:m.jsx(JO,{children:m.jsx(Ic,{})})}),e]})}function P1({className:t,inset:e,...n}){return m.jsx(qO,{"data-slot":"dropdown-menu-label","data-inset":e,className:Ce("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",t),...n})}function wu({className:t,...e}){return m.jsx(ZO,{"data-slot":"dropdown-menu-separator",className:Ce("-mx-1 my-1 h-px bg-border",t),...e})}function jt({className:t,type:e,...n}){return m.jsx("input",{type:e,"data-slot":"input",className:Ce("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function Bi({className:t,...e}){return m.jsx(ej,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function Qu({...t}){return m.jsx(fj,{"data-slot":"select",...t})}function ec({...t}){return m.jsx(gj,{"data-slot":"select-value",...t})}function tc({className:t,size:e="default",children:n,...r}){return m.jsxs(pj,{"data-slot":"select-trigger","data-size":e,className:Ce("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[n,m.jsx(yj,{asChild:!0,children:m.jsx(gx,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function nc({className:t,children:e,position:n="item-aligned",align:r="center",...o}){return m.jsx(kj,{children:m.jsxs(wj,{"data-slot":"select-content","data-align-trigger":n==="item-aligned",className:Ce("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",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,align:r,...o,children:[m.jsx(mL,{}),m.jsx(Nj,{"data-position":n,className:Ce("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",n==="popper"&&""),children:e}),m.jsx(gL,{})]})})}function rc({className:t,children:e,...n}){return m.jsxs(Dj,{"data-slot":"select-item",className:Ce("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:m.jsx(jj,{children:m.jsx(Ic,{className:"pointer-events-none"})})}),m.jsx(Rj,{children:e})]})}function mL({className:t,...e}){return m.jsx(Ij,{"data-slot":"select-scroll-up-button",className:Ce("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:m.jsx(NP,{})})}function gL({className:t,...e}){return m.jsx(Pj,{"data-slot":"select-scroll-down-button",className:Ce("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:m.jsx(gx,{})})}var yL=(t,e,n,r,o,s,i,a)=>{let u=document.documentElement,d=["light","dark"];function h(x){(Array.isArray(t)?t:[t]).forEach(v=>{let b=v==="class",k=b&&s?o.map(E=>s[E]||E):o;b?(u.classList.remove(...k),u.classList.add(s&&s[x]?s[x]:x)):u.setAttribute(v,x)}),f(x)}function f(x){a&&d.includes(x)&&(u.style.colorScheme=x)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)h(r);else try{let x=localStorage.getItem(e)||n,v=i&&x==="system"?g():x;h(v)}catch{}},xL=C.createContext(void 0),vL={setTheme:t=>{},themes:[]},bL=()=>{var t;return(t=C.useContext(xL))!=null?t:vL};C.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:u,scriptProps:d})=>{let h=JSON.stringify([n,e,s,t,a,i,r,o]).slice(1,-1);return C.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${yL.toString()})(${h})`}})});function kL(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const wL=t=>{switch(t){case"success":return EL;case"info":return TL;case"warning":return _L;case"error":return NL;default:return null}},CL=Array(12).fill(0),SL=({visible:t,className:e})=>ne.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ne.createElement("div",{className:"sonner-spinner"},CL.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),EL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_L=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),TL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),NL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),AL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ML=()=>{const[t,e]=ne.useState(document.hidden);return ne.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let L1=1;class DL{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...o}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:L1++,i=this.toasts.find(u=>u.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...e,id:s,title:r}),{...u,...e,id:s,dismissible:a,title:r}):u):this.addToast({title:r,...o,dismissible:a,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,i;const a=o.then(async d=>{if(i=["resolve",d],ne.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(OL(d)&&!d.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,v=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...v})}else if(d instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...v})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:g,...v})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const h=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:f,...x})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,h)=>a.then(()=>i[0]==="reject"?h(i[1]):d(i[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||L1++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const er=new DL,RL=(t,e)=>{const n=(e==null?void 0:e.id)||L1++;return er.addToast({title:t,...e,id:n}),n},OL=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",jL=RL,IL=()=>er.toasts,PL=()=>er.getActiveToasts(),Ct=Object.assign(jL,{success:er.success,info:er.info,warning:er.warning,error:er.error,custom:er.custom,message:er.message,promise:er.promise,dismiss:er.dismiss,loading:er.loading},{getHistory:IL,getToasts:PL});kL("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function wf(t){return t.label!==void 0}const LL=3,zL="24px",FL="16px",dw=4e3,$L=356,BL=14,VL=45,HL=200;function ho(...t){return t.filter(Boolean).join(" ")}function UL(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const WL=t=>{var e,n,r,o,s,i,a,u,d;const{invert:h,toast:f,unstyled:g,interacting:x,setHeights:v,visibleToasts:b,heights:k,index:E,toasts:_,expanded:T,removeToast:A,defaultRichColors:D,closeButton:R,style:O,cancelButtonStyle:P,actionButtonStyle:j,className:W="",descriptionClassName:Z="",duration:J,position:K,gap:Y,expandByDefault:ee,classNames:G,icons:X,closeButtonAriaLabel:q="Close toast"}=t,[te,F]=ne.useState(null),[L,V]=ne.useState(null),[re,he]=ne.useState(!1),[ce,pe]=ne.useState(!1),[Re,Q]=ne.useState(!1),[de,me]=ne.useState(!1),[Fe,Oe]=ne.useState(!1),[Be,Ye]=ne.useState(0),[Mt,zt]=ne.useState(0),qt=ne.useRef(f.duration||J||dw),Hn=ne.useRef(null),Kt=ne.useRef(null),nn=E===0,On=E+1<=b,pt=f.type,yr=f.dismissible!==!1,ki=f.className||"",ya=f.descriptionClassName||"",Oo=ne.useMemo(()=>k.findIndex(Me=>Me.toastId===f.id)||0,[k,f.id]),xr=ne.useMemo(()=>{var Me;return(Me=f.closeButton)!=null?Me:R},[f.closeButton,R]),Un=ne.useMemo(()=>f.duration||J||dw,[f.duration,J]),vr=ne.useRef(0),jn=ne.useRef(0),mn=ne.useRef(0),Pr=ne.useRef(null),[xa,va]=K.split("-"),ys=ne.useMemo(()=>k.reduce((Me,it,tt)=>tt>=Oo?Me:Me+it.height,0),[k,Oo]),jo=ML(),wi=f.invert||h,ro=pt==="loading";jn.current=ne.useMemo(()=>Oo*Y+ys,[Oo,ys]),ne.useEffect(()=>{qt.current=Un},[Un]),ne.useEffect(()=>{he(!0)},[]),ne.useEffect(()=>{const Me=Kt.current;if(Me){const it=Me.getBoundingClientRect().height;return zt(it),v(tt=>[{toastId:f.id,height:it,position:f.position},...tt]),()=>v(tt=>tt.filter(at=>at.toastId!==f.id))}},[v,f.id]),ne.useLayoutEffect(()=>{if(!re)return;const Me=Kt.current,it=Me.style.height;Me.style.height="auto";const tt=Me.getBoundingClientRect().height;Me.style.height=it,zt(tt),v(at=>at.find(mt=>mt.toastId===f.id)?at.map(mt=>mt.toastId===f.id?{...mt,height:tt}:mt):[{toastId:f.id,height:tt,position:f.position},...at])},[re,f.title,f.description,v,f.id,f.jsx,f.action,f.cancel]);const Wn=ne.useCallback(()=>{pe(!0),Ye(jn.current),v(Me=>Me.filter(it=>it.toastId!==f.id)),setTimeout(()=>{A(f)},HL)},[f,A,v,jn]);ne.useEffect(()=>{if(f.promise&&pt==="loading"||f.duration===1/0||f.type==="loading")return;let Me;return T||x||jo?(()=>{if(mn.current<vr.current){const at=new Date().getTime()-vr.current;qt.current=qt.current-at}mn.current=new Date().getTime()})():(()=>{qt.current!==1/0&&(vr.current=new Date().getTime(),Me=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Wn()},qt.current))})(),()=>clearTimeout(Me)},[T,x,f,pt,jo,Wn]),ne.useEffect(()=>{f.delete&&(Wn(),f.onDismiss==null||f.onDismiss.call(f,f))},[Wn,f.delete]);function Ci(){var Me;if(X!=null&&X.loading){var it;return ne.createElement("div",{className:ho(G==null?void 0:G.loader,f==null||(it=f.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":pt==="loading"},X.loading)}return ne.createElement(SL,{className:ho(G==null?void 0:G.loader,f==null||(Me=f.classNames)==null?void 0:Me.loader),visible:pt==="loading"})}const oo=f.icon||(X==null?void 0:X[pt])||wL(pt);var gt,Gt;return ne.createElement("li",{tabIndex:0,ref:Kt,className:ho(W,ki,G==null?void 0:G.toast,f==null||(e=f.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[pt],f==null||(n=f.classNames)==null?void 0:n[pt]),"data-sonner-toast":"","data-rich-colors":(gt=f.richColors)!=null?gt:D,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":re,"data-promise":!!f.promise,"data-swiped":Fe,"data-removed":ce,"data-visible":On,"data-y-position":xa,"data-x-position":va,"data-index":E,"data-front":nn,"data-swiping":Re,"data-dismissible":yr,"data-type":pt,"data-invert":wi,"data-swipe-out":de,"data-swipe-direction":L,"data-expanded":!!(T||ee&&re),"data-testid":f.testId,style:{"--index":E,"--toasts-before":E,"--z-index":_.length-E,"--offset":`${ce?Be:jn.current}px`,"--initial-height":ee?"auto":`${Mt}px`,...O,...f.style},onDragEnd:()=>{Q(!1),F(null),Pr.current=null},onPointerDown:Me=>{Me.button!==2&&(ro||!yr||(Hn.current=new Date,Ye(jn.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(Q(!0),Pr.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,it,tt;if(de||!yr)return;Pr.current=null;const at=Number(((Me=Kt.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jt=Number(((it=Kt.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((tt=Hn.current)==null?void 0:tt.getTime()),Je=te==="x"?at:Jt,gn=Math.abs(Je)/mt;if(Math.abs(Je)>=VL||gn>.11){Ye(jn.current),f.onDismiss==null||f.onDismiss.call(f,f),V(te==="x"?at>0?"right":"left":Jt>0?"down":"up"),Wn(),me(!0);return}else{var ft,Tt;(ft=Kt.current)==null||ft.style.setProperty("--swipe-amount-x","0px"),(Tt=Kt.current)==null||Tt.style.setProperty("--swipe-amount-y","0px")}Oe(!1),Q(!1),F(null)},onPointerMove:Me=>{var it,tt,at;if(!Pr.current||!yr||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const mt=Me.clientY-Pr.current.y,Je=Me.clientX-Pr.current.x;var gn;const ft=(gn=t.swipeDirections)!=null?gn:UL(K);!te&&(Math.abs(Je)>1||Math.abs(mt)>1)&&F(Math.abs(Je)>Math.abs(mt)?"x":"y");let Tt={x:0,y:0};const qn=rn=>1/(1.5+Math.abs(rn)/20);if(te==="y"){if(ft.includes("top")||ft.includes("bottom"))if(ft.includes("top")&&mt<0||ft.includes("bottom")&&mt>0)Tt.y=mt;else{const rn=mt*qn(mt);Tt.y=Math.abs(rn)<Math.abs(mt)?rn:mt}}else if(te==="x"&&(ft.includes("left")||ft.includes("right")))if(ft.includes("left")&&Je<0||ft.includes("right")&&Je>0)Tt.x=Je;else{const rn=Je*qn(Je);Tt.x=Math.abs(rn)<Math.abs(Je)?rn:Je}(Math.abs(Tt.x)>0||Math.abs(Tt.y)>0)&&Oe(!0),(tt=Kt.current)==null||tt.style.setProperty("--swipe-amount-x",`${Tt.x}px`),(at=Kt.current)==null||at.style.setProperty("--swipe-amount-y",`${Tt.y}px`)}},xr&&!f.jsx&&pt!=="loading"?ne.createElement("button",{"aria-label":q,"data-disabled":ro,"data-close-button":!0,onClick:ro||!yr?()=>{}:()=>{Wn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:ho(G==null?void 0:G.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Gt=X==null?void 0:X.close)!=null?Gt:AL):null,(pt||f.icon||f.promise)&&f.icon!==null&&((X==null?void 0:X[pt])!==null||f.icon)?ne.createElement("div",{"data-icon":"",className:ho(G==null?void 0:G.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Ci():null,f.type!=="loading"?oo:null):null,ne.createElement("div",{"data-content":"",className:ho(G==null?void 0:G.content,f==null||(s=f.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:ho(G==null?void 0:G.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ne.createElement("div",{"data-description":"",className:ho(Z,ya,G==null?void 0:G.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),ne.isValidElement(f.cancel)?f.cancel:f.cancel&&wf(f.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||P,onClick:Me=>{wf(f.cancel)&&yr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Me),Wn())},className:ho(G==null?void 0:G.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,ne.isValidElement(f.action)?f.action:f.action&&wf(f.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||j,onClick:Me=>{wf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Me),!Me.defaultPrevented&&Wn())},className:ho(G==null?void 0:G.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function fw(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function qL(t,e){const n={};return[t,e].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?FL:zL;function u(d){["top","right","bottom","left"].forEach(h=>{n[`${i}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=a:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(a)}),n}const KL=ne.forwardRef(function(e,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:u,className:d,offset:h,mobileOffset:f,theme:g="light",richColors:x,duration:v,style:b,visibleToasts:k=LL,toastOptions:E,dir:_=fw(),gap:T=BL,icons:A,containerAriaLabel:D="Notifications"}=e,[R,O]=ne.useState([]),P=ne.useMemo(()=>r?R.filter(re=>re.toasterId===r):R.filter(re=>!re.toasterId),[R,r]),j=ne.useMemo(()=>Array.from(new Set([s].concat(P.filter(re=>re.position).map(re=>re.position)))),[P,s]),[W,Z]=ne.useState([]),[J,K]=ne.useState(!1),[Y,ee]=ne.useState(!1),[G,X]=ne.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ne.useRef(null),te=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=ne.useRef(null),L=ne.useRef(!1),V=ne.useCallback(re=>{O(he=>{var ce;return(ce=he.find(pe=>pe.id===re.id))!=null&&ce.delete||er.dismiss(re.id),he.filter(({id:pe})=>pe!==re.id)})},[]);return ne.useEffect(()=>er.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{O(he=>he.map(ce=>ce.id===re.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{o3.flushSync(()=>{O(he=>{const ce=he.findIndex(pe=>pe.id===re.id);return ce!==-1?[...he.slice(0,ce),{...he[ce],...re},...he.slice(ce+1)]:[re,...he]})})})}),[R]),ne.useEffect(()=>{if(g!=="system"){X(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:he})=>{X(he?"dark":"light")})}catch{re.addListener(({matches:ce})=>{try{X(ce?"dark":"light")}catch(pe){console.error(pe)}})}},[g]),ne.useEffect(()=>{R.length<=1&&K(!1)},[R]),ne.useEffect(()=>{const re=he=>{var ce;if(i.every(Q=>he[Q]||he.code===Q)){var Re;K(!0),(Re=q.current)==null||Re.focus()}he.code==="Escape"&&(document.activeElement===q.current||(ce=q.current)!=null&&ce.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[i]),ne.useEffect(()=>{if(q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[q.current]),ne.createElement("section",{ref:n,"aria-label":`${D} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((re,he)=>{var ce;const[pe,Re]=re.split("-");return P.length?ne.createElement("ol",{key:re,dir:_==="auto"?fw():_,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":pe,"data-x-position":Re,style:{"--front-toast-height":`${((ce=W[0])==null?void 0:ce.height)||0}px`,"--width":`${$L}px`,"--gap":`${T}px`,...b,...qL(h,f)},onBlur:Q=>{L.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||L.current||(L.current=!0,F.current=Q.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{Y||K(!1)},onDragEnd:()=>K(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},P.filter(Q=>!Q.position&&he===0||Q.position===re).map((Q,de)=>{var me,Fe;return ne.createElement(WL,{key:Q.id,icons:A,index:de,toast:Q,defaultRichColors:x,duration:(me=E==null?void 0:E.duration)!=null?me:v,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:o,visibleToasts:k,closeButton:(Fe=E==null?void 0:E.closeButton)!=null?Fe:u,interacting:Y,position:re,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:V,toasts:P.filter(Oe=>Oe.position==Q.position),heights:W.filter(Oe=>Oe.position==Q.position),setHeights:Z,expandByDefault:a,gap:T,expanded:J,swipeDirections:e.swipeDirections})})):null}))}),GL=({...t})=>{const{theme:e="system"}=bL();return m.jsx(KL,{theme:e,className:"toaster group",icons:{success:m.jsx(RP,{className:"size-4"}),info:m.jsx(a9,{className:"size-4"}),warning:m.jsx(Pc,{className:"size-4"}),error:m.jsx(S9,{className:"size-4"}),loading:m.jsx(Ln,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...t})};function JL({className:t,...e}){return m.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:m.jsx("table",{"data-slot":"table",className:Ce("w-full caption-bottom text-sm",t),...e})})}function ZL({className:t,...e}){return m.jsx("thead",{"data-slot":"table-header",className:Ce("[&_tr]:border-b",t),...e})}function YL({className:t,...e}){return m.jsx("tbody",{"data-slot":"table-body",className:Ce("[&_tr:last-child]:border-0",t),...e})}function pg({className:t,...e}){return m.jsx("tr",{"data-slot":"table-row",className:Ce("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function Cf({className:t,...e}){return m.jsx("th",{"data-slot":"table-head",className:Ce("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",t),...e})}function zs({className:t,...e}){return m.jsx("td",{"data-slot":"table-cell",className:Ce("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t),...e})}function XL({delayDuration:t=0,...e}){return m.jsx(eI,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function vx({...t}){return m.jsx(tI,{"data-slot":"tooltip",...t})}function bx({...t}){return m.jsx(nI,{"data-slot":"tooltip-trigger",...t})}function kx({className:t,sideOffset:e=0,children:n,...r}){return m.jsx(rI,{children:m.jsxs(oI,{"data-slot":"tooltip-content",sideOffset:e,className:Ce("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r,children:[n,m.jsx(sI,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var rt;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},t.getValidEnumValues=o=>{const s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(const i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(rt||(rt={}));var hw;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(hw||(hw={}));const Te=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bs=t=>{switch(typeof t){case"undefined":return Te.undefined;case"string":return Te.string;case"number":return Number.isNaN(t)?Te.nan:Te.number;case"boolean":return Te.boolean;case"function":return Te.function;case"bigint":return Te.bigint;case"symbol":return Te.symbol;case"object":return Array.isArray(t)?Te.array:t===null?Te.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Te.promise:typeof Map<"u"&&t instanceof Map?Te.map:typeof Set<"u"&&t instanceof Set?Te.set:typeof Date<"u"&&t instanceof Date?Te.date:Te.object;default:return Te.unknown}},le=rt.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"]);class cs extends Error{get errors(){return this.issues}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}format(e){const n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof cs))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}cs.create=t=>new cs(t);const z1=(t,e)=>{let n;switch(t.code){case le.invalid_type:t.received===Te.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case le.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,rt.jsonStringifyReplacer)}`;break;case le.unrecognized_keys:n=`Unrecognized key(s) in object: ${rt.joinValues(t.keys,", ")}`;break;case le.invalid_union:n="Invalid input";break;case le.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rt.joinValues(t.options)}`;break;case le.invalid_enum_value:n=`Invalid enum value. Expected ${rt.joinValues(t.options)}, received '${t.received}'`;break;case le.invalid_arguments:n="Invalid function arguments";break;case le.invalid_return_type:n="Invalid function return type";break;case le.invalid_date:n="Invalid date";break;case le.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}"`:rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case le.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==="bigint"?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 le.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 le.custom:n="Invalid input";break;case le.invalid_intersection_types:n="Intersection results could not be merged";break;case le.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case le.not_finite:n="Number must be finite";break;default:n=e.defaultError,rt.assertNever(t)}return{message:n}};let QL=z1;function e7(){return QL}const t7=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}};function xe(t,e){const n=e7(),r=t7({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===z1?void 0:z1].filter(o=>!!o)});t.common.issues.push(r)}class hr{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 Ve;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){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return hr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Ve;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}}const Ve=Object.freeze({status:"aborted"}),Cu=t=>({status:"dirty",value:t}),Ir=t=>({status:"valid",value:t}),pw=t=>t.status==="aborted",mw=t=>t.status==="dirty",al=t=>t.status==="valid",lh=t=>typeof Promise<"u"&&t instanceof Promise;var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ae||(Ae={}));class ui{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gw=(t,e)=>{if(al(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 cs(t.common.issues);return this._error=n,this._error}}};function Ge(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:(i,a)=>{const{message:u}=t;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:o}}class et{get description(){return this._def.description}_getType(e){return Bs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new hr,ctx:{common:e.parent.common,data:e.data,parsedType:Bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(lh(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){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bs(e)},o=this._parseSync({data:e,path:r.path,parent:r});return gw(r,o)}"~validate"(e){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return al(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(o=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>al(s)?{value:s.value}:{issues:n.common.issues})}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:Bs(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(lh(o)?o:Promise.resolve(o));return gw(r,s)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=e(o),a=()=>s.addIssue({code:le.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(a(),!1)):i?!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 ul({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ei.create(this,this._def)}nullable(){return cl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return So.create(this)}promise(){return fh.create(this,this._def)}or(e){return ch.create([this,e],this._def)}and(e){return dh.create(this,e,this._def)}transform(e){return new ul({...Ge(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new H1({...Ge(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new S7({typeName:He.ZodBranded,type:this,...Ge(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new U1({...Ge(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return wx.create(this,e)}readonly(){return W1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const n7=/^c[^\s-]{8,}$/i,r7=/^[0-9a-z]+$/,o7=/^[0-9A-HJKMNP-TV-Z]{26}$/i,s7=/^[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,i7=/^[a-z0-9_-]{21}$/i,a7=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,l7=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,u7=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,c7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let mg;const d7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,f7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,h7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,p7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,m7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,g7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,M_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",y7=new RegExp(`^${M_}$`);function D_(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function x7(t){return new RegExp(`^${D_(t)}$`)}function v7(t){let e=`${M_}T${D_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function b7(t,e){return!!((e==="v4"||!e)&&d7.test(t)||(e==="v6"||!e)&&h7.test(t))}function k7(t,e){if(!a7.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function w7(t,e){return!!((e==="v4"||!e)&&f7.test(t)||(e==="v6"||!e)&&p7.test(t))}class Js extends et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Te.string){const s=this._getOrReturnCtx(e);return xe(s,{code:le.invalid_type,expected:Te.string,received:s.parsedType}),Ve}const r=new hr;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),xe(o,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),xe(o,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?xe(o,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&xe(o,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")u7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"email",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")mg||(mg=new RegExp(c7,"u")),mg.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"emoji",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")s7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"uuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")i7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"nanoid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")n7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"cuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")r7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"cuid2",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")o7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"ulid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),xe(o,{validation:"url",code:le.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"regex",code:le.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?v7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?y7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?x7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{code:le.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?l7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"duration",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?b7(e.data,s.version)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"ip",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?k7(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"jwt",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?w7(e.data,s.version)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"cidr",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?m7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"base64",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?g7.test(e.data)||(o=this._getOrReturnCtx(e,o),xe(o,{validation:"base64url",code:le.invalid_string,message:s.message}),r.dirty()):rt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:le.invalid_string,...Ae.errToObj(r)})}_addCheck(e){return new Js({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ae.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ae.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ae.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ae.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ae.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ae.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ae.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ae.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ae.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ae.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ae.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ae.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ae.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ae.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ae.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ae.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ae.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ae.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ae.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ae.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ae.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ae.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ae.errToObj(n)})}nonempty(e){return this.min(1,Ae.errToObj(e))}trim(){return new Js({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Js({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Js({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}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}}Js.create=t=>new Js({checks:[],typeName:He.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});function C7(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}class oc extends et{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)!==Te.number){const s=this._getOrReturnCtx(e);return xe(s,{code:le.invalid_type,expected:Te.number,received:s.parsedType}),Ve}let r;const o=new hr;for(const s of this._def.checks)s.kind==="int"?rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),xe(r,{code:le.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?C7(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),xe(r,{code:le.not_finite,message:s.message}),o.dirty()):rt.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ae.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ae.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ae.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ae.toString(n))}setLimit(e,n,r,o){return new oc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ae.toString(o)}]})}_addCheck(e){return new oc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ae.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ae.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ae.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.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"&&rt.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)}}oc.create=t=>new oc({checks:[],typeName:He.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class sc extends et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Te.bigint)return this._getInvalidInput(e);let r;const o=new hr;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),xe(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):rt.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return xe(n,{code:le.invalid_type,expected:Te.bigint,received:n.parsedType}),Ve}gte(e,n){return this.setLimit("min",e,!0,Ae.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ae.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ae.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ae.toString(n))}setLimit(e,n,r,o){return new sc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ae.toString(o)}]})}_addCheck(e){return new sc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ae.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}}sc.create=t=>new sc({checks:[],typeName:He.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});class F1 extends et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Te.boolean){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.boolean,received:r.parsedType}),Ve}return Ir(e.data)}}F1.create=t=>new F1({typeName:He.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class uh extends et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Te.date){const s=this._getOrReturnCtx(e);return xe(s,{code:le.invalid_type,expected:Te.date,received:s.parsedType}),Ve}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return xe(s,{code:le.invalid_date}),Ve}const r=new hr;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),xe(o,{code:le.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),xe(o,{code:le.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):rt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new uh({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ae.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ae.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}}uh.create=t=>new uh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:He.ZodDate,...Ge(t)});class yw extends et{_parse(e){if(this._getType(e)!==Te.symbol){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.symbol,received:r.parsedType}),Ve}return Ir(e.data)}}yw.create=t=>new yw({typeName:He.ZodSymbol,...Ge(t)});class xw extends et{_parse(e){if(this._getType(e)!==Te.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.undefined,received:r.parsedType}),Ve}return Ir(e.data)}}xw.create=t=>new xw({typeName:He.ZodUndefined,...Ge(t)});class vw extends et{_parse(e){if(this._getType(e)!==Te.null){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.null,received:r.parsedType}),Ve}return Ir(e.data)}}vw.create=t=>new vw({typeName:He.ZodNull,...Ge(t)});class bw extends et{constructor(){super(...arguments),this._any=!0}_parse(e){return Ir(e.data)}}bw.create=t=>new bw({typeName:He.ZodAny,...Ge(t)});class kw extends et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ir(e.data)}}kw.create=t=>new kw({typeName:He.ZodUnknown,...Ge(t)});class ci extends et{_parse(e){const n=this._getOrReturnCtx(e);return xe(n,{code:le.invalid_type,expected:Te.never,received:n.parsedType}),Ve}}ci.create=t=>new ci({typeName:He.ZodNever,...Ge(t)});class ww extends et{_parse(e){if(this._getType(e)!==Te.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.void,received:r.parsedType}),Ve}return Ir(e.data)}}ww.create=t=>new ww({typeName:He.ZodVoid,...Ge(t)});class So extends et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Te.array)return xe(n,{code:le.invalid_type,expected:Te.array,received:n.parsedType}),Ve;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(xe(n,{code:i?le.too_big:le.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?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&&(xe(n,{code:le.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&&(xe(n,{code:le.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((i,a)=>o.type._parseAsync(new ui(n,i,n.path,a)))).then(i=>hr.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new ui(n,i,n.path,a)));return hr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new So({...this._def,minLength:{value:e,message:Ae.toString(n)}})}max(e,n){return new So({...this._def,maxLength:{value:e,message:Ae.toString(n)}})}length(e,n){return new So({...this._def,exactLength:{value:e,message:Ae.toString(n)}})}nonempty(e){return this.min(1,e)}}So.create=(t,e)=>new So({type:t,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Ge(e)});function Ja(t){if(t instanceof Bt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ei.create(Ja(r))}return new Bt({...t._def,shape:()=>e})}else return t instanceof So?new So({...t._def,type:Ja(t.element)}):t instanceof ei?ei.create(Ja(t.unwrap())):t instanceof cl?cl.create(Ja(t.unwrap())):t instanceof ra?ra.create(t.items.map(e=>Ja(e))):t}class Bt extends et{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=rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Te.object){const d=this._getOrReturnCtx(e);return xe(d,{code:le.invalid_type,expected:Te.object,received:d.parsedType}),Ve}const{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ci&&this._def.unknownKeys==="strip"))for(const d in o.data)i.includes(d)||a.push(d);const u=[];for(const d of i){const h=s[d],f=o.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new ui(o,f,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof ci){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of a)u.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(d==="strict")a.length>0&&(xe(o,{code:le.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of a){const f=o.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new ui(o,f,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of u){const f=await h.key,g=await h.value;d.push({key:f,value:g,alwaysSet:h.alwaysSet})}return d}).then(d=>hr.mergeObjectSync(r,d)):hr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ae.errToObj,new Bt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,i;const o=((i=(s=this._def).errorMap)==null?void 0:i.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ae.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Bt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Bt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Bt({...this._def,catchall:e})}pick(e){const n={};for(const r of rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Bt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Bt({...this._def,shape:()=>n})}deepPartial(){return Ja(this)}partial(e){const n={};for(const r of rt.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new Bt({...this._def,shape:()=>n})}required(e){const n={};for(const r of rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof ei;)s=s._def.innerType;n[r]=s}return new Bt({...this._def,shape:()=>n})}keyof(){return R_(rt.objectKeys(this.shape))}}Bt.create=(t,e)=>new Bt({shape:()=>t,unknownKeys:"strip",catchall:ci.create(),typeName:He.ZodObject,...Ge(e)});Bt.strictCreate=(t,e)=>new Bt({shape:()=>t,unknownKeys:"strict",catchall:ci.create(),typeName:He.ZodObject,...Ge(e)});Bt.lazycreate=(t,e)=>new Bt({shape:t,unknownKeys:"strip",catchall:ci.create(),typeName:He.ZodObject,...Ge(e)});class ch extends et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new cs(a.ctx.common.issues));return xe(n,{code:le.invalid_union,unionErrors:i}),Ve}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},h=u._parseSync({data:n.data,path:n.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(u=>new cs(u));return xe(n,{code:le.invalid_union,unionErrors:a}),Ve}}get options(){return this._def.options}}ch.create=(t,e)=>new ch({options:t,typeName:He.ZodUnion,...Ge(e)});function $1(t,e){const n=Bs(t),r=Bs(e);if(t===e)return{valid:!0,data:t};if(n===Te.object&&r===Te.object){const o=rt.objectKeys(e),s=rt.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(const a of s){const u=$1(t[a],e[a]);if(!u.valid)return{valid:!1};i[a]=u.data}return{valid:!0,data:i}}else if(n===Te.array&&r===Te.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let s=0;s<t.length;s++){const i=t[s],a=e[s],u=$1(i,a);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===Te.date&&r===Te.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class dh extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(pw(s)||pw(i))return Ve;const a=$1(s.value,i.value);return a.valid?((mw(s)||mw(i))&&n.dirty(),{status:n.value,value:a.data}):(xe(r,{code:le.invalid_intersection_types}),Ve)};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(([s,i])=>o(s,i)):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}))}}dh.create=(t,e,n)=>new dh({left:t,right:e,typeName:He.ZodIntersection,...Ge(n)});class ra extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Te.array)return xe(r,{code:le.invalid_type,expected:Te.array,received:r.parsedType}),Ve;if(r.data.length<this._def.items.length)return xe(r,{code:le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ve;!this._def.rest&&r.data.length>this._def.items.length&&(xe(r,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new ui(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>hr.mergeArray(n,i)):hr.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ra({...this._def,rest:e})}}ra.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ra({items:t,typeName:He.ZodTuple,rest:null,...Ge(e)})};class Cw extends et{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!==Te.map)return xe(r,{code:le.invalid_type,expected:Te.map,received:r.parsedType}),Ve;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,u],d)=>({key:o._parse(new ui(r,a,r.path,[d,"key"])),value:s._parse(new ui(r,u,r.path,[d,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,h=await u.value;if(d.status==="aborted"||h.status==="aborted")return Ve;(d.status==="dirty"||h.status==="dirty")&&n.dirty(),a.set(d.value,h.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of i){const d=u.key,h=u.value;if(d.status==="aborted"||h.status==="aborted")return Ve;(d.status==="dirty"||h.status==="dirty")&&n.dirty(),a.set(d.value,h.value)}return{status:n.value,value:a}}}}Cw.create=(t,e,n)=>new Cw({valueType:e,keyType:t,typeName:He.ZodMap,...Ge(n)});class ic extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Te.set)return xe(r,{code:le.invalid_type,expected:Te.set,received:r.parsedType}),Ve;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(xe(r,{code:le.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&&(xe(r,{code:le.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(u){const d=new Set;for(const h of u){if(h.status==="aborted")return Ve;h.status==="dirty"&&n.dirty(),d.add(h.value)}return{status:n.value,value:d}}const a=[...r.data.values()].map((u,d)=>s._parse(new ui(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>i(u)):i(a)}min(e,n){return new ic({...this._def,minSize:{value:e,message:Ae.toString(n)}})}max(e,n){return new ic({...this._def,maxSize:{value:e,message:Ae.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ic.create=(t,e)=>new ic({valueType:t,minSize:null,maxSize:null,typeName:He.ZodSet,...Ge(e)});class B1 extends et{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})}}B1.create=(t,e)=>new B1({getter:t,typeName:He.ZodLazy,...Ge(e)});class V1 extends et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return xe(n,{received:n.data,code:le.invalid_literal,expected:this._def.value}),Ve}return{status:"valid",value:e.data}}get value(){return this._def.value}}V1.create=(t,e)=>new V1({value:t,typeName:He.ZodLiteral,...Ge(e)});function R_(t,e){return new ll({values:t,typeName:He.ZodEnum,...Ge(e)})}class ll extends et{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return xe(n,{expected:rt.joinValues(r),received:n.parsedType,code:le.invalid_type}),Ve}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return xe(n,{received:n.data,code:le.invalid_enum_value,options:r}),Ve}return Ir(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,n=this._def){return ll.create(e,{...this._def,...n})}exclude(e,n=this._def){return ll.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}ll.create=R_;class Sw extends et{_parse(e){const n=rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Te.string&&r.parsedType!==Te.number){const o=rt.objectValues(n);return xe(r,{expected:rt.joinValues(o),received:r.parsedType,code:le.invalid_type}),Ve}if(this._cache||(this._cache=new Set(rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=rt.objectValues(n);return xe(r,{received:r.data,code:le.invalid_enum_value,options:o}),Ve}return Ir(e.data)}get enum(){return this._def.values}}Sw.create=(t,e)=>new Sw({values:t,typeName:He.ZodNativeEnum,...Ge(e)});class fh extends et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Te.promise&&n.common.async===!1)return xe(n,{code:le.invalid_type,expected:Te.promise,received:n.parsedType}),Ve;const r=n.parsedType===Te.promise?n.data:Promise.resolve(n.data);return Ir(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fh.create=(t,e)=>new fh({type:t,typeName:He.ZodPromise,...Ge(e)});class ul extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{xe(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Ve;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ve:u.status==="dirty"||n.value==="dirty"?Cu(u.value):u});{if(n.value==="aborted")return Ve;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Ve:a.status==="dirty"||n.value==="dirty"?Cu(a.value):a}}if(o.type==="refinement"){const i=a=>{const u=o.refinement(a,s);if(r.common.async)return Promise.resolve(u);if(u 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"?Ve:(a.status==="dirty"&&n.dirty(),i(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"?Ve:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!al(i))return Ve;const a=o.transform(i.value,s);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(i=>al(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Ve);rt.assertNever(o)}}ul.create=(t,e,n)=>new ul({schema:t,typeName:He.ZodEffects,effect:e,...Ge(n)});ul.createWithPreprocess=(t,e,n)=>new ul({schema:e,effect:{type:"preprocess",transform:t},typeName:He.ZodEffects,...Ge(n)});class ei extends et{_parse(e){return this._getType(e)===Te.undefined?Ir(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ei.create=(t,e)=>new ei({innerType:t,typeName:He.ZodOptional,...Ge(e)});class cl extends et{_parse(e){return this._getType(e)===Te.null?Ir(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}cl.create=(t,e)=>new cl({innerType:t,typeName:He.ZodNullable,...Ge(e)});class H1 extends et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Te.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}H1.create=(t,e)=>new H1({innerType:t,typeName:He.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ge(e)});class U1 extends et{_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 lh(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new cs(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new cs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}U1.create=(t,e)=>new U1({innerType:t,typeName:He.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ge(e)});class Ew extends et{_parse(e){if(this._getType(e)!==Te.nan){const r=this._getOrReturnCtx(e);return xe(r,{code:le.invalid_type,expected:Te.nan,received:r.parsedType}),Ve}return{status:"valid",value:e.data}}}Ew.create=t=>new Ew({typeName:He.ZodNaN,...Ge(t)});class S7 extends et{_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 wx extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ve:s.status==="dirty"?(n.dirty(),Cu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ve: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 wx({in:e,out:n,typeName:He.ZodPipeline})}}class W1 extends et{_parse(e){const n=this._def.innerType._parse(e),r=o=>(al(o)&&(o.value=Object.freeze(o.value)),o);return lh(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}W1.create=(t,e)=>new W1({innerType:t,typeName:He.ZodReadonly,...Ge(e)});var He;(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"})(He||(He={}));const bo=Js.create,E7=F1.create;ci.create;const dl=So.create,jp=Bt.create;ch.create;dh.create;ra.create;const _7=B1.create,T7=V1.create,N7=ll.create;fh.create;ei.create;cl.create;var A7=["text","richtext","number","boolean","date","select","relation","image","url","email","list","color","group"],Cx=_7(()=>jp({key:bo().min(1),label:bo().optional(),type:N7(A7),required:E7().optional(),options:dl(bo()).optional(),to:bo().optional(),fields:dl(Cx).optional()}).superRefine((t,e)=>{t.type==="select"&&(!t.options||t.options.length===0)&&e.addIssue({code:le.custom,message:"a select field requires options"}),t.type==="relation"&&!t.to&&e.addIssue({code:le.custom,message:'a relation field requires "to"'}),t.type==="group"&&(!t.fields||t.fields.length===0)&&e.addIssue({code:le.custom,message:"a group field requires fields"})})),M7=jp({name:bo().min(1),label:bo().optional(),path:bo().min(1),fields:dl(Cx)}),D7=jp({name:bo().min(1),label:bo().optional(),path:bo().min(1),fields:dl(Cx)});jp({version:T7(1),collections:dl(M7),singletons:dl(D7)}).superRefine((t,e)=>{const n=new Set,r=new Set,o=new Set(t.collections.map(i=>i.name)),s=[...t.collections,...t.singletons];for(const i of s){n.has(i.name)&&e.addIssue({code:le.custom,message:`duplicate name: ${i.name}`}),n.add(i.name),(i.path.includes("..")||i.path.startsWith("/")||i.path.includes("\\"))&&e.addIssue({code:le.custom,message:`unsafe path: ${i.path}`}),r.has(i.path)&&e.addIssue({code:le.custom,message:`duplicate path: ${i.path}`}),r.add(i.path);const a=new Set;for(const u of i.fields)a.has(u.key)&&e.addIssue({code:le.custom,message:`duplicate field key: ${u.key}`}),a.add(u.key),u.type==="relation"&&u.to&&!o.has(u.to)&&e.addIssue({code:le.custom,message:`relation target does not exist: ${u.to}`})}});var R7={ç:"c",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"c",Ğ:"g",İ:"i",Ö:"o",Ş:"s",Ü:"u",I:"i"};function Ip(t){return t.replace(/[çğıöşüÇĞİÖŞÜI]/g,r=>R7[r]??r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"content"}var O_="_status";function _w(t){return t[O_]==="draft"?"draft":"published"}function O7(t){return t==null||t===""}var j7=/^[a-z][a-z0-9+.-]*:\/\/.+/i,I7=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,P7=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function L7(t,e){var n;switch(t.type){case"text":case"richtext":case"date":case"image":return typeof e=="string"?null:"expected text";case"url":return typeof e!="string"?"expected text":j7.test(e)?null:"expected a valid URL";case"email":return typeof e!="string"?"expected text":I7.test(e)?null:"expected a valid email address";case"color":return typeof e!="string"?"expected text":P7.test(e)?null:"expected a hex color (e.g. #ff0000)";case"list":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"expected a list of text":null;case"relation":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"expected a list of slugs":null;case"group":return typeof e!="object"||e===null||Array.isArray(e)?"expected an object":null;case"number":return typeof e=="number"?null:"expected a number";case"boolean":return typeof e=="boolean"?null:"expected true or false";case"select":return typeof e!="string"?"expected text":(n=t.options)!=null&&n.includes(e)?null:"not one of the options"}}function j_(t,e){const n=[],r=new Set(t.map(o=>o.key));for(const o of t){const s=e[o.key];if(O7(s)){o.required&&n.push({key:o.key,level:"warning",kind:"required",message:"required field is empty"});continue}const i=L7(o,s);i&&n.push({key:o.key,level:"error",kind:"type",message:i})}for(const o of Object.keys(e))o.startsWith("_")||r.has(o)||n.push({key:o,level:"warning",kind:"unknown-key",message:"key is not in the schema"});return{ok:n.every(o=>o.level!=="error"),issues:n}}var q1=[{id:"paper",label:"Paper",bg:"#faf9f5",text:"#1c1a17",muted:"#6b6558",border:"#e4e0d5"},{id:"plain",label:"Plain",bg:"#ffffff",text:"#18181b",muted:"#71717a",border:"#e4e4e7"},{id:"ink",label:"Ink",bg:"#141414",text:"#f4f4f5",muted:"#a1a1aa",border:"#2a2a2a"},{id:"sand",label:"Sand",bg:"#f5f1e8",text:"#2b2620",muted:"#7a7060",border:"#ddd5c4"},{id:"sky",label:"Sky",bg:"#f7fafc",text:"#111b26",muted:"#5d7183",border:"#dbe6ef"}],K1=[{id:"sans",label:"Sans",stack:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},{id:"serif",label:"Serif",stack:'ui-serif, Georgia, "Times New Roman", serif'},{id:"mono",label:"Mono",stack:"ui-monospace, SFMono-Regular, Menlo, monospace"},{id:"humanist",label:"Humanist",stack:'"Optima", "Gill Sans", "Trebuchet MS", ui-sans-serif, sans-serif'}],z7={tight:{gap:"0.5rem",page:"2rem",lead:"1.5"},normal:{gap:"0.75rem",page:"3rem",lead:"1.65"},roomy:{gap:"1.15rem",page:"4.5rem",lead:"1.8"}};function F7(t){return q1.find(e=>e.id===t.palette)??q1[0]}function $7(t){return K1.find(e=>e.id===t.font)??K1[0]}function B7(t){const e=F7(t),n=$7(t),r=z7[t.density];return[":root {",` --jj-bg: ${e.bg};`,` --jj-text: ${e.text};`,` --jj-muted: ${e.muted};`,` --jj-border: ${e.border};`,` --jj-accent: ${t.accent};`,` --jj-font: ${n.stack};`,` --jj-radius: ${t.radius}px;`,` --jj-gap: ${r.gap};`,` --jj-page: ${r.page};`,` --jj-lead: ${r.lead};`,"}"].join(`
471
+ `)}async function Dn(t){if(!t.ok)throw new Error(`Request failed: ${t.status}`);return t}async function I_(){return(await Dn(await fetch("/api/_project"))).json()}async function Tw(){return(await Dn(await fetch("/api/_schema"))).json()}async function V7(){return(await(await Dn(await fetch("/api/_templates"))).json()).items}async function H7(t){const e=await fetch("/api/_init",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({template:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Could not apply the template: ${e.status}`)}}async function P_(t){const e=await fetch("/api/_import",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({raw:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Import failed: ${e.status}`)}}const U7="/api/_export";function W7(){const t=document.createElement("a");t.href=U7,t.download="justjson-export.zip",document.body.appendChild(t),t.click(),t.remove()}async function L_(t){const e=await fetch("/api/_schema",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Could not save the schema: ${e.status}`)}}async function Sx(t){return(await(await Dn(await fetch(`/api/${encodeURIComponent(t)}`))).json()).items}async function q7(t){return(await Sx(t)).map(e=>e.slug)}async function G1(t,e){const n=await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`);return n.status===404?null:(await Dn(n),n.json())}async function K7(t,e,n){return(await(await Dn(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}))).json()).slug}async function G7(t,e){await Dn(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"DELETE"}))}async function J7(t,e){return(await(await Dn(await fetch("/api/_media",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dataBase64:t,filename:e})}))).json()).path}async function z_(t){return(await Dn(await fetch(`/api/_singleton/${encodeURIComponent(t)}`))).json()}async function Z7(t,e){await Dn(await fetch(`/api/_singleton/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}))}async function F_(t,e,n){const r=await fetch("/api/_ai/generate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...t,system:e,prompt:n})}),o=await r.json();if(!r.ok||!o.text)throw new Error(o.error||`The AI request failed (${r.status})`);return o.text}async function Y7(t){const e=await fetch("/api/_ai/models",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),n=await e.json();if(!e.ok||!n.models)throw new Error(n.error||`Could not fetch models (${e.status})`);return n.models}async function $_(){return(await Dn(await fetch("/api/_ship"))).json()}async function Vc(t,e){const n=await fetch(`/api/_ship/${t}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),r=await n.json();if(!n.ok)throw new Error(r.error??`Request failed: ${n.status}`);return r}const X7=()=>Vc("scaffold",{}),Q7=t=>Vc("publish",{message:t}),ez=t=>Vc("commit",{message:t}),tz=()=>Vc("push",{}),nz=(t,e)=>Vc("repo",{name:t,private:e});async function rz(){return(await Dn(await fetch("/api/_theme"))).json()}async function oz(t){return(await Dn(await fetch("/api/_theme",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}))).json()}async function sz(){return(await Dn(await fetch("/api/_preview"))).json()}async function iz(){return(await Dn(await fetch("/api/_preview/start",{method:"POST"}))).json()}async function az(){return(await Dn(await fetch("/api/_preview/stop",{method:"POST"}))).json()}function Jr({children:t}){return m.jsx("div",{className:"flex h-full min-h-0 flex-col",children:t})}function Zr({title:t,badge:e,subtitle:n,actions:r,toolbar:o}){return m.jsxs("header",{className:"sticky top-0 z-20 shrink-0 border-b bg-card px-8 pt-4 pb-3.5",children:[m.jsxs("div",{className:"flex items-start justify-between gap-6",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("h1",{className:"truncate text-lg font-semibold leading-tight tracking-tight text-foreground",children:t}),e]}),n&&m.jsx("div",{className:"mt-1.5 flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:n})]}),r&&m.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]}),o&&m.jsx("div",{className:"mt-3.5",children:o})]})}function Hc({children:t}){return m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t})}function lz({children:t}){return m.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-8 py-6",children:t})}function uz({className:t,children:e}){return m.jsx("div",{className:Ce("overflow-hidden rounded-xl border bg-card shadow-sm",t),children:e})}function Jf({children:t}){return m.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 rounded-md border bg-muted/60 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:[m.jsx(VP,{className:"h-3 w-3 shrink-0 text-muted-foreground/70"}),m.jsx("span",{className:"truncate",children:t})]})}function Nw({icon:t,title:e,hint:n,action:r}){return m.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-16 text-center",children:[m.jsx("div",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:t}),m.jsx("p",{className:"text-sm font-medium text-foreground",children:e}),n&&m.jsx("p",{className:"mt-1 max-w-xs text-sm text-muted-foreground",children:n}),r&&m.jsx("div",{className:"mt-5",children:r})]})}const cz={Save:"Kaydet","Saving…":"Kaydediliyor…",Cancel:"Vazgeç",Delete:"Sil",Add:"Ekle",Open:"Aç",Clear:"Temizle","Loading…":"Yükleniyor…","Try again":"Tekrar dene",Yes:"Evet",No:"Hayır",Language:"Dil",Title:"Başlık",File:"Dosya",Updated:"Güncellendi",remove:"kaldır",new:"yeni",optional:"opsiyonel",connected:"bağlı",key:"anahtar",automatic:"otomatik","Select…":"Seç…","Could not load":"Yüklenemedi","Could not save":"Kaydedilemedi",Schema:"Şema","Content structure":"İçerik yapısı","Raw JSON":"Ham JSON",Collections:"Koleksiyonlar",Singletons:"Tekil",singleton:"tekil","Add collection":"Koleksiyon ekle","Add singleton":"Tekil ekle","Add a singleton":"Tekil kayıt ekle","Export (.zip)":"Dışa aktar (.zip)","Downloading export":"Dışa aktarma indiriliyor","Start over (reset)":"Baştan başla (sıfırla)","Reset the schema?":"Şemayı sıfırla?","Your content files stay on disk, but the schema is cleared so you can pick a template or JSON again.":"İçerik dosyaların diskte kalır ama şema temizlenir, baştan şablon/JSON seçebilirsin.",Reset:"Sıfırla","Resetting…":"Sıfırlanıyor…","Schema reset":"Şema sıfırlandı","Could not load the schema. Is `justjson serve` running?":"Şema yüklenemedi. `justjson serve` çalışıyor mu?","Start on the left":"Soldan başla","Pick a collection or singleton to start editing. To change the structure, go to Schema.":"Bir koleksiyon ya da tekil kayıt seçerek düzenlemeye başla. Yapıyı değiştirmek istersen Şema’ya git.","Open schema":"Şemayı aç","This collection no longer exists.":"Bu koleksiyon artık yok.","This singleton no longer exists.":"Bu tekil kayıt artık yok.","New entry":"Yeni kayıt","{n} entry":"{n} kayıt","{n} entries":"{n} kayıt","{n} result":"{n} sonuç","{n} results":"{n} sonuç","{n} field":"{n} alan","{n} fields":"{n} alan","{n} file":"{n} dosya","{n} files":"{n} dosya","{n} collection":"{n} koleksiyon","{n} collections":"{n} koleksiyon","{n} singleton":"{n} tekil","{n} singletons":"{n} tekil","Loading entries…":"Kayıtlar yükleniyor…","Search by title or slug…":"Başlık veya slug ara…","No entries yet":"Henüz kayıt yok","Add the first piece of content to this collection.":"Bu koleksiyona ilk içeriği ekleyerek başla.","Create the first entry":"İlk kaydı oluştur","No matching entries":"Eşleşen kayıt yok","Nothing found for “{q}”. Change the search or clear it.":"“{q}” için sonuç bulunamadı. Aramayı değiştir ya da temizle.","Clear search":"Aramayı temizle",Draft:"Taslak",Published:"Yayında","Draft — publish it":"Taslak — yayına al","Published — move back to draft":"Yayında — taslağa çevir","File name":"Dosya adı","Leave it empty to derive it from the title. It cannot change after saving.":"Boş bırakırsan başlıktan üretilir. Kaydettikten sonra değişmez.",'"{slug}" already exists — pick a different slug.':"“{slug}” zaten var — farklı bir slug seç.",'"{slug}" saved':"“{slug}” kaydedildi",'"{slug}" deleted':"“{slug}” silindi","{name} saved":"{name} kaydedildi","Could not load the entry":"Kayıt yüklenemedi","The file could not be read, or it may have been deleted. Editing is disabled so an empty form does not overwrite it.":"Dosya okunamadı ya da silinmiş olabilir. Boş bir formla üzerine yazmamak için düzenleme kapatıldı.","Back to the list":"Listeye dön","Fix these before saving":"Kaydetmeden önce düzeltilecekler",Warnings:"Uyarılar","Pick a color":"Renk seç","Type and press Enter…":"Yaz ve Enter’a bas…","Remove {item}":"{item} kaldır","Add link":"Bağlantı ekle","No entries in “{name}”.":"“{name}” içinde kayıt yok.","Entries in “{name}”":"“{name}” kayıtları","Remove the link to {slug}":"{slug} bağlantısını kaldır","Upload image":"Görsel yükle","Uploading…":"Yükleniyor…","Image uploaded":"Görsel yüklendi",Bold:"Kalın",Italic:"İtalik","Heading 2":"Başlık 2","Heading 3":"Başlık 3","Ordered list":"Sıralı liste",Quote:"Alıntı","Bullet list":"Madde listesi",Code:"Kod",Undo:"Geri al",Redo:"Yinele",Copy:"Kopyala","JSON copied":"JSON kopyalandı","No fields filled in yet.":"Henüz alan doldurulmadı.","Every file in content/, exactly as written to disk":"content/ klasöründeki her dosya, diske yazıldığı hâliyle","Design your collections and fields.":"Koleksiyonlarını ve alanlarını tasarla.","Save schema":"Şemayı kaydet","Content with many entries (posts, products…)":"Çok kayıtlı içerik (yazılar, ürünler…)","A single record (site settings, profile…)":"Tek kayıt (site ayarları, profil…)","Expand all":"Tümünü genişlet","Collapse all":"Tümünü daralt",Expand:"Genişlet",Collapse:"Daralt","Your schema is empty":"Şeman boş","A collection describes one type of your content — posts, products, projects. Start by adding the first one.":"Koleksiyon, içeriğinin bir tipini tanımlar — yazılar, ürünler, projeler. İlkini ekleyerek başla.","or start from a template":"veya bir template’den başla","New collection":"Yeni koleksiyon","New singleton":"Yeni tekil","Collection name":"Koleksiyon adı","Singleton name":"Tekil ad","No fields yet. Add the first one below.":"Henüz alan yok. Aşağıdan ilk alanı ekle.","Add field":"Alan ekle","Field name":"Alan adı","Display name":"Görünen ad",Required:"Zorunlu","Required field":"Zorunlu alan","Make it required":"Zorunlu yap","Change type":"Tipi değiştir","change type":"tipi değiştir","Pick a field type":"Alan tipi seç","Choose what kind of data this field holds.":"Bu alanın hangi türde veri tutacağını belirle.","options (comma separated)":"seçenekler (virgülle ayır)","pick a target collection…":"hedef koleksiyon seç…","Add sub-field":"Alt alan ekle","Delete sub-field":"Alt alanı sil","Drag to reorder":"Sürükleyerek sırala","Item picked up. Use the arrow keys to move it, space to drop it.":"Öğe kaldırıldı. Ok tuşlarıyla taşı, boşluk tuşuyla bırak.","Moving to position {n}.":"{n}. sıraya taşınıyor.","Dropped at position {n}.":"{n}. sıraya bırakıldı.","The item is outside the list.":"Öğe listenin dışında.","The item returned to its original place.":"Öğe eski yerine döndü.","Move cancelled.":"Taşıma iptal edildi.",Text:"Metin","Single line of text":"Tek satır metin","Rich text":"Zengin metin","Markdown content":"Markdown içerik",Number:"Sayı","Numeric value":"Sayısal değer","Yes / No":"Evet / Hayır","True or false":"Doğru veya yanlış",Date:"Tarih","Calendar date":"Takvim tarihi",Select:"Seçim","A fixed list of options":"Sabit seçenekler listesi",Relation:"İlişki","Link to another collection":"Başka koleksiyona bağla",Image:"Görsel","Image URL or path":"Resim URL veya yolu","Web address":"Web adresi",Email:"E-posta","Email address":"E-posta adresi",List:"Liste","Free-text tags":"Serbest metin etiketleri",Color:"Renk","Hex color picker":"Hex renk seçici",Group:"Grup","Nested fields":"İç içe alanlar","required field is empty":"zorunlu alan boş","key is not in the schema":"anahtar şemada yok","expected text":"metin bekleniyor","expected a number":"sayı bekleniyor","expected true or false":"boolean bekleniyor","expected a valid URL":"geçerli bir URL bekleniyor","expected a valid email address":"geçerli bir e-posta bekleniyor","expected a hex color (e.g. #ff0000)":"hex renk bekleniyor (ör. #ff0000)","expected a list of text":"metin dizisi bekleniyor","expected a list of slugs":"slug dizisi bekleniyor","expected an object":"nesne bekleniyor","not one of the options":"seçenek dışı değer","Pick a template":"Bir şablon seç","Template catalog":"Şablon kataloğu","Previous templates":"Önceki şablonlar","Next templates":"Sonraki şablonlar","+{n} more":"+{n} daha","Edit your content visually; everything stays in your folder as plain JSON — no server, no account.":"İçeriğini görsel olarak düzenle; her şey klasöründe düz JSON olarak kalır — sunucu yok, hesap yok.","Could not load the template list.":"Şablon listesi yüklenemedi.","Applying…":"Uygulanıyor…","Start from scratch":"Sıfırdan başla","Begin with an empty schema and define your own collections and fields.":"Boş bir şemayla başla, koleksiyonlarını ve alanlarını kendin tanımla.","Continue with an empty project":"Boş projeyle devam et","Or start on your own":"Ya da kendin başla","Import your own JSON":"Kendi JSON’unu içe aktar","Drop a JSON file here, or":"Bir JSON dosyasını buraya bırak ya da","Release to read this file":"Dosyayı okumak için bırak","Browse files":"Dosyalara göz at","That file is not JSON — drop a .json file instead.":"Bu dosya JSON değil — bir .json dosyası bırak.","Paste your content JSON or choose a file, and JustJSON works out the collections and singletons for you.":"İçerik JSON’unu yapıştır ya da bir dosya seç; JustJSON koleksiyon ve tekil yapısını senin için çıkarsın.","An exported schema file works too:":"Dışa aktarılmış bir şema dosyası da olur:",Import:"İçe aktar","Importing…":"İçe aktarılıyor…","Choose a file":"Dosya seç","Could not read the file.":"Dosya okunamadı.","Invalid JSON":"Geçersiz JSON","Generate with AI":"AI ile oluştur","Connect a provider":"Sağlayıcı bağla","Describe what you want to manage and let it design the schema":"Ne yöneteceğini anlat, şemayı senin için tasarlasın","Runs on your own API key — entirely optional, nothing reaches us. It only creates collections and fields; the content is yours to write.":"Kendi API key’inle çalışır — tamamen opsiyonel, hiçbir şey bize gitmez. Sadece koleksiyon ve alanları üretir; içeriği sen girersin.",'e.g. "a blog where I share recipes, with category, difficulty and cooking time"':"Örn. “Tarif paylaştığım bir blog; kategori, zorluk seviyesi ve pişirme süresi olsun”","Generate schema":"Şema oluştur","Generating…":"Oluşturuluyor…","No AI provider connected yet — the settings open when you press the button.":"Henüz bir AI sağlayıcı bağlamadın — butona basınca ayarlar açılacak.","The AI did not return valid JSON — try again.":"AI geçerli bir JSON döndürmedi, tekrar dene.","Fill with AI":"AI ile doldur","Say what you want in a sentence; the model fills it in using {context} as context.":"Ne istediğini kısaca yaz, model {context} bağlamına göre dolduracak.","The current text is sent along as context.":"Mevcut metin bağlam olarak gönderilecek.",'e.g. "write a short, friendly {field}"':"Örn. “{field} için kısa ve samimi bir metin yaz”",Generate:"Oluştur","Content generated":"İçerik üretildi","AI settings":"AI ayarları","AI settings saved":"AI ayarları kaydedildi","AI disconnected":"AI bağlantısı kaldırıldı",Disconnect:"Bağlantıyı kaldır",Provider:"Sağlayıcı","Base URL":"Taban URL","Entirely optional. Your key is stored in this browser only and goes straight to the provider — nothing reaches us.":"Tamamen opsiyonel. Girdiğin key yalnızca bu tarayıcıda saklanır ve doğrudan sağlayıcıya gider — bize hiçbir şey ulaşmaz.","Get a free key":"Ücretsiz key al","Load models":"Modelleri yükle","Loading models…":"Modeller yükleniyor…","Pick a model…":"Model seç…","Refresh models":"Modelleri yenile","Type the model manually":"Modeli elle gir","Enter an API key first":"Önce API key gir","Enter a base URL first":"Önce taban URL gir","No models found — you can type one in":"Model bulunamadı — elle girebilirsin","A model name is required":"Model adı gerekli","A base URL is required":"Taban URL gerekli","An API key is required":"API key gerekli","Custom (OpenAI-compatible)":"Özel (OpenAI uyumlu)","Has a free tier — use your own Gemini API key.":"Ücretsiz katmanı var — kendi Gemini API key’ini kullan.","Has a free tier — fast open models.":"Ücretsiz katmanı var — hızlı açık modeller.","Plenty of free models (their names end in :free).":"Birçok ücretsiz model (isimleri :free ile biter).","Your own server, or a local service like Ollama.":"Kendi sunucun ya da Ollama gibi yerel bir servis.","Ship it":"Yayına al","Your content is on disk. Here is what comes next.":"İçeriğin diskte. Sıradaki adımlar şunlar.","Use it in {framework}":"{framework} içinde kullan","Give your content a site":"İçeriğine bir site ver","There is no site in this folder yet. JustJSON can generate a small Astro site wired to your content — a home page listing every collection, and a page per entry.":"Bu klasörde henüz bir site yok. JustJSON, içeriğine bağlı küçük bir Astro sitesi üretebilir — koleksiyonları listeleyen bir ana sayfa ve her kayıt için bir sayfa.","Create an Astro site":"Astro sitesi oluştur","Created {n} file(s).":"{n} dosya oluşturuldu.","Created {n} file(s); kept {k} of your own.":"{n} dosya oluşturuldu; senin {k} dosyana dokunulmadı.","Now start it:":"Şimdi başlat:","Nothing you already have is overwritten.":"Var olan hiçbir dosyanın üzerine yazılmaz.","{framework} project detected":"{framework} projesi algılandı",Project:"Proje",Copied:"Kopyalandı","Commit your content":"İçeriğini commit et","This folder is not a git repository yet.":"Bu klasör henüz bir git deposu değil.","{n} file(s) waiting on branch {branch}.":"{branch} dalında {n} dosya bekliyor.","Everything is committed.":"Her şey commit edilmiş.",Commit:"Commit et","Committed {n} file(s).":"{n} dosya commit edildi.","Nothing to commit — content is up to date.":"Commit edilecek bir şey yok — içerik güncel.","Pushed {branch} to origin.":"{branch} dalı origin'e gönderildi.","Created {name} on GitHub and pushed it.":"{name} GitHub'da oluşturuldu ve gönderildi.","Send it to GitHub":"GitHub'a gönder","Put it online":"Siteyi yayına al","Hand the repository to a host once. After that, publishing is one button — they rebuild your site on every push.":"Depoyu bir barındırıcıya bir kez tanıt. Sonrası tek düğme — her göndermede siteni yeniden kurarlar.","Deploy to {host}":"{host}'a yükle","Already online? Send your latest changes:":"Zaten yayında mı? Son değişikliklerini gönder:","Publish changes":"Değişiklikleri yayınla","Published {n} change(s) to {branch}.":"{n} değişiklik {branch} dalına yayınlandı.","Nothing new to publish — {branch} is up to date.":"Yayınlanacak yeni bir şey yok — {branch} güncel.","Send your project to GitHub first — hosts deploy straight from a repository.":"Önce projeni GitHub'a gönder — barındırıcılar doğrudan depodan yayına alır.",Push:"Gönder","Create a private repository":"Gizli bir depo oluştur","Create & push":"Oluştur ve gönder","Uses the GitHub CLI already signed in on this machine — no token is stored.":"Bu makinede zaten giriş yapılmış GitHub CLI kullanılır — hiçbir token saklanmaz.","Add a remote yourself, then come back to push:":"Uzak sunucuyu kendin ekle, sonra göndermek için buraya dön:",Design:"Tasarım",Theme:"Tema","Style your generated site. Changes preview live and save to _theme.json.":"Üretilen siteni biçimlendir. Değişiklikler anında önizlenir ve _theme.json’a kaydedilir.","Unsaved changes":"Kaydedilmemiş değişiklikler","Save theme":"Temayı kaydet","Theme saved.":"Tema kaydedildi.",Palette:"Palet",Accent:"Vurgu","Pick an accent color":"Bir vurgu rengi seç",Font:"Yazı tipi","Corners: {n}px":"Köşeler: {n}px","Corner radius in pixels":"Köşe yarıçapı (piksel)",Density:"Yoğunluk",Tight:"Sıkı",Cozy:"Rahat",Roomy:"Ferah","Live preview":"Canlı önizleme","The Quiet Ledger":"Sessiz Defter","A small journal of things worth keeping. This is exactly how your generated site renders — same colors, type, spacing and corners.":"Saklamaya değer şeylerin küçük bir güncesi. Üretilen siten tam da böyle görünür — aynı renkler, yazı, boşluk ve köşeler.","Recent entries":"Son kayıtlar","On keeping notes in plain files":"Notları düz dosyalarda tutmak üzerine","A field guide to small tools":"Küçük araçlar için bir saha kılavuzu","Why JSON, and nothing more":"Neden JSON, fazlası değil","Built from":"Şununla kuruldu:","Read the latest":"Sonuncuyu oku",Subscribe:"Abone ol",Preview:"Önizleme","Your site, running live. Edit content and refresh to see it change.":"Siten canlı çalışıyor. İçeriği düzenle, yenile ve değişikliği gör.",Refresh:"Yenile","Open in a tab":"Sekmede aç",Stop:"Durdur","Site preview":"Site önizlemesi","Starting your dev server…":"Dev sunucun başlatılıyor…","The first start can take a moment while it warms up.":"İlk başlatma, ısınırken biraz sürebilir.","Could not start the preview":"Önizleme başlatılamadı","See your site as you build it":"Siteni kurarken gör","Runs the site in this folder and shows it here. Content and theme changes appear as you make them.":"Bu klasördeki siteyi çalıştırıp burada gösterir. İçerik ve tema değişiklikleri yaptıkça görünür.","Start preview":"Önizlemeyi başlat"},dz=[{code:"en",label:"English"},{code:"tr",label:"Türkçe"}],B_="justjson.lang";function fz(t){return t==="en"||t==="tr"}function hz(){if(typeof localStorage>"u")return"en";const t=localStorage.getItem(B_);return fz(t)?t:"en"}let Pp=hz();const J1=new Set;typeof document<"u"&&(document.documentElement.lang=Pp);function ac(){return Pp}function pz(t){Pp=t,typeof localStorage<"u"&&localStorage.setItem(B_,t),typeof document<"u"&&(document.documentElement.lang=t);for(const e of J1)e()}function mz(t){return J1.add(t),()=>{J1.delete(t)}}function V_(){return C.useSyncExternalStore(mz,ac,ac)}function M(t,e){const n=Pp==="tr"?cz[t]??t:t;return e?n.replace(/\{(\w+)\}/g,(r,o)=>o in e?String(e[o]):r):n}function lc(t,e,n,r){return M(t===1?e:n,{n:t,...r})}function gz(){const[t,e]=C.useState({status:"idle"}),[n,r]=C.useState(0),o=C.useRef(null),s=C.useRef(null),i=()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},a=C.useCallback(async()=>{try{e(await sz())}catch{}},[]);C.useEffect(()=>(a(),i),[a]),C.useEffect(()=>{t.status==="starting"&&s.current===null&&(s.current=window.setInterval(a,1e3)),t.status!=="starting"&&i()},[t.status,a]);const u=async()=>{e({status:"starting"}),e(await iz())},d=async()=>{e(await az())},h=()=>r(f=>f+1);return m.jsxs(Jr,{children:[m.jsx(Zr,{title:M("Preview"),subtitle:M("Your site, running live. Edit content and refresh to see it change."),actions:t.status==="running"?m.jsxs(m.Fragment,{children:[m.jsxs(Ee,{variant:"outline",onClick:h,children:[m.jsx(C_,{})," ",M("Refresh")]}),m.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-lg border px-3 text-sm font-medium text-muted-foreground transition-colors hover:text-primary",children:[m.jsx(g_,{className:"size-4"})," ",M("Open in a tab")]}),m.jsxs(Ee,{variant:"outline",onClick:d,children:[m.jsx(J9,{})," ",M("Stop")]})]}):void 0}),m.jsx(Hc,{children:t.status==="running"?m.jsx("iframe",{ref:o,src:t.url,title:M("Site preview"),className:"h-full w-full border-0 bg-white"},n):m.jsx("div",{className:"flex h-full items-center justify-center p-8",children:m.jsx("div",{className:"max-w-sm text-center",children:t.status==="starting"?m.jsxs(m.Fragment,{children:[m.jsx(Ln,{className:"mx-auto mb-4 size-7 animate-spin text-primary"}),m.jsx("p",{className:"font-medium text-foreground",children:M("Starting your dev server…")}),m.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:M("The first start can take a moment while it warms up.")})]}):t.status==="error"?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"mx-auto mb-4 flex size-12 items-center justify-center rounded-xl bg-destructive/10 text-destructive",children:m.jsx(Pc,{className:"size-5"})}),m.jsx("p",{className:"font-medium text-foreground",children:M("Could not start the preview")}),m.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:t.message}),m.jsxs(Ee,{className:"mt-5",onClick:u,children:[m.jsx(fg,{})," ",M("Try again")]})]}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"mx-auto mb-4 flex size-12 items-center justify-center rounded-xl bg-accent text-accent-foreground",children:m.jsx(fg,{className:"size-5"})}),m.jsx("p",{className:"font-medium text-foreground",children:M("See your site as you build it")}),m.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:M("Runs the site in this folder and shows it here. Content and theme changes appear as you make them.")}),m.jsxs(Ee,{className:"mt-5",onClick:u,children:[m.jsx(fg,{})," ",M("Start preview")]})]})})})})]})}var gg={exports:{}},yg={};/**
472
+ * @license React
473
+ * use-sync-external-store-shim.production.js
474
+ *
475
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
476
+ *
477
+ * This source code is licensed under the MIT license found in the
478
+ * LICENSE file in the root directory of this source tree.
479
+ */var Aw;function yz(){if(Aw)return yg;Aw=1;var t=Nc();function e(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function a(f,g){var x=g(),v=r({inst:{value:x,getSnapshot:g}}),b=v[0].inst,k=v[1];return s(function(){b.value=x,b.getSnapshot=g,u(b)&&k({inst:b})},[f,x,g]),o(function(){return u(b)&&k({inst:b}),f(function(){u(b)&&k({inst:b})})},[f]),i(x),x}function u(f){var g=f.getSnapshot;f=f.value;try{var x=g();return!n(f,x)}catch{return!0}}function d(f,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return yg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,yg}var Mw;function H_(){return Mw||(Mw=1,gg.exports=yz()),gg.exports}var U_=H_();function vn(t){this.content=t}vn.prototype={constructor:vn,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),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new vn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new vn(n)},addToStart:function(t,e){return new vn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new vn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new vn(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=vn.from(t),t.size?new vn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=vn.from(t),t.size?new vn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=vn.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}};vn.from=function(t){if(t instanceof vn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new vn(e)};function W_(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),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let i=o.text,a=s.text,u=0;for(;i[u]==a[u];u++)n++;return u&&u<i.length&&u<a.length&&G_(i.charCodeAt(u-1))&&K_(i.charCodeAt(u))&&n--,n}if(o.content.size||s.content.size){let i=W_(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function q_(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),a=e.child(--s),u=i.nodeSize;if(i==a){n-=u,r-=u;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let d=i.text,h=a.text,f=d.length,g=h.length;for(;f>0&&g>0&&d[f-1]==h[g-1];)f--,g--,n--,r--;return f&&g&&f<d.length&&G_(d.charCodeAt(f-1))&&K_(d.charCodeAt(f))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let d=q_(i.content,a.content,n-1,r-1);if(d)return d}n-=u,r-=u}}function K_(t){return t>=56320&&t<57344}function G_(t){return t>=55296&&t<56320}class oe{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,s){for(let i=0,a=0;a<n;i++){let u=this.content[i],d=a+u.nodeSize;if(d>e&&r(u,o+a,s||null,i)!==!1&&u.content.size){let h=a+1;u.nodesBetween(Math.max(0,e-h),Math.min(u.content.size,n-h),r,o+h)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(a,u)=>{let d=a.isText?a.text.slice(Math.max(e,u)-u,n-u):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(i?i=!1:s+=r),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new oe(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 s=0,i=0;i<n;s++){let a=this.content[s],u=i+a.nodeSize;u>e&&((i<e||u>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),o+=a.nodeSize),i=u}return new oe(r,o)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new oe(o,s)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(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 W_(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return q_(this,e,n,r)}findIndex(e){if(e==0)return Sf(0,e);if(e==this.size)return Sf(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),s=r+o.nodeSize;if(s>=e)return s==e?Sf(n+1,s):Sf(n,r);r=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 oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return oe.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}oe.empty=new oe([],0);const xg={index:0,offset:0};function Sf(t,e){return xg.index=t,xg.offset=e,xg}function hh(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(!hh(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!hh(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ut=class Z1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}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&&hh(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`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}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 Z1.none;if(e instanceof Z1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ut.none=[];class uc extends Error{}class ve{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=Z_(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new ve(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ve(J_(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 ve.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 ve(oe.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new ve(e,r,o)}}ve.empty=new ve(oe.empty,0,0);function J_(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(o==e||s.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(J_(s.content,e-o-1,n-o-1)))}function Z_(t,e,n,r,o,s){let{index:i,offset:a}=t.findIndex(e),u=t.maybeChild(i);if(a==e||u.isText)return s&&r<=0&&o<=0&&!s.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let d=Z_(u.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?o-1:0,u);return d&&t.replaceChild(i,u.copy(d))}function xz(t,e,n){if(n.openStart>t.depth)throw new uc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new uc("Inconsistent open depths");return Y_(t,e,n,0)}function Y_(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=Y_(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return Ji(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=vz(n,t);return Ji(s,Q_(t,i,a,e,r))}else return Ji(s,ph(t,e,r))}function X_(t,e){if(!e.type.compatibleContent(t.type))throw new uc("Cannot join "+e.type.name+" onto "+t.type.name)}function Y1(t,e,n){let r=t.node(n);return X_(r,e.node(n)),r}function Gi(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 Mu(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Gi(t.nodeAfter,r),s++));for(let a=s;a<i;a++)Gi(o.child(a),r);e&&e.depth==n&&e.textOffset&&Gi(e.nodeBefore,r)}function Ji(t,e){if(!t.type.validContent(e))throw new uc("Invalid content for node "+t.type.name);return t.copy(e)}function Q_(t,e,n,r,o){let s=t.depth>o&&Y1(t,e,o+1),i=r.depth>o&&Y1(n,r,o+1),a=[];return Mu(null,t,o,a),s&&i&&e.index(o)==n.index(o)?(X_(s,i),Gi(Ji(s,Q_(t,e,n,r,o+1)),a)):(s&&Gi(Ji(s,ph(t,e,o+1)),a),Mu(e,n,o,a),i&&Gi(Ji(i,ph(n,r,o+1)),a)),Mu(r,null,o,a),new oe(a)}function ph(t,e,n){let r=[];if(Mu(null,t,n,r),t.depth>n){let o=Y1(t,e,n+1);Gi(Ji(o,ph(t,e,n+1)),r)}return Mu(e,null,n,r),new oe(r)}function vz(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class cc{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 s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ut.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 s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}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 s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].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 mh(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,s=n;for(let i=e;;){let{index:a,offset:u}=i.content.findIndex(s),d=s-u;if(r.push(i,a,o+u),!d||(i=i.child(a),i.isText))break;s=d-1,o+=u+1}return new cc(n,r,s)}static resolveCached(e,n){let r=Dw.get(e);if(r)for(let s=0;s<r.elts.length;s++){let i=r.elts[s];if(i.pos==n)return i}else Dw.set(e,r=new bz);let o=r.elts[r.i]=cc.resolve(e,n);return r.i=(r.i+1)%kz,o}}class bz{constructor(){this.elts=[],this.i=0}}const kz=12,Dw=new WeakMap;class mh{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 wz=Object.create(null);let ti=class X1{constructor(e,n,r,o=ut.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,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&&hh(this.attrs,n||e.defaultAttrs||wz)&&ut.sameSet(this.marks,r||ut.none)}copy(e=null){return e==this.content?this:new X1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new X1(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 ve.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),a=o.start(i),d=o.node(i).content.cut(o.pos-a,s.pos-a);return new ve(d,o.depth-i,s.depth-i)}replace(e,n,r){return xz(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 cc.resolveCached(this,e)}resolveNoCache(e){return cc.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.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()+")"),e4(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=oe.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let u=o;u<s;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ut.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ut.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;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=oe.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};ti.prototype.text=void 0;class gh extends ti{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):e4(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 e4(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class oa{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Cz(e,n);if(r.next==null)return oa.empty;let o=t4(r);r.next&&r.err("Unexpected trailing text");let s=Mz(Az(o));return Dz(s,r),s}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 s=n;o&&s<r;s++)o=o.matchType(e.child(s).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 s(i,a){let u=i.matchFragment(e,r);if(u&&(!n||u.validEnd))return oe.from(a.map(d=>d.createAndFill()));for(let d=0;d<i.next.length;d++){let{type:h,next:f}=i.next[d];if(!(h.isText||h.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let g=s(f,a.concat(h));if(g)return g}}return null}return s(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(),s=o.match;if(s.matchType(e)){let i=[];for(let a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:a,next:u}=s.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||u.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 s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
480
+ `)}}oa.empty=new oa(!0);class Cz{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 t4(t){let e=[];do e.push(Sz(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Sz(t){let e=[];do e.push(Ez(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ez(t){let e=Nz(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=_z(t,e);else break;return e}function Rw(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function _z(t,e){let n=Rw(t),r=n;return t.eat(",")&&(t.next!="}"?r=Rw(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Tz(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.isInGroup(e)&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Nz(t){if(t.eat("(")){let e=t4(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=Tz(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 Az(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,u){let d={term:u,to:a};return e[i].push(d),d}function o(i,a){i.forEach(u=>u.to=a)}function s(i,a){if(i.type=="choice")return i.exprs.reduce((u,d)=>u.concat(s(d,a)),[]);if(i.type=="seq")for(let u=0;;u++){let d=s(i.exprs[u],a);if(u==i.exprs.length-1)return d;o(d,a=n())}else if(i.type=="star"){let u=n();return r(a,u),o(s(i.expr,u),u),[r(u)]}else if(i.type=="plus"){let u=n();return o(s(i.expr,a),u),o(s(i.expr,u),u),[r(u)]}else{if(i.type=="opt")return[r(a)].concat(s(i.expr,a));if(i.type=="range"){let u=a;for(let d=0;d<i.min;d++){let h=n();o(s(i.expr,u),h),u=h}if(i.max==-1)o(s(i.expr,u),u);else for(let d=i.min;d<i.max;d++){let h=n();r(u,h),o(s(i.expr,u),h),u=h}return[r(u)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function n4(t,e){return e-t}function Ow(t,e){let n=[];return r(e),n.sort(n4);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:a,to:u}=s[i];!a&&n.indexOf(u)==-1&&r(u)}}}function Mz(t){let e=Object.create(null);return n(Ow(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:a,to:u})=>{if(!a)return;let d;for(let h=0;h<o.length;h++)o[h][0]==a&&(d=o[h][1]);Ow(t,u).forEach(h=>{d||o.push([a,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let s=e[r.join(",")]=new oa(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let a=o[i][1].sort(n4);s.next.push({type:o[i][0],next:e[a.join(",")]||n(a)})}return s}}function Dz(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let a=0;a<o.next.length;a++){let{type:u,next:d}=o.next[a];i.push(u.name),s&&!(u.isText||u.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function r4(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 o4(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function s4(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function i4(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Oz(t,r,e[r]);return n}let jw=class a4{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=i4(e,r.attrs),this.defaultAttrs=r4(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==oa.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:o4(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ti(this,this.computeAttrs(e),oe.from(n),ut.setFrom(r))}createChecked(e=null,n,r){return n=oe.from(n),this.checkContent(n),new ti(this,this.computeAttrs(e),n,ut.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=oe.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(oe.empty,!0);return s?new ti(this,e,n.append(s),ut.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)}`)}checkAttrs(e){s4(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let 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:ut.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new a4(s,n,i));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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Rz(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Oz{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Rz(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Lp{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=i4(e,o.attrs),this.excluded=null;let s=r4(this.attrs);this.instance=s?new ut(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ut(this,o4(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new Lp(s,o++,n,i)),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]}checkAttrs(e){s4(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ex{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=vn.from(e.nodes),n.marks=vn.from(e.marks||{}),this.nodes=jw.compile(this.spec.nodes,this),this.marks=Lp.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 s=this.nodes[o],i=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=oa.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Iw(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Iw(this,i.split(" "))}this.nodeFromJSON=o=>ti.fromJSON(this,o),this.markFromJSON=o=>ut.fromJSON(this,o),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 jw){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,ut.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Iw(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;if(s)n.push(s);else for(let a in t.marks){let u=t.marks[a];(o=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=u)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function jz(t){return t.tag!=null}function Iz(t){return t.style!=null}class ss{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(jz(o))this.tags.push(o);else if(Iz(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Lw(this,n,!1);return r.addAll(e,ut.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Lw(this,n,!0);return r.addAll(e,ut.none,n.from,n.to),ve.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(zz(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let u=i.getAttrs(n);if(u===!1)continue;i.attrs=u||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=zw(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=zw(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ss(e,ss.schemaRules(e)))}}const l4={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Pz={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},u4={ol:!0,ul:!0},dc=1,Q1=2,Du=4;function Pw(t,e,n){return e!=null?(e?dc:0)|(e==="full"?Q1:0):t&&t.whitespace=="pre"?dc|Q1:n&~Du}class Ef{constructor(e,n,r,o,s,i){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=i,this.content=[],this.activeMarks=ut.none,this.match=s||(i&Du?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(oe.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&dc)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!l4.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Lw{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,i=Pw(null,n.preserveWhitespace,0)|(r?Du:0);o?s=new Ef(o.type,o.attrs,ut.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new Ef(null,null,ut.none,!0,null,i):s=new Ef(e.schema.topNodeType,null,ut.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&Q1?"full":this.localPreserveWS||(o.options&dc)>0,{schema:i}=this.parser;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
481
+ `);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let u=0;u<a.length;u++)u&&this.insertNode(i.linebreakReplacement.create(),n,!0),a[u]&&this.insertNode(i.text(a[u]),n,!/\S/.test(a[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=o.content[o.content.length-1],u=e.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;u4.hasOwnProperty(i)&&this.parser.normalizeLists&&Lz(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(u?u.ignore:Pz.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,h=this.needsBlock;if(l4.hasOwnProperty(i))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=u&&u.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(s),this.needsBlock=h}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
482
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],i=r.getPropertyValue(s);if(i)for(let a=void 0;;){let u=this.parser.matchStyle(s,i,this,a);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)a=u;else break}}return n}addElementByRule(e,n,r,o){let s,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let u=this.enter(i,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];i!=a;i=i.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(i,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let i=this.open,a=0;i>=0;i--){let u=this.nodes[i],d=u.findWrapping(e);if(d&&(!o||o.length>d.length+a)&&(o=d,s=u,!d.length))break;if(u.solid){if(r)break;a+=2}}if(!o)return null;this.sync(s);for(let i=0;i<o.length;i++)n=this.enterInner(o[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let i=ut.none;for(let a of o.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):Fw(a.type,e.type))&&(i=a.addToSet(i));return s.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=Pw(e,s,i.options);i.options&Du&&i.content.length==0&&(a|=Du);let u=ut.none;return r=r.filter(d=>(i.type?i.type.allowsMarkType(d.type):Fw(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Ef(e,n,u,o,null,a)),this.open++,r}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;this.localPreserveWS&&(this.nodes[n].options|=dc)}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),s=-(r?r.depth+1:0)+(o?0:1),i=(a,u)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;u>=s;u--)if(i(a-1,u))return!0;return!1}else{let h=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;u--}}return!0};return i(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}}}function Lz(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&u4.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function zz(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function zw(t){let e={};for(let n in t)e[n]=t[n];return e}function Fw(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=a=>{s.push(a);for(let u=0;u<a.edgeCount;u++){let{type:d,next:h}=a.edge(u);if(d==e||s.indexOf(h)<0&&i(h))return!0}};if(i(o.contentMatch))return!0}}class ma{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=_f(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let a=0,u=0;for(;a<s.length&&u<i.marks.length;){let d=i.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[a][0])||d.type.spec.spanning===!1)break;a++,u++}for(;a<s.length;)o=s.pop()[1];for(;u<i.marks.length;){let d=i.marks[u++],h=this.serializeMark(d,i.isInline,n);h&&(s.push([d,o]),o.appendChild(h.dom),o=h.contentDOM||h.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return _f(n).createTextNode(e.text);let{dom:r,contentDOM:o}=Zf(_f(n),this.nodes[e.type.name](e),null,e.attrs);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 s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Zf(_f(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return typeof n=="string"?{dom:e.createTextNode(n)}:Zf(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ma(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=$w(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return $w(e.marks)}}function $w(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function _f(t){return t.document||window.document}const Bw=new WeakMap;function Fz(t){let e=Bw.get(t);return e===void 0&&Bw.set(t,e=$z(t)),e}function $z(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Zf(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Fz(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let a,u=n?t.createElementNS(n,o):t.createElement(o),d=e[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let f in d)if(d[f]!=null){let g=f.indexOf(" ");g>0?u.setAttributeNS(f.slice(0,g),f.slice(g+1),d[f]):f=="style"&&u.style?u.style.cssText=d[f]:u.setAttribute(f,d[f])}}for(let f=h;f<e.length;f++){let g=e[f];if(g===0){if(f<e.length-1||f>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else if(typeof g=="string")u.appendChild(t.createTextNode(g));else{let{dom:x,contentDOM:v}=Zf(t,g,n,r);if(u.appendChild(x),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:u,contentDOM:a}}const c4=65535,d4=Math.pow(2,16);function Bz(t,e){return t+e*d4}function Vw(t){return t&c4}function Vz(t){return(t-(t&c4))/d4}const f4=1,h4=2,Yf=4,p4=8;class ey{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&p4)>0}get deletedBefore(){return(this.delInfo&(f4|Yf))>0}get deletedAfter(){return(this.delInfo&(h4|Yf))>0}get deletedAcross(){return(this.delInfo&Yf)>0}}class dr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&dr.empty)return dr.empty}recover(e){let n=0,r=Vw(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+Vz(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,s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?o:0);if(u>e)break;let d=this.ranges[a+s],h=this.ranges[a+i],f=u+d;if(e<=f){let g=d?e==u?-1:e==f?1:n:n,x=u+o+(g<0?0:h);if(r)return x;let v=e==(n<0?u:f)?null:Bz(a/3,e-u),b=e==u?h4:e==f?f4:Yf;return(n<0?e!=u:e!=f)&&(b|=p4),new ey(x,b,v)}o+=h-d}return r?e+o:new ey(e+o,0,null)}touches(e,n){let r=0,o=Vw(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[a+s],h=u+d;if(e<=h&&a==o*3)return!0;r+=this.ranges[a+i]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],a=i-(this.inverted?s:0),u=i+(this.inverted?0:s),d=this.ranges[o+n],h=this.ranges[o+r];e(a,a+d,u,u+h),s+=h-d}}invert(){return new dr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?dr.empty:new dr(e<0?[0,-e,0]:[0,0,e])}}dr.empty=new dr([]);class fc{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new fc(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),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 fc;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 s=this.from;s<this.to;s++){let i=this._maps[s],a=i.mapResult(e,n);if(a.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new ey(e,o,null)}}const vg=Object.create(null);let Rn=class{getMap(){return dr.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 Ht{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ht(e,null)}static fail(e){return new Ht(null,e)}static fromReplace(e,n,r,o){try{return Ht.ok(e.replace(n,r,o))}catch(s){if(s instanceof uc)return Ht.fail(s.message);throw s}}}function _x(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(_x(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return oe.fromArray(r)}class Zs extends Rn{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)),s=new ve(_x(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Ht.fromReplace(e,this.from,this.to,s)}invert(){return new Gr(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 Zs(n.pos,r.pos,this.mark)}merge(e){return e instanceof Zs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zs(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 Zs(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("addMark",Zs);class Gr extends Rn{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 ve(_x(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ht.fromReplace(e,this.from,this.to,r)}invert(){return new Zs(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 Gr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Gr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gr(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 Gr(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("removeMark",Gr);class Ys extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new ve(oe.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 Ys(this.pos,n.marks[o]);return new Ys(this.pos,this.mark)}}return new sa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ys(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 Ys(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("addNodeMark",Ys);class sa extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new ve(oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ys(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sa(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 sa(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("removeNodeMark",sa);class Vt extends Rn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&ty(e,this.from,this.to)?Ht.fail("Structure replace would overwrite content"):Ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new dr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Vt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Vt.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Vt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Vt)||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?ve.empty:new ve(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Vt(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?ve.empty:new ve(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Vt(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 Vt(n.from,n.to,ve.fromJSON(e,n.slice),!!n.structure)}}Vt.MAP_BIAS=1;Rn.jsonID("replace",Vt);class hn extends Rn{constructor(e,n,r,o,s,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=a}apply(e){if(this.structure&&(ty(e,this.from,this.gapFrom)||ty(e,this.gapTo,this.to)))return Ht.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ht.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ht.fromReplace(e,this.from,this.to,r):Ht.fail("Content does not fit in gap")}getMap(){return new dr([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 hn(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=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new hn(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 hn(n.from,n.to,n.gapFrom,n.gapTo,ve.fromJSON(e,n.slice),n.insert,!!n.structure)}}Rn.jsonID("replaceAround",hn);function ty(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function Hz(t,e,n,r){let o=[],s=[],i,a;t.doc.nodesBetween(e,n,(u,d,h)=>{if(!u.isInline)return;let f=u.marks;if(!r.isInSet(f)&&h.type.allowsMarkType(r.type)){let g=Math.max(d,e),x=Math.min(d+u.nodeSize,n),v=r.addToSet(f);for(let b=0;b<f.length;b++)f[b].isInSet(v)||(i&&i.to==g&&i.mark.eq(f[b])?i.to=x:o.push(i=new Gr(g,x,f[b])));a&&a.to==g?a.to=x:s.push(a=new Zs(g,x,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function Uz(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;s++;let u=null;if(r instanceof Lp){let d=i.marks,h;for(;h=r.isInSet(d);)(u||(u=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(i.marks)&&(u=[r]):u=i.marks;if(u&&u.length){let d=Math.min(a+i.nodeSize,n);for(let h=0;h<u.length;h++){let f=u[h],g;for(let x=0;x<o.length;x++){let v=o[x];v.step==s-1&&f.eq(o[x].style)&&(g=v)}g?(g.to=d,g.step=s):o.push({style:f,from:Math.max(a,e),to:d,step:s})}}}),o.forEach(i=>t.step(new Gr(i.from,i.to,i.style)))}function Tx(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],a=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),h=a+d.nodeSize,f=r.matchType(d.type);if(!f)i.push(new Vt(a,h,ve.empty));else{r=f;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||t.step(new Gr(a,h,d.marks[g]));if(o&&d.isText&&n.whitespace!="pre"){let g,x=/\r?\n|\r/g,v;for(;g=x.exec(d.text);)v||(v=new ve(oe.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),i.push(new Vt(a+g.index,a+g.index+g[0].length,v))}}a=h}if(!r.validEnd){let u=r.fillBefore(oe.empty,!0);t.replace(a,a,new ve(u,0,0))}for(let u=i.length-1;u>=0;u--)t.step(i[u])}function Wz(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Nl(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,s=0;;--r){let i=t.$from.node(r),a=t.$from.index(r)+o,u=t.$to.indexAfter(r)-s;if(r<t.depth&&i.canReplace(a,u,n))return r;if(r==0||i.type.spec.isolating||!Wz(i,a,u))break;a&&(o=1),u<i.childCount&&(s=1)}return null}function qz(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),a=o.after(s+1),u=i,d=a,h=oe.empty,f=0;for(let v=s,b=!1;v>n;v--)b||r.index(v)>0?(b=!0,h=oe.from(r.node(v).copy(h)),f++):u--;let g=oe.empty,x=0;for(let v=s,b=!1;v>n;v--)b||o.after(v+1)<o.end(v)?(b=!0,g=oe.from(o.node(v).copy(g)),x++):d++;t.step(new hn(u,d,i,a,new ve(h.append(g),f,x),h.size-f,!0))}function Nx(t,e,n=null,r=t){let o=Kz(t,e),s=o&&Gz(r,e);return s?o.map(Hw).concat({type:e,attrs:n}).concat(s.map(Hw)):null}function Hw(t){return{type:t,attrs:null}}function Kz(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function Gz(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let u=(i.length?i[i.length-1]:e).contentMatch;for(let d=r;u&&d<o;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:i}function Jz(t,e,n){let r=oe.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].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=oe.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new hn(o,s,o,s,new ve(r,0,0),n.length,!0))}function Zz(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{let u=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,u)&&Yz(t.doc,t.mapping.slice(s).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let x=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);x&&!v?d=!1:!x&&v&&(d=!0)}d===!1&&g4(t,i,a,s),Tx(t,t.mapping.slice(s).map(a,1),r,void 0,d===null);let h=t.mapping.slice(s),f=h.map(a,1),g=h.map(a+i.nodeSize,1);return t.step(new hn(f,g,f+1,g-1,new ve(oe.from(r.create(u,null,i.marks)),0,0),1,!0)),d===!0&&m4(t,i,a,s),!1}})}function m4(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(o.text);){let u=t.mapping.slice(r).map(n+1+s+i.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function g4(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text(`
483
+ `))}})}function Yz(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Xz(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new hn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new ve(oe.from(i),0,0),1,!0))}function is(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let d=o.depth-1,h=n-2;d>s;d--,h--){let f=o.node(d),g=o.index(d);if(f.type.spec.isolating)return!1;let x=f.content.cutByIndex(g,f.childCount),v=r&&r[h+1];v&&(x=x.replaceChild(0,v.type.create(v.attrs)));let b=r&&r[h]||f;if(!f.canReplace(g+1,f.childCount)||!b.type.validContent(x))return!1}let a=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(a,a,u?u.type:o.node(s+1).type)}function Qz(t,e,n=1,r){let o=t.doc.resolve(e),s=oe.empty,i=oe.empty;for(let a=o.depth,u=o.depth-n,d=n-1;a>u;a--,d--){s=oe.from(o.node(a).copy(s));let h=r&&r[d];i=oe.from(h?h.type.create(h.attrs,i):o.node(a).copy(i))}t.step(new Vt(e,e,new ve(s.append(i),n,n),!0))}function xi(t,e){let n=t.resolve(e),r=n.index();return y4(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eF(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),i=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function y4(t,e){return!!(t&&e&&!t.isLeaf&&eF(t,e))}function zp(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,a=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(s=r.node(o).maybeChild(a-1),i=r.node(o+1)),s&&!s.isTextblock&&y4(s,i)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function tF(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),i=s.node().type;if(o&&i.inlineContent){let h=i.whitespace=="pre",f=!!i.contentMatch.matchType(o);h&&!f?r=!1:!h&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let h=t.doc.resolve(e+n);g4(t,h.node(),h.before(),a)}i.inlineContent&&Tx(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(a),d=u.map(e-n);if(t.step(new Vt(d,u.map(e+n,-1),ve.empty,!0)),r===!0){let h=t.doc.resolve(d);m4(t,h.node(),h.before(),t.steps.length)}return t}function nF(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 s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function x4(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let a=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,u=r.index(i)+(a>0?1:0),d=r.node(i),h=!1;if(s==1)h=d.canReplace(u,u,o);else{let f=d.contentMatchAt(u).findWrapping(o.firstChild.type);h=f&&d.canReplaceWith(u,u,f[0])}if(h)return a==0?r.pos:a<0?r.before(i+1):r.after(i+1)}return null}function Fp(t,e,n=e,r=ve.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return v4(o,s,r)?new Vt(e,n,r):new rF(o,s,r).fit()}function v4(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class rF{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=oe.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=oe.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):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 s=this.placed,i=r.depth,a=o.depth;for(;i&&a&&s.childCount==1;)s=s.firstChild.content,i--,a--;let u=new ve(s,i,a);return e>-1?new hn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Vt(r.pos,o.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=bg(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:d}=this.frontier[a],h,f=null;if(n==1&&(i?d.matchType(i.type)||(f=d.fillBefore(oe.from(i),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&i&&(h=d.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=bg(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ve(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=bg(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new ve(Su(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new ve(Su(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let i=this.unplaced,a=r?r.content:i.content,u=i.openStart-e,d=0,h=[],{match:f,type:g}=this.frontier[n];if(o){for(let b=0;b<o.childCount;b++)h.push(o.child(b));f=f.matchFragment(o)}let x=a.size+e-(i.content.size-i.openEnd);for(;d<a.childCount;){let b=a.child(d),k=f.matchType(b.type);if(!k)break;d++,(d>1||u==0||b.content.size)&&(f=k,h.push(b4(b.mark(g.allowedMarks(b.marks)),d==1?u:0,d==a.childCount?x:-1)))}let v=d==a.childCount;v||(x=-1),this.placed=Eu(this.placed,n,oe.from(h)),this.frontier[n].match=f,v&&x<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,k=a;b<x;b++){let E=k.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),k=E.content}this.unplaced=v?e==0?ve.empty:new ve(Su(i.content,e-1,1),e-1,x<0?i.openEnd:e-1):new ve(Su(i.content,e,d),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!kg(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],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=kg(e,n,o,r,s);if(i){for(let a=n-1;a>=0;a--){let{match:u,type:d}=this.frontier[a],h=kg(e,a,d,u,!0);if(!h||h.childCount)continue e}return{depth:n,fit:i,move:s?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=Eu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Eu(this.placed,this.depth,oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(oe.empty,!0);n.childCount&&(this.placed=Eu(this.placed,this.frontier.length,n))}}function Su(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Su(t.firstChild.content,e-1,n)))}function Eu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Eu(t.lastChild.content,e-1,n)))}function bg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function b4(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,b4(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(oe.empty,!0)))),t.copy(r)}function kg(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,i);return a&&!oF(n,s.content,i)?a:null}function oF(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function sF(t){return t.spec.defining||t.spec.definingForContent}function iF(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(v4(o,s,r))return t.step(new Vt(e,n,r));let i=w4(o,s);i[i.length-1]==0&&i.pop();let a=-(o.depth+1);i.unshift(a);for(let g=o.depth,x=o.pos-1;g>0;g--,x--){let v=o.node(g).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;i.indexOf(g)>-1?a=g:o.before(g)==x&&i.splice(1,0,-g)}let u=i.indexOf(a),d=[],h=r.openStart;for(let g=r.content,x=0;;x++){let v=g.firstChild;if(d.push(v),x==r.openStart)break;g=v.content}for(let g=h-1;g>=0;g--){let x=d[g],v=sF(x.type);if(v&&!x.sameMarkup(o.node(Math.abs(a)-1)))h=g;else if(v||!x.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let x=(g+h+1)%(r.openStart+1),v=d[x];if(v)for(let b=0;b<i.length;b++){let k=i[(b+u)%i.length],E=!0;k<0&&(E=!1,k=-k);let _=o.node(k-1),T=o.index(k-1);if(_.canReplaceWith(T,T,v.type,v.marks))return t.replace(o.before(k),E?s.after(k):n,new ve(k4(r.content,0,r.openStart,x),x,r.openEnd))}}let f=t.steps.length;for(let g=i.length-1;g>=0&&(t.replace(e,n,r),!(t.steps.length>f));g--){let x=i[g];x<0||(e=o.before(x),n=s.after(x))}}function k4(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(k4(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(oe.empty,!0))}return t}function aF(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=nF(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ve(oe.from(r),0,0))}function lF(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let i=r.sharedDepth(n),a=!1;for(let u=r.depth;u>i;u--)r.node(u).type.spec.isolating&&(a=!0);for(let u=o.depth;u>i;u--)o.node(u).type.spec.isolating&&(a=!0);if(!a){for(let u=r.depth;u>0&&e==r.start(u);u--)e=r.before(u);for(let u=o.depth;u>0&&n==o.start(u);u--)n=o.before(u);r=t.doc.resolve(e),o=t.doc.resolve(n)}}let s=w4(r,o);for(let i=0;i<s.length;i++){let a=s[i],u=i==s.length-1;if(u&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(u||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}function w4(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<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;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class tl extends Rn{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 Ht.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Ht.fromReplace(e,this.pos,this.pos+1,new ve(oe.from(o),0,n.isLeaf?0:1))}getMap(){return dr.empty}invert(e){return new tl(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 tl(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 tl(n.pos,n.attr,n.value)}}Rn.jsonID("attr",tl);class hc extends Rn{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 Ht.ok(r)}getMap(){return dr.empty}invert(e){return new hc(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 hc(n.attr,n.value)}}Rn.jsonID("docAttr",hc);let fl=class extends Error{};fl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};fl.prototype=Object.create(Error.prototype);fl.prototype.constructor=fl;fl.prototype.name="TransformError";class C4{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new fl(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}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((s,i,a,u)=>{e=Math.min(e,a),n=Math.max(n,u)})}return e==1e9?null:{from:e,to:n}}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=ve.empty){let o=Fp(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ve(oe.from(r),0,0))}delete(e,n){return this.replace(e,n,ve.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return iF(this,e,n,r),this}replaceRangeWith(e,n,r){return aF(this,e,n,r),this}deleteRange(e,n){return lF(this,e,n),this}lift(e,n){return qz(this,e,n),this}join(e,n=1){return tF(this,e,n),this}wrap(e,n){return Jz(this,e,n),this}setBlockType(e,n=e,r,o=null){return Zz(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Xz(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new tl(e,n,r)),this}setDocAttribute(e,n){return this.step(new hc(e,n)),this}addNodeMark(e,n){return this.step(new Ys(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ut)n.isInSet(r.marks)&&this.step(new sa(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new sa(e,s)),o=s.removeFromSet(o);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,n=1,r){return Qz(this,e,n,r),this}addMark(e,n,r){return Hz(this,e,n,r),this}removeMark(e,n,r){return Uz(this,e,n,r),this}clearIncompatible(e,n,r){return Tx(this,e,n,r),this}}const wg=Object.create(null);class Ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new uF(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=ve.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:u,$to:d}=i[a],h=e.mapping.slice(s);e.replaceRange(h.map(u.pos),h.map(d.pos),a?ve.empty:n),a==0&&qw(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:a}=o[s],u=e.mapping.slice(r),d=u.map(i.pos),h=u.map(a.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,n),qw(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new ze(e):Za(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Za(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Za(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fr(e.node(0))}static atStart(e){return Za(e,e,0,0,1)||new fr(e)}static atEnd(e){return Za(e,e,e.content.size,e.childCount,-1)||new fr(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 ze.between(this.$anchor,this.$head).getBookmark()}}Ue.prototype.visible=!0;class uF{constructor(e,n){this.$from=e,this.$to=n}}let Uw=!1;function Ww(t){!Uw&&!t.parent.inlineContent&&(Uw=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ze extends Ue{constructor(e,n=e){Ww(e),Ww(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 Ue.near(r);let o=e.resolve(n.map(this.anchor));return new ze(o.parent.inlineContent?o:r,r)}replace(e,n=ve.empty){if(super.replace(e,n),n==ve.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new $p(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 ze(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 s=Ue.findFrom(n,r,!0)||Ue.findFrom(n,-r,!0);if(s)n=s.$head;else return Ue.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ue.findFrom(e,-r,!0)||Ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new ze(e,n)}}Ue.jsonID("text",ze);class $p{constructor(e,n){this.anchor=e,this.head=n}map(e){return new $p(e.map(this.anchor),e.map(this.head))}resolve(e){return ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ie extends Ue{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),s=e.resolve(o);return r?Ue.near(s):new Ie(s)}content(){return new ve(oe.from(this.node),0,0)}eq(e){return e instanceof Ie&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ax(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ie(e.resolve(n.anchor))}static create(e,n){return new Ie(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ie.prototype.visible=!1;Ue.jsonID("node",Ie);class Ax{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new $p(r,r):new Ax(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ie.isSelectable(r)?new Ie(n):Ue.near(n)}}class fr extends Ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ve.empty){if(n==ve.empty){e.delete(0,e.doc.content.size);let r=Ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new fr(e)}map(e){return new fr(e)}eq(e){return e instanceof fr}getBookmark(){return cF}}Ue.jsonID("all",fr);const cF={map(){return this},resolve(t){return new fr(t)}};function Za(t,e,n,r,o,s=!1){if(e.inlineContent)return ze.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let a=e.child(i);if(a.isAtom){if(!s&&Ie.isSelectable(a))return Ie.create(t,n-(o<0?a.nodeSize:0))}else{let u=Za(t,a,n+o,o<0?a.childCount:0,o,s);if(u)return u}n+=a.nodeSize*o}return null}function qw(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Vt||o instanceof hn))return;let s=t.mapping.maps[r],i;s.forEach((a,u,d,h)=>{i==null&&(i=h)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}const Kw=1,Tf=2,Gw=4;class dF extends C4{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|Kw)&~Tf,this.storedMarks=null,this}get selectionSet(){return(this.updated&Kw)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Tf,this}ensureMarks(e){return ut.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&Tf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Tf,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)||ut.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),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Ue.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|=Gw,this}get scrolledIntoView(){return(this.updated&Gw)>0}}function Jw(t,e){return!e||!t?t:t.bind(e)}class _u{constructor(e,n,r){this.name=e,this.init=Jw(n.init,r),this.apply=Jw(n.apply,r)}}const fF=[new _u("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new _u("selection",{init(t,e){return t.selection||Ue.atStart(e.doc)},apply(t){return t.selection}}),new _u("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new _u("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Cg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fF.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 _u(r.key,r.spec.state,r))})}}class Vi{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 s=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let u=o?o[i].n:0,d=o?o[i].state:this,h=u<n.length&&a.spec.appendTransaction.call(a,u?n.slice(u):n,d,r);if(h&&r.filterTransaction(h,i)){if(h.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<i?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Vi(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new dF(this)}static create(e){let n=new Cg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Vi(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 Cg(this.schema,e.plugins),r=n.fields,o=new Vi(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].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],s=o.spec.state;s&&s.toJSON&&(n[r]=s.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 Cg(e.schema,e.plugins),s=new Vi(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=ti.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=Ue.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],d=u.spec.state;if(u.key==i.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[i.name]=d.fromJSON.call(u,e,n[a],s);return}}s[i.name]=i.init(e,s)}}),s}}function S4(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=S4(o,e,{})),n[r]=o}return n}class St{constructor(e){this.spec=e,this.props={},e.props&&S4(e.props,this,this.props),this.key=e.key?e.key.key:E4("plugin")}getState(e){return e[this.key]}}const Sg=Object.create(null);function E4(t){return t in Sg?t+"$"+ ++Sg[t]:(Sg[t]=0,t+"$")}class Wt{constructor(e="key"){this.key=E4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const _4=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function T4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const N4=(t,e,n)=>{let r=T4(t,n);if(!r)return!1;let o=Mx(r);if(!o){let i=r.blockRange(),a=i&&Nl(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let s=o.nodeBefore;if(L4(t,o,e,-1))return!0;if(r.parent.content.size==0&&(hl(s,"end")||Ie.isSelectable(s)))for(let i=r.depth;;i--){let a=Fp(t.doc,r.before(i),r.after(i),ve.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=t.tr.step(a);u.setSelection(hl(s,"end")?Ue.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):Ie.create(u.doc,o.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},hF=(t,e,n)=>{let r=T4(t,n);if(!r)return!1;let o=Mx(r);return o?A4(t,o,e):!1},pF=(t,e,n)=>{let r=D4(t,n);if(!r)return!1;let o=Dx(r);return o?A4(t,o,e):!1};function A4(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let h=o.lastChild;if(!h)return!1;o=h}let i=e.nodeAfter,a=i,u=e.pos+1;for(;!a.isTextblock;u++){if(a.type.spec.isolating)return!1;let h=a.firstChild;if(!h)return!1;a=h}let d=Fp(t.doc,s,u,ve.empty);if(!d||d.from!=s||d instanceof Vt&&d.slice.size>=u-s)return!1;if(n){let h=t.tr.step(d);h.setSelection(ze.create(h.doc,s)),n(h.scrollIntoView())}return!0}function hl(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 M4=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=Mx(r)}let i=s&&s.nodeBefore;return!i||!Ie.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ie.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function Mx(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 D4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const R4=(t,e,n)=>{let r=D4(t,n);if(!r)return!1;let o=Dx(r);if(!o)return!1;let s=o.nodeAfter;if(L4(t,o,e,1))return!0;if(r.parent.content.size==0&&(hl(s,"start")||Ie.isSelectable(s))){let i=Fp(t.doc,r.before(),r.after(),ve.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(hl(s,"start")?Ue.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Ie.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},O4=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Dx(r)}let i=s&&s.nodeAfter;return!i||!Ie.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ie.create(t.doc,s.pos)).scrollIntoView()),!0)};function Dx(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 mF=(t,e)=>{let n=t.selection,r=n instanceof Ie,o;if(r){if(n.node.isTextblock||!xi(t.doc,n.from))return!1;o=n.from}else if(o=zp(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Ie.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},gF=(t,e)=>{let n=t.selection,r;if(n instanceof Ie){if(n.node.isTextblock||!xi(t.doc,n.to))return!1;r=n.to}else if(r=zp(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},yF=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Nl(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},j4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
484
+ `).scrollIntoView()),!0)};function Rx(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 xF=(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),s=n.indexAfter(-1),i=Rx(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let a=n.after(),u=t.tr.replaceWith(a,a,i.createAndFill());u.setSelection(Ue.near(u.doc.resolve(a),1)),e(u.scrollIntoView())}return!0},I4=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof fr||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=Rx(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(i,s.createAndFill());a.setSelection(ze.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},P4=(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 s=n.before();if(is(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Nl(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function vF(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Ie&&e.selection.node.isBlock)return!r.parentOffset||!is(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,a,u=!1,d=!1;for(let x=r.depth;;x--)if(r.node(x).isBlock){u=r.end(x)==r.pos+(r.depth-x),d=r.start(x)==r.pos-(r.depth-x),a=Rx(r.node(x-1).contentMatchAt(r.indexAfter(x-1))),s.unshift(u&&a?{type:a}:null),i=x;break}else{if(x==1)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof ze||e.selection instanceof fr)&&h.deleteSelection();let f=h.mapping.map(r.pos),g=is(h.doc,f,s.length,s);if(g||(s[0]=a?{type:a}:null,g=is(h.doc,f,s.length,s)),!g)return!1;if(h.split(f,s.length,s),!u&&d&&r.node(i).type!=a){let x=h.mapping.map(r.before(i)),v=h.doc.resolve(x);a&&r.node(i-1).canReplaceWith(v.index(),v.index()+1,a)&&h.setNodeMarkup(h.mapping.map(r.before(i)),a)}return n&&n(h.scrollIntoView()),!0}}const bF=vF(),kF=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Ie.create(t.doc,o))),!0)};function wF(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||xi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function L4(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,a,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&wF(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(a=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&a.matchType(i[0]||s.type).validEnd){if(n){let x=e.pos+s.nodeSize,v=oe.empty;for(let E=i.length-1;E>=0;E--)v=oe.from(i[E].create(null,v));v=oe.from(o.copy(v));let b=t.tr.step(new hn(e.pos-1,x,e.pos,x,new ve(v,1,0),i.length,!0)),k=b.doc.resolve(x+2*i.length);k.nodeAfter&&k.nodeAfter.type==o.type&&xi(b.doc,k.pos)&&b.join(k.pos),n(b.scrollIntoView())}return!0}let h=s.type.spec.isolating||r>0&&u?null:Ue.findFrom(e,1),f=h&&h.$from.blockRange(h.$to),g=f&&Nl(f);if(g!=null&&g>=e.depth)return n&&n(t.tr.lift(f,g).scrollIntoView()),!0;if(d&&hl(s,"start",!0)&&hl(o,"end")){let x=o,v=[];for(;v.push(x),!x.isTextblock;)x=x.lastChild;let b=s,k=1;for(;!b.isTextblock;b=b.firstChild)k++;if(x.canReplace(x.childCount,x.childCount,b.content)){if(n){let E=oe.empty;for(let T=v.length-1;T>=0;T--)E=oe.from(v[T].copy(E));let _=t.tr.step(new hn(e.pos-v.length,e.pos+s.nodeSize,e.pos+k,e.pos+s.nodeSize-k,new ve(E,v.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function z4(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(ze.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const CF=z4(-1),SF=z4(1);function EF(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=i&&Nx(i,t,e);return a?(r&&r(n.tr.wrap(i,a).scrollIntoView()),!0):!1}}function Zw(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(i,a,(u,d)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let h=n.doc.resolve(d),f=h.index();o=h.parent.canReplaceWith(f,f+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[i];s.setBlockType(a,u,t,e)}r(s.scrollIntoView())}return!0}}function Ox(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}Ox(_4,N4,M4);Ox(_4,R4,O4);Ox(j4,I4,P4,bF);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function _F(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let a=r?n.tr:null;return TF(a,i,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function TF(t,e,n,r=null){let o=!1,s=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=i.resolve(e.start-2);s=new mh(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new mh(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Nx(s,n,r,e);return a?(t&&NF(t,e,a,o,n),!0):!1}function NF(t,e,n,r,o){let s=oe.empty;for(let h=n.length-1;h>=0;h--)s=oe.from(n[h].type.create(n[h].attrs,s));t.step(new hn(e.start-(r?2:0),e.end,e.start,e.end,new ve(s,0,0),n.length,!0));let i=0;for(let h=0;h<n.length;h++)n[h].type==o&&(i=h+1);let a=n.length-i,u=e.start+n.length-(r?2:0),d=e.parent;for(let h=e.startIndex,f=e.endIndex,g=!0;h<f;h++,g=!1)!g&&is(t.doc,u,a)&&(t.split(u,a),u+=2*a),u+=d.child(h).nodeSize;return t}function AF(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?MF(e,n,t,s):DF(e,n,s):!0:!1}}function MF(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new hn(s-1,i,s,i,new ve(oe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new mh(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const a=Nl(r);if(a==null)return!1;o.lift(r,a);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return xi(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function DF(t,e,n){let r=t.tr,o=n.parent;for(let x=n.end,v=n.endIndex-1,b=n.startIndex;v>b;v--)x-=o.child(v).nodeSize,r.delete(x-1,x+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,u=n.endIndex==o.childCount,d=s.node(-1),h=s.index(-1);if(!d.canReplace(h+(a?0:1),h+1,i.content.append(u?oe.empty:oe.from(o))))return!1;let f=s.pos,g=f+i.nodeSize;return r.step(new hn(f-(a?1:0),g+(u?1:0),f+1,g-1,new ve((a?oe.empty:oe.from(o.copy(oe.empty))).append(u?oe.empty:oe.from(o.copy(oe.empty))),a?0:1,u?0:1),a?0:1)),e(r.scrollIntoView()),!0}function RF(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,d=>d.childCount>0&&d.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let a=s.parent,u=a.child(i-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==a.type,h=oe.from(d?t.create():null),f=new ve(oe.from(t.create(null,oe.from(a.type.create(null,h)))),d?3:1,0),g=s.start,x=s.end;n(e.tr.step(new hn(g-(d?3:1),x,g,x,f,1,!0)).scrollIntoView())}return!0}}const bn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},pl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ny=null;const Yo=function(t,e,n){let r=ny||(ny=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},OF=function(){ny=null},ia=function(t,e,n,r){return n&&(Yw(t,e,n,r,-1)||Yw(t,e,n,r,1))},jF=/^(img|br|input|textarea|hr)$/i;function Yw(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Dr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Uc(t)||jF.test(t.nodeName)||t.contentEditable=="false")return!1;e=bn(t)+(o<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=i,e=o<0?Dr(t):0}else return!1}}function Dr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function IF(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Dr(t)}else if(t.parentNode&&!Uc(t))e=bn(t),t=t.parentNode;else return null}}function PF(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Uc(t))e=bn(t)+1,t=t.parentNode;else return null}}function LF(t,e,n){for(let r=e==0,o=e==Dr(t);r||o;){if(t==n)return!0;let s=bn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Dr(t)}}function Uc(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 Bp=function(t){return t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function $i(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zF(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function FF(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Dr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Dr(r.startContainer),r.startOffset)}}}const No=typeof navigator<"u"?navigator:null,Xw=typeof document<"u"?document:null,vi=No&&No.userAgent||"",ry=/Edge\/(\d+)/.exec(vi),F4=/MSIE \d/.exec(vi),oy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vi),rr=!!(F4||oy||ry),ni=F4?document.documentMode:oy?+oy[1]:ry?+ry[1]:0,Rr=!rr&&/gecko\/(\d+)/i.test(vi);Rr&&+(/Firefox\/(\d+)/.exec(vi)||[0,0])[1];const sy=!rr&&/Chrome\/(\d+)/.exec(vi),wn=!!sy,$4=sy?+sy[1]:0,Mn=!rr&&!!No&&/Apple Computer/.test(No.vendor),ml=Mn&&(/Mobile\/\w+/.test(vi)||!!No&&No.maxTouchPoints>2),Nr=ml||(No?/Mac/.test(No.platform):!1),B4=No?/Win/.test(No.platform):!1,Qo=/Android \d/.test(vi),Wc=!!Xw&&"webkitFontSmoothing"in Xw.documentElement.style,$F=Wc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function BF(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Wo(t,e){return typeof t=="number"?t:t[e]}function VF(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 Qw(t,e,n){if(!iy(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;){if(i.nodeType!=1){i=pl(i);continue}let a=i,u=a==s.body,d=u?BF(s):VF(a),h=0,f=0;if(e.top<d.top+Wo(r,"top")?f=-(d.top-e.top+Wo(o,"top")):e.bottom>d.bottom-Wo(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Wo(o,"top")-d.top:e.bottom-d.bottom+Wo(o,"bottom")),e.left<d.left+Wo(r,"left")?h=-(d.left-e.left+Wo(o,"left")):e.right>d.right-Wo(r,"right")&&(h=e.right-d.right+Wo(o,"right")),h||f)if(u)s.defaultView.scrollBy(h,f);else{let x=a.scrollLeft,v=a.scrollTop;f&&(a.scrollTop+=f),h&&(a.scrollLeft+=h);let b=a.scrollLeft-x,k=a.scrollTop-v;e={left:e.left-b,top:e.top-k,right:e.right-b,bottom:e.bottom-k}}let g=u?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(g))break;i=g=="absolute"?i.offsetParent:pl(i)}}function HF(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(s,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let u=a.getBoundingClientRect();if(u.top>=n-20){r=a,o=u.top;break}}return{refDOM:r,refTop:o,stack:V4(t.dom)}}function V4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=pl(r));return e}function UF({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;H4(n,r==0?0:r-e)}function H4(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Wa=null;function WF(t){if(t.setActive)return t.setActive();if(Wa)return t.focus(Wa);let e=V4(t);t.focus(Wa==null?{get preventScroll(){return Wa={preventScroll:!0},!0}}:void 0),Wa||(Wa=!1,H4(e,0))}function U4(t,e){let n,r=2e8,o,s=0,i=e.top,a=e.top,u,d;for(let h=t.firstChild,f=0;h;h=h.nextSibling,f++){let g;if(h.nodeType==1)g=h.getClientRects();else if(h.nodeType==3)g=Yo(h).getClientRects();else continue;for(let x=0;x<g.length;x++){let v=g[x];if(v.top<=i&&v.bottom>=a){i=Math.max(v.bottom,i),a=Math.min(v.top,a);let b=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(b<r){n=h,r=b,o=b&&n.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,h.nodeType==1&&b&&(s=f+(e.left>=(v.left+v.right)/2?1:0));continue}}else v.top>e.top&&!u&&v.left<=e.left&&v.right>=e.left&&(u=h,d={left:Math.max(v.left,Math.min(v.right,e.left)),top:v.top});!n&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(s=f+1)}}return!n&&u&&(n=u,o=d,r=0),n&&n.nodeType==3?qF(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:U4(n,o)}function qF(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let i=$s(r,1);if(i.top!=i.bottom&&jx(e,i)){o={node:t,offset:s+(e.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function jx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function KF(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function GF(t,e,n){let{node:r,offset:o}=U4(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function JF(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),u;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((u=a.dom.getBoundingClientRect()).width||u.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&u.left>r.left||u.top>r.top?o=a.posBefore:(!i&&u.right<r.left||u.bottom<r.top)&&(o=a.posAfter),i=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function W4(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)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let a=i.getClientRects();for(let u=0;u<a.length;u++){let d=a[u];if(jx(e,d))return W4(i,e,d)}}if((s=(s+1)%r)==o)break}return t}function ZF(t,e){let n=t.dom.ownerDocument,r,o=0,s=FF(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let d=t.dom.getBoundingClientRect();if(!jx(e,d)||(i=W4(t.dom,e,d),!i))return null}if(Mn)for(let d=i;r&&d;d=pl(d))d.draggable&&(r=void 0);if(i=KF(i,e),r){if(Rr&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let h=r.childNodes[o],f;h.nodeName=="IMG"&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let d;Wc&&o&&r.nodeType==1&&(d=r.childNodes[o-1]).nodeType==1&&d.contentEditable=="false"&&d.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=JF(t,r,o,e))}a==null&&(a=GF(t,i,e));let u=t.docView.nearestDesc(i,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function iy(t){return t.top<t.bottom||t.left<t.right}function $s(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(iy(r))return r}return Array.prototype.find.call(n,iy)||t.getBoundingClientRect()}const YF=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function q4(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Wc||Rr;if(r.nodeType==3)if(i&&(YF.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=$s(Yo(r,o,o),n);if(Rr&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=$s(Yo(r,o-1,o-1),-1);if(d.top==u.top){let h=$s(Yo(r,o,o+1),-1);if(h.top!=u.top)return mu(h,h.left<d.left)}}return u}else{let u=o,d=o,h=n<0?1:-1;return n<0&&!o?(d++,h=-1):n>=0&&o==r.nodeValue.length?(u--,h=1):n<0?u--:d++,mu($s(Yo(r,u,d),h),h<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Dr(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return Eg(u.getBoundingClientRect(),!1)}if(s==null&&o<Dr(r)){let u=r.childNodes[o];if(u.nodeType==1)return Eg(u.getBoundingClientRect(),!0)}return Eg(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Dr(r))){let u=r.childNodes[o-1],d=u.nodeType==3?Yo(u,Dr(u)-(i?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return mu($s(d,1),!1)}if(s==null&&o<Dr(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?Yo(u,0,i?0:1):u.nodeType==1?u:null:null;if(d)return mu($s(d,-1),!0)}return mu($s(r.nodeType==3?Yo(r):r,-n),n>=0)}function mu(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 Eg(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 K4(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 XF(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return K4(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let i=q4(t,o.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let u;if(a.nodeType==1)u=a.getClientRects();else if(a.nodeType==3)u=Yo(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let h=u[d];if(h.bottom>h.top+1&&(n=="up"?i.top-h.top>(h.bottom-i.top)*2:h.bottom-i.bottom>(i.bottom-h.top)*2))return!1}}return!0})}const QF=/[\u0590-\u08ac]/;function e$(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,a=t.domSelection();return a?!QF.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:i:K4(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:h,anchorOffset:f}=t.domSelectionRange(),g=a.caretBidiLevel;a.modify("move",n,"character");let x=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:v,focusOffset:b}=t.domSelectionRange(),k=v&&!x.contains(v.nodeType==1?v:v.parentNode)||u==v&&d==b;try{a.collapse(h,f),u&&(u!=h||d!=f)&&a.extend&&a.extend(u,d)}catch{}return g!=null&&(a.caretBidiLevel=g),k}):r.pos==r.start()||r.pos==r.end()}let eC=null,tC=null,nC=!1;function t$(t,e,n){return eC==e&&tC==n?nC:(eC=e,tC=n,nC=n=="up"||n=="down"?XF(t,e,n):e$(t,e,n))}const Or=0,rC=1,Hi=2,Yr=3;class qc{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Or,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){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 s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>bn(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 s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.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 s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}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 s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let a=o.children[i];if(a.size){o=a;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],a=s+i.size;if(a>e||i instanceof J4){o=e-s;break}s=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof G4&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?bn(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?bn(s.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,s=-1;for(let i=r,a=0;;a++){let u=this.children[a],d=i+u.size;if(o==-1&&e<=d){let h=i+u.border;if(e>=h&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,h);e=i;for(let f=a;f>0;f--){let g=this.children[f-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){o=bn(g.dom)+1;break}e-=g.size}o==-1&&(o=0)}if(o>-1&&(d>n||a==this.children.length-1)){n=d;for(let h=a+1;h<this.children.length;h++){let f=this.children[h];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=bn(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=d}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}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 s=Math.min(e,n),i=Math.max(e,n);for(let x=0,v=0;x<this.children.length;x++){let b=this.children[x],k=v+b.size;if(s>v&&i<k)return b.setSelection(e-v-b.border,n-v-b.border,r,o);v=k}let a=this.domFromPos(e,e?-1:1),u=n==e?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),f=!1;if((Rr||Mn)&&e==n){let{node:x,offset:v}=a;if(x.nodeType==3){if(f=!!(v&&x.nodeValue[v-1]==`
485
+ `),f&&v==x.nodeValue.length)for(let b=x,k;b;b=b.parentNode){if(k=b.nextSibling){k.nodeName=="BR"&&(a=u={node:k.parentNode,offset:bn(k)+1});break}let E=b.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let b=x.childNodes[v-1];f=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(Rr&&h.focusNode&&h.focusNode!=u.node&&h.focusNode.nodeType==1){let x=h.focusNode.childNodes[h.focusOffset];x&&x.contentEditable=="false"&&(o=!0)}if(!(o||f&&Mn)&&ia(a.node,a.offset,h.anchorNode,h.anchorOffset)&&ia(u.node,u.offset,h.focusNode,h.focusOffset))return;let g=!1;if((d.extend||e==n)&&!(f&&Rr)){d.collapse(a.node,a.offset);try{e!=n&&d.extend(u.node,u.offset),g=!0}catch{}}if(!g){if(e>n){let v=a;a=u,u=v}let x=document.createRange();x.setEnd(u.node,u.offset),x.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(x)}}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 s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let a=r+s.border,u=i-s.border;if(e>=a&&n<=u){this.dirty=e==r||n==i?Hi:rC,e==a&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Yr:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Hi:Yr}r=i}this.dirty=Hi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Hi:rC;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class G4 extends qc{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Or&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class n$ extends qc{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 ri extends qc{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=ma.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ri(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Yr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Yr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Or){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Or}}slice(e,n,r){let o=ri.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=ly(s,n,i,r)),e>0&&(s=ly(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oi extends qc{constructor(e,n,r,o,s,i,a){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,s,i){let a=s.nodeViews[n.type.name],u,d=a&&a(n,s,()=>{if(!u)return i;if(u.parent)return u.parent.posBeforeChild(u)},r,o),h=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:f}=ma.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let g=h;return h=X4(h,r,n),d?u=new r$(e,n,r,o,h,f||null,g,d):n.isText?new Vp(e,n,r,o,h,g):new oi(e,n,r,o,h,f||null,g)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElement=o.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(o=>o.nodeType==1&&e.indexOf(o.parentNode)<0&&this.dom.contains(o));r?n.contentElement=r:n.getContent=()=>oe.empty}}return n}matchesNode(e,n,r){return this.dirty==Or&&e.eq(this.node)&&yh(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,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,a=s&&s.pos<0,u=new s$(this,i&&i.node,e);l$(this.node,this.innerDeco,(d,h,f)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,h):d.type.side>=0&&!f&&u.syncToMarks(h==this.node.childCount?ut.none:this.node.child(h).marks,r,e,h),u.placeWidget(d,e,o)},(d,h,f,g)=>{u.syncToMarks(d.marks,r,e,g);let x;u.findNodeMatch(d,h,f,g)||a&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(x=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,h,f,x,e)||u.updateNextNode(d,h,f,e,g,o)||u.addNode(d,h,f,e,o),o+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Hi)&&(i&&this.protectLocalComposition(e,i),Z4(this.contentDOM,this.children,e),ml&&u$(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof ze)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,a=c$(this.node.content,i,r-n,o-n);return a<0?null:{node:s,pos:a,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new n$(this,s,n,o);e.input.compositionNodes.push(i),this.children=ly(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==Yr||!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=Or}updateOuterDeco(e){if(yh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Y4(this.dom,this.nodeDOM,ay(this.outerDeco,this.node,n),ay(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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function oC(t,e,n,r,o){X4(r,e,t);let s=new oi(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}class Vp extends oi{constructor(e,n,r,o,s,i){super(e,n,r,o,s,null,i)}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==Yr||this.dirty!=Or&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Or||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=Or,!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),s=document.createTextNode(o.text);return new Vp(this.parent,o,this.outerDeco,this.innerDeco,s,s)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Yr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class J4 extends qc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Or&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class r$ extends oi{constructor(e,n,r,o,s,i,a,u){super(e,n,r,o,s,i,a),this.spec=u}update(e,n,r,o){if(this.dirty==Yr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}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.root):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 Z4(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=sC(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(i instanceof ri){let u=r?r.previousSibling:t.lastChild;Z4(i.contentDOM,i.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=sC(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Ru=function(t){t&&(this.nodeName=t)};Ru.prototype=Object.create(null);const Ui=[new Ru];function ay(t,e,n){if(t.length==0)return Ui;let r=n?Ui[0]:new Ru,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Ru(i.nodeName));for(let a in i){let u=i[a];u!=null&&(n&&o.length==1&&o.push(r=new Ru(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+u:a=="style"?r.style=(r.style?r.style+";":"")+u:a!="nodeName"&&(r[a]=u))}}}return o}function Y4(t,e,n,r){if(n==Ui&&r==Ui)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],a=n[s];if(s){let u;a&&a.nodeName==i.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==i.nodeName||(u=document.createElement(i.nodeName),u.pmIsDeco=!0,u.appendChild(o),a=Ui[0]),o=u}o$(o,a||Ui[0],i)}return o}function o$(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 s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);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 X4(t,e,n){return Y4(t,t,Ui,ay(e,n,t.nodeType!=1))}function yh(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 sC(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class s${constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=i$(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,o){let s=0,i=this.stack.length>>1,a=Math.min(i,e.length);for(;s<a&&(s==i-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<i;)this.destroyRest(),this.top.dirty=Or,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;o<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let h=this.index;h<d;h++){let f=this.top.children[h];if(f.matchesMark(e[i])&&!this.isLocked(f.dom)){u=h;break}}if(u<0&&this.index<this.top.children.length){let h=this.top.children[this.index];h instanceof ri&&h.dirty!=Yr&&h.mark.type==e[i].type&&h.spec.update&&!this.isLocked(h.dom)&&h.spec.update(e[i])&&(h.mark=e[i],u=this.index,this.changed=!0)}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let h=ri.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let a=this.index,u=Math.min(this.top.children.length,a+5);a<u;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==Yr&&i.dom==i.contentDOM&&(i.dirty=Hi),i.update(e,n,r,s)?(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,s,i){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof oi){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let h=u.dom,f,g=this.isLocked(h)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=Yr&&yh(n,u.outerDeco));if(!g&&u.update(e,n,r,o))return this.destroyBetween(this.index,a),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!g&&(f=this.recreateWrapper(u,e,n,r,o,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Hi,f.updateChildren(o,i+1),f.dirty=Or),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!yh(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=oi.create(this.top,n,r,o,s,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let u of a.children)u.parent=a}return e.destroy(),a}addNode(e,n,r,o,s){let i=oi.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),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 s=new G4(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ri;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Vp)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Mn||wn)&&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 J4(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 i$(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof ri)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=t.child(o-1))break;--o,s.set(a,o),i.push(a)}}return{index:o,matched:s,matches:i.reverse()}}function a$(t,e){return t.type.side-e.type.side}function l$(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let d=0;d<t.childCount;d++){let h=t.child(d);r(h,o,e.forChild(s,h),d),s+=h.nodeSize}return}let i=0,a=[],u=null;for(let d=0;;){let h,f;for(;i<o.length&&o[i].to==s;){let k=o[i++];k.widget&&(h?(f||(f=[h])).push(k):h=k)}if(h)if(f){f.sort(a$);for(let k=0;k<f.length;k++)n(f[k],d,!!u)}else n(h,d,!!u);let g,x;if(u)x=-1,g=u,u=null;else if(d<t.childCount)x=d,g=t.child(d++);else break;for(let k=0;k<a.length;k++)a[k].to<=s&&a.splice(k--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)a.push(o[i++]);let v=s+g.nodeSize;if(g.isText){let k=v;i<o.length&&o[i].from<k&&(k=o[i].from);for(let E=0;E<a.length;E++)a[E].to<k&&(k=a[E].to);k<v&&(u=g.cut(k-s),g=g.cut(0,k-s),v=k,x=-1)}else for(;i<o.length&&o[i].to<v;)i++;let b=g.isInline&&!g.isLeaf?a.filter(k=>!k.inline):a.slice();r(g,b,e.forChild(s,g),x),s=v}}function u$(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 c$(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),a=s;if(s+=i.nodeSize,!i.isText)continue;let u=i.text;for(;o<t.childCount;){let d=t.child(o++);if(s+=d.nodeSize,!d.isText)break;u+=d.text}if(s>=n){if(s>=r&&u.slice(r-e.length-a,r-a)==e)return r-e.length;let d=a<r?u.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&u.length>=r+e.length-a&&u.slice(r-a,r-a+e.length)==e)return r}}return-1}function ly(t,e,n,r,o){let s=[];for(let i=0,a=0;i<t.length;i++){let u=t[i],d=a,h=a+=u.size;d>=n||h<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),o&&(s.push(o),o=void 0),h>n&&s.push(u.slice(n-d,u.size,r)))}return s}function Ix(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let a=r.resolve(i),u,d;if(Bp(n)){for(u=i;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Ie.isSelectable(f)&&o.parent&&!(f.isInline&&LF(n.focusNode,n.focusOffset,o.dom))){let g=o.posBefore;d=new Ie(i==g?a:r.resolve(g))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=i,g=i;for(let x=0;x<n.rangeCount;x++){let v=n.getRangeAt(x);f=Math.min(f,t.docView.posFromDOM(v.startContainer,v.startOffset,1)),g=Math.max(g,t.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(f<0)return null;[u,i]=g==t.state.selection.anchor?[g,f]:[f,g],a=r.resolve(i)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!d){let f=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;d=Px(t,h,a,f)}return d}function Q4(t){return t.editable?t.hasFocus():t6(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function as(t,e=!1){let n=t.state.selection;if(e6(t,n),!Q4(t))return;let r=t.input.mouseDown;if(!e&&wn&&r){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&ia(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)f$(t);else{let{anchor:o,head:s}=n,i,a;iC&&!(n instanceof ze)&&(n.$from.parent.inlineContent||(i=aC(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=aC(t,n.to))),t.docView.setSelection(o,s,t,e),iC&&(i&&lC(i),a&&lC(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&d$(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const iC=Mn||wn&&$4<63;function aC(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Mn&&o&&o.contentEditable=="false")return _g(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return _g(o);if(s)return _g(s)}}function _g(t){return t.contentEditable="true",Mn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function lC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function d$(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(()=>{(!Q4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function f$(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,bn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&rr&&ni<=11&&(n.disabled=!0,n.disabled=!1)}function e6(t,e){if(e instanceof Ie){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(uC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else uC(t)}function uC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Px(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||ze.between(e,n,r)}function cC(t){return t.editable&&!t.hasFocus()?!1:t6(t)}function t6(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 h$(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ia(e.node,e.offset,n.anchorNode,n.anchorOffset)}function uy(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&Ue.findFrom(s,e)}function Vs(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function dC(t,e,n){let r=t.state.selection;if(r instanceof ze)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return Vs(t,new ze(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=uy(t.state,e);return o&&o instanceof Ie?Vs(t,o):!1}else if(!(Nr&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Ie.isSelectable(s)?Vs(t,new Ie(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Wc?Vs(t,new ze(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ie&&r.node.isInline)return Vs(t,new ze(e>0?r.$to:r.$from));{let o=uy(t.state,e);return o?Vs(t,o):!1}}}function xh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ou(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function qa(t,e){return e<0?p$(t):m$(t)}function p$(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Rr&&n.nodeType==1&&r<xh(n)&&Ou(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ou(a,-1))o=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(n6(n))break;{let a=n.previousSibling;for(;a&&Ou(a,-1);)o=n.parentNode,s=bn(a),a=a.previousSibling;if(a)n=a,r=xh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?cy(t,n,r):o&&cy(t,o,s)}function m$(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=xh(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Ou(a,1))s=n,i=++r;else break}else{if(n6(n))break;{let a=n.nextSibling;for(;a&&Ou(a,1);)s=a.parentNode,i=bn(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=xh(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&cy(t,s,i)}function n6(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function g$(t,e){for(;t&&e==t.childNodes.length&&!Uc(t);)e=bn(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 y$(t,e){for(;t&&!e&&!Uc(t);)e=bn(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 cy(t,e,n){if(e.nodeType!=3){let s,i;(i=g$(e,n))?(e=i,n=0):(s=y$(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Bp(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&as(t)},50)}function fC(t,e){let n=t.state.doc.resolve(e);if(!(wn||B4)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function hC(t,e,n){let r=t.state.selection;if(r instanceof ze&&!r.empty||n.indexOf("s")>-1||Nr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=uy(t.state,e);if(i&&i instanceof Ie)return Vs(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,a=r instanceof fr?Ue.near(i,e):Ue.findFrom(i,e);return a?Vs(t,a):!1}return!1}function pC(t,e){if(!(t.state.selection instanceof ze))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 s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function mC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function x$(t){if(!Mn||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;mC(t,r,"true"),setTimeout(()=>mC(t,r,"false"),20)}return!1}function v$(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function b$(t,e){let n=e.keyCode,r=v$(e);if(n==8||Nr&&n==72&&r=="c")return pC(t,-1)||qa(t,-1);if(n==46&&!e.shiftKey||Nr&&n==68&&r=="c")return pC(t,1)||qa(t,1);if(n==13||n==27)return!0;if(n==37||Nr&&n==66&&r=="c"){let o=n==37?fC(t,t.state.selection.from)=="ltr"?-1:1:-1;return dC(t,o,r)||qa(t,o)}else if(n==39||Nr&&n==70&&r=="c"){let o=n==39?fC(t,t.state.selection.from)=="ltr"?1:-1:1;return dC(t,o,r)||qa(t,o)}else{if(n==38||Nr&&n==80&&r=="c")return hC(t,-1,r)||qa(t,-1);if(n==40||Nr&&n==78&&r=="c")return x$(t)||hC(t,1,r)||qa(t,1);if(r==(Nr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Lx(t,e){t.someProp("transformCopied",x=>{e=x(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let x=r.firstChild;n.push(x.type.name,x.attrs!=x.type.defaultAttrs?x.attrs:null),r=x.content}let i=t.someProp("clipboardSerializer")||ma.fromSchema(t.state.schema),a=l6(),u=a.createElement("div");u.appendChild(i.serializeFragment(r,{document:a}));let d=u.firstChild,h,f=0;for(;d&&d.nodeType==1&&(h=a6[d.nodeName.toLowerCase()]);){for(let x=h.length-1;x>=0;x--){let v=a.createElement(h[x]);for(;u.firstChild;)v.appendChild(u.firstChild);u.appendChild(v),f++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let g=t.someProp("clipboardTextSerializer",x=>x(e,t))||e.content.textBetween(0,e.content.size,`
486
+
487
+ `);return{dom:u,text:g,slice:e}}function r6(t,e,n,r,o){let s=o.parent.type.spec.code,i,a;if(!n&&!e)return null;let u=!!e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",g=>{e=g(e,s||r,t)}),s)return a=new ve(oe.from(t.state.schema.text(e.replace(/\r\n?/g,`
488
+ `))),0,0),t.someProp("transformPasted",g=>{a=g(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",g=>g(e,o,r,t));if(f)a=f;else{let g=o.marks(),{schema:x}=t.state,v=ma.fromSchema(x);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let k=i.appendChild(document.createElement("p"));b&&k.appendChild(v.serializeNode(x.text(b,g)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),i=S$(n),Wc&&E$(i);let d=i&&i.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let f=+h[3];f>0;f--){let g=i.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;i=g}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||ss.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(u||h),context:o,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!k$.test(g.parentNode.nodeName)?{ignore:!0}:null}})),h)a=_$(gC(a,+h[1],+h[2]),h[4]);else if(a=ve.maxOpen(w$(a.content,o),!0),a.openStart||a.openEnd){let f=0,g=0;for(let x=a.content.firstChild;f<a.openStart&&!x.type.spec.isolating;f++,x=x.firstChild);for(let x=a.content.lastChild;g<a.openEnd&&!x.type.spec.isolating;g++,x=x.lastChild);a=gC(a,f,g)}return t.someProp("transformPasted",f=>{a=f(a,t,u)}),a}const k$=/^(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 w$(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)),s,i=[];if(t.forEach(a=>{if(!i)return;let u=o.findWrapping(a.type),d;if(!u)return i=null;if(d=i.length&&s.length&&s6(u,s,a,i[i.length-1],0))i[i.length-1]=d;else{i.length&&(i[i.length-1]=i6(i[i.length-1],s.length));let h=o6(a,u);i.push(h),o=o.matchType(h.type),s=u}}),i)return oe.from(i)}return t}function o6(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,oe.from(t));return t}function s6(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=s6(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(oe.from(o6(n,t,o+1))))}}function i6(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,i6(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(oe.empty,!0);return t.copy(n.append(r))}function dy(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(s=0),o<r-1&&(a=dy(a,e,n,r,o+1,s)),o>=n&&(a=e<0?i.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function gC(t,e,n){return e<t.openStart&&(t=new ve(dy(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ve(dy(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const a6={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function l6(){return document.implementation.createHTMLDocument("title")}let Tg=null;function C$(t){let e=window.trustedTypes;return e?(Tg||(Tg=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Tg.createHTML(t)):t}function S$(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=l6(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),s;if((s=o&&a6[o[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=C$(t),s)for(let i=0;i<s.length;i++)r=r.querySelector(s[i])||r;for(let i=0;i<n.styleSheets.length;i++){let a=n.styleSheets[i];for(let u=0;u<a.rules.length;u++){let d=a.rules[u];if(d instanceof CSSStyleRule){let h=r.querySelectorAll(d.selectorText);for(let f=0;f<h.length;f++)h[f].style.cssText+=d.style.cssText}}}return r}function E$(t){let e=t.querySelectorAll(wn?"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 _$(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:s,openEnd:i}=t;for(let a=r.length-2;a>=0;a-=2){let u=n.nodes[r[a]];if(!u||u.hasRequiredAttrs())break;o=oe.from(u.create(r[a+1],o)),s++,i++}return new ve(o,s,i)}const $n={},Bn={},T$={touchstart:!0,touchmove:!0};class N${constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function A$(t){for(let e in $n){let n=$n[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{D$(t,r)&&!zx(t,r)&&(t.editable||!(r.type in Bn))&&n(t,r)},T$[e]?{passive:!0}:void 0)}Mn&&t.dom.addEventListener("input",()=>null),fy(t)}function es(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function M$(t){t.input.mouseDown&&t.input.mouseDown.done(),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 fy(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>zx(t,r))})}function zx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function D$(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 R$(t,e){!zx(t,e)&&$n[e.type]&&(t.editable||!(e.type in Bn))&&$n[e.type](t,e)}Bn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!f6(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qo&&wn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ml&&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,$i(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||b$(t,n)?n.preventDefault():es(t,"key")};Bn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Bn.keypress=(t,e)=>{let n=e;if(f6(t)||!n.charCode||n.ctrlKey&&!n.altKey||Nr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ze)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function Kc(t){return{left:t.clientX,top:t.clientY}}function O$(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Fx(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,a=>i>s.depth?a(t,n,s.nodeAfter,s.before(i),o,!0):a(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Gc(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function j$(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ie.isSelectable(r)?(Gc(t,new Ie(n)),!0):!1}function I$(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ie&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let a=i>s.depth?s.nodeAfter:s.node(i);if(Ie.isSelectable(a)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(Gc(t,Ie.create(t.state.doc,o)),!0):!1}function P$(t,e,n,r,o){return Fx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?I$(t,n):j$(t,n))}function L$(t,e,n,r){return Fx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function z$(t,e,n,r){return Fx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||F$(t,n,r)}function F$(t,e,n){if(n.button!=0)return!1;let r=u6(t,e,!0),o=t.state.doc;return r?(Gc(t,r),r instanceof ze&&o.eq(t.state.doc)&&(t.input.mouseDown=new B$(t,r)),!0):!1}function u6(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?ze.create(r,0,r.content.size):null;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),a=o.before(s);if(i.inlineContent)return ze.create(r,a+1,a+1+i.content.size);if(n&&Ie.isSelectable(i))return Ie.create(r,a)}return null}function $x(t){return vh(t)}const c6=Nr?"metaKey":"ctrlKey";$n.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$x(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&O$(n,t.input.lastClick)&&!n[c6]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let i=t.posAtCoords(Kc(n));i&&(s=="singleClick"?t.input.mouseDown=new $$(t,i,n,!!r):(s=="doubleClick"?L$:z$)(t,i.pos,i.inside,n)?n.preventDefault():es(t,"pointer"))};class d6{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class $$ extends d6{constructor(e,n,r,o){super(e),this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[c6],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let h=e.state.doc.resolve(n.pos);s=h.parent,i=h.depth?h.before():0}const a=o?null:r.target,u=a?e.docView.nearestDesc(a,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof Ie&&d.from<=i&&d.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Rr&&!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()),es(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||as(this.view)})}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(Kc(e))),this.updateAllowDefault(e),this.allowDefault||!n?es(this.view,"pointer"):P$(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mn&&this.mightDrag&&!this.mightDrag.node.isAtom||wn&&!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)?(Gc(this.view,Ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):es(this.view,"pointer")}move(e){this.updateAllowDefault(e),es(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class B$ extends d6{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),es(this.view,"pointer");let n=this.view.posAtCoords(Kc(e)),r=n&&u6(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,s=this.startSelection,[i,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];Gc(this.view,ze.create(o,i,a))}}$n.touchstart=t=>{t.input.lastTouch=Date.now(),$x(t),es(t,"pointer")};$n.touchmove=t=>{t.input.lastTouch=Date.now(),es(t,"pointer")};$n.contextmenu=t=>$x(t);function f6(t,e){return t.composing?!0:Mn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const V$=Qo?5e3:-1;Bn.compositionstart=Bn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ze&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||wn&&B4&&H$(t)))t.markCursor=t.state.storedMarks||n.marks(),vh(t,!0),t.markCursor=null;else if(vh(t,!e.selection.empty),Rr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}h6(t,V$)};function H$(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Bn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,h6(t,20))};function h6(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vh(t),e))}function p6(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function U$(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=IF(e.focusNode,e.focusOffset),r=PF(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function vh(t,e=!1){if(!(Qo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),p6(t),e||t.docView&&t.docView.dirty){let n=Ix(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function W$(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 pc=rr&&ni<15||ml&&$F<604;$n.copy=Bn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=pc?null:n.clipboardData,i=r.content(),{dom:a,text:u}=Lx(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",u)):W$(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function q$(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function K$(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?mc(t,r.value,null,o,e):mc(t,r.textContent,r.innerHTML,o,e)},50)}function mc(t,e,n,r,o){let s=r6(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,o,s||ve.empty)))return!0;if(!s)return!1;let i=q$(s),a=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function m6(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," "):""}Bn.paste=(t,e)=>{let n=e;if(t.composing&&!Qo)return;let r=pc?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&mc(t,m6(r),r.getData("text/html"),o,n)?n.preventDefault():K$(t,n)};class g6{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const G$=Nr?"altKey":"ctrlKey";function y6(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[G$]}$n.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Kc(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Ie?o.to-1:o.to))){if(r&&r.mightDrag)i=Ie.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(i=Ie.create(t.state.doc,f.posBefore))}}let a=(i||t.state.selection).content(),{dom:u,text:d,slice:h}=Lx(t,a);(!n.dataTransfer.files.length||!wn||$4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(pc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",pc||n.dataTransfer.setData("text/plain",d),t.dragging=new g6(h,y6(t,n),i)};$n.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Bn.dragover=Bn.dragenter=(t,e)=>e.preventDefault();Bn.drop=(t,e)=>{try{J$(t,e,t.dragging)}finally{t.dragging=null}};function J$(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Kc(e));if(!r)return;let o=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",x=>{s=x(s,t,!1)}):s=r6(t,m6(e.dataTransfer),pc?null:e.dataTransfer.getData("text/html"),!1,o);let i=!!(n&&y6(t,e));if(t.someProp("handleDrop",x=>x(t,e,s||ve.empty,i))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?x4(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let u=t.state.tr;if(i){let{node:x}=n;x?x.replace(u):u.deleteSelection()}let d=u.mapping.map(a),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=u.doc;if(h?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(f))return;let g=u.doc.resolve(d);if(h&&Ie.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Ie(g));else{let x=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,b,k,E)=>x=E),u.setSelection(Px(t,g,u.doc.resolve(x)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}$n.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())&&as(t)},20))};$n.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)};$n.beforeinput=(t,e)=>{if(Qo&&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",s=>s(t,$i(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 Bn)$n[t]=Bn[t];function gc(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 bh{constructor(e,n){this.toDOM=e,this.spec=n||Zi,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new Fn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof bh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&gc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class si{constructor(e,n){this.attrs=e,this.spec=n||Zi}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new Fn(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof si&&gc(this.attrs,e.attrs)&&gc(this.spec,e.spec)}static is(e){return e.type instanceof si}destroy(){}}class Bx{constructor(e,n){this.attrs=e,this.spec=n||Zi}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new Fn(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof Bx&&gc(this.attrs,e.attrs)&&gc(this.spec,e.spec)}destroy(){}}class Fn{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Fn(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 Fn(e,e,new bh(n,r))}static inline(e,n,r,o){return new Fn(e,n,new si(r,o))}static node(e,n,r,o){return new Fn(e,n,new Bx(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof si}get widget(){return this.type instanceof bh}}const Ya=[],Zi={};class xt{constructor(e,n){this.local=e.length?e:Ya,this.children=n.length?n:Ya}static create(e,n){return n.length?kh(n,e,0,Zi):An}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,n-a,r,o+a,s)}}map(e,n,r){return this==An||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Zi)}mapInner(e,n,r,o,s){let i;for(let a=0;a<this.local.length;a++){let u=this.local[a].map(e,r,o);u&&u.type.valid(n,u)?(i||(i=[])).push(u):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Z$(this.children,i||[],e,n,r,o,s):i?new xt(i.sort(Yi),Ya):An}add(e,n){return n.length?this==An?xt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((a,u)=>{let d=u+r,h;if(h=v6(n,a,d)){for(o||(o=this.children.slice());s<o.length&&o[s]<u;)s+=3;o[s]==u?o[s+2]=o[s+2].addInner(a,h,d+1):o.splice(s,0,u,u+a.nodeSize,kh(h,a,d+1,Zi)),s+=3}});let i=x6(s?b6(n):n,-r);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new xt(i.length?this.local.concat(i).sort(Yi):this.local,o||this.children)}remove(e){return e.length==0||this==An?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,a=r[s]+n,u=r[s+1]+n;for(let h=0,f;h<e.length;h++)(f=e[h])&&f.from>a&&f.to<u&&(e[h]=null,(i||(i=[])).push(f));if(!i)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(i,a+1);d!=An?r[s+2]=d:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let a=0;a<o.length;a++)o[a].eq(i,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 xt(o,r):An}forChild(e,n){if(this==An)return this;if(n.isLeaf)return xt.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 s=e+1,i=s+n.content.size;for(let a=0;a<this.local.length;a++){let u=this.local[a];if(u.from<i&&u.to>s&&u.type instanceof si){let d=Math.max(s,u.from)-s,h=Math.min(i,u.to)-s;d<h&&(o||(o=[])).push(u.copy(d,h))}}if(o){let a=new xt(o.sort(Yi),Ya);return r?new Gs([a,r]):a}return r||An}eq(e){if(this==e)return!0;if(!(e instanceof xt)||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 Vx(this.localsInner(e))}localsInner(e){if(this==An)return Ya;if(e.inlineContent||!this.local.some(si.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof si||n.push(this.local[r]);return n}forEachSet(e){e(this)}}xt.empty=new xt([],[]);xt.removeOverlap=Vx;const An=xt.empty;class Gs{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Zi));return Gs.from(r)}forChild(e,n){if(n.isLeaf)return xt.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=An&&(s instanceof Gs?r=r.concat(s.members):r.push(s))}return Gs.from(r)}eq(e){if(!(e instanceof Gs)||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 s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Vx(r?n:n.sort(Yi)):Ya}static from(e){switch(e.length){case 0:return An;case 1:return e[0];default:return new Gs(e.every(n=>n instanceof xt)?e:e.reduce((n,r)=>n.concat(r instanceof xt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Z$(t,e,n,r,o,s,i){let a=t.slice();for(let d=0,h=s;d<n.maps.length;d++){let f=0;n.maps[d].forEach((g,x,v,b)=>{let k=b-v-(x-g);for(let E=0;E<a.length;E+=3){let _=a[E+1];if(_<0||g>_+h-f)continue;let T=a[E]+h-f;x>=T?a[E+1]=g<=T?-2:-1:g>=h&&k&&(a[E]+=k,a[E+1]+=k)}f+=k}),h=n.maps[d].map(h,-1)}let u=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){u=!0,a[d+1]=-1;continue}let h=n.map(t[d]+s),f=h-o;if(f<0||f>=r.content.size){u=!0;continue}let g=n.map(t[d+1]+s,-1),x=g-o,{index:v,offset:b}=r.content.findIndex(f),k=r.maybeChild(v);if(k&&b==f&&b+k.nodeSize==x){let E=a[d+2].mapInner(n,k,h+1,t[d]+s+1,i);E!=An?(a[d]=f,a[d+1]=x,a[d+2]=E):(a[d+1]=-2,u=!0)}else u=!0}if(u){let d=Y$(a,t,e,n,o,s,i),h=kh(d,r,0,i);e=h.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,g=0;f<h.children.length;f+=3){let x=h.children[f];for(;g<a.length&&a[g]<x;)g+=3;a.splice(g,0,h.children[f],h.children[f+1],h.children[f+2])}}return new xt(e.sort(Yi),a)}function x6(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 Fn(o.from+e,o.to+e,o.type))}return n}function Y$(t,e,n,r,o,s,i){function a(u,d){for(let h=0;h<u.local.length;h++){let f=u.local[h].map(r,o,d);f?n.push(f):i.onRemove&&i.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)a(u.children[h+2],u.children[h]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&a(t[u+2],e[u]+s+1);return n}function v6(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function b6(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function kh(t,e,n,r){let o=[],s=!1;e.forEach((a,u)=>{let d=v6(t,a,u+n);if(d){s=!0;let h=kh(d,a,n+u+1,r);h!=An&&o.push(u,u+a.nodeSize,h)}});let i=x6(s?b6(t):t,-n).sort(Yi);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(r.onRemove&&r.onRemove(i[a].spec),i.splice(a--,1));return i.length||o.length?new xt(i,o):An}function Yi(t,e){return t.from-e.from||t.to-e.to}function Vx(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 s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),yC(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),yC(e,o,r.copy(s.from,r.to)));break}}}return e}function yC(t,e,n){for(;e<t.length&&Yi(n,t[e])>0;)e++;t.splice(e,0,n)}function Ng(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=An&&e.push(r)}),t.cursorWrapper&&e.push(xt.create(t.state.doc,[t.cursorWrapper.deco])),Gs.from(e)}const X$={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Q$=rr&&ni<=11;class eB{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 tB{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eB,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);rr&&ni<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Mn&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Q$&&(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,X$)),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(cC(this.view)){if(this.suppressingSelectionUpdates)return as(this.view);if(rr&&ni<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ia(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 s=e.focusNode;s;s=pl(s))n.add(s);for(let s=e.anchorNode;s;s=pl(s))if(n.has(s)){r=s;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)&&cC(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,a=!1,u=[];if(e.editable)for(let h=0;h<n.length;h++){let f=this.registerMutation(n[h],u);f&&(s=s<0?f.from:Math.min(f.from,s),i=i<0?f.to:Math.max(f.to,i),f.typeOver&&(a=!0))}if(u.some(h=>h.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||wn&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(h=>h.type=="childList"&&h.removedNodes.length))){for(let h of u)if(h.nodeName=="BR"&&h.parentNode){let f=h.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){h.parentNode.removeChild(h);break}f=f.firstChild}}}else if(Rr&&u.length){let h=u.filter(f=>f.nodeName=="BR");if(h.length==2){let[f,g]=h;f.parentNode&&f.parentNode.parentNode==g.parentNode?g.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let g of h){let x=g.parentNode;x&&x.nodeName=="LI"&&(!f||oB(e,f)!=x)&&g.remove()}}}let d=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Bp(r)&&(d=Ix(e))&&d.eq(Ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,as(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),nB(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,sB(e,u)),this.handleDOMChange(s,i,a,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||as(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 h=0;h<e.addedNodes.length;h++){let f=e.addedNodes[h];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(rr&&ni<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:f,nextSibling:g}=e.addedNodes[h];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(s=g)}let i=o&&o.parentNode==e.target?bn(o)+1:0,a=r.localPosFromDOM(e.target,i,-1),u=s&&s.parentNode==e.target?bn(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let xC=new WeakMap,vC=!1;function nB(t){if(!xC.has(t)&&(xC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Rr,vC)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."),vC=!0}}function bC(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return ia(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function rB(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return bC(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?bC(t,n):null}function oB(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function sB(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=s.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let a=i;for(;;){let u=a.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;a=u}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function iB(t,e,n,r){let{node:o,fromOffset:s,toOffset:i,from:a,to:u}=t.docView.parseRange(e,n),d=t.domSelectionRange(),h,f=d.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(h=[{node:f,offset:d.anchorOffset}],Bp(d)||h.push({node:d.focusNode,offset:d.focusOffset})),wn&&t.input.lastKeyCode===8)for(let E=i;E>s;E--){let _=o.childNodes[E-1],T=_.pmViewDesc;if(_.nodeName=="BR"&&!T){i=E;break}if(!T||T.size)break}let g=t.state.doc,x=t.someProp("domParser")||ss.fromSchema(t.state.schema),v=g.resolve(a),b=null,k=x.parse(o,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:s,to:i,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:aB(r),context:v});if(h&&h[0].pos!=null){let E=h[0].pos,_=h[1]&&h[1].pos;_==null&&(_=E),b={anchor:E+a,head:_+a}}return{doc:k,sel:b,from:a,to:u}}const aB=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(Mn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Mn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},lB=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function uB(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=Ix(t,O);if(P&&!t.state.selection.eq(P)){if(wn&&Qo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",W=>W(t,$i(13,"Enter"))))return;let j=t.state.tr.setSelection(P);O=="pointer"?j.setMeta("pointer",!0):O=="key"&&j.scrollIntoView(),s&&j.setMeta("composition",s),t.dispatch(j)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(n);e=i.before(a+1),n=t.state.doc.resolve(n).after(a+1);let u=t.state.selection,d=iB(t,e,n,o),h=t.state.doc,f=h.slice(d.from,d.to),g,x;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(g=t.state.selection.to,x="end"):(g=t.state.selection.from,x="start"),t.input.lastKeyCode=null;let v=fB(f.content,d.doc.content,d.from,g,x);if(v&&t.input.domChangeCount++,(ml&&t.input.lastIOSEnter>Date.now()-225||Qo)&&o.some(O=>O.nodeType==1&&!lB.test(O.nodeName))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",O=>O(t,$i(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!v)if(r&&u instanceof ze&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))v={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let O=kC(t,t.state.doc,d.sel);if(O&&!O.eq(t.state.selection)){let P=t.state.tr.setSelection(O);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&v.start==v.endB&&t.state.selection instanceof ze&&(v.start>t.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?v.start=t.state.selection.from:v.endA<t.state.selection.to&&v.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),rr&&ni<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>d.from&&d.doc.textBetween(v.start-d.from-1,v.start-d.from+1)=="  "&&(v.start--,v.endA--,v.endB--);let b=d.doc.resolveNoCache(v.start-d.from),k=d.doc.resolveNoCache(v.endB-d.from),E=h.resolve(v.start),_=b.sameParent(k)&&b.parent.inlineContent&&E.end()>=v.endA;if((ml&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!_&&b.pos<d.doc.content.size&&(!b.sameParent(k)||!b.parent.inlineContent)&&b.pos<k.pos&&!/\S/.test(d.doc.textBetween(b.pos,k.pos,"","")))&&t.someProp("handleKeyDown",O=>O(t,$i(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>v.start&&dB(h,v.start,v.endA,b,k)&&t.someProp("handleKeyDown",O=>O(t,$i(8,"Backspace")))){Qo&&wn&&t.domObserver.suppressSelectionUpdates();return}wn&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),Qo&&!_&&b.start()!=k.start()&&k.parentOffset==0&&b.depth==k.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==v.endA&&(v.endB-=2,k=d.doc.resolveNoCache(v.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,$i(13,"Enter"))})},20));let T=v.start,A=v.endA,D=O=>{let P=O||t.state.tr.replace(T,A,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let j=kC(t,P.doc,d.sel);j&&!(wn&&t.composing&&j.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(j.head==T||j.head==P.mapping.map(A)-1)||rr&&j.empty&&j.head==T)&&P.setSelection(j)}return s&&P.setMeta("composition",s),P.scrollIntoView()},R;if(_)if(b.pos==k.pos){rr&&ni<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>as(t),20));let O=D(t.state.tr.delete(T,A)),P=h.resolve(v.start).marksAcross(h.resolve(v.endA));P&&O.ensureMarks(P),t.dispatch(O)}else if(v.endA==v.endB&&(R=cB(b.parent.content.cut(b.parentOffset,k.parentOffset),E.parent.content.cut(E.parentOffset,v.endA-E.start())))){let O=D(t.state.tr);R.type=="add"?O.addMark(T,A,R.mark):O.removeMark(T,A,R.mark),t.dispatch(O)}else if(b.parent.child(b.index()).isText&&b.index()==k.index()-(k.textOffset?0:1)){let O=b.parent.textBetween(b.parentOffset,k.parentOffset),P=()=>D(t.state.tr.insertText(O,T,A));t.someProp("handleTextInput",j=>j(t,T,A,O,P))||t.dispatch(P())}else t.dispatch(D());else t.dispatch(D())}function kC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Px(t,e.resolve(n.anchor),e.resolve(n.head))}function cB(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,a,u;for(let h=0;h<r.length;h++)o=r[h].removeFromSet(o);for(let h=0;h<n.length;h++)s=n[h].removeFromSet(s);if(o.length==1&&s.length==0)a=o[0],i="add",u=h=>h.mark(a.addToSet(h.marks));else if(o.length==0&&s.length==1)a=s[0],i="remove",u=h=>h.mark(a.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<e.childCount;h++)d.push(u(e.child(h)));if(oe.from(d).eq(t))return{mark:a,type:i}}function dB(t,e,n,r,o){if(n-e<=o.pos-r.pos||Ag(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(Ag(s,!0,!0));return!i.parent.isTextblock||i.pos>n||Ag(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function Ag(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 s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function fB(t,e,n,r,o){let s=t.findDiffStart(e,n),i=n+t.size,a=n+e.size;if(s==null)return null;let{a:u,b:d}=t.findDiffEnd(e,i,a);if(o=="end"){let h=Math.max(0,s-Math.min(u,d));r-=u+h-s}if(u<s&&i<a){let h=r<=s&&r>=u?s-r:0;s-=h,d=s+(d-u),u=s}else if(d<s){let h=r<=s&&r>=d?s-r:0;s-=h,u=s+(u-d),d=s}return{start:s,endA:u,endB:d}}class k6{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 N$,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(_C),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=SC(this),CC(this),this.nodeViews=EC(this),this.docView=oC(this.state.doc,wC(this),Ng(this),this.dom,this),this.domObserver=new tB(this,(r,o,s,i)=>uB(this,r,o,s,i)),this.domObserver.start(),A$(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&&fy(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(_C),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,s=!1,i=!1;e.storedMarks&&this.composing&&(p6(this),i=!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 x=EC(this);pB(x,this.nodeViews)&&(this.nodeViews=x,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&fy(this),this.editable=SC(this),CC(this);let u=Ng(this),d=wC(this),h=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,d,u);(f||!e.selection.eq(o.selection))&&(i=!0);let g=h=="preserve"&&i&&this.dom.style.overflowAnchor==null&&HF(this);if(i){this.domObserver.stop();let x=f&&(rr||wn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&hB(o.selection,e.selection);if(f){let b=wn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=U$(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=oC(e.doc,d,u,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(x=!0)}let v=this.input.mouseDown;x||!(v&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&h$(this)&&v.delaySelUpdate())?as(this,x):(e6(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),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():g&&UF(g)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ie){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Qw(this,n.getBoundingClientRect(),e)}else Qw(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(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new g6(e.slice,e.move,o<0?void 0:Ie.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 i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(o=n?n(a):a))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let a=s[i].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(rr){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&&WF(this.dom),as(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 ZF(this,e)}coordsAtPos(e,n=1){return q4(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 t$(this,n||this.state,e)}pasteHTML(e,n){return mc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return mc(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Lx(this,e)}destroy(){this.docView&&(M$(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ng(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,OF())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return R$(this,e)}domSelectionRange(){let e=this.domSelection();return e?Mn&&this.root.nodeType===11&&zF(this.dom.ownerDocument)==this.dom&&rB(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}k6.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function wC(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"),[Fn.node(0,t.state.doc.content.size,e)]}function CC(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:Fn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function SC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function hB(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 EC(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 pB(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 _C(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 di={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:"'"},wh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mB=typeof navigator<"u"&&/Mac/.test(navigator.platform),gB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var kn=0;kn<10;kn++)di[48+kn]=di[96+kn]=String(kn);for(var kn=1;kn<=24;kn++)di[kn+111]="F"+kn;for(var kn=65;kn<=90;kn++)di[kn]=String.fromCharCode(kn+32),wh[kn]=String.fromCharCode(kn);for(var Mg in di)wh.hasOwnProperty(Mg)||(wh[Mg]=di[Mg]);function yB(t){var e=mB&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||gB&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?wh:di)[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 xB=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),vB=typeof navigator<"u"&&/Win/.test(navigator.platform);function bB(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a++){let u=e[a];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))xB?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function kB(t){let e=Object.create(null);for(let n in t)e[bB(n)]=t[n];return e}function Dg(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 wB(t){return new St({props:{handleKeyDown:w6(t)}})}function w6(t){let e=kB(t);return function(n,r){let o=yB(r),s,i=e[Dg(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Dg(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(vB&&r.ctrlKey&&r.altKey)&&(s=di[r.keyCode])&&s!=o){let a=e[Dg(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var CB=Object.defineProperty,Hx=(t,e)=>{for(var n in e)CB(t,n,{get:e[n],enumerable:!0})};function Hp(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Up=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([i,a])=>[i,(...d)=>{const h=a(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],a=!!t,u=t||o.tr,d=()=>(!a&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),i.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(n).map(([f,g])=>[f,(...v)=>{const b=this.buildProps(u,e),k=g(...v)(b);return i.push(k),h}])),run:d};return h}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([a,u])=>[a,(...d)=>u(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:t,editor:r,view:s,state:Hp({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...d)=>u(...d)(i)]))}};return i}},C6={};Hx(C6,{blur:()=>SB,clearContent:()=>EB,clearNodes:()=>_B,command:()=>TB,createParagraphNear:()=>NB,cut:()=>AB,deleteCurrentNode:()=>MB,deleteNode:()=>DB,deleteRange:()=>RB,deleteSelection:()=>IB,enter:()=>PB,exitCode:()=>LB,extendMarkRange:()=>zB,first:()=>FB,focus:()=>BB,forEach:()=>VB,insertContent:()=>HB,insertContentAt:()=>WB,insertDefaultBlock:()=>qB,joinBackward:()=>JB,joinDown:()=>GB,joinForward:()=>ZB,joinItemBackward:()=>YB,joinItemForward:()=>XB,joinTextblockBackward:()=>QB,joinTextblockForward:()=>eV,joinUp:()=>KB,keyboardShortcut:()=>nV,lift:()=>rV,liftEmptyBlock:()=>oV,liftListItem:()=>sV,newlineInCode:()=>iV,resetAttributes:()=>aV,scrollIntoView:()=>lV,selectAll:()=>uV,selectNodeBackward:()=>cV,selectNodeForward:()=>dV,selectParentNode:()=>fV,selectTextblockEnd:()=>hV,selectTextblockStart:()=>pV,setContent:()=>mV,setMark:()=>IV,setMeta:()=>PV,setNode:()=>LV,setNodeSelection:()=>zV,setTextDirection:()=>FV,setTextSelection:()=>$V,sinkListItem:()=>BV,splitBlock:()=>VV,splitListItem:()=>HV,toggleList:()=>WV,toggleMark:()=>qV,toggleNode:()=>KV,toggleWrap:()=>GV,undoInputRule:()=>JV,unsetAllMarks:()=>ZV,unsetMark:()=>YV,unsetTextDirection:()=>XV,updateAttributes:()=>QV,wrapIn:()=>eH,wrapInList:()=>tH});var SB=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),EB=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),_B=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(a,u)=>{if(a.type.isText)return;const{doc:d,mapping:h}=e,f=d.resolve(h.map(u)),g=d.resolve(h.map(u+a.nodeSize)),x=f.blockRange(g);if(!x)return;const v=Nl(x);if(a.type.isTextblock){const{defaultType:b}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(x.start,b)}(v||v===0)&&e.lift(x,v)})}),!0},TB=t=>e=>t(e),NB=()=>({state:t,dispatch:e})=>I4(t,e),AB=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const i=r.mapping.map(e);return r.insert(i,s.content),r.setSelection(new ze(r.doc.resolve(Math.max(i-1,0)))),!0},MB=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const a=o.before(s),u=o.after(s);t.delete(a,u).scrollIntoView()}return!0}return!1};function Ut(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var DB=t=>({tr:e,state:n,dispatch:r})=>{const o=Ut(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const u=s.before(i),d=s.after(i);e.delete(u,d).scrollIntoView()}return!0}return!1},RB=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},OB=t=>t.content?/^text(\*|\+)/.test(t.content):!1,TC=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return OB(r)?n==="left"?t.start()-1:t.end()+1:t.pos},jB=(t,e,n)=>{const r=TC(t,n,"left"),o=TC(e,n,"right");return{from:r,to:o}},IB=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,o=n.steps.length;r.forEach(s=>{const i=n.mapping.slice(o),a=n.doc.resolve(i.map(s.$from.pos)),u=n.doc.resolve(i.map(s.$to.pos)),{from:d,to:h}=jB(a,u,t.schema);n.deleteRange(d,h)}),n.selection.empty||n.setSelection(ze.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},PB=()=>({commands:t})=>t.keyboardShortcut("Enter"),LB=()=>({state:t,dispatch:e})=>xF(t,e);function Ux(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ch(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Ux(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function S6(t,e,n={}){return t.find(r=>r.type===e&&Ch(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function NC(t,e,n={}){return!!S6(t,e,n)}function Wx(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===e))return;if(!n){const d=r.node.marks.find(h=>h.type===e);d&&(n=d.attrs)}if(!S6([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,u=i+r.node.nodeSize;for(;s>0&&NC([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&NC([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:u}}function gs(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var zB=(t,e)=>({tr:n,state:r,dispatch:o})=>{const s=gs(t,r.schema),{doc:i,selection:a}=n,{$from:u,from:d,to:h}=a;if(o){const f=Wx(u,s,e);if(f&&f.from<=d&&f.to>=h){const g=ze.create(i,f.from,f.to);n.setSelection(g)}}return!0},FB=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function E6(t){return t instanceof ze}function Wi(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function hy(t,e=null){if(!e)return null;const n=Ue.atStart(t),r=Ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?ze.create(t,Wi(0,o,s),Wi(t.content.size,o,s)):ze.create(t,Wi(e,o,s),Wi(e,o,s))}function AC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function Sh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function $B(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var BB=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Sh()||AC())&&r.dom.focus(),$B()&&!Sh()&&!AC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!E6(n.state.selection))return i(),!0;const a=hy(o.doc,t)||n.state.selection,u=n.state.selection.eq(a);return s&&(u||o.setSelection(a),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},VB=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),HB=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),_6=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&_6(r)}return t};function Nf(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return _6(n)}function gl(t,e,n){if(t instanceof ti||t instanceof oe)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return oe.fromArray(t.map(a=>e.nodeFromJSON(a)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),gl("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,a="";const u=new Ex({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(i=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?ss.fromSchema(u).parseSlice(Nf(t),n.parseOptions):ss.fromSchema(u).parse(Nf(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=ss.fromSchema(e);return n.slice?s.parseSlice(Nf(t),n.parseOptions).content:s.parse(Nf(t),n.parseOptions)}return gl("",e,n)}function T6(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Vt||o instanceof hn))return;const s=t.mapping.maps[r];let i=0;s.forEach((a,u,d,h)=>{i===0&&(i=h)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}var UB=t=>!("type"in t),WB=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const u=k=>{s.emit("contentError",{editor:s,error:k,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{gl(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(k){u(k)}try{a=gl(e,s.schema,{parseOptions:d,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(k){return u(k),!1}let{from:h,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,x=!0;if((UB(a)?a:[a]).forEach(k=>{k.check(),g=g?k.isText&&k.marks.length===0:!1,x=x?k.isBlock:!1}),h===f&&x){const{parent:k}=r.doc.resolve(h);k.isTextblock&&!k.type.spec.code&&!k.childCount&&(h-=1,f+=1)}let b;if(g){if(Array.isArray(e))b=e.map(k=>k.text||"").join("");else if(e instanceof oe){let k="";e.forEach(E=>{E.text&&(k+=E.text)}),b=k}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,h,f)}else{b=a;const k=r.doc.resolve(h),E=k.node(),_=k.parentOffset===0,T=E.isText||E.isTextblock,A=E.content.size>0;_&&T&&A&&x&&(h=Math.max(0,h-1)),r.replaceWith(h,f,b)}n.updateSelection&&T6(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:b})}return!0};function N6(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var qB=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:o,attrs:s,content:i,updateSelection:a=!0}=t;let u;typeof o=="number"?u=e.doc.resolve(o):o?u=o:u=e.selection.$from;const d=N6(u.parent.contentMatchAt(u.index()));if(!d)return!1;const h=Object.keys(d.spec.attrs||{}),f=s?Object.fromEntries(Object.entries(s).filter(([x])=>h.includes(x))):{};let g;if(i){const x=gl(i,r.schema);g=d.createAndFill(f,x)}else g=d.createAndFill(f);return g?(n&&(e.insert(u.pos,g),a&&T6(e,e.steps.length-1,-1)),!0):!1},KB=()=>({state:t,dispatch:e})=>mF(t,e),GB=()=>({state:t,dispatch:e})=>gF(t,e),JB=()=>({state:t,dispatch:e})=>N4(t,e),ZB=()=>({state:t,dispatch:e})=>R4(t,e),YB=()=>({state:t,dispatch:e,tr:n})=>{try{const r=zp(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},XB=()=>({state:t,dispatch:e,tr:n})=>{try{const r=zp(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},QB=()=>({state:t,dispatch:e})=>hF(t,e),eV=()=>({state:t,dispatch:e})=>pF(t,e);function A6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function tV(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a+=1){const u=e[a];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))Sh()||A6()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var nV=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=tV(t).split(/-(?!$)/),i=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return u==null||u.steps.forEach(d=>{const h=d.map(r.mapping);h&&o&&r.maybeStep(h)}),!0};function fi(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Ut(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(f,g)=>{if(f.isText)return;const x=Math.max(r,g),v=Math.min(o,g+f.nodeSize);a.push({node:f,from:x,to:v})});const u=o-r,d=a.filter(f=>i?i.name===f.node.type.name:!0).filter(f=>Ch(f.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((f,g)=>f+g.to-g.from,0)>=u}var rV=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return fi(n,o,e)?yF(n,r):!1},oV=()=>({state:t,dispatch:e})=>P4(t,e),sV=t=>({state:e,dispatch:n})=>{const r=Ut(t,e.schema);return AF(r)(e,n)},iV=()=>({state:t,dispatch:e})=>j4(t,e);function Wp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function MC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var aV=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Wp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Ut(t,r.schema)),a==="mark"&&(i=gs(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,f)=>{s&&s===h.type&&(u=!0,o&&n.setNodeMarkup(f,void 0,MC(h.attrs,e))),i&&h.marks.length&&h.marks.forEach(g=>{i===g.type&&(u=!0,o&&n.addMark(f,f+h.nodeSize,i.create(MC(g.attrs,e))))})})}),u},lV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),uV=()=>({tr:t,dispatch:e})=>{if(e){const n=new fr(t.doc);t.setSelection(n)}return!0},cV=()=>({state:t,dispatch:e})=>M4(t,e),dV=()=>({state:t,dispatch:e})=>O4(t,e),fV=()=>({state:t,dispatch:e})=>kF(t,e),hV=()=>({state:t,dispatch:e})=>SF(t,e),pV=()=>({state:t,dispatch:e})=>CF(t,e);function py(t,e,n={},r={}){return gl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var mV=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:a})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=py(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return i&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function M6(t,e){const n=gs(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,u=>{i.push(...u.marks)});const a=i.find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function D6(t,e){const n=new C4(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function gV(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function yV(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function qp(t){return e=>yV(e.$from,t)}function De(t,e,n){return t.config[e]===void 0&&t.parent?De(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?De(t.parent,e,n):null}):t.config[e]}function qx(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=De(e,"addExtensions",n);return r?[e,...qx(r())]:e}).flat(10)}function Jc(t,e){const n=ma.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function R6(t){return typeof t=="function"}function lt(t,e=void 0,...n){return R6(t)?e?t.bind(e)(...n):t(...n):t}function xV(t={}){return Object.keys(t).length===0&&t.constructor===Object}function yl(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function O6(t){const e=[],{nodeExtensions:n,markExtensions:r}=yl(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},i=n.filter(d=>d.name!=="text").map(d=>d.name),a=r.map(d=>d.name),u=[...i,...a];return t.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage,extensions:o},f=De(d,"addGlobalAttributes",h);if(!f)return;f().forEach(x=>{let v;Array.isArray(x.types)?v=x.types:x.types==="*"?v=u:x.types==="nodes"?v=i:x.types==="marks"?v=a:v=[],v.forEach(b=>{Object.entries(x.attributes).forEach(([k,E])=>{e.push({type:b,name:k,attribute:{...s,...E}})})})})}),o.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage},f=De(d,"addAttributes",h);if(!f)return;const g=f();Object.entries(g).forEach(([x,v])=>{const b={...s,...v};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,e.push({type:d.name,name:x,attribute:b})})}),e}function vV(t){const e=[];let n="",r=!1,o=!1,s=0;const i=t.length;for(let a=0;a<i;a+=1){const u=t[a];if(u==="'"&&!o){r=!r,n+=u;continue}if(u==='"'&&!r){o=!o,n+=u;continue}if(!r&&!o){if(u==="("){s+=1,n+=u;continue}if(u===")"&&s>0){s-=1,n+=u;continue}if(u===";"&&s===0){e.push(n),n="";continue}}n+=u}return n&&e.push(n),e}function DC(t){const e=[],n=vV(t||""),r=n.length;for(let o=0;o<r;o+=1){const s=n[o],i=s.indexOf(":");if(i===-1)continue;const a=s.slice(0,i).trim(),u=s.slice(i+1).trim();a&&u&&e.push([a,u])}return e}function tn(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const a=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],d=a.filter(h=>!u.includes(h));r[o]=[...u,...d].join(" ")}else if(o==="style"){const a=new Map([...DC(r[o]),...DC(s)]);r[o]=Array.from(a.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=s}),r},{})}function yc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>tn(n,r),{})}function bV(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function RC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):bV(n.getAttribute(i.name));return a==null?s:{...s,[i.name]:a}},{});return{...r,...o}}}}function OC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&xV(n)?!1:n!=null))}function jC(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function kV(t,e){var n;const r=O6(t),{nodeExtensions:o,markExtensions:s}=yl(t),i=(n=o.find(d=>De(d,"topNode")))==null?void 0:n.name,a=Object.fromEntries(o.map(d=>{const h=r.filter(E=>E.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((E,_)=>{const T=De(_,"extendNodeSchema",f);return{...E,...T?T(d):{}}},{}),x=OC({...g,content:lt(De(d,"content",f)),marks:lt(De(d,"marks",f)),group:lt(De(d,"group",f)),inline:lt(De(d,"inline",f)),atom:lt(De(d,"atom",f)),selectable:lt(De(d,"selectable",f)),draggable:lt(De(d,"draggable",f)),code:lt(De(d,"code",f)),whitespace:lt(De(d,"whitespace",f)),linebreakReplacement:lt(De(d,"linebreakReplacement",f)),defining:lt(De(d,"defining",f)),isolating:lt(De(d,"isolating",f)),attrs:Object.fromEntries(h.map(jC))}),v=lt(De(d,"parseHTML",f));v&&(x.parseDOM=v.map(E=>RC(E,h)));const b=De(d,"renderHTML",f);b&&(x.toDOM=E=>b({node:E,HTMLAttributes:yc(E,h)}));const k=De(d,"renderText",f);return k&&(x.toText=k),[d.name,x]})),u=Object.fromEntries(s.map(d=>{const h=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((k,E)=>{const _=De(E,"extendMarkSchema",f);return{...k,..._?_(d):{}}},{}),x=OC({...g,inclusive:lt(De(d,"inclusive",f)),excludes:lt(De(d,"excludes",f)),group:lt(De(d,"group",f)),spanning:lt(De(d,"spanning",f)),code:lt(De(d,"code",f)),attrs:Object.fromEntries(h.map(jC))}),v=lt(De(d,"parseHTML",f));v&&(x.parseDOM=v.map(k=>RC(k,h)));const b=De(d,"renderHTML",f);return b&&(x.toDOM=k=>b({mark:k,HTMLAttributes:yc(k,h)})),[d.name,x]}));return new Ex({topNode:i,nodes:a,marks:u})}function wV(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ju(t){return t.sort((n,r)=>{const o=De(n,"priority")||100,s=De(r,"priority")||100;return o>s?-1:o<s?1:0})}function j6(t){const e=ju(qx(t)),n=wV(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function I6(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
489
+
490
+ `,textSerializers:i={}}=n||{};let a="";return t.nodesBetween(r,o,(u,d,h,f)=>{var g;u.isBlock&&d>r&&(a+=s);const x=i==null?void 0:i[u.type.name];if(x)return h&&(a+=x({node:u,pos:d,parent:h,index:f,range:e})),!1;u.isText&&(a+=(g=u==null?void 0:u.text)==null?void 0:g.slice(Math.max(r,d)-d,o-d))}),a}function CV(t,e){const n={from:0,to:t.content.size};return I6(t,n,e)}function P6(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function SV(t,e){const n=Ut(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,a=>{s.push(a)});const i=s.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function L6(t,e){const n=Wp(typeof e=="string"?e:e.name,t.schema);return n==="node"?SV(t,e):n==="mark"?M6(t,e):{}}function EV(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function _V(t){const e=EV(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function Kx(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((a,u)=>{i.push({from:a,to:u})});else{const{from:a,to:u}=n[s];if(a===void 0||u===void 0)return;i.push({from:a,to:u})}i.forEach(({from:a,to:u})=>{const d=e.slice(s).map(a,-1),h=e.slice(s).map(u),f=e.invert().map(d,-1),g=e.invert().map(h);r.push({oldRange:{from:f,to:g},newRange:{from:d,to:h}})})}),_V(r)}function Gx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=Wx(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}var TV=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const a=o.node(s);(a==null?void 0:a.type.name)===e?i=a:s-=1}return[i,s]};function gu(t,e){return e.nodes[t]||e.marks[t]||null}function Xf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var NV=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,a)=>{var u,d;const h=((d=(u=o.type.spec).toText)==null?void 0:d.call(u,{node:o,pos:s,parent:i,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?h:h.slice(0,Math.max(0,r-s))}),n};function my(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?gs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>Ch(f.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:f,$to:g})=>{const x=f.pos,v=g.pos;t.doc.nodesBetween(x,v,(b,k)=>{if(s&&b.inlineContent&&!b.type.allowsMarkType(s))return!1;if(!b.isText&&!b.marks.length)return;const E=Math.max(x,k),_=Math.min(v,k+b.nodeSize),T=_-E;i+=T,a.push(...b.marks.map(A=>({mark:A,from:E,to:_})))})}),i===0)return!1;const u=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>Ch(f.mark.attrs,n,{strict:!1})).reduce((f,g)=>f+g.to-g.from,0),d=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,g)=>f+g.to-g.from,0);return(u>0?u+d:u)>=i}function AV(t,e,n={}){if(!e)return fi(t,null,n)||my(t,null,n);const r=Wp(e,t.schema);return r==="node"?fi(t,e,n):r==="mark"?my(t,e,n):!1}var MV=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=qp(a=>a.type.name===e)(t.selection);if(!s)return!1;const i=t.doc.resolve(s.pos+1);return o.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},DV=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function IC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Rg(t,e){const{nodeExtensions:n}=yl(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=lt(De(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Zc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(Zc(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function z6(t){return t instanceof Ie}var F6=class $6{constructor(e){this.position=e}static fromJSON(e){return new $6(e.position)}toJSON(){return{position:this.position}}};function RV(t,e){const n=e.mapping.mapResult(t.position);return{position:new F6(n.pos),mapResult:n}}function OV(t){return new F6(t)}function jV(t,e,n){var r;const{selection:o}=e;let s=null;if(E6(o)&&(s=o.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(d=>d.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:a,$to:u})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,u.pos,(h,f,g)=>{if(d)return!1;if(h.isInline){const x=!g||g.type.allowsMarkType(n),v=!!n.isInSet(h.marks)||!h.marks.some(b=>b.type.excludes(n));d=x&&v}return!d}),d})}var IV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:a}=s,u=gs(t,r.schema);if(o)if(i){const d=M6(r,u);n.addStoredMark(u.create({...d,...e}))}else a.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(h,f,(g,x)=>{const v=Math.max(x,h),b=Math.min(x+g.nodeSize,f);g.marks.find(E=>E.type===u)?g.marks.forEach(E=>{u===E.type&&n.addMark(v,b,u.create({...E.attrs,...e}))}):n.addMark(v,b,u.create(e))})});return jV(r,n,u)},PV=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),LV=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Ut(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:a})=>Zw(s,{...i,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Zw(s,{...i,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},zV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Wi(t,0,r.content.size),s=Ie.create(r,o);e.setSelection(s)}return!0},FV=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,a;return typeof e=="number"?(i=e,a=e):e&&"from"in e&&"to"in e?(i=e.from,a=e.to):(i=s.from,a=s.to),o&&n.doc.nodesBetween(i,a,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},$V=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=ze.atStart(r).from,a=ze.atEnd(r).to,u=Wi(o,i,a),d=Wi(s,i,a),h=ze.create(r,u,d);e.setSelection(h)}return!0},BV=t=>({state:e,dispatch:n})=>{const r=Ut(t,e.schema);return RF(r)(e,n)};function PC(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}var VV=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:a,$to:u}=s,d=o.extensionManager.attributes,h=Xf(d,a.node().type.name,a.node().attrs);if(s instanceof Ie&&s.node.isBlock)return!a.parentOffset||!is(i,a.pos)?!1:(r&&(t&&PC(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=u.parentOffset===u.parent.content.size,g=a.depth===0?void 0:N6(a.node(-1).contentMatchAt(a.indexAfter(-1)));let x=f&&g?[{type:g,attrs:h}]:void 0,v=is(e.doc,e.mapping.map(a.pos),1,x);if(!x&&!v&&is(e.doc,e.mapping.map(a.pos),1,g?[{type:g}]:void 0)&&(v=!0,x=g?[{type:g,attrs:h}]:void 0),r){if(v&&(s instanceof ze&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,x),g&&!f&&!a.parentOffset&&a.parent.type!==g)){const b=e.mapping.map(a.before()),k=e.doc.resolve(b);a.node(-1).canReplaceWith(k.index(),k.index()+1,g)&&e.setNodeMarkup(e.mapping.map(a.before()),g)}t&&PC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return v},HV=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const a=Ut(t,r.schema),{$from:u,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(d))return!1;const f=u.node(-1);if(f.type!==a)return!1;const g=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(o){let E=oe.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let P=u.depth-_;P>=u.depth-3;P-=1)E=oe.from(u.node(P).copy(E));const T=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,A={...Xf(g,u.node().type.name,u.node().attrs),...e},D=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(A))||void 0;E=E.append(oe.from(a.createAndFill(null,D)||void 0));const R=u.before(u.depth-(_-1));n.replace(R,u.after(-T),new ve(E,4-_,0));let O=-1;n.doc.nodesBetween(R,n.doc.content.size,(P,j)=>{if(O>-1)return!1;P.isTextblock&&P.content.size===0&&(O=j+1)}),O>-1&&n.setSelection(ze.near(n.doc.resolve(O))),n.scrollIntoView()}return!0}const x=d.pos===u.end()?f.contentMatchAt(0).defaultType:null,v={...Xf(g,f.type.name,f.attrs),...e},b={...Xf(g,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const k=x?[{type:a,attrs:v},{type:x,attrs:b}]:[{type:a,attrs:v}];if(!is(n.doc,u.pos,2))return!1;if(o){const{selection:E,storedMarks:_}=r,{splittableMarks:T}=s.extensionManager,A=_||E.$to.parentOffset&&E.$from.marks();if(n.split(u.pos,2,k).scrollIntoView(),!A||!o)return!0;const D=A.filter(R=>T.includes(R.type.name));n.ensureMarks(D)}return!0};function LC(t){return!t||t==="1"?null:t}function B6(t,e){return LC(t)===LC(e)}var Og=(t,e)=>{const n=qp(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return!(n.node.type===(o==null?void 0:o.type)&&xi(t.doc,n.pos))||!B6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(n.pos),!0},jg=(t,e)=>{const n=qp(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return!(n.node.type===(o==null?void 0:o.type)&&xi(t.doc,r))||!B6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(r),!0};function UV(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),o=e.resolve(n.nodeSize-1);return ze.between(r,o)}var WV=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:a,chain:u,commands:d,can:h})=>{const{extensions:f,splittableMarks:g}=o.extensionManager,x=Ut(t,i.schema),v=Ut(e,i.schema),{selection:b,storedMarks:k}=i,{$from:E,$to:_}=b,T=E.blockRange(_),A=k||b.$to.parentOffset&&b.$from.marks();if(!T)return!1;const D=qp(K=>Rg(K.type.name,f))(b),R=b.from===0&&b.to===i.doc.content.size,O=i.doc.content.content,P=O.length===1?O[0]:null,j=R&&P&&Rg(P.type.name,f)?{node:P,pos:0}:null,W=D??j,Z=!!D&&T.depth>=1&&T.depth-D.depth<=1,J=!!j;if((Z||J)&&W){if(W.node.type===x)return R&&J?u().command(({tr:K,dispatch:Y})=>{const ee=UV(K);return ee?(K.setSelection(ee),Y&&Y(K),!0):!1}).liftListItem(v).run():d.liftListItem(v);if(Rg(W.node.type.name,f)&&x.validContent(W.node.content))return u().command(()=>(s.setNodeMarkup(W.pos,x),!0)).command(()=>Og(s,x)).command(()=>jg(s,x)).run()}return!n||!A||!a?u().command(()=>h().wrapInList(x,r)?!0:d.clearNodes()).wrapInList(x,r).command(()=>Og(s,x)).command(()=>jg(s,x)).run():u().command(()=>{const K=h().wrapInList(x,r),Y=A.filter(ee=>g.includes(ee.type.name));return s.ensureMarks(Y),K?!0:d.clearNodes()}).wrapInList(x,r).command(()=>Og(s,x)).command(()=>jg(s,x)).run()},qV=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=gs(t,r.schema);return my(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},KV=(t,e,n={})=>({state:r,commands:o})=>{const s=Ut(t,r.schema),i=Ut(e,r.schema),a=fi(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),a?o.setNode(i,u):o.setNode(s,{...u,...n})},GV=(t,e={})=>({state:n,commands:r})=>{const o=Ut(t,n.schema);return fi(n,o,e)?r.lift(o):r.wrapIn(o,e)},JV=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,a=s.transform;for(let u=a.steps.length-1;u>=0;u-=1)i.step(a.steps[u].invert(a.docs[u]));if(s.text){const u=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else i.delete(s.from,s.to)}return!0}}return!1},ZV=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:i,ranges:a}=s;if(i)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(h=>o||!u.includes(h.name));a.forEach(h=>{for(const f of d)e.removeMark(h.$from.pos,h.$to.pos,f)})}return!0},YV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,u=gs(t,r.schema),{$from:d,empty:h,ranges:f}=a;if(!o)return!0;if(h&&i){let{from:g,to:x}=a;const v=(s=d.marks().find(k=>k.type===u))==null?void 0:s.attrs,b=Wx(d,u,v);b&&(g=b.from,x=b.to),n.removeMark(g,x,u)}else f.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,u)});return n.removeStoredMark(u),!0},XV=t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=n;let s,i;return typeof t=="number"?(s=t,i=t):t&&"from"in t&&"to"in t?(s=t.from,i=t.to):(s=o.from,i=o.to),r&&e.doc.nodesBetween(s,i,(a,u)=>{if(a.isText)return;const d={...a.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},QV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Wp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Ut(t,r.schema)),a==="mark"&&(i=gs(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;let g,x,v,b;n.selection.empty?r.doc.nodesBetween(h,f,(k,E)=>{s&&s===k.type&&(u=!0,v=Math.max(E,h),b=Math.min(E+k.nodeSize,f),g=E,x=k)}):r.doc.nodesBetween(h,f,(k,E)=>{E<h&&s&&s===k.type&&(u=!0,v=Math.max(E,h),b=Math.min(E+k.nodeSize,f),g=E,x=k),E>=h&&E<=f&&(s&&s===k.type&&(u=!0,o&&n.setNodeMarkup(E,void 0,{...k.attrs,...e})),i&&k.marks.length&&k.marks.forEach(_=>{if(i===_.type&&(u=!0,o)){const T=Math.max(E,h),A=Math.min(E+k.nodeSize,f);n.addMark(T,A,i.create({..._.attrs,...e}))}}))}),x&&(g!==void 0&&o&&n.setNodeMarkup(g,void 0,{...x.attrs,...e}),i&&x.marks.length&&x.marks.forEach(k=>{i===k.type&&o&&n.addMark(v,b,i.create({...k.attrs,...e}))}))}),u},eH=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return EF(o,e)(n,r)},tH=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return _F(o,e)(n,r)},nH=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function rH(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Ie){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let o=r.depth;for(;o>=0;){const s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(e))return!0;o-=1}return!1}function oH(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}function sH(t){return typeof t=="number"}function iH(t){return Object.prototype.toString.call(t).slice(8,-1)}function Af(t){return iH(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var aH={};Hx(aH,{createAtomBlockMarkdownSpec:()=>lH,createBlockMarkdownSpec:()=>uH,createInlineMarkdownSpec:()=>fH,parseAttributes:()=>Jx,parseIndentedBlocks:()=>gy,renderNestedMarkdownContent:()=>Yx,serializeAttributes:()=>Zx});function Jx(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([\w-]+)/g);if(o){const d=o.map(h=>h.trim().slice(1));e.class=d.join(" ")}const s=r.match(/(?:^|\s)#([\w-]+)/);s&&(e.id=s[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(i)).forEach(([,d,h])=>{var f;const g=parseInt(((f=h.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),x=n[g];x&&(e[d]=x.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(e[h]=!0)}),e}function Zx(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function lH(t){const{nodeName:e,name:n,parseAttributes:r=Jx,serializeAttributes:o=Zx,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:a}=t,u=n||e,d=h=>{if(!a)return h;const f={};return a.forEach(g=>{g in h&&(f[g]=h[g])}),f};return{parseMarkdown:(h,f)=>{const g={...s,...h.attributes};return f.createNode(e,g,[])},markdownTokenizer:{name:e,level:"block",start(h){var f;const g=new RegExp(`^:::${u}(?:\\s|$)`,"m"),x=(f=h.match(g))==null?void 0:f.index;return x!==void 0?x:-1},tokenize(h,f,g){const x=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=h.match(x);if(!v)return;const b=v[1]||"",k=r(b);if(!i.find(_=>!(_ in k)))return{type:e,raw:v[0],attributes:k}}},renderMarkdown:h=>{const f=d(h.attrs||{}),g=o(f),x=g?` {${g}}`:"";return`:::${u}${x} :::`}}}function uH(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Jx,serializeAttributes:s=Zx,defaultAttributes:i={},content:a="block",allowedAttributes:u}=t,d=n||e,h=f=>{if(!u)return f;const g={};return u.forEach(x=>{x in f&&(g[x]=f[x])}),g};return{parseMarkdown:(f,g)=>{let x;if(r){const b=r(f);x=typeof b=="string"?[{type:"text",text:b}]:b}else a==="block"?x=g.parseChildren(f.tokens||[]):x=g.parseInline(f.tokens||[]);const v={...i,...f.attributes};return g.createNode(e,v,x)},markdownTokenizer:{name:e,level:"block",start(f){var g;const x=new RegExp(`^:::${d}`,"m"),v=(g=f.match(x))==null?void 0:g.index;return v!==void 0?v:-1},tokenize(f,g,x){var v;const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),k=f.match(b);if(!k)return;const[E,_=""]=k,T=o(_);let A=1;const D=E.length;let R="";const O=/^:::([\w-]*)(\s.*)?/gm,P=f.slice(D);for(O.lastIndex=0;;){const j=O.exec(P);if(j===null)break;const W=j.index,Z=j[1];if(!((v=j[2])!=null&&v.endsWith(":::"))){if(Z)A+=1;else if(A-=1,A===0){const J=P.slice(0,W);R=J.trim();const K=f.slice(0,D+W+j[0].length);let Y=[];if(R)if(a==="block")for(Y=x.blockTokens(J),Y.forEach(ee=>{ee.text&&(!ee.tokens||ee.tokens.length===0)&&(ee.tokens=x.inlineTokens(ee.text))});Y.length>0;){const ee=Y[Y.length-1];if(ee.type==="paragraph"&&(!ee.text||ee.text.trim()===""))Y.pop();else break}else Y=x.inlineTokens(R);return{type:e,raw:K,attributes:T,content:R,tokens:Y}}}}}},renderMarkdown:(f,g)=>{const x=h(f.attrs||{}),v=s(x),b=v?` {${v}}`:"",k=g.renderChildren(f.content||[],`
491
+
492
+ `);return`:::${d}${b}
493
+
494
+ ${k}
495
+
496
+ :::`}}}function cH(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,o,s,i]=r;e[o]=s||i,r=n.exec(t)}return e}function dH(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function fH(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=cH,serializeAttributes:s=dH,defaultAttributes:i={},selfClosing:a=!1,allowedAttributes:u}=t,d=n||e,h=g=>{if(!u)return g;const x={};return u.forEach(v=>{const b=typeof v=="string"?v:v.name,k=typeof v=="string"?void 0:v.skipIfDefault;if(b in g){const E=g[b];if(k!==void 0&&E===k)return;x[b]=E}}),x},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,x)=>{const v={...i,...g.attributes};if(a)return x.createNode(e,v);const b=r?r(g):g.content||"";return b?x.createNode(e,v,[x.createTextNode(b)]):x.createNode(e,v,[])},markdownTokenizer:{name:e,level:"inline",start(g){const x=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),v=g.match(x),b=v==null?void 0:v.index;return b!==void 0?b:-1},tokenize(g,x,v){const b=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),k=g.match(b);if(!k)return;let E="",_="";if(a){const[,A]=k;_=A}else{const[,A,D]=k;_=A,E=D||""}const T=o(_.trim());return{type:e,raw:k[0],content:E.trim(),attributes:T}}},renderMarkdown:g=>{let x="";r?x=r(g):g.content&&g.content.length>0&&(x=g.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const v=h(g.attrs||{}),b=s(v),k=b?` ${b}`:"";return a?`[${d}${k}]`:`[${d}${k}]${x}[/${d}]`}}}function gy(t,e,n){var r,o,s,i;const a=t.split(`
497
+ `),u=[];let d="",h=0;const f=e.baseIndentSize||2;for(;h<a.length;){const g=a[h],x=g.match(e.itemPattern);if(!x){if(u.length>0)break;if(g.trim()===""){h+=1,d=`${d}${g}
498
+ `;continue}else return}const v=e.extractItemData(x),{indentLevel:b,mainContent:k}=v;d=`${d}${g}
499
+ `;const E=[k];for(h+=1;h<a.length;){const D=a[h];if(D.trim()===""){const O=a.slice(h+1).findIndex(W=>W.trim()!=="");if(O===-1)break;if((((o=(r=a[h+1+O].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>b){E.push(D),d=`${d}${D}
500
+ `,h+=1;continue}else break}if((((i=(s=D.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:i.length)||0)>b)E.push(D),d=`${d}${D}
501
+ `,h+=1;else break}let _;const T=E.slice(1);if(T.length>0){const D=T.map(R=>R.slice(b+f)).join(`
502
+ `);D.trim()&&(e.customNestedParser?_=e.customNestedParser(D):_=n.blockTokens(D))}const A=e.createToken(v,_);u.push(A)}if(u.length!==0)return{items:u,raw:d}}function Yx(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[s,...i]=t.content,a=e.renderChildren([s]);let u=`${o}${a}`;return i&&i.length>0&&i.forEach((d,h)=>{var f,g;const x=(g=(f=e.renderChild)==null?void 0:f.call(e,d,h+1))!=null?g:e.renderChildren([d]);if(x!=null){const v=x.split(`
503
+ `).map(b=>b?e.indent(b):e.indent("")).join(`
504
+ `);u+=d.type==="paragraph"?`
505
+
506
+ ${v}`:`
507
+ ${v}`}}),u}function V6(t,e){const n={...t};return Af(t)&&Af(e)&&Object.keys(e).forEach(r=>{Af(e[r])&&Af(t[r])?n[r]=V6(t[r],e[r]):n[r]=e[r]}),n}function hH(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((a,u)=>{const d=s.mapping.map(u),h=s.mapping.map(u)+a.nodeSize;let f=null;if(a.marks.forEach(x=>{if(x!==i)return!1;f=x}),!f)return;let g=!1;if(Object.keys(n).forEach(x=>{n[x]!==f.attrs[x]&&(g=!0)}),g){const x=t.type.create({...t.attrs,...n});s.removeMark(d,h,t.type),s.addMark(d,h,x)}}),s.docChanged&&e.view.dispatch(s)}var Yc=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},pH=(t,e)=>{if(Ux(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Mf(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:a}=t,{view:u}=n;if(u.composing)return!1;const d=u.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let h=!1;const f=NV(d)+s;return i.forEach(g=>{if(h)return;const x=pH(f,g.find);if(!x)return;const v=x[0].length-s.length;if(v>0){const R=d.parentOffset-v;if(R<0||d.parent.textBetween(R,d.parentOffset)!==x[0].slice(0,v))return}const b=u.state.tr,k=Hp({state:u.state,transaction:b}),E={from:r-(x[0].length-s.length),to:o},{commands:_,chain:T,can:A}=new Up({editor:n,state:k});g.handler({state:k,range:E,match:x,commands:_,chain:T,can:A})===null||!b.steps.length||(g.undoable&&b.setMeta(a,{transform:b,from:r,to:o,text:s}),u.dispatch(b),h=!0)}),h}function mH(t){const{editor:e,rules:n}=t,r=new St({state:{init(){return null},apply(o,s,i){const a=o.getMeta(r);if(a)return a;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:h}=u;typeof h=="string"?h=h:h=Jc(oe.from(h),i.schema);const{from:f}=u,g=f+h.length;Mf({editor:e,from:f,to:g,text:h,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,a){return Mf({editor:e,from:s,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Mf({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?Mf({editor:e,from:i.pos,to:i.pos,text:`
508
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Xx=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...lt(De(this,"addOptions",{name:this.name}))}}get storage(){return{...lt(De(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>V6(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},gr=class H6 extends Xx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new H6(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!!!i.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const u=i.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},U6=class{constructor(t){this.find=t.find,this.handler=t.handler}},gH=(t,e,n)=>{if(Ux(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function yH(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:u,chain:d,can:h}=new Up({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,o,(x,v)=>{var b,k,E,_,T;if((k=(b=x.type)==null?void 0:b.spec)!=null&&k.code||!(x.isText||x.isTextblock||x.isInline))return;const A=(T=(_=(E=x.content)==null?void 0:E.size)!=null?_:x.nodeSize)!=null?T:0,D=Math.max(r,v),R=Math.min(o,v+A);if(D>=R)return;const O=x.isText?x.text||"":x.textBetween(D-v,R-v,void 0,"");gH(O,s.find,i).forEach(j=>{if(j.index===void 0)return;const W=D+j.index+1,Z=W+j[0].length,J={from:n.tr.mapping.map(W),to:n.tr.mapping.map(Z)},K=s.handler({state:n,range:J,match:j,commands:u,chain:d,can:h,pasteEvent:i,dropEvent:a});f.push(K)})}),f.every(x=>x!==null)}var Df=null,xH=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function vH(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const u=({state:h,from:f,to:g,rule:x,pasteEvt:v})=>{const b=h.tr,k=Hp({state:h,transaction:b});if(!(!yH({editor:e,state:k,from:Math.max(f-1,0),to:g.b-1,rule:x,pasteEvent:v,dropEvent:a})||!b.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(h=>new St({view(f){const g=v=>{var b;r=(b=f.dom.parentElement)!=null&&b.contains(v.target)?f.dom.parentElement:null,r&&(Df=e)},x=()=>{Df&&(Df=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",x),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",x)}}},props:{handleDOMEvents:{drop:(f,g)=>{if(s=r===f.dom.parentElement,a=g,!s){const x=Df;x!=null&&x.isEditable&&setTimeout(()=>{const v=x.state.selection;v&&x.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(f,g)=>{var x;const v=(x=g.clipboardData)==null?void 0:x.getData("text/html");return i=g,o=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(f,g,x)=>{const v=f[0],b=v.getMeta("uiEvent")==="paste"&&!o,k=v.getMeta("uiEvent")==="drop"&&!s,E=v.getMeta("applyPasteRules"),_=!!E;if(!b&&!k&&!_)return;if(_){let{text:D}=E;typeof D=="string"?D=D:D=Jc(oe.from(D),x.schema);const{from:R}=E,O=R+D.length,P=xH(D);return u({rule:h,state:x,from:R,to:{b:O},pasteEvt:P})}const T=g.doc.content.findDiffStart(x.doc.content),A=g.doc.content.findDiffEnd(x.doc.content);if(!(!sH(T)||!A||T===A.b))return u({rule:h,state:x,from:T,to:A,pasteEvt:i})}}))}var Kp=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=j6(t),this.schema=kV(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:gu(e.name,this.schema)},r=De(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ju([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:gu(r.name,this.schema)},s=[],i=De(r,"addKeyboardShortcuts",o);let a={};if(r.type==="mark"&&De(r,"exitable",o)&&(a.ArrowRight=()=>gr.handleExit({editor:t,mark:r})),i){const g=Object.fromEntries(Object.entries(i()).map(([x,v])=>[x,()=>v({editor:t})]));a={...a,...g}}const u=wB(a);s.push(u);const d=De(r,"addInputRules",o);if(IC(r,t.options.enableInputRules)&&d){const g=d();if(g&&g.length){const x=mH({editor:t,rules:g}),v=Array.isArray(x)?x:[x];s.push(...v)}}const h=De(r,"addPasteRules",o);if(IC(r,t.options.enablePasteRules)&&h){const g=h();if(g&&g.length){const x=vH({editor:t,rules:g});s.push(...x)}}const f=De(r,"addProseMirrorPlugins",o);if(f){const g=f();s.push(...g)}return s})}get attributes(){return O6(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=yl(this.extensions);return Object.fromEntries(e.filter(n=>!!De(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ut(n.name,this.schema)},s=De(n,"addNodeView",o);if(!s)return[];const i=s();if(!i)return[];const a=(u,d,h,f,g)=>{const x=yc(u,r);return i({node:u,view:d,getPos:h,decorations:f,innerDecorations:g,editor:t,extension:n,HTMLAttributes:x})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return ju([...this.extensions].reverse()).reduceRight((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:gu(o.name,this.schema)},i=De(o,"dispatchTransaction",s);return i?a=>{i.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ju([...this.extensions]).reduce((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:gu(o.name,this.schema)},i=De(o,"transformPastedHTML",s);return i?(a,u)=>{const d=r(a,u);return i.call(s,d)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=yl(this.extensions);return Object.fromEntries(e.filter(n=>!!De(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:gs(n.name,this.schema)},s=De(n,"addMarkView",o);if(!s)return[];const i=(a,u,d)=>{const h=yc(a,r);return s()({mark:a,view:u,inline:d,editor:t,extension:n,HTMLAttributes:h,updateAttributes:f=>{hH(a,t,f)}})};return[n.name,i]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n,r;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:gu(e.name,this.schema)};e.type==="mark"&&(((n=lt(De(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name),(r=lt(De(e,"clearable",o)))==null||r||this.nonClearableMarks.push(e.name));const s=De(e,"onBeforeCreate",o),i=De(e,"onCreate",o),a=De(e,"onUpdate",o),u=De(e,"onSelectionUpdate",o),d=De(e,"onTransaction",o),h=De(e,"onFocus",o),f=De(e,"onBlur",o),g=De(e,"onDestroy",o);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),a&&this.editor.on("update",a),u&&this.editor.on("selectionUpdate",u),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),f&&this.editor.on("blur",f),g&&this.editor.on("destroy",g)})}};Kp.resolve=j6;Kp.sort=ju;Kp.flatten=qx;var W6={};Hx(W6,{ClipboardTextSerializer:()=>K6,Commands:()=>G6,Delete:()=>J6,Drop:()=>Z6,Editable:()=>Y6,FocusEvents:()=>Q6,Keymap:()=>eT,Paste:()=>tT,Tabindex:()=>nT,TextDirection:()=>rT,focusEventsPluginKey:()=>X6});var Et=class q6 extends Xx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new q6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},K6=Et.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new St({key:new Wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=P6(n),{blockSeparator:i}=this.options,a={...i!==void 0?{blockSeparator:i}:{},textSerializers:s};return[...o.ranges].sort((d,h)=>d.$from.pos-h.$from.pos).map(({$from:d,$to:h})=>I6(r,{from:d.pos,to:h.pos},a)).join(i??`
509
+
510
+ `)}}})]}}),G6=Et.create({name:"commands",addCommands(){return{...C6}}}),J6=Et.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,a,u,d;if((d=(u=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:u.call(a,t))!=null?d:t.getMeta("y-sync$"))return;const h=D6(t.before,[t,...e]);Kx(h).forEach(x=>{h.mapping.mapResult(x.oldRange.from).deletedAfter&&h.mapping.mapResult(x.oldRange.to).deletedBefore&&h.before.nodesBetween(x.oldRange.from,x.oldRange.to,(v,b)=>{const k=b+v.nodeSize-2,E=x.oldRange.from<=b&&k<=x.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:b,to:k,newFrom:h.mapping.map(b),newTo:h.mapping.map(k),deletedRange:x.oldRange,newRange:x.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:h})})});const g=h.mapping;h.steps.forEach((x,v)=>{var b,k;if(x instanceof Gr){const E=g.slice(v).map(x.from,-1),_=g.slice(v).map(x.to),T=g.invert().map(E,-1),A=g.invert().map(_),D=E>0?(b=h.doc.nodeAt(E-1))==null?void 0:b.marks.some(O=>O.eq(x.mark)):!1,R=(k=h.doc.nodeAt(_))==null?void 0:k.marks.some(O=>O.eq(x.mark));this.editor.emit("delete",{type:"mark",mark:x.mark,from:x.from,to:x.to,deletedRange:{from:T,to:A},newRange:{from:E,to:_},partial:!!(R||D),editor:this.editor,transaction:t,combinedTransform:h})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),Z6=Et.create({name:"drop",addProseMirrorPlugins(){return[new St({key:new Wt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Y6=Et.create({name:"editable",addProseMirrorPlugins(){return[new St({key:new Wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),X6=new Wt("focusEvents"),Q6=Et.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new St({key:X6,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),eT=Et.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:u,doc:d}=a,{empty:h,$anchor:f}=u,{pos:g,parent:x}=f,v=f.parent.isTextblock&&g>0?a.doc.resolve(g-1):f,b=v.parent.type.spec.isolating,k=f.pos-f.parentOffset,E=b&&v.parent.childCount===1?k===f.pos:Ue.atStart(d).from===g;return!h||!x.type.isTextblock||x.textContent.length||!E||E&&f.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Sh()||A6()?s:o},addProseMirrorPlugins(){return[new St({key:new Wt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(b=>b.getMeta("composition")))return;const r=t.some(b=>b.docChanged)&&!e.doc.eq(n.doc),o=t.some(b=>b.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:a}=e.selection,u=Ue.atStart(e.doc).from,d=Ue.atEnd(e.doc).to;if(s||!(i===u&&a===d)||!Zc(n.doc))return;const g=n.tr,x=Hp({state:n,transaction:g}),{commands:v}=new Up({editor:this.editor,state:x});if(v.clearNodes(),!!g.steps.length)return g}})]}}),tT=Et.create({name:"paste",addProseMirrorPlugins(){return[new St({key:new Wt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),nT=Et.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new St({key:new Wt("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),rT=Et.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=yl(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new St({key:new Wt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),bH=class Tu{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Tu(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Tu(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Tu(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(a);if(!o&&!i&&u.depth<=this.depth)return;const d=new Tu(u,this.editor,o,o||i?n:null);o&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let a=0;a<i.length;a+=1){const u=i[a];if(s[u]!==n[u])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===e&&s.every(u=>n[u]===i.node.attrs[u])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},kH=`.ProseMirror {
511
+ position: relative;
512
+ }
513
+
514
+ .ProseMirror {
515
+ word-wrap: break-word;
516
+ white-space: pre-wrap;
517
+ white-space: break-spaces;
518
+ -webkit-font-variant-ligatures: none;
519
+ font-variant-ligatures: none;
520
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
521
+ }
522
+
523
+ .ProseMirror [contenteditable="false"] {
524
+ white-space: normal;
525
+ }
526
+
527
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
528
+ white-space: pre-wrap;
529
+ }
530
+
531
+ .ProseMirror pre {
532
+ white-space: pre-wrap;
533
+ }
534
+
535
+ img.ProseMirror-separator {
536
+ display: inline !important;
537
+ border: none !important;
538
+ margin: 0 !important;
539
+ width: 0 !important;
540
+ height: 0 !important;
541
+ }
542
+
543
+ .ProseMirror-gapcursor {
544
+ display: none;
545
+ pointer-events: none;
546
+ position: absolute;
547
+ margin: 0;
548
+ }
549
+
550
+ .ProseMirror-gapcursor:after {
551
+ content: "";
552
+ display: block;
553
+ position: absolute;
554
+ top: -2px;
555
+ width: 20px;
556
+ border-top: 1px solid black;
557
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
558
+ }
559
+
560
+ @keyframes ProseMirror-cursor-blink {
561
+ to {
562
+ visibility: hidden;
563
+ }
564
+ }
565
+
566
+ .ProseMirror-hideselection *::selection {
567
+ background: transparent;
568
+ }
569
+
570
+ .ProseMirror-hideselection *::-moz-selection {
571
+ background: transparent;
572
+ }
573
+
574
+ .ProseMirror-hideselection * {
575
+ caret-color: transparent;
576
+ }
577
+
578
+ .ProseMirror-focused .ProseMirror-gapcursor {
579
+ display: block;
580
+ }`,wH=class extends nH{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:RV,createMappablePosition:OV},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=hy(e,this.options.autofocus);this.editorState=Vi.create({doc:e,schema:this.schema,selection:n||void 0})}this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=oH(kH,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=R6(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;n=n.filter(i=>!i.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[Y6,K6.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),G6,Q6,eT,nT.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),Z6,tT,J6,rT.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Kp(s,this)}createCommandManager(){this.commandManager=new Up({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=py(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=py(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Vi.create({doc:n,schema:this.schema,selection:hy(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,i=this.extensionManager.transformPastedHTML(s);this.editorView=new k6(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:o,transformPastedHTML:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(d)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),a=i==null?void 0:i.getMeta("focus"),u=i==null?void 0:i.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:i}),u&&this.emit("blur",{editor:this,event:u.event,transaction:i}),!(t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return L6(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return AV(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
581
+
582
+ `,textSerializers:n={}}=t||{};return CV(this.state.doc,{blockSeparator:e,textSerializers:{...P6(this.schema),...n}})}get isEmpty(){return Zc(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new bH(e,this,!1,n)}get $doc(){return this.$pos(0)}};function aa(t){return new Yc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=lt(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];if(i){const u=a.search(/\S/),d=n.from+a.indexOf(i),h=d+i.length;if(Gx(n.from,n.to,e.doc).filter(x=>x.mark.type.excluded.find(b=>b===t.type&&b!==x.mark.type)).filter(x=>x.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+u,d);const g=n.from+u+i.length;s.addMark(n.from+u,g,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function CH(t){return new Yc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=lt(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let a=n.to;const u=t.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=i+d;h>a?h=a:a=h+r[1].length;const f=r[0][r[0].length-1];s.insertText(f,i+r[0].length-1),s.replaceWith(h,a,u)}else if(r[0]){const d=t.type.isInline?i:i-1;s.insert(d,t.type.create(o)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function yy(t){return new Yc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=lt(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function xl(t){return new Yc({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=lt(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),u=i.doc.resolve(n.from).blockRange(),d=u&&Nx(u,t.type,s);if(!d)return null;if(i.wrap(u,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:g}=e,{splittableMarks:x}=t.editor.extensionManager,v=g||f.$to.parentOffset&&f.$from.marks();if(v){const b=v.filter(k=>x.includes(k.type.name));i.ensureMarks(b)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,s).run()}const h=i.doc.resolve(n.from-1).nodeBefore;h&&h.type===t.type&&xi(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,h))&&i.join(n.from-1)},undoable:t.undoable})}var ht=class oT extends Xx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new oT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function hi(t){return new U6({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=lt(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,a=r[r.length-1],u=r[0];let d=n.to;if(a){const h=u.search(/\S/),f=n.from+u.indexOf(a),g=f+a.length;if(Gx(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(E=>E===t.type&&E!==b.mark.type)).filter(b=>b.to>f).length)return null;g<n.to&&i.delete(g,n.to),f>n.from&&i.delete(n.from+h,f),d=n.from+h+a.length,i.addMark(n.from+h,d,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||i.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:SH,getOwnPropertySymbols:EH}=Object,{hasOwnProperty:_H}=Object.prototype;function Ig(t,e){return function(r,o,s){return t(r,o,s)&&e(r,o,s)}}function Rf(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);const{cache:s}=o,i=s.get(n),a=s.get(r);if(i&&a)return i===r&&a===n;s.set(n,r),s.set(r,n);const u=t(n,r,o);return s.delete(n),s.delete(r),u}}function TH(t){return t!=null?t[Symbol.toStringTag]:void 0}function zC(t){return SH(t).concat(EH(t))}const NH=Object.hasOwn||((t,e)=>_H.call(t,e));function ga(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const AH="__v",MH="__o",DH="_owner",{getOwnPropertyDescriptor:FC,keys:$C}=Object;function RH(t,e){return t.byteLength===e.byteLength&&Eh(new Uint8Array(t),new Uint8Array(e))}function OH(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function jH(t,e){return t.byteLength===e.byteLength&&Eh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function IH(t,e){return ga(t.getTime(),e.getTime())}function PH(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function LH(t,e){return t===e}function BC(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),s=t.entries();let i,a,u=0;for(;(i=s.next())&&!i.done;){const d=e.entries();let h=!1,f=0;for(;(a=d.next())&&!a.done;){if(o[f]){f++;continue}const g=i.value,x=a.value;if(n.equals(g[0],x[0],u,f,t,e,n)&&n.equals(g[1],x[1],g[0],x[0],t,e,n)){h=o[f]=!0;break}f++}if(!h)return!1;u++}return!0}const zH=ga;function FH(t,e,n){const r=$C(t);let o=r.length;if($C(e).length!==o)return!1;for(;o-- >0;)if(!sT(t,e,n,r[o]))return!1;return!0}function yu(t,e,n){const r=zC(t);let o=r.length;if(zC(e).length!==o)return!1;let s,i,a;for(;o-- >0;)if(s=r[o],!sT(t,e,n,s)||(i=FC(t,s),a=FC(e,s),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function $H(t,e){return ga(t.valueOf(),e.valueOf())}function BH(t,e){return t.source===e.source&&t.flags===e.flags}function VC(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),s=t.values();let i,a;for(;(i=s.next())&&!i.done;){const u=e.values();let d=!1,h=0;for(;(a=u.next())&&!a.done;){if(!o[h]&&n.equals(i.value,a.value,i.value,a.value,t,e,n)){d=o[h]=!0;break}h++}if(!d)return!1}return!0}function Eh(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function VH(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function sT(t,e,n,r){return(r===DH||r===MH||r===AH)&&(t.$$typeof||e.$$typeof)?!0:NH(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const HH="[object ArrayBuffer]",UH="[object Arguments]",WH="[object Boolean]",qH="[object DataView]",KH="[object Date]",GH="[object Error]",JH="[object Map]",ZH="[object Number]",YH="[object Object]",XH="[object RegExp]",QH="[object Set]",eU="[object String]",tU={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},nU="[object URL]",rU=Object.prototype.toString;function oU({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:f,areTypedArraysEqual:g,areUrlsEqual:x,unknownTagComparators:v}){return function(k,E,_){if(k===E)return!0;if(k==null||E==null)return!1;const T=typeof k;if(T!==typeof E)return!1;if(T!=="object")return T==="number"?a(k,E,_):T==="function"?s(k,E,_):!1;const A=k.constructor;if(A!==E.constructor)return!1;if(A===Object)return u(k,E,_);if(Array.isArray(k))return e(k,E,_);if(A===Date)return r(k,E,_);if(A===RegExp)return h(k,E,_);if(A===Map)return i(k,E,_);if(A===Set)return f(k,E,_);const D=rU.call(k);if(D===KH)return r(k,E,_);if(D===XH)return h(k,E,_);if(D===JH)return i(k,E,_);if(D===QH)return f(k,E,_);if(D===YH)return typeof k.then!="function"&&typeof E.then!="function"&&u(k,E,_);if(D===nU)return x(k,E,_);if(D===GH)return o(k,E,_);if(D===UH)return u(k,E,_);if(tU[D])return g(k,E,_);if(D===HH)return t(k,E,_);if(D===qH)return n(k,E,_);if(D===WH||D===ZH||D===eU)return d(k,E,_);if(v){let R=v[D];if(!R){const O=TH(k);O&&(R=v[O])}if(R)return R(k,E,_)}return!1}}function sU({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:RH,areArraysEqual:n?yu:OH,areDataViewsEqual:jH,areDatesEqual:IH,areErrorsEqual:PH,areFunctionsEqual:LH,areMapsEqual:n?Ig(BC,yu):BC,areNumbersEqual:zH,areObjectsEqual:n?yu:FH,arePrimitiveWrappersEqual:$H,areRegExpsEqual:BH,areSetsEqual:n?Ig(VC,yu):VC,areTypedArraysEqual:n?Ig(Eh,yu):Eh,areUrlsEqual:VH,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=Rf(r.areArraysEqual),s=Rf(r.areMapsEqual),i=Rf(r.areObjectsEqual),a=Rf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:a})}return r}function iU(t){return function(e,n,r,o,s,i,a){return t(e,n,a)}}function aU({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(a,u){const{cache:d=t?new WeakMap:void 0,meta:h}=n();return e(a,u,{cache:d,equals:r,meta:h,strict:o})};if(t)return function(a,u){return e(a,u,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const s={cache:void 0,equals:r,meta:void 0,strict:o};return function(a,u){return e(a,u,s)}}const lU=bi();bi({strict:!0});bi({circular:!0});bi({circular:!0,strict:!0});bi({createInternalComparator:()=>ga});bi({strict:!0,createInternalComparator:()=>ga});bi({circular:!0,createInternalComparator:()=>ga});bi({circular:!0,createInternalComparator:()=>ga,strict:!0});function bi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,s=sU(t),i=oU(s),a=n?n(i):iU(i);return aU({circular:e,comparator:i,createState:r,equals:a,strict:o})}var Pg={exports:{}},Lg={};/**
583
+ * @license React
584
+ * use-sync-external-store-shim/with-selector.production.js
585
+ *
586
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
587
+ *
588
+ * This source code is licensed under the MIT license found in the
589
+ * LICENSE file in the root directory of this source tree.
590
+ */var HC;function uU(){if(HC)return Lg;HC=1;var t=Nc(),e=H_();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,u=t.useDebugValue;return Lg.useSyncExternalStoreWithSelector=function(d,h,f,g,x){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function E(R){if(!_){if(_=!0,T=R,R=g(R),x!==void 0&&b.hasValue){var O=b.value;if(x(O,R))return A=O}return A=R}if(O=A,r(T,R))return O;var P=g(R);return x!==void 0&&x(O,P)?(T=R,O):(T=R,A=P)}var _=!1,T,A,D=f===void 0?null:f;return[function(){return E(h())},D===null?void 0:function(){return E(D())}]},[h,f,g,x]);var k=o(d,v[0],v[1]);return i(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},Lg}var UC;function cU(){return UC||(UC=1,Pg.exports=uU()),Pg.exports}var dU=cU(),fU=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},hU=({contentComponent:t})=>{const e=U_.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return m.jsx(m.Fragment,{children:Object.values(e)})};function pU(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(o=>o())}))};return{subscribe(o){return t.add(o),()=>{t.delete(o)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(o,s){e={...e,[o]:o3.createPortal(s.reactElement,s.element,o)},r()},removeRenderer(o){const s={...e};delete s[o],e=s,r()}}}var mU=class extends ne.Component{constructor(t){super(t),this.editorContentRef=ne.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=pU(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return m.jsxs(m.Fragment,{children:[m.jsx("div",{ref:fU(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&m.jsx(hU,{contentComponent:t.contentComponent})]})}},gU=C.forwardRef((t,e)=>{const n=ne.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ne.createElement(mU,{key:n,innerRef:e,...t})}),iT=ne.memo(gU),yU=typeof window<"u"?C.useLayoutEffect:C.useEffect,xU=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=o=>{(o==null?void 0:o.transaction)!==void 0&&o.transaction===e||(e=o==null?void 0:o.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function vU(t){var e;const[n]=C.useState(()=>new xU(t.editor)),r=dU.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:lU);return yU(()=>n.watch(t.editor),[t.editor,n]),C.useDebugValue(r),r}var bU=!1,aT=typeof window>"u",kU=aT||!!(typeof window<"u"&&window.next),wU=class lT{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return aT?(n&&bU&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):kU&&e===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onBeforeCreate)==null?void 0:s.call(o,...r)},onBlur:(...r)=>{var o,s;return(s=(o=this.options.current).onBlur)==null?void 0:s.call(o,...r)},onCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onCreate)==null?void 0:s.call(o,...r)},onDestroy:(...r)=>{var o,s;return(s=(o=this.options.current).onDestroy)==null?void 0:s.call(o,...r)},onFocus:(...r)=>{var o,s;return(s=(o=this.options.current).onFocus)==null?void 0:s.call(o,...r)},onSelectionUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onSelectionUpdate)==null?void 0:s.call(o,...r)},onTransaction:(...r)=>{var o,s;return(s=(o=this.options.current).onTransaction)==null?void 0:s.call(o,...r)},onUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onUpdate)==null?void 0:s.call(o,...r)},onContentError:(...r)=>{var o,s;return(s=(o=this.options.current).onContentError)==null?void 0:s.call(o,...r)},onDrop:(...r)=>{var o,s;return(s=(o=this.options.current).onDrop)==null?void 0:s.call(o,...r)},onPaste:(...r)=>{var o,s;return(s=(o=this.options.current).onPaste)==null?void 0:s.call(o,...r)},onDelete:(...r)=>{var o,s;return(s=(o=this.options.current).onDelete)==null?void 0:s.call(o,...r)},onMount:(...r)=>{var o,s;return(s=(o=this.options.current).onMount)==null?void 0:s.call(o,...r)},onUnmount:(...r)=>{var o,s;return(s=(o=this.options.current).onUnmount)==null?void 0:s.call(o,...r)}};return new wH(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,s)=>{var i;return o===((i=n.extensions)==null?void 0:i[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?lT.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function CU(t={},e=[]){const n=C.useRef(t);n.current=t;const[r]=C.useState(()=>new wU(n)),o=U_.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(o),C.useEffect(r.onRender(e)),vU({editor:o,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),o}var uT=C.createContext({editor:null});uT.Consumer;var SU=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),EU=()=>C.useContext(SU);ne.forwardRef((t,e)=>{const{onDragStart:n}=EU(),r=t.as||"div";return m.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});ne.createContext({markViewContentRef:()=>{}});var Qx=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Qx.displayName="TiptapContext";var _U=()=>C.useContext(Qx);function cT({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=C.useMemo(()=>({editor:n}),[n]),o=C.useMemo(()=>({editor:n}),[n]);return m.jsx(uT.Provider,{value:o,children:m.jsx(Qx.Provider,{value:r,children:t})})}cT.displayName="Tiptap";function dT({...t}){const{editor:e}=_U();return m.jsx(iT,{editor:e,...t})}dT.displayName="Tiptap.Content";Object.assign(cT,{Content:dT});var _h=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},TU=(t,e)=>{var n;const{state:r,view:o}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const a=i.depth-1;if(a<0)return!1;const u=i.node(a),d=i.index(a);if(d===0)return!1;if(u.type===e)return t.commands.lift(e.name);const h=u.child(d-1);if(h.type!==e||!((n=h.lastChild)!=null&&n.isTextblock))return!1;const f=i.before(),x=f-1-1,{tr:v}=r;return v.delete(f,i.after()).insert(x,i.parent.content),v.setSelection(ze.create(v.doc,x)),o.dispatch(v.scrollIntoView()),!0},NU=/^\s*>\s$/,AU=ht.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return _h("blockquote",{...tn(this.options.HTMLAttributes,t),children:_h("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((o,s)=>{var i,a;const h=((a=(i=e.renderChild)==null?void 0:i.call(e,o,s))!=null?a:e.renderChildren([o])).split(`
591
+ `).map(f=>f.trim()===""?n:`${n} ${f}`);r.push(h.join(`
592
+ `))}),r.join(`
593
+ ${n}
594
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>TU(this.editor,this.type)}},addInputRules(){return[xl({find:NU,type:this.type})]}}),MU=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,DU=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,RU=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,OU=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,jU=gr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return _h("strong",{...tn(this.options.HTMLAttributes,t),children:_h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[aa({find:MU,type:this.type}),aa({find:RU,type:this.type})]},addPasteRules(){return[hi({find:DU,type:this.type}),hi({find:OU,type:this.type})]}}),IU=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},PU=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},LU=gr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",tn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[aa({find:IU,type:this.type})]},addPasteRules(){return[hi({find:PU,type:this.type})]}}),zg=4,zU=/^```([a-z]+)?[\s\n]$/,FU=/^~~~([a-z]+)?[\s\n]$/,$U=ht.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:zg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",tn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const o=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
595
+ `):r=`\`\`\`${o}
596
+
597
+ \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:zg,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return i?t.commands.insertContent(a):t.commands.command(({tr:u})=>{const{from:d,to:h}=o,x=r.doc.textBetween(d,h,`
598
+ `,`
599
+ `).split(`
600
+ `).map(v=>a+v).join(`
601
+ `);return u.replaceWith(d,h,r.schema.text(x)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:zg,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;return s.parent.type!==this.type?!1:i?t.commands.command(({tr:a})=>{var u;const{pos:d}=s,h=s.start(),f=s.end(),x=r.doc.textBetween(h,f,`
602
+ `,`
603
+ `).split(`
604
+ `);let v=0,b=0;const k=d-h;for(let R=0;R<x.length;R+=1){if(b+x[R].length>=k){v=R;break}b+=x[R].length+1}const _=((u=x[v].match(/^ */))==null?void 0:u[0])||"",T=Math.min(_.length,n);if(T===0)return!0;let A=h;for(let R=0;R<v;R+=1)A+=x[R].length+1;return a.delete(A,A+T),d-A<=T&&a.setSelection(ze.create(a.doc,A)),!0}):t.commands.command(({tr:a})=>{const{from:u,to:d}=o,g=r.doc.textBetween(u,d,`
605
+ `,`
606
+ `).split(`
607
+ `).map(x=>{var v;const b=((v=x.match(/^ */))==null?void 0:v[0])||"",k=Math.min(b.length,n);return x.slice(k)}).join(`
608
+ `);return a.replaceWith(u,d,r.schema.text(g)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
609
+
610
+ `);return!s||!i?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:d})=>(d.setSelection(Ue.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[yy({find:zU,type:this.type,getAttributes:t=>({language:t[1]})}),yy({find:FU,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new St({key:new Wt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o==null?void 0:o.mode;if(!n||!s)return!1;const{tr:i,schema:a}=t.state,u=a.text(n.replace(/\r\n?/g,`
611
+ `));return i.replaceSelectionWith(this.type.create({language:s},u)),i.selection.$from.parent.type!==this.type&&i.setSelection(ze.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),BU=ht.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
612
+
613
+ `):""}),VU=ht.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",tn(this.options.HTMLAttributes,t)]},renderText(){return`
614
+ `},renderMarkdown:()=>`
615
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&u&&i){const f=u.filter(g=>a.includes(g.type.name));d.ensureMarks(f)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),HU=ht.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,tn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>yy({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),UU=ht.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",tn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!rH(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return z6(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:i,dispatch:a})=>{if(a){const{$to:u}=i.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?i.setSelection(ze.create(i.doc,u.pos+1)):u.nodeAfter.isBlock?i.setSelection(Ie.create(i.doc,u.pos)):i.setSelection(ze.create(i.doc,u.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,f=h==null?void 0:h.create();f&&(i.insert(d,f),i.setSelection(ze.create(i.doc,d+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[CH({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),WU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,KU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,GU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,JU=gr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[aa({find:WU,type:this.type}),aa({find:KU,type:this.type})]},addPasteRules(){return[hi({find:qU,type:this.type}),hi({find:GU,type:this.type})]}});const ZU="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",YU="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",xy="numeric",vy="ascii",by="alpha",Iu="asciinumeric",Nu="alphanumeric",ky="domain",fT="emoji",XU="scheme",QU="slashscheme",Fg="whitespace";function eW(t,e){return t in e||(e[t]=[]),e[t]}function qi(t,e,n){e[xy]&&(e[Iu]=!0,e[Nu]=!0),e[vy]&&(e[Iu]=!0,e[by]=!0),e[Iu]&&(e[Nu]=!0),e[by]&&(e[Nu]=!0),e[Nu]&&(e[ky]=!0),e[fT]&&(e[ky]=!0);for(const r in e){const o=eW(r,n);o.indexOf(t)<0&&o.push(t)}}function tW(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function tr(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}tr.groups={};tr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||tr.groups;let o;return e&&e.j?o=e:(o=new tr(e),n&&r&&qi(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const s=t.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(t[i]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||tr.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,a=o.go(t);if(a?(i=new tr,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new tr,s){if(r)if(i.t&&typeof i.t=="string"){const u=Object.assign(tW(i.t,r),n);qi(s,u,r)}else n&&qi(s,n,r);i.t=s}return o.j[t]=i,i}};const We=(t,e,n,r,o)=>t.ta(e,n,r,o),Rt=(t,e,n,r,o)=>t.tr(e,n,r,o),WC=(t,e,n,r,o)=>t.ts(e,n,r,o),ue=(t,e,n,r,o)=>t.tt(e,n,r,o),Jo="WORD",wy="UWORD",hT="ASCIINUMERICAL",pT="ALPHANUMERICAL",xc="LOCALHOST",Cy="TLD",Sy="UTLD",Qf="SCHEME",Xa="SLASH_SCHEME",ev="NUM",Ey="WS",tv="NL",Pu="OPENBRACE",Lu="CLOSEBRACE",Th="OPENBRACKET",Nh="CLOSEBRACKET",Ah="OPENPAREN",Mh="CLOSEPAREN",Dh="OPENANGLEBRACKET",Rh="CLOSEANGLEBRACKET",Oh="FULLWIDTHLEFTPAREN",jh="FULLWIDTHRIGHTPAREN",Ih="LEFTCORNERBRACKET",Ph="RIGHTCORNERBRACKET",Lh="LEFTWHITECORNERBRACKET",zh="RIGHTWHITECORNERBRACKET",Fh="FULLWIDTHLESSTHAN",$h="FULLWIDTHGREATERTHAN",Bh="AMPERSAND",Vh="APOSTROPHE",Hh="ASTERISK",Hs="AT",Uh="BACKSLASH",Wh="BACKTICK",qh="CARET",Ki="COLON",nv="COMMA",Kh="DOLLAR",mo="DOT",Gh="EQUALS",rv="EXCLAMATION",Tr="HYPHEN",zu="PERCENT",Jh="PIPE",Zh="PLUS",Yh="POUND",Fu="QUERY",ov="QUOTE",mT="FULLWIDTHMIDDLEDOT",sv="SEMI",go="SLASH",$u="TILDE",Xh="UNDERSCORE",gT="EMOJI",Qh="SYM";var yT=Object.freeze({__proto__:null,ALPHANUMERICAL:pT,AMPERSAND:Bh,APOSTROPHE:Vh,ASCIINUMERICAL:hT,ASTERISK:Hh,AT:Hs,BACKSLASH:Uh,BACKTICK:Wh,CARET:qh,CLOSEANGLEBRACKET:Rh,CLOSEBRACE:Lu,CLOSEBRACKET:Nh,CLOSEPAREN:Mh,COLON:Ki,COMMA:nv,DOLLAR:Kh,DOT:mo,EMOJI:gT,EQUALS:Gh,EXCLAMATION:rv,FULLWIDTHGREATERTHAN:$h,FULLWIDTHLEFTPAREN:Oh,FULLWIDTHLESSTHAN:Fh,FULLWIDTHMIDDLEDOT:mT,FULLWIDTHRIGHTPAREN:jh,HYPHEN:Tr,LEFTCORNERBRACKET:Ih,LEFTWHITECORNERBRACKET:Lh,LOCALHOST:xc,NL:tv,NUM:ev,OPENANGLEBRACKET:Dh,OPENBRACE:Pu,OPENBRACKET:Th,OPENPAREN:Ah,PERCENT:zu,PIPE:Jh,PLUS:Zh,POUND:Yh,QUERY:Fu,QUOTE:ov,RIGHTCORNERBRACKET:Ph,RIGHTWHITECORNERBRACKET:zh,SCHEME:Qf,SEMI:sv,SLASH:go,SLASH_SCHEME:Xa,SYM:Qh,TILDE:$u,TLD:Cy,UNDERSCORE:Xh,UTLD:Sy,UWORD:wy,WORD:Jo,WS:Ey});const qo=/[a-z]/,xu=new RegExp("\\p{L}","u"),$g=new RegExp("\\p{Emoji}","u"),Ko=/\d/,Bg=/\s/,qC="\r",Vg=`
616
+ `,nW="️",rW="‍",Hg="";let Of=null,jf=null;function oW(t=[]){const e={};tr.groups=e;const n=new tr;Of==null&&(Of=KC(ZU)),jf==null&&(jf=KC(YU)),ue(n,"'",Vh),ue(n,"{",Pu),ue(n,"}",Lu),ue(n,"[",Th),ue(n,"]",Nh),ue(n,"(",Ah),ue(n,")",Mh),ue(n,"<",Dh),ue(n,">",Rh),ue(n,"(",Oh),ue(n,")",jh),ue(n,"「",Ih),ue(n,"」",Ph),ue(n,"『",Lh),ue(n,"』",zh),ue(n,"<",Fh),ue(n,">",$h),ue(n,"&",Bh),ue(n,"*",Hh),ue(n,"@",Hs),ue(n,"`",Wh),ue(n,"^",qh),ue(n,":",Ki),ue(n,",",nv),ue(n,"$",Kh),ue(n,".",mo),ue(n,"=",Gh),ue(n,"!",rv),ue(n,"-",Tr),ue(n,"%",zu),ue(n,"|",Jh),ue(n,"+",Zh),ue(n,"#",Yh),ue(n,"?",Fu),ue(n,'"',ov),ue(n,"/",go),ue(n,";",sv),ue(n,"~",$u),ue(n,"_",Xh),ue(n,"\\",Uh),ue(n,"・",mT);const r=Rt(n,Ko,ev,{[xy]:!0});Rt(r,Ko,r);const o=Rt(r,qo,hT,{[Iu]:!0}),s=Rt(r,xu,pT,{[Nu]:!0}),i=Rt(n,qo,Jo,{[vy]:!0});Rt(i,Ko,o),Rt(i,qo,i),Rt(o,Ko,o),Rt(o,qo,o);const a=Rt(n,xu,wy,{[by]:!0});Rt(a,qo),Rt(a,Ko,s),Rt(a,xu,a),Rt(s,Ko,s),Rt(s,qo),Rt(s,xu,s);const u=ue(n,Vg,tv,{[Fg]:!0}),d=ue(n,qC,Ey,{[Fg]:!0}),h=Rt(n,Bg,Ey,{[Fg]:!0});ue(n,Hg,h),ue(d,Vg,u),ue(d,Hg,h),Rt(d,Bg,h),ue(h,qC),ue(h,Vg),Rt(h,Bg,h),ue(h,Hg,h);const f=Rt(n,$g,gT,{[fT]:!0});ue(f,"#"),Rt(f,$g,f),ue(f,nW,f);const g=ue(f,rW);ue(g,"#"),Rt(g,$g,f);const x=[[qo,i],[Ko,o]],v=[[qo,null],[xu,a],[Ko,s]];for(let b=0;b<Of.length;b++)Fs(n,Of[b],Cy,Jo,x);for(let b=0;b<jf.length;b++)Fs(n,jf[b],Sy,wy,v);qi(Cy,{tld:!0,ascii:!0},e),qi(Sy,{utld:!0,alpha:!0},e),Fs(n,"file",Qf,Jo,x),Fs(n,"mailto",Qf,Jo,x),Fs(n,"http",Xa,Jo,x),Fs(n,"https",Xa,Jo,x),Fs(n,"ftp",Xa,Jo,x),Fs(n,"ftps",Xa,Jo,x),qi(Qf,{scheme:!0,ascii:!0},e),qi(Xa,{slashscheme:!0,ascii:!0},e),t=t.sort((b,k)=>b[0]>k[0]?1:-1);for(let b=0;b<t.length;b++){const k=t[b][0],_=t[b][1]?{[XU]:!0}:{[QU]:!0};k.indexOf("-")>=0?_[ky]=!0:qo.test(k)?Ko.test(k)?_[Iu]=!0:_[vy]=!0:_[xy]=!0,WC(n,k,k,_)}return WC(n,"localhost",xc,{ascii:!0}),n.jd=new tr(Qh),{start:n,tokens:Object.assign({groups:e},yT)}}function xT(t,e){const n=sW(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let a=t,u=null,d=0,h=null,f=-1,g=-1;for(;i<r&&(u=a.go(n[i]));)a=u,a.accepts()?(f=0,g=0,h=a):f>=0&&(f+=n[i].length,g++),d+=n[i].length,s+=n[i].length,i++;s-=f,i-=g,d-=f,o.push({t:h.t,v:e.slice(s-d,s),s:s-d,e:s})}return o}function sW(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(i),r+=i.length}return e}function Fs(t,e,n,r,o){let s;const i=e.length;for(let a=0;a<i-1;a++){const u=e[a];t.j[u]?s=t.j[u]:(s=new tr(r),s.jr=o.slice(),t.j[u]=s),t=s}return s=new tr(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function KC(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(t[r]),r++}return e}const vc={defaultProtocol:"http",events:null,format:GC,formatHref:GC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function iv(t,e=null){let n=Object.assign({},vc);t&&(n=Object.assign(n,t instanceof iv?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}iv.prototype={o:vc,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:vc[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function GC(t){return t}function vT(t,e){this.t="token",this.v=t,this.tk=e}vT.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=vc.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),i={},a=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),h=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return i.href=r,a&&(i.class=a),u&&(i.target=u),d&&(i.rel=d),h&&Object.assign(i,h),{tagName:o,attributes:i,content:s,eventListeners:f}}};function Gp(t,e){class n extends vT{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const iW=Gp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),JC=Gp("text"),aW=Gp("nl"),If=Gp("url",{isLink:!0,toHref(t=vc.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xc&&t[1].t===Ki}}),_r=t=>new tr(t);function lW({groups:t}){const e=t.domain.concat([Bh,Hh,Hs,Uh,Wh,qh,Kh,Gh,Tr,ev,zu,Jh,Zh,Yh,go,Qh,$u,Xh]),n=[Vh,Ki,nv,mo,rv,zu,Fu,ov,sv,Dh,Rh,Pu,Lu,Nh,Th,Ah,Mh,Oh,jh,Ih,Ph,Lh,zh,Fh,$h],r=[Bh,Vh,Hh,Uh,Wh,qh,Kh,Gh,Tr,Pu,Lu,zu,Jh,Zh,Yh,Fu,go,Qh,$u,Xh],o=_r(),s=ue(o,$u);We(s,r,s),We(s,t.domain,s);const i=_r(),a=_r(),u=_r();We(o,t.domain,i),We(o,t.scheme,a),We(o,t.slashscheme,u),We(i,r,s),We(i,t.domain,i);const d=ue(i,Hs);ue(s,Hs,d),ue(a,Hs,d),ue(u,Hs,d);const h=ue(s,mo);We(h,r,s),We(h,t.domain,s);const f=_r();We(d,t.domain,f),We(f,t.domain,f);const g=ue(f,mo);We(g,t.domain,f);const x=_r(iW);We(g,t.tld,x),We(g,t.utld,x),ue(d,xc,x);const v=ue(f,Tr);ue(v,Tr,v),We(v,t.domain,f),We(x,t.domain,f),ue(x,mo,g),ue(x,Tr,v);const b=ue(i,Tr),k=ue(i,mo);ue(b,Tr,b),We(b,t.domain,i),We(k,r,s),We(k,t.domain,i);const E=_r(If);We(k,t.tld,E),We(k,t.utld,E),We(E,t.domain,i),We(E,r,s),ue(E,mo,k),ue(E,Tr,b),ue(E,Hs,d);const _=ue(E,Ki),T=_r(If);We(_,t.numeric,T);const A=_r(If),D=_r();We(A,e,A),We(A,n,D),We(D,e,A),We(D,n,D),ue(E,go,A),ue(T,go,A);const R=ue(a,Ki),O=ue(u,Ki),P=ue(O,go),j=ue(P,go);We(a,t.domain,i),ue(a,mo,k),ue(a,Tr,b),We(u,t.domain,i),ue(u,mo,k),ue(u,Tr,b),We(R,t.domain,A),ue(R,go,A),ue(R,Fu,A),We(j,t.domain,A),We(j,e,A),ue(j,go,A);const W=[[Pu,Lu],[Th,Nh],[Ah,Mh],[Dh,Rh],[Oh,jh],[Ih,Ph],[Lh,zh],[Fh,$h]];for(let Z=0;Z<W.length;Z++){const[J,K]=W[Z],Y=ue(A,J);ue(D,J,Y);const ee=_r(If);We(Y,e,ee);const G=_r();We(Y,n,G),ue(Y,K,A),We(ee,e,ee),We(ee,n,G),We(G,e,ee),We(G,n,G),ue(ee,K,A),ue(G,K,A)}return ue(o,xc,E),ue(o,tv,aW),{start:o,tokens:yT}}function uW(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let a=t,u=null,d=null,h=0,f=null,g=-1;for(;o<r&&!(u=a.go(n[o].t));)i.push(n[o++]);for(;o<r&&(d=u||a.go(n[o].t));)u=null,a=d,a.accepts()?(g=0,f=a):g>=0&&g++,o++,h++;if(g<0)o-=h,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Ug(JC,e,i)),i=[]),o-=g,h-=g;const x=f.t,v=n.slice(o-h,o);s.push(Ug(x,e,v))}}return i.length>0&&s.push(Ug(JC,e,i)),s}function Ug(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const cW=typeof console<"u"&&console&&console.warn||(()=>{}),dW="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",wt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function fW(){return tr.groups={},wt.scanner=null,wt.parser=null,wt.tokenQueue=[],wt.pluginQueue=[],wt.customSchemes=[],wt.initialized=!1,wt}function ZC(t,e=!1){if(wt.initialized&&cW(`linkifyjs: already initialized - will not register custom scheme "${t}" ${dW}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
617
+ 1. Must only contain digits, lowercase ASCII letters or "-"
618
+ 2. Cannot start or end with "-"
619
+ 3. "-" cannot repeat`);wt.customSchemes.push([t,e])}function hW(){wt.scanner=oW(wt.customSchemes);for(let t=0;t<wt.tokenQueue.length;t++)wt.tokenQueue[t][1]({scanner:wt.scanner});wt.parser=lW(wt.scanner.tokens);for(let t=0;t<wt.pluginQueue.length;t++)wt.pluginQueue[t][1]({scanner:wt.scanner,parser:wt.parser});return wt.initialized=!0,wt}function av(t){return wt.initialized||hW(),uW(wt.parser.start,t,xT(wt.scanner.start,t))}av.scan=xT;function bT(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new iv(n),o=av(t),s=[];for(let i=0;i<o.length;i++){const a=o[i];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var lv="[\0-   ᠎ -\u2029  ]",pW=new RegExp(lv),mW=new RegExp(`${lv}$`),gW=new RegExp(lv,"g");function yW(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function xW(t){return new St({key:new Wt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),s=e.some(d=>d.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,a=D6(n.doc,[...e]);if(Kx(a).forEach(({newRange:d})=>{const h=gV(r.doc,d,x=>x.isTextblock);let f,g;if(h.length>1)f=h[0],g=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(h.length){const x=r.doc.textBetween(d.from,d.to," "," ");if(!mW.test(x))return;f=h[0],g=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&g){const x=g.split(pW).filter(Boolean);if(x.length<=0)return!1;const v=x[x.length-1],b=f.pos+g.lastIndexOf(v);if(!v)return!1;const k=av(v).map(E=>E.toObject(t.defaultProtocol));if(!yW(k))return!1;k.filter(E=>E.isLink).map(E=>({...E,from:b+E.start+1,to:b+E.end+1})).filter(E=>r.schema.marks.code?!r.doc.rangeHasMark(E.from,E.to,r.schema.marks.code):!0).filter(E=>t.validate(E.value)).filter(E=>t.shouldAutoLink(E.value)).forEach(E=>{Gx(E.from,E.to,r.doc).some(_=>_.mark.type===t.type)||i.addMark(E.from,E.to,t.type.create({href:E.href}))})}}),!!i.steps.length)return i}})}function vW(t){return new St({key:new Wt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const u=r.target;if(!u)return!1;const d=t.editor.view.dom;i=u.closest("a"),i&&!d.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=L6(e.state,t.type.name),d=(o=i.href)!=null?o:u.href,h=(s=i.target)!=null?s:u.target;d&&(window.open(d,h),a=!0)}return a}}})}var bW=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,kW=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function kT(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function wW(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&kT(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function wT(t,e,n){var r,o;const[,s,i]=e;return(e.index?t[e.index-1]:void 0)==="!"||kT(t,(r=e.index)!=null?r:0)||wW(t,(o=e.index)!=null?o:0)?!1:!!s.trim()&&n(i)}function CT(t){var e,n;const[r,o,s,,i,a,u]=t,d=(e=i??a)!=null?e:u;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:o,data:{href:s,title:d||null,markdown:!0}}}function CW(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function ST(t){var e,n,r;return{href:(e=t.data)==null?void 0:e.href,title:(r=(n=t.data)==null?void 0:n.title)!=null?r:null}}function SW(t){const e=aa({find:n=>{const r=bW.exec(n);return!r||!wT(n,r,t.isAllowedHref)?null:CT(r)},type:t.type,getAttributes:ST});return new Yc({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function EW(t){const e=hi({find:n=>{var r,o;const s=[];for(const a of n.matchAll(kW))wT(n,a,t.isAllowedHref)&&s.push(CT(a));const i=((o=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?o:[]).filter(a=>!s.some(u=>CW(u,a)));return[...s,...i]},type:t.type,getAttributes:ST});return new U6({find:e.find,handler:n=>{var r;const o=e.handler(n);return o!==null&&n.state.tr.steps.length&&((r=n.match.data)!=null&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function _W(t){return new St({key:new Wt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:s}=e,{selection:i}=s,{empty:a}=i;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const d=bT(u,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!d||o!==void 0&&!o(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function Go(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(gW,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var TW=gr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){ZC(t);return}ZC(t.scheme,t.optionalSlashes)})},onDestroy(){fW()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const o=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!=null?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!=null?e:null},class:{default:(n=this.options.HTMLAttributes.class)!=null?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",tn(this.options.HTMLAttributes,t),0]:["a",tn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,o,s;const i=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(s=(o=t.attrs)==null?void 0:o.title)!=null?s:"",u=e.renderChildren(t);return a?`[${u}](${i} "${a}")`:`[${u}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[SW({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:o}=this.options;bT(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!Go(a,r),protocols:r,defaultProtocol:o})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[EW({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[hi({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(xW({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Go(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(vW({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(_W({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),NW=Object.defineProperty,AW=(t,e)=>{for(var n in e)NW(t,n,{get:e[n],enumerable:!0})},MW="listItem",YC="textStyle",XC=/^\s*([-+*])\s$/,ET=ht.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",tn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
620
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MW,this.editor.getAttributes(YC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=xl({find:XC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=xl({find:XC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(YC),editor:this.editor})),[t]}}),DW=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let s=-1;for(let x=o.depth;x>0;x-=1)if(o.node(x).type.name===e){s=x;break}if(s<0)return null;const i=o.node(s),a=o.index(s);if(a+1>=i.childCount)return null;const u=i.child(a+1);if(!n.includes(u.type.name))return null;const d=t.schema.nodes[e];let h=!1;if(u.forEach(x=>{x.type===d&&x.childCount>1&&(h=!0)}),!h)return null;const f=t.doc.resolve(o.after()).nodeAfter;if(!f||!n.includes(f.type.name))return null;const g=[];return f.forEach(x=>{g.push(x)}),g.length===0?null:{listItemDepth:s,nestedList:f,nestedListPos:o.after(),insertPos:o.after(s),items:g}},RW=(t,e,n,r)=>{const o=DW(t,n,r);if(!o)return!1;const{selection:s}=t,{nestedList:i,nestedListPos:a,insertPos:u,items:d}=o,h=t.tr;h.delete(a,a+i.nodeSize);const f=h.mapping.map(u);return h.insert(f,oe.from(d)),h.setSelection(s.map(h.doc,h.mapping)),e&&e(h),!0},OW=(t,e,n)=>RW(t.state,t.view.dispatch,e,n),_T=(t,e)=>Et.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>OW(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),TT=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Pf="abcdefghijklmnopqrstuvwxyz",jW="[a-zA-Z]{1,2}",NT=String.raw`\d+|[ivxlcdmIVXLCDM]+|${jW}`;function Jp(t){let e=t,n="";for(const[r,o]of TT)for(;e>=r;)n+=o,e-=r;return n}function uv(t){return Jp(t).toUpperCase()}function AT(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let o=!1;for(const[s,i]of TT)if(e.startsWith(i,n)){r+=s,n+=i.length,o=!0;break}if(!o)return 0}return r}function IW(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=AT(t);return e<=0?!1:(t===t.toLowerCase()?Jp(e):uv(e))===t}function PW(t){const e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function ep(t){if(t<=26)return Pf[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Pf[n]:Pf[e]+Pf[n]}function Zp(t){if(!(!t||/^\d+$/.test(t))){if(IW(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function cv(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=Zp(t);if(e==="i"||e==="I")return AT(t);if(e==="a"||e==="A"){const r=PW(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function LW(t,e){if(t==="numeric")return String(e);switch(t){case"a":return ep(e);case"A":return ep(e).toUpperCase();case"i":return Jp(e);case"I":return uv(e);default:return String(e)}}function zW(t){var e;if(t.length===0)return!1;const n=(e=Zp(t[0]))!=null?e:"numeric",r=cv(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){const s=LW(n,r+o);if(t[o]!==s)return!1}return!0}function FW(t){return{type:Zp(t),start:cv(t)}}function $W(t){const{type:e,start:n}=FW(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function BW(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${ep(r)}${n}`;case"A":return`${ep(r).toUpperCase()}${n}`;case"i":return`${Jp(r)}${n}`;case"I":return`${uv(r)}${n}`;default:return`${r}${n}`}}function VW(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function HW(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var MT=ht.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",tn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let o=[];if(t.tokens&&t.tokens.length>0){if(VW(t))return{type:"listItem",content:[{type:"paragraph",content:HW(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))o=r(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const u=t.tokens.slice(1),d=r(u);o.push(...d)}}else o=r(t.tokens)}}return o.length===0&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(t,e,n)=>Yx(t,e,r=>{var o,s,i,a;if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){const u=((s=(o=r.meta)==null?void 0:o.parentAttrs)==null?void 0:s.start)||1,d=(a=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:a.type,h=u-1+(r.index||0);return BW(d,h,". ")}return"- "},n),addExtensions(){return[_T(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),UW={};AW(UW,{findListItemPos:()=>Yp,getNextListDepth:()=>dv,handleBackspace:()=>_y,handleDelete:()=>Ty,hasListBefore:()=>DT,hasListItemAfter:()=>WW,hasListItemBefore:()=>qW,listItemHasSubList:()=>KW,nextListIsDeeper:()=>RT,nextListIsHigher:()=>OT});var Yp=(t,e)=>{const{$from:n}=e.selection,r=Ut(t,e.schema);let o=null,s=n.depth,i=n.pos,a=null;for(;s>0&&a===null;)o=n.node(s),o.type===r?a=s:(s-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},dv=(t,e)=>{const n=Yp(t,e);if(!n)return!1;const[,r]=TV(e,t,n.$pos.pos+4);return r},DT=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},_y=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!fi(t.state,e)&&DT(t.state,e,n)){const{$anchor:r}=t.state.selection,o=t.state.doc.resolve(r.before()-1),s=[];o.node().descendants((u,d)=>{u.type.name===e&&s.push({node:u,pos:d})});const i=s.at(-1);if(!i)return!1;const a=t.state.doc.resolve(o.start()+i.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},a.end()).joinForward().run()}return!fi(t.state,e)||!DV(t.state)?!1:t.chain().liftListItem(e).run()},RT=(t,e)=>{const n=dv(t,e),r=Yp(t,e);return!r||!n?!1:n>r.depth},OT=(t,e)=>{const n=dv(t,e),r=Yp(t,e);return!r||!n?!1:n<r.depth},Ty=(t,e)=>{if(!fi(t.state,e)||!MV(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:RT(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():OT(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},WW=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==t)},qW=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==t)},KW=(t,e,n)=>{if(!n)return!1;const r=Ut(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},jT=Et.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Ty(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Ty(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&_y(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&_y(t,n,r)&&(e=!0)}),e}}}}),Ny=new RegExp(`^(\\s*)(${NT})([.)])\\s+(.*)$`),GW=/^\s/,Au={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function JW(t){return Ny.test(t.trimStart())}function ZW(t){const e=t.trimStart();return Au.bulletItem.test(e)||JW(e)||Au.heading.test(e)||Au.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Au.codeFence.test(e)}function YW(t){return Object.values(Au).some(e=>e.test(t))}function XW(t){const e=[],n=[];let r=!1;return t.forEach(o=>{if(r){n.push(o);return}if(o.trim()===""){r=!0,n.push(o);return}if(e.length>0&&ZW(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function QW(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],s=o.match(Ny);if(!s)break;const[,i,a,u,d]=s,h=i.length,f=parseInt(a,10),g=isNaN(f)?Zp(a):void 0,x=isNaN(f)?cv(a):f,v=[d];let b=n+1;const k=[o];let E=!1;for(;b<t.length;){const _=t[b];if(_.match(Ny))break;if(_.trim()==="")k.push(_),v.push(""),E=!0,b+=1;else if(_.match(GW)){const A=_.length-_.trimStart().length,D=h+a.length+1;k.push(_),v.push(_.slice(Math.min(A,D))),b+=1}else{if(E||YW(_))break;k.push(_),v.push(_),b+=1}}e.push({indent:h,number:x,type:g,content:v.join(`
621
+ `).trim(),contentLines:v,raw:k.join(`
622
+ `)}),r=b,n=b}return[e,r]}var eq=new RegExp(`^(${NT})([.)])\\s+(.+)$`);function tq(t){const e=t.split(`
623
+ `).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const i=s.trim().match(eq);if(!i)return null;n.push({marker:i[1],content:i[3]})}const r=n.map(s=>s.marker);return zW(r)?{type:"orderedList",attrs:$W(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function IT(t,e,n){const r=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const{paragraphLines:i,blockLines:a}=XW(s.contentLines),u=i.join(`
624
+ `).trim(),d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const h=a.join(`
625
+ `).trim();if(h){const x=n.blockTokens(h);d.push(...x)}let f=o+1;const g=[];for(;f<t.length&&t[f].indent>e;)g.push(t[f]),f+=1;if(g.length>0){const x=Math.min(...g.map(b=>b.indent)),v=IT(g,x,n);d.push({type:"list",ordered:!0,start:g[0].number,typeMarker:g[0].type,items:v,raw:g.map(b=>b.raw).join(`
626
+ `)})}r.push({type:"list_item",raw:s.raw,tokens:d}),o=f}else o+=1}return r}function nq(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){const s=e.parseChildren([o]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([o]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var rq="listItem",QC="textStyle",eS=/^(\d+)\.\s$/;function tS(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var PT=ht.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const o=tS(n);if(o)return o}const r=t.querySelector("li");if(r){const o=r.getAttribute("style");if(o){const s=tS(o);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,o=tn(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,o=t.items?nq(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
627
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;const s=t.split(`
628
+ `),[i,a]=QW(s);if(i.length===0)return;const u=IT(i,i[0].indent,n);if(u.length===0)return;const d=((r=i[0])==null?void 0:r.number)||1,h=(o=i[0])==null?void 0:o.type;return{type:"list",ordered:!0,start:d,typeMarker:h,items:u,raw:s.slice(0,a).join(`
629
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rq,this.editor.getAttributes(QC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new St({props:{handlePaste:(t,e)=>{var n,r;const o=(n=e.clipboardData)==null?void 0:n.getData("text/html");if(o!=null&&o.trim())return!1;const s=(r=e.clipboardData)==null?void 0:r.getData("text/plain");if(!s)return!1;const i=tq(s);if(!i)return!1;try{const a=t.state.schema.nodeFromJSON(i),u=t.state.tr.replaceSelectionWith(a);return t.dispatch(u),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=xl({find:eS,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xl({find:eS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(QC)}),joinPredicate:t,editor:this.editor})),[e]}}),oq=/^\s*(\[([( |x])?\])\s$/,sq=ht.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",tn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const o=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return Yx(t,e,o)},addExtensions(){return this.options.nested?[_T(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),u=document.createElement("div"),d=f=>{var g,x;a.ariaLabel=((x=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:x.call(g,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};d(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:g}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:x})=>{const v=n();if(typeof v!="number")return!1;const b=x.doc.nodeAt(v);return x.setNodeMarkup(v,void 0,{...b==null?void 0:b.attrs,checked:g}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,g)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,g])=>{o.setAttribute(f,g)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,i),o.append(s,u),Object.entries(e).forEach(([f,g])=>{o.setAttribute(f,g)});let h=new Set(Object.keys(e));return{dom:o,contentDOM:u,update:f=>{if(f.type!==this.type)return!1;o.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,d(f);const g=r.extensionManager.attributes,x=yc(f,g),v=new Set(Object.keys(x)),b=this.options.HTMLAttributes;return h.forEach(k=>{v.has(k)||(k in b?o.setAttribute(k,b[k]):o.removeAttribute(k))}),Object.entries(x).forEach(([k,E])=>{E==null?k in b?o.setAttribute(k,b[k]):o.removeAttribute(k):o.setAttribute(k,E)}),h=v,!0}}}},addInputRules(){return[xl({find:oq,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),iq=ht.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",tn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
630
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const i=gy(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,u)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:u}),customNestedParser:r},n);if(i){const a={type:"taskList",raw:i.raw,items:i.items},u=s.slice(i.raw.length);return u.trim()?[a,...n.blockTokens(u)]:[a]}return n.blockTokens(s)},o=gy(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,i)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:i}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Et.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ET.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(MT.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(jT.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(PT.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(sq.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(iq.configure(this.options.taskList)),t}});var Lf="&nbsp;",Wg=" ",aq=ht.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",tn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Lf||n[0].text===Lf||n[0].raw===Wg||n[0].text===Wg)&&r.length===1&&r[0].type==="text"&&(r[0].text===Lf||r[0].text===Wg)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,o;if(!t)return"";const s=Array.isArray(t.content)?t.content:[];if(s.length===0){const i=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n==null?void 0:n.previousNode)==null?void 0:o.type)==="paragraph"&&i.length===0?Lf:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,uq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cq=gr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",tn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[aa({find:lq,type:this.type})]},addPasteRules(){return[hi({find:uq,type:this.type})]}}),dq=ht.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),fq=gr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",tn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const s=o[2].trim();return{type:"underline",raw:o[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function hq(t={}){return new St({view(e){return new pq(e,t)}})}class pq{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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 s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else 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,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(n){let f=e.nodeBefore,g=e.nodeAfter;if(f||g){let x=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(x){let v=x.getBoundingClientRect(),b=f?v.bottom:v.top;f&&g&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*a;r={left:v.left,right:v.right,top:b-k,bottom:b+k}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*i;r={left:f.left-g,right:f.left+g,top:f.top,bottom:f.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.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 d,h;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let f=u.getBoundingClientRect(),g=f.width/u.offsetWidth,x=f.height/u.offsetHeight;d=f.left-u.scrollLeft*g,h=f.top-u.scrollTop*x}this.element.style.left=(r.left-d)/i+"px",this.element.style.top=(r.top-h)/a+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){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,s=typeof o=="function"?o(this.editorView,n,e):o;if(!n||s)return null;let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=x4(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}return i}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ot extends Ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ot.valid(r)?new Ot(r):Ue.near(r)}content(){return ve.empty}eq(e){return e instanceof Ot&&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 Ot(e.resolve(n.pos))}getBookmark(){return new fv(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!mq(e)||!gq(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&&Ot.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(n>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let u=e.doc.resolve(o);if(Ot.valid(u))return u}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Ie.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let a=e.doc.resolve(o);if(Ot.valid(a))return a}return null}}}Ot.prototype.visible=!1;Ot.findFrom=Ot.findGapCursorFrom;Ue.jsonID("gapcursor",Ot);class fv{constructor(e){this.pos=e}map(e){return new fv(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ot.valid(n)?new Ot(n):Ue.near(n)}}function LT(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function mq(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||LT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function gq(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||LT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function yq(){return new St({props:{decorations:kq,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ot.valid(n)?new Ot(n):null},handleClick:vq,handleKeyDown:xq,handleDOMEvents:{beforeinput:bq}}})}const xq=w6({ArrowLeft:zf("horiz",-1),ArrowRight:zf("horiz",1),ArrowUp:zf("vert",-1),ArrowDown:zf("vert",1)});function zf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,u=i.empty;if(i instanceof ze){if(!s.endOfTextblock(n)||a.depth==0)return!1;u=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=Ot.findGapCursorFrom(a,e,u);return d?(o&&o(r.tr.setSelection(new Ot(d))),!0):!1}}function vq(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ot.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Ie.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ot(r))),!0)}function bq(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ot))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=oe.empty;for(let i=r.length-1;i>=0;i--)o=oe.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new ve(o,0,0));return s.setSelection(ze.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function kq(t){if(!(t.selection instanceof Ot))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xt.create(t.doc,[Fn.widget(t.selection.head,e,{key:"gapcursor"})])}var tp=200,pn=function(){};pn.prototype.append=function(e){return e.length?(e=pn.from(e),!this.length&&e||e.length<tp&&this.leafAppend(e)||this.length<tp&&e.leafPrepend(this)||this.appendInner(e)):this};pn.prototype.prepend=function(e){return e.length?pn.from(e).append(this):this};pn.prototype.appendInner=function(e){return new wq(this,e)};pn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?pn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};pn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pn.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)};pn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,i){return o.push(e(s,i))},n,r),o};pn.from=function(e){return e instanceof pn?e:e&&e.length?new zT(e):pn.empty};var zT=(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,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,i,a){for(var u=s;u<i;u++)if(o(this.values[u],a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,a){for(var u=s-1;u>=i;u--)if(o(this.values[u],a+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=tp)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=tp)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})(pn);pn.empty=new zT([]);var wq=(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,s,i){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(s,a),i)===!1||s>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,s)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(s,a)-a,i+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(o,a),s,i)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},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})(pn);const Cq=500;class qr{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,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,u,d=[],h=[];return this.items.forEach((f,g)=>{if(!f.step){o||(o=this.remapping(r,g+1),s=o.maps.length),s--,h.push(f);return}if(o){h.push(new yo(f.map));let x=f.step.map(o.slice(s)),v;x&&i.maybeStep(x).doc&&(v=i.mapping.maps[i.mapping.maps.length-1],d.push(new yo(v,void 0,void 0,d.length+h.length))),s--,v&&o.appendMap(v,s)}else i.maybeStep(f.step);if(f.selection)return a=o?f.selection.map(o.slice(s)):f.selection,u=new qr(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:i,selection:a}}addTransform(e,n,r,o){let s=[],i=this.eventCount,a=this.items,u=!o&&a.length?a.get(a.length-1):null;for(let h=0;h<e.steps.length;h++){let f=e.steps[h].invert(e.docs[h]),g=new yo(e.mapping.maps[h],f,n),x;(x=u&&u.merge(g))&&(g=x,h?s.pop():a=a.slice(0,a.length-1)),s.push(g),n&&(i++,n=void 0),o||(u=g)}let d=i-r.depth;return d>Eq&&(a=Sq(a,d),i-=d),new qr(a.append(s),i)}remapping(e,n){let r=new fc;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new qr(this.items.append(e.map(n=>new yo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(g=>{g.selection&&a--},o);let u=n;this.items.forEach(g=>{let x=s.getMirror(--u);if(x==null)return;i=Math.min(i,x);let v=s.maps[x];if(g.step){let b=e.steps[x].invert(e.docs[x]),k=g.selection&&g.selection.map(s.slice(u+1,x));k&&a++,r.push(new yo(v,b,k))}else r.push(new yo(v))},o);let d=[];for(let g=n;g<i;g++)d.push(new yo(s.maps[g]));let h=this.items.slice(0,o).append(d).append(r),f=new qr(h,a);return f.emptyItemCount()>Cq&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let u=i.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=i.selection&&i.selection.map(n.slice(r));h&&s++;let f=new yo(d.invert(),u,h),g,x=o.length-1;(g=o.length&&o[x].merge(f))?o[x]=g:o.push(f)}}else i.map&&r--},this.items.length,0),new qr(pn.from(o.reverse()),s)}}qr.empty=new qr(pn.empty,0);function Sq(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class yo{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 yo(n.getMap().invert(),n,this.selection)}}}class Us{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const Eq=20;function _q(t,e,n,r){let o=n.getMeta(Xi),s;if(o)return o.historyState;n.getMeta(Aq)&&(t=new Us(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(Xi))return i.getMeta(Xi).redo?new Us(t.done.addTransform(n,void 0,r,eh(e)),t.undone,nS(n.mapping.maps),t.prevTime,t.prevComposition):new Us(t.done,t.undone.addTransform(n,void 0,r,eh(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),u=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Tq(n,t.prevRanges)),d=i?qg(t.prevRanges,n.mapping):nS(n.mapping.maps);return new Us(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,eh(e)),qr.empty,d,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Us(t.done.rebased(n,s),t.undone.rebased(n,s),qg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Us(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),qg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Tq(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function nS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,i)=>e.push(s,i));return e}function qg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function Nq(t,e,n){let r=eh(e),o=Xi.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new Us(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(i).setMeta(Xi,{redo:n,historyState:u})}let Kg=!1,rS=null;function eh(t){let e=t.plugins;if(rS!=e){Kg=!1,rS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Kg=!0;break}}return Kg}const Xi=new Wt("history"),Aq=new Wt("closeHistory");function Mq(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new St({key:Xi,state:{init(){return new Us(qr.empty,qr.empty,null,0,-1)},apply(e,n,r){return _q(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?$T:r=="historyRedo"?BT:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function FT(t,e){return(n,r)=>{let o=Xi.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=Nq(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const $T=FT(!1,!0),BT=FT(!0,!0);Et.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new St({key:new Wt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit,s=this.options.autoTrim;if(o==null||o===0||s===!1){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>o){const a=i-o,u=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(u,d);return t=!0,h}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,u=s-r,d=a-u,h=a;return e.deleteRange(d,h),!(this.storage.characters({node:e.doc})>r)}})]}});var Dq=Et.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hq(this.options)]}});Et.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new St({key:new Wt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return xt.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((u,d)=>{if(u.isText)return;if(!(o>=d&&o<=d+u.nodeSize-1))return!1;i+=1});let a=0;return t.descendants((u,d)=>{if(u.isText||!(o>=d&&o<=d+u.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(Fn.node(d,d+u.nodeSize,{class:this.options.className}))}),xt.create(t,s)}}})]}});var Rq=Et.create({name:"gapCursor",addProseMirrorPlugins(){return[yq()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=lt(De(t,"allowGapCursor",n)))!=null?e:null}}}),VT="placeholder",oS=new Wt("tiptap__placeholder");function HT(t){const{editor:e,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:i,hasAnchor:a,classes:{emptyNode:u,emptyEditor:d}}=t,h=[u];return i&&h.push(d),Fn.node(o,o+s.nodeSize,{class:h.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:o,hasAnchor:a}):n})}function UT(t,e){return typeof t=="function"?t(e):t}function WT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:s,to:i}){const{anchor:a}=o,u=[],d=t.isEmpty;return r.nodesBetween(s,i,(h,f)=>{const g=a>=f&&a<=f+h.nodeSize,x=!h.isLeaf&&Zc(h);return h.type.isTextblock&&(g||!e.showOnlyCurrent)&&x&&u.push(HT({editor:t,isEmptyDoc:d,dataAttribute:n,hasAnchor:g,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:UT(e.emptyNodeClass,{editor:t,node:h,pos:f,hasAnchor:g})},node:h,pos:f})),e.includeChildren}),u}function qT({editor:t,options:e,dataAttribute:n,doc:r,selection:o}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=o,a=[],u=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const h=r.resolve(i),f=h.depth>0?h.node(1):h.nodeAfter,g=h.depth>0?h.before(1):i;if(f&&f.type.isTextblock&&Zc(f)){const x=i>=g&&i<=g+f.nodeSize;a.push(HT({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:x,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:UT(e.emptyNodeClass,{editor:t,node:f,pos:g,hasAnchor:x})},node:f,pos:g}))}}else a.push(...WT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return xt.create(r,a)}function Bu(t,e){var n;const r=t.resolve(e);if(r.depth===0){const i=(n=r.nodeAfter)!=null?n:r.nodeBefore;if(!i)return{from:e,to:e};const a=r.nodeAfter?e:e-i.nodeSize;return{from:a,to:a+i.nodeSize}}const o=r.before(1),s=r.node(1);return{from:o,to:o+s.nodeSize}}function Vu(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function Oq(t,e,n){const r=[];return t.forEach((o,s)=>{const i=s,a=i+o.nodeSize,u=i+1,d=a+1;u<n&&d>e&&r.push({from:i,to:a})}),r}function jq(t){if(t.length===0)return[];const e=[...t].sort((r,o)=>r.from-o.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){const o=n[n.length-1],s=e[r];s.from<=o.to?o.to=Math.max(o.to,s.to):n.push({...s})}return n}function Iq(t,e){const n=Oq(t,e.from,e.to);return n.push(Vu(t,Bu(t,e.from))),e.to>e.from?n.push(Vu(t,Bu(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(Vu(t,Bu(t,Math.min(e.from+1,t.content.size)))),n}function Pq(t,e,n){const r=[];if(t.docChanged){const o=Kx(t);for(const s of o)r.push(...Iq(n.doc,s.newRange))}return t.selectionSet&&(r.push(Vu(n.doc,Bu(n.doc,t.mapping.map(e.selection.anchor)))),r.push(Vu(n.doc,Bu(n.doc,n.selection.anchor)))),jq(r)}function Lq(t,e,n){const r=Math.max(0,Math.min(t,n.content.size)),o=Math.max(r,Math.min(e,n.content.size));return{from:r,to:o}}function zq({decorations:t,ranges:e,editor:n,options:r,dataAttribute:o,doc:s,selection:i}){let a=t;for(const u of e){const{from:d,to:h}=Lq(u.from,u.to,s),f=a.find(d,h).filter(x=>x.from>=d&&x.to<=h);f.length&&(a=a.remove(f));const g=WT({editor:n,options:r,dataAttribute:o,doc:s,selection:i,from:d,to:h});g.length&&(a=a.add(s,g))}return a}function Fq({editor:t,options:e,dataAttribute:n}){return{init(r,o){const s=qT({editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection});return s??xt.empty},apply(r,o,s,i){if(!r.docChanged&&!r.selectionSet)return o;const a=o.map(r.mapping,r.doc),u=Pq(r,s,i);return zq({decorations:a,ranges:u,editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection})}}}function $q(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function Bq({editor:t,options:e}){const n=e.dataAttribute?`data-${$q(e.dataAttribute)}`:`data-${VT}`,r=e.showOnlyCurrent&&!e.includeChildren;return new St({key:oS,...r?{}:{state:Fq({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:o,selection:s})=>qT({editor:t,options:e,dataAttribute:n,doc:o,selection:s}):o=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?xt.empty:(s=oS.getState(o))!=null?s:xt.empty}}})}Et.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:VT,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Bq({editor:this.editor,options:this.options})]}});function Ay(t,e){return!t.selection.empty&&!z6(t.selection)&&e.isEditable}function Vq(t,e){return Ay(t,e)&&!e.isFocused&&!e.view.dragging}function Hq(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function Uq(t){t.focus()}Et.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new St({key:new Wt("selection"),props:{decorations(n){return Vq(n,t)?xt.create(n.doc,[Fn.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return Ay(n.state,t)&&Hq(),!1},focus(n){return Ay(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&Uq(n)}),!1}}}})]}});var Wq="skipTrailingNode";function sS({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var qq=Et.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Wt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new St({key:e,appendTransaction:(o,s,i)=>{const{doc:a,tr:u,schema:d}=i,h=e.getState(i),f=a.content.size,g=d.nodes[n];if(!o.some(x=>x.getMeta(Wq))&&h)return u.insert(f,g.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!sS({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!sS({node:i,types:r})}}})]}}),Kq=Et.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>$T(t,e),redo:()=>({state:t,dispatch:e})=>BT(t,e)}},addProseMirrorPlugins(){return[Mq(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Gq=Et.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(jU.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(AU.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(ET.configure(this.options.bulletList)),this.options.code!==!1&&o.push(LU.configure(this.options.code)),this.options.codeBlock!==!1&&o.push($U.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(BU.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(Dq.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(Rq.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(VU.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(HU.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(Kq.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(UU.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(JU.configure(this.options.italic)),this.options.listItem!==!1&&o.push(MT.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(jT.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(TW.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(PT.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(aq.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(cq.configure(this.options.strike)),this.options.text!==!1&&o.push(dq.configure(this.options.text)),this.options.underline!==!1&&o.push(fq.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(qq.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),Jq=Gq;const iS={};function Zq(t){let e=iS[t];if(e)return e;e=iS[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function vl(t,e){typeof e!="string"&&(e=vl.defaultChars);const n=Zq(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const d=a<<6&1984|u&63;d<128?o+="��":o+=String.fromCharCode(d),s+=3;continue}}if((a&240)===224&&s+6<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16);if((u&192)===128&&(d&192)===128){const h=a<<12&61440|u<<6&4032|d&63;h<2048||h>=55296&&h<=57343?o+="���":o+=String.fromCharCode(h),s+=6;continue}}if((a&248)===240&&s+9<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16),h=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(d&192)===128&&(h&192)===128){let f=a<<18&1835008|u<<12&258048|d<<6&4032|h&63;f<65536||f>1114111?o+="����":(f-=65536,o+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}o+="�"}return o})}vl.defaultChars=";/?:@&=+$,#";vl.componentChars="";const aS={};function Yq(t){let e=aS[t];if(e)return e;e=aS[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Xc(t,e,n){typeof e!="string"&&(n=e,e=Xc.defaultChars),typeof n>"u"&&(n=!0);const r=Yq(e);let o="";for(let s=0,i=t.length;s<i;s++){const a=t.charCodeAt(s);if(n&&a===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){o+=t.slice(s,s+3),s+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<i){const u=t.charCodeAt(s+1);if(u>=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}Xc.defaultChars=";/?:@&=+$,-_.!~*'()#";Xc.componentChars="-_.!~*'()";function hv(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function np(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Xq=/^([a-z0-9.+-]+:)/i,Qq=/:[0-9]*$/,eK=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,tK=["<",">",'"',"`"," ","\r",`
631
+ `," "],nK=["{","}","|","\\","^","`"].concat(tK),rK=["'"].concat(nK),lS=["%","/","?",";","#"].concat(rK),uS=["/","?","#"],oK=255,cS=/^[+a-z0-9A-Z_-]{0,63}$/,sK=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dS={javascript:!0,"javascript:":!0},fS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function pv(t,e){if(t&&t instanceof np)return t;const n=new np;return n.parse(t,e),n}np.prototype.parse=function(t,e){let n,r,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const d=eK.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=Xq.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(e||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&dS[i])&&(s=s.substr(2),this.slashes=!0)),!dS[i]&&(o||i&&!fS[i])){let d=-1;for(let v=0;v<uS.length;v++)r=s.indexOf(uS[v]),r!==-1&&(d===-1||r<d)&&(d=r);let h,f;d===-1?f=s.lastIndexOf("@"):f=s.lastIndexOf("@",d),f!==-1&&(h=s.slice(0,f),s=s.slice(f+1),this.auth=h),d=-1;for(let v=0;v<lS.length;v++)r=s.indexOf(lS[v]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=s.length),s[d-1]===":"&&d--;const g=s.slice(0,d);s=s.slice(d),this.parseHost(g),this.hostname=this.hostname||"";const x=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!x){const v=this.hostname.split(/\./);for(let b=0,k=v.length;b<k;b++){const E=v[b];if(E&&!E.match(cS)){let _="";for(let T=0,A=E.length;T<A;T++)E.charCodeAt(T)>127?_+="x":_+=E[T];if(!_.match(cS)){const T=v.slice(0,b),A=v.slice(b+1),D=E.match(sK);D&&(T.push(D[1]),A.unshift(D[2])),A.length&&(s=A.join(".")+s),this.hostname=T.join(".");break}}}}this.hostname.length>oK&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),fS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};np.prototype.parseHost=function(t){let e=Qq.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const iK=Object.freeze(Object.defineProperty({__proto__:null,decode:vl,encode:Xc,format:hv,parse:pv},Symbol.toStringTag,{value:"Module"})),KT=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,GT=/[\0-\x1F\x7F-\x9F]/,aK=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,mv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,JT=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ZT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,lK=Object.freeze(Object.defineProperty({__proto__:null,Any:KT,Cc:GT,Cf:aK,P:mv,S:JT,Z:ZT},Symbol.toStringTag,{value:"Module"})),uK=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),cK=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Gg;const dK=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fK=(Gg=String.fromCodePoint)!==null&&Gg!==void 0?Gg:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function hK(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=dK.get(t))!==null&&e!==void 0?e:t}var fn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(fn||(fn={}));const pK=32;var Xs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Xs||(Xs={}));function My(t){return t>=fn.ZERO&&t<=fn.NINE}function mK(t){return t>=fn.UPPER_A&&t<=fn.UPPER_F||t>=fn.LOWER_A&&t<=fn.LOWER_F}function gK(t){return t>=fn.UPPER_A&&t<=fn.UPPER_Z||t>=fn.LOWER_A&&t<=fn.LOWER_Z||My(t)}function yK(t){return t===fn.EQUALS||gK(t)}var ln;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(ln||(ln={}));var Xo;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Xo||(Xo={}));class xK{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=ln.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Xo.Strict}startEntity(e){this.decodeMode=e,this.state=ln.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case ln.EntityStart:return e.charCodeAt(n)===fn.NUM?(this.state=ln.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=ln.NamedEntity,this.stateNamedEntity(e,n));case ln.NumericStart:return this.stateNumericStart(e,n);case ln.NumericDecimal:return this.stateNumericDecimal(e,n);case ln.NumericHex:return this.stateNumericHex(e,n);case ln.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|pK)===fn.LOWER_X?(this.state=ln.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=ln.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(My(o)||mK(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(My(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===fn.SEMI)this.consumed+=1;else if(this.decodeMode===Xo.Strict)return 0;return this.emitCodePoint(hK(this.result),this.consumed),this.errors&&(e!==fn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&Xs.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=vK(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Xo.Attribute&&(s===0||yK(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&Xs.VALUE_LENGTH)>>14,s!==0){if(i===fn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Xo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&Xs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~Xs.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case ln.NamedEntity:return this.result!==0&&(this.decodeMode!==Xo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ln.NumericDecimal:return this.emitNumericEntity(0,2);case ln.NumericHex:return this.emitNumericEntity(0,3);case ln.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ln.EntityStart:return 0}}}function YT(t){let e="";const n=new xK(t,r=>e+=fK(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){e+=o.slice(i,a),n.startEntity(s);const d=n.write(o,a+1);if(d<0){i=a+n.end();break}i=a+d,a=d===0?i+1:i}const u=e+o.slice(i);return e="",u}}function vK(t,e,n,r){const o=(e&Xs.BRANCH_LENGTH)>>7,s=e&Xs.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let i=n,a=i+o-1;for(;i<=a;){const u=i+a>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)a=u-1;else return t[u+o]}return-1}const XT=YT(uK);YT(cK);function bK(t,e=Xo.Legacy){return XT(t,e)}function kK(t){return XT(t,Xo.Strict)}function wK(t){return Object.prototype.toString.call(t)}function gv(t){return wK(t)==="[object String]"}const CK=Object.prototype.hasOwnProperty;function SK(t,e){return CK.call(t,e)}function Xp(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function QT(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function yv(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function bc(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const eN=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,EK=/&([a-z#][a-z0-9]{1,31});/gi,_K=new RegExp(eN.source+"|"+EK.source,"gi"),TK=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function NK(t,e){if(e.charCodeAt(0)===35&&TK.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return yv(r)?bc(r):t}const n=bK(t);return n!==t?n:t}function AK(t){return t.indexOf("\\")<0?t:t.replace(eN,"$1")}function bl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(_K,function(e,n,r){return n||NK(e,r)})}const MK=/[&<>"]/,DK=/[&<>"]/g,RK={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function OK(t){return RK[t]}function pi(t){return MK.test(t)?t.replace(DK,OK):t}const jK=/[.?*+^$[\]\\(){}|-]/g;function IK(t){return t.replace(jK,"\\$&")}function vt(t){switch(t){case 9:case 32:return!0}return!1}function kc(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function tN(t){return mv.test(t)||JT.test(t)}function wc(t){return tN(bc(t))}function Cc(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Qp(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function hS(t){return t===32||t===9||t===10||t===13}function em(t){let e=0;for(;e<t.length&&hS(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&hS(t.charCodeAt(n));n--);return t.slice(e,n+1)}const PK={mdurl:iK,ucmicro:lK},LK=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:QT,asciiTrim:em,assign:Xp,escapeHtml:pi,escapeRE:IK,fromCodePoint:bc,has:SK,isMdAsciiPunct:Cc,isPunctChar:tN,isPunctCharCode:wc,isSpace:vt,isString:gv,isValidEntityCode:yv,isWhiteSpace:kc,lib:PK,normalizeReference:Qp,unescapeAll:bl,unescapeMd:AK},Symbol.toStringTag,{value:"Module"}));function zK(t,e,n){let r,o,s,i;const a=t.posMax,u=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){o=!0;break}if(i=t.pos,t.md.inline.skipToken(t),s===91){if(i===t.pos-1)r++;else if(n)return t.pos=u,-1}}let d=-1;return o&&(d=t.pos),t.pos=u,d}function FK(t,e,n){let r,o=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(o)===60){for(o++;o<n;){if(r=t.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=bl(t.slice(e+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=t.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(t.charCodeAt(o+1)===32)break;o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return e===o||i!==0||(s.str=bl(t.slice(e,o)),s.pos=o,s.ok=!0),s}function $K(t,e,n,r){let o,s=e;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;e++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=t.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=bl(t.slice(e,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=bl(t.slice(e,s)),i}const BK=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:FK,parseLinkLabel:zK,parseLinkTitle:$K},Symbol.toStringTag,{value:"Module"})),Mo={};Mo.code_inline=function(t,e,n,r,o){const s=t[e];return"<code"+o.renderAttrs(s)+">"+pi(s.content)+"</code>"};Mo.code_block=function(t,e,n,r,o){const s=t[e];return"<pre"+o.renderAttrs(s)+"><code>"+pi(t[e].content)+`</code></pre>
632
+ `};Mo.fence=function(t,e,n,r,o){const s=t[e],i=s.info?bl(s.info).trim():"";let a="",u="";if(i){const h=i.split(/(\s+)/g);a=h[0],u=h.slice(2).join("")}let d;if(n.highlight?d=n.highlight(s.content,a,u)||pi(s.content):d=pi(s.content),d.indexOf("<pre")===0)return d+`
633
+ `;if(i){const h=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[];h<0?f.push(["class",n.langPrefix+a]):(f[h]=f[h].slice(),f[h][1]+=" "+n.langPrefix+a);const g={attrs:f};return`<pre><code${o.renderAttrs(g)}>${d}</code></pre>
634
+ `}return`<pre><code${o.renderAttrs(s)}>${d}</code></pre>
635
+ `};Mo.image=function(t,e,n,r,o){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,n,r),o.renderToken(t,e,n)};Mo.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
636
+ `:`<br>
637
+ `};Mo.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
638
+ `:`<br>
639
+ `:`
640
+ `};Mo.text=function(t,e){return pi(t[e].content)};Mo.html_block=function(t,e){return t[e].content};Mo.html_inline=function(t,e){return t[e].content};function Al(){this.rules=Xp({},Mo)}Al.prototype.renderAttrs=function(e){let n,r,o;if(!e.attrs)return"";for(o="",n=0,r=e.attrs.length;n<r;n++)o+=" "+pi(e.attrs[n][0])+'="'+pi(e.attrs[n][1])+'"';return o};Al.prototype.renderToken=function(e,n,r){const o=e[n];let s="";if(o.hidden)return"";o.block&&o.nesting!==-1&&n&&e[n-1].hidden&&(s+=`
641
+ `),s+=(o.nesting===-1?"</":"<")+o.tag,s+=this.renderAttrs(o),o.nesting===0&&r.xhtmlOut&&(s+=" /");let i=!1;if(o.block&&(i=!0,o.nesting===1&&n+1<e.length)){const a=e[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===o.tag)&&(i=!1)}return s+=i?`>
642
+ `:">",s};Al.prototype.renderInline=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const a=t[s].type;typeof o[a]<"u"?r+=o[a](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};Al.prototype.renderInlineAsText=function(t,e,n){let r="";for(let o=0,s=t.length;o<s;o++)switch(t[o].type){case"text":r+=t[o].content;break;case"image":r+=this.renderInlineAsText(t[o].children,e,n);break;case"html_inline":case"html_block":r+=t[o].content;break;case"softbreak":case"hardbreak":r+=`
643
+ `;break}return r};Al.prototype.render=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const a=t[s].type;a==="inline"?r+=this.renderInline(t[s].children,e,n):typeof o[a]<"u"?r+=o[a](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function or(){this.__rules__=[],this.__cache__=null}or.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};or.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};or.prototype.at=function(t,e,n){const r=this.__find__(t),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=o.alt||[],this.__cache__=null};or.prototype.before=function(t,e,n,r){const o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};or.prototype.after=function(t,e,n,r){const o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};or.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};or.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,n.push(r)},this),this.__cache__=null,n};or.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};or.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,n.push(r)},this),this.__cache__=null,n};or.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function no(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}no.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,o=n.length;r<o;r++)if(n[r][0]===e)return r;return-1};no.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};no.prototype.attrSet=function(e,n){const r=this.attrIndex(e),o=[e,n];r<0?this.attrPush(o):this.attrs[r]=o};no.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};no.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function nN(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}nN.prototype.Token=no;const VK=/\r\n?|\n/g,HK=/\0/g;function UK(t){let e;e=t.src.replace(VK,`
644
+ `),e=e.replace(HK,"�"),t.src=e}function WK(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function qK(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const o=e[n];o.type==="inline"&&t.md.inline.parse(o.content,t.md,t.env,o.children)}}function KK(t){return/^<a[>\s]/i.test(t)}function GK(t){return/^<\/a\s*>/i.test(t)}function JK(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let o=e[n].children,s=0;for(let i=o.length-1;i>=0;i--){const a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(KK(a.content)&&s>0&&s--,GK(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const u=a.content;let d=t.md.linkify.match(u);const h=[];let f=a.level,g=0;d.length>0&&d[0].index===0&&i>0&&o[i-1].type==="text_special"&&(d=d.slice(1));for(let x=0;x<d.length;x++){const v=d[x].url,b=t.md.normalizeLink(v);if(!t.md.validateLink(b))continue;let k=d[x].text;d[x].schema?d[x].schema==="mailto:"&&!/^mailto:/i.test(k)?k=t.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):k=t.md.normalizeLinkText(k):k=t.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,"");const E=d[x].index;if(E>g){const D=new t.Token("text","",0);D.content=u.slice(g,E),D.level=f,h.push(D)}const _=new t.Token("link_open","a",1);_.attrs=[["href",b]],_.level=f++,_.markup="linkify",_.info="auto",h.push(_);const T=new t.Token("text","",0);T.content=k,T.level=f,h.push(T);const A=new t.Token("link_close","a",-1);A.level=--f,A.markup="linkify",A.info="auto",h.push(A),g=d[x].lastIndex}if(g<u.length){const x=new t.Token("text","",0);x.content=u.slice(g),x.level=f,h.push(x)}e[n].children=o=QT(o,i,h)}}}}const rN=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ZK=/\((c|tm|r)\)/i,YK=/\((c|tm|r)\)/ig,XK={c:"©",r:"®",tm:"™"};function QK(t,e){return XK[e.toLowerCase()]}function eG(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(YK,QK)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function tG(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&rN.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function nG(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(ZK.test(t.tokens[e].content)&&eG(t.tokens[e].children),rN.test(t.tokens[e].content)&&tG(t.tokens[e].children))}const rG=/['"]/,pS=/['"]/g,mS="’";function Ff(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function oG(t,e){let n="",r=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o<e.length;o++){const s=e[o];n+=t.slice(r,s.pos)+s.ch,r=s.pos+1}return n+t.slice(r)}function sG(t,e){let n;const r=[],o={};for(let s=0;s<t.length;s++){const i=t[s],a=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const u=i.content;let d=0;const h=u.length;e:for(;d<h;){pS.lastIndex=d;const f=pS.exec(u);if(!f)break;let g=!0,x=!0;d=f.index+1;const v=f[0]==="'";let b=32;if(f.index-1>=0)b=u.charCodeAt(f.index-1);else for(n=s-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){b=t[n].content.charCodeAt(t[n].content.length-1);break}let k=32;if(d<h)k=u.charCodeAt(d);else for(n=s+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){k=t[n].content.charCodeAt(0);break}const E=Cc(b)||wc(b),_=Cc(k)||wc(k),T=kc(b),A=kc(k);if(A?g=!1:_&&(T||E||(g=!1)),T?x=!1:E&&(A||_||(x=!1)),k===34&&f[0]==='"'&&b>=48&&b<=57&&(x=g=!1),g&&x&&(g=E,x=_),!g&&!x){v&&Ff(o,s,f.index,mS);continue}if(x)for(n=r.length-1;n>=0;n--){let D=r[n];if(r[n].level<a)break;if(D.single===v&&r[n].level===a){D=r[n];let R,O;v?(R=e.md.options.quotes[2],O=e.md.options.quotes[3]):(R=e.md.options.quotes[0],O=e.md.options.quotes[1]),Ff(o,s,f.index,O),Ff(o,D.token,D.pos,R),r.length=n;continue e}}g?r.push({token:s,pos:f.index,single:v,level:a}):x&&v&&Ff(o,s,f.index,mS)}}Object.keys(o).forEach(function(s){t[s].content=oG(t[s].content,o[s])})}function iG(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!rG.test(t.tokens[e].content)||sG(t.tokens[e].children,t)}function aG(t){let e,n;const r=t.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,a=i.length;for(e=0;e<a;e++)i[e].type==="text_special"&&(i[e].type="text");for(e=n=0;e<a;e++)i[e].type==="text"&&e+1<a&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}}const Jg=[["normalize",UK],["block",WK],["inline",qK],["linkify",JK],["replacements",nG],["smartquotes",iG],["text_join",aG]];function xv(){this.ruler=new or;for(let t=0;t<Jg.length;t++)this.ruler.push(Jg[t][0],Jg[t][1])}xv.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};xv.prototype.State=nN;function Do(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let s=0,i=0,a=0,u=0,d=o.length,h=!1;i<d;i++){const f=o.charCodeAt(i);if(!h)if(vt(f)){a++,f===9?u+=4-u%4:u++;continue}else h=!0;(f===10||i===d-1)&&(f!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),h=!1,a=0,u=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Do.prototype.push=function(t,e,n){const r=new no(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};Do.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Do.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Do.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!vt(r))break}return e};Do.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!vt(this.src.charCodeAt(--e)))return e+1;return e};Do.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};Do.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Do.prototype.getLines=function(e,n,r,o){if(e>=n)return"";const s=new Array(n-e);for(let i=0,a=e;a<n;a++,i++){let u=0;const d=this.bMarks[a];let h=d,f;for(a+1<n||o?f=this.eMarks[a]+1:f=this.eMarks[a];h<f&&u<r;){const g=this.src.charCodeAt(h);if(vt(g))g===9?u+=4-(u+this.bsCount[a])%4:u++;else if(h-d<this.tShift[a])u++;else break;h++}u>r?s[i]=new Array(u-r+1).join(" ")+this.src.slice(h,f):s[i]=this.src.slice(h,f)}return s.join("")};Do.prototype.Token=no;const lG=65536;function Zg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function gS(t){const e=[],n=t.length;let r=0,o=t.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=t.substring(i,r-1),i=r):(e.push(a+t.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=t.charCodeAt(r);return e.push(a+t.substring(i)),e}function uG(t,e,n,r){if(e+2>n)return!1;let o=e+1;if(t.sCount[o]<t.blkIndent||t.sCount[o]-t.blkIndent>=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;const i=t.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=t.eMarks[o])return!1;const a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!vt(a)||i===45&&vt(a))return!1;for(;s<t.eMarks[o];){const A=t.src.charCodeAt(s);if(A!==124&&A!==45&&A!==58&&!vt(A))return!1;s++}let u=Zg(t,e+1),d=u.split("|");const h=[];for(let A=0;A<d.length;A++){const D=d[A].trim();if(!D){if(A===0||A===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(D))return!1;D.charCodeAt(D.length-1)===58?h.push(D.charCodeAt(0)===58?"center":"right"):D.charCodeAt(0)===58?h.push("left"):h.push("")}if(u=Zg(t,e).trim(),u.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;d=gS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const f=d.length;if(f===0||f!==h.length)return!1;if(r)return!0;const g=t.parentType;t.parentType="table";const x=t.md.block.ruler.getRules("blockquote"),v=t.push("table_open","table",1),b=[e,0];v.map=b;const k=t.push("thead_open","thead",1);k.map=[e,e+1];const E=t.push("tr_open","tr",1);E.map=[e,e+1];for(let A=0;A<d.length;A++){const D=t.push("th_open","th",1);h[A]&&(D.attrs=[["style","text-align:"+h[A]]]);const R=t.push("inline","",0);R.content=d[A].trim(),R.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let _,T=0;for(o=e+2;o<n&&!(t.sCount[o]<t.blkIndent);o++){let A=!1;for(let R=0,O=x.length;R<O;R++)if(x[R](t,o,n,!0)){A=!0;break}if(A||(u=Zg(t,o).trim(),!u)||t.sCount[o]-t.blkIndent>=4||(d=gS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),T+=f-d.length,T>lG))break;if(o===e+2){const R=t.push("tbody_open","tbody",1);R.map=_=[e+2,0]}const D=t.push("tr_open","tr",1);D.map=[o,o+1];for(let R=0;R<f;R++){const O=t.push("td_open","td",1);h[R]&&(O.attrs=[["style","text-align:"+h[R]]]);const P=t.push("inline","",0);P.content=d[R]?d[R].trim():"",P.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return _&&(t.push("tbody_close","tbody",-1),_[1]=o),t.push("table_close","table",-1),b[1]=o,t.parentType=g,t.line=o,!0}function cG(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,o=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,o=r;continue}break}t.line=o;const s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+`
645
+ `,s.map=[e,t.line],!0}function dG(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;const i=t.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let a=o;o=t.skipChars(o,i);let u=o-a;if(u<3)return!1;const d=t.src.slice(a,o),h=t.src.slice(o,s);if(i===96&&h.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let f=e,g=!1;for(;f++,!(f>=n||(o=a=t.bMarks[f]+t.tShift[f],s=t.eMarks[f],o<s&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(o)===i&&!(t.sCount[f]-t.blkIndent>=4)&&(o=t.skipChars(o,i),!(o-a<u)&&(o=t.skipSpaces(o),!(o<s)))){g=!0;break}u=t.sCount[e],t.line=f+(g?1:0);const x=t.push("fence","code",0);return x.info=h,x.content=t.getLines(e+1,f,u,!0),x.markup=d,x.map=[e,t.line],!0}function fG(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const i=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],u=[],d=[],h=[],f=t.md.block.ruler.getRules("blockquote"),g=t.parentType;t.parentType="blockquote";let x=!1,v;for(v=e;v<n;v++){const T=t.sCount[v]<t.blkIndent;if(o=t.bMarks[v]+t.tShift[v],s=t.eMarks[v],o>=s)break;if(t.src.charCodeAt(o++)===62&&!T){let D=t.sCount[v]+1,R,O;t.src.charCodeAt(o)===32?(o++,D++,O=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[v]+D)%4===3?(o++,D++,O=!1):O=!0):R=!1;let P=D;for(a.push(t.bMarks[v]),t.bMarks[v]=o;o<s;){const j=t.src.charCodeAt(o);if(vt(j))j===9?P+=4-(P+t.bsCount[v]+(O?1:0))%4:P++;else break;o++}x=o>=s,u.push(t.bsCount[v]),t.bsCount[v]=t.sCount[v]+1+(R?1:0),d.push(t.sCount[v]),t.sCount[v]=P-D,h.push(t.tShift[v]),t.tShift[v]=o-t.bMarks[v];continue}if(x)break;let A=!1;for(let D=0,R=f.length;D<R;D++)if(f[D](t,v,n,!0)){A=!0;break}if(A){t.lineMax=v,t.blkIndent!==0&&(a.push(t.bMarks[v]),u.push(t.bsCount[v]),h.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]-=t.blkIndent);break}a.push(t.bMarks[v]),u.push(t.bsCount[v]),h.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]=-1}const b=t.blkIndent;t.blkIndent=0;const k=t.push("blockquote_open","blockquote",1);k.markup=">";const E=[e,0];k.map=E,t.md.block.tokenize(t,e,v);const _=t.push("blockquote_close","blockquote",-1);_.markup=">",t.lineMax=i,t.parentType=g,E[1]=t.line;for(let T=0;T<h.length;T++)t.bMarks[T+e]=a[T],t.tShift[T+e]=h[T],t.sCount[T+e]=d[T],t.bsCount[T+e]=u[T];return t.blkIndent=b,!0}function hG(t,e,n,r){const o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let a=1;for(;s<o;){const d=t.src.charCodeAt(s++);if(d!==i&&!vt(d))return!1;d===i&&a++}if(a<3)return!1;if(r)return!0;t.line=e+1;const u=t.push("hr","hr",0);return u.map=[e,t.line],u.markup=Array(a+1).join(String.fromCharCode(i)),!0}function yS(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==43)return-1;if(r<n){const s=t.src.charCodeAt(r);if(!vt(s))return-1}return r}function xS(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let o=n;if(o+1>=r)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=t.src.charCodeAt(o),!vt(s))?-1:o}function pG(t,e){const n=t.level+2;for(let r=e+2,o=t.tokens.length-2;r<o;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function mG(t,e,n,r){let o,s,i,a,u=e,d=!0;if(t.sCount[u]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]<t.blkIndent)return!1;let h=!1;r&&t.parentType==="paragraph"&&t.sCount[u]>=t.blkIndent&&(h=!0);let f,g,x;if((x=xS(t,u))>=0){if(f=!0,i=t.bMarks[u]+t.tShift[u],g=Number(t.src.slice(i,x-1)),h&&g!==1)return!1}else if((x=yS(t,u))>=0)f=!1;else return!1;if(h&&t.skipSpaces(x)>=t.eMarks[u])return!1;if(r)return!0;const v=t.src.charCodeAt(x-1),b=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),g!==1&&(a.attrs=[["start",g]])):a=t.push("bullet_list_open","ul",1);const k=[u,0];a.map=k,a.markup=String.fromCharCode(v);let E=!1;const _=t.md.block.ruler.getRules("list"),T=t.parentType;for(t.parentType="list";u<n;){s=x,o=t.eMarks[u];const A=t.sCount[u]+x-(t.bMarks[u]+t.tShift[u]);let D=A;for(;s<o;){const ee=t.src.charCodeAt(s);if(ee===9)D+=4-(D+t.bsCount[u])%4;else if(ee===32)D++;else break;s++}const R=s;let O;R>=o?O=1:O=D-A,O>4&&(O=1);const P=A+O;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(v);const j=[u,0];a.map=j,f&&(a.info=t.src.slice(i,x-1));const W=t.tight,Z=t.tShift[u],J=t.sCount[u],K=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=D,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,u,n,!0),(!t.tight||E)&&(d=!1),E=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=K,t.tShift[u]=Z,t.sCount[u]=J,t.tight=W,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(v),u=t.line,j[1]=u,u>=n||t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)break;let Y=!1;for(let ee=0,G=_.length;ee<G;ee++)if(_[ee](t,u,n,!0)){Y=!0;break}if(Y)break;if(f){if(x=xS(t,u),x<0)break;i=t.bMarks[u]+t.tShift[u]}else if(x=yS(t,u),x<0)break;if(v!==t.src.charCodeAt(x-1))break}return f?a=t.push("ordered_list_close","ol",-1):a=t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(v),k[1]=u,t.line=u,t.parentType=T,d&&pG(t,b),!0}function gG(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],i=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(o)!==91)return!1;function a(_){const T=t.lineMax;if(_>=T||t.isEmpty(_))return null;let A=!1;if(t.sCount[_]-t.blkIndent>3&&(A=!0),t.sCount[_]<0&&(A=!0),!A){const O=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let j=!1;for(let W=0,Z=O.length;W<Z;W++)if(O[W](t,_,T,!0)){j=!0;break}if(t.parentType=P,j)return null}const D=t.bMarks[_]+t.tShift[_],R=t.eMarks[_];return t.src.slice(D,R+1)}let u=t.src.slice(o,s+1);s=u.length;let d=-1;for(o=1;o<s;o++){const _=u.charCodeAt(o);if(_===91)return!1;if(_===93){d=o;break}else if(_===10){const T=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(_===92&&(o++,o<s&&u.charCodeAt(o)===10)){const T=a(i);T!==null&&(u+=T,s=u.length,i++)}}if(d<0||u.charCodeAt(d+1)!==58)return!1;for(o=d+2;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(!vt(_))break}const h=t.md.helpers.parseLinkDestination(u,o,s);if(!h.ok)return!1;const f=t.md.normalizeLink(h.str);if(!t.md.validateLink(f))return!1;o=h.pos;const g=o,x=i,v=o;for(;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(!vt(_))break}let b=t.md.helpers.parseLinkTitle(u,o,s);for(;b.can_continue;){const _=a(i);if(_===null)break;u+=_,o=s,s=u.length,i++,b=t.md.helpers.parseLinkTitle(u,o,s,b)}let k;for(o<s&&v!==o&&b.ok?(k=b.str,o=b.pos):(k="",o=g,i=x);o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10&&k)for(k="",o=g,i=x;o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10)return!1;const E=Qp(u.slice(1,d));return E?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[E]>"u"&&(t.env.references[E]={title:k,href:f}),t.line=i),!0):!1}const yG=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xG="[a-zA-Z_:][a-zA-Z0-9:._-]*",vG="[^\"'=<>`\\x00-\\x20]+",bG="'[^']*'",kG='"[^"]*"',wG="(?:"+vG+"|"+bG+"|"+kG+")",CG="(?:\\s+"+xG+"(?:\\s*=\\s*"+wG+")?)",oN="<[A-Za-z][A-Za-z0-9\\-]*"+CG+"*\\s*\\/?>",sN="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",SG="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",EG="<[?][\\s\\S]*?[?]>",_G="<![A-Za-z][^>]*>",TG="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",NG=new RegExp("^(?:"+oN+"|"+sN+"|"+SG+"|"+EG+"|"+_G+"|"+TG+")"),AG=new RegExp("^(?:"+oN+"|"+sN+")"),Fi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+yG.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(AG.source+"\\s*$"),/^$/,!1]];function MG(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let i=t.src.slice(o,s),a=0;for(;a<Fi.length&&!Fi[a][0].test(i);a++);if(a===Fi.length)return!1;if(r)return Fi[a][2];let u=e+1;const d=Fi[a][1].test("");if(!Fi[a][1].test(i)){for(;u<n&&!(t.sCount[u]<t.blkIndent&&(d||!t.isEmpty(u)));u++)if(o=t.bMarks[u]+t.tShift[u],s=t.eMarks[u],i=t.src.slice(o,s),Fi[a][1].test(i)){i.length!==0&&u++;break}}t.line=u;const h=t.push("html_block","",0);return h.map=[e,u],h.content=t.getLines(e,u,t.blkIndent,!0),!0}function DG(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.src.charCodeAt(o);if(i!==35||o>=s)return!1;let a=1;for(i=t.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=t.src.charCodeAt(++o);if(a>6||o<s&&!vt(i))return!1;if(r)return!0;s=t.skipSpacesBack(s,o);const u=t.skipCharsBack(s,35,o);u>o&&vt(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;const d=t.push("heading_open","h"+String(a),1);d.markup="########".slice(0,a),d.map=[e,t.line];const h=t.push("inline","",0);h.content=em(t.src.slice(o,s)),h.map=[e,t.line],h.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function RG(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const o=t.parentType;t.parentType="paragraph";let s=0,i,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let x=t.bMarks[a]+t.tShift[a];const v=t.eMarks[a];if(x<v&&(i=t.src.charCodeAt(x),(i===45||i===61)&&(x=t.skipChars(x,i),x=t.skipSpaces(x),x>=v))){s=i===61?1:2;break}}if(t.sCount[a]<0)continue;let g=!1;for(let x=0,v=r.length;x<v;x++)if(r[x](t,a,n,!0)){g=!0;break}if(g)break}if(!s)return t.parentType=o,!1;const u=em(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const d=t.push("heading_open","h"+String(s),1);d.markup=String.fromCharCode(i),d.map=[e,t.line];const h=t.push("inline","",0);h.content=u,h.map=[e,t.line-1],h.children=[];const f=t.push("heading_close","h"+String(s),-1);return f.markup=String.fromCharCode(i),t.parentType=o,!0}function OG(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),o=t.parentType;let s=e+1;for(t.parentType="paragraph";s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let d=!1;for(let h=0,f=r.length;h<f;h++)if(r[h](t,s,n,!0)){d=!0;break}if(d)break}const i=em(t.getLines(e,s,t.blkIndent,!1));t.line=s;const a=t.push("paragraph_open","p",1);a.map=[e,t.line];const u=t.push("inline","",0);return u.content=i,u.map=[e,t.line],u.children=[],t.push("paragraph_close","p",-1),t.parentType=o,!0}const $f=[["table",uG,["paragraph","reference"]],["code",cG],["fence",dG,["paragraph","reference","blockquote","list"]],["blockquote",fG,["paragraph","reference","blockquote","list"]],["hr",hG,["paragraph","reference","blockquote","list"]],["list",mG,["paragraph","reference","blockquote"]],["reference",gG],["html_block",MG,["paragraph","reference","blockquote"]],["heading",DG,["paragraph","reference","blockquote"]],["lheading",RG],["paragraph",OG]];function tm(){this.ruler=new or;for(let t=0;t<$f.length;t++)this.ruler.push($f[t][0],$f[t][1],{alt:($f[t][2]||[]).slice()})}tm.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),o=r.length,s=t.md.options.maxNesting;let i=e,a=!1;for(;i<n&&(t.line=i=t.skipEmptyLines(i),!(i>=n||t.sCount[i]<t.blkIndent));){if(t.level>=s){t.line=n;break}const u=t.line;let d=!1;for(let h=0;h<o;h++)if(d=r[h](t,i,n,!1),d){if(u>=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),i=t.line,i<n&&t.isEmpty(i)&&(a=!0,i++,t.line=i)}};tm.prototype.parse=function(t,e,n,r){if(!t)return;const o=new this.State(t,e,n,r);this.tokenize(o,o.line,o.lineMax)};tm.prototype.State=Do;function Qc(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Qc.prototype.pushPending=function(){const t=new no("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Qc.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new no(t,e,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r};Qc.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t);let o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){const k=this.src.charCodeAt(t-2);o=(k&64512)===55296?65536+(k-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-t;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const k=this.src.charCodeAt(s+1);a=(k&64512)===56320?65536+(a-55296<<10)+(k-56320):65533}else(a&64512)===56320&&(a=65533);const u=Cc(o)||wc(o),d=Cc(a)||wc(a),h=kc(o),f=kc(a),g=!f&&(!d||h||u),x=!h&&(!u||f||d);return{can_open:g&&(e||!x||u),can_close:x&&(e||!g||d),length:i}};Qc.prototype.Token=no;function jG(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function IG(t,e){let n=t.pos;for(;n<t.posMax&&!jG(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const PG=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function LG(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const o=t.pending.match(PG);if(!o)return!1;const s=o[1],i=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let u=a.length;for(;u>0&&a.charCodeAt(u-1)===42;)u--;u!==a.length&&(a=a.slice(0,u));const d=t.md.normalizeLink(a);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const h=t.push("link_open","a",1);h.attrs=[["href",d]],h.markup="linkify",h.info="auto";const f=t.push("text","",0);f.content=t.md.normalizeLinkText(a);const g=t.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return t.pos+=a.length-s.length,!0}function zG(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,o=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<o&&vt(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const vv=[];for(let t=0;t<256;t++)vv.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){vv[t.charCodeAt(0)]=1});function FG(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=t.src.charCodeAt(n);if(o===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(o=t.src.charCodeAt(n),!!vt(o));)n++;return t.pos=n,!0}if(o===32){if(!e){const a=t.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return t.pos=n,!0}let s=t.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=t.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=t.src[n+1],n++)}const i="\\"+s;if(!e){const a=t.push("text_special","",0);o<256&&vv[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return t.pos=n+1,!0}function $G(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const o=n;n++;const s=t.posMax;for(;n<s&&t.src.charCodeAt(n)===96;)n++;const i=t.src.slice(o,n),a=i.length;if(t.backticksScanned&&(t.backticks[a]||0)<=o)return e||(t.pending+=i),t.pos+=a,!0;let u=n,d;for(;(d=t.src.indexOf("`",u))!==-1;){for(u=d+1;u<s&&t.src.charCodeAt(u)===96;)u++;const h=u-d;if(h===a){if(!e){const f=t.push("code_inline","code",0);f.markup=i,f.content=t.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=u,!0}t.backticks[h]=d}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=a,!0}function BG(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const o=t.scanDelims(t.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=t.push("text","",0),a.content=i,s--);for(let u=0;u<s;u+=2)a=t.push("text","",0),a.content=i+i,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0}function vS(t,e){let n;const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(i.marker!==126||i.end===-1)continue;const a=e[i.end];n=t.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[a.token-1].type==="text"&&t.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<t.tokens.length&&t.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=t.tokens[i],t.tokens[i]=t.tokens[s],t.tokens[s]=n)}}function VG(t){const e=t.tokens_meta,n=t.tokens_meta.length;vS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&vS(t,e[r].delimiters)}const iN={tokenize:BG,postProcess:VG};function HG(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const o=t.scanDelims(t.pos,r===42);for(let s=0;s<o.length;s++){const i=t.push("text","",0);i.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:o.length,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return t.pos+=o.length,!0}function bS(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const o=e[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=e[o.end],i=r>0&&e[r-1].end===o.end+1&&e[r-1].marker===o.marker&&e[r-1].token===o.token-1&&e[o.end+1].token===s.token+1,a=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=i?"strong_open":"em_open",u.tag=i?"strong":"em",u.nesting=1,u.markup=i?a+a:a,u.content="";const d=t.tokens[s.token];d.type=i?"strong_close":"em_close",d.tag=i?"strong":"em",d.nesting=-1,d.markup=i?a+a:a,d.content="",i&&(t.tokens[e[r-1].token].content="",t.tokens[e[o.end+1].token].content="",r--)}}function UG(t){const e=t.tokens_meta,n=t.tokens_meta.length;bS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&bS(t,e[r].delimiters)}const aN={tokenize:HG,postProcess:UG};function WG(t,e){let n,r,o,s,i="",a="",u=t.pos,d=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const h=t.pos,f=t.posMax,g=t.pos+1,x=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(x<0)return!1;let v=x+1;if(v<f&&t.src.charCodeAt(v)===40){for(d=!1,v++;v<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(v>=f)return!1;if(u=v,o=t.md.helpers.parseLinkDestination(t.src,v,t.posMax),o.ok){for(i=t.md.normalizeLink(o.str),t.md.validateLink(i)?v=o.pos:i="",u=v;v<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(o=t.md.helpers.parseLinkTitle(t.src,v,t.posMax),v<f&&u!==v&&o.ok)for(a=o.str,v=o.pos;v<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);}(v>=f||t.src.charCodeAt(v)!==41)&&(d=!0),v++}if(d){if(typeof t.env.references>"u")return!1;if(v<f&&t.src.charCodeAt(v)===91?(u=v+1,v=t.md.helpers.parseLinkLabel(t,v),v>=0?r=t.src.slice(u,v++):v=x+1):v=x+1,r||(r=t.src.slice(g,x)),s=t.env.references[Qp(r)],!s)return t.pos=h,!1;i=s.href,a=s.title}if(!e){t.pos=g,t.posMax=x;const b=t.push("link_open","a",1),k=[["href",i]];b.attrs=k,a&&k.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=v,t.posMax=f,!0}function qG(t,e){let n,r,o,s,i,a,u,d,h="";const f=t.pos,g=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const x=t.pos+2,v=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(v<0)return!1;if(s=v+1,s<g&&t.src.charCodeAt(s)===40){for(s++;s<g&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);if(s>=g)return!1;for(d=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(h=t.md.normalizeLink(a.str),t.md.validateLink(h)?s=a.pos:h=""),d=s;s<g&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);if(a=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<g&&d!==s&&a.ok)for(u=a.str,s=a.pos;s<g&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);else u="";if(s>=g||t.src.charCodeAt(s)!==41)return t.pos=f,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<g&&t.src.charCodeAt(s)===91?(d=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?o=t.src.slice(d,s++):s=v+1):s=v+1,o||(o=t.src.slice(x,v)),i=t.env.references[Qp(o)],!i)return t.pos=f,!1;h=i.href,u=i.title}if(!e){r=t.src.slice(x,v);const b=[];t.md.inline.parse(r,t.md,t.env,b);const k=t.push("image","img",0),E=[["src",h],["alt",""]];k.attrs=E,k.children=b,k.content=r,u&&E.push(["title",u])}return t.pos=s,t.posMax=g,!0}const KG=/^([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])?)*)$/,GG=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function JG(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,o=t.posMax;for(;;){if(++n>=o)return!1;const i=t.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=t.src.slice(r+1,n);if(GG.test(s)){const i=t.md.normalizeLink(s);if(!t.md.validateLink(i))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);const d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(KG.test(s)){const i=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(i))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);const d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}function ZG(t){return/^<a[>\s]/i.test(t)}function YG(t){return/^<\/a\s*>/i.test(t)}function XG(t){const e=t|32;return e>=97&&e<=122}function QG(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=t.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!XG(o))return!1;const s=t.src.slice(r).match(NG);if(!s)return!1;if(!e){const i=t.push("html_inline","",0);i.content=s[0],ZG(i.content)&&t.linkLevel++,YG(i.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const eJ=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,tJ=/^&([a-z][a-z0-9]{1,31});/i;function nJ(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(eJ);if(s){if(!e){const i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=yv(i)?bc(i):bc(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(tJ);if(s){const i=kK(s[0]);if(i!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=i,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function kS(t){const e={},n=t.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=t[i];if(s.push(0),(t[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[a.marker][(a.open?3:0)+a.length%3];let d=r-s[r]-1,h=d;for(;d>u;d-=s[d]+1){const f=t[d];if(f.marker===a.marker&&f.open&&f.end<0){let g=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(g=!0),!g){const x=d>0&&!t[d-1].open?s[d-1]+1:0;s[i]=i-d+x,s[d]=x,a.open=!1,f.end=i,f.close=!1,h=-1,o=-2;break}}}h!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=h)}}function rJ(t){const e=t.tokens_meta,n=t.tokens_meta.length;kS(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&kS(e[r].delimiters)}function oJ(t){let e,n,r=0;const o=t.tokens,s=t.tokens.length;for(e=n=0;e<s;e++)o[e].nesting<0&&r--,o[e].level=r,o[e].nesting>0&&r++,o[e].type==="text"&&e+1<s&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}const Yg=[["text",IG],["linkify",LG],["newline",zG],["escape",FG],["backticks",$G],["strikethrough",iN.tokenize],["emphasis",aN.tokenize],["link",WG],["image",qG],["autolink",JG],["html_inline",QG],["entity",nJ]],Xg=[["balance_pairs",rJ],["strikethrough",iN.postProcess],["emphasis",aN.postProcess],["fragments_join",oJ]];function ed(){this.ruler=new or;for(let t=0;t<Yg.length;t++)this.ruler.push(Yg[t][0],Yg[t][1]);this.ruler2=new or;for(let t=0;t<Xg.length;t++)this.ruler2.push(Xg[t][0],Xg[t][1])}ed.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,o=t.md.options.maxNesting,s=t.cache;if(typeof s[e]<"u"){t.pos=s[e];return}let i=!1;if(t.level<o){for(let a=0;a<r;a++)if(t.level++,i=n[a](t,!0),t.level--,i){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;i||t.pos++,s[e]=t.pos};ed.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,o=t.md.options.maxNesting;for(;t.pos<r;){const s=t.pos;let i=!1;if(t.level<o){for(let a=0;a<n;a++)if(i=e[a](t,!1),i){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};ed.prototype.parse=function(t,e,n,r){const o=new this.State(t,e,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let a=0;a<i;a++)s[a](o)};ed.prototype.State=Qc;function sJ(t){const e={};t=t||{},e.src_Any=KT.source,e.src_Cc=GT.source,e.src_Z=ZT.source,e.src_P=mv.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter=`(?:(?!${n}|${e.src_ZPCc})${e.src_Any})`,e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${n}|${e.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${n}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function Dy(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function nm(t){return Object.prototype.toString.call(t)}function iJ(t){return nm(t)==="[object String]"}function aJ(t){return nm(t)==="[object Object]"}function lJ(t){return nm(t)==="[object RegExp]"}function wS(t){return nm(t)==="[object Function]"}function uJ(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const lN={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function cJ(t){return Object.keys(t||{}).reduce(function(e,n){return e||lN.hasOwnProperty(n)},!1)}const dJ={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},fJ="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hJ="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function pJ(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function CS(){return function(t,e){e.normalize(t)}}function rp(t){const e=t.re=sJ(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(fJ),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const o=[];t.__compiled__={};function s(a,u){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${u}`)}Object.keys(t.__schemas__).forEach(function(a){const u=t.__schemas__[a];if(u===null)return;const d={validate:null,link:null};if(t.__compiled__[a]=d,aJ(u)){lJ(u.validate)?d.validate=pJ(u.validate):wS(u.validate)?d.validate=u.validate:s(a,u),wS(u.normalize)?d.normalize=u.normalize:u.normalize?s(a,u):d.normalize=CS();return}if(iJ(u)){o.push(a);return}s(a,u)}),o.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:CS()};const i=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(uJ).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${i})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${i})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}function uN(t,e,n,r){const o=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}function pr(t,e){if(!(this instanceof pr))return new pr(t,e);e||cJ(t)&&(e=t,t={}),this.__opts__=Dy({},lN,e),this.__schemas__=Dy({},dJ,t),this.__compiled__={},this.__tlds__=hJ,this.__tlds_replaced__=!1,this.re={},rp(this)}pr.prototype.add=function(e,n){return this.__schemas__[e]=n,rp(this),this};pr.prototype.set=function(e){return this.__opts__=Dy(this.__opts__,e),this};pr.prototype.test=function(e){if(!e.length)return!1;let n,r;if(this.re.schema_test.test(e)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(e))!==null;)if(this.testSchemaAt(e,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};pr.prototype.pretest=function(e){return this.re.pretest.test(e)};pr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};pr.prototype.match=function(e){const n=[],r=[],o=[],s=[];let i,a,u;function d(g,x){return g?x?g.index!==x.index?g.index<x.index?g:x:g.lastIndex>=x.lastIndex?g:x:g:x}if(!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(i=u.exec(e))!==null;)a=this.testSchemaAt(e,i[2],u.lastIndex),a&&r.push({schema:i[2],index:i.index+i[1].length,lastIndex:i.index+i[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(i=u.exec(e))!==null;)o.push({schema:"",index:i.index+i[1].length,lastIndex:i.index+i[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(i=u.exec(e))!==null;)s.push({schema:"mailto:",index:i.index+i[1].length,lastIndex:i.index+i[0].length});const h=[0,0,0];let f=0;for(;;){const g=[r[h[0]],s[h[1]],o[h[2]]],x=d(d(g[0],g[1]),g[2]);if(!x)break;if(x===g[0]?h[0]++:x===g[1]?h[1]++:h[2]++,x.index<f)continue;const v=new uN(e,x.schema,x.index,x.lastIndex);this.__compiled__[v.schema].normalize(v,this),n.push(v),f=x.lastIndex}return n.length?n:null};pr.prototype.matchAtStart=function(e){if(!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);if(!r)return null;const o=new uN(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[o.schema].normalize(o,this),o};pr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,o,s){return r!==s[o-1]}).reverse(),rp(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,rp(this),this)};pr.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};pr.prototype.onCompile=function(){};const nl=2147483647,ko=36,bv=1,Sc=26,mJ=38,gJ=700,cN=72,dN=128,fN="-",yJ=/^xn--/,xJ=/[^\0-\x7F]/,vJ=/[\x2E\u3002\uFF0E\uFF61]/g,bJ={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Qg=ko-bv,wo=Math.floor,e1=String.fromCharCode;function Ws(t){throw new RangeError(bJ[t])}function kJ(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function hN(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(vJ,".");const o=t.split("."),s=kJ(o,e).join(".");return r+s}function pN(t){const e=[];let n=0;const r=t.length;for(;n<r;){const o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((o&1023)<<10)+(s&1023)+65536):(e.push(o),n--)}else e.push(o)}return e}const wJ=t=>String.fromCodePoint(...t),CJ=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:ko},SS=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},mN=function(t,e,n){let r=0;for(t=n?wo(t/gJ):t>>1,t+=wo(t/e);t>Qg*Sc>>1;r+=ko)t=wo(t/Qg);return wo(r+(Qg+1)*t/(t+mJ))},gN=function(t){const e=[],n=t.length;let r=0,o=dN,s=cN,i=t.lastIndexOf(fN);i<0&&(i=0);for(let a=0;a<i;++a)t.charCodeAt(a)>=128&&Ws("not-basic"),e.push(t.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const u=r;for(let h=1,f=ko;;f+=ko){a>=n&&Ws("invalid-input");const g=CJ(t.charCodeAt(a++));g>=ko&&Ws("invalid-input"),g>wo((nl-r)/h)&&Ws("overflow"),r+=g*h;const x=f<=s?bv:f>=s+Sc?Sc:f-s;if(g<x)break;const v=ko-x;h>wo(nl/v)&&Ws("overflow"),h*=v}const d=e.length+1;s=mN(r-u,d,u==0),wo(r/d)>nl-o&&Ws("overflow"),o+=wo(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},yN=function(t){const e=[];t=pN(t);const n=t.length;let r=dN,o=0,s=cN;for(const u of t)u<128&&e.push(e1(u));const i=e.length;let a=i;for(i&&e.push(fN);a<n;){let u=nl;for(const h of t)h>=r&&h<u&&(u=h);const d=a+1;u-r>wo((nl-o)/d)&&Ws("overflow"),o+=(u-r)*d,r=u;for(const h of t)if(h<r&&++o>nl&&Ws("overflow"),h===r){let f=o;for(let g=ko;;g+=ko){const x=g<=s?bv:g>=s+Sc?Sc:g-s;if(f<x)break;const v=f-x,b=ko-x;e.push(e1(SS(x+v%b,0))),f=wo(v/b)}e.push(e1(SS(f,0))),s=mN(o,d,a===i),o=0,++a}++o,++r}return e.join("")},SJ=function(t){return hN(t,function(e){return yJ.test(e)?gN(e.slice(4).toLowerCase()):e})},EJ=function(t){return hN(t,function(e){return xJ.test(e)?"xn--"+yN(e):e})},xN={version:"2.3.1",ucs2:{decode:pN,encode:wJ},decode:gN,encode:yN,toASCII:EJ,toUnicode:SJ},_J={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},TJ={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},NJ={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},AJ={default:_J,zero:TJ,commonmark:NJ},MJ=/^(vbscript|javascript|file|data):/,DJ=/^data:image\/(gif|png|jpeg|webp);/;function RJ(t){const e=t.trim().toLowerCase();return MJ.test(e)?DJ.test(e):!0}const vN=["http:","https:","mailto:"];function OJ(t){const e=pv(t,!0);if(e.hostname&&(!e.protocol||vN.indexOf(e.protocol)>=0))try{e.hostname=xN.toASCII(e.hostname)}catch{}return Xc(hv(e))}function jJ(t){const e=pv(t,!0);if(e.hostname&&(!e.protocol||vN.indexOf(e.protocol)>=0))try{e.hostname=xN.toUnicode(e.hostname)}catch{}return vl(hv(e),vl.defaultChars+"%")}function sr(t,e){if(!(this instanceof sr))return new sr(t,e);e||gv(t)||(e=t||{},t="default"),this.inline=new ed,this.block=new tm,this.core=new xv,this.renderer=new Al,this.linkify=new pr,this.validateLink=RJ,this.normalizeLink=OJ,this.normalizeLinkText=jJ,this.utils=LK,this.helpers=Xp({},BK),this.options={},this.configure(t),e&&this.set(e)}sr.prototype.set=function(t){return Xp(this.options,t),this};sr.prototype.configure=function(t){const e=this;if(gv(t)){const n=t;if(t=AJ[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};sr.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};sr.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};sr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};sr.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};sr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};sr.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};sr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const IJ=new Ex({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function PJ(t,e){if(t.isText&&e.isText&&ut.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class LJ{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:ut.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,o=r[r.length-1],s=this.schema.text(e,n.marks),i;o&&(i=PJ(o,s))?r[r.length-1]=i:r.push(s)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],o=this.tokenHandlers[r.type];if(!o)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");o(this,r,e,n)}}addNode(e,n,r){let o=this.top(),s=e.createAndFill(n,r,o?o.marks:[]);return s?(this.push(s),s):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:ut.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function vu(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function t1(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function ES(t){return t[t.length-1]==`
646
+ `?t.slice(0,t.length-1):t}function n1(){}function zJ(t,e){let n=Object.create(null);for(let r in e){let o=e[r];if(o.block){let s=t.nodeType(o.block);t1(o,r)?n[r]=(i,a,u,d)=>{i.openNode(s,vu(o,a,u,d)),i.addText(ES(a.content)),i.closeNode()}:(n[r+"_open"]=(i,a,u,d)=>i.openNode(s,vu(o,a,u,d)),n[r+"_close"]=i=>i.closeNode())}else if(o.node){let s=t.nodeType(o.node);n[r]=(i,a,u,d)=>i.addNode(s,vu(o,a,u,d))}else if(o.mark){let s=t.marks[o.mark];t1(o,r)?n[r]=(i,a,u,d)=>{i.openMark(s.create(vu(o,a,u,d))),i.addText(ES(a.content)),i.closeMark(s)}:(n[r+"_open"]=(i,a,u,d)=>i.openMark(s.create(vu(o,a,u,d))),n[r+"_close"]=i=>i.closeMark(s))}else if(o.ignore)t1(o,r)?n[r]=n1:(n[r+"_open"]=n1,n[r+"_close"]=n1);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(o))}return n.text=(r,o)=>r.addText(o.content),n.inline=(r,o)=>r.parseTokens(o.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let FJ=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=zJ(e,r)}parse(e,n={}){let r=new LJ(this.schema,this.tokenHandlers),o;r.parseTokens(this.tokenizer.parse(e,n));do o=r.closeNode();while(r.stack.length);return o||this.schema.topNodeType.createAndFill()}};function _S(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new FJ(IJ,sr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:_S(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:_S(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const $J={open:"",close:"",mixable:!0};let BJ=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new bN(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const Ro=new BJ({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
647
+ `),t.text(e.textContent,!1),t.write(`
648
+ `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){var n;let r=(n=e.attrs.order)!==null&&n!==void 0?n:1,o=String(r+e.childCount-1).length,s=t.repeat(" ",o+2);t.renderList(e,s,i=>{let a=String(r+i);return t.repeat(" ",o-a.length)+a+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type){t.write(`\\
649
+ `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=VJ(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:o}=t;return t.inAutolink=void 0,o?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return TS(n.child(r),-1)},close(t,e,n,r){return TS(n.child(r-1),1)},escape:!1}});function TS(t,e){let n=/`+/g,r,o=0;if(t.isText)for(;r=n.exec(t.text);)o=Math.max(o,r[0].length);let s=o>0&&e>0?" `":"`";for(let i=0;i<o;i++)s+="`";return o>0&&e<0&&(s+=" "),s}function VJ(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let bN=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
650
+ `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let o=1;o<e;o++)this.out+=n+`
651
+ `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=$J}return n}wrapBlock(e,n,r,o){let s=this.delim;this.write(n??e),this.delim+=e,o(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
652
+ `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
653
+ `);for(let o=0;o<r.length;o++)this.write(),!n&&r[o][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[o],this.atBlockStart):r[o],o!=r.length-1&&(this.out+=`
654
+ `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,o)=>this.render(n,e,o))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],o="",s=(i,a,u)=>{let d=i?i.marks:[];i&&i.type.name===this.options.hardBreakNodeName&&(d=d.filter(b=>{if(u+1==e.childCount)return!1;let k=e.child(u+1);return b.isInSet(k.marks)&&(!k.isText||/\S/.test(k.text))}));let h=o;if(o="",i&&i.isText&&d.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!b.isInSet(r)})){let[b,k,E]=/^(\s*)(.*)$/m.exec(i.text);k&&(h+=k,i=E?i.withText(E):null,i||(d=r))}if(i&&i.isText&&d.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!this.isMarkAhead(e,u+1,b)})){let[b,k,E]=/^(.*?)(\s*)$/m.exec(i.text);E&&(o=E,i=k?i.withText(k):null,i||(d=r))}let f=d.length?d[d.length-1]:null,g=f&&this.getMark(f.type.name).escape===!1,x=d.length-(g?1:0);e:for(let b=0;b<x;b++){let k=d[b];if(!this.getMark(k.type.name).mixable)break;for(let E=0;E<r.length;E++){let _=r[E];if(!this.getMark(_.type.name).mixable)break;if(k.eq(_)){b>E?d=d.slice(0,E).concat(k).concat(d.slice(E,b)).concat(d.slice(b+1,x)):E>b&&(d=d.slice(0,b).concat(d.slice(b+1,E)).concat(k).concat(d.slice(E,x)));continue e}}}let v=0;for(;v<Math.min(r.length,x)&&d[v].eq(r[v]);)++v;for(;v<r.length;)this.text(this.markString(r.pop(),!1,e,u),!1);if(h&&this.text(h),i){for(;r.length<x;){let b=d[r.length];r.push(b),this.text(this.markString(b,!0,e,u),!1),this.atBlockStart=!1}g&&i.isText?this.text(this.markString(f,!0,e,u)+i.text+this.markString(f,!1,e,u+1),!1):this.render(i,e,u),this.atBlockStart=!1}i!=null&&i.isText&&i.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(s),s(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let o=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=o,e.forEach((i,a,u)=>{u&&o&&this.flushClose(1),this.wrapBlock(n,r(u),e,()=>this.render(i,e,u))}),this.inTightList=s}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,o)=>r=="_"&&o>0&&o+1<e.length&&e[o-1].match(/\w/)&&e[o+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let o=0;o<n;o++)r+=e;return r}markString(e,n,r,o){let s=this.getMark(e.type.name),i=n?s.open:s.close;return typeof i=="string"?i:i(this,e,r,o)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,n,r){for(;;n++){if(n>=e.childCount)return!1;let o=e.child(n);if(o.type.name!=this.options.hardBreakNodeName)return r.isInSet(o.marks);n++}}};var r1,NS;function HJ(){if(NS)return r1;NS=1;var t=!0,e=!1,n=!1;r1=function(b,k){k&&(t=!k.enabled,e=!!k.label,n=!!k.labelAfter),b.core.ruler.after("inline","github-task-lists",function(E){for(var _=E.tokens,T=2;T<_.length;T++)s(_,T)&&(i(_[T],E.Token),r(_[T-2],"class","task-list-item"+(t?"":" enabled")),r(_[o(_,T-2)],"class","contains-task-list"))})};function r(b,k,E){var _=b.attrIndex(k),T=[k,E];_<0?b.attrPush(T):b.attrs[_]=T}function o(b,k){for(var E=b[k].level-1,_=k-1;_>=0;_--)if(b[_].level===E)return _;return-1}function s(b,k){return f(b[k])&&g(b[k-1])&&x(b[k-2])&&v(b[k])}function i(b,k){if(b.children.unshift(a(b,k)),b.children[1].content=b.children[1].content.slice(3),b.content=b.content.slice(3),e)if(n){b.children.pop();var E="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);b.children[0].content=b.children[0].content.slice(0,-1)+' id="'+E+'">',b.children.push(h(b.content,E,k))}else b.children.unshift(u(k)),b.children.push(d(k))}function a(b,k){var E=new k("html_inline","",0),_=t?' disabled="" ':"";return b.content.indexOf("[ ] ")===0?E.content='<input class="task-list-item-checkbox"'+_+'type="checkbox">':(b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0)&&(E.content='<input class="task-list-item-checkbox" checked=""'+_+'type="checkbox">'),E}function u(b){var k=new b("html_inline","",0);return k.content="<label>",k}function d(b){var k=new b("html_inline","",0);return k.content="</label>",k}function h(b,k,E){var _=new E("html_inline","",0);return _.content='<label class="task-list-item-label" for="'+k+'">'+b+"</label>",_.attrs=[{for:k}],_}function f(b){return b.type==="inline"}function g(b){return b.type==="paragraph_open"}function x(b){return b.type==="list_item_open"}function v(b){return b.content.indexOf("[ ] ")===0||b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0}return r1}var UJ=HJ();const WJ=Py(UJ);var qJ=Object.defineProperty,KJ=(t,e,n)=>e in t?qJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,op=(t,e,n)=>(KJ(t,typeof e!="symbol"?e+"":e,n),n);const GJ=Et.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:o}=n;function s(i){if(!r.isActive(i))return!1;const a=r.getAttributes(i);return o.updateAttributes(i,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(i=>s(i))}}}}}),AS=sr();function kN(t,e){return AS.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new AS.inline.State(t,null,null,[]).scanDelims(e,!0)}function wN(t,e,n,r){let o=t.substring(0,n)+t.substring(n+e.length);return o=o.substring(0,n+r)+e+o.substring(n+r),o}function JJ(t,e,n,r){let o=n,s=t;for(;o<r&&!kN(s,o).can_open;)s=wN(s,e,o,1),o++;return{text:s,from:o,to:r}}function ZJ(t,e,n,r){let o=r,s=t;for(;o>n&&!kN(s,o).can_close;)s=wN(s,e,o,-1),o--;return{text:s,from:n,to:o}}function YJ(t,e,n,r){let o={text:t,from:n,to:r};return o=JJ(o.text,e,o.from,o.to),o=ZJ(o.text,e,o.from,o.to),o.to-o.from<e.length+1&&(o.text=o.text.substring(0,o.from)+o.text.substring(o.to+e.length)),o.text}class XJ extends bN{constructor(e,n,r){super(e,n,r??{}),op(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const o=this.inlines[this.inlines.length-1];if(o!=null&&o.start&&o!==null&&o!==void 0&&o.end){const{delimiter:s,start:i,end:a}=this.normalizeInline(o);this.out=YJ(this.out,s,i,a),this.inlines.pop()}}markString(e,n,r,o){const s=this.marks[e.type.name];if(s.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:s.open});else{const i=this.inlines.pop();this.inlines.push({...i,end:this.out.length})}return super.markString(e,n,r,o)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}}const CN=gr.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=MS(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=MS(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function MS(t){const e=t.type.schema,n=e.text(" ",[t]),o=Jc(oe.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return o?[o[1],o[2]]:null}function kv(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function QJ(t){return t==null?void 0:t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function eZ(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function tZ(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const rm=ht.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(nZ(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function nZ(t,e){const n=t.type.schema,r=Jc(oe.from(t),n);return t.isBlock&&(e instanceof oe||e.type.name===n.topNodeType.name)?rZ(r):r}function rZ(t){const n=kv(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
655
+ ${n.innerHTML}
656
+ `:`
657
+ `,n.outerHTML}const oZ=ht.create({name:"blockquote"}),sZ=oZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.blockquote,parse:{}}}}}),iZ=ht.create({name:"bulletList"}),SN=iZ.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),aZ=ht.create({name:"codeBlock"}),lZ=aZ.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
658
+ `),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),uZ=ht.create({name:"hardBreak"}),EN=uZ.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type){t.write(t.inTable?rm.storage.markdown.serialize.call(this,t,e,n):`\\
659
+ `);return}},parse:{}}}}}),cZ=ht.create({name:"heading"}),dZ=cZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.heading,parse:{}}}}}),fZ=ht.create({name:"horizontalRule"}),hZ=fZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.horizontal_rule,parse:{}}}}}),pZ=ht.create({name:"image"}),mZ=pZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.image,parse:{}}}}}),gZ=ht.create({name:"listItem"}),yZ=gZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.list_item,parse:{}}}}}),xZ=ht.create({name:"orderedList"});function vZ(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const bZ=xZ.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const o=e.attrs.start||1,s=String(o+e.childCount-1).length,i=t.repeat(" ",s+2),u=vZ(e,n,r)%2?") ":". ";t.renderList(e,i,d=>{const h=String(o+d);return t.repeat(" ",s-h.length)+h+u})},parse:{}}}}}),kZ=ht.create({name:"paragraph"}),wZ=kZ.extend({addStorage(){return{markdown:{serialize:Ro.nodes.paragraph,parse:{}}}}});function o1(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const CZ=ht.create({name:"table"}),SZ=CZ.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!EZ(e)){rm.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,o,s)=>{if(t.write("| "),r.forEach((i,a,u)=>{u&&t.write(" | ");const d=i.firstChild;d.textContent.trim()&&t.renderInline(d)}),t.write(" |"),t.ensureNewLine(),!s){const i=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${i} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function DS(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function EZ(t){const e=o1(t),n=e[0],r=e.slice(1);return!(o1(n).some(o=>o.type.name!=="tableHeader"||DS(o)||o.childCount>1)||r.some(o=>o1(o).some(s=>s.type.name==="tableHeader"||DS(s)||s.childCount>1)))}const _Z=ht.create({name:"taskItem"}),TZ=_Z.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),NZ=ht.create({name:"taskList"}),AZ=NZ.extend({addStorage(){return{markdown:{serialize:SN.storage.markdown.serialize,parse:{setup(t){t.use(WJ)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),MZ=ht.create({name:"text"}),DZ=MZ.extend({addStorage(){return{markdown:{serialize(t,e){t.text(QJ(e.text))},parse:{}}}}}),RZ=gr.create({name:"bold"}),OZ=RZ.extend({addStorage(){return{markdown:{serialize:Ro.marks.strong,parse:{}}}}}),jZ=gr.create({name:"code"}),IZ=jZ.extend({addStorage(){return{markdown:{serialize:Ro.marks.code,parse:{}}}}}),PZ=gr.create({name:"italic"}),LZ=PZ.extend({addStorage(){return{markdown:{serialize:Ro.marks.em,parse:{}}}}}),zZ=gr.create({name:"link"}),FZ=zZ.extend({addStorage(){return{markdown:{serialize:Ro.marks.link,parse:{}}}}}),$Z=gr.create({name:"strike"}),BZ=$Z.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),VZ=[sZ,SN,lZ,EN,dZ,hZ,rm,mZ,yZ,bZ,wZ,SZ,TZ,AZ,DZ,OZ,IZ,CN,LZ,FZ,BZ];function sp(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,o=(n=VZ.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||o?{...o,...r}:null}class HZ{constructor(e){op(this,"editor",null),this.editor=e}serialize(e){const n=new XJ(this.nodes,this.marks,{hardBreakNodeName:EN.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(rm)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(CN)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=sp(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=sp(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class UZ{constructor(e,n){op(this,"editor",null),op(this,"md",null);let{html:r,linkify:o,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(sr({html:r,linkify:o,breaks:s}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=sp(s))===null||i===void 0||(i=i.parse)===null||i===void 0||(i=i.setup)===null||i===void 0?void 0:i.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(e),o=kv(r);return this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=sp(s))===null||i===void 0||(i=i.parse)===null||i===void 0||(i=i.updateDOM)===null||i===void 0?void 0:i.call({editor:this.editor,options:s.options},o)}),this.normalizeDOM(o,{inline:n,content:e}),o.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:o}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(s=>{var i;((i=s.nextSibling)===null||i===void 0?void 0:i.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,o),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(o=>o.isBlock).map(o=>{var s;return(s=o.spec.parseDOM)===null||s===void 0?void 0:s.map(i=>i.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(o=>{o.parentElement.matches("p")&&eZ(o)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var o,s,i,a;const u=e.firstElementChild,{nextElementSibling:d}=u,h=(o=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&o!==void 0?o:"",f=d?"":(i=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&i!==void 0?i:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${f}`;return}tZ(u),e.innerHTML=`${h}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const o=r(...arguments);return o===`
660
+ `?o:o[o.length-1]===`
661
+ `?o.slice(0,-1):o};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const WZ=Et.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new St({key:new Wt("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return ss.fromSchema(this.editor.schema).parseSlice(kv(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),qZ=Et.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=W6.Commands.config.addCommands();return{setContent:(e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),insertContentAt:(e,n,r)=>o=>t.insertContentAt(e,o.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(o)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new UZ(this.editor,this.options),serializer:new HZ(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[GJ.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),WZ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function KZ({value:t,onChange:e}){const n=CU({extensions:[Jq,qZ],content:t||"",onUpdate:({editor:r})=>{const o=r.storage;e(o.markdown.getMarkdown())},editorProps:{attributes:{class:"tiptap min-h-40 px-4 py-3 text-sm text-foreground outline-none"}}});return n?m.jsxs("div",{className:"overflow-hidden rounded-lg border border-input bg-card shadow-sm focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border bg-muted/50 px-2 py-1.5",children:[m.jsx(po,{editor:n,on:"bold",cmd:r=>r.toggleBold(),title:M("Bold"),children:m.jsx(uP,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,on:"italic",cmd:r=>r.toggleItalic(),title:M("Italic"),children:m.jsx(u9,{className:"h-4 w-4"})}),m.jsx(s1,{}),m.jsx(po,{editor:n,on:"heading",attrs:{level:2},cmd:r=>r.toggleHeading({level:2}),title:M("Heading 2"),children:m.jsx(n9,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,on:"heading",attrs:{level:3},cmd:r=>r.toggleHeading({level:3}),title:M("Heading 3"),children:m.jsx(o9,{className:"h-4 w-4"})}),m.jsx(s1,{}),m.jsx(po,{editor:n,on:"bulletList",cmd:r=>r.toggleBulletList(),title:M("Bullet list"),children:m.jsx(b_,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,on:"orderedList",cmd:r=>r.toggleOrderedList(),title:M("Ordered list"),children:m.jsx(x9,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,on:"blockquote",cmd:r=>r.toggleBlockquote(),title:M("Quote"),children:m.jsx(M9,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,on:"codeBlock",cmd:r=>r.toggleCodeBlock(),title:M("Code"),children:m.jsx(jP,{className:"h-4 w-4"})}),m.jsx(s1,{}),m.jsx(po,{editor:n,cmd:r=>r.undo(),title:M("Undo"),children:m.jsx(aL,{className:"h-4 w-4"})}),m.jsx(po,{editor:n,cmd:r=>r.redo(),title:M("Redo"),children:m.jsx(R9,{className:"h-4 w-4"})})]}),m.jsx(iT,{editor:n})]}):null}function po({editor:t,on:e,attrs:n,cmd:r,title:o,children:s}){const i=e?t.isActive(e,n):!1;return m.jsx("button",{type:"button",title:o,onClick:()=>r(t.chain().focus()).run(),className:`flex h-8 w-8 items-center justify-center rounded-md transition ${i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/60"}`,children:s})}function s1(){return m.jsx("span",{className:"mx-1 h-5 w-px bg-border"})}function GZ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return C.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const om=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ml(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function wv(t){return"nodeType"in t}function Vn(t){var e,n;return t?Ml(t)?t:wv(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Cv(t){const{Document:e}=Vn(t);return t instanceof e}function td(t){return Ml(t)?!1:t instanceof Vn(t).HTMLElement}function _N(t){return t instanceof Vn(t).SVGElement}function Dl(t){return t?Ml(t)?t.document:wv(t)?Cv(t)?t:td(t)||_N(t)?t.ownerDocument:document:document:document}const Xr=om?C.useLayoutEffect:C.useEffect;function sm(t){const e=C.useRef(t);return Xr(()=>{e.current=t}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function JZ(){const t=C.useRef(null),e=C.useCallback((r,o)=>{t.current=setInterval(r,o)},[]),n=C.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Ec(t,e){e===void 0&&(e=[t]);const n=C.useRef(t);return Xr(()=>{n.current!==t&&(n.current=t)},e),n}function nd(t,e){const n=C.useRef();return C.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function ip(t){const e=sm(t),n=C.useRef(null),r=C.useCallback(o=>{o!==n.current&&(e==null||e(o,n.current)),n.current=o},[]);return[n,r]}function ap(t){const e=C.useRef();return C.useEffect(()=>{e.current=t},[t]),e.current}let i1={};function rd(t,e){return C.useMemo(()=>{if(e)return e;const n=i1[t]==null?0:i1[t]+1;return i1[t]=n,t+"-"+n},[t,e])}function TN(t){return 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 r.reduce((s,i)=>{const a=Object.entries(i);for(const[u,d]of a){const h=s[u];h!=null&&(s[u]=h+t*d)}return s},{...e})}}const rl=TN(1),_c=TN(-1);function ZZ(t){return"clientX"in t&&"clientY"in t}function im(t){if(!t)return!1;const{KeyboardEvent:e}=Vn(t.target);return e&&t instanceof e}function YZ(t){if(!t)return!1;const{TouchEvent:e}=Vn(t.target);return e&&t instanceof e}function lp(t){if(YZ(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return ZZ(t)?{x:t.clientX,y:t.clientY}:null}const ds=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[ds.Translate.toString(t),ds.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),RS="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function XZ(t){return t.matches(RS)?t:t.querySelector(RS)}const QZ={display:"none"};function eY(t){let{id:e,value:n}=t;return ne.createElement("div",{id:e,style:QZ},n)}function tY(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ne.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function nY(){const[t,e]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const NN=C.createContext(null);function rY(t){const e=C.useContext(NN);C.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function oY(){const[t]=C.useState(()=>new Set),e=C.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[C.useCallback(r=>{let{type:o,event:s}=r;t.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[t]),e]}const sY={draggable:`
662
+ To pick up a draggable item, press the space bar.
663
+ While dragging, use the arrow keys to move the item.
664
+ Press space again to drop the item in its new position, or press escape to cancel.
665
+ `},iY={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function aY(t){let{announcements:e=iY,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=sY}=t;const{announce:s,announcement:i}=nY(),a=rd("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),rY(C.useMemo(()=>({onDragStart(f){let{active:g}=f;s(e.onDragStart({active:g}))},onDragMove(f){let{active:g,over:x}=f;e.onDragMove&&s(e.onDragMove({active:g,over:x}))},onDragOver(f){let{active:g,over:x}=f;s(e.onDragOver({active:g,over:x}))},onDragEnd(f){let{active:g,over:x}=f;s(e.onDragEnd({active:g,over:x}))},onDragCancel(f){let{active:g,over:x}=f;s(e.onDragCancel({active:g,over:x}))}}),[s,e])),!u)return null;const h=ne.createElement(ne.Fragment,null,ne.createElement(eY,{id:r,value:o.draggable}),ne.createElement(tY,{id:a,announcement:i}));return n?Kr.createPortal(h,n):h}var Qt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Qt||(Qt={}));function up(){}function OS(t,e){return C.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function lY(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return C.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Qr=Object.freeze({x:0,y:0});function AN(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function uY(t,e){const n=lp(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function MN(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function cY(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function jS(t){let{left:e,top:n,height:r,width:o}=t;return[{x:e,y:n},{x:e+o,y:n},{x:e,y:n+r},{x:e+o,y:n+r}]}function DN(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function IS(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const dY=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=IS(e,e.left,e.top),s=[];for(const i of r){const{id:a}=i,u=n.get(a);if(u){const d=AN(IS(u),o);s.push({id:a,data:{droppableContainer:i,value:d}})}}return s.sort(MN)},fY=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=jS(e),s=[];for(const i of r){const{id:a}=i,u=n.get(a);if(u){const d=jS(u),h=o.reduce((g,x,v)=>g+AN(d[v],x),0),f=Number((h/4).toFixed(4));s.push({id:a,data:{droppableContainer:i,value:f}})}}return s.sort(MN)};function hY(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),o=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),i=o-r,a=s-n;if(r<o&&n<s){const u=e.width*e.height,d=t.width*t.height,h=i*a,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const pY=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const u=hY(a,e);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(cY)};function mY(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function RN(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Qr}function gY(t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+t*a.y,bottom:i.bottom+t*a.y,left:i.left+t*a.x,right:i.right+t*a.x}),{...n})}}const yY=gY(1);function ON(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function xY(t,e,n){const r=ON(e);if(!r)return t;const{scaleX:o,scaleY:s,x:i,y:a}=r,u=t.left-i-(1-o)*parseFloat(n),d=t.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?t.width/o:t.width,f=s?t.height/s:t.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const vY={ignoreTransform:!1};function Rl(t,e){e===void 0&&(e=vY);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=Vn(t).getComputedStyle(t);d&&(n=xY(n,d,h))}const{top:r,left:o,width:s,height:i,bottom:a,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:u}}function PS(t){return Rl(t,{ignoreTransform:!0})}function bY(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function kY(t,e){return e===void 0&&(e=Vn(t).getComputedStyle(t)),e.position==="fixed"}function wY(t,e){e===void 0&&(e=Vn(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=e[o];return typeof s=="string"?n.test(s):!1})}function am(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(Cv(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!td(o)||_N(o)||n.includes(o))return n;const s=Vn(t).getComputedStyle(o);return o!==t&&wY(o,s)&&n.push(o),kY(o,s)?n:r(o.parentNode)}return t?r(t):n}function jN(t){const[e]=am(t,1);return e??null}function a1(t){return!om||!t?null:Ml(t)?t:wv(t)?Cv(t)||t===Dl(t).scrollingElement?window:td(t)?t:null:null}function IN(t){return Ml(t)?t.scrollX:t.scrollLeft}function PN(t){return Ml(t)?t.scrollY:t.scrollTop}function Ry(t){return{x:IN(t),y:PN(t)}}var un;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(un||(un={}));function LN(t){return!om||!t?!1:t===document.scrollingElement}function zN(t){const e={x:0,y:0},n=LN(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,i=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:e}}const CY={x:.2,y:.2};function SY(t,e,n,r,o){let{top:s,left:i,right:a,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=CY);const{isTop:d,isBottom:h,isLeft:f,isRight:g}=zN(t),x={x:0,y:0},v={x:0,y:0},b={height:e.height*o.y,width:e.width*o.x};return!d&&s<=e.top+b.height?(x.y=un.Backward,v.y=r*Math.abs((e.top+b.height-s)/b.height)):!h&&u>=e.bottom-b.height&&(x.y=un.Forward,v.y=r*Math.abs((e.bottom-b.height-u)/b.height)),!g&&a>=e.right-b.width?(x.x=un.Forward,v.x=r*Math.abs((e.right-b.width-a)/b.width)):!f&&i<=e.left+b.width&&(x.x=un.Backward,v.x=r*Math.abs((e.left+b.width-i)/b.width)),{direction:x,speed:v}}function EY(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function FN(t){return t.reduce((e,n)=>rl(e,Ry(n)),Qr)}function _Y(t){return t.reduce((e,n)=>e+IN(n),0)}function TY(t){return t.reduce((e,n)=>e+PN(n),0)}function $N(t,e){if(e===void 0&&(e=Rl),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);jN(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const NY=[["x",["left","right"],_Y],["y",["top","bottom"],TY]];class Sv{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=am(n),o=FN(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,i,a]of NY)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=a(r),h=o[s]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Hu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function AY(t){const{EventTarget:e}=Vn(t);return t instanceof e?t:Dl(t)}function l1(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Ar;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Ar||(Ar={}));function LS(t){t.preventDefault()}function MY(t){t.stopPropagation()}var Ze;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ze||(Ze={}));const BN={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},DY=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Ze.Right:return{...n,x:n.x+25};case Ze.Left:return{...n,x:n.x-25};case Ze.Down:return{...n,y:n.y+25};case Ze.Up:return{...n,y:n.y-25}}};class Ev{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Hu(Dl(n)),this.windowListeners=new Hu(Vn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ar.Resize,this.handleCancel),this.windowListeners.add(Ar.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ar.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&$N(r),n(Qr)}handleKeyDown(e){if(im(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=BN,coordinateGetter:i=DY,scrollBehavior:a="smooth"}=o,{code:u}=e;if(s.end.includes(u)){this.handleEnd(e);return}if(s.cancel.includes(u)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Qr;this.referenceCoordinates||(this.referenceCoordinates=h);const f=i(e,{active:n,context:r.current,currentCoordinates:h});if(f){const g=_c(f,h),x={x:0,y:0},{scrollableAncestors:v}=r.current;for(const b of v){const k=e.code,{isTop:E,isRight:_,isLeft:T,isBottom:A,maxScroll:D,minScroll:R}=zN(b),O=EY(b),P={x:Math.min(k===Ze.Right?O.right-O.width/2:O.right,Math.max(k===Ze.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(k===Ze.Down?O.bottom-O.height/2:O.bottom,Math.max(k===Ze.Down?O.top:O.top+O.height/2,f.y))},j=k===Ze.Right&&!_||k===Ze.Left&&!T,W=k===Ze.Down&&!A||k===Ze.Up&&!E;if(j&&P.x!==f.x){const Z=b.scrollLeft+g.x,J=k===Ze.Right&&Z<=D.x||k===Ze.Left&&Z>=R.x;if(J&&!g.y){b.scrollTo({left:Z,behavior:a});return}J?x.x=b.scrollLeft-Z:x.x=k===Ze.Right?b.scrollLeft-D.x:b.scrollLeft-R.x,x.x&&b.scrollBy({left:-x.x,behavior:a});break}else if(W&&P.y!==f.y){const Z=b.scrollTop+g.y,J=k===Ze.Down&&Z<=D.y||k===Ze.Up&&Z>=R.y;if(J&&!g.x){b.scrollTo({top:Z,behavior:a});return}J?x.y=b.scrollTop-Z:x.y=k===Ze.Down?b.scrollTop-D.y:b.scrollTop-R.y,x.y&&b.scrollBy({top:-x.y,behavior:a});break}}this.handleMove(e,rl(_c(f,this.referenceCoordinates),x))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ev.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=BN,onActivation:o}=e,{active:s}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function zS(t){return!!(t&&"distance"in t)}function FS(t){return!!(t&&"delay"in t)}class _v{constructor(e,n,r){var o;r===void 0&&(r=AY(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:i}=s;this.props=e,this.events=n,this.document=Dl(i),this.documentListeners=new Hu(this.document),this.listeners=new Hu(r),this.windowListeners=new Hu(Vn(i)),this.initialCoordinates=(o=lp(s))!=null?o:Qr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ar.Resize,this.handleCancel),this.windowListeners.add(Ar.DragStart,LS),this.windowListeners.add(Ar.VisibilityChange,this.handleCancel),this.windowListeners.add(Ar.ContextMenu,LS),this.documentListeners.add(Ar.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FS(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(zS(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:o}=this.props;o(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ar.Click,MY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ar.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const u=(n=lp(e))!=null?n:Qr,d=_c(o,u);if(!r&&a){if(zS(a)){if(a.tolerance!=null&&l1(d,a.tolerance))return this.handleCancel();if(l1(d,a.distance))return this.handleStart()}if(FS(a)&&l1(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}e.cancelable&&e.preventDefault(),i(u)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Ze.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const RY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Tv extends _v{constructor(e){const{event:n}=e,r=Dl(n.target);super(e,RY,r)}}Tv.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const OY={move:{name:"mousemove"},end:{name:"mouseup"}};var Oy;(function(t){t[t.RightClick=2]="RightClick"})(Oy||(Oy={}));class jY extends _v{constructor(e){super(e,OY,Dl(e.event.target))}}jY.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Oy.RightClick?!1:(r==null||r({event:n}),!0)}}];const u1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class IY extends _v{constructor(e){super(e,u1)}static setup(){return window.addEventListener(u1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(u1.move.name,e)};function e(){}}}IY.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Uu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Uu||(Uu={}));var cp;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(cp||(cp={}));function PY(t){let{acceleration:e,activator:n=Uu.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=cp.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:g}=t;const x=zY({delta:f,disabled:!s}),[v,b]=JZ(),k=C.useRef({x:0,y:0}),E=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case Uu.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Uu.DraggableRect:return o}},[n,o,u]),T=C.useRef(null),A=C.useCallback(()=>{const R=T.current;if(!R)return;const O=k.current.x*E.current.x,P=k.current.y*E.current.y;R.scrollBy(O,P)},[]),D=C.useMemo(()=>a===cp.TreeOrder?[...d].reverse():d,[a,d]);C.useEffect(()=>{if(!s||!d.length||!_){b();return}for(const R of D){if((r==null?void 0:r(R))===!1)continue;const O=d.indexOf(R),P=h[O];if(!P)continue;const{direction:j,speed:W}=SY(R,P,_,e,g);for(const Z of["x","y"])x[Z][j[Z]]||(W[Z]=0,j[Z]=0);if(W.x>0||W.y>0){b(),T.current=R,v(A,i),k.current=W,E.current=j;return}}k.current={x:0,y:0},E.current={x:0,y:0},b()},[e,A,r,b,s,i,JSON.stringify(_),JSON.stringify(x),v,d,D,h,JSON.stringify(g)])}const LY={x:{[un.Backward]:!1,[un.Forward]:!1},y:{[un.Backward]:!1,[un.Forward]:!1}};function zY(t){let{delta:e,disabled:n}=t;const r=ap(e);return nd(o=>{if(n||!r||!o)return LY;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[un.Backward]:o.x[un.Backward]||s.x===-1,[un.Forward]:o.x[un.Forward]||s.x===1},y:{[un.Backward]:o.y[un.Backward]||s.y===-1,[un.Forward]:o.y[un.Forward]||s.y===1}}},[n,e,r])}function FY(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return nd(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function $Y(t,e){return C.useMemo(()=>t.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:e(i.handler,r)}));return[...n,...s]},[]),[t,e])}var Tc;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Tc||(Tc={}));var jy;(function(t){t.Optimized="optimized"})(jy||(jy={}));const $S=new Map;function BY(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,i]=C.useState(null),{frequency:a,measure:u,strategy:d}=o,h=C.useRef(t),f=k(),g=Ec(f),x=C.useCallback(function(E){E===void 0&&(E=[]),!g.current&&i(_=>_===null?E:_.concat(E.filter(T=>!_.includes(T))))},[g]),v=C.useRef(null),b=nd(E=>{if(f&&!n)return $S;if(!E||E===$S||h.current!==t||s!=null){const _=new Map;for(let T of t){if(!T)continue;if(s&&s.length>0&&!s.includes(T.id)&&T.rect.current){_.set(T.id,T.rect.current);continue}const A=T.node.current,D=A?new Sv(u(A),A):null;T.rect.current=D,D&&_.set(T.id,D)}return _}return E},[t,s,n,f,u]);return C.useEffect(()=>{h.current=t},[t]),C.useEffect(()=>{f||x()},[n,f]),C.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),C.useEffect(()=>{f||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{x(),v.current=null},a))},[a,f,x,...r]),{droppableRects:b,measureDroppableContainers:x,measuringScheduled:s!=null};function k(){switch(d){case Tc.Always:return!1;case Tc.BeforeDragging:return n;default:return!n}}}function Nv(t,e){return nd(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function VY(t,e){return Nv(t,e)}function HY(t){let{callback:e,disabled:n}=t;const r=sm(e),o=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return C.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function lm(t){let{callback:e,disabled:n}=t;const r=sm(e),o=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return C.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function UY(t){return new Sv(Rl(t),t)}function BS(t,e,n){e===void 0&&(e=UY);const[r,o]=C.useState(null);function s(){o(u=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=u??n)!=null?d:null}const h=e(t);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const i=HY({callback(u){if(t)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(t)){s();break}}}}),a=lm({callback:s});return Xr(()=>{s(),t?(a==null||a.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[t]),r}function WY(t){const e=Nv(t);return RN(t,e)}const VS=[];function qY(t){const e=C.useRef(t),n=nd(r=>t?r&&r!==VS&&t&&e.current&&t.parentNode===e.current.parentNode?r:am(t):VS,[t]);return C.useEffect(()=>{e.current=t},[t]),n}function KY(t){const[e,n]=C.useState(null),r=C.useRef(t),o=C.useCallback(s=>{const i=a1(s.target);i&&n(a=>a?(a.set(i,Ry(i)),new Map(a)):null)},[]);return C.useEffect(()=>{const s=r.current;if(t!==s){i(s);const a=t.map(u=>{const d=a1(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ry(d)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),r.current=t}return()=>{i(t),i(s)};function i(a){a.forEach(u=>{const d=a1(u);d==null||d.removeEventListener("scroll",o)})}},[o,t]),C.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,i)=>rl(s,i),Qr):FN(t):Qr,[t,e])}function HS(t,e){e===void 0&&(e=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},e),C.useEffect(()=>{const r=t!==Qr;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?_c(t,n.current):Qr}function GY(t){C.useEffect(()=>{if(!om)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function JY(t,e){return C.useMemo(()=>t.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,e)},n},{}),[t,e])}function VN(t){return C.useMemo(()=>t?bY(t):null,[t])}const US=[];function ZY(t,e){e===void 0&&(e=Rl);const[n]=t,r=VN(n?Vn(n):null),[o,s]=C.useState(US);function i(){s(()=>t.length?t.map(u=>LN(u)?r:new Sv(e(u),u)):US)}const a=lm({callback:i});return Xr(()=>{a==null||a.disconnect(),i(),t.forEach(u=>a==null?void 0:a.observe(u))},[t]),o}function HN(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return td(e)?e:t}function YY(t){let{measure:e}=t;const[n,r]=C.useState(null),o=C.useCallback(d=>{for(const{target:h}of d)if(td(h)){r(f=>{const g=e(h);return f?{...f,width:g.width,height:g.height}:g});break}},[e]),s=lm({callback:o}),i=C.useCallback(d=>{const h=HN(d);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?e(h):null)},[e,s]),[a,u]=ip(i);return C.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const XY=[{sensor:Tv,options:{}},{sensor:Ev,options:{}}],QY={current:{}},th={draggable:{measure:PS},droppable:{measure:PS,strategy:Tc.WhileDragging,frequency:jy.Optimized},dragOverlay:{measure:Rl}};class Wu extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const eX={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Wu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:up},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:th,measureDroppableContainers:up,windowRect:null,measuringScheduled:!1},UN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:up,draggableNodes:new Map,over:null,measureDroppableContainers:up},od=C.createContext(UN),WN=C.createContext(eX);function tX(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Wu}}}function nX(t,e){switch(e.type){case Qt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Qt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Qt.DragEnd:case Qt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new Wu(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case Qt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Wu(t.droppable.containers);return i.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:i}}}case Qt.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new Wu(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function rX(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=C.useContext(od),s=ap(r),i=ap(n==null?void 0:n.id);return C.useEffect(()=>{if(!e&&!r&&s&&i!=null){if(!im(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=XZ(h);if(f){f.focus();break}}})}},[r,e,o,i,s]),null}function qN(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function oX(t){return C.useMemo(()=>({draggable:{...th.draggable,...t==null?void 0:t.draggable},droppable:{...th.droppable,...t==null?void 0:t.droppable},dragOverlay:{...th.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function sX(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=C.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Xr(()=>{if(!i&&!a||!e){s.current=!1;return}if(s.current||!r)return;const d=e==null?void 0:e.node.current;if(!d||d.isConnected===!1)return;const h=n(d),f=RN(h,r);if(i||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=jN(d);g&&g.scrollBy({top:f.y,left:f.x})}},[e,i,a,r,n])}const um=C.createContext({...Qr,scaleX:1,scaleY:1});var qs;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(qs||(qs={}));const iX=C.memo(function(e){var n,r,o,s;let{id:i,accessibility:a,autoScroll:u=!0,children:d,sensors:h=XY,collisionDetection:f=pY,measuring:g,modifiers:x,...v}=e;const b=C.useReducer(nX,void 0,tX),[k,E]=b,[_,T]=oY(),[A,D]=C.useState(qs.Uninitialized),R=A===qs.Initialized,{draggable:{active:O,nodes:P,translate:j},droppable:{containers:W}}=k,Z=O!=null?P.get(O):null,J=C.useRef({initial:null,translated:null}),K=C.useMemo(()=>{var gt;return O!=null?{id:O,data:(gt=Z==null?void 0:Z.data)!=null?gt:QY,rect:J}:null},[O,Z]),Y=C.useRef(null),[ee,G]=C.useState(null),[X,q]=C.useState(null),te=Ec(v,Object.values(v)),F=rd("DndDescribedBy",i),L=C.useMemo(()=>W.getEnabled(),[W]),V=oX(g),{droppableRects:re,measureDroppableContainers:he,measuringScheduled:ce}=BY(L,{dragging:R,dependencies:[j.x,j.y],config:V.droppable}),pe=FY(P,O),Re=C.useMemo(()=>X?lp(X):null,[X]),Q=oo(),de=VY(pe,V.draggable.measure);sX({activeNode:O!=null?P.get(O):null,config:Q.layoutShiftCompensation,initialRect:de,measure:V.draggable.measure});const me=BS(pe,V.draggable.measure,de),Fe=BS(pe?pe.parentElement:null),Oe=C.useRef({activatorEvent:null,active:null,activeNode:pe,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Be=W.getNodeFor((n=Oe.current.over)==null?void 0:n.id),Ye=YY({measure:V.dragOverlay.measure}),Mt=(r=Ye.nodeRef.current)!=null?r:pe,zt=R?(o=Ye.rect)!=null?o:me:null,qt=!!(Ye.nodeRef.current&&Ye.rect),Hn=WY(qt?null:me),Kt=VN(Mt?Vn(Mt):null),nn=qY(R?Be??pe:null),On=ZY(nn),pt=qN(x,{transform:{x:j.x-Hn.x,y:j.y-Hn.y,scaleX:1,scaleY:1},activatorEvent:X,active:K,activeNodeRect:me,containerNodeRect:Fe,draggingNodeRect:zt,over:Oe.current.over,overlayNodeRect:Ye.rect,scrollableAncestors:nn,scrollableAncestorRects:On,windowRect:Kt}),yr=Re?rl(Re,j):null,ki=KY(nn),ya=HS(ki),Oo=HS(ki,[me]),xr=rl(pt,ya),Un=zt?yY(zt,pt):null,vr=K&&Un?f({active:K,collisionRect:Un,droppableRects:re,droppableContainers:L,pointerCoordinates:yr}):null,jn=DN(vr,"id"),[mn,Pr]=C.useState(null),xa=qt?pt:rl(pt,Oo),va=mY(xa,(s=mn==null?void 0:mn.rect)!=null?s:null,me),ys=C.useRef(null),jo=C.useCallback((gt,Gt)=>{let{sensor:Me,options:it}=Gt;if(Y.current==null)return;const tt=P.get(Y.current);if(!tt)return;const at=gt.nativeEvent,Jt=new Me({active:Y.current,activeNode:tt,event:at,options:it,context:Oe,onAbort(Je){if(!P.get(Je))return;const{onDragAbort:ft}=te.current,Tt={id:Je};ft==null||ft(Tt),_({type:"onDragAbort",event:Tt})},onPending(Je,gn,ft,Tt){if(!P.get(Je))return;const{onDragPending:rn}=te.current,Kn={id:Je,constraint:gn,initialCoordinates:ft,offset:Tt};rn==null||rn(Kn),_({type:"onDragPending",event:Kn})},onStart(Je){const gn=Y.current;if(gn==null)return;const ft=P.get(gn);if(!ft)return;const{onDragStart:Tt}=te.current,qn={activatorEvent:at,active:{id:gn,data:ft.data,rect:J}};Kr.unstable_batchedUpdates(()=>{Tt==null||Tt(qn),D(qs.Initializing),E({type:Qt.DragStart,initialCoordinates:Je,active:gn}),_({type:"onDragStart",event:qn}),G(ys.current),q(at)})},onMove(Je){E({type:Qt.DragMove,coordinates:Je})},onEnd:mt(Qt.DragEnd),onCancel:mt(Qt.DragCancel)});ys.current=Jt;function mt(Je){return async function(){const{active:ft,collisions:Tt,over:qn,scrollAdjustedTranslate:rn}=Oe.current;let Kn=null;if(ft&&rn){const{cancelDrop:Io}=te.current;Kn={activatorEvent:at,active:ft,collisions:Tt,delta:rn,over:qn},Je===Qt.DragEnd&&typeof Io=="function"&&await Promise.resolve(Io(Kn))&&(Je=Qt.DragCancel)}Y.current=null,Kr.unstable_batchedUpdates(()=>{E({type:Je}),D(qs.Uninitialized),Pr(null),G(null),q(null),ys.current=null;const Io=Je===Qt.DragEnd?"onDragEnd":"onDragCancel";if(Kn){const Ol=te.current[Io];Ol==null||Ol(Kn),_({type:Io,event:Kn})}})}}},[P]),wi=C.useCallback((gt,Gt)=>(Me,it)=>{const tt=Me.nativeEvent,at=P.get(it);if(Y.current!==null||!at||tt.dndKit||tt.defaultPrevented)return;const Jt={active:at};gt(Me,Gt.options,Jt)===!0&&(tt.dndKit={capturedBy:Gt.sensor},Y.current=it,jo(Me,Gt))},[P,jo]),ro=$Y(h,wi);GY(h),Xr(()=>{me&&A===qs.Initializing&&D(qs.Initialized)},[me,A]),C.useEffect(()=>{const{onDragMove:gt}=te.current,{active:Gt,activatorEvent:Me,collisions:it,over:tt}=Oe.current;if(!Gt||!Me)return;const at={active:Gt,activatorEvent:Me,collisions:it,delta:{x:xr.x,y:xr.y},over:tt};Kr.unstable_batchedUpdates(()=>{gt==null||gt(at),_({type:"onDragMove",event:at})})},[xr.x,xr.y]),C.useEffect(()=>{const{active:gt,activatorEvent:Gt,collisions:Me,droppableContainers:it,scrollAdjustedTranslate:tt}=Oe.current;if(!gt||Y.current==null||!Gt||!tt)return;const{onDragOver:at}=te.current,Jt=it.get(jn),mt=Jt&&Jt.rect.current?{id:Jt.id,rect:Jt.rect.current,data:Jt.data,disabled:Jt.disabled}:null,Je={active:gt,activatorEvent:Gt,collisions:Me,delta:{x:tt.x,y:tt.y},over:mt};Kr.unstable_batchedUpdates(()=>{Pr(mt),at==null||at(Je),_({type:"onDragOver",event:Je})})},[jn]),Xr(()=>{Oe.current={activatorEvent:X,active:K,activeNode:pe,collisionRect:Un,collisions:vr,droppableRects:re,draggableNodes:P,draggingNode:Mt,draggingNodeRect:zt,droppableContainers:W,over:mn,scrollableAncestors:nn,scrollAdjustedTranslate:xr},J.current={initial:zt,translated:Un}},[K,pe,vr,Un,P,Mt,zt,re,W,mn,nn,xr]),PY({...Q,delta:j,draggingRect:Un,pointerCoordinates:yr,scrollableAncestors:nn,scrollableAncestorRects:On});const Wn=C.useMemo(()=>({active:K,activeNode:pe,activeNodeRect:me,activatorEvent:X,collisions:vr,containerNodeRect:Fe,dragOverlay:Ye,draggableNodes:P,droppableContainers:W,droppableRects:re,over:mn,measureDroppableContainers:he,scrollableAncestors:nn,scrollableAncestorRects:On,measuringConfiguration:V,measuringScheduled:ce,windowRect:Kt}),[K,pe,me,X,vr,Fe,Ye,P,W,re,mn,he,nn,On,V,ce,Kt]),Ci=C.useMemo(()=>({activatorEvent:X,activators:ro,active:K,activeNodeRect:me,ariaDescribedById:{draggable:F},dispatch:E,draggableNodes:P,over:mn,measureDroppableContainers:he}),[X,ro,K,me,E,F,P,mn,he]);return ne.createElement(NN.Provider,{value:T},ne.createElement(od.Provider,{value:Ci},ne.createElement(WN.Provider,{value:Wn},ne.createElement(um.Provider,{value:va},d)),ne.createElement(rX,{disabled:(a==null?void 0:a.restoreFocus)===!1})),ne.createElement(aY,{...a,hiddenTextDescribedById:F}));function oo(){const gt=(ee==null?void 0:ee.autoScrollEnabled)===!1,Gt=typeof u=="object"?u.enabled===!1:u===!1,Me=R&&!gt&&!Gt;return typeof u=="object"?{...u,enabled:Me}:{enabled:Me}}}),aX=C.createContext(null),WS="button",lX="Draggable";function uX(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=rd(lX),{activators:i,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:g}=C.useContext(od),{role:x=WS,roleDescription:v="draggable",tabIndex:b=0}=o??{},k=(u==null?void 0:u.id)===e,E=C.useContext(k?um:aX),[_,T]=ip(),[A,D]=ip(),R=JY(i,e),O=Ec(n);Xr(()=>(f.set(e,{id:e,key:s,node:_,activatorNode:A,data:O}),()=>{const j=f.get(e);j&&j.key===s&&f.delete(e)}),[f,e]);const P=C.useMemo(()=>({role:x,tabIndex:b,"aria-disabled":r,"aria-pressed":k&&x===WS?!0:void 0,"aria-roledescription":v,"aria-describedby":h.draggable}),[r,x,b,k,v,h.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:P,isDragging:k,listeners:r?void 0:R,node:_,over:g,setNodeRef:T,setActivatorNodeRef:D,transform:E}}function KN(){return C.useContext(WN)}const cX="Droppable",dX={timeout:25};function fX(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=rd(cX),{active:i,dispatch:a,over:u,measureDroppableContainers:d}=C.useContext(od),h=C.useRef({disabled:n}),f=C.useRef(!1),g=C.useRef(null),x=C.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:k}={...dX,...o},E=Ec(b??r),_=C.useCallback(()=>{if(!f.current){f.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),x.current=null},k)},[k]),T=lm({callback:_,disabled:v||!i}),A=C.useCallback((P,j)=>{T&&(j&&(T.unobserve(j),f.current=!1),P&&T.observe(P))},[T]),[D,R]=ip(A),O=Ec(e);return C.useEffect(()=>{!T||!D.current||(T.disconnect(),f.current=!1,T.observe(D.current))},[D,T]),C.useEffect(()=>(a({type:Qt.RegisterDroppable,element:{id:r,key:s,disabled:n,node:D,rect:g,data:O}}),()=>a({type:Qt.UnregisterDroppable,key:s,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(a({type:Qt.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,a]),{active:i,rect:g,isOver:(u==null?void 0:u.id)===r,node:D,over:u,setNodeRef:R}}function hX(t){let{animation:e,children:n}=t;const[r,o]=C.useState(null),[s,i]=C.useState(null),a=ap(n);return!n&&!r&&a&&o(a),Xr(()=>{if(!s)return;const u=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(u==null||d==null){o(null);return}Promise.resolve(e(d,s)).then(()=>{o(null)})},[e,r,s]),ne.createElement(ne.Fragment,null,n,r?C.cloneElement(r,{ref:i}):null)}const pX={x:0,y:0,scaleX:1,scaleY:1};function mX(t){let{children:e}=t;return ne.createElement(od.Provider,{value:UN},ne.createElement(um.Provider,{value:pX},e))}const gX={position:"fixed",touchAction:"none"},yX=t=>im(t)?"transform 250ms ease":void 0,xX=C.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:u,transform:d,transition:h=yX}=t;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},g={...gX,width:a.width,height:a.height,top:a.top,left:a.left,transform:ds.Transform.toString(f),transformOrigin:o&&r?uY(r,a):void 0,transition:typeof h=="function"?h(r):h,...u};return ne.createElement(n,{className:i,style:g,ref:e},s)}),vX=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:i}=t;if(s!=null&&s.active)for(const[a,u]of Object.entries(s.active))u!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,u));if(s!=null&&s.dragOverlay)for(const[a,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(a,u);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[u,d]of Object.entries(o))n.node.style.setProperty(u,d);i!=null&&i.active&&n.node.classList.remove(i.active)}},bX=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:ds.Transform.toString(e)},{transform:ds.Transform.toString(n)}]},kX={duration:250,easing:"ease",keyframes:bX,sideEffects:vX({styles:{active:{opacity:"0"}}})};function wX(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return sm((s,i)=>{if(e===null)return;const a=n.get(s);if(!a)return;const u=a.node.current;if(!u)return;const d=HN(i);if(!d)return;const{transform:h}=Vn(i).getComputedStyle(i),f=ON(h);if(!f)return;const g=typeof e=="function"?e:CX(e);return $N(u,o.draggable.measure),g({active:{id:s,data:a.data,node:u,rect:o.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function CX(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={...kX,...t};return s=>{let{active:i,dragOverlay:a,transform:u,...d}=s;if(!e)return;const h={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:u.scaleX!==1?i.rect.width*u.scaleX/a.rect.width:1,scaleY:u.scaleY!==1?i.rect.height*u.scaleY/a.rect.height:1},g={x:u.x-h.x,y:u.y-h.y,...f},x=o({...d,active:i,dragOverlay:a,transform:{initial:u,final:g}}),[v]=x,b=x[x.length-1];if(JSON.stringify(v)===JSON.stringify(b))return;const k=r==null?void 0:r({active:i,dragOverlay:a,...d}),E=a.node.animate(x,{duration:e,easing:n,fill:"forwards"});return new Promise(_=>{E.onfinish=()=>{k==null||k(),_()}})}}let qS=0;function SX(t){return C.useMemo(()=>{if(t!=null)return qS++,qS},[t])}const EX=ne.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:u,zIndex:d=999}=t;const{activatorEvent:h,active:f,activeNodeRect:g,containerNodeRect:x,draggableNodes:v,droppableContainers:b,dragOverlay:k,over:E,measuringConfiguration:_,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:D}=KN(),R=C.useContext(um),O=SX(f==null?void 0:f.id),P=qN(i,{activatorEvent:h,active:f,activeNodeRect:g,containerNodeRect:x,draggingNodeRect:k.rect,over:E,overlayNodeRect:k.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:R,windowRect:D}),j=Nv(g),W=wX({config:r,draggableNodes:v,droppableContainers:b,measuringConfiguration:_}),Z=j?k.setRef:void 0;return ne.createElement(mX,null,ne.createElement(hX,{animation:W},f&&O?ne.createElement(xX,{key:O,id:f.id,ref:Z,as:a,activatorEvent:h,adjustScale:e,className:u,transition:s,rect:j,style:{zIndex:d,...o},transform:P},n):null))});function _X(t,e,n){const r={...t};return e.top+t.y<=n.top?r.y=n.top-e.top:e.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.bottom),e.left+t.x<=n.left?r.x=n.left-e.left:e.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.right),r}const TX=t=>{let{containerNodeRect:e,draggingNodeRect:n,transform:r}=t;return!n||!e?r:_X(r,n,e)},NX=t=>{let{transform:e}=t;return{...e,x:0}};function Ks(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function AX(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function Bf(t){return t!==null&&t>=0}function MX(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function DX(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const GN=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=Ks(e,r,n),i=e[o],a=s[o];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Vf={scaleX:1,scaleY:1},RX=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=t;const a=(e=s[n])!=null?e:r;if(!a)return null;if(o===n){const d=s[i];return d?{x:0,y:n<i?d.top+d.height-(a.top+a.height):d.top-a.top,...Vf}:null}const u=OX(s,o,n);return o>n&&o<=i?{x:0,y:-a.height-u,...Vf}:o<n&&o>=i?{x:0,y:a.height+u,...Vf}:{x:0,y:0,...Vf}};function OX(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return r?n<e?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const JN="Sortable",ZN=ne.createContext({activeIndex:-1,containerId:JN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:GN,disabled:{draggable:!1,droppable:!1}});function jX(t){let{children:e,id:n,items:r,strategy:o=GN,disabled:s=!1}=t;const{active:i,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:h}=KN(),f=rd(JN,n),g=a.rect!==null,x=C.useMemo(()=>r.map(R=>typeof R=="object"&&"id"in R?R.id:R),[r]),v=i!=null,b=i?x.indexOf(i.id):-1,k=d?x.indexOf(d.id):-1,E=C.useRef(x),_=!MX(x,E.current),T=k!==-1&&b===-1||_,A=DX(s);Xr(()=>{_&&v&&h(x)},[_,x,v,h]),C.useEffect(()=>{E.current=x},[x]);const D=C.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:T,items:x,overIndex:k,useDragOverlay:g,sortedRects:AX(x,u),strategy:o}),[b,f,A.draggable,A.droppable,T,x,k,u,g,o]);return ne.createElement(ZN.Provider,{value:D},e)}const IX=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return Ks(n,r,o).indexOf(e)},PX=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:a,previousContainerId:u,transition:d}=t;return!d||!r||a!==s&&o===i?!1:n?!0:i!==o&&e===u},LX={duration:200,easing:"ease"},YN="transform",zX=ds.Transition.toString({property:YN,duration:0,easing:"linear"}),FX={roleDescription:"sortable"};function $X(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,i]=C.useState(null),a=C.useRef(n);return Xr(()=>{if(!e&&n!==a.current&&r.current){const u=o.current;if(u){const d=Rl(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&i(h)}}n!==a.current&&(a.current=n)},[e,n,r,o]),C.useEffect(()=>{s&&i(null)},[s]),s}function XN(t){let{animateLayoutChanges:e=PX,attributes:n,disabled:r,data:o,getNewIndex:s=IX,id:i,strategy:a,resizeObserverConfig:u,transition:d=LX}=t;const{items:h,containerId:f,activeIndex:g,disabled:x,disableTransforms:v,sortedRects:b,overIndex:k,useDragOverlay:E,strategy:_}=C.useContext(ZN),T=BX(r,x),A=h.indexOf(i),D=C.useMemo(()=>({sortable:{containerId:f,index:A,items:h},...o}),[f,o,A,h]),R=C.useMemo(()=>h.slice(h.indexOf(i)),[h,i]),{rect:O,node:P,isOver:j,setNodeRef:W}=fX({id:i,data:D,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...u}}),{active:Z,activatorEvent:J,activeNodeRect:K,attributes:Y,setNodeRef:ee,listeners:G,isDragging:X,over:q,setActivatorNodeRef:te,transform:F}=uX({id:i,data:D,attributes:{...FX,...n},disabled:T.draggable}),L=GZ(W,ee),V=!!Z,re=V&&!v&&Bf(g)&&Bf(k),he=!E&&X,ce=he&&re?F:null,Re=re?ce??(a??_)({rects:b,activeNodeRect:K,activeIndex:g,overIndex:k,index:A}):null,Q=Bf(g)&&Bf(k)?s({id:i,items:h,activeIndex:g,overIndex:k}):A,de=Z==null?void 0:Z.id,me=C.useRef({activeId:de,items:h,newIndex:Q,containerId:f}),Fe=h!==me.current.items,Oe=e({active:Z,containerId:f,isDragging:X,isSorting:V,id:i,index:A,items:h,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:d,wasDragging:me.current.activeId!=null}),Be=$X({disabled:!Oe,index:A,node:P,rect:O});return C.useEffect(()=>{V&&me.current.newIndex!==Q&&(me.current.newIndex=Q),f!==me.current.containerId&&(me.current.containerId=f),h!==me.current.items&&(me.current.items=h)},[V,Q,f,h]),C.useEffect(()=>{if(de===me.current.activeId)return;if(de!=null&&me.current.activeId==null){me.current.activeId=de;return}const Mt=setTimeout(()=>{me.current.activeId=de},50);return()=>clearTimeout(Mt)},[de]),{active:Z,activeIndex:g,attributes:Y,data:D,rect:O,index:A,newIndex:Q,items:h,isOver:j,isSorting:V,isDragging:X,listeners:G,node:P,overIndex:k,over:q,setNodeRef:L,setActivatorNodeRef:te,setDroppableNodeRef:W,setDraggableNodeRef:ee,transform:Be??Re,transition:Ye()};function Ye(){if(Be||Fe&&me.current.newIndex===A)return zX;if(!(he&&!im(J)||!d)&&(V||Oe))return ds.Transition.toString({...d,property:YN})}}function BX(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function dp(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const VX=[Ze.Down,Ze.Right,Ze.Up,Ze.Left],HX=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(VX.includes(t.code)){if(t.preventDefault(),!n||!r)return;const u=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const g=o.get(f.id);if(g)switch(t.code){case Ze.Down:r.top<g.top&&u.push(f);break;case Ze.Up:r.top>g.top&&u.push(f);break;case Ze.Left:r.left>g.left&&u.push(f);break;case Ze.Right:r.left<g.left&&u.push(f);break}});const d=fY({collisionRect:r,droppableRects:o,droppableContainers:u});let h=DN(d,"id");if(h===(i==null?void 0:i.id)&&d.length>1&&(h=d[1].id),h!=null){const f=s.get(n.id),g=s.get(h),x=g?o.get(g.id):null,v=g==null?void 0:g.node.current;if(v&&x&&f&&g){const k=am(v).some((R,O)=>a[O]!==R),E=QN(f,g),_=UX(f,g),T=k||!E?{x:0,y:0}:{x:_?r.width-x.width:0,y:_?r.height-x.height:0},A={x:x.left,y:x.top};return T.x&&T.y?A:_c(A,T)}}}};function QN(t,e){return!dp(t)||!dp(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function UX(t,e){return!dp(t)||!dp(e)||!QN(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const Av=C.forwardRef(({label:t,className:e,...n},r)=>m.jsx(Ee,{ref:r,type:"button",variant:"ghost",size:"icon-xs","aria-label":t,title:t,className:Ce("cursor-grab touch-none text-muted-foreground/50 hover:bg-transparent hover:text-foreground active:cursor-grabbing",e),...n,children:m.jsx(xx,{})}));Av.displayName="DragHandle";function eA({ids:t,onReorder:e,renderOverlay:n,children:r}){const[o,s]=C.useState(null),i=lY(OS(Tv,{activationConstraint:{distance:4}}),OS(Ev,{coordinateGetter:HX})),a=d=>t.indexOf(String(d))+1,u={onDragStart:()=>M("Item picked up. Use the arrow keys to move it, space to drop it."),onDragOver:({over:d})=>d?M("Moving to position {n}.",{n:a(d.id)}):M("The item is outside the list."),onDragEnd:({over:d})=>d?M("Dropped at position {n}.",{n:a(d.id)}):M("The item returned to its original place."),onDragCancel:()=>M("Move cancelled.")};return m.jsxs(iX,{accessibility:{announcements:u},sensors:i,collisionDetection:dY,modifiers:[NX,TX],onDragStart:({active:d})=>s(String(d.id)),onDragCancel:()=>s(null),onDragEnd:({active:d,over:h})=>{if(s(null),!h||d.id===h.id)return;const f=t.indexOf(String(d.id)),g=t.indexOf(String(h.id));f<0||g<0||e(f,g)},children:[m.jsx(jX,{items:t,strategy:RX,children:r}),m.jsx(EX,{children:o?n(o):null})]})}function tA({className:t,size:e="default",...n}){return m.jsx("div",{"data-slot":"card","data-size":e,className:Ce("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function WX({className:t,...e}){return m.jsx("div",{"data-slot":"card-header",className:Ce("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",t),...e})}function nA({className:t,...e}){return m.jsx("div",{"data-slot":"card-content",className:Ce("px-(--card-spacing)",t),...e})}const Mv=[{type:"text",label:"Text",desc:"Single line of text",icon:sL},{type:"richtext",label:"Rich text",desc:"Markdown content",icon:GP},{type:"number",label:"Number",desc:"Numeric value",icon:e9},{type:"boolean",label:"Yes / No",desc:"True or false",icon:tL},{type:"date",label:"Date",desc:"Calendar date",icon:yP},{type:"select",label:"Select",desc:"A fixed list of options",icon:b_},{type:"relation",label:"Relation",desc:"Link to another collection",icon:v_},{type:"image",label:"Image",desc:"Image URL or path",icon:x_},{type:"url",label:"URL",desc:"Web address",icon:g9},{type:"email",label:"Email",desc:"Email address",icon:aP},{type:"list",label:"List",desc:"Free-text tags",icon:Y9},{type:"color",label:"Color",desc:"Hex color picker",icon:k_},{type:"group",label:"Group",desc:"Nested fields",icon:jc}],Dv=Object.fromEntries(Mv.map(t=>[t.type,t]));let KS=0;function la(t){return KS+=1,`${t}${KS}`}function c1(t){return JSON.parse(JSON.stringify(t))}function qX(t){const e=(n,r)=>n.map(o=>({id:la(r),fields:o.fields.map(()=>la("f"))}));return{collections:e(t.collections,"c"),singletons:e(t.singletons,"s")}}function KX(t){const e=n=>n.map(r=>({id:r.id,fields:[...r.fields]}));return{collections:e(t.collections),singletons:e(t.singletons)}}function GX(t,e){const n=(r,o,s)=>r.map((i,a)=>{const u=o[a];return{id:(u==null?void 0:u.id)??la(s),fields:i.fields.map((d,h)=>(u==null?void 0:u.fields[h])??la("f"))}});return{collections:n(t.collections,e.collections,"c"),singletons:n(t.singletons,e.singletons,"s")}}function GS(){return{fields:[{key:"field1",label:"",type:"text"}]}}function cm(t,e){let n=1;for(;e.includes(`${t}${n}`);)n+=1;return`${t}${n}`}function d1(t,e){const n=cm("collection",t.collections.map(r=>r.name));t.collections.push({name:n,label:M("New collection"),path:n,fields:[]}),e.collections.push({id:la("c"),fields:[]})}function f1(t,e){const n=cm("singleton",t.singletons.map(r=>r.name));t.singletons.push({name:n,label:M("New singleton"),path:`${n}.json`,fields:[]}),e.singletons.push({id:la("s"),fields:[]})}function JX({schema:t,onSaved:e,onBrowseTemplates:n,initialAdd:r}){const[o,s]=C.useState(()=>{const j=c1(t),W=qX(j);return r==="collection"?d1(j,W):r==="singleton"&&f1(j,W),{schema:j,ids:W}}),[i,a]=C.useState(()=>{const j=[...o.ids.collections,...o.ids.singletons];return j.length<=5?{}:Object.fromEntries(j.map(W=>[W.id,!0]))}),[u,d]=C.useState(!1),[h,f]=C.useState(null),[g,x]=C.useState(null),v=o.schema,b=o.ids,k=v.collections.map(j=>j.name),E=j=>s(W=>{const Z=c1(W.schema);return j(Z),{schema:Z,ids:W.ids}}),_=j=>s(W=>{const Z=c1(W.schema),J=KX(W.ids);return j(Z,J),{schema:Z,ids:GX(Z,J)}}),T=(j,W)=>a(Z=>({...Z,[j]:W})),A=(j,W)=>a(Z=>{const J={...Z};for(const K of j)J[K.id]=W;return J}),D=v.collections.length===0&&v.singletons.length===0,R=j=>{g&&(_((W,Z)=>{var ee;const J=g.kind==="collection"?W.collections:W.singletons,K=g.kind==="collection"?Z.collections:Z.singletons,Y=J[g.ci];if(Y)if(g.fi===null){const G=cm("field",Y.fields.map(X=>X.key));Y.fields.push({key:G,label:"",type:j,...j==="group"?GS():{}}),(ee=K[g.ci])==null||ee.fields.push(la("f"))}else{const G=Y.fields[g.fi];if(!G)return;G.type=j,j!=="select"&&(G.options=void 0),j!=="relation"&&(G.to=void 0),j!=="group"?G.fields=void 0:(!G.fields||G.fields.length===0)&&(G.fields=GS().fields)}}),x(null))},O=async()=>{f(null),d(!0);try{await L_(v),e()}catch(j){f(j.message)}finally{d(!1)}},P=j=>{const W=j==="collection"?v.collections:v.singletons,Z=j==="collection"?b.collections:b.singletons;return m.jsx(eA,{ids:Z.map(J=>J.id),onReorder:(J,K)=>_((Y,ee)=>{j==="collection"?(Y.collections=Ks(Y.collections,J,K),ee.collections=Ks(ee.collections,J,K)):(Y.singletons=Ks(Y.singletons,J,K),ee.singletons=Ks(ee.singletons,J,K))}),renderOverlay:J=>{const K=Z.findIndex(ee=>ee.id===J),Y=W[K];return Y?m.jsx(QX,{container:Y}):null},children:W.map((J,K)=>{const Y=Z[K];return Y?m.jsx(YX,{id:Y.id,container:J,kind:j,collectionNames:k,fieldIds:Y.fields,collapsed:i[Y.id]??!1,onToggleCollapse:()=>T(Y.id,!i[Y.id]),onChange:ee=>E(G=>{const q=(j==="collection"?G.collections:G.singletons)[K];q&&ee(q)}),onRemove:()=>_((ee,G)=>{j==="collection"?(ee.collections.splice(K,1),G.collections.splice(K,1)):(ee.singletons.splice(K,1),G.singletons.splice(K,1))}),onRemoveField:ee=>_((G,X)=>{var F,L;const q=j==="collection"?G.collections:G.singletons,te=j==="collection"?X.collections:X.singletons;(F=q[K])==null||F.fields.splice(ee,1),(L=te[K])==null||L.fields.splice(ee,1)}),onReorderFields:(ee,G)=>_((X,q)=>{const te=j==="collection"?X.collections:X.singletons,F=j==="collection"?q.collections:q.singletons,L=te[K],V=F[K];!L||!V||(L.fields=Ks(L.fields,ee,G),V.fields=Ks(V.fields,ee,G))}),onAddField:()=>x({kind:j,ci:K,fi:null}),onChangeType:ee=>x({kind:j,ci:K,fi:ee})},Y.id):null})})};return m.jsxs("div",{className:"flex h-full flex-col",children:[m.jsx("header",{className:"sticky top-0 z-10 shrink-0 border-b bg-card px-8 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-4xl items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-heading text-lg font-semibold text-foreground",children:M("Schema")}),m.jsx("p",{className:"text-sm text-muted-foreground",children:M("Design your collections and fields.")})]}),m.jsxs(Ee,{type:"button",onClick:O,disabled:u,children:[m.jsx(Ic,{}),M(u?"Saving…":"Save schema")]})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:m.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[h&&m.jsx("p",{className:"mb-5 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:h}),D?m.jsx(ZX,{onAddCollection:()=>_(d1),onAddSingleton:()=>_(f1),onBrowseTemplates:n}):m.jsxs("div",{className:"space-y-10",children:[m.jsx(JS,{title:M("Collections"),hint:M("Content with many entries (posts, products…)"),onAdd:()=>_(d1),allCollapsed:b.collections.length>0&&b.collections.every(j=>i[j.id]),onToggleAll:b.collections.length>1?j=>A(b.collections,j):void 0,children:P("collection")}),m.jsx(JS,{title:M("Singletons"),hint:M("A single record (site settings, profile…)"),onAdd:()=>_(f1),allCollapsed:b.singletons.length>0&&b.singletons.every(j=>i[j.id]),onToggleAll:b.singletons.length>1?j=>A(b.singletons,j):void 0,children:P("singleton")})]})]})}),m.jsx(sQ,{open:g!==null,onPick:R,onClose:()=>x(null)})]})}function JS({title:t,hint:e,onAdd:n,allCollapsed:r,onToggleAll:o,children:s}){return m.jsxs("section",{children:[m.jsxs("div",{className:"mb-3 flex items-end justify-between gap-3",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t}),m.jsx("p",{className:"text-xs text-muted-foreground/70",children:e})]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&m.jsxs(Ee,{type:"button",variant:"ghost",size:"sm",onClick:()=>o(!r),className:"text-muted-foreground",children:[r?m.jsx(p_,{}):m.jsx(_P,{}),M(r?"Expand all":"Collapse all")]}),m.jsxs(Ee,{type:"button",variant:"outline",size:"sm",onClick:n,children:[m.jsx(li,{})," ",M("Add")]})]})]}),m.jsx("div",{className:"space-y-3",children:s})]})}function ZX({onAddCollection:t,onAddSingleton:e,onBrowseTemplates:n}){return m.jsx(tA,{className:"mx-auto max-w-md",children:m.jsxs(nA,{className:"flex flex-col items-center px-8 py-10 text-center",children:[m.jsx("div",{className:"mb-4 flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:m.jsx(jc,{className:"size-7"})}),m.jsx("h2",{className:"font-heading text-lg font-semibold text-foreground",children:M("Your schema is empty")}),m.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:M("A collection describes one type of your content — posts, products, projects. Start by adding the first one.")}),m.jsxs(Ee,{type:"button",size:"lg",onClick:t,className:"mt-6",children:[m.jsx(li,{})," ",M("Add collection")]}),m.jsxs("div",{className:"mt-3 flex items-center gap-3 text-sm",children:[m.jsx(Ee,{type:"button",variant:"link",onClick:e,className:"h-auto p-0 text-muted-foreground hover:text-foreground",children:M("Add a singleton")}),n&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-border",children:"·"}),m.jsx(Ee,{type:"button",variant:"link",onClick:n,className:"h-auto p-0",children:M("or start from a template")})]})]})]})})}function YX({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:a,isDragging:u}=XN({id:t});return m.jsx("div",{ref:o,style:{transform:ds.Translate.toString(i),transition:a},className:Ce(u&&"opacity-40"),children:m.jsx(XX,{...e,dragHandle:m.jsx(Av,{ref:s,label:M("Drag to reorder"),...n,...r})})})}function XX({container:t,kind:e,collectionNames:n,fieldIds:r,collapsed:o,onToggleCollapse:s,onChange:i,onRemove:a,onRemoveField:u,onReorderFields:d,onAddField:h,onChangeType:f,dragHandle:g}){const x=b=>{const k=Ip(b);i(E=>{E.name=k,E.path=e==="collection"?k:`${k}.json`})},v=t.fields.length;return m.jsxs(tA,{className:"gap-0 overflow-hidden py-0 shadow-sm",children:[m.jsxs(WX,{className:Ce("relative grid grid-cols-[1.5rem_1.75rem_minmax(0,1fr)_auto_1.75rem] items-center gap-2 bg-muted/40 px-4 py-3",!o&&"border-b"),children:[m.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,onClick:s,className:"absolute inset-0 cursor-pointer"}),m.jsx("div",{className:"relative opacity-0 transition group-focus-within/card:opacity-100 group-hover/card:opacity-100 focus-within:opacity-100",children:g}),m.jsx(Ee,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,"aria-expanded":!o,"aria-label":M(o?"Expand":"Collapse"),className:"relative text-muted-foreground",children:m.jsx(gx,{className:Ce("transition-transform",o&&"-rotate-90")})}),m.jsx(jt,{className:"relative h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:M(e==="collection"?"Collection name":"Singleton name"),onChange:b=>i(k=>{k.label=b.target.value})}),m.jsxs("div",{className:"relative flex items-center gap-2",children:[o&&m.jsx("span",{className:"whitespace-nowrap rounded-full bg-foreground/5 px-2 py-0.5 text-xs text-muted-foreground",children:lc(v,"{n} field","{n} fields")}),m.jsx(jt,{className:"h-8 w-40 border-transparent bg-transparent font-mono text-xs text-primary hover:border-input focus-visible:bg-background",value:t.name,placeholder:"api-name",onChange:b=>x(b.target.value)})]}),m.jsx(Rv,{label:M("Delete"),danger:!0,onClick:a,className:"relative",children:m.jsx(E_,{})})]}),!o&&m.jsxs(m.Fragment,{children:[m.jsxs(nA,{className:"px-0",children:[v===0&&m.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:M("No fields yet. Add the first one below.")}),m.jsx(eA,{ids:r,onReorder:d,renderOverlay:b=>{const k=r.indexOf(b),E=t.fields[k];return E?m.jsx(oQ,{field:E}):null},children:m.jsx("div",{className:"divide-y divide-border/60",children:t.fields.map((b,k)=>{const E=r[k];return E?m.jsx(eQ,{id:E,field:b,collectionNames:n,onChange:_=>i(T=>_(T.fields[k])),onRemove:()=>u(k),onChangeType:()=>f(k)},E):null})})})]}),m.jsxs(Ee,{type:"button",variant:"ghost",onClick:h,className:"h-11 w-full justify-center gap-1.5 rounded-none border-t text-primary hover:bg-primary/5 hover:text-primary",children:[m.jsx(li,{})," ",M("Add field")]})]})]})}function QX({container:t}){return m.jsxs("div",{className:"flex scale-[1.01] items-center gap-2 rounded-xl bg-card px-4 py-3 shadow-lg ring-2 ring-primary/40",children:[m.jsx(xx,{className:"size-4 shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||t.name}),m.jsx("span",{className:"truncate font-mono text-xs text-primary",children:t.name}),m.jsx("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:lc(t.fields.length,"{n} field","{n} fields")})]})}function eQ({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:a,isDragging:u}=XN({id:t});return m.jsx(tQ,{...e,rowRef:o,style:{transform:ds.Translate.toString(i),transition:a},dragging:u,dragHandle:m.jsx(Av,{ref:s,label:M("Drag to reorder"),...n,...r})})}function tQ({field:t,collectionNames:e,onChange:n,onRemove:r,onChangeType:o,rowRef:s,style:i,dragging:a,dragHandle:u}){const d=Dv[t.type],h=d.icon,f="opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100 focus-within:opacity-100";return m.jsxs("div",{ref:s,style:i,className:Ce("group/row grid grid-cols-[1.5rem_2rem_minmax(0,1fr)_7rem_4.5rem_1.75rem] items-center gap-2 bg-card px-4 py-2.5 md:grid-cols-[1.5rem_2rem_minmax(0,1fr)_10rem_4.5rem_1.75rem]",a&&"opacity-40"),children:[m.jsx("div",{className:f,children:u}),m.jsxs(vx,{children:[m.jsx(bx,{asChild:!0,children:m.jsx(Ee,{type:"button",variant:"ghost",size:"icon",onClick:o,"aria-label":M("Change type"),className:"bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",children:m.jsx(h,{})})}),m.jsxs(kx,{children:[M(d.label)," · ",M("change type")]})]}),m.jsx(jt,{className:"h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:M("Field name"),onChange:g=>n(x=>{x.label=g.target.value})}),m.jsx(jt,{className:"h-8 border-transparent bg-transparent font-mono text-xs text-muted-foreground hover:border-input focus-visible:bg-background focus-visible:text-foreground",value:t.key,placeholder:M("key"),onChange:g=>n(x=>{x.key=Ip(g.target.value)})}),m.jsx(Ee,{type:"button",size:"xs",variant:t.required?"default":"ghost","aria-pressed":t.required??!1,title:t.required?M("Required field"):M("Make it required"),onClick:()=>n(g=>{g.required=!g.required}),className:Ce("w-full rounded-full",!t.required&&`border-dashed border-border text-muted-foreground ${f}`),children:M("Required")}),m.jsx(Rv,{label:M("Delete"),danger:!0,onClick:r,className:f,children:m.jsx(pa,{})}),t.type==="select"&&m.jsx(jt,{className:"col-start-3 col-end-[-1] row-start-2 mt-1",value:(t.options??[]).join(", "),placeholder:M("options (comma separated)"),onChange:g=>n(x=>{x.options=g.target.value.split(",").map(v=>v.trim()).filter(Boolean)})}),t.type==="relation"&&m.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:m.jsxs(Qu,{value:t.to||void 0,onValueChange:g=>n(x=>{x.to=g}),children:[m.jsx(tc,{className:"w-full",children:m.jsx(ec,{placeholder:M("pick a target collection…")})}),m.jsx(nc,{children:e.map(g=>m.jsx(rc,{value:g,children:g},g))})]})}),t.type==="group"&&m.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:m.jsx(rQ,{field:t,onChange:n})})]})}const nQ=Mv.filter(t=>t.type!=="group");function rQ({field:t,onChange:e}){const n=t.fields??[];return m.jsxs("div",{className:"space-y-1.5 rounded-lg border border-dashed bg-muted/20 p-2.5",children:[n.map((r,o)=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsxs(Qu,{value:r.type,onValueChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.type=s)}),children:[m.jsx(tc,{className:"h-8 w-[7.5rem] shrink-0",children:m.jsx(ec,{})}),m.jsx(nc,{children:nQ.map(({type:s,label:i})=>m.jsx(rc,{value:s,children:M(i)},s))})]}),m.jsx(jt,{className:"h-8 flex-1 font-mono text-xs",value:r.key,placeholder:M("key"),onChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.key=Ip(s.target.value))})}),m.jsx(jt,{className:"h-8 flex-1",value:r.label??"",placeholder:M("Display name"),onChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.label=s.target.value)})}),m.jsx(Rv,{label:M("Delete sub-field"),danger:!0,onClick:()=>e(s=>{s.fields&&(s.fields=s.fields.filter((i,a)=>a!==o))}),children:m.jsx(pa,{})})]},o)),m.jsxs(Ee,{type:"button",size:"xs",variant:"ghost",className:"text-muted-foreground",onClick:()=>e(r=>{const o=(r.fields??[]).map(s=>s.key);r.fields=[...r.fields??[],{key:cm("field",o),label:"",type:"text"}]}),children:[m.jsx(li,{})," ",M("Add sub-field")]})]})}function oQ({field:t}){const e=Dv[t.type],n=e.icon;return m.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-card px-4 py-2.5 shadow-lg ring-2 ring-primary/40",children:[m.jsx(xx,{className:"size-4 shrink-0 text-muted-foreground"}),m.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:m.jsx(n,{className:"size-4"})}),m.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||M(e.label)}),m.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:t.key})]})}function sQ({open:t,onPick:e,onClose:n}){return m.jsx(Lc,{open:t,onOpenChange:r=>{r||n()},children:m.jsxs(zc,{className:"sm:max-w-lg",children:[m.jsxs(Fc,{children:[m.jsx($c,{children:M("Pick a field type")}),m.jsx(Bc,{children:M("Choose what kind of data this field holds.")})]}),m.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:Mv.map(({type:r,label:o,desc:s,icon:i})=>m.jsxs("button",{type:"button",onClick:()=>e(r),className:"flex items-start gap-3 rounded-xl border p-3 text-left outline-none transition-colors hover:border-primary hover:bg-primary/5 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",children:[m.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:m.jsx(i,{className:"size-4"})}),m.jsxs("span",{children:[m.jsx("span",{className:"block text-sm font-medium text-foreground",children:M(o)}),m.jsx("span",{className:"block text-xs text-muted-foreground",children:M(s)})]})]},r))})]})})}function Rv({children:t,label:e,danger:n,onClick:r,className:o}){return m.jsxs(vx,{children:[m.jsx(bx,{asChild:!0,children:m.jsx(Ee,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":e,className:Ce("text-muted-foreground",n&&"hover:bg-destructive/10 hover:text-destructive",o),children:t})}),m.jsx(kx,{children:e})]})}function ZS(t){return t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function iQ(t,e){if(t==="astro")return{install:"npm install @kdrgny/justjson-astro",file:"src/content.config.ts",code:["import { justjsonCollections } from '@kdrgny/justjson-astro'","","export const collections = await justjsonCollections()"].join(`
666
+ `)};const n=[...e.collections.map(o=>`load${ZS(o.name)}`),...e.singletons.map(o=>`load${ZS(o.name)}`)].slice(0,3),r=n[0]??"loadPosts";return{install:"npx @kdrgny/justjson types",file:"anywhere in your build",code:[`import { ${n.join(", ")||"loadPosts"} } from './content'`,"",`const items = await ${r}()`].join(`
667
+ `)}}const aQ=[{name:"Vercel",url:t=>`https://vercel.com/new/clone?repository-url=${encodeURIComponent(t)}`},{name:"Netlify",url:t=>`https://app.netlify.com/start/deploy?repository=${encodeURIComponent(t)}`}],lQ={astro:"Astro",next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",vite:"Vite",node:"Node",unknown:"this project"};function Hf({code:t}){const e=()=>{navigator.clipboard&&navigator.clipboard.writeText(t),Ct.success(M("Copied"))};return m.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[m.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-1.5",children:[m.jsx(Q9,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),m.jsxs(Ee,{variant:"ghost",size:"xs",onClick:e,className:"ml-auto text-muted-foreground hover:text-primary",children:[m.jsx(m_,{})," ",M("Copy")]})]}),m.jsx("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs leading-relaxed text-foreground",children:t})]})}function bu({index:t,title:e,done:n,children:r}){return m.jsxs("section",{className:"rounded-xl border bg-card p-5 shadow-sm",children:[m.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[m.jsx("span",{className:Ce("flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-medium",n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:n?m.jsx(Ic,{className:"size-3.5"}):t}),m.jsx("h2",{className:"font-medium text-foreground",children:e})]}),m.jsx("div",{className:"space-y-3 pl-8.5",children:r})]})}function uQ({schema:t}){const[e,n]=C.useState(null),[r,o]=C.useState("content: update"),[s,i]=C.useState(""),[a,u]=C.useState(null),[d,h]=C.useState(!1),f=C.useCallback(async()=>{try{n(await $_())}catch{n(null)}},[]);C.useEffect(()=>{f()},[f]);const g=async(O,P)=>{u(O);try{Ct.success(await P()),await f()}catch(j){Ct.error(j.message)}finally{u(null)}},x=async()=>{const{committed:O,count:P}=await ez(r);return O?M("Committed {n} file(s).",{n:P}):M("Nothing to commit — content is up to date.")},v=async()=>{const{branch:O}=await tz();return M("Pushed {branch} to origin.",{branch:O})},b=async()=>{const{written:O,skipped:P}=await X7();return h(!0),P.length>0?M("Created {n} file(s); kept {k} of your own.",{n:O.length,k:P.length}):M("Created {n} file(s).",{n:O.length})},k=async()=>{const{committed:O,count:P,branch:j}=await Q7(r);return O?M("Published {n} change(s) to {branch}.",{n:P,branch:j}):M("Nothing new to publish — {branch} is up to date.",{branch:j})},E=async()=>{const O=await nz(s,!0);return M("Created {name} on GitHub and pushed it.",{name:O.name})},_=e==null?void 0:e.git,T=iQ((e==null?void 0:e.framework)??"unknown",t),A=(_==null?void 0:_.pendingFiles)??0,D=(_==null?void 0:_.remoteWebUrl)??null,R=e!==null&&(e.framework==="unknown"||d);return m.jsxs(Jr,{children:[m.jsx(Zr,{title:M("Ship it"),subtitle:M("Your content is on disk. Here is what comes next.")}),m.jsx(Hc,{children:m.jsxs("div",{className:"mx-auto max-w-2xl space-y-4 px-8 py-6",children:[R?m.jsxs(bu,{index:1,title:M("Give your content a site"),done:d,children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:M("There is no site in this folder yet. JustJSON can generate a small Astro site wired to your content — a home page listing every collection, and a page per entry.")}),m.jsxs(Ee,{onClick:()=>g("scaffold",b),disabled:a!==null,children:[a==="scaffold"?m.jsx(Ln,{className:"animate-spin"}):m.jsx(il,{}),M("Create an Astro site")]}),d&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:M("Now start it:")}),m.jsx(Hf,{code:`npm install
668
+ npm run dev`})]}),m.jsx("p",{className:"text-xs text-muted-foreground",children:M("Nothing you already have is overwritten.")})]}):m.jsxs(bu,{index:1,title:M("Use it in {framework}",{framework:lQ[(e==null?void 0:e.framework)??"unknown"]}),children:[T.install&&m.jsx(Hf,{code:T.install}),m.jsx("p",{className:"text-xs text-muted-foreground",children:T.file}),m.jsx(Hf,{code:T.code})]}),m.jsx(bu,{index:2,title:M("Commit your content"),done:!!(_!=null&&_.isRepo)&&A===0,children:_!=null&&_.isRepo?m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:A>0?M("{n} file(s) waiting on branch {branch}.",{n:A,branch:_.branch??"—"}):M("Everything is committed.")}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(jt,{value:r,onChange:O=>o(O.target.value),className:"font-mono text-xs",disabled:A===0}),m.jsxs(Ee,{onClick:()=>g("commit",x),disabled:A===0||a!==null,children:[a==="commit"?m.jsx(Ln,{className:"animate-spin"}):m.jsx(YP,{}),M("Commit")]})]})]}):m.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-border bg-muted/40 px-3 py-2.5 text-sm text-muted-foreground",children:[m.jsx(Pc,{className:"mt-0.5 size-4 shrink-0"}),m.jsx("span",{children:M("This folder is not a git repository yet.")})]})}),m.jsx(bu,{index:3,title:M("Send it to GitHub"),done:!!(_!=null&&_.hasRemote),children:_!=null&&_.hasRemote?m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:_.remoteUrl}),m.jsxs(Ee,{variant:"outline",onClick:()=>g("push",v),disabled:a!==null,children:[a==="push"?m.jsx(Ln,{className:"animate-spin"}):m.jsx(Xu,{}),M("Push")]})]}):_!=null&&_.hasGh?m.jsxs(m.Fragment,{children:[m.jsx(Bi,{className:"text-sm",children:M("Create a private repository")}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(jt,{value:s,onChange:O=>i(O.target.value),placeholder:"my-site",className:"font-mono text-xs"}),m.jsxs(Ee,{onClick:()=>g("repo",E),disabled:!s.trim()||a!==null,children:[a==="repo"?m.jsx(Ln,{className:"animate-spin"}):m.jsx(Xu,{}),M("Create & push")]})]}),m.jsx("p",{className:"text-xs text-muted-foreground",children:M("Uses the GitHub CLI already signed in on this machine — no token is stored.")})]}):m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:M("Add a remote yourself, then come back to push:")}),m.jsx(Hf,{code:`git remote add origin <url>
669
+ git push -u origin main`})]})}),m.jsx(bu,{index:4,title:M("Put it online"),children:D?m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:M("Hand the repository to a host once. After that, publishing is one button — they rebuild your site on every push.")}),m.jsx("div",{className:"flex flex-wrap gap-2",children:aQ.map(O=>m.jsxs("a",{href:O.url(D),target:"_blank",rel:"noreferrer",className:Ce(Mp({variant:"outline"})),children:[m.jsx(g_,{}),M("Deploy to {host}",{host:O.name})]},O.name))}),m.jsxs("div",{className:"mt-1 rounded-lg border bg-muted/40 p-3",children:[m.jsx("p",{className:"mb-2.5 text-sm text-muted-foreground",children:M("Already online? Send your latest changes:")}),m.jsxs(Ee,{onClick:()=>g("publish",k),disabled:a!==null,children:[a==="publish"?m.jsx(Ln,{className:"animate-spin"}):m.jsx(S_,{}),M("Publish changes")]})]})]}):m.jsx("p",{className:"text-sm text-muted-foreground",children:M("Send your project to GitHub first — hosts deploy straight from a repository.")})})]})})]})}function Ov({className:t,...e}){return m.jsx("textarea",{"data-slot":"textarea",className:Ce("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...e})}const Iy={gemini:{id:"gemini",label:"Google Gemini",hint:"Has a free tier — use your own Gemini API key.",modelPlaceholder:"gemini-2.0-flash",keyUrl:"https://aistudio.google.com/apikey"},groq:{id:"groq",label:"Groq",hint:"Has a free tier — fast open models.",modelPlaceholder:"llama-3.3-70b-versatile",keyUrl:"https://console.groq.com/keys"},openrouter:{id:"openrouter",label:"OpenRouter",hint:"Plenty of free models (their names end in :free).",modelPlaceholder:"meta-llama/llama-3.3-70b-instruct:free",keyUrl:"https://openrouter.ai/keys"},custom:{id:"custom",label:"Custom (OpenAI-compatible)",hint:"Your own server, or a local service like Ollama.",modelPlaceholder:"llama3.1",needsBaseUrl:!0,keyUrl:""}},cQ=Object.values(Iy),jv="jj-ai-config";function dQ(){try{const t=localStorage.getItem(jv);if(!t)return null;const e=JSON.parse(t);return!e.provider||!e.model||!e.apiKey?null:e}catch{return null}}function fQ(t){localStorage.setItem(jv,JSON.stringify(t))}function hQ(){localStorage.removeItem(jv)}const rA=C.createContext(null);function Iv(){const t=C.useContext(rA);if(!t)throw new Error("useAiSettings must be used inside AiSettingsProvider");return t}function pQ({children:t}){const[e,n]=C.useState(()=>dQ()),[r,o]=C.useState(!1),[s,i]=C.useState((e==null?void 0:e.provider)??"gemini"),[a,u]=C.useState((e==null?void 0:e.model)??""),[d,h]=C.useState((e==null?void 0:e.apiKey)??""),[f,g]=C.useState((e==null?void 0:e.baseUrl)??""),[x,v]=C.useState([]),[b,k]=C.useState(!1),[E,_]=C.useState(!1),T=C.useMemo(()=>Iy[s],[s]),A=()=>{i((e==null?void 0:e.provider)??"gemini"),u((e==null?void 0:e.model)??""),h((e==null?void 0:e.apiKey)??""),g((e==null?void 0:e.baseUrl)??""),v([]),_(!1),o(!0)},D=j=>{i(j),u(""),v([]),_(!1)},R=async()=>{var W;const j=Iy[s];if(!j.needsBaseUrl&&!d.trim()){Ct.error(M("Enter an API key first"));return}if(j.needsBaseUrl&&!f.trim()){Ct.error(M("Enter a base URL first"));return}k(!0);try{const Z=await Y7({provider:s,apiKey:d.trim(),...j.needsBaseUrl?{baseUrl:f.trim()}:{}});if(Z.length===0){_(!0),Ct.error(M("No models found — you can type one in"));return}v(Z),_(!1),Z.some(J=>J.id===a)||u(((W=Z[0])==null?void 0:W.id)??"")}catch(Z){_(!0),Ct.error(Z.message)}finally{k(!1)}},O=()=>{if(!a.trim()){Ct.error(M("A model name is required"));return}if(T.needsBaseUrl&&!f.trim()){Ct.error(M("A base URL is required"));return}if(!T.needsBaseUrl&&!d.trim()){Ct.error(M("An API key is required"));return}const j={provider:s,model:a.trim(),apiKey:d.trim(),...T.needsBaseUrl?{baseUrl:f.trim()}:{}};fQ(j),n(j),o(!1),Ct.success(M("AI settings saved"))},P=()=>{hQ(),n(null),h(""),u(""),Ct.success(M("AI disconnected"))};return m.jsxs(rA.Provider,{value:{config:e,openSettings:A},children:[t,m.jsx(Lc,{open:r,onOpenChange:o,children:m.jsxs(zc,{children:[m.jsxs(Fc,{children:[m.jsxs($c,{className:"flex items-center gap-2",children:[m.jsx(d9,{className:"h-4 w-4 text-primary"})," ",M("AI settings")]}),m.jsx(Bc,{children:M("Entirely optional. Your key is stored in this browser only and goes straight to the provider — nothing reaches us.")})]}),m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Bi,{children:M("Provider")}),m.jsxs(Qu,{value:s,onValueChange:j=>D(j),children:[m.jsx(tc,{className:"w-full",children:m.jsx(ec,{})}),m.jsx(nc,{children:cQ.map(j=>m.jsx(rc,{value:j.id,children:M(j.label)},j.id))})]}),m.jsx("p",{className:"text-xs text-muted-foreground",children:M(T.hint)})]}),T.needsBaseUrl&&m.jsxs("div",{className:"space-y-2",children:[m.jsx(Bi,{children:M("Base URL")}),m.jsx(jt,{value:f,onChange:j=>g(j.target.value),placeholder:"http://localhost:11434/v1",className:"font-mono"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(Bi,{children:["API key",T.needsBaseUrl&&m.jsxs("span",{className:"ml-1 font-normal text-muted-foreground",children:["(",M("optional"),")"]})]}),m.jsx(jt,{type:"password",value:d,onChange:j=>h(j.target.value),placeholder:"••••••••••••",className:"font-mono"}),T.keyUrl&&m.jsxs("a",{href:T.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-block text-xs text-primary hover:underline",children:[M("Get a free key")," →"]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Bi,{children:"Model"}),E?m.jsx(jt,{value:a,onChange:j=>u(j.target.value),placeholder:T.modelPlaceholder,className:"font-mono"}):x.length===0?m.jsx(Ee,{type:"button",variant:"outline",className:"w-full",onClick:R,disabled:b,children:b?m.jsxs(m.Fragment,{children:[m.jsx(Ln,{className:"animate-spin"})," ",M("Loading models…")]}):M("Load models")}):m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(Qu,{value:a,onValueChange:u,children:[m.jsx(tc,{className:"w-full font-mono",children:m.jsx(ec,{placeholder:M("Pick a model…")})}),m.jsx(nc,{children:x.map(j=>m.jsx(rc,{value:j.id,className:"font-mono",children:j.label},j.id))})]}),m.jsxs(Ee,{type:"button",variant:"ghost",size:"icon-sm",onClick:R,disabled:b,title:M("Refresh models"),className:"text-muted-foreground",children:[b?m.jsx(Ln,{className:"animate-spin"}):m.jsx(C_,{}),m.jsx("span",{className:"sr-only",children:M("Refresh models")})]})]}),!E&&x.length>0&&m.jsx("button",{type:"button",onClick:()=>_(!0),className:"text-xs text-muted-foreground hover:text-primary",children:M("Type the model manually")})]})]}),m.jsxs(Op,{className:"sm:justify-between",children:[e?m.jsx(Ee,{variant:"ghost",onClick:P,className:"text-muted-foreground",children:M("Disconnect")}):m.jsx("span",{}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(Rp,{asChild:!0,children:m.jsx(Ee,{variant:"outline",children:M("Cancel")})}),m.jsx(Ee,{onClick:O,children:M("Save")})]})]})]})})]})}function mQ(t){return t.type==="application/json"||t.name.toLowerCase().endsWith(".json")}function gQ({onScratch:t,disabled:e}){return m.jsxs("div",{"data-busy":e,className:"flex flex-col items-start justify-center gap-2 border-l border-border py-2 pl-5 data-[busy=true]:opacity-60",children:[m.jsx("h3",{className:"font-heading text-sm font-semibold text-foreground",children:M("Start from scratch")}),m.jsx("p",{className:"text-[13px] leading-relaxed text-muted-foreground",children:M("Begin with an empty schema and define your own collections and fields.")}),m.jsxs(Ee,{variant:"link",size:"sm",disabled:e,onClick:t,className:"h-auto px-0",children:[M("Continue with an empty project"),m.jsx(sP,{})]})]})}function yQ({onImported:t,disabled:e}){const[n,r]=C.useState(!1),[o,s]=C.useState(""),[i,a]=C.useState(null),[u,d]=C.useState(!1),[h,f]=C.useState(!1),[g,x]=C.useState(null),v=async E=>{var T;const _=(T=E.target.files)==null?void 0:T[0];if(E.target.value="",!!_){a(null);try{s(await _.text())}catch{a(M("Could not read the file."))}}},b=async E=>{if(!mQ(E)){x(M("That file is not JSON — drop a .json file instead."));return}x(null);try{const _=await E.text();s(_),a(null),r(!0)}catch{x(M("Could not read the file."))}},k=async()=>{let E;try{E=JSON.parse(o)}catch{a(M("Invalid JSON"));return}const _=E&&typeof E=="object"&&"schema"in E?E.schema:E;a(null),d(!0);try{await P_(_),r(!1),t()}catch(T){a(T.message),d(!1)}};return m.jsxs(Lc,{open:n,onOpenChange:E=>{r(E),!E&&!u&&(s(""),a(null))},children:[m.jsxs("div",{"data-busy":e,"data-dragging":h,onDragOver:E=>{e||(E.preventDefault(),E.dataTransfer.dropEffect="copy",f(!0))},onDragLeave:E=>{E.currentTarget.contains(E.relatedTarget)||f(!1)},onDrop:E=>{if(E.preventDefault(),f(!1),e)return;const _=E.dataTransfer.files.item(0);_&&b(_)},className:Ce("group flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-muted/40 px-5 py-7 text-center","transition-colors motion-reduce:transition-none","data-[dragging=true]:border-primary data-[dragging=true]:bg-accent","data-[busy=true]:opacity-60"),children:[m.jsx("span",{className:"flex size-11 items-center justify-center rounded-full border border-dashed border-border bg-card text-muted-foreground transition-colors motion-reduce:transition-none group-data-[dragging=true]:border-primary group-data-[dragging=true]:text-primary",children:m.jsx(Xu,{className:"size-5"})}),m.jsxs("div",{className:"flex flex-col items-center gap-1",children:[m.jsx("h3",{className:"font-heading text-sm font-semibold text-foreground",children:M("Import your own JSON")}),m.jsx("p",{className:"text-[13px] leading-relaxed text-muted-foreground",children:M(h?"Release to read this file":"Drop a JSON file here, or")})]}),m.jsx(fL,{asChild:!0,children:m.jsx(Ee,{variant:"outline",size:"lg",disabled:e,children:M("Browse files")})}),g&&m.jsx("output",{className:"text-xs text-destructive",children:g})]}),m.jsxs(zc,{className:"sm:max-w-lg",children:[m.jsxs(Fc,{children:[m.jsx($c,{children:M("Import your own JSON")}),m.jsx(Bc,{children:M("Paste your content JSON or choose a file, and JustJSON works out the collections and singletons for you.")})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[M("An exported schema file works too:"),m.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-foreground",children:"_schema.json"})]}),m.jsxs("div",{className:"flex items-center justify-between gap-3",children:[m.jsx("span",{className:"text-sm font-medium text-foreground",children:"JSON"}),m.jsxs("label",{className:Ce(Mp({variant:"outline",size:"sm"}),"cursor-pointer focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",u&&"pointer-events-none opacity-50"),children:[m.jsx(Xu,{}),M("Choose a file"),m.jsx("input",{type:"file",accept:".json,application/json",className:"sr-only",disabled:u,onChange:v})]})]}),m.jsx(Ov,{value:o,onChange:E=>{s(E.target.value),i&&a(null)},disabled:u,spellCheck:!1,rows:10,placeholder:'{ "collections": { ... }, "singletons": { ... } }',className:"max-h-72 resize-y font-mono text-xs leading-relaxed"}),i&&m.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2.5 text-sm text-destructive",children:[m.jsx(yx,{className:"mt-0.5 size-4 shrink-0"}),m.jsx("span",{className:"break-words",children:i})]})]}),m.jsxs(Op,{children:[m.jsx(Rp,{asChild:!0,children:m.jsx(Ee,{variant:"ghost",disabled:u,children:M("Cancel")})}),m.jsx(Ee,{disabled:u||!o.trim(),onClick:k,children:u?m.jsxs(m.Fragment,{children:[m.jsx(Ln,{className:"animate-spin"}),M("Importing…")]}):M("Import")})]})]})]})}function xQ({onImported:t,onScratch:e,disabled:n}){return m.jsxs("section",{className:"mt-10",children:[m.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[m.jsx("h2",{className:"font-heading text-xs font-medium tracking-wide text-muted-foreground",children:M("Or start on your own")}),m.jsx("span",{className:"h-px flex-1 bg-border"})]}),m.jsxs("div",{className:"grid grid-cols-1 items-stretch gap-4 sm:grid-cols-[1.25fr_1fr]",children:[m.jsx(yQ,{onImported:t,disabled:n}),m.jsx(gQ,{onScratch:e,disabled:n})]})]})}const Pv=["a","b","c","d","e"];function Wr({className:t}){return m.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",t)})}const vQ={blog:w9,cv:cL,portfolio:h9,docs:dP,changelog:P9,recipe:bP,event:mP,catalog:q9},oA="h-[168px] w-[264px] shrink-0 snap-start rounded-xl",h1=56,bQ=2;function kQ(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function wQ(t){let e=t.parentElement;for(;e;){const{overflowY:n}=getComputedStyle(e);if(n==="auto"||n==="scroll")return e;e=e.parentElement}return document.documentElement}function CQ(){const t=C.useRef(null),[e,n]=C.useState({left:0,right:0});return C.useLayoutEffect(()=>{const r=t.current;if(!r)return;const o=wQ(r),s=()=>{const a=r.getBoundingClientRect(),d=o.getBoundingClientRect().left+o.clientLeft;n({left:Math.max(0,Math.round(a.left-d)),right:Math.max(0,Math.round(d+o.clientWidth-a.right))})};s();const i=new ResizeObserver(s);return i.observe(r),i.observe(o),()=>i.disconnect()},[]),{probeRef:t,bleed:e}}function SQ({tpl:t,applying:e,onPick:n}){const r=vQ[t.id]??qP,o=e===t.id,s=e!==null,i=[...t.collections.map(d=>({label:d.label,singleton:!1})),...t.singletons.map(d=>({label:d.label,singleton:!0}))],a=i.slice(0,bQ),u=i.length-a.length;return m.jsxs("button",{type:"button","data-carousel-card":"",disabled:s,"aria-busy":o,onClick:()=>n(t.id),className:Ce(oA,"group relative flex flex-col overflow-hidden border border-border bg-card p-4 text-left","shadow-sm outline-none transition-[box-shadow,transform,opacity,border-color] duration-200","hover:border-primary/45 hover:shadow-md motion-safe:hover:-translate-y-0.5","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",s&&!o&&"opacity-40",s&&"cursor-default"),children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-accent text-accent-foreground transition-colors group-hover:bg-primary/25",children:m.jsx(r,{className:"size-[18px]"})}),m.jsx("span",{className:"min-w-0 flex-1 truncate font-heading text-sm font-bold tracking-tight text-foreground",children:t.title})]}),m.jsx("p",{className:"mt-3 line-clamp-2 text-[13px] leading-relaxed text-muted-foreground",children:t.description}),m.jsxs("div",{className:"mt-auto flex w-full flex-nowrap items-center gap-1 overflow-hidden pt-3",children:[a.map(d=>m.jsx("span",{className:Ce("max-w-[45%] shrink-0 truncate rounded-md px-1.5 py-0.5 text-[11px] leading-5 text-muted-foreground",d.singleton?"border border-border":"bg-muted"),children:d.label},d.label)),u>0&&m.jsx("span",{className:"shrink-0 text-[11px] leading-5 text-muted-foreground/80",children:M("+{n} more",{n:u})})]}),o&&m.jsxs("span",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-xl bg-card/85 text-sm font-medium text-primary backdrop-blur-[1px]",children:[m.jsx(Ln,{className:"size-4 animate-spin"}),M("Applying…")]})]})}function EQ(){return m.jsxs("div",{className:Ce(oA,"flex flex-col border border-border bg-card p-4"),children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(Wr,{className:"size-9 shrink-0 rounded-lg"}),m.jsx(Wr,{className:"h-3.5 w-28"})]}),m.jsx(Wr,{className:"mt-4 h-3 w-full"}),m.jsx(Wr,{className:"mt-2 h-3 w-3/5"}),m.jsxs("div",{className:"mt-auto flex gap-1.5 pt-3",children:[m.jsx(Wr,{className:"h-5 w-20"}),m.jsx(Wr,{className:"h-5 w-14"})]})]})}function _Q({templates:t,applying:e,onPick:n}){const r=C.useRef(null),{probeRef:o,bleed:s}=CQ(),[i,a]=C.useState(!1),[u,d]=C.useState(!1),h=C.useCallback(()=>{const b=r.current;if(!b)return;const k=b.scrollWidth-b.clientWidth;a(b.scrollLeft>1),d(b.scrollLeft<k-1)},[]);C.useEffect(()=>{h();const b=r.current;if(!b)return;const k=new ResizeObserver(h);return k.observe(b),()=>k.disconnect()},[h]),C.useEffect(h,[t,h]);const f=b=>{const k=r.current;if(!k)return;const E=k.querySelector("[data-carousel-card]"),_=E?E.offsetWidth+16:Math.round(k.clientWidth*.8),T=k.scrollWidth-k.clientWidth,A=k.scrollLeft,D=Math.max(0,Math.min(A+b*_,T));k.scrollTo({left:D,behavior:kQ()?"auto":"smooth"}),window.setTimeout(()=>{k.scrollLeft===A&&A!==D&&(k.scrollLeft=D)},80)},v=`linear-gradient(to right, transparent 0, black ${i?h1:0}px, black calc(100% - ${u?h1:0}px), transparent 100%)`;return m.jsxs("section",{"aria-labelledby":"template-catalog-label",children:[m.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m.jsx("h2",{id:"template-catalog-label",className:"font-heading text-[11px] font-bold uppercase tracking-[0.18em] text-muted-foreground",children:M("Template catalog")}),m.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[m.jsx(Ee,{variant:"outline",size:"icon-sm","aria-label":M("Previous templates"),disabled:!i,onClick:()=>f(-1),children:m.jsx(CP,{})}),m.jsx(Ee,{variant:"outline",size:"icon-sm","aria-label":M("Next templates"),disabled:!u,onClick:()=>f(1),children:m.jsx(Dp,{})})]})]}),m.jsx("div",{ref:o,"aria-hidden":"true",className:"h-0"}),m.jsx("div",{ref:r,onScroll:h,className:"flex snap-x snap-mandatory gap-4 overflow-x-auto overscroll-x-contain pt-4 pb-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{marginLeft:-s.left,marginRight:-s.right,paddingLeft:s.left,paddingRight:s.right,scrollPaddingLeft:s.left,scrollPaddingRight:s.right+h1,maskImage:v,WebkitMaskImage:v},children:t===null?Pv.slice(0,4).map(b=>m.jsx(EQ,{},b)):t.map(b=>m.jsx(SQ,{tpl:b,applying:e,onPick:n},b.id))})]})}const TQ={en:"English",tr:"Turkish"};function NQ(){return["You are designing a content schema for a headless CMS.","Return ONLY valid JSON — no explanation, markdown code fence or other text.","Follow this shape exactly:",'{"version":1,"collections":[{"name":"plural-id","label":"Display name","path":"same-id","fields":[{"key":"field_key","label":"Display name","type":"text|richtext|number|boolean|date|select|relation|image|url|email|list|color","required":true}]}],"singletons":[{"name":"id","label":"Display name","path":"name.json","fields":[...]}]}',`Pick field types sensibly from what the user describes: richtext for long or formatted text, date for dates, select for a fixed set of options (add an "options" array), image for pictures, url for links, email for addresses, list for free-text tags, color for colors, and relation for a link to another collection (put the target collection's name in "to").`,"Produce at least one collection. Give every collection an identifying field like title or slug.",`Keep name and key values in English, kebab/snake-case and short. Write label values in ${TQ[ac()]??"English"}.`].join(" ")}function AQ(t){return t.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"").trim()}function MQ({onApplied:t,disabled:e}){const{config:n,openSettings:r}=Iv(),[o,s]=C.useState(""),[i,a]=C.useState(!1),[u,d]=C.useState(null),h=async()=>{if(!n){r();return}if(o.trim()){d(null),a(!0);try{const f=await F_(n,NQ(),o.trim());let g;try{g=JSON.parse(AQ(f))}catch{throw new Error(M("The AI did not return valid JSON — try again."))}await P_(g),t()}catch(f){d(f.message),a(!1)}}};return m.jsxs("div",{className:"mb-8 rounded-2xl border border-primary/30 bg-accent/40 p-6 sm:p-8",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[m.jsx(il,{className:"size-4"})," ",M("Generate with AI")]}),m.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground underline-offset-2 hover:text-primary hover:underline",children:M(n?"AI settings":"Connect a provider")})]}),m.jsx("h2",{className:"mt-2 font-heading text-lg font-semibold text-foreground sm:text-xl",children:M("Describe what you want to manage and let it design the schema")}),m.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:M("Runs on your own API key — entirely optional, nothing reaches us. It only creates collections and fields; the content is yours to write.")}),m.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-start",children:[m.jsx(Ov,{value:o,onChange:f=>{s(f.target.value),u&&d(null)},disabled:i||e,rows:2,placeholder:M('e.g. "a blog where I share recipes, with category, difficulty and cooking time"'),className:"min-h-0 flex-1 resize-none bg-card",onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&h()}}),m.jsx(Ee,{onClick:h,disabled:i||e||!o.trim(),className:"shrink-0 sm:mt-0",children:i?m.jsxs(m.Fragment,{children:[m.jsx(Ln,{className:"animate-spin"})," ",M("Generating…")]}):m.jsxs(m.Fragment,{children:[m.jsx(il,{})," ",M("Generate schema")]})})]}),!n&&m.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:M("No AI provider connected yet — the settings open when you press the button.")}),u&&m.jsxs("div",{className:"mt-3 flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2.5 text-sm text-destructive",children:[m.jsx(yx,{className:"mt-0.5 size-4 shrink-0"}),m.jsx("span",{className:"break-words",children:u})]})]})}const DQ={astro:"Astro",next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",vite:"Vite"};function RQ(){const[t,e]=C.useState(null);return C.useEffect(()=>{Promise.all([I_(),$_()]).then(([n,r])=>e({project:n.name,framework:DQ[r.framework]??""})).catch(()=>e(null))},[]),t?m.jsxs("p",{className:"mb-5 text-sm text-muted-foreground",children:[t.framework?M("{framework} project detected",{framework:t.framework}):M("Project")," · ",m.jsx("span",{className:"font-mono text-foreground/80",children:t.project})]}):null}function OQ({onApplied:t,onScratch:e}){const[n,r]=C.useState(null),[o,s]=C.useState(null),[i,a]=C.useState(null);C.useEffect(()=>{V7().then(r).catch(()=>s(M("Could not load the template list.")))},[]);const u=async h=>{s(null),a(h);try{await H7(h),t()}catch(f){s(f.message),a(null)}},d=i!==null;return m.jsx("div",{className:"h-full overflow-y-auto bg-muted/30",children:m.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12 sm:px-8",children:[m.jsxs("header",{className:"mb-8 max-w-2xl",children:[m.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[m.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground",children:m.jsx(Tl,{className:"size-3.5"})}),"JustJSON"]}),m.jsx(RQ,{}),m.jsx("h1",{className:"font-heading text-2xl font-semibold tracking-tight text-foreground sm:text-3xl",children:M("Pick a template")}),m.jsx("p",{className:"mt-2 text-base leading-relaxed text-muted-foreground",children:M("Edit your content visually; everything stays in your folder as plain JSON — no server, no account.")})]}),o&&m.jsxs("div",{className:"mb-6 flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:[m.jsx(yx,{className:"mt-0.5 size-4 shrink-0"}),m.jsx("span",{children:o})]}),m.jsx(MQ,{onApplied:t,disabled:d}),m.jsx(_Q,{templates:n,applying:i,onPick:u}),m.jsx(xQ,{onImported:t,onScratch:e,disabled:d})]})})}const jQ=/^#[0-9a-f]{6}$/i,Nn="jj-preview",IQ=[{id:"tight",label:"Tight"},{id:"normal",label:"Cozy"},{id:"roomy",label:"Roomy"}];function PQ(t,e){return t.palette===e.palette&&t.accent===e.accent&&t.font===e.font&&t.radius===e.radius&&t.density===e.density}function LQ(t){return B7(t).replace(":root {",`.${Nn} {`)}function zQ({value:t,onChange:e}){const n=jQ.test(t);return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("label",{className:"relative size-9 shrink-0 cursor-pointer overflow-hidden rounded-lg border shadow-sm",children:[m.jsx("span",{className:"block size-full",style:{backgroundColor:n?t:"#ffffff"}}),m.jsx("input",{type:"color",value:n?t:"#000000",onChange:r=>e(r.target.value),className:"absolute inset-0 cursor-pointer opacity-0","aria-label":M("Pick an accent color")})]}),m.jsx(jt,{className:"w-[140px] font-mono",placeholder:"#000000",spellCheck:!1,value:t,onChange:r=>e(r.target.value),"aria-invalid":!n})]})}function ku({label:t,children:e}){return m.jsxs("div",{className:"space-y-2",children:[m.jsx(Bi,{className:"text-xs font-medium text-muted-foreground",children:t}),e]})}function FQ(){return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:M("The Quiet Ledger")}),m.jsx("p",{className:"lead",children:M("A small journal of things worth keeping. This is exactly how your generated site renders — same colors, type, spacing and corners.")}),m.jsx("h2",{children:M("Recent entries")}),m.jsxs("ul",{children:[m.jsxs("li",{children:[m.jsx("a",{href:"#preview",children:M("On keeping notes in plain files")}),m.jsx("div",{children:m.jsx("time",{children:"2026-03-04"})})]}),m.jsxs("li",{children:[m.jsx("a",{href:"#preview",children:M("A field guide to small tools")}),m.jsx("div",{children:m.jsx("time",{children:"2026-02-19"})})]}),m.jsxs("li",{children:[m.jsx("a",{href:"#preview",children:M("Why JSON, and nothing more")}),m.jsx("div",{children:m.jsx("time",{children:"2026-01-28"})})]})]}),m.jsxs("p",{children:[M("Built from")," ",m.jsx("code",{children:"content/_theme.json"}),"."," ",m.jsx("a",{href:"#preview",children:M("Read the latest")})]}),m.jsx("span",{className:"btn",children:M("Subscribe")})]})}function $Q(){const[t,e]=C.useState(null),[n,r]=C.useState(null),[o,s]=C.useState(!1),i=C.useId();C.useEffect(()=>{let f=!0;return rz().then(g=>{f&&(e(g),r(g))}).catch(g=>Ct.error(g.message)),()=>{f=!1}},[]);const a=C.useCallback(f=>{e(g=>g&&{...g,...f})},[]),u=C.useMemo(()=>t?LQ(t):"",[t]),d=t!==null&&n!==null&&!PQ(t,n),h=async()=>{if(t){s(!0);try{const f=await oz(t);r(f),e(f),Ct.success(M("Theme saved."))}catch(f){Ct.error(f.message)}finally{s(!1)}}};return m.jsxs(Jr,{children:[m.jsx(Zr,{title:M("Theme"),subtitle:M("Style your generated site. Changes preview live and save to _theme.json."),actions:m.jsxs("div",{className:"flex items-center gap-3",children:[d&&m.jsx("span",{className:"text-xs text-muted-foreground",children:M("Unsaved changes")}),m.jsxs(Ee,{onClick:h,disabled:!t||o||!d,children:[o?m.jsx(Ln,{className:"animate-spin"}):m.jsx($9,{}),M("Save theme")]})]})}),m.jsx(Hc,{children:t===null?m.jsx("div",{className:"flex h-full items-center justify-center py-24 text-muted-foreground",children:m.jsx(Ln,{className:"size-5 animate-spin"})}):m.jsxs("div",{className:"grid gap-6 px-8 py-6 lg:grid-cols-[380px_minmax(0,1fr)]",children:[m.jsxs("div",{className:"space-y-6",children:[m.jsx(ku,{label:M("Palette"),children:m.jsx("div",{className:"grid grid-cols-5 gap-2",children:q1.map(f=>{const g=f.id===t.palette;return m.jsxs("button",{type:"button",onClick:()=>a({palette:f.id}),"aria-pressed":g,title:f.label,className:Ce("flex flex-col items-stretch overflow-hidden rounded-lg border text-left outline-none transition-shadow focus-visible:ring-3 focus-visible:ring-ring/50",g?"ring-2 ring-ring ring-offset-2 ring-offset-background":"hover:border-foreground/30"),style:{borderColor:f.border},children:[m.jsx("span",{className:"flex h-11 items-center justify-center text-sm font-semibold",style:{backgroundColor:f.bg,color:f.text},children:"Aa"}),m.jsx("span",{className:"border-t px-1 py-1 text-center text-[10px] text-muted-foreground",style:{borderColor:f.border,backgroundColor:f.bg,color:f.muted},children:f.label})]},f.id)})})}),m.jsx(ku,{label:M("Accent"),children:m.jsx(zQ,{value:t.accent,onChange:f=>a({accent:f})})}),m.jsx(ku,{label:M("Font"),children:m.jsx("div",{className:"grid grid-cols-2 gap-2",children:K1.map(f=>{const g=f.id===t.font;return m.jsxs("button",{type:"button",onClick:()=>a({font:f.id}),"aria-pressed":g,style:{fontFamily:f.stack},className:Ce("flex items-center justify-between gap-2 rounded-lg border px-3 py-2 text-sm outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",g?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:bg-muted"),children:[m.jsx("span",{children:f.label}),g&&m.jsx(Ic,{className:"size-3.5 shrink-0 text-primary"})]},f.id)})})}),m.jsx(ku,{label:M("Corners: {n}px",{n:t.radius}),children:m.jsx("input",{type:"range",min:0,max:24,step:1,value:t.radius,onChange:f=>a({radius:Number(f.target.value)}),"aria-label":M("Corner radius in pixels"),className:"w-full accent-primary"})}),m.jsx(ku,{label:M("Density"),children:m.jsx("div",{className:"grid grid-cols-3 gap-2",children:IQ.map(f=>{const g=f.id===t.density;return m.jsx("button",{type:"button",onClick:()=>a({density:f.id}),"aria-pressed":g,className:Ce("rounded-lg border px-3 py-2 text-sm outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",g?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:bg-muted"),children:M(f.label)},f.id)})})})]}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:M("Live preview")}),m.jsx("style",{id:i,children:`${u}
670
+ ${BQ}`}),m.jsx("div",{className:"overflow-hidden rounded-xl border shadow-sm",children:m.jsx("div",{className:Ce(Nn,"overflow-x-auto"),children:m.jsx("div",{className:"jj-page",children:m.jsx(FQ,{})})})})]})]})})]})}const BQ=`
671
+ .${Nn} {
672
+ background: var(--jj-bg);
673
+ color: var(--jj-text);
674
+ font-family: var(--jj-font);
675
+ line-height: var(--jj-lead);
676
+ }
677
+ .${Nn} .jj-page {
678
+ max-width: 44rem;
679
+ margin: 0 auto;
680
+ padding: var(--jj-page) 1.25rem;
681
+ font-size: 16px;
682
+ }
683
+ .${Nn} h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 0.35rem; }
684
+ .${Nn} h2 {
685
+ font-size: 0.8rem;
686
+ text-transform: uppercase;
687
+ letter-spacing: 0.12em;
688
+ color: var(--jj-muted);
689
+ margin: calc(var(--jj-page) * 0.8) 0 var(--jj-gap);
690
+ }
691
+ .${Nn} p { margin: 0 0 var(--jj-gap); }
692
+ .${Nn} .lead { margin-bottom: var(--jj-page); }
693
+ .${Nn} ul { list-style: none; margin: 0 0 var(--jj-gap); padding: 0; }
694
+ .${Nn} li + li { margin-top: var(--jj-gap); }
695
+ .${Nn} a { color: var(--jj-accent); text-decoration: none; }
696
+ .${Nn} a:hover { text-decoration: underline; }
697
+ .${Nn} time { color: var(--jj-muted); font-size: 0.9rem; }
698
+ .${Nn} code {
699
+ background: color-mix(in oklab, var(--jj-text) 8%, transparent);
700
+ padding: 0.1em 0.35em;
701
+ border-radius: calc(var(--jj-radius) / 2);
702
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
703
+ }
704
+ .${Nn} .btn {
705
+ display: inline-block;
706
+ margin-top: var(--jj-gap);
707
+ padding: 0.5em 1em;
708
+ background: var(--jj-accent);
709
+ color: var(--jj-bg);
710
+ border-radius: var(--jj-radius);
711
+ font-size: 0.9rem;
712
+ font-weight: 600;
713
+ }
714
+ @media (prefers-reduced-motion: reduce) {
715
+ .${Nn} * { transition: none !important; }
716
+ }
717
+ `,VQ={en:"Write in English.",tr:"Write in Turkish."};function HQ({context:t,fieldLabel:e,currentValue:n,richtext:r,onResult:o}){const{config:s,openSettings:i}=Iv(),[a,u]=C.useState(!1),[d,h]=C.useState(""),[f,g]=C.useState(!1),x=()=>{if(!s){i();return}h(""),u(!0)},v=async()=>{if(s){g(!0);try{const b=[`You are filling in the "${e}" field of "${t}".`,r?"Write the answer in Markdown.":"Write the answer as plain text, preferring a single line.","Return only the field value — no explanation, quotes or prefix.",VQ[ac()]].join(" "),k=[d.trim()||`Write suitable content for ${e}.`,n.trim()?`
718
+
719
+ Current text (improve on it / use as a base):
720
+ ${n}`:""].join(""),E=await F_(s,b,k);o(E.trim()),u(!1),Ct.success(M("Content generated"))}catch(b){Ct.error(b.message)}finally{g(!1)}}};return m.jsxs(m.Fragment,{children:[m.jsxs(Ee,{type:"button",variant:"ghost",size:"icon-xs",onClick:x,className:"text-muted-foreground hover:text-primary",title:M("Fill with AI"),children:[m.jsx(il,{className:"h-3.5 w-3.5"}),m.jsx("span",{className:"sr-only",children:M("Fill with AI")})]}),m.jsx(Lc,{open:a,onOpenChange:u,children:m.jsxs(zc,{children:[m.jsxs(Fc,{children:[m.jsxs($c,{className:"flex items-center gap-2",children:[m.jsx(il,{className:"h-4 w-4 text-primary"})," ",e]}),m.jsxs(Bc,{children:[M("Say what you want in a sentence; the model fills it in using {context} as context.",{context:t}),n.trim()?` ${M("The current text is sent along as context.")}`:""]})]}),m.jsx(Ov,{autoFocus:!0,value:d,onChange:b=>h(b.target.value),placeholder:M('e.g. "write a short, friendly {field}"',{field:e}),className:"min-h-24",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&v()}}),m.jsxs(Op,{children:[m.jsx(Rp,{asChild:!0,children:m.jsx(Ee,{variant:"outline",children:M("Cancel")})}),m.jsx(Ee,{onClick:v,disabled:f,children:f?m.jsxs(m.Fragment,{children:[m.jsx(Ln,{className:"h-4 w-4 animate-spin"})," ",M("Generating…")]}):M("Generate")})]})]})})]})}function UQ(){return m.jsxs(XL,{delayDuration:300,children:[m.jsx(pQ,{children:m.jsx(WQ,{})}),m.jsx(GL,{position:"bottom-right"})]})}function WQ(){V_();const[t,e]=C.useState(null),[n,r]=C.useState(null),[o,s]=C.useState(null),[i,a]=C.useState(null),[u,d]=C.useState(!1),[h,f]=C.useState(0),[g,x]=C.useState(null),v=C.useCallback(async()=>{const T=await Tw();return e(T),T},[]),b=C.useCallback(T=>{T&&(x(T),f(A=>A+1)),a({kind:"schema"})},[]);if(C.useEffect(()=>{Tw().then(T=>{e(T),T.collections.length===0&&T.singletons.length===0&&d(!0)}).catch(()=>s(M("Could not load the schema. Is `justjson serve` running?")))},[]),C.useEffect(()=>{I_().then(r).catch(()=>{})},[]),o)return m.jsx(qu,{children:o});if(!t)return m.jsx(qu,{children:M("Loading…")});if(u)return m.jsx(OQ,{onApplied:async()=>{const T=await v();d(!1),a(T.collections[0]?{kind:"collection",name:T.collections[0].name}:{kind:"schema"})},onScratch:()=>{d(!1),a({kind:"schema"})}});const k=t.collections.length===0&&t.singletons.length===0,E=()=>{W7(),Ct.success(M("Downloading export"))},_=async()=>{await L_({version:1,collections:[],singletons:[]}),await v(),a(null),d(!0),Ct.success(M("Schema reset"))};return m.jsxs("div",{className:"flex h-full bg-background",children:[m.jsx(GQ,{project:n,schema:t,selection:i,onSelect:a,onOpenSchema:b,onExport:E,onReset:_}),m.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden bg-muted/30",children:[m.jsx(KQ,{project:n,crumbs:qQ(t,i,a)}),m.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:m.jsx(YQ,{schema:t,selection:i,onSelect:a,onReload:v,onOpenSchema:b,addSeq:h,addKind:g,onBrowseTemplates:k?()=>d(!0):void 0})})]})]})}function qQ(t,e,n){if(!e)return[];if(e.kind==="schema")return[{label:M("Schema")}];if(e.kind==="json")return[{label:M("Raw JSON")}];if(e.kind==="ship")return[{label:M("Ship it")}];if(e.kind==="theme")return[{label:M("Design")}];if(e.kind==="preview")return[{label:M("Preview")}];if(e.kind==="collection"){const o=t.collections.find(s=>s.name===e.name);return[{label:(o==null?void 0:o.label)??e.name}]}if(e.kind==="entry"||e.kind==="newEntry"){const o=t.collections.find(s=>s.name===e.collection);return[{label:(o==null?void 0:o.label)??e.collection,onClick:()=>n({kind:"collection",name:e.collection})},e.kind==="entry"?{label:e.slug}:{label:M("New entry")}]}const r=t.singletons.find(o=>o.name===e.name);return[{label:(r==null?void 0:r.label)??e.name,tag:M("singleton")}]}function KQ({project:t,crumbs:e}){return m.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-1 overflow-x-auto border-b bg-card px-8 text-xs",children:[m.jsxs("span",{title:t==null?void 0:t.path,className:"inline-flex shrink-0 items-center gap-1.5 text-muted-foreground",children:[m.jsx(y_,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),(t==null?void 0:t.name)??"…"]}),e.map(n=>m.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[m.jsx(Dp,{className:"h-3.5 w-3.5 text-muted-foreground/40"}),n.onClick?m.jsx("button",{type:"button",onClick:n.onClick,className:"rounded text-muted-foreground transition-colors hover:text-primary",children:n.label}):m.jsx("span",{className:"font-medium text-foreground/80",children:n.label}),n.tag&&m.jsx(_l,{variant:"secondary",className:"ml-0.5 font-normal",children:n.tag})]},n.label))]})}function qu({children:t}){return m.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:t})}function GQ({project:t,schema:e,selection:n,onSelect:r,onOpenSchema:o,onExport:s,onReset:i}){const a=u=>n?n.kind==="collection"?n.name===u:n.kind==="entry"||n.kind==="newEntry"?n.collection===u:!1:!1;return m.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r bg-card",children:[m.jsx("div",{className:"flex h-12 shrink-0 items-center border-b px-5",children:m.jsxs("div",{className:"font-mono text-[15px] font-bold tracking-tight text-foreground",children:["Just",m.jsx("span",{className:"text-primary",children:"JSON"})]})}),t&&m.jsx("div",{className:"px-3 pt-3",children:m.jsx(JQ,{project:t,onExport:s,onReset:i})}),m.jsxs("nav",{className:"flex-1 space-y-1 overflow-y-auto px-3 pt-3 pb-4",children:[m.jsx(ZQ,{active:(n==null?void 0:n.kind)==="schema",onClick:()=>o()}),m.jsx(Ka,{icon:m.jsx(Tl,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="json",onClick:()=>r({kind:"json"}),children:M("Raw JSON")}),m.jsx(Ka,{icon:m.jsx(k_,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="theme",onClick:()=>r({kind:"theme"}),children:M("Design")}),m.jsx(Ka,{icon:m.jsx($P,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="preview",onClick:()=>r({kind:"preview"}),children:M("Preview")}),m.jsx(Ka,{icon:m.jsx(S_,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="ship",onClick:()=>r({kind:"ship"}),children:M("Ship it")}),m.jsx(YS,{label:M("Collections"),addLabel:M("Add collection"),onAdd:()=>o("collection"),children:e.collections.length===0?m.jsx(XS,{onClick:()=>o("collection"),children:M("Add collection")}):e.collections.map(u=>m.jsx(Ka,{icon:m.jsx(jc,{className:"h-4 w-4"}),active:a(u.name),onClick:()=>r({kind:"collection",name:u.name}),children:u.label??u.name},u.name))}),m.jsx(YS,{label:M("Singletons"),addLabel:M("Add singleton"),onAdd:()=>o("singleton"),children:e.singletons.length===0?m.jsx(XS,{onClick:()=>o("singleton"),children:M("Add singleton")}):e.singletons.map(u=>m.jsx(Ka,{icon:m.jsx(UP,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="singleton"&&n.name===u.name,onClick:()=>r({kind:"singleton",name:u.name}),children:u.label??u.name},u.name))})]})]})}function JQ({project:t,onExport:e,onReset:n}){const[r,o]=C.useState(!1),[s,i]=C.useState(!1),{config:a,openSettings:u}=Iv(),d=V_(),h=async()=>{i(!0);try{await n(),o(!1)}finally{i(!1)}};return m.jsxs(m.Fragment,{children:[m.jsxs(__,{children:[m.jsx(T_,{asChild:!0,children:m.jsxs("button",{type:"button",title:t.path,className:"flex w-full max-w-full items-center gap-1.5 rounded-lg border bg-muted/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m.jsx(y_,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),m.jsx("span",{className:"truncate",children:t.name}),m.jsx(p_,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]})}),m.jsxs(N_,{align:"start",className:"w-56",children:[m.jsx(P1,{className:"truncate",children:t.name}),m.jsx(wu,{}),m.jsxs(hg,{onSelect:e,children:[m.jsx(LP,{}),M("Export (.zip)")]}),m.jsx(wu,{}),m.jsxs(hg,{onSelect:u,children:[m.jsx(il,{}),M("AI settings"),a&&m.jsx(_l,{variant:"secondary",className:"ml-auto font-normal",children:M("connected")})]}),m.jsx(wu,{}),m.jsx(P1,{className:"text-xs font-normal text-muted-foreground",children:M("Language")}),dz.map(f=>m.jsx(A_,{checked:d===f.code,onCheckedChange:()=>pz(f.code),children:f.label},f.code)),m.jsx(wu,{}),m.jsxs(hg,{variant:"destructive",onSelect:()=>o(!0),children:[m.jsx(z9,{}),M("Start over (reset)")]})]})]}),m.jsx(Lc,{open:r,onOpenChange:o,children:m.jsxs(zc,{children:[m.jsxs(Fc,{children:[m.jsx($c,{children:M("Reset the schema?")}),m.jsx(Bc,{children:M("Your content files stay on disk, but the schema is cleared so you can pick a template or JSON again.")})]}),m.jsxs(Op,{children:[m.jsx(Rp,{asChild:!0,children:m.jsx(Ee,{variant:"outline",children:M("Cancel")})}),m.jsx(Ee,{variant:"destructive",onClick:h,disabled:s,children:M(s?"Resetting…":"Reset")})]})]})})]})}function ZQ({active:t,onClick:e}){return m.jsxs("button",{type:"button",onClick:e,className:Ce("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left transition-colors",t?"bg-accent text-primary":"text-muted-foreground hover:bg-accent/60"),children:[m.jsx(w_,{className:"h-4 w-4 shrink-0"}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("span",{className:"block text-sm font-medium leading-tight",children:M("Schema")}),m.jsx("span",{className:Ce("block text-xs leading-tight",t?"text-primary/70":"text-muted-foreground/70"),children:M("Content structure")})]})]})}function YS({label:t,addLabel:e,onAdd:n,children:r}){return m.jsxs("div",{className:"pt-4",children:[m.jsxs("div",{className:"flex items-center justify-between px-3 pb-1",children:[m.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground/80",children:t}),m.jsxs(vx,{children:[m.jsx(bx,{asChild:!0,children:m.jsxs(Ee,{variant:"ghost",size:"icon-xs",onClick:n,className:"text-muted-foreground hover:text-primary",children:[m.jsx(li,{}),m.jsx("span",{className:"sr-only",children:e})]})}),m.jsx(kx,{children:e})]})]}),m.jsx("div",{className:"space-y-0.5",children:r})]})}function XS({onClick:t,children:e}){return m.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-muted-foreground/70 transition-colors hover:bg-accent/60 hover:text-primary",children:[m.jsx(li,{className:"h-4 w-4"})," ",e]})}function Ka({children:t,icon:e,active:n,onClick:r}){return m.jsxs("button",{type:"button",onClick:r,className:Ce("flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors",n?"bg-accent font-medium text-primary":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[e&&m.jsx("span",{className:n?"text-primary":"text-muted-foreground/70",children:e}),m.jsx("span",{className:"truncate",children:t})]})}function YQ({schema:t,selection:e,onSelect:n,onReload:r,onOpenSchema:o,addSeq:s,addKind:i,onBrowseTemplates:a}){if(!e)return m.jsx(XQ,{icon:m.jsx(jc,{className:"h-6 w-6"}),title:M("Start on the left"),hint:M("Pick a collection or singleton to start editing. To change the structure, go to Schema."),action:m.jsxs(Ee,{onClick:()=>o(),children:[m.jsx(w_,{})," ",M("Open schema")]})});if(e.kind==="schema")return m.jsx(JX,{schema:t,initialAdd:i??void 0,onSaved:()=>void r(),onBrowseTemplates:a},s);if(e.kind==="json")return m.jsx(eee,{schema:t});if(e.kind==="ship")return m.jsx(uQ,{schema:t});if(e.kind==="theme")return m.jsx($Q,{});if(e.kind==="preview")return m.jsx(gz,{});if(e.kind==="collection"){const d=t.collections.find(h=>h.name===e.name);return d?m.jsx(nee,{collection:d,onOpen:h=>n({kind:"entry",collection:d.name,slug:h}),onNew:()=>n({kind:"newEntry",collection:d.name})}):m.jsx(qu,{children:M("This collection no longer exists.")})}if(e.kind==="entry"||e.kind==="newEntry"){const d=t.collections.find(f=>f.name===e.collection);if(!d)return m.jsx(qu,{children:M("This collection no longer exists.")});const h=e.kind==="entry"?e.slug:null;return m.jsx(oee,{collection:d,slug:h,onSaved:f=>n({kind:"entry",collection:d.name,slug:f}),onDeleted:()=>n({kind:"collection",name:d.name})},`${d.name}/${h??"new"}`)}const u=t.singletons.find(d=>d.name===e.name);return u?m.jsx(see,{singleton:u},u.name):m.jsx(qu,{children:M("This singleton no longer exists.")})}function XQ({icon:t,title:e,hint:n,action:r}){return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[t&&m.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl border bg-card text-muted-foreground shadow-sm",children:t}),m.jsx("p",{className:"text-base font-semibold text-foreground",children:e}),n&&m.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-muted-foreground",children:n}),r&&m.jsx("div",{className:"mt-5",children:r})]})}function dm({children:t}){return m.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t})}function sA(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(?:\s*:)?|\b(?:true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,n=>{let r="jk-num";return/^"/.test(n)?r=/:\s*$/.test(n)?"jk-key":"jk-str":n==="true"||n==="false"?r="jk-bool":n==="null"&&(r="jk-null"),`<span class="${r}">${n}</span>`})}function iA({path:t,data:e}){const n=C.useMemo(()=>JSON.stringify(e,null,2),[e]),r=n==="{}",o=()=>{navigator.clipboard&&navigator.clipboard.writeText(n),Ct.success(M("JSON copied"))};return m.jsxs("div",{className:"overflow-hidden rounded-xl border shadow-sm",children:[m.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-2",children:[m.jsx(Tl,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),m.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:t}),m.jsxs(Ee,{variant:"ghost",size:"xs",onClick:o,disabled:r,className:"ml-auto text-muted-foreground hover:text-primary",children:[m.jsx(m_,{})," ",M("Copy")]})]}),r?m.jsx("p",{className:"jk-pre text-muted-foreground/70",children:M("No fields filled in yet.")}):m.jsx("pre",{className:"jk-pre overflow-x-auto",children:m.jsx("code",{dangerouslySetInnerHTML:{__html:sA(n)}})})]})}function ol({children:t}){return m.jsx(Hc,{children:m.jsx("div",{className:"mx-auto max-w-3xl space-y-5 px-8 py-6",children:t})})}function QQ({path:t,data:e,defaultOpen:n}){const[r,o]=C.useState(n??!1),s=C.useMemo(()=>JSON.stringify(e,null,2),[e]);return m.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[m.jsxs("button",{type:"button",onClick:()=>o(i=>!i),className:"flex w-full items-center gap-2 bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-muted",children:[m.jsx(Dp,{className:Ce("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),m.jsx(Tl,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),m.jsx("span",{className:"truncate font-mono text-xs text-foreground/80",children:t})]}),r&&m.jsx("pre",{className:"jk-pre overflow-x-auto border-t",children:m.jsx("code",{dangerouslySetInnerHTML:{__html:sA(s)}})})]})}function eee({schema:t}){const[e,n]=C.useState(null),[r,o]=C.useState(null);return C.useEffect(()=>{let s=!1;return(async()=>{try{const i=[{path:"_schema.json",data:t}];for(const a of t.collections){const u=await Sx(a.name),d=await Promise.all(u.map(h=>G1(a.name,h.slug).then(f=>({slug:h.slug,d:f}))));for(const h of d)h.d&&i.push({path:`${a.name}/${h.slug}.json`,data:h.d})}for(const a of t.singletons){const u=await z_(a.name);i.push({path:`${a.name}.json`,data:u})}s||n(i)}catch(i){s||o(i.message)}})(),()=>{s=!0}},[t]),m.jsxs(Jr,{children:[m.jsx(Zr,{title:M("Raw JSON"),subtitle:e?`content/ • ${lc(e.length,"{n} file","{n} files")}`:M("Every file in content/, exactly as written to disk")}),m.jsx(Hc,{children:m.jsxs("div",{className:"mx-auto max-w-3xl space-y-2 px-8 py-6",children:[r&&m.jsx(Lv,{title:M("Could not load"),children:r}),e===null&&!r&&m.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:M("Loading…")}),e==null?void 0:e.map((s,i)=>m.jsx(QQ,{path:s.path,data:s.data,defaultOpen:i===0},s.path))]})})]})}function aA(){return m.jsx(dm,{children:m.jsx("div",{className:"space-y-6",children:Pv.slice(0,4).map(t=>m.jsxs("div",{className:"space-y-2",children:[m.jsx(Wr,{className:"h-3.5 w-28"}),m.jsx(Wr,{className:"h-8 w-full"})]},t))})})}function lA({onRetry:t,onBack:e}){return m.jsx(dm,{children:m.jsxs("div",{className:"flex flex-col items-center py-8 text-center",children:[m.jsx("div",{className:"mb-3 flex size-12 items-center justify-center rounded-xl bg-destructive/10 text-destructive",children:m.jsx(Pc,{className:"size-5"})}),m.jsx("p",{className:"font-medium text-foreground",children:M("Could not load the entry")}),m.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:M("The file could not be read, or it may have been deleted. Editing is disabled so an empty form does not overwrite it.")}),m.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[m.jsx(Ee,{onClick:t,children:M("Try again")}),e&&m.jsx(Ee,{variant:"outline",onClick:e,children:M("Back to the list")})]})]})})}function tee(t){return t?new Intl.DateTimeFormat(ac()==="tr"?"tr-TR":"en-GB",{day:"numeric",month:"short",year:"numeric"}).format(new Date(t)):"—"}function nee({collection:t,onOpen:e,onNew:n}){const[r,o]=C.useState(null),[s,i]=C.useState("");C.useEffect(()=>{Sx(t.name).then(o)},[t.name]);const a=s.trim().toLowerCase(),u=r==null?void 0:r.filter(h=>h.title.toLowerCase().includes(a)||h.slug.includes(a)),d=!!r&&r.length>0;return m.jsxs(Jr,{children:[m.jsx(Zr,{title:t.label??t.name,subtitle:r?lc(r.length,"{n} entry","{n} entries"):M("Loading entries…"),actions:m.jsxs(Ee,{onClick:n,children:[m.jsx(li,{})," ",M("New entry")]}),toolbar:d?m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("div",{className:"relative w-full max-w-sm",children:[m.jsx(U9,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),m.jsx(jt,{className:"pl-9",placeholder:M("Search by title or slug…"),value:s,onChange:h=>i(h.target.value)})]}),m.jsx("span",{className:"ml-auto shrink-0 text-xs tabular-nums text-muted-foreground",children:a?lc((u==null?void 0:u.length)??0,"{n} result","{n} results"):null})]}):void 0}),m.jsx(lz,{children:m.jsxs(uz,{className:"flex h-full flex-col [&>[data-slot=table-container]]:min-h-0 [&>[data-slot=table-container]]:flex-1",children:[r===null&&m.jsx(QS,{rows:null,onOpen:e}),r!==null&&r.length===0&&m.jsx(Nw,{icon:m.jsx(jc,{className:"h-6 w-6"}),title:M("No entries yet"),hint:M("Add the first piece of content to this collection."),action:m.jsxs(Ee,{onClick:n,variant:"outline",children:[m.jsx(li,{})," ",M("Create the first entry")]})}),d&&(u==null?void 0:u.length)===0&&m.jsx(Nw,{icon:m.jsx(V9,{className:"h-6 w-6"}),title:M("No matching entries"),hint:M("Nothing found for “{q}”. Change the search or clear it.",{q:s.trim()}),action:m.jsx(Ee,{variant:"outline",onClick:()=>i(""),children:M("Clear search")})}),d&&u&&u.length>0&&m.jsx(QS,{rows:u,onOpen:e})]})})]})}const Uf="h-9 bg-muted/50 px-4 text-xs font-medium uppercase tracking-wide text-muted-foreground";function QS({rows:t,onOpen:e}){return m.jsxs(JL,{children:[m.jsx(ZL,{className:"sticky top-0 z-10",children:m.jsxs(pg,{className:"hover:bg-transparent",children:[m.jsx(Cf,{className:Ce(Uf,"w-full"),children:M("Title")}),m.jsx(Cf,{className:Uf,children:M("File")}),m.jsx(Cf,{className:Ce(Uf,"text-right"),children:M("Updated")}),m.jsx(Cf,{className:Ce(Uf,"w-10 pl-0"),children:m.jsx("span",{className:"sr-only",children:M("Open")})})]})}),m.jsx(YL,{children:t===null?Pv.map(n=>m.jsxs(pg,{className:"hover:bg-transparent",children:[m.jsx(zs,{className:"px-4 py-3",children:m.jsx(Wr,{className:"h-3.5 w-48"})}),m.jsx(zs,{className:"px-4 py-3",children:m.jsx(Wr,{className:"h-3 w-24"})}),m.jsx(zs,{className:"px-4 py-3",children:m.jsx(Wr,{className:"ml-auto h-3 w-20"})}),m.jsx(zs,{className:"w-10 py-3 pl-0"})]},n)):t.map(n=>m.jsxs(pg,{tabIndex:0,onClick:()=>e(n.slug),onKeyDown:r=>r.key==="Enter"&&e(n.slug),className:"group/row cursor-pointer hover:bg-muted/40 focus:bg-accent focus:outline-none",children:[m.jsx(zs,{className:"px-4 py-3 font-medium text-foreground",children:n.title}),m.jsx(zs,{className:"px-4 py-3 font-mono text-xs text-muted-foreground",children:n.slug}),m.jsx(zs,{className:"px-4 py-3 text-right text-xs tabular-nums text-muted-foreground",children:tee(n.updatedAt)}),m.jsxs(zs,{className:"w-10 py-3 pr-4 pl-0 text-right",children:[m.jsx(Dp,{className:"ml-auto h-4 w-4 text-transparent transition-colors group-hover/row:text-muted-foreground/70 group-focus/row:text-muted-foreground/70"}),m.jsx("span",{className:"sr-only",children:M("Open")})]})]},n.slug))})]})}function uA(t,e){const[n,r]=C.useState({}),[o,s]=C.useState(!0),[i,a]=C.useState(!1),[u,d]=C.useState(0),h=C.useRef(0);C.useEffect(()=>{const g=++h.current;s(!0),a(!1),t().then(x=>{g===h.current&&(x===null&&e?a(!0):r(x??{}),s(!1))}).catch(()=>{g===h.current&&(a(!0),s(!1))})},[u]);const f=C.useCallback(()=>d(g=>g+1),[]);return{data:n,setData:r,loading:o,failed:i,retry:f}}function ree({status:t,onToggle:e}){const n=t==="draft";return m.jsxs(Ee,{type:"button",variant:"outline",onClick:e,title:M(n?"Draft — publish it":"Published — move back to draft"),className:Ce(n&&"border-dashed text-muted-foreground"),children:[m.jsx("span",{className:Ce("inline-block size-2 rounded-full",n?"bg-muted-foreground/50":"bg-primary")}),M(n?"Draft":"Published")]})}function oee({collection:t,slug:e,onSaved:n,onDeleted:r}){const o=e===null,s=C.useCallback(()=>o?Promise.resolve({}):G1(t.name,e),[t.name,e,o]),{data:i,setData:a,loading:u,failed:d,retry:h}=uA(s,!o),[f,g]=C.useState(""),[x,v]=C.useState(!1),[b,k]=C.useState(null),[E,_]=C.useState(!1),T=(j,W)=>a(Z=>{const J={...Z};return W===""||W===void 0?delete J[j]:J[j]=W,J}),A=C.useMemo(()=>j_(t.fields,i),[i,t.fields]),D=o?Ip(f||String(i.title??"entry")):e,R=async()=>{k(null),v(!0);try{if(o&&await G1(t.name,D)){const W=M('"{slug}" already exists — pick a different slug.',{slug:D});k(W),Ct.error(W);return}const j=await K7(t.name,D,i);Ct.success(M('"{slug}" saved',{slug:j})),n(j)}finally{v(!1)}},O=async()=>{o||(await G7(t.name,e),Ct.success(M('"{slug}" deleted',{slug:e})),r())},P=t.label??t.name;return u?m.jsxs(Jr,{children:[m.jsx(Zr,{title:P,subtitle:m.jsx(Jf,{children:`${t.name}/…`})}),m.jsx(ol,{children:m.jsx(aA,{})})]}):d?m.jsxs(Jr,{children:[m.jsx(Zr,{title:P,subtitle:m.jsx(Jf,{children:`${t.name}/${e}.json`})}),m.jsx(ol,{children:m.jsx(lA,{onRetry:h,onBack:r})})]}):m.jsxs(Jr,{children:[m.jsx(Zr,{title:P,badge:o?m.jsx(_l,{variant:"secondary",className:"font-normal",children:M("new")}):void 0,subtitle:m.jsx(Jf,{children:`${t.name}/${D}.json`}),actions:m.jsxs(m.Fragment,{children:[m.jsx(ree,{status:_w(i),onToggle:()=>T(O_,_w(i)==="draft"?"":"draft")}),m.jsxs(Ee,{variant:E?"secondary":"outline",onClick:()=>_(j=>!j),children:[m.jsx(Tl,{})," JSON"]}),!o&&m.jsxs(Ee,{variant:"destructive",onClick:O,children:[m.jsx(E_,{})," ",M("Delete")]}),m.jsx(Ee,{onClick:R,disabled:x||!A.ok,children:M(x?"Saving…":"Save")})]})}),m.jsxs(ol,{children:[b&&m.jsx(Lv,{title:M("Could not save"),children:b}),E&&m.jsx(iA,{path:`${t.name}/${D}.json`,data:i}),m.jsxs(dm,{children:[o&&m.jsxs("div",{className:"mb-6 rounded-lg border bg-muted/40 p-4",children:[m.jsx(zv,{label:M("File name"),hint:`${D}.json`,children:m.jsx(jt,{value:f,onChange:j=>g(j.target.value),placeholder:M("automatic"),className:"bg-card font-mono"})}),m.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:M("Leave it empty to derive it from the title. It cannot change after saving.")})]}),m.jsx("div",{className:"space-y-6",children:t.fields.map(j=>m.jsx(dA,{field:j,value:i[j.key],onChange:T,context:t.label??t.name},j.key))})]}),m.jsx(cA,{result:A})]})]})}function see({singleton:t}){const e=C.useCallback(()=>z_(t.name),[t.name]),{data:n,setData:r,loading:o,failed:s,retry:i}=uA(e,!1),[a,u]=C.useState(!1),[d,h]=C.useState(!1),f=(k,E)=>r(_=>{const T={..._};return E===""||E===void 0?delete T[k]:T[k]=E,T}),g=C.useMemo(()=>j_(t.fields,n),[n,t.fields]),x=async()=>{u(!0);try{await Z7(t.name,n),Ct.success(M("{name} saved",{name:t.label??t.name}))}finally{u(!1)}},v=t.label??t.name,b=m.jsx(_l,{variant:"secondary",className:"font-normal",children:M("singleton")});return o?m.jsxs(Jr,{children:[m.jsx(Zr,{title:v,badge:b}),m.jsx(ol,{children:m.jsx(aA,{})})]}):s?m.jsxs(Jr,{children:[m.jsx(Zr,{title:v,badge:b}),m.jsx(ol,{children:m.jsx(lA,{onRetry:i})})]}):m.jsxs(Jr,{children:[m.jsx(Zr,{title:v,badge:b,subtitle:m.jsx(Jf,{children:`${t.name}.json`}),actions:m.jsxs(m.Fragment,{children:[m.jsxs(Ee,{variant:d?"secondary":"outline",onClick:()=>h(k=>!k),children:[m.jsx(Tl,{})," JSON"]}),m.jsx(Ee,{onClick:x,disabled:a||!g.ok,children:M(a?"Saving…":"Save")})]})}),m.jsxs(ol,{children:[d&&m.jsx(iA,{path:`${t.name}.json`,data:n}),m.jsx(dm,{children:m.jsx("div",{className:"space-y-6",children:t.fields.map(k=>m.jsx(dA,{field:k,value:n[k.key],onChange:f,context:t.label??t.name},k.key))})}),m.jsx(cA,{result:g})]})]})}function Lv({title:t,tone:e="error",children:n}){const r=e==="error";return m.jsxs("div",{className:Ce("rounded-xl border p-4",r?"border-destructive/30 bg-destructive/5":"border-border bg-muted/40"),children:[m.jsxs("div",{className:Ce("flex items-center gap-2 text-sm font-medium",r?"text-destructive":"text-foreground"),children:[m.jsx(Pc,{className:"h-4 w-4 shrink-0"}),t]}),m.jsx("div",{className:"mt-2.5 text-sm text-muted-foreground",children:n})]})}function cA({result:t}){if(t.issues.length===0)return null;const e=t.issues.some(n=>n.level==="error");return m.jsx(Lv,{tone:e?"error":"warning",title:M(e?"Fix these before saving":"Warnings"),children:m.jsx("ul",{className:"space-y-2",children:t.issues.map(n=>m.jsxs("li",{className:"flex items-start gap-2.5",children:[m.jsx("span",{"aria-hidden":!0,className:Ce("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",n.level==="error"?"bg-destructive":"bg-muted-foreground/50")}),m.jsx("span",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-xs text-foreground",children:n.key}),m.jsx("span",{className:"min-w-0",children:M(n.message)})]},`${n.key}-${n.message}`))})})}function zv({label:t,required:e,type:n,hint:r,actions:o,children:s}){var a;const i=n?(a=Dv[n])==null?void 0:a.icon:null;return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&m.jsx(i,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"}),m.jsx(Bi,{className:"text-sm font-medium text-foreground",children:t}),e&&m.jsx("span",{className:"text-destructive","aria-hidden":!0,children:"*"}),r&&m.jsx("span",{className:"ml-auto truncate font-mono text-xs text-primary",children:r}),o&&m.jsx("span",{className:r?"":"ml-auto",children:o})]}),s]})}const iee=new Set(["text","richtext"]);function dA({field:t,value:e,onChange:n,context:r}){const[o,s]=C.useState(0),i=a=>{n(t.key,a),t.type==="richtext"&&s(u=>u+1)};return m.jsx(zv,{label:t.label||t.key,required:t.required,type:t.type,actions:iee.has(t.type)?m.jsx(HQ,{context:r,fieldLabel:t.label||t.key,currentValue:typeof e=="string"?e:"",richtext:t.type==="richtext",onResult:i}):void 0,children:m.jsx(fA,{field:t,value:e,onChange:n,richtextKey:o})})}function fA({field:t,value:e,onChange:n,richtextKey:r}){const o=t.key;switch(t.type){case"richtext":return m.jsx(KZ,{value:e??"",onChange:s=>n(o,s)},r);case"number":return m.jsx(jt,{type:"number",value:e===void 0?"":String(e),onChange:s=>n(o,s.target.value===""?"":Number(s.target.value))});case"boolean":return m.jsx(Ee,{type:"button",variant:e?"default":"outline",role:"switch","aria-checked":!!e,onClick:()=>n(o,!e),className:"min-w-20",children:M(e?"Yes":"No")});case"date":return m.jsx(jt,{type:"date",className:"w-[240px]",value:e??"",onChange:s=>n(o,s.target.value)});case"select":return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(Qu,{value:e||void 0,onValueChange:s=>n(o,s),children:[m.jsx(tc,{className:"w-[240px]",children:m.jsx(ec,{placeholder:M("Select…")})}),m.jsx(nc,{children:(t.options??[]).map(s=>m.jsx(rc,{value:s,children:s},s))})]}),e?m.jsxs(Ee,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>n(o,""),className:"text-muted-foreground",children:[m.jsx(pa,{}),m.jsx("span",{className:"sr-only",children:M("Clear")})]}):null]});case"relation":return m.jsx(cee,{field:t,value:e,onChange:n});case"image":return m.jsx(fee,{value:e,onChange:s=>n(o,s)});case"url":return m.jsx(jt,{type:"url",inputMode:"url",placeholder:"https://…",value:e??"",onChange:s=>n(o,s.target.value)});case"email":return m.jsx(jt,{type:"email",inputMode:"email",placeholder:"name@example.com",value:e??"",onChange:s=>n(o,s.target.value)});case"color":return m.jsx(aee,{value:e,onChange:s=>n(o,s)});case"list":return m.jsx(lee,{value:e,onChange:s=>n(o,s)});case"group":return m.jsx(uee,{field:t,value:e,onChange:s=>n(o,s)});default:return m.jsx(jt,{value:e??"",onChange:s=>n(o,s.target.value)})}}function aee({value:t,onChange:e}){const n=typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t)?t:"";return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("label",{className:"relative size-9 shrink-0 cursor-pointer overflow-hidden rounded-lg border shadow-sm",children:[m.jsx("span",{className:"block size-full",style:{backgroundColor:n||"#ffffff"}}),m.jsx("input",{type:"color",value:n||"#000000",onChange:r=>e(r.target.value),className:"absolute inset-0 cursor-pointer opacity-0","aria-label":M("Pick a color")})]}),m.jsx(jt,{className:"w-[140px] font-mono",placeholder:"#000000",value:t??"",onChange:r=>e(r.target.value)}),t?m.jsxs(Ee,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>e(""),className:"text-muted-foreground",children:[m.jsx(pa,{}),m.jsx("span",{className:"sr-only",children:M("Clear")})]}):null]})}function lee({value:t,onChange:e}){const n=Array.isArray(t)?t:[],[r,o]=C.useState(""),s=()=>{const a=r.trim();if(!a||n.includes(a)){o("");return}e([...n,a]),o("")},i=a=>{const u=n.filter((d,h)=>h!==a);e(u.length?u:"")};return m.jsxs("div",{className:"space-y-2.5",children:[n.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map((a,u)=>m.jsxs(_l,{variant:"secondary",className:"gap-1 pr-1",children:[a,m.jsx("button",{type:"button",onClick:()=>i(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":M("Remove {item}",{item:a}),children:m.jsx(pa,{className:"h-3 w-3"})})]},a))}),m.jsx(jt,{value:r,onChange:a=>o(a.target.value),onKeyDown:a=>{(a.key==="Enter"||a.key===",")&&(a.preventDefault(),s())},onBlur:s,placeholder:M("Type and press Enter…")})]})}function uee({field:t,value:e,onChange:n}){const r=e&&typeof e=="object"&&!Array.isArray(e)?e:{},o=(s,i)=>{const a={...r};i===""||i===void 0?delete a[s]:a[s]=i,n(Object.keys(a).length?a:"")};return m.jsx("div",{className:"space-y-5 rounded-lg border border-dashed bg-muted/20 p-4",children:(t.fields??[]).map(s=>m.jsx(zv,{label:s.label||s.key,required:s.required,type:s.type,children:m.jsx(fA,{field:s,value:r[s.key],onChange:o})},s.key))})}function cee({field:t,value:e,onChange:n}){const[r,o]=C.useState([]),s=Array.isArray(e)?e:[];C.useEffect(()=>{t.to&&q7(t.to).then(o).catch(()=>o([]))},[t.to]);const i=u=>n(t.key,u.length?u:""),a=u=>{i(s.includes(u)?s.filter(d=>d!==u):[...s,u])};return r.length===0?m.jsx("p",{className:"rounded-lg border border-dashed bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground",children:M("No entries in “{name}”.",{name:t.to??""})}):m.jsxs("div",{className:"space-y-2.5",children:[s.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(u=>m.jsxs(_l,{variant:"secondary",className:"gap-1 pr-1 font-mono",children:[u,m.jsx("button",{type:"button",onClick:()=>a(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":M("Remove the link to {slug}",{slug:u}),children:m.jsx(pa,{className:"h-3 w-3"})})]},u))}),m.jsxs(__,{children:[m.jsx(T_,{asChild:!0,children:m.jsxs(Ee,{variant:"outline",children:[m.jsx(v_,{})," ",M("Add link")]})}),m.jsxs(N_,{align:"start",className:"max-h-72 w-56 overflow-y-auto",children:[m.jsx(P1,{children:M("Entries in “{name}”",{name:t.to??""})}),m.jsx(wu,{}),r.map(u=>m.jsx(A_,{checked:s.includes(u),onCheckedChange:()=>a(u),onSelect:d=>d.preventDefault(),className:"font-mono text-xs",children:u},u))]})]})]})}async function dee(t,e=1600){const n=await createImageBitmap(t),r=Math.min(1,e/n.width),o=Math.round(n.width*r),s=Math.round(n.height*r),i=document.createElement("canvas");i.width=o,i.height=s;const a=i.getContext("2d");if(!a)throw new Error("no canvas context");a.drawImage(n,0,0,o,s);const u=await new Promise(f=>i.toBlob(f,"image/webp",.85));if(!u)throw new Error("conversion failed");const d=new Uint8Array(await u.arrayBuffer());let h="";for(const f of d)h+=String.fromCharCode(f);return btoa(h)}function fee({value:t,onChange:e}){const[n,r]=C.useState(!1),o=typeof t=="string"?t:"",s=o?`/media/${o.split("/").pop()}`:null,i=async a=>{r(!0);try{e(await J7(await dee(a),a.name)),Ct.success(M("Image uploaded"))}finally{r(!1)}};return m.jsxs("div",{className:"flex items-center gap-4 rounded-lg border bg-muted/30 p-3",children:[m.jsx("div",{className:Ce("flex h-24 w-24 shrink-0 items-center justify-center overflow-hidden rounded-lg border bg-card",!s&&"border-dashed"),children:s?m.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):m.jsx(x_,{className:"h-6 w-6 text-muted-foreground/60"})}),m.jsxs("div",{className:"min-w-0 space-y-2",children:[m.jsxs("label",{className:Ce(Mp({variant:"outline"}),"cursor-pointer bg-card"),children:[m.jsx(Xu,{}),M(n?"Uploading…":"Upload image"),m.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:a=>{var d;const u=(d=a.target.files)==null?void 0:d[0];u&&i(u)}})]}),o&&m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:o}),m.jsx(Ee,{type:"button",variant:"ghost",size:"xs",onClick:()=>e(""),className:"text-muted-foreground hover:text-destructive",children:M("remove")})]})]})]})}const hA=document.getElementById("root");if(!hA)throw new Error("no root element");p5.createRoot(hA).render(m.jsx(C.StrictMode,{children:m.jsx(UQ,{})}));