@kdrgny/justjson 1.4.0 → 1.7.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.
- package/README.md +4 -1
- package/dist/cli.js +414 -25
- package/dist/editor/assets/index-CPfRKa4y.js +651 -0
- package/dist/editor/assets/index-DhsxkS_F.css +1 -0
- package/dist/editor/index.html +2 -2
- package/package.json +1 -1
- package/dist/editor/assets/index-B7tRIQcy.js +0 -632
- package/dist/editor/assets/index-GwsCiKhf.css +0 -1
|
@@ -1,632 +0,0 @@
|
|
|
1
|
-
var c2=t=>{throw TypeError(t)};var d2=(t,e,n)=>e.has(t)||c2("Cannot "+n);var Tn=(t,e,n)=>(d2(t,e,"read from private field"),n?n.call(t):e.get(t)),f2=(t,e,n)=>e.has(t)?c2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),z0=(t,e,n,r)=>(d2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function KM(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 Ty(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var F0={exports:{}},du={},$0={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 h2;function GM(){if(h2)return Ke;h2=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"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(L){return L===null||typeof L!="object"?null:(L=h&&L[h]||L["@@iterator"],typeof L=="function"?L:null)}var y={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||y}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||y}var T=_.prototype=new E;T.constructor=_,v(T,k.prototype),T.isPureReactComponent=!0;var N=Array.isArray,M=Object.prototype.hasOwnProperty,D={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function P(L,V,re){var he,ce={},pe=null,De=null;if(V!=null)for(he in V.ref!==void 0&&(De=V.ref),V.key!==void 0&&(pe=""+V.key),V)M.call(V,he)&&!I.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:De,props:ce,_owner:D.current}}function O(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 De=!1;if(L===null)De=!0;else switch(pe){case"string":case"number":De=!0;break;case"object":switch(L.$$typeof){case t:case e:De=!0}}if(De)return De=L,ce=ce(De),L=he===""?"."+K(De,0):he,N(ce)?(re="",L!=null&&(re=L.replace(J,"$&/")+"/"),Y(ce,V,re,"",function(me){return me})):ce!=null&&(W(ce)&&(ce=O(ce,re+(!ce.key||De&&De.key===ce.key?"":(""+ce.key).replace(J,"$&/")+"/")+L)),V.push(ce)),1;if(De=0,he=he===""?".":he+":",N(L))for(var Q=0;Q<L.length;Q++){pe=L[Q];var de=he+K(pe,Q);De+=Y(pe,V,re,de,ce)}else if(de=m(L),typeof de=="function")for(L=de.call(L),Q=0;!(pe=L.next()).done;)pe=pe.value,de=he+K(pe,Q++),De+=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 De}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:D};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,De=L._owner;if(V!=null){if(V.ref!==void 0&&(pe=V.ref,De=D.current),V.key!==void 0&&(ce=""+V.key),L.type&&L.type.defaultProps)var Q=L.type.defaultProps;for(de in V)M.call(V,de)&&!I.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:De}},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:l,render:L}},Ke.isValidElement=W,Ke.lazy=function(L){return{$$typeof:f,_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 p2;function _c(){return p2||(p2=1,$0.exports=GM()),$0.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 m2;function JM(){if(m2)return du;m2=1;var t=_c(),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(l,u,d){var f,h={},m=null,y=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(y=u.ref);for(f in u)r.call(u,f)&&!s.hasOwnProperty(f)&&(h[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:e,type:l,key:m,ref:y,props:h,_owner:o.current}}return du.Fragment=n,du.jsx=i,du.jsxs=i,du}var g2;function ZM(){return g2||(g2=1,F0.exports=JM()),F0.exports}var x=ZM(),C=_c();const ne=Ty(C),bl=KM({__proto__:null,default:ne},[C]);var of={},B0={exports:{}},Zn={},V0={exports:{}},H0={};/**
|
|
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 y2;function YM(){return y2||(y2=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,De=q[pe];if(0>o(ce,F))pe<V&&0>o(De,ce)?(q[L]=De,q[pe]=F,L=pe):(q[L]=ce,q[he]=F,L=he);else if(pe<V&&0>o(De,F))q[L]=De,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,l=i.now();t.unstable_now=function(){return i.now()-l}}var u=[],d=[],f=1,h=null,m=3,y=!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 N(q){if(b=!1,T(q),!v)if(n(u)!==null)v=!0,G(M);else{var te=n(d);te!==null&&X(N,te.startTime-q)}}function M(q,te){v=!1,b&&(b=!1,E(P),P=-1),y=!0;var F=m;try{for(T(te),h=n(u);h!==null&&(!(h.expirationTime>te)||q&&!Z());){var L=h.callback;if(typeof L=="function"){h.callback=null,m=h.priorityLevel;var V=L(h.expirationTime<=te);te=t.unstable_now(),typeof V=="function"?h.callback=V:h===n(u)&&r(u),T(te)}else r(u);h=n(u)}if(h!==null)var re=!0;else{var he=n(d);he!==null&&X(N,he.startTime-te),re=!1}return re}finally{h=null,m=F,y=!1}}var D=!1,I=null,P=-1,O=5,W=-1;function Z(){return!(t.unstable_now()-W<O)}function J(){if(I!==null){var q=t.unstable_now();W=q;var te=!0;try{te=I(!0,q)}finally{te?K():(D=!1,I=null)}}else D=!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){I=q,D||(D=!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||y||(v=!0,G(M))},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"):O=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(q){switch(m){case 1:case 2:case 3:var te=3;break;default:te=m}var F=m;m=te;try{return q()}finally{m=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=m;m=q;try{return te()}finally{m=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:f++,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(N,F-L))):(q.sortIndex=V,e(u,q),v||y||(v=!0,G(M))),q},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(q){var te=m;return function(){var F=m;m=te;try{return q.apply(this,arguments)}finally{m=F}}}})(H0)),H0}var x2;function XM(){return x2||(x2=1,V0.exports=YM()),V0.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 v2;function QM(){if(v2)return Zn;v2=1;var t=_c(),e=XM();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; 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(a,c){i(a,c),i(a+"Capture",c)}function i(a,c){for(o[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(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]*$/,f={},h={};function m(a){return u.call(h,a)?!0:u.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function y(a,c,p,g){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,c,p,g){if(c===null||typeof c>"u"||y(a,c,p,g))return!0;if(g)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(a,c,p,g,w,S,A){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=a,this.type=c,this.sanitizeURL=S,this.removeEmptyString=A}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){k[a]=new b(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];k[c]=new b(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){k[a]=new b(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){k[a]=new b(a,2,!1,a,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(a){k[a]=new b(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){k[a]=new b(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){k[a]=new b(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){k[a]=new b(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){k[a]=new b(a,5,!1,a.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function _(a){return a[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(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){k[a]=new b(a,1,!1,a.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(a){k[a]=new b(a,1,!1,a.toLowerCase(),null,!0,!0)});function T(a,c,p,g){var w=k.hasOwnProperty(c)?k[c]:null;(w!==null?w.type!==0:g||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(v(c,p,w,g)&&(p=null),g||w===null?m(c)&&(p===null?a.removeAttribute(c):a.setAttribute(c,""+p)):w.mustUseProperty?a[w.propertyName]=p===null?w.type===3?!1:"":p:(c=w.attributeName,g=w.attributeNamespace,p===null?a.removeAttribute(c):(w=w.type,p=w===3||w===4&&p===!0?"":""+p,g?a.setAttributeNS(g,c,p):a.setAttribute(c,p))))}var N=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),D=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),O=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(a){return a===null||typeof a!="object"?null:(a=q&&a[q]||a["@@iterator"],typeof a=="function"?a:null)}var F=Object.assign,L;function V(a){if(L===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);L=c&&c[1]||""}return`
|
|
34
|
-
`+L+a}var re=!1;function he(a,c){if(!a||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 g=U}Reflect.construct(a,[],c)}else{try{c.call()}catch(U){g=U}a.call(c.prototype)}else{try{throw Error()}catch(U){g=U}a()}}catch(U){if(U&&g&&typeof U.stack=="string"){for(var w=U.stack.split(`
|
|
35
|
-
`),S=g.stack.split(`
|
|
36
|
-
`),A=w.length-1,R=S.length-1;1<=A&&0<=R&&w[A]!==S[R];)R--;for(;1<=A&&0<=R;A--,R--)if(w[A]!==S[R]){if(A!==1||R!==1)do if(A--,R--,0>R||w[A]!==S[R]){var z=`
|
|
37
|
-
`+w[A].replace(" at new "," at ");return a.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",a.displayName)),z}while(1<=A&&0<=R);break}}}finally{re=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?V(a):""}function ce(a){switch(a.tag){case 5:return V(a.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return a=he(a.type,!1),a;case 11:return a=he(a.type.render,!1),a;case 1:return a=he(a.type,!0),a;default:return""}}function pe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case D:return"Portal";case O:return"Profiler";case P:return"StrictMode";case K:return"Suspense";case Y:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Z:return(a.displayName||"Context")+".Consumer";case W:return(a._context.displayName||"Context")+".Provider";case J:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case ee:return c=a.displayName||null,c!==null?c:pe(a.type)||"Memo";case G:c=a._payload,a=a._init;try{return pe(a(c))}catch{}}return null}function De(a){var c=a.type;switch(a.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 a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"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(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function de(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function me(a){var c=de(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),g=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,S=p.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return w.call(this)},set:function(A){g=""+A,S.call(this,A)}}),Object.defineProperty(a,c,{enumerable:p.enumerable}),{getValue:function(){return g},setValue:function(A){g=""+A},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Fe(a){a._valueTracker||(a._valueTracker=me(a))}function Re(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),g="";return a&&(g=de(a)?a.checked?"true":"false":a.value),a=g,a!==p?(c.setValue(a),!0):!1}function Be(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ye(a,c){var p=c.checked;return F({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function Nt(a,c){var p=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;p=Q(c.value!=null?c.value:p),a._wrapperState={initialChecked:g,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function jt(a,c){c=c.checked,c!=null&&T(a,"checked",c,!1)}function Ut(a,c){jt(a,c);var p=Q(c.value),g=c.type;if(p!=null)g==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Wt(a,c.type,p):c.hasOwnProperty("defaultValue")&&Wt(a,c.type,Q(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function $n(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,p||c===a.value||(a.value=c),a.defaultValue=c}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Wt(a,c,p){(c!=="number"||Be(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var nn=Array.isArray;function Dn(a,c,p,g){if(a=a.options,c){c={};for(var w=0;w<p.length;w++)c["$"+p[w]]=!0;for(p=0;p<a.length;p++)w=c.hasOwnProperty("$"+a[p].value),a[p].selected!==w&&(a[p].selected=w),w&&g&&(a[p].defaultSelected=!0)}else{for(p=""+Q(p),c=null,w=0;w<a.length;w++){if(a[w].value===p){a[w].selected=!0,g&&(a[w].defaultSelected=!0);return}c!==null||a[w].disabled||(c=a[w])}c!==null&&(c.selected=!0)}}function pt(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return F({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function pr(a,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}a._wrapperState={initialValue:Q(p)}}function bi(a,c){var p=Q(c.value),g=Q(c.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),c.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),g!=null&&(a.defaultValue=""+g)}function ga(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Ao(a){switch(a){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 mr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Ao(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Bn,gr=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,g,w){MSApp.execUnsafeLocalFunction(function(){return a(c,p,g,w)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Bn=Bn||document.createElement("div"),Bn.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Bn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Rn(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.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},Or=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(a){Or.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),mn[c]=mn[a]})});function ya(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||mn.hasOwnProperty(a)&&mn[a]?(""+c).trim():c+"px"}function xa(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var g=p.indexOf("--")===0,w=ya(p,c[p],g);p==="float"&&(p="cssFloat"),g?a.setProperty(p,w):a[p]=w}}var fs=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 No(a,c){if(c){if(fs[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));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 ki(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 Yr=null;function Vn(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var wi=null,Xr=null,gt=null;function qt(a){if(a=Zl(a)){if(typeof wi!="function")throw Error(n(280));var c=a.stateNode;c&&(c=vd(c),wi(a.stateNode,a.type,c))}}function Ne(a){Xr?gt?gt.push(a):gt=[a]:Xr=a}function it(){if(Xr){var a=Xr,c=gt;if(gt=Xr=null,qt(a),c)for(a=0;a<c.length;a++)qt(c[a])}}function tt(a,c){return a(c)}function at(){}var Kt=!1;function mt(a,c,p){if(Kt)return a(c,p);Kt=!0;try{return tt(a,c,p)}finally{Kt=!1,(Xr!==null||gt!==null)&&(at(),it())}}function Je(a,c){var p=a.stateNode;if(p===null)return null;var g=vd(p);if(g===null)return null;p=g[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":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var gn=!1;if(l)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 _t(a,c,p,g,w,S,A,R,z){var U=Array.prototype.slice.call(arguments,3);try{c.apply(p,U)}catch(ie){this.onError(ie)}}var Hn=!1,rn=null,Un=!1,Mo=null,Dl={onError:function(a){Hn=!0,rn=a}};function tN(a,c,p,g,w,S,A,R,z){Hn=!1,rn=null,_t.apply(Dl,arguments)}function nN(a,c,p,g,w,S,A,R,z){if(tN.apply(this,arguments),Hn){if(Hn){var U=rn;Hn=!1,rn=null}else throw Error(n(198));Un||(Un=!0,Mo=U)}}function Ci(a){var c=a,p=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(p=c.return),a=c.return;while(a)}return c.tag===3?p:null}function Ov(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Iv(a){if(Ci(a)!==a)throw Error(n(188))}function rN(a){var c=a.alternate;if(!c){if(c=Ci(a),c===null)throw Error(n(188));return c!==a?null:a}for(var p=a,g=c;;){var w=p.return;if(w===null)break;var S=w.alternate;if(S===null){if(g=w.return,g!==null){p=g;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===p)return Iv(w),a;if(S===g)return Iv(w),c;S=S.sibling}throw Error(n(188))}if(p.return!==g.return)p=w,g=S;else{for(var A=!1,R=w.child;R;){if(R===p){A=!0,p=w,g=S;break}if(R===g){A=!0,g=w,p=S;break}R=R.sibling}if(!A){for(R=S.child;R;){if(R===p){A=!0,p=S,g=w;break}if(R===g){A=!0,g=S,p=w;break}R=R.sibling}if(!A)throw Error(n(189))}}if(p.alternate!==g)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:c}function Pv(a){return a=rN(a),a!==null?jv(a):null}function jv(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=jv(a);if(c!==null)return c;a=a.sibling}return null}var Lv=e.unstable_scheduleCallback,zv=e.unstable_cancelCallback,oN=e.unstable_shouldYield,sN=e.unstable_requestPaint,It=e.unstable_now,iN=e.unstable_getCurrentPriorityLevel,om=e.unstable_ImmediatePriority,Fv=e.unstable_UserBlockingPriority,Qc=e.unstable_NormalPriority,aN=e.unstable_LowPriority,$v=e.unstable_IdlePriority,ed=null,Qr=null;function lN(a){if(Qr&&typeof Qr.onCommitFiberRoot=="function")try{Qr.onCommitFiberRoot(ed,a,void 0,(a.current.flags&128)===128)}catch{}}var Ir=Math.clz32?Math.clz32:dN,uN=Math.log,cN=Math.LN2;function dN(a){return a>>>=0,a===0?32:31-(uN(a)/cN|0)|0}var td=64,nd=4194304;function Rl(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function rd(a,c){var p=a.pendingLanes;if(p===0)return 0;var g=0,w=a.suspendedLanes,S=a.pingedLanes,A=p&268435455;if(A!==0){var R=A&~w;R!==0?g=Rl(R):(S&=A,S!==0&&(g=Rl(S)))}else A=p&~w,A!==0?g=Rl(A):S!==0&&(g=Rl(S));if(g===0)return 0;if(c!==0&&c!==g&&(c&w)===0&&(w=g&-g,S=c&-c,w>=S||w===16&&(S&4194240)!==0))return c;if((g&4)!==0&&(g|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=g;0<c;)p=31-Ir(c),w=1<<p,g|=a[p],c&=~w;return g}function fN(a,c){switch(a){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 hN(a,c){for(var p=a.suspendedLanes,g=a.pingedLanes,w=a.expirationTimes,S=a.pendingLanes;0<S;){var A=31-Ir(S),R=1<<A,z=w[A];z===-1?((R&p)===0||(R&g)!==0)&&(w[A]=fN(R,c)):z<=c&&(a.expiredLanes|=R),S&=~R}}function sm(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Bv(){var a=td;return td<<=1,(td&4194240)===0&&(td=64),a}function im(a){for(var c=[],p=0;31>p;p++)c.push(a);return c}function Ol(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Ir(c),a[c]=p}function pN(a,c){var p=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<p;){var w=31-Ir(p),S=1<<w;c[w]=0,g[w]=-1,a[w]=-1,p&=~S}}function am(a,c){var p=a.entangledLanes|=c;for(a=a.entanglements;p;){var g=31-Ir(p),w=1<<g;w&c|a[g]&c&&(a[g]|=c),p&=~w}}var ct=0;function Vv(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Hv,lm,Uv,Wv,qv,um=!1,od=[],hs=null,ps=null,ms=null,Il=new Map,Pl=new Map,gs=[],mN="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 Kv(a,c){switch(a){case"focusin":case"focusout":hs=null;break;case"dragenter":case"dragleave":ps=null;break;case"mouseover":case"mouseout":ms=null;break;case"pointerover":case"pointerout":Il.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(c.pointerId)}}function jl(a,c,p,g,w,S){return a===null||a.nativeEvent!==S?(a={blockedOn:c,domEventName:p,eventSystemFlags:g,nativeEvent:S,targetContainers:[w]},c!==null&&(c=Zl(c),c!==null&&lm(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),a)}function gN(a,c,p,g,w){switch(c){case"focusin":return hs=jl(hs,a,c,p,g,w),!0;case"dragenter":return ps=jl(ps,a,c,p,g,w),!0;case"mouseover":return ms=jl(ms,a,c,p,g,w),!0;case"pointerover":var S=w.pointerId;return Il.set(S,jl(Il.get(S)||null,a,c,p,g,w)),!0;case"gotpointercapture":return S=w.pointerId,Pl.set(S,jl(Pl.get(S)||null,a,c,p,g,w)),!0}return!1}function Gv(a){var c=Si(a.target);if(c!==null){var p=Ci(c);if(p!==null){if(c=p.tag,c===13){if(c=Ov(p),c!==null){a.blockedOn=c,qv(a.priority,function(){Uv(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function sd(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var p=dm(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var g=new p.constructor(p.type,p);Yr=g,p.target.dispatchEvent(g),Yr=null}else return c=Zl(p),c!==null&&lm(c),a.blockedOn=p,!1;c.shift()}return!0}function Jv(a,c,p){sd(a)&&p.delete(c)}function yN(){um=!1,hs!==null&&sd(hs)&&(hs=null),ps!==null&&sd(ps)&&(ps=null),ms!==null&&sd(ms)&&(ms=null),Il.forEach(Jv),Pl.forEach(Jv)}function Ll(a,c){a.blockedOn===c&&(a.blockedOn=null,um||(um=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yN)))}function zl(a){function c(w){return Ll(w,a)}if(0<od.length){Ll(od[0],a);for(var p=1;p<od.length;p++){var g=od[p];g.blockedOn===a&&(g.blockedOn=null)}}for(hs!==null&&Ll(hs,a),ps!==null&&Ll(ps,a),ms!==null&&Ll(ms,a),Il.forEach(c),Pl.forEach(c),p=0;p<gs.length;p++)g=gs[p],g.blockedOn===a&&(g.blockedOn=null);for(;0<gs.length&&(p=gs[0],p.blockedOn===null);)Gv(p),p.blockedOn===null&&gs.shift()}var va=N.ReactCurrentBatchConfig,id=!0;function xN(a,c,p,g){var w=ct,S=va.transition;va.transition=null;try{ct=1,cm(a,c,p,g)}finally{ct=w,va.transition=S}}function vN(a,c,p,g){var w=ct,S=va.transition;va.transition=null;try{ct=4,cm(a,c,p,g)}finally{ct=w,va.transition=S}}function cm(a,c,p,g){if(id){var w=dm(a,c,p,g);if(w===null)Am(a,c,g,ad,p),Kv(a,g);else if(gN(w,a,c,p,g))g.stopPropagation();else if(Kv(a,g),c&4&&-1<mN.indexOf(a)){for(;w!==null;){var S=Zl(w);if(S!==null&&Hv(S),S=dm(a,c,p,g),S===null&&Am(a,c,g,ad,p),S===w)break;w=S}w!==null&&g.stopPropagation()}else Am(a,c,g,null,p)}}var ad=null;function dm(a,c,p,g){if(ad=null,a=Vn(g),a=Si(a),a!==null)if(c=Ci(a),c===null)a=null;else if(p=c.tag,p===13){if(a=Ov(c),a!==null)return a;a=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return ad=a,null}function Zv(a){switch(a){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(iN()){case om:return 1;case Fv:return 4;case Qc:case aN:return 16;case $v:return 536870912;default:return 16}default:return 16}}var ys=null,fm=null,ld=null;function Yv(){if(ld)return ld;var a,c=fm,p=c.length,g,w="value"in ys?ys.value:ys.textContent,S=w.length;for(a=0;a<p&&c[a]===w[a];a++);var A=p-a;for(g=1;g<=A&&c[p-g]===w[S-g];g++);return ld=w.slice(a,1<g?1-g:void 0)}function ud(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function cd(){return!0}function Xv(){return!1}function rr(a){function c(p,g,w,S,A){this._reactName=p,this._targetInst=w,this.type=g,this.nativeEvent=S,this.target=A,this.currentTarget=null;for(var R in a)a.hasOwnProperty(R)&&(p=a[R],this[R]=p?p(S):S[R]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?cd:Xv,this.isPropagationStopped=Xv,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=cd)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=cd)},persist:function(){},isPersistent:cd}),c}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hm=rr(ba),Fl=F({},ba,{view:0,detail:0}),bN=rr(Fl),pm,mm,$l,dd=F({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ym,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==$l&&($l&&a.type==="mousemove"?(pm=a.screenX-$l.screenX,mm=a.screenY-$l.screenY):mm=pm=0,$l=a),pm)},movementY:function(a){return"movementY"in a?a.movementY:mm}}),Qv=rr(dd),kN=F({},dd,{dataTransfer:0}),wN=rr(kN),CN=F({},Fl,{relatedTarget:0}),gm=rr(CN),SN=F({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=rr(SN),_N=F({},ba,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),TN=rr(_N),AN=F({},ba,{data:0}),eb=rr(AN),NN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MN={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"},DN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RN(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=DN[a])?!!c[a]:!1}function ym(){return RN}var ON=F({},Fl,{key:function(a){if(a.key){var c=NN[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=ud(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?MN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ym,charCode:function(a){return a.type==="keypress"?ud(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ud(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),IN=rr(ON),PN=F({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tb=rr(PN),jN=F({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ym}),LN=rr(jN),zN=F({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),FN=rr(zN),$N=F({},dd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),BN=rr($N),VN=[9,13,27,32],xm=l&&"CompositionEvent"in window,Bl=null;l&&"documentMode"in document&&(Bl=document.documentMode);var HN=l&&"TextEvent"in window&&!Bl,nb=l&&(!xm||Bl&&8<Bl&&11>=Bl),rb=" ",ob=!1;function sb(a,c){switch(a){case"keyup":return VN.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ib(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ka=!1;function UN(a,c){switch(a){case"compositionend":return ib(c);case"keypress":return c.which!==32?null:(ob=!0,rb);case"textInput":return a=c.data,a===rb&&ob?null:a;default:return null}}function WN(a,c){if(ka)return a==="compositionend"||!xm&&sb(a,c)?(a=Yv(),ld=fm=ys=null,ka=!1,a):null;switch(a){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 nb&&c.locale!=="ko"?null:c.data;default:return null}}var qN={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 ab(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!qN[a.type]:c==="textarea"}function lb(a,c,p,g){Ne(g),c=gd(c,"onChange"),0<c.length&&(p=new hm("onChange","change",null,p,g),a.push({event:p,listeners:c}))}var Vl=null,Hl=null;function KN(a){_b(a,0)}function fd(a){var c=_a(a);if(Re(c))return a}function GN(a,c){if(a==="change")return c}var ub=!1;if(l){var vm;if(l){var bm="oninput"in document;if(!bm){var cb=document.createElement("div");cb.setAttribute("oninput","return;"),bm=typeof cb.oninput=="function"}vm=bm}else vm=!1;ub=vm&&(!document.documentMode||9<document.documentMode)}function db(){Vl&&(Vl.detachEvent("onpropertychange",fb),Hl=Vl=null)}function fb(a){if(a.propertyName==="value"&&fd(Hl)){var c=[];lb(c,Hl,a,Vn(a)),mt(KN,c)}}function JN(a,c,p){a==="focusin"?(db(),Vl=c,Hl=p,Vl.attachEvent("onpropertychange",fb)):a==="focusout"&&db()}function ZN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return fd(Hl)}function YN(a,c){if(a==="click")return fd(c)}function XN(a,c){if(a==="input"||a==="change")return fd(c)}function QN(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Pr=typeof Object.is=="function"?Object.is:QN;function Ul(a,c){if(Pr(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var p=Object.keys(a),g=Object.keys(c);if(p.length!==g.length)return!1;for(g=0;g<p.length;g++){var w=p[g];if(!u.call(c,w)||!Pr(a[w],c[w]))return!1}return!0}function hb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function pb(a,c){var p=hb(a);a=0;for(var g;p;){if(p.nodeType===3){if(g=a+p.textContent.length,a<=c&&g>=c)return{node:p,offset:c-a};a=g}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=hb(p)}}function mb(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?mb(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function gb(){for(var a=window,c=Be();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=Be(a.document)}return c}function km(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function eM(a){var c=gb(),p=a.focusedElem,g=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&mb(p.ownerDocument.documentElement,p)){if(g!==null&&km(p)){if(c=g.start,a=g.end,a===void 0&&(a=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(a,p.value.length);else if(a=(c=p.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var w=p.textContent.length,S=Math.min(g.start,w);g=g.end===void 0?S:Math.min(g.end,w),!a.extend&&S>g&&(w=g,g=S,S=w),w=pb(p,S);var A=pb(p,g);w&&A&&(a.rangeCount!==1||a.anchorNode!==w.node||a.anchorOffset!==w.offset||a.focusNode!==A.node||a.focusOffset!==A.offset)&&(c=c.createRange(),c.setStart(w.node,w.offset),a.removeAllRanges(),S>g?(a.addRange(c),a.extend(A.node,A.offset)):(c.setEnd(A.node,A.offset),a.addRange(c)))}}for(c=[],a=p;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)a=c[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var tM=l&&"documentMode"in document&&11>=document.documentMode,wa=null,wm=null,Wl=null,Cm=!1;function yb(a,c,p){var g=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Cm||wa==null||wa!==Be(g)||(g=wa,"selectionStart"in g&&km(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Wl&&Ul(Wl,g)||(Wl=g,g=gd(wm,"onSelect"),0<g.length&&(c=new hm("onSelect","select",null,c,p),a.push({event:c,listeners:g}),c.target=wa)))}function hd(a,c){var p={};return p[a.toLowerCase()]=c.toLowerCase(),p["Webkit"+a]="webkit"+c,p["Moz"+a]="moz"+c,p}var Ca={animationend:hd("Animation","AnimationEnd"),animationiteration:hd("Animation","AnimationIteration"),animationstart:hd("Animation","AnimationStart"),transitionend:hd("Transition","TransitionEnd")},Sm={},xb={};l&&(xb=document.createElement("div").style,"AnimationEvent"in window||(delete Ca.animationend.animation,delete Ca.animationiteration.animation,delete Ca.animationstart.animation),"TransitionEvent"in window||delete Ca.transitionend.transition);function pd(a){if(Sm[a])return Sm[a];if(!Ca[a])return a;var c=Ca[a],p;for(p in c)if(c.hasOwnProperty(p)&&p in xb)return Sm[a]=c[p];return a}var vb=pd("animationend"),bb=pd("animationiteration"),kb=pd("animationstart"),wb=pd("transitionend"),Cb=new Map,Sb="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 xs(a,c){Cb.set(a,c),s(c,[a])}for(var Em=0;Em<Sb.length;Em++){var _m=Sb[Em],nM=_m.toLowerCase(),rM=_m[0].toUpperCase()+_m.slice(1);xs(nM,"on"+rM)}xs(vb,"onAnimationEnd"),xs(bb,"onAnimationIteration"),xs(kb,"onAnimationStart"),xs("dblclick","onDoubleClick"),xs("focusin","onFocus"),xs("focusout","onBlur"),xs(wb,"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 ql="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(" "),oM=new Set("cancel close invalid load scroll toggle".split(" ").concat(ql));function Eb(a,c,p){var g=a.type||"unknown-event";a.currentTarget=p,nN(g,c,void 0,a),a.currentTarget=null}function _b(a,c){c=(c&4)!==0;for(var p=0;p<a.length;p++){var g=a[p],w=g.event;g=g.listeners;e:{var S=void 0;if(c)for(var A=g.length-1;0<=A;A--){var R=g[A],z=R.instance,U=R.currentTarget;if(R=R.listener,z!==S&&w.isPropagationStopped())break e;Eb(w,R,U),S=z}else for(A=0;A<g.length;A++){if(R=g[A],z=R.instance,U=R.currentTarget,R=R.listener,z!==S&&w.isPropagationStopped())break e;Eb(w,R,U),S=z}}}if(Un)throw a=Mo,Un=!1,Mo=null,a}function bt(a,c){var p=c[Im];p===void 0&&(p=c[Im]=new Set);var g=a+"__bubble";p.has(g)||(Tb(c,a,2,!1),p.add(g))}function Tm(a,c,p){var g=0;c&&(g|=4),Tb(p,a,g,c)}var md="_reactListening"+Math.random().toString(36).slice(2);function Kl(a){if(!a[md]){a[md]=!0,r.forEach(function(p){p!=="selectionchange"&&(oM.has(p)||Tm(p,!1,a),Tm(p,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[md]||(c[md]=!0,Tm("selectionchange",!1,c))}}function Tb(a,c,p,g){switch(Zv(c)){case 1:var w=xN;break;case 4:w=vN;break;default:w=cm}p=w.bind(null,c,p,a),w=void 0,!gn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),g?w!==void 0?a.addEventListener(c,p,{capture:!0,passive:w}):a.addEventListener(c,p,!0):w!==void 0?a.addEventListener(c,p,{passive:w}):a.addEventListener(c,p,!1)}function Am(a,c,p,g,w){var S=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var A=g.tag;if(A===3||A===4){var R=g.stateNode.containerInfo;if(R===w||R.nodeType===8&&R.parentNode===w)break;if(A===4)for(A=g.return;A!==null;){var z=A.tag;if((z===3||z===4)&&(z=A.stateNode.containerInfo,z===w||z.nodeType===8&&z.parentNode===w))return;A=A.return}for(;R!==null;){if(A=Si(R),A===null)return;if(z=A.tag,z===5||z===6){g=S=A;continue e}R=R.parentNode}}g=g.return}mt(function(){var U=S,ie=Vn(p),ae=[];e:{var se=Cb.get(a);if(se!==void 0){var ge=hm,we=a;switch(a){case"keypress":if(ud(p)===0)break e;case"keydown":case"keyup":ge=IN;break;case"focusin":we="focus",ge=gm;break;case"focusout":we="blur",ge=gm;break;case"beforeblur":case"afterblur":ge=gm;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":ge=Qv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=wN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=LN;break;case vb:case bb:case kb:ge=EN;break;case wb:ge=FN;break;case"scroll":ge=bN;break;case"wheel":ge=BN;break;case"copy":case"cut":case"paste":ge=TN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=tb}var Se=(c&4)!==0,Pt=!Se&&a==="scroll",B=Se?se!==null?se+"Capture":null:se;Se=[];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&&Se.push(Gl($,fe,H)))),Pt)break;$=$.return}0<Se.length&&(se=new ge(se,we,null,p,ie),ae.push({event:se,listeners:Se}))}}if((c&7)===0){e:{if(se=a==="mouseover"||a==="pointerover",ge=a==="mouseout"||a==="pointerout",se&&p!==Yr&&(we=p.relatedTarget||p.fromElement)&&(Si(we)||we[Do]))break e;if((ge||se)&&(se=ie.window===ie?ie:(se=ie.ownerDocument)?se.defaultView||se.parentWindow:window,ge?(we=p.relatedTarget||p.toElement,ge=U,we=we?Si(we):null,we!==null&&(Pt=Ci(we),we!==Pt||we.tag!==5&&we.tag!==6)&&(we=null)):(ge=null,we=U),ge!==we)){if(Se=Qv,fe="onMouseLeave",B="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Se=tb,fe="onPointerLeave",B="onPointerEnter",$="pointer"),Pt=ge==null?se:_a(ge),H=we==null?se:_a(we),se=new Se(fe,$+"leave",ge,p,ie),se.target=Pt,se.relatedTarget=H,fe=null,Si(ie)===U&&(Se=new Se(B,$+"enter",we,p,ie),Se.target=H,Se.relatedTarget=Pt,fe=Se),Pt=fe,ge&&we)t:{for(Se=ge,B=we,$=0,H=Se;H;H=Sa(H))$++;for(H=0,fe=B;fe;fe=Sa(fe))H++;for(;0<$-H;)Se=Sa(Se),$--;for(;0<H-$;)B=Sa(B),H--;for(;$--;){if(Se===B||B!==null&&Se===B.alternate)break t;Se=Sa(Se),B=Sa(B)}Se=null}else Se=null;ge!==null&&Ab(ae,se,ge,Se,!1),we!==null&&Pt!==null&&Ab(ae,Pt,we,Se,!0)}}e:{if(se=U?_a(U):window,ge=se.nodeName&&se.nodeName.toLowerCase(),ge==="select"||ge==="input"&&se.type==="file")var _e=GN;else if(ab(se))if(ub)_e=XN;else{_e=ZN;var Pe=JN}else(ge=se.nodeName)&&ge.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(_e=YN);if(_e&&(_e=_e(a,U))){lb(ae,_e,p,ie);break e}Pe&&Pe(a,se,U),a==="focusout"&&(Pe=se._wrapperState)&&Pe.controlled&&se.type==="number"&&Wt(se,"number",se.value)}switch(Pe=U?_a(U):window,a){case"focusin":(ab(Pe)||Pe.contentEditable==="true")&&(wa=Pe,wm=U,Wl=null);break;case"focusout":Wl=wm=wa=null;break;case"mousedown":Cm=!0;break;case"contextmenu":case"mouseup":case"dragend":Cm=!1,yb(ae,p,ie);break;case"selectionchange":if(tM)break;case"keydown":case"keyup":yb(ae,p,ie)}var je;if(xm)e:{switch(a){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else ka?sb(a,p)&&($e="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&($e="onCompositionStart");$e&&(nb&&p.locale!=="ko"&&(ka||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&ka&&(je=Yv()):(ys=ie,fm="value"in ys?ys.value:ys.textContent,ka=!0)),Pe=gd(U,$e),0<Pe.length&&($e=new eb($e,a,null,p,ie),ae.push({event:$e,listeners:Pe}),je?$e.data=je:(je=ib(p),je!==null&&($e.data=je)))),(je=HN?UN(a,p):WN(a,p))&&(U=gd(U,"onBeforeInput"),0<U.length&&(ie=new eb("onBeforeInput","beforeinput",null,p,ie),ae.push({event:ie,listeners:U}),ie.data=je))}_b(ae,c)})}function Gl(a,c,p){return{instance:a,listener:c,currentTarget:p}}function gd(a,c){for(var p=c+"Capture",g=[];a!==null;){var w=a,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=Je(a,p),S!=null&&g.unshift(Gl(a,S,w)),S=Je(a,c),S!=null&&g.push(Gl(a,S,w))),a=a.return}return g}function Sa(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function Ab(a,c,p,g,w){for(var S=c._reactName,A=[];p!==null&&p!==g;){var R=p,z=R.alternate,U=R.stateNode;if(z!==null&&z===g)break;R.tag===5&&U!==null&&(R=U,w?(z=Je(p,S),z!=null&&A.unshift(Gl(p,z,R))):w||(z=Je(p,S),z!=null&&A.push(Gl(p,z,R)))),p=p.return}A.length!==0&&a.push({event:c,listeners:A})}var sM=/\r\n?/g,iM=/\u0000|\uFFFD/g;function Nb(a){return(typeof a=="string"?a:""+a).replace(sM,`
|
|
38
|
-
`).replace(iM,"")}function yd(a,c,p){if(c=Nb(c),Nb(a)!==c&&p)throw Error(n(425))}function xd(){}var Nm=null,Mm=null;function Dm(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Rm=typeof setTimeout=="function"?setTimeout:void 0,aM=typeof clearTimeout=="function"?clearTimeout:void 0,Mb=typeof Promise=="function"?Promise:void 0,lM=typeof queueMicrotask=="function"?queueMicrotask:typeof Mb<"u"?function(a){return Mb.resolve(null).then(a).catch(uM)}:Rm;function uM(a){setTimeout(function(){throw a})}function Om(a,c){var p=c,g=0;do{var w=p.nextSibling;if(a.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"){if(g===0){a.removeChild(w),zl(c);return}g--}else p!=="$"&&p!=="$?"&&p!=="$!"||g++;p=w}while(p);zl(c)}function vs(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Db(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return a;c--}else p==="/$"&&c++}a=a.previousSibling}return null}var Ea=Math.random().toString(36).slice(2),eo="__reactFiber$"+Ea,Jl="__reactProps$"+Ea,Do="__reactContainer$"+Ea,Im="__reactEvents$"+Ea,cM="__reactListeners$"+Ea,dM="__reactHandles$"+Ea;function Si(a){var c=a[eo];if(c)return c;for(var p=a.parentNode;p;){if(c=p[Do]||p[eo]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(a=Db(a);a!==null;){if(p=a[eo])return p;a=Db(a)}return c}a=p,p=a.parentNode}return null}function Zl(a){return a=a[eo]||a[Do],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function _a(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function vd(a){return a[Jl]||null}var Pm=[],Ta=-1;function bs(a){return{current:a}}function kt(a){0>Ta||(a.current=Pm[Ta],Pm[Ta]=null,Ta--)}function yt(a,c){Ta++,Pm[Ta]=a.current,a.current=c}var ks={},Cn=bs(ks),Wn=bs(!1),Ei=ks;function Aa(a,c){var p=a.type.contextTypes;if(!p)return ks;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in p)w[S]=c[S];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=w),w}function qn(a){return a=a.childContextTypes,a!=null}function bd(){kt(Wn),kt(Cn)}function Rb(a,c,p){if(Cn.current!==ks)throw Error(n(168));yt(Cn,c),yt(Wn,p)}function Ob(a,c,p){var g=a.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return p;g=g.getChildContext();for(var w in g)if(!(w in c))throw Error(n(108,De(a)||"Unknown",w));return F({},p,g)}function kd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ks,Ei=Cn.current,yt(Cn,a),yt(Wn,Wn.current),!0}function Ib(a,c,p){var g=a.stateNode;if(!g)throw Error(n(169));p?(a=Ob(a,c,Ei),g.__reactInternalMemoizedMergedChildContext=a,kt(Wn),kt(Cn),yt(Cn,a)):kt(Wn),yt(Wn,p)}var Ro=null,wd=!1,jm=!1;function Pb(a){Ro===null?Ro=[a]:Ro.push(a)}function fM(a){wd=!0,Pb(a)}function ws(){if(!jm&&Ro!==null){jm=!0;var a=0,c=ct;try{var p=Ro;for(ct=1;a<p.length;a++){var g=p[a];do g=g(!0);while(g!==null)}Ro=null,wd=!1}catch(w){throw Ro!==null&&(Ro=Ro.slice(a+1)),Lv(om,ws),w}finally{ct=c,jm=!1}}return null}var Na=[],Ma=0,Cd=null,Sd=0,yr=[],xr=0,_i=null,Oo=1,Io="";function Ti(a,c){Na[Ma++]=Sd,Na[Ma++]=Cd,Cd=a,Sd=c}function jb(a,c,p){yr[xr++]=Oo,yr[xr++]=Io,yr[xr++]=_i,_i=a;var g=Oo;a=Io;var w=32-Ir(g)-1;g&=~(1<<w),p+=1;var S=32-Ir(c)+w;if(30<S){var A=w-w%5;S=(g&(1<<A)-1).toString(32),g>>=A,w-=A,Oo=1<<32-Ir(c)+w|p<<w|g,Io=S+a}else Oo=1<<S|p<<w|g,Io=a}function Lm(a){a.return!==null&&(Ti(a,1),jb(a,1,0))}function zm(a){for(;a===Cd;)Cd=Na[--Ma],Na[Ma]=null,Sd=Na[--Ma],Na[Ma]=null;for(;a===_i;)_i=yr[--xr],yr[xr]=null,Io=yr[--xr],yr[xr]=null,Oo=yr[--xr],yr[xr]=null}var or=null,sr=null,Et=!1,jr=null;function Lb(a,c){var p=wr(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=a,c=a.deletions,c===null?(a.deletions=[p],a.flags|=16):c.push(p)}function zb(a,c){switch(a.tag){case 5:var p=a.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,or=a,sr=vs(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,or=a,sr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=_i!==null?{id:Oo,overflow:Io}:null,a.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=wr(18,null,null,0),p.stateNode=c,p.return=a,a.child=p,or=a,sr=null,!0):!1;default:return!1}}function Fm(a){return(a.mode&1)!==0&&(a.flags&128)===0}function $m(a){if(Et){var c=sr;if(c){var p=c;if(!zb(a,c)){if(Fm(a))throw Error(n(418));c=vs(p.nextSibling);var g=or;c&&zb(a,c)?Lb(g,p):(a.flags=a.flags&-4097|2,Et=!1,or=a)}}else{if(Fm(a))throw Error(n(418));a.flags=a.flags&-4097|2,Et=!1,or=a}}}function Fb(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;or=a}function Ed(a){if(a!==or)return!1;if(!Et)return Fb(a),Et=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Dm(a.type,a.memoizedProps)),c&&(c=sr)){if(Fm(a))throw $b(),Error(n(418));for(;c;)Lb(a,c),c=vs(c.nextSibling)}if(Fb(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(c===0){sr=vs(a.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}a=a.nextSibling}sr=null}}else sr=or?vs(a.stateNode.nextSibling):null;return!0}function $b(){for(var a=sr;a;)a=vs(a.nextSibling)}function Da(){sr=or=null,Et=!1}function Bm(a){jr===null?jr=[a]:jr.push(a)}var hM=N.ReactCurrentBatchConfig;function Yl(a,c,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var g=p.stateNode}if(!g)throw Error(n(147,a));var w=g,S=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(A){var R=w.refs;A===null?delete R[S]:R[S]=A},c._stringRef=S,c)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function _d(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function Bb(a){var c=a._init;return c(a._payload)}function Vb(a){function c(B,$){if(a){var H=B.deletions;H===null?(B.deletions=[$],B.flags|=16):H.push($)}}function p(B,$){if(!a)return null;for(;$!==null;)c(B,$),$=$.sibling;return null}function g(B,$){for(B=new Map;$!==null;)$.key!==null?B.set($.key,$):B.set($.index,$),$=$.sibling;return B}function w(B,$){return B=Ms(B,$),B.index=0,B.sibling=null,B}function S(B,$,H){return B.index=H,a?(H=B.alternate,H!==null?(H=H.index,H<$?(B.flags|=2,$):H):(B.flags|=2,$)):(B.flags|=1048576,$)}function A(B){return a&&B.alternate===null&&(B.flags|=2),B}function R(B,$,H,fe){return $===null||$.tag!==6?($=R0(H,B.mode,fe),$.return=B,$):($=w($,H),$.return=B,$)}function z(B,$,H,fe){var _e=H.type;return _e===I?ie(B,$,H.props.children,fe,H.key):$!==null&&($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===G&&Bb(_e)===$.type)?(fe=w($,H.props),fe.ref=Yl(B,$,H),fe.return=B,fe):(fe=Zd(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Yl(B,$,H),fe.return=B,fe)}function U(B,$,H,fe){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=O0(H,B.mode,fe),$.return=B,$):($=w($,H.children||[]),$.return=B,$)}function ie(B,$,H,fe,_e){return $===null||$.tag!==7?($=Pi(H,B.mode,fe,_e),$.return=B,$):($=w($,H),$.return=B,$)}function ae(B,$,H){if(typeof $=="string"&&$!==""||typeof $=="number")return $=R0(""+$,B.mode,H),$.return=B,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case M:return H=Zd($.type,$.key,$.props,null,B.mode,H),H.ref=Yl(B,null,$),H.return=B,H;case D:return $=O0($,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,$;_d(B,$)}return null}function se(B,$,H,fe){var _e=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return _e!==null?null:R(B,$,""+H,fe);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case M:return H.key===_e?z(B,$,H,fe):null;case D:return H.key===_e?U(B,$,H,fe):null;case G:return _e=H._init,se(B,$,_e(H._payload),fe)}if(nn(H)||te(H))return _e!==null?null:ie(B,$,H,fe,null);_d(B,H)}return null}function ge(B,$,H,fe,_e){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return B=B.get(H)||null,R($,B,""+fe,_e);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case M:return B=B.get(fe.key===null?H:fe.key)||null,z($,B,fe,_e);case D:return B=B.get(fe.key===null?H:fe.key)||null,U($,B,fe,_e);case G:var Pe=fe._init;return ge(B,$,H,Pe(fe._payload),_e)}if(nn(fe)||te(fe))return B=B.get(H)||null,ie($,B,fe,_e,null);_d($,fe)}return null}function we(B,$,H,fe){for(var _e=null,Pe=null,je=$,$e=$=0,an=null;je!==null&&$e<H.length;$e++){je.index>$e?(an=je,je=null):an=je.sibling;var nt=se(B,je,H[$e],fe);if(nt===null){je===null&&(je=an);break}a&&je&&nt.alternate===null&&c(B,je),$=S(nt,$,$e),Pe===null?_e=nt:Pe.sibling=nt,Pe=nt,je=an}if($e===H.length)return p(B,je),Et&&Ti(B,$e),_e;if(je===null){for(;$e<H.length;$e++)je=ae(B,H[$e],fe),je!==null&&($=S(je,$,$e),Pe===null?_e=je:Pe.sibling=je,Pe=je);return Et&&Ti(B,$e),_e}for(je=g(B,je);$e<H.length;$e++)an=ge(je,B,$e,H[$e],fe),an!==null&&(a&&an.alternate!==null&&je.delete(an.key===null?$e:an.key),$=S(an,$,$e),Pe===null?_e=an:Pe.sibling=an,Pe=an);return a&&je.forEach(function(Ds){return c(B,Ds)}),Et&&Ti(B,$e),_e}function Se(B,$,H,fe){var _e=te(H);if(typeof _e!="function")throw Error(n(150));if(H=_e.call(H),H==null)throw Error(n(151));for(var Pe=_e=null,je=$,$e=$=0,an=null,nt=H.next();je!==null&&!nt.done;$e++,nt=H.next()){je.index>$e?(an=je,je=null):an=je.sibling;var Ds=se(B,je,nt.value,fe);if(Ds===null){je===null&&(je=an);break}a&&je&&Ds.alternate===null&&c(B,je),$=S(Ds,$,$e),Pe===null?_e=Ds:Pe.sibling=Ds,Pe=Ds,je=an}if(nt.done)return p(B,je),Et&&Ti(B,$e),_e;if(je===null){for(;!nt.done;$e++,nt=H.next())nt=ae(B,nt.value,fe),nt!==null&&($=S(nt,$,$e),Pe===null?_e=nt:Pe.sibling=nt,Pe=nt);return Et&&Ti(B,$e),_e}for(je=g(B,je);!nt.done;$e++,nt=H.next())nt=ge(je,B,$e,nt.value,fe),nt!==null&&(a&&nt.alternate!==null&&je.delete(nt.key===null?$e:nt.key),$=S(nt,$,$e),Pe===null?_e=nt:Pe.sibling=nt,Pe=nt);return a&&je.forEach(function(qM){return c(B,qM)}),Et&&Ti(B,$e),_e}function Pt(B,$,H,fe){if(typeof H=="object"&&H!==null&&H.type===I&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case M:e:{for(var _e=H.key,Pe=$;Pe!==null;){if(Pe.key===_e){if(_e=H.type,_e===I){if(Pe.tag===7){p(B,Pe.sibling),$=w(Pe,H.props.children),$.return=B,B=$;break e}}else if(Pe.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===G&&Bb(_e)===Pe.type){p(B,Pe.sibling),$=w(Pe,H.props),$.ref=Yl(B,Pe,H),$.return=B,B=$;break e}p(B,Pe);break}else c(B,Pe);Pe=Pe.sibling}H.type===I?($=Pi(H.props.children,B.mode,fe,H.key),$.return=B,B=$):(fe=Zd(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Yl(B,$,H),fe.return=B,B=fe)}return A(B);case D: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}$=O0(H,B.mode,fe),$.return=B,B=$}return A(B);case G:return Pe=H._init,Pt(B,$,Pe(H._payload),fe)}if(nn(H))return we(B,$,H,fe);if(te(H))return Se(B,$,H,fe);_d(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,$),$=R0(H,B.mode,fe),$.return=B,B=$),A(B)):p(B,$)}return Pt}var Ra=Vb(!0),Hb=Vb(!1),Td=bs(null),Ad=null,Oa=null,Vm=null;function Hm(){Vm=Oa=Ad=null}function Um(a){var c=Td.current;kt(Td),a._currentValue=c}function Wm(a,c,p){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===p)break;a=a.return}}function Ia(a,c){Ad=a,Vm=Oa=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Kn=!0),a.firstContext=null)}function vr(a){var c=a._currentValue;if(Vm!==a)if(a={context:a,memoizedValue:c,next:null},Oa===null){if(Ad===null)throw Error(n(308));Oa=a,Ad.dependencies={lanes:0,firstContext:a}}else Oa=Oa.next=a;return c}var Ai=null;function qm(a){Ai===null?Ai=[a]:Ai.push(a)}function Ub(a,c,p,g){var w=c.interleaved;return w===null?(p.next=p,qm(c)):(p.next=w.next,w.next=p),c.interleaved=p,Po(a,g)}function Po(a,c){a.lanes|=c;var p=a.alternate;for(p!==null&&(p.lanes|=c),p=a,a=a.return;a!==null;)a.childLanes|=c,p=a.alternate,p!==null&&(p.childLanes|=c),p=a,a=a.return;return p.tag===3?p.stateNode:null}var Cs=!1;function Km(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wb(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function jo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Ss(a,c,p){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Xe&2)!==0){var w=g.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),g.pending=c,Po(a,p)}return w=g.interleaved,w===null?(c.next=c,qm(g)):(c.next=w.next,w.next=c),g.interleaved=c,Po(a,p)}function Nd(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var g=c.lanes;g&=a.pendingLanes,p|=g,c.lanes=p,am(a,p)}}function qb(a,c){var p=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,p===g)){var w=null,S=null;if(p=p.firstBaseUpdate,p!==null){do{var A={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};S===null?w=S=A:S=S.next=A,p=p.next}while(p!==null);S===null?w=S=c:S=S.next=c}else w=S=c;p={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:g.shared,effects:g.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function Md(a,c,p,g){var w=a.updateQueue;Cs=!1;var S=w.firstBaseUpdate,A=w.lastBaseUpdate,R=w.shared.pending;if(R!==null){w.shared.pending=null;var z=R,U=z.next;z.next=null,A===null?S=U:A.next=U,A=z;var ie=a.alternate;ie!==null&&(ie=ie.updateQueue,R=ie.lastBaseUpdate,R!==A&&(R===null?ie.firstBaseUpdate=U:R.next=U,ie.lastBaseUpdate=z))}if(S!==null){var ae=w.baseState;A=0,ie=U=z=null,R=S;do{var se=R.lane,ge=R.eventTime;if((g&se)===se){ie!==null&&(ie=ie.next={eventTime:ge,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var we=a,Se=R;switch(se=c,ge=p,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ae=we.call(ge,ae,se);break e}ae=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,se=typeof we=="function"?we.call(ge,ae,se):we,se==null)break e;ae=F({},ae,se);break e;case 2:Cs=!0}}R.callback!==null&&R.lane!==0&&(a.flags|=64,se=w.effects,se===null?w.effects=[R]:se.push(R))}else ge={eventTime:ge,lane:se,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ie===null?(U=ie=ge,z=ae):ie=ie.next=ge,A|=se;if(R=R.next,R===null){if(R=w.shared.pending,R===null)break;se=R,R=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 A|=w.lane,w=w.next;while(w!==c)}else S===null&&(w.shared.lanes=0);Di|=A,a.lanes=A,a.memoizedState=ae}}function Kb(a,c,p){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var g=a[c],w=g.callback;if(w!==null){if(g.callback=null,g=p,typeof w!="function")throw Error(n(191,w));w.call(g)}}}var Xl={},to=bs(Xl),Ql=bs(Xl),eu=bs(Xl);function Ni(a){if(a===Xl)throw Error(n(174));return a}function Gm(a,c){switch(yt(eu,c),yt(Ql,a),yt(to,Xl),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:mr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=mr(c,a)}kt(to),yt(to,c)}function Pa(){kt(to),kt(Ql),kt(eu)}function Gb(a){Ni(eu.current);var c=Ni(to.current),p=mr(c,a.type);c!==p&&(yt(Ql,a),yt(to,p))}function Jm(a){Ql.current===a&&(kt(to),kt(Ql))}var Tt=bs(0);function Dd(a){for(var c=a;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===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Zm=[];function Ym(){for(var a=0;a<Zm.length;a++)Zm[a]._workInProgressVersionPrimary=null;Zm.length=0}var Rd=N.ReactCurrentDispatcher,Xm=N.ReactCurrentBatchConfig,Mi=0,At=null,Gt=null,on=null,Od=!1,tu=!1,nu=0,pM=0;function Sn(){throw Error(n(321))}function Qm(a,c){if(c===null)return!1;for(var p=0;p<c.length&&p<a.length;p++)if(!Pr(a[p],c[p]))return!1;return!0}function e0(a,c,p,g,w,S){if(Mi=S,At=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Rd.current=a===null||a.memoizedState===null?xM:vM,a=p(g,w),tu){S=0;do{if(tu=!1,nu=0,25<=S)throw Error(n(301));S+=1,on=Gt=null,c.updateQueue=null,Rd.current=bM,a=p(g,w)}while(tu)}if(Rd.current=jd,c=Gt!==null&&Gt.next!==null,Mi=0,on=Gt=At=null,Od=!1,c)throw Error(n(300));return a}function t0(){var a=nu!==0;return nu=0,a}function no(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?At.memoizedState=on=a:on=on.next=a,on}function br(){if(Gt===null){var a=At.alternate;a=a!==null?a.memoizedState:null}else a=Gt.next;var c=on===null?At.memoizedState:on.next;if(c!==null)on=c,Gt=a;else{if(a===null)throw Error(n(310));Gt=a,a={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},on===null?At.memoizedState=on=a:on=on.next=a}return on}function ru(a,c){return typeof c=="function"?c(a):c}function n0(a){var c=br(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var g=Gt,w=g.baseQueue,S=p.pending;if(S!==null){if(w!==null){var A=w.next;w.next=S.next,S.next=A}g.baseQueue=w=S,p.pending=null}if(w!==null){S=w.next,g=g.baseState;var R=A=null,z=null,U=S;do{var ie=U.lane;if((Mi&ie)===ie)z!==null&&(z=z.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),g=U.hasEagerState?U.eagerState:a(g,U.action);else{var ae={lane:ie,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};z===null?(R=z=ae,A=g):z=z.next=ae,At.lanes|=ie,Di|=ie}U=U.next}while(U!==null&&U!==S);z===null?A=g:z.next=R,Pr(g,c.memoizedState)||(Kn=!0),c.memoizedState=g,c.baseState=A,c.baseQueue=z,p.lastRenderedState=g}if(a=p.interleaved,a!==null){w=a;do S=w.lane,At.lanes|=S,Di|=S,w=w.next;while(w!==a)}else w===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function r0(a){var c=br(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var g=p.dispatch,w=p.pending,S=c.memoizedState;if(w!==null){p.pending=null;var A=w=w.next;do S=a(S,A.action),A=A.next;while(A!==w);Pr(S,c.memoizedState)||(Kn=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),p.lastRenderedState=S}return[S,g]}function Jb(){}function Zb(a,c){var p=At,g=br(),w=c(),S=!Pr(g.memoizedState,w);if(S&&(g.memoizedState=w,Kn=!0),g=g.queue,o0(Qb.bind(null,p,g,a),[a]),g.getSnapshot!==c||S||on!==null&&on.memoizedState.tag&1){if(p.flags|=2048,ou(9,Xb.bind(null,p,g,w,c),void 0,null),sn===null)throw Error(n(349));(Mi&30)!==0||Yb(p,c,w)}return w}function Yb(a,c,p){a.flags|=16384,a={getSnapshot:c,value:p},c=At.updateQueue,c===null?(c={lastEffect:null,stores:null},At.updateQueue=c,c.stores=[a]):(p=c.stores,p===null?c.stores=[a]:p.push(a))}function Xb(a,c,p,g){c.value=p,c.getSnapshot=g,ek(c)&&tk(a)}function Qb(a,c,p){return p(function(){ek(c)&&tk(a)})}function ek(a){var c=a.getSnapshot;a=a.value;try{var p=c();return!Pr(a,p)}catch{return!0}}function tk(a){var c=Po(a,1);c!==null&&$r(c,a,1,-1)}function nk(a){var c=no();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ru,lastRenderedState:a},c.queue=a,a=a.dispatch=yM.bind(null,At,a),[c.memoizedState,a]}function ou(a,c,p,g){return a={tag:a,create:c,destroy:p,deps:g,next:null},c=At.updateQueue,c===null?(c={lastEffect:null,stores:null},At.updateQueue=c,c.lastEffect=a.next=a):(p=c.lastEffect,p===null?c.lastEffect=a.next=a:(g=p.next,p.next=a,a.next=g,c.lastEffect=a)),a}function rk(){return br().memoizedState}function Id(a,c,p,g){var w=no();At.flags|=a,w.memoizedState=ou(1|c,p,void 0,g===void 0?null:g)}function Pd(a,c,p,g){var w=br();g=g===void 0?null:g;var S=void 0;if(Gt!==null){var A=Gt.memoizedState;if(S=A.destroy,g!==null&&Qm(g,A.deps)){w.memoizedState=ou(c,p,S,g);return}}At.flags|=a,w.memoizedState=ou(1|c,p,S,g)}function ok(a,c){return Id(8390656,8,a,c)}function o0(a,c){return Pd(2048,8,a,c)}function sk(a,c){return Pd(4,2,a,c)}function ik(a,c){return Pd(4,4,a,c)}function ak(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function lk(a,c,p){return p=p!=null?p.concat([a]):null,Pd(4,4,ak.bind(null,c,a),p)}function s0(){}function uk(a,c){var p=br();c=c===void 0?null:c;var g=p.memoizedState;return g!==null&&c!==null&&Qm(c,g[1])?g[0]:(p.memoizedState=[a,c],a)}function ck(a,c){var p=br();c=c===void 0?null:c;var g=p.memoizedState;return g!==null&&c!==null&&Qm(c,g[1])?g[0]:(a=a(),p.memoizedState=[a,c],a)}function dk(a,c,p){return(Mi&21)===0?(a.baseState&&(a.baseState=!1,Kn=!0),a.memoizedState=p):(Pr(p,c)||(p=Bv(),At.lanes|=p,Di|=p,a.baseState=!0),c)}function mM(a,c){var p=ct;ct=p!==0&&4>p?p:4,a(!0);var g=Xm.transition;Xm.transition={};try{a(!1),c()}finally{ct=p,Xm.transition=g}}function fk(){return br().memoizedState}function gM(a,c,p){var g=As(a);if(p={lane:g,action:p,hasEagerState:!1,eagerState:null,next:null},hk(a))pk(c,p);else if(p=Ub(a,c,p,g),p!==null){var w=In();$r(p,a,g,w),mk(p,c,g)}}function yM(a,c,p){var g=As(a),w={lane:g,action:p,hasEagerState:!1,eagerState:null,next:null};if(hk(a))pk(c,w);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var A=c.lastRenderedState,R=S(A,p);if(w.hasEagerState=!0,w.eagerState=R,Pr(R,A)){var z=c.interleaved;z===null?(w.next=w,qm(c)):(w.next=z.next,z.next=w),c.interleaved=w;return}}catch{}finally{}p=Ub(a,c,w,g),p!==null&&(w=In(),$r(p,a,g,w),mk(p,c,g))}}function hk(a){var c=a.alternate;return a===At||c!==null&&c===At}function pk(a,c){tu=Od=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function mk(a,c,p){if((p&4194240)!==0){var g=c.lanes;g&=a.pendingLanes,p|=g,c.lanes=p,am(a,p)}}var jd={readContext:vr,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},xM={readContext:vr,useCallback:function(a,c){return no().memoizedState=[a,c===void 0?null:c],a},useContext:vr,useEffect:ok,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,Id(4194308,4,ak.bind(null,c,a),p)},useLayoutEffect:function(a,c){return Id(4194308,4,a,c)},useInsertionEffect:function(a,c){return Id(4,2,a,c)},useMemo:function(a,c){var p=no();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var g=no();return c=p!==void 0?p(c):c,g.memoizedState=g.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},g.queue=a,a=a.dispatch=gM.bind(null,At,a),[g.memoizedState,a]},useRef:function(a){var c=no();return a={current:a},c.memoizedState=a},useState:nk,useDebugValue:s0,useDeferredValue:function(a){return no().memoizedState=a},useTransition:function(){var a=nk(!1),c=a[0];return a=mM.bind(null,a[1]),no().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var g=At,w=no();if(Et){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),sn===null)throw Error(n(349));(Mi&30)!==0||Yb(g,c,p)}w.memoizedState=p;var S={value:p,getSnapshot:c};return w.queue=S,ok(Qb.bind(null,g,S,a),[a]),g.flags|=2048,ou(9,Xb.bind(null,g,S,p,c),void 0,null),p},useId:function(){var a=no(),c=sn.identifierPrefix;if(Et){var p=Io,g=Oo;p=(g&~(1<<32-Ir(g)-1)).toString(32)+p,c=":"+c+"R"+p,p=nu++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=pM++,c=":"+c+"r"+p.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},vM={readContext:vr,useCallback:uk,useContext:vr,useEffect:o0,useImperativeHandle:lk,useInsertionEffect:sk,useLayoutEffect:ik,useMemo:ck,useReducer:n0,useRef:rk,useState:function(){return n0(ru)},useDebugValue:s0,useDeferredValue:function(a){var c=br();return dk(c,Gt.memoizedState,a)},useTransition:function(){var a=n0(ru)[0],c=br().memoizedState;return[a,c]},useMutableSource:Jb,useSyncExternalStore:Zb,useId:fk,unstable_isNewReconciler:!1},bM={readContext:vr,useCallback:uk,useContext:vr,useEffect:o0,useImperativeHandle:lk,useInsertionEffect:sk,useLayoutEffect:ik,useMemo:ck,useReducer:r0,useRef:rk,useState:function(){return r0(ru)},useDebugValue:s0,useDeferredValue:function(a){var c=br();return Gt===null?c.memoizedState=a:dk(c,Gt.memoizedState,a)},useTransition:function(){var a=r0(ru)[0],c=br().memoizedState;return[a,c]},useMutableSource:Jb,useSyncExternalStore:Zb,useId:fk,unstable_isNewReconciler:!1};function Lr(a,c){if(a&&a.defaultProps){c=F({},c),a=a.defaultProps;for(var p in a)c[p]===void 0&&(c[p]=a[p]);return c}return c}function i0(a,c,p,g){c=a.memoizedState,p=p(g,c),p=p==null?c:F({},c,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var Ld={isMounted:function(a){return(a=a._reactInternals)?Ci(a)===a:!1},enqueueSetState:function(a,c,p){a=a._reactInternals;var g=In(),w=As(a),S=jo(g,w);S.payload=c,p!=null&&(S.callback=p),c=Ss(a,S,w),c!==null&&($r(c,a,w,g),Nd(c,a,w))},enqueueReplaceState:function(a,c,p){a=a._reactInternals;var g=In(),w=As(a),S=jo(g,w);S.tag=1,S.payload=c,p!=null&&(S.callback=p),c=Ss(a,S,w),c!==null&&($r(c,a,w,g),Nd(c,a,w))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var p=In(),g=As(a),w=jo(p,g);w.tag=2,c!=null&&(w.callback=c),c=Ss(a,w,g),c!==null&&($r(c,a,g,p),Nd(c,a,g))}};function gk(a,c,p,g,w,S,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,S,A):c.prototype&&c.prototype.isPureReactComponent?!Ul(p,g)||!Ul(w,S):!0}function yk(a,c,p){var g=!1,w=ks,S=c.contextType;return typeof S=="object"&&S!==null?S=vr(S):(w=qn(c)?Ei:Cn.current,g=c.contextTypes,S=(g=g!=null)?Aa(a,w):ks),c=new c(p,S),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ld,a.stateNode=c,c._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=w,a.__reactInternalMemoizedMaskedChildContext=S),c}function xk(a,c,p,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,g),c.state!==a&&Ld.enqueueReplaceState(c,c.state,null)}function a0(a,c,p,g){var w=a.stateNode;w.props=p,w.state=a.memoizedState,w.refs={},Km(a);var S=c.contextType;typeof S=="object"&&S!==null?w.context=vr(S):(S=qn(c)?Ei:Cn.current,w.context=Aa(a,S)),w.state=a.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(i0(a,c,S,p),w.state=a.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&&Ld.enqueueReplaceState(w,w.state,null),Md(a,p,w,g),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308)}function ja(a,c){try{var p="",g=c;do p+=ce(g),g=g.return;while(g);var w=p}catch(S){w=`
|
|
39
|
-
Error generating stack: `+S.message+`
|
|
40
|
-
`+S.stack}return{value:a,source:c,stack:w,digest:null}}function l0(a,c,p){return{value:a,source:null,stack:p??null,digest:c??null}}function u0(a,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var kM=typeof WeakMap=="function"?WeakMap:Map;function vk(a,c,p){p=jo(-1,p),p.tag=3,p.payload={element:null};var g=c.value;return p.callback=function(){Ud||(Ud=!0,S0=g),u0(a,c)},p}function bk(a,c,p){p=jo(-1,p),p.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var w=c.value;p.payload=function(){return g(w)},p.callback=function(){u0(a,c)}}var S=a.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(p.callback=function(){u0(a,c),typeof g!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})}),p}function kk(a,c,p){var g=a.pingCache;if(g===null){g=a.pingCache=new kM;var w=new Set;g.set(c,w)}else w=g.get(c),w===void 0&&(w=new Set,g.set(c,w));w.has(p)||(w.add(p),a=PM.bind(null,a,c,p),c.then(a,a))}function wk(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function Ck(a,c,p,g,w){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=jo(-1,1),c.tag=2,Ss(p,c,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=w,a)}var wM=N.ReactCurrentOwner,Kn=!1;function On(a,c,p,g){c.child=a===null?Hb(c,null,p,g):Ra(c,a.child,p,g)}function Sk(a,c,p,g,w){p=p.render;var S=c.ref;return Ia(c,w),g=e0(a,c,p,g,S,w),p=t0(),a!==null&&!Kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~w,Lo(a,c,w)):(Et&&p&&Lm(c),c.flags|=1,On(a,c,g,w),c.child)}function Ek(a,c,p,g,w){if(a===null){var S=p.type;return typeof S=="function"&&!D0(S)&&S.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=S,_k(a,c,S,g,w)):(a=Zd(p.type,null,g,c,c.mode,w),a.ref=c.ref,a.return=c,c.child=a)}if(S=a.child,(a.lanes&w)===0){var A=S.memoizedProps;if(p=p.compare,p=p!==null?p:Ul,p(A,g)&&a.ref===c.ref)return Lo(a,c,w)}return c.flags|=1,a=Ms(S,g),a.ref=c.ref,a.return=c,c.child=a}function _k(a,c,p,g,w){if(a!==null){var S=a.memoizedProps;if(Ul(S,g)&&a.ref===c.ref)if(Kn=!1,c.pendingProps=g=S,(a.lanes&w)!==0)(a.flags&131072)!==0&&(Kn=!0);else return c.lanes=a.lanes,Lo(a,c,w)}return c0(a,c,p,g,w)}function Tk(a,c,p){var g=c.pendingProps,w=g.children,S=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(za,ir),ir|=p;else{if((p&1073741824)===0)return a=S!==null?S.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,yt(za,ir),ir|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=S!==null?S.baseLanes:p,yt(za,ir),ir|=g}else S!==null?(g=S.baseLanes|p,c.memoizedState=null):g=p,yt(za,ir),ir|=g;return On(a,c,w,p),c.child}function Ak(a,c){var p=c.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function c0(a,c,p,g,w){var S=qn(p)?Ei:Cn.current;return S=Aa(c,S),Ia(c,w),p=e0(a,c,p,g,S,w),g=t0(),a!==null&&!Kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~w,Lo(a,c,w)):(Et&&g&&Lm(c),c.flags|=1,On(a,c,p,w),c.child)}function Nk(a,c,p,g,w){if(qn(p)){var S=!0;kd(c)}else S=!1;if(Ia(c,w),c.stateNode===null)Fd(a,c),yk(c,p,g),a0(c,p,g,w),g=!0;else if(a===null){var A=c.stateNode,R=c.memoizedProps;A.props=R;var z=A.context,U=p.contextType;typeof U=="object"&&U!==null?U=vr(U):(U=qn(p)?Ei:Cn.current,U=Aa(c,U));var ie=p.getDerivedStateFromProps,ae=typeof ie=="function"||typeof A.getSnapshotBeforeUpdate=="function";ae||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(R!==g||z!==U)&&xk(c,A,g,U),Cs=!1;var se=c.memoizedState;A.state=se,Md(c,g,A,w),z=c.memoizedState,R!==g||se!==z||Wn.current||Cs?(typeof ie=="function"&&(i0(c,p,ie,g),z=c.memoizedState),(R=Cs||gk(c,p,R,g,se,z,U))?(ae||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(c.flags|=4194308)):(typeof A.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=z),A.props=g,A.state=z,A.context=U,g=R):(typeof A.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{A=c.stateNode,Wb(a,c),R=c.memoizedProps,U=c.type===c.elementType?R:Lr(c.type,R),A.props=U,ae=c.pendingProps,se=A.context,z=p.contextType,typeof z=="object"&&z!==null?z=vr(z):(z=qn(p)?Ei:Cn.current,z=Aa(c,z));var ge=p.getDerivedStateFromProps;(ie=typeof ge=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(R!==ae||se!==z)&&xk(c,A,g,z),Cs=!1,se=c.memoizedState,A.state=se,Md(c,g,A,w);var we=c.memoizedState;R!==ae||se!==we||Wn.current||Cs?(typeof ge=="function"&&(i0(c,p,ge,g),we=c.memoizedState),(U=Cs||gk(c,p,U,g,se,we,z)||!1)?(ie||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,we,z),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,we,z)),typeof A.componentDidUpdate=="function"&&(c.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof A.componentDidUpdate!="function"||R===a.memoizedProps&&se===a.memoizedState||(c.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&se===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=we),A.props=g,A.state=we,A.context=z,g=U):(typeof A.componentDidUpdate!="function"||R===a.memoizedProps&&se===a.memoizedState||(c.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&se===a.memoizedState||(c.flags|=1024),g=!1)}return d0(a,c,p,g,S,w)}function d0(a,c,p,g,w,S){Ak(a,c);var A=(c.flags&128)!==0;if(!g&&!A)return w&&Ib(c,p,!1),Lo(a,c,S);g=c.stateNode,wM.current=c;var R=A&&typeof p.getDerivedStateFromError!="function"?null:g.render();return c.flags|=1,a!==null&&A?(c.child=Ra(c,a.child,null,S),c.child=Ra(c,null,R,S)):On(a,c,R,S),c.memoizedState=g.state,w&&Ib(c,p,!0),c.child}function Mk(a){var c=a.stateNode;c.pendingContext?Rb(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Rb(a,c.context,!1),Gm(a,c.containerInfo)}function Dk(a,c,p,g,w){return Da(),Bm(w),c.flags|=256,On(a,c,p,g),c.child}var f0={dehydrated:null,treeContext:null,retryLane:0};function h0(a){return{baseLanes:a,cachePool:null,transitions:null}}function Rk(a,c,p){var g=c.pendingProps,w=Tt.current,S=!1,A=(c.flags&128)!==0,R;if((R=A)||(R=a!==null&&a.memoizedState===null?!1:(w&2)!==0),R?(S=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(w|=1),yt(Tt,w&1),a===null)return $m(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(A=g.children,a=g.fallback,S?(g=c.mode,S=c.child,A={mode:"hidden",children:A},(g&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=A):S=Yd(A,g,0,null),a=Pi(a,g,p,null),S.return=c,a.return=c,S.sibling=a,c.child=S,c.child.memoizedState=h0(p),c.memoizedState=f0,a):p0(c,A));if(w=a.memoizedState,w!==null&&(R=w.dehydrated,R!==null))return CM(a,c,A,g,R,w,p);if(S){S=g.fallback,A=c.mode,w=a.child,R=w.sibling;var z={mode:"hidden",children:g.children};return(A&1)===0&&c.child!==w?(g=c.child,g.childLanes=0,g.pendingProps=z,c.deletions=null):(g=Ms(w,z),g.subtreeFlags=w.subtreeFlags&14680064),R!==null?S=Ms(R,S):(S=Pi(S,A,p,null),S.flags|=2),S.return=c,g.return=c,g.sibling=S,c.child=g,g=S,S=c.child,A=a.child.memoizedState,A=A===null?h0(p):{baseLanes:A.baseLanes|p,cachePool:null,transitions:A.transitions},S.memoizedState=A,S.childLanes=a.childLanes&~p,c.memoizedState=f0,g}return S=a.child,a=S.sibling,g=Ms(S,{mode:"visible",children:g.children}),(c.mode&1)===0&&(g.lanes=p),g.return=c,g.sibling=null,a!==null&&(p=c.deletions,p===null?(c.deletions=[a],c.flags|=16):p.push(a)),c.child=g,c.memoizedState=null,g}function p0(a,c){return c=Yd({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function zd(a,c,p,g){return g!==null&&Bm(g),Ra(c,a.child,null,p),a=p0(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function CM(a,c,p,g,w,S,A){if(p)return c.flags&256?(c.flags&=-257,g=l0(Error(n(422))),zd(a,c,A,g)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(S=g.fallback,w=c.mode,g=Yd({mode:"visible",children:g.children},w,0,null),S=Pi(S,w,A,null),S.flags|=2,g.return=c,S.return=c,g.sibling=S,c.child=g,(c.mode&1)!==0&&Ra(c,a.child,null,A),c.child.memoizedState=h0(A),c.memoizedState=f0,S);if((c.mode&1)===0)return zd(a,c,A,null);if(w.data==="$!"){if(g=w.nextSibling&&w.nextSibling.dataset,g)var R=g.dgst;return g=R,S=Error(n(419)),g=l0(S,g,void 0),zd(a,c,A,g)}if(R=(A&a.childLanes)!==0,Kn||R){if(g=sn,g!==null){switch(A&-A){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&(g.suspendedLanes|A))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,Po(a,w),$r(g,a,w,-1))}return M0(),g=l0(Error(n(421))),zd(a,c,A,g)}return w.data==="$?"?(c.flags|=128,c.child=a.child,c=jM.bind(null,a),w._reactRetry=c,null):(a=S.treeContext,sr=vs(w.nextSibling),or=c,Et=!0,jr=null,a!==null&&(yr[xr++]=Oo,yr[xr++]=Io,yr[xr++]=_i,Oo=a.id,Io=a.overflow,_i=c),c=p0(c,g.children),c.flags|=4096,c)}function Ok(a,c,p){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),Wm(a.return,c,p)}function m0(a,c,p,g,w){var S=a.memoizedState;S===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:p,tailMode:w}:(S.isBackwards=c,S.rendering=null,S.renderingStartTime=0,S.last=g,S.tail=p,S.tailMode=w)}function Ik(a,c,p){var g=c.pendingProps,w=g.revealOrder,S=g.tail;if(On(a,c,g.children,p),g=Tt.current,(g&2)!==0)g=g&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Ok(a,p,c);else if(a.tag===19)Ok(a,p,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(yt(Tt,g),(c.mode&1)===0)c.memoizedState=null;else switch(w){case"forwards":for(p=c.child,w=null;p!==null;)a=p.alternate,a!==null&&Dd(a)===null&&(w=p),p=p.sibling;p=w,p===null?(w=c.child,c.child=null):(w=p.sibling,p.sibling=null),m0(c,!1,w,p,S);break;case"backwards":for(p=null,w=c.child,c.child=null;w!==null;){if(a=w.alternate,a!==null&&Dd(a)===null){c.child=w;break}a=w.sibling,w.sibling=p,p=w,w=a}m0(c,!0,p,null,S);break;case"together":m0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Fd(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function Lo(a,c,p){if(a!==null&&(c.dependencies=a.dependencies),Di|=c.lanes,(p&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,p=Ms(a,a.pendingProps),c.child=p,p.return=c;a.sibling!==null;)a=a.sibling,p=p.sibling=Ms(a,a.pendingProps),p.return=c;p.sibling=null}return c.child}function SM(a,c,p){switch(c.tag){case 3:Mk(c),Da();break;case 5:Gb(c);break;case 1:qn(c.type)&&kd(c);break;case 4:Gm(c,c.stateNode.containerInfo);break;case 10:var g=c.type._context,w=c.memoizedProps.value;yt(Td,g._currentValue),g._currentValue=w;break;case 13:if(g=c.memoizedState,g!==null)return g.dehydrated!==null?(yt(Tt,Tt.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?Rk(a,c,p):(yt(Tt,Tt.current&1),a=Lo(a,c,p),a!==null?a.sibling:null);yt(Tt,Tt.current&1);break;case 19:if(g=(p&c.childLanes)!==0,(a.flags&128)!==0){if(g)return Ik(a,c,p);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),yt(Tt,Tt.current),g)break;return null;case 22:case 23:return c.lanes=0,Tk(a,c,p)}return Lo(a,c,p)}var Pk,g0,jk,Lk;Pk=function(a,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)a.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}},g0=function(){},jk=function(a,c,p,g){var w=a.memoizedProps;if(w!==g){a=c.stateNode,Ni(to.current);var S=null;switch(p){case"input":w=Ye(a,w),g=Ye(a,g),S=[];break;case"select":w=F({},w,{value:void 0}),g=F({},g,{value:void 0}),S=[];break;case"textarea":w=pt(a,w),g=pt(a,g),S=[];break;default:typeof w.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=xd)}No(p,g);var A;p=null;for(U in w)if(!g.hasOwnProperty(U)&&w.hasOwnProperty(U)&&w[U]!=null)if(U==="style"){var R=w[U];for(A in R)R.hasOwnProperty(A)&&(p||(p={}),p[A]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(o.hasOwnProperty(U)?S||(S=[]):(S=S||[]).push(U,null));for(U in g){var z=g[U];if(R=w!=null?w[U]:void 0,g.hasOwnProperty(U)&&z!==R&&(z!=null||R!=null))if(U==="style")if(R){for(A in R)!R.hasOwnProperty(A)||z&&z.hasOwnProperty(A)||(p||(p={}),p[A]="");for(A in z)z.hasOwnProperty(A)&&R[A]!==z[A]&&(p||(p={}),p[A]=z[A])}else p||(S||(S=[]),S.push(U,p)),p=z;else U==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,R=R?R.__html:void 0,z!=null&&R!==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",a),S||R===z||(S=[])):(S=S||[]).push(U,z))}p&&(S=S||[]).push("style",p);var U=S;(c.updateQueue=U)&&(c.flags|=4)}},Lk=function(a,c,p,g){p!==g&&(c.flags|=4)};function su(a,c){if(!Et)switch(a.tailMode){case"hidden":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var g=null;p!==null;)p.alternate!==null&&(g=p),p=p.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function En(a){var c=a.alternate!==null&&a.alternate.child===a.child,p=0,g=0;if(c)for(var w=a.child;w!==null;)p|=w.lanes|w.childLanes,g|=w.subtreeFlags&14680064,g|=w.flags&14680064,w.return=a,w=w.sibling;else for(w=a.child;w!==null;)p|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=a,w=w.sibling;return a.subtreeFlags|=g,a.childLanes=p,c}function EM(a,c,p){var g=c.pendingProps;switch(zm(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 qn(c.type)&&bd(),En(c),null;case 3:return g=c.stateNode,Pa(),kt(Wn),kt(Cn),Ym(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(Ed(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,jr!==null&&(T0(jr),jr=null))),g0(a,c),En(c),null;case 5:Jm(c);var w=Ni(eu.current);if(p=c.type,a!==null&&c.stateNode!=null)jk(a,c,p,g,w),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!g){if(c.stateNode===null)throw Error(n(166));return En(c),null}if(a=Ni(to.current),Ed(c)){g=c.stateNode,p=c.type;var S=c.memoizedProps;switch(g[eo]=c,g[Jl]=S,a=(c.mode&1)!==0,p){case"dialog":bt("cancel",g),bt("close",g);break;case"iframe":case"object":case"embed":bt("load",g);break;case"video":case"audio":for(w=0;w<ql.length;w++)bt(ql[w],g);break;case"source":bt("error",g);break;case"img":case"image":case"link":bt("error",g),bt("load",g);break;case"details":bt("toggle",g);break;case"input":Nt(g,S),bt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!S.multiple},bt("invalid",g);break;case"textarea":pr(g,S),bt("invalid",g)}No(p,S),w=null;for(var A in S)if(S.hasOwnProperty(A)){var R=S[A];A==="children"?typeof R=="string"?g.textContent!==R&&(S.suppressHydrationWarning!==!0&&yd(g.textContent,R,a),w=["children",R]):typeof R=="number"&&g.textContent!==""+R&&(S.suppressHydrationWarning!==!0&&yd(g.textContent,R,a),w=["children",""+R]):o.hasOwnProperty(A)&&R!=null&&A==="onScroll"&&bt("scroll",g)}switch(p){case"input":Fe(g),$n(g,S,!0);break;case"textarea":Fe(g),ga(g);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(g.onclick=xd)}g=w,c.updateQueue=g,g!==null&&(c.flags|=4)}else{A=w.nodeType===9?w:w.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Ao(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=A.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=A.createElement(p,{is:g.is}):(a=A.createElement(p),p==="select"&&(A=a,g.multiple?A.multiple=!0:g.size&&(A.size=g.size))):a=A.createElementNS(a,p),a[eo]=c,a[Jl]=g,Pk(a,c,!1,!1),c.stateNode=a;e:{switch(A=ki(p,g),p){case"dialog":bt("cancel",a),bt("close",a),w=g;break;case"iframe":case"object":case"embed":bt("load",a),w=g;break;case"video":case"audio":for(w=0;w<ql.length;w++)bt(ql[w],a);w=g;break;case"source":bt("error",a),w=g;break;case"img":case"image":case"link":bt("error",a),bt("load",a),w=g;break;case"details":bt("toggle",a),w=g;break;case"input":Nt(a,g),w=Ye(a,g),bt("invalid",a);break;case"option":w=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},w=F({},g,{value:void 0}),bt("invalid",a);break;case"textarea":pr(a,g),w=pt(a,g),bt("invalid",a);break;default:w=g}No(p,w),R=w;for(S in R)if(R.hasOwnProperty(S)){var z=R[S];S==="style"?xa(a,z):S==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&gr(a,z)):S==="children"?typeof z=="string"?(p!=="textarea"||z!=="")&&Rn(a,z):typeof z=="number"&&Rn(a,""+z):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(o.hasOwnProperty(S)?z!=null&&S==="onScroll"&&bt("scroll",a):z!=null&&T(a,S,z,A))}switch(p){case"input":Fe(a),$n(a,g,!1);break;case"textarea":Fe(a),ga(a);break;case"option":g.value!=null&&a.setAttribute("value",""+Q(g.value));break;case"select":a.multiple=!!g.multiple,S=g.value,S!=null?Dn(a,!!g.multiple,S,!1):g.defaultValue!=null&&Dn(a,!!g.multiple,g.defaultValue,!0);break;default:typeof w.onClick=="function"&&(a.onclick=xd)}switch(p){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return En(c),null;case 6:if(a&&c.stateNode!=null)Lk(a,c,a.memoizedProps,g);else{if(typeof g!="string"&&c.stateNode===null)throw Error(n(166));if(p=Ni(eu.current),Ni(to.current),Ed(c)){if(g=c.stateNode,p=c.memoizedProps,g[eo]=c,(S=g.nodeValue!==p)&&(a=or,a!==null))switch(a.tag){case 3:yd(g.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&yd(g.nodeValue,p,(a.mode&1)!==0)}S&&(c.flags|=4)}else g=(p.nodeType===9?p:p.ownerDocument).createTextNode(g),g[eo]=c,c.stateNode=g}return En(c),null;case 13:if(kt(Tt),g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Et&&sr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)$b(),Da(),c.flags|=98560,S=!1;else if(S=Ed(c),g!==null&&g.dehydrated!==null){if(a===null){if(!S)throw Error(n(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[eo]=c}else Da(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),S=!1}else jr!==null&&(T0(jr),jr=null),S=!0;if(!S)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(Tt.current&1)!==0?Jt===0&&(Jt=3):M0())),c.updateQueue!==null&&(c.flags|=4),En(c),null);case 4:return Pa(),g0(a,c),a===null&&Kl(c.stateNode.containerInfo),En(c),null;case 10:return Um(c.type._context),En(c),null;case 17:return qn(c.type)&&bd(),En(c),null;case 19:if(kt(Tt),S=c.memoizedState,S===null)return En(c),null;if(g=(c.flags&128)!==0,A=S.rendering,A===null)if(g)su(S,!1);else{if(Jt!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(A=Dd(a),A!==null){for(c.flags|=128,su(S,!1),g=A.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),c.subtreeFlags=0,g=p,p=c.child;p!==null;)S=p,a=g,S.flags&=14680066,A=S.alternate,A===null?(S.childLanes=0,S.lanes=a,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=A.childLanes,S.lanes=A.lanes,S.child=A.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=A.memoizedProps,S.memoizedState=A.memoizedState,S.updateQueue=A.updateQueue,S.type=A.type,a=A.dependencies,S.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return yt(Tt,Tt.current&1|2),c.child}a=a.sibling}S.tail!==null&&It()>Fa&&(c.flags|=128,g=!0,su(S,!1),c.lanes=4194304)}else{if(!g)if(a=Dd(A),a!==null){if(c.flags|=128,g=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),su(S,!0),S.tail===null&&S.tailMode==="hidden"&&!A.alternate&&!Et)return En(c),null}else 2*It()-S.renderingStartTime>Fa&&p!==1073741824&&(c.flags|=128,g=!0,su(S,!1),c.lanes=4194304);S.isBackwards?(A.sibling=c.child,c.child=A):(p=S.last,p!==null?p.sibling=A:c.child=A,S.last=A)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=It(),c.sibling=null,p=Tt.current,yt(Tt,g?p&1|2:p&1),c):(En(c),null);case 22:case 23:return N0(),g=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(c.flags|=8192),g&&(c.mode&1)!==0?(ir&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 _M(a,c){switch(zm(c),c.tag){case 1:return qn(c.type)&&bd(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Pa(),kt(Wn),kt(Cn),Ym(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Jm(c),null;case 13:if(kt(Tt),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Da()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return kt(Tt),null;case 4:return Pa(),null;case 10:return Um(c.type._context),null;case 22:case 23:return N0(),null;case 24:return null;default:return null}}var $d=!1,_n=!1,TM=typeof WeakSet=="function"?WeakSet:Set,be=null;function La(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(g){Mt(a,c,g)}else p.current=null}function y0(a,c,p){try{p()}catch(g){Mt(a,c,g)}}var zk=!1;function AM(a,c){if(Nm=id,a=gb(),km(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var g=p.getSelection&&p.getSelection();if(g&&g.rangeCount!==0){p=g.anchorNode;var w=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{p.nodeType,S.nodeType}catch{p=null;break e}var A=0,R=-1,z=-1,U=0,ie=0,ae=a,se=null;t:for(;;){for(var ge;ae!==p||w!==0&&ae.nodeType!==3||(R=A+w),ae!==S||g!==0&&ae.nodeType!==3||(z=A+g),ae.nodeType===3&&(A+=ae.nodeValue.length),(ge=ae.firstChild)!==null;)se=ae,ae=ge;for(;;){if(ae===a)break t;if(se===p&&++U===w&&(R=A),se===S&&++ie===g&&(z=A),(ge=ae.nextSibling)!==null)break;ae=se,se=ae.parentNode}ae=ge}p=R===-1||z===-1?null:{start:R,end:z}}else p=null}p=p||{start:0,end:0}}else p=null;for(Mm={focusedElem:a,selectionRange:p},id=!1,be=c;be!==null;)if(c=be,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,be=a;else for(;be!==null;){c=be;try{var we=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,Pt=we.memoizedState,B=c.stateNode,$=B.getSnapshotBeforeUpdate(c.elementType===c.type?Se:Lr(c.type,Se),Pt);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){Mt(c,c.return,fe)}if(a=c.sibling,a!==null){a.return=c.return,be=a;break}be=c.return}return we=zk,zk=!1,we}function iu(a,c,p){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var w=g=g.next;do{if((w.tag&a)===a){var S=w.destroy;w.destroy=void 0,S!==void 0&&y0(c,p,S)}w=w.next}while(w!==g)}}function Bd(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&a)===a){var g=p.create;p.destroy=g()}p=p.next}while(p!==c)}}function x0(a){var c=a.ref;if(c!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof c=="function"?c(a):c.current=a}}function Fk(a){var c=a.alternate;c!==null&&(a.alternate=null,Fk(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[eo],delete c[Jl],delete c[Im],delete c[cM],delete c[dM])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function $k(a){return a.tag===5||a.tag===3||a.tag===4}function Bk(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||$k(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function v0(a,c,p){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(a,c):p.insertBefore(a,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(a,p)):(c=p,c.appendChild(a)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=xd));else if(g!==4&&(a=a.child,a!==null))for(v0(a,c,p),a=a.sibling;a!==null;)v0(a,c,p),a=a.sibling}function b0(a,c,p){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(b0(a,c,p),a=a.sibling;a!==null;)b0(a,c,p),a=a.sibling}var yn=null,zr=!1;function Es(a,c,p){for(p=p.child;p!==null;)Vk(a,c,p),p=p.sibling}function Vk(a,c,p){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(ed,p)}catch{}switch(p.tag){case 5:_n||La(p,c);case 6:var g=yn,w=zr;yn=null,Es(a,c,p),yn=g,zr=w,yn!==null&&(zr?(a=yn,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):yn.removeChild(p.stateNode));break;case 18:yn!==null&&(zr?(a=yn,p=p.stateNode,a.nodeType===8?Om(a.parentNode,p):a.nodeType===1&&Om(a,p),zl(a)):Om(yn,p.stateNode));break;case 4:g=yn,w=zr,yn=p.stateNode.containerInfo,zr=!0,Es(a,c,p),yn=g,zr=w;break;case 0:case 11:case 14:case 15:if(!_n&&(g=p.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){w=g=g.next;do{var S=w,A=S.destroy;S=S.tag,A!==void 0&&((S&2)!==0||(S&4)!==0)&&y0(p,c,A),w=w.next}while(w!==g)}Es(a,c,p);break;case 1:if(!_n&&(La(p,c),g=p.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=p.memoizedProps,g.state=p.memoizedState,g.componentWillUnmount()}catch(R){Mt(p,c,R)}Es(a,c,p);break;case 21:Es(a,c,p);break;case 22:p.mode&1?(_n=(g=_n)||p.memoizedState!==null,Es(a,c,p),_n=g):Es(a,c,p);break;default:Es(a,c,p)}}function Hk(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new TM),c.forEach(function(g){var w=LM.bind(null,a,g);p.has(g)||(p.add(g),g.then(w,w))})}}function Fr(a,c){var p=c.deletions;if(p!==null)for(var g=0;g<p.length;g++){var w=p[g];try{var S=a,A=c,R=A;e:for(;R!==null;){switch(R.tag){case 5:yn=R.stateNode,zr=!1;break e;case 3:yn=R.stateNode.containerInfo,zr=!0;break e;case 4:yn=R.stateNode.containerInfo,zr=!0;break e}R=R.return}if(yn===null)throw Error(n(160));Vk(S,A,w),yn=null,zr=!1;var z=w.alternate;z!==null&&(z.return=null),w.return=null}catch(U){Mt(w,c,U)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Uk(c,a),c=c.sibling}function Uk(a,c){var p=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Fr(c,a),ro(a),g&4){try{iu(3,a,a.return),Bd(3,a)}catch(Se){Mt(a,a.return,Se)}try{iu(5,a,a.return)}catch(Se){Mt(a,a.return,Se)}}break;case 1:Fr(c,a),ro(a),g&512&&p!==null&&La(p,p.return);break;case 5:if(Fr(c,a),ro(a),g&512&&p!==null&&La(p,p.return),a.flags&32){var w=a.stateNode;try{Rn(w,"")}catch(Se){Mt(a,a.return,Se)}}if(g&4&&(w=a.stateNode,w!=null)){var S=a.memoizedProps,A=p!==null?p.memoizedProps:S,R=a.type,z=a.updateQueue;if(a.updateQueue=null,z!==null)try{R==="input"&&S.type==="radio"&&S.name!=null&&jt(w,S),ki(R,A);var U=ki(R,S);for(A=0;A<z.length;A+=2){var ie=z[A],ae=z[A+1];ie==="style"?xa(w,ae):ie==="dangerouslySetInnerHTML"?gr(w,ae):ie==="children"?Rn(w,ae):T(w,ie,ae,U)}switch(R){case"input":Ut(w,S);break;case"textarea":bi(w,S);break;case"select":var se=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var ge=S.value;ge!=null?Dn(w,!!S.multiple,ge,!1):se!==!!S.multiple&&(S.defaultValue!=null?Dn(w,!!S.multiple,S.defaultValue,!0):Dn(w,!!S.multiple,S.multiple?[]:"",!1))}w[Jl]=S}catch(Se){Mt(a,a.return,Se)}}break;case 6:if(Fr(c,a),ro(a),g&4){if(a.stateNode===null)throw Error(n(162));w=a.stateNode,S=a.memoizedProps;try{w.nodeValue=S}catch(Se){Mt(a,a.return,Se)}}break;case 3:if(Fr(c,a),ro(a),g&4&&p!==null&&p.memoizedState.isDehydrated)try{zl(c.containerInfo)}catch(Se){Mt(a,a.return,Se)}break;case 4:Fr(c,a),ro(a);break;case 13:Fr(c,a),ro(a),w=a.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(C0=It())),g&4&&Hk(a);break;case 22:if(ie=p!==null&&p.memoizedState!==null,a.mode&1?(_n=(U=_n)||ie,Fr(c,a),_n=U):Fr(c,a),ro(a),g&8192){if(U=a.memoizedState!==null,(a.stateNode.isHidden=U)&&!ie&&(a.mode&1)!==0)for(be=a,ie=a.child;ie!==null;){for(ae=be=ie;be!==null;){switch(se=be,ge=se.child,se.tag){case 0:case 11:case 14:case 15:iu(4,se,se.return);break;case 1:La(se,se.return);var we=se.stateNode;if(typeof we.componentWillUnmount=="function"){g=se,p=se.return;try{c=g,we.props=c.memoizedProps,we.state=c.memoizedState,we.componentWillUnmount()}catch(Se){Mt(g,p,Se)}}break;case 5:La(se,se.return);break;case 22:if(se.memoizedState!==null){Kk(ae);continue}}ge!==null?(ge.return=se,be=ge):Kk(ae)}ie=ie.sibling}e:for(ie=null,ae=a;;){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"):(R=ae.stateNode,z=ae.memoizedProps.style,A=z!=null&&z.hasOwnProperty("display")?z.display:null,R.style.display=ya("display",A))}catch(Se){Mt(a,a.return,Se)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=U?"":ae.memoizedProps}catch(Se){Mt(a,a.return,Se)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===a)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===a)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===a)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Fr(c,a),ro(a),g&4&&Hk(a);break;case 21:break;default:Fr(c,a),ro(a)}}function ro(a){var c=a.flags;if(c&2){try{e:{for(var p=a.return;p!==null;){if($k(p)){var g=p;break e}p=p.return}throw Error(n(160))}switch(g.tag){case 5:var w=g.stateNode;g.flags&32&&(Rn(w,""),g.flags&=-33);var S=Bk(a);b0(a,S,w);break;case 3:case 4:var A=g.stateNode.containerInfo,R=Bk(a);v0(a,R,A);break;default:throw Error(n(161))}}catch(z){Mt(a,a.return,z)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function NM(a,c,p){be=a,Wk(a)}function Wk(a,c,p){for(var g=(a.mode&1)!==0;be!==null;){var w=be,S=w.child;if(w.tag===22&&g){var A=w.memoizedState!==null||$d;if(!A){var R=w.alternate,z=R!==null&&R.memoizedState!==null||_n;R=$d;var U=_n;if($d=A,(_n=z)&&!U)for(be=w;be!==null;)A=be,z=A.child,A.tag===22&&A.memoizedState!==null?Gk(w):z!==null?(z.return=A,be=z):Gk(w);for(;S!==null;)be=S,Wk(S),S=S.sibling;be=w,$d=R,_n=U}qk(a)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,be=S):qk(a)}}function qk(a){for(;be!==null;){var c=be;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||Bd(5,c);break;case 1:var g=c.stateNode;if(c.flags&4&&!_n)if(p===null)g.componentDidMount();else{var w=c.elementType===c.type?p.memoizedProps:Lr(c.type,p.memoizedProps);g.componentDidUpdate(w,p.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var S=c.updateQueue;S!==null&&Kb(c,S,g);break;case 3:var A=c.updateQueue;if(A!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}Kb(c,A,p)}break;case 5:var R=c.stateNode;if(p===null&&c.flags&4){p=R;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&&zl(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||c.flags&512&&x0(c)}catch(se){Mt(c,c.return,se)}}if(c===a){be=null;break}if(p=c.sibling,p!==null){p.return=c.return,be=p;break}be=c.return}}function Kk(a){for(;be!==null;){var c=be;if(c===a){be=null;break}var p=c.sibling;if(p!==null){p.return=c.return,be=p;break}be=c.return}}function Gk(a){for(;be!==null;){var c=be;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{Bd(4,c)}catch(z){Mt(c,p,z)}break;case 1:var g=c.stateNode;if(typeof g.componentDidMount=="function"){var w=c.return;try{g.componentDidMount()}catch(z){Mt(c,w,z)}}var S=c.return;try{x0(c)}catch(z){Mt(c,S,z)}break;case 5:var A=c.return;try{x0(c)}catch(z){Mt(c,A,z)}}}catch(z){Mt(c,c.return,z)}if(c===a){be=null;break}var R=c.sibling;if(R!==null){R.return=c.return,be=R;break}be=c.return}}var MM=Math.ceil,Vd=N.ReactCurrentDispatcher,k0=N.ReactCurrentOwner,kr=N.ReactCurrentBatchConfig,Xe=0,sn=null,Lt=null,xn=0,ir=0,za=bs(0),Jt=0,au=null,Di=0,Hd=0,w0=0,lu=null,Gn=null,C0=0,Fa=1/0,zo=null,Ud=!1,S0=null,_s=null,Wd=!1,Ts=null,qd=0,uu=0,E0=null,Kd=-1,Gd=0;function In(){return(Xe&6)!==0?It():Kd!==-1?Kd:Kd=It()}function As(a){return(a.mode&1)===0?1:(Xe&2)!==0&&xn!==0?xn&-xn:hM.transition!==null?(Gd===0&&(Gd=Bv()),Gd):(a=ct,a!==0||(a=window.event,a=a===void 0?16:Zv(a.type)),a)}function $r(a,c,p,g){if(50<uu)throw uu=0,E0=null,Error(n(185));Ol(a,p,g),((Xe&2)===0||a!==sn)&&(a===sn&&((Xe&2)===0&&(Hd|=p),Jt===4&&Ns(a,xn)),Jn(a,g),p===1&&Xe===0&&(c.mode&1)===0&&(Fa=It()+500,wd&&ws()))}function Jn(a,c){var p=a.callbackNode;hN(a,c);var g=rd(a,a===sn?xn:0);if(g===0)p!==null&&zv(p),a.callbackNode=null,a.callbackPriority=0;else if(c=g&-g,a.callbackPriority!==c){if(p!=null&&zv(p),c===1)a.tag===0?fM(Zk.bind(null,a)):Pb(Zk.bind(null,a)),lM(function(){(Xe&6)===0&&ws()}),p=null;else{switch(Vv(g)){case 1:p=om;break;case 4:p=Fv;break;case 16:p=Qc;break;case 536870912:p=$v;break;default:p=Qc}p=o2(p,Jk.bind(null,a))}a.callbackPriority=c,a.callbackNode=p}}function Jk(a,c){if(Kd=-1,Gd=0,(Xe&6)!==0)throw Error(n(327));var p=a.callbackNode;if($a()&&a.callbackNode!==p)return null;var g=rd(a,a===sn?xn:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||c)c=Jd(a,g);else{c=g;var w=Xe;Xe|=2;var S=Xk();(sn!==a||xn!==c)&&(zo=null,Fa=It()+500,Oi(a,c));do try{OM();break}catch(R){Yk(a,R)}while(!0);Hm(),Vd.current=S,Xe=w,Lt!==null?c=0:(sn=null,xn=0,c=Jt)}if(c!==0){if(c===2&&(w=sm(a),w!==0&&(g=w,c=_0(a,w))),c===1)throw p=au,Oi(a,0),Ns(a,g),Jn(a,It()),p;if(c===6)Ns(a,g);else{if(w=a.current.alternate,(g&30)===0&&!DM(w)&&(c=Jd(a,g),c===2&&(S=sm(a),S!==0&&(g=S,c=_0(a,S))),c===1))throw p=au,Oi(a,0),Ns(a,g),Jn(a,It()),p;switch(a.finishedWork=w,a.finishedLanes=g,c){case 0:case 1:throw Error(n(345));case 2:Ii(a,Gn,zo);break;case 3:if(Ns(a,g),(g&130023424)===g&&(c=C0+500-It(),10<c)){if(rd(a,0)!==0)break;if(w=a.suspendedLanes,(w&g)!==g){In(),a.pingedLanes|=a.suspendedLanes&w;break}a.timeoutHandle=Rm(Ii.bind(null,a,Gn,zo),c);break}Ii(a,Gn,zo);break;case 4:if(Ns(a,g),(g&4194240)===g)break;for(c=a.eventTimes,w=-1;0<g;){var A=31-Ir(g);S=1<<A,A=c[A],A>w&&(w=A),g&=~S}if(g=w,g=It()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*MM(g/1960))-g,10<g){a.timeoutHandle=Rm(Ii.bind(null,a,Gn,zo),g);break}Ii(a,Gn,zo);break;case 5:Ii(a,Gn,zo);break;default:throw Error(n(329))}}}return Jn(a,It()),a.callbackNode===p?Jk.bind(null,a):null}function _0(a,c){var p=lu;return a.current.memoizedState.isDehydrated&&(Oi(a,c).flags|=256),a=Jd(a,c),a!==2&&(c=Gn,Gn=p,c!==null&&T0(c)),a}function T0(a){Gn===null?Gn=a:Gn.push.apply(Gn,a)}function DM(a){for(var c=a;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var g=0;g<p.length;g++){var w=p[g],S=w.getSnapshot;w=w.value;try{if(!Pr(S(),w))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ns(a,c){for(c&=~w0,c&=~Hd,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var p=31-Ir(c),g=1<<p;a[p]=-1,c&=~g}}function Zk(a){if((Xe&6)!==0)throw Error(n(327));$a();var c=rd(a,0);if((c&1)===0)return Jn(a,It()),null;var p=Jd(a,c);if(a.tag!==0&&p===2){var g=sm(a);g!==0&&(c=g,p=_0(a,g))}if(p===1)throw p=au,Oi(a,0),Ns(a,c),Jn(a,It()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ii(a,Gn,zo),Jn(a,It()),null}function A0(a,c){var p=Xe;Xe|=1;try{return a(c)}finally{Xe=p,Xe===0&&(Fa=It()+500,wd&&ws())}}function Ri(a){Ts!==null&&Ts.tag===0&&(Xe&6)===0&&$a();var c=Xe;Xe|=1;var p=kr.transition,g=ct;try{if(kr.transition=null,ct=1,a)return a()}finally{ct=g,kr.transition=p,Xe=c,(Xe&6)===0&&ws()}}function N0(){ir=za.current,kt(za)}function Oi(a,c){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,aM(p)),Lt!==null)for(p=Lt.return;p!==null;){var g=p;switch(zm(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&bd();break;case 3:Pa(),kt(Wn),kt(Cn),Ym();break;case 5:Jm(g);break;case 4:Pa();break;case 13:kt(Tt);break;case 19:kt(Tt);break;case 10:Um(g.type._context);break;case 22:case 23:N0()}p=p.return}if(sn=a,Lt=a=Ms(a.current,null),xn=ir=c,Jt=0,au=null,w0=Hd=Di=0,Gn=lu=null,Ai!==null){for(c=0;c<Ai.length;c++)if(p=Ai[c],g=p.interleaved,g!==null){p.interleaved=null;var w=g.next,S=p.pending;if(S!==null){var A=S.next;S.next=w,g.next=A}p.pending=g}Ai=null}return a}function Yk(a,c){do{var p=Lt;try{if(Hm(),Rd.current=jd,Od){for(var g=At.memoizedState;g!==null;){var w=g.queue;w!==null&&(w.pending=null),g=g.next}Od=!1}if(Mi=0,on=Gt=At=null,tu=!1,nu=0,k0.current=null,p===null||p.return===null){Jt=1,au=c,Lt=null;break}e:{var S=a,A=p.return,R=p,z=c;if(c=xn,R.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var U=z,ie=R,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 ge=wk(A);if(ge!==null){ge.flags&=-257,Ck(ge,A,R,S,c),ge.mode&1&&kk(S,U,c),c=ge,z=U;var we=c.updateQueue;if(we===null){var Se=new Set;Se.add(z),c.updateQueue=Se}else we.add(z);break e}else{if((c&1)===0){kk(S,U,c),M0();break e}z=Error(n(426))}}else if(Et&&R.mode&1){var Pt=wk(A);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),Ck(Pt,A,R,S,c),Bm(ja(z,R));break e}}S=z=ja(z,R),Jt!==4&&(Jt=2),lu===null?lu=[S]:lu.push(S),S=A;do{switch(S.tag){case 3:S.flags|=65536,c&=-c,S.lanes|=c;var B=vk(S,z,c);qb(S,B);break e;case 1:R=z;var $=S.type,H=S.stateNode;if((S.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(_s===null||!_s.has(H)))){S.flags|=65536,c&=-c,S.lanes|=c;var fe=bk(S,R,c);qb(S,fe);break e}}S=S.return}while(S!==null)}e2(p)}catch(_e){c=_e,Lt===p&&p!==null&&(Lt=p=p.return);continue}break}while(!0)}function Xk(){var a=Vd.current;return Vd.current=jd,a===null?jd:a}function M0(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),sn===null||(Di&268435455)===0&&(Hd&268435455)===0||Ns(sn,xn)}function Jd(a,c){var p=Xe;Xe|=2;var g=Xk();(sn!==a||xn!==c)&&(zo=null,Oi(a,c));do try{RM();break}catch(w){Yk(a,w)}while(!0);if(Hm(),Xe=p,Vd.current=g,Lt!==null)throw Error(n(261));return sn=null,xn=0,Jt}function RM(){for(;Lt!==null;)Qk(Lt)}function OM(){for(;Lt!==null&&!oN();)Qk(Lt)}function Qk(a){var c=r2(a.alternate,a,ir);a.memoizedProps=a.pendingProps,c===null?e2(a):Lt=c,k0.current=null}function e2(a){var c=a;do{var p=c.alternate;if(a=c.return,(c.flags&32768)===0){if(p=EM(p,c,ir),p!==null){Lt=p;return}}else{if(p=_M(p,c),p!==null){p.flags&=32767,Lt=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Jt=6,Lt=null;return}}if(c=c.sibling,c!==null){Lt=c;return}Lt=c=a}while(c!==null);Jt===0&&(Jt=5)}function Ii(a,c,p){var g=ct,w=kr.transition;try{kr.transition=null,ct=1,IM(a,c,p,g)}finally{kr.transition=w,ct=g}return null}function IM(a,c,p,g){do $a();while(Ts!==null);if((Xe&6)!==0)throw Error(n(327));p=a.finishedWork;var w=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var S=p.lanes|p.childLanes;if(pN(a,S),a===sn&&(Lt=sn=null,xn=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||Wd||(Wd=!0,o2(Qc,function(){return $a(),null})),S=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||S){S=kr.transition,kr.transition=null;var A=ct;ct=1;var R=Xe;Xe|=4,k0.current=null,AM(a,p),Uk(p,a),eM(Mm),id=!!Nm,Mm=Nm=null,a.current=p,NM(p),sN(),Xe=R,ct=A,kr.transition=S}else a.current=p;if(Wd&&(Wd=!1,Ts=a,qd=w),S=a.pendingLanes,S===0&&(_s=null),lN(p.stateNode),Jn(a,It()),c!==null)for(g=a.onRecoverableError,p=0;p<c.length;p++)w=c[p],g(w.value,{componentStack:w.stack,digest:w.digest});if(Ud)throw Ud=!1,a=S0,S0=null,a;return(qd&1)!==0&&a.tag!==0&&$a(),S=a.pendingLanes,(S&1)!==0?a===E0?uu++:(uu=0,E0=a):uu=0,ws(),null}function $a(){if(Ts!==null){var a=Vv(qd),c=kr.transition,p=ct;try{if(kr.transition=null,ct=16>a?16:a,Ts===null)var g=!1;else{if(a=Ts,Ts=null,qd=0,(Xe&6)!==0)throw Error(n(331));var w=Xe;for(Xe|=4,be=a.current;be!==null;){var S=be,A=S.child;if((be.flags&16)!==0){var R=S.deletions;if(R!==null){for(var z=0;z<R.length;z++){var U=R[z];for(be=U;be!==null;){var ie=be;switch(ie.tag){case 0:case 11:case 15:iu(8,ie,S)}var ae=ie.child;if(ae!==null)ae.return=ie,be=ae;else for(;be!==null;){ie=be;var se=ie.sibling,ge=ie.return;if(Fk(ie),ie===U){be=null;break}if(se!==null){se.return=ge,be=se;break}be=ge}}}var we=S.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var Pt=Se.sibling;Se.sibling=null,Se=Pt}while(Se!==null)}}be=S}}if((S.subtreeFlags&2064)!==0&&A!==null)A.return=S,be=A;else e:for(;be!==null;){if(S=be,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:iu(9,S,S.return)}var B=S.sibling;if(B!==null){B.return=S.return,be=B;break e}be=S.return}}var $=a.current;for(be=$;be!==null;){A=be;var H=A.child;if((A.subtreeFlags&2064)!==0&&H!==null)H.return=A,be=H;else e:for(A=$;be!==null;){if(R=be,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Bd(9,R)}}catch(_e){Mt(R,R.return,_e)}if(R===A){be=null;break e}var fe=R.sibling;if(fe!==null){fe.return=R.return,be=fe;break e}be=R.return}}if(Xe=w,ws(),Qr&&typeof Qr.onPostCommitFiberRoot=="function")try{Qr.onPostCommitFiberRoot(ed,a)}catch{}g=!0}return g}finally{ct=p,kr.transition=c}}return!1}function t2(a,c,p){c=ja(p,c),c=vk(a,c,1),a=Ss(a,c,1),c=In(),a!==null&&(Ol(a,1,c),Jn(a,c))}function Mt(a,c,p){if(a.tag===3)t2(a,a,p);else for(;c!==null;){if(c.tag===3){t2(c,a,p);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(_s===null||!_s.has(g))){a=ja(p,a),a=bk(c,a,1),c=Ss(c,a,1),a=In(),c!==null&&(Ol(c,1,a),Jn(c,a));break}}c=c.return}}function PM(a,c,p){var g=a.pingCache;g!==null&&g.delete(c),c=In(),a.pingedLanes|=a.suspendedLanes&p,sn===a&&(xn&p)===p&&(Jt===4||Jt===3&&(xn&130023424)===xn&&500>It()-C0?Oi(a,0):w0|=p),Jn(a,c)}function n2(a,c){c===0&&((a.mode&1)===0?c=1:(c=nd,nd<<=1,(nd&130023424)===0&&(nd=4194304)));var p=In();a=Po(a,c),a!==null&&(Ol(a,c,p),Jn(a,p))}function jM(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),n2(a,p)}function LM(a,c){var p=0;switch(a.tag){case 13:var g=a.stateNode,w=a.memoizedState;w!==null&&(p=w.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),n2(a,p)}var r2;r2=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||Wn.current)Kn=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return Kn=!1,SM(a,c,p);Kn=(a.flags&131072)!==0}else Kn=!1,Et&&(c.flags&1048576)!==0&&jb(c,Sd,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Fd(a,c),a=c.pendingProps;var w=Aa(c,Cn.current);Ia(c,p),w=e0(null,c,g,a,w,p);var S=t0();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,qn(g)?(S=!0,kd(c)):S=!1,c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Km(c),w.updater=Ld,c.stateNode=w,w._reactInternals=c,a0(c,g,a,p),c=d0(null,c,g,!0,S,p)):(c.tag=0,Et&&S&&Lm(c),On(null,c,w,p),c=c.child),c;case 16:g=c.elementType;e:{switch(Fd(a,c),a=c.pendingProps,w=g._init,g=w(g._payload),c.type=g,w=c.tag=FM(g),a=Lr(g,a),w){case 0:c=c0(null,c,g,a,p);break e;case 1:c=Nk(null,c,g,a,p);break e;case 11:c=Sk(null,c,g,a,p);break e;case 14:c=Ek(null,c,g,Lr(g.type,a),p);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:Lr(g,w),c0(a,c,g,w,p);case 1:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:Lr(g,w),Nk(a,c,g,w,p);case 3:e:{if(Mk(c),a===null)throw Error(n(387));g=c.pendingProps,S=c.memoizedState,w=S.element,Wb(a,c),Md(c,g,null,p);var A=c.memoizedState;if(g=A.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){w=ja(Error(n(423)),c),c=Dk(a,c,g,p,w);break e}else if(g!==w){w=ja(Error(n(424)),c),c=Dk(a,c,g,p,w);break e}else for(sr=vs(c.stateNode.containerInfo.firstChild),or=c,Et=!0,jr=null,p=Hb(c,null,g,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Da(),g===w){c=Lo(a,c,p);break e}On(a,c,g,p)}c=c.child}return c;case 5:return Gb(c),a===null&&$m(c),g=c.type,w=c.pendingProps,S=a!==null?a.memoizedProps:null,A=w.children,Dm(g,w)?A=null:S!==null&&Dm(g,S)&&(c.flags|=32),Ak(a,c),On(a,c,A,p),c.child;case 6:return a===null&&$m(c),null;case 13:return Rk(a,c,p);case 4:return Gm(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=Ra(c,null,g,p):On(a,c,g,p),c.child;case 11:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:Lr(g,w),Sk(a,c,g,w,p);case 7:return On(a,c,c.pendingProps,p),c.child;case 8:return On(a,c,c.pendingProps.children,p),c.child;case 12:return On(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(g=c.type._context,w=c.pendingProps,S=c.memoizedProps,A=w.value,yt(Td,g._currentValue),g._currentValue=A,S!==null)if(Pr(S.value,A)){if(S.children===w.children&&!Wn.current){c=Lo(a,c,p);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var R=S.dependencies;if(R!==null){A=S.child;for(var z=R.firstContext;z!==null;){if(z.context===g){if(S.tag===1){z=jo(-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),Wm(S.return,p,c),R.lanes|=p;break}z=z.next}}else if(S.tag===10)A=S.type===c.type?null:S.child;else if(S.tag===18){if(A=S.return,A===null)throw Error(n(341));A.lanes|=p,R=A.alternate,R!==null&&(R.lanes|=p),Wm(A,p,c),A=S.sibling}else A=S.child;if(A!==null)A.return=S;else for(A=S;A!==null;){if(A===c){A=null;break}if(S=A.sibling,S!==null){S.return=A.return,A=S;break}A=A.return}S=A}On(a,c,w.children,p),c=c.child}return c;case 9:return w=c.type,g=c.pendingProps.children,Ia(c,p),w=vr(w),g=g(w),c.flags|=1,On(a,c,g,p),c.child;case 14:return g=c.type,w=Lr(g,c.pendingProps),w=Lr(g.type,w),Ek(a,c,g,w,p);case 15:return _k(a,c,c.type,c.pendingProps,p);case 17:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:Lr(g,w),Fd(a,c),c.tag=1,qn(g)?(a=!0,kd(c)):a=!1,Ia(c,p),yk(c,g,w),a0(c,g,w,p),d0(null,c,g,!0,a,p);case 19:return Ik(a,c,p);case 22:return Tk(a,c,p)}throw Error(n(156,c.tag))};function o2(a,c){return Lv(a,c)}function zM(a,c,p,g){this.tag=a,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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(a,c,p,g){return new zM(a,c,p,g)}function D0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function FM(a){if(typeof a=="function")return D0(a)?1:0;if(a!=null){if(a=a.$$typeof,a===J)return 11;if(a===ee)return 14}return 2}function Ms(a,c){var p=a.alternate;return p===null?(p=wr(a.tag,c,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=c,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,c=a.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function Zd(a,c,p,g,w,S){var A=2;if(g=a,typeof a=="function")D0(a)&&(A=1);else if(typeof a=="string")A=5;else e:switch(a){case I:return Pi(p.children,w,S,c);case P:A=8,w|=8;break;case O:return a=wr(12,p,c,w|2),a.elementType=O,a.lanes=S,a;case K:return a=wr(13,p,c,w),a.elementType=K,a.lanes=S,a;case Y:return a=wr(19,p,c,w),a.elementType=Y,a.lanes=S,a;case X:return Yd(p,w,S,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case W:A=10;break e;case Z:A=9;break e;case J:A=11;break e;case ee:A=14;break e;case G:A=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=wr(A,p,c,w),c.elementType=a,c.type=g,c.lanes=S,c}function Pi(a,c,p,g){return a=wr(7,a,g,c),a.lanes=p,a}function Yd(a,c,p,g){return a=wr(22,a,g,c),a.elementType=X,a.lanes=p,a.stateNode={isHidden:!1},a}function R0(a,c,p){return a=wr(6,a,null,c),a.lanes=p,a}function O0(a,c,p){return c=wr(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function $M(a,c,p,g,w){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=im(0),this.expirationTimes=im(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=im(0),this.identifierPrefix=g,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function I0(a,c,p,g,w,S,A,R,z){return a=new $M(a,c,p,R,z),c===1?(c=1,S===!0&&(c|=8)):c=0,S=wr(3,null,null,c),a.current=S,S.stateNode=a,S.memoizedState={element:g,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Km(S),a}function BM(a,c,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:g==null?null:""+g,children:a,containerInfo:c,implementation:p}}function s2(a){if(!a)return ks;a=a._reactInternals;e:{if(Ci(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(qn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(qn(p))return Ob(a,p,c)}return c}function i2(a,c,p,g,w,S,A,R,z){return a=I0(p,g,!0,a,w,S,A,R,z),a.context=s2(null),p=a.current,g=In(),w=As(p),S=jo(g,w),S.callback=c??null,Ss(p,S,w),a.current.lanes=w,Ol(a,w,g),Jn(a,g),a}function Xd(a,c,p,g){var w=c.current,S=In(),A=As(w);return p=s2(p),c.context===null?c.context=p:c.pendingContext=p,c=jo(S,A),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=Ss(w,c,A),a!==null&&($r(a,w,A,S),Nd(a,w,A)),A}function Qd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function a2(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<c?p:c}}function P0(a,c){a2(a,c),(a=a.alternate)&&a2(a,c)}function VM(){return null}var l2=typeof reportError=="function"?reportError:function(a){console.error(a)};function j0(a){this._internalRoot=a}ef.prototype.render=j0.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Xd(a,c,null,null)},ef.prototype.unmount=j0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Ri(function(){Xd(null,a,null,null)}),c[Do]=null}};function ef(a){this._internalRoot=a}ef.prototype.unstable_scheduleHydration=function(a){if(a){var c=Wv();a={blockedOn:null,target:a,priority:c};for(var p=0;p<gs.length&&c!==0&&c<gs[p].priority;p++);gs.splice(p,0,a),p===0&&Gv(a)}};function L0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function tf(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function u2(){}function HM(a,c,p,g,w){if(w){if(typeof g=="function"){var S=g;g=function(){var U=Qd(A);S.call(U)}}var A=i2(c,g,a,0,null,!1,!1,"",u2);return a._reactRootContainer=A,a[Do]=A.current,Kl(a.nodeType===8?a.parentNode:a),Ri(),A}for(;w=a.lastChild;)a.removeChild(w);if(typeof g=="function"){var R=g;g=function(){var U=Qd(z);R.call(U)}}var z=I0(a,0,!1,null,null,!1,!1,"",u2);return a._reactRootContainer=z,a[Do]=z.current,Kl(a.nodeType===8?a.parentNode:a),Ri(function(){Xd(c,z,p,g)}),z}function nf(a,c,p,g,w){var S=p._reactRootContainer;if(S){var A=S;if(typeof w=="function"){var R=w;w=function(){var z=Qd(A);R.call(z)}}Xd(c,A,a,w)}else A=HM(p,c,a,w,g);return Qd(A)}Hv=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var p=Rl(c.pendingLanes);p!==0&&(am(c,p|1),Jn(c,It()),(Xe&6)===0&&(Fa=It()+500,ws()))}break;case 13:Ri(function(){var g=Po(a,1);if(g!==null){var w=In();$r(g,a,1,w)}}),P0(a,1)}},lm=function(a){if(a.tag===13){var c=Po(a,134217728);if(c!==null){var p=In();$r(c,a,134217728,p)}P0(a,134217728)}},Uv=function(a){if(a.tag===13){var c=As(a),p=Po(a,c);if(p!==null){var g=In();$r(p,a,c,g)}P0(a,c)}},Wv=function(){return ct},qv=function(a,c){var p=ct;try{return ct=a,c()}finally{ct=p}},wi=function(a,c,p){switch(c){case"input":if(Ut(a,p),c=p.name,p.type==="radio"&&c!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var g=p[c];if(g!==a&&g.form===a.form){var w=vd(g);if(!w)throw Error(n(90));Re(g),Ut(g,w)}}}break;case"textarea":bi(a,p);break;case"select":c=p.value,c!=null&&Dn(a,!!p.multiple,c,!1)}},tt=A0,at=Ri;var UM={usingClientEntryPoint:!1,Events:[Zl,_a,vd,Ne,it,A0]},cu={findFiberByHostInstance:Si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WM={bundleType:cu.bundleType,version:cu.version,rendererPackageName:cu.rendererPackageName,rendererConfig:cu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Pv(a),a===null?null:a.stateNode},findFiberByHostInstance:cu.findFiberByHostInstance||VM,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 rf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rf.isDisabled&&rf.supportsFiber)try{ed=rf.inject(WM),Qr=rf}catch{}}return Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UM,Zn.createPortal=function(a,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!L0(c))throw Error(n(200));return BM(a,c,null,p)},Zn.createRoot=function(a,c){if(!L0(a))throw Error(n(299));var p=!1,g="",w=l2;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),c=I0(a,1,!1,null,null,p,!1,g,w),a[Do]=c.current,Kl(a.nodeType===8?a.parentNode:a),new j0(c)},Zn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Pv(c),a=a===null?null:a.stateNode,a},Zn.flushSync=function(a){return Ri(a)},Zn.hydrate=function(a,c,p){if(!tf(c))throw Error(n(200));return nf(null,a,c,!0,p)},Zn.hydrateRoot=function(a,c,p){if(!L0(a))throw Error(n(405));var g=p!=null&&p.hydratedSources||null,w=!1,S="",A=l2;if(p!=null&&(p.unstable_strictMode===!0&&(w=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onRecoverableError!==void 0&&(A=p.onRecoverableError)),c=i2(c,null,a,1,p??null,w,!1,S,A),a[Do]=c.current,Kl(a),g)for(a=0;a<g.length;a++)p=g[a],w=p._getVersion,w=w(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,w]:c.mutableSourceEagerHydrationData.push(p,w);return new ef(c)},Zn.render=function(a,c,p){if(!tf(c))throw Error(n(200));return nf(null,a,c,!1,p)},Zn.unmountComponentAtNode=function(a){if(!tf(a))throw Error(n(40));return a._reactRootContainer?(Ri(function(){nf(null,null,a,!1,function(){a._reactRootContainer=null,a[Do]=null})}),!0):!1},Zn.unstable_batchedUpdates=A0,Zn.unstable_renderSubtreeIntoContainer=function(a,c,p,g){if(!tf(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return nf(a,c,p,!1,g)},Zn.version="18.3.1-next-f1338f8080-20240426",Zn}var b2;function KS(){if(b2)return B0.exports;b2=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(),B0.exports=QM(),B0.exports}var k2;function e5(){if(k2)return of;k2=1;var t=KS();return of.createRoot=t.createRoot,of.hydrateRoot=t.hydrateRoot,of}var t5=e5();function GS(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=GS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function JS(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=GS(t))&&(r&&(r+=" "),r+=e);return r}const w2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,C2=JS,ZS=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return C2(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 f=n==null?void 0:n[d],h=s==null?void 0:s[d];if(f===null)return null;const m=w2(f)||w2(h);return o[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...y}=f;return Object.entries(y).every(v=>{let[b,k]=v;return Array.isArray(k)?k.includes({...s,...l}[b]):{...s,...l}[b]===k})?[...d,h,m]:d},[]);return C2(t,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};var Hr=KS();const YS=Ty(Hr);var n5=Object.defineProperty,Ay=(t,e)=>n5(t,"name",{value:e,configurable:!0});function s1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ay(s1,"setRef");function XS(...t){return e=>{let n=!1;const r=t.map(o=>{const s=s1(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():s1(t[o],null)}}}}Ay(XS,"composeRefs");function ot(...t){return C.useCallback(XS(...t),t)}Ay(ot,"useComposedRefs");var r5=Object.defineProperty,Gr=(t,e)=>r5(t,"name",{value:e,configurable:!0});function vo(t){const e=C.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,l=!1;const u=[];i1(o)&&typeof sf=="function"&&(o=sf(o._payload)),C.Children.forEach(o,m=>{var y;if(o3(m)){l=!0;const v=m;let b="child"in v.props?v.props.child:v.props.children;i1(b)&&typeof sf=="function"&&(b=sf(b._payload)),i=o5(v,b),u.push((y=i==null?void 0:i.props)==null?void 0:y.children)}else u.push(m)}),i?i=C.cloneElement(i,void 0,u):!l&&C.Children.count(o)===1&&C.isValidElement(o)&&(i=o);const d=i?r3(i):void 0,f=ot(r,d);if(!i){if(o||o===0)throw new Error(l?a5(t):i5(t));return o}const h=n3(s,i.props??{});return i.type!==C.Fragment&&(h.ref=r?f:d),C.cloneElement(i,h)});return e.displayName=`${t}.Slot`,e}Gr(vo,"createSlot");var QS=vo("Slot"),e3=Symbol.for("radix.slottable");function t3(t){const e=Gr(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=e3,e}Gr(t3,"createSlottable");var o5=Gr((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 n3(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]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}Gr(n3,"mergeProps");function r3(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)}Gr(r3,"getElementRef");function o3(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===e3}Gr(o3,"isSlottable");var s5=Symbol.for("react.lazy");function i1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===s5&&"_payload"in t&&s3(t._payload)}Gr(i1,"isLazyComponent");function s3(t){return typeof t=="object"&&t!==null&&"then"in t}Gr(s3,"isPromiseLike");var i5=Gr(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),a5=Gr(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),sf=bl[" use ".trim().toString()],l5=Object.defineProperty,u5=(t,e)=>l5(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=vo(`Primitive.${e}`),r=C.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Ny(t,e){t&&Hr.flushSync(()=>t.dispatchEvent(e))}u5(Ny,"dispatchDiscreteCustomEvent");var d5=Object.defineProperty,f5=(t,e)=>d5(t,"name",{value:e,configurable:!0}),i3=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"}),h5=C.forwardRef(f5(function(e,n){return x.jsx(st.span,{...e,ref:n,style:{...i3,...e.style}})},"VisuallyHidden")),p5=h5,m5=Object.defineProperty,Tr=(t,e)=>m5(t,"name",{value:e,configurable:!0});function g5(t,e){const n=C.createContext(e);n.displayName=t+"Context";const r=Tr(s=>{const{children:i,...l}=s,u=C.useMemo(()=>l,Object.values(l));return x.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:l=!1}=i,u=C.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${s}\` must be used within \`${t}\``)}return Tr(o,"useContext"),[r,o]}Tr(g5,"createContext");function Co(t,e=[]){let n=[];function r(s,i){const l=C.createContext(i);l.displayName=s+"Context";const u=n.length;n=[...n,i];const d=Tr(h=>{var E;const{scope:m,children:y,...v}=h,b=((E=m==null?void 0:m[t])==null?void 0:E[u])||l,k=C.useMemo(()=>v,Object.values(v));return x.jsx(b.Provider,{value:k,children:y})},"Provider");d.displayName=s+"Provider";function f(h,m,y={}){var E;const{optional:v=!1}=y,b=((E=m==null?void 0:m[t])==null?void 0:E[u])||l,k=C.useContext(b);if(k)return k;if(i!==void 0)return i;if(!v)throw new Error(`\`${h}\` must be used within \`${s}\``)}return Tr(f,"useContext"),[d,f]}Tr(r,"createContext");const o=Tr(()=>{const s=n.map(i=>C.createContext(i));return Tr(function(l){const u=(l==null?void 0:l[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return o.scopeName=t,[r,a3(o,...e)]}Tr(Co,"createContextScope");function a3(...t){const e=t[0];if(t.length===1)return e;const n=Tr(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return Tr(function(s){const i=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(s)[`__scope${d}`];return{...l,...h}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Tr(a3,"composeContextScopes");var y5=Object.defineProperty,dn=(t,e)=>y5(t,"name",{value:e,configurable:!0});function ip(t){const e=t+"CollectionProvider",[n,r]=Co(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 x.jsx(o,{scope:k,itemMap:T,collectionRef:_,children:E})},"CollectionProvider");i.displayName=e;const l=t+"CollectionSlot",u=vo(l),d=C.forwardRef((b,k)=>{const{scope:E,children:_}=b,T=s(l,E),N=ot(k,T.collectionRef);return x.jsx(u,{ref:N,children:_})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",m=vo(f),y=C.forwardRef((b,k)=>{const{scope:E,children:_,...T}=b,N=C.useRef(null),M=ot(k,N),D=s(f,E);return C.useEffect(()=>(D.itemMap.set(N,{ref:N,...T}),()=>void D.itemMap.delete(N))),x.jsx(m,{[h]:"",ref:M,children:_})});y.displayName=f;function v(b){const k=s(t+"CollectionConsumer",b);return C.useCallback(()=>{const _=k.collectionRef.current;if(!_)return[];const T=Array.from(_.querySelectorAll(`[${h}]`));return Array.from(k.itemMap.values()).sort((D,I)=>T.indexOf(D.ref.current)-T.indexOf(I.ref.current))},[k.collectionRef,k.itemMap])}return dn(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:y},v,r]}dn(ip,"createCollection");var S2=new WeakMap,zt,ar,U0=(ar=class extends Map{constructor(n){super(n);f2(this,zt);z0(this,zt,[...super.keys()]),S2.set(this,!0)}set(n,r){return S2.get(this)&&(this.has(n)?Tn(this,zt)[Tn(this,zt).indexOf(n)]=n:Tn(this,zt).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Tn(this,zt).length,l=My(n);let u=l>=0?l:i+l;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 f=this.size+(s?0:1);l<0&&u++;const h=[...Tn(this,zt)];let m,y=!1;for(let v=u;v<f;v++)if(u===v){let b=h[v];h[v]===r&&(b=h[v+1]),s&&this.delete(r),m=this.get(b),this.set(r,o)}else{!y&&h[v-1]===r&&(y=!0);const b=h[y?v:v-1],k=m;m=this.get(b),this.delete(b),this.set(b,k)}return this}with(n,r,o){const s=new ar(this);return s.insert(n,r,o),s}before(n){const r=Tn(this,zt).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Tn(this,zt).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Tn(this,zt).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,zt).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return z0(this,zt,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Tn(this,zt).splice(Tn(this,zt).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=zf(Tn(this,zt),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=zf(Tn(this,zt),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Tn(this,zt).indexOf(n)}keyAt(n){return zf(Tn(this,zt),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 ar(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 ar(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const l of this)s===0&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,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 l=this.at(i);i===this.size-1&&n.length===1?s=l:s=Reflect.apply(r,this,[s,l,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new ar(r)}toReversed(){const n=new ar;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 ar(r)}slice(n,r){const o=new ar;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 l=this.keyAt(i),u=this.get(l);o.set(l,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}},zt=new WeakMap,dn(ar,"OrderedDict"),ar);function zf(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=l3(t,e);return n===-1?void 0:t[n]}dn(zf,"at");function l3(t,e){const n=t.length,r=My(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}dn(l3,"toSafeIndex");function My(t){return t!==t||t===0?0:Math.trunc(t)}dn(My,"toSafeInteger");function x5(t){const e=t+"CollectionProvider",[n,r]=Co(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new U0,setItemMap:dn(()=>{},"setItemMap")}),i=dn(({state:T,...N})=>T?x.jsx(u,{...N,state:T}):x.jsx(l,{...N}),"CollectionProvider");i.displayName=e;const l=dn(T=>{const N=k();return x.jsx(u,{...T,state:N})},"CollectionInit");l.displayName=e+"Init";const u=dn(T=>{const{scope:N,children:M,state:D}=T,I=C.useRef(null),[P,O]=C.useState(null),W=ot(I,O),[Z,J]=D;return C.useEffect(()=>{if(!P)return;const K=d3(()=>{});return K.observe(P,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[P]),x.jsx(o,{scope:N,itemMap:Z,setItemMap:J,collectionRef:W,collectionRefObject:I,collectionElement:P,children:M})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=vo(d),h=C.forwardRef((T,N)=>{const{scope:M,children:D}=T,I=s(d,M),P=ot(N,I.collectionRef);return x.jsx(f,{ref:P,children:D})});h.displayName=d;const m=t+"CollectionItemSlot",y="data-radix-collection-item",v=vo(m),b=C.forwardRef((T,N)=>{const{scope:M,children:D,...I}=T,P=C.useRef(null),[O,W]=C.useState(null),Z=ot(N,P,W),J=s(m,M),{setItemMap:K}=J,Y=C.useRef(I);u3(Y.current,I)||(Y.current=I);const ee=Y.current;return C.useEffect(()=>{const G=ee;return K(X=>O?X.has(O)?X.set(O,{...G,element:O}).toSorted(a1):(X.set(O,{...G,element:O}),X.toSorted(a1)):X),()=>{K(X=>!O||!X.has(O)?X:(X.delete(O),new U0(X)))}},[O,ee,K]),x.jsx(v,{[y]:"",ref:Z,children:D})});b.displayName=m;function k(){return C.useState(new U0)}dn(k,"useInitCollection");function E(T){const{itemMap:N}=s(t+"CollectionConsumer",T);return N}return dn(E,"useCollection"),[{Provider:i,Slot:h,ItemSlot:b},{createCollectionScope:r,useCollection:E,useInitCollection:k}]}dn(x5,"createCollection");function u3(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(u3,"shallowEqual");function c3(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}dn(c3,"isElementPreceding");function a1(t,e){return!t[1].element||!e[1].element?0:c3(t[1].element,e[1].element)?-1:1}dn(a1,"sortByDocumentPosition");function d3(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}dn(d3,"getChildListObserver");var v5=Object.defineProperty,kl=(t,e)=>v5(t,"name",{value:e,configurable:!0}),f3=!!(typeof window<"u"&&window.document&&window.document.createElement);function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return kl(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}kl(Oe,"composeEventHandlers");function b5(t){var e;if(!f3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}kl(b5,"getOwnerWindow");function l1(t){if(!f3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}kl(l1,"getOwnerDocument");function h3(t,e=!1){const{activeElement:n}=l1(t);if(!(n!=null&&n.nodeName))return null;if(p3(n)&&n.contentDocument)return h3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=l1(n).getElementById(r);if(o)return o}}return n}kl(h3,"getActiveElement");function p3(t){return t.tagName==="IFRAME"}kl(p3,"isFrame");var Ot=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},k5=Object.defineProperty,w5=(t,e)=>k5(t,"name",{value:e,configurable:!0}),E2=bl[" useEffectEvent ".trim().toString()],_2=bl[" useInsertionEffect ".trim().toString()];function m3(t){if(typeof E2=="function")return E2(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof _2=="function"?_2(()=>{e.current=t}):Ot(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}w5(m3,"useEffectEvent");var C5=Object.defineProperty,Tc=(t,e)=>C5(t,"name",{value:e,configurable:!0}),S5=bl[" useInsertionEffect ".trim().toString()]||Ot;function Yi({prop:t,defaultProp:e,onChange:n=Tc(()=>{},"onChange"),caller:r}){const[o,s,i]=g3({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:o,d=C.useCallback(f=>{var h;if(l){const m=y3(f)?f(t):f;m!==t&&((h=i.current)==null||h.call(i,m))}else s(f)},[l,t,s,i]);return[u,d]}Tc(Yi,"useControllableState");function g3({defaultProp:t,onChange:e}){const[n,r]=C.useState(t),o=C.useRef(n),s=C.useRef(e);return S5(()=>{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]}Tc(g3,"useUncontrolledState");function y3(t){return typeof t=="function"}Tc(y3,"isFunction");var T2=Symbol("RADIX:SYNC_STATE");function E5(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:l}=e,u=o!==void 0,d=m3(i),f=[{...n,state:s}];r&&f.push(r);const[h,m]=C.useReducer((k,E)=>{if(E.type===T2)return{...k,state:E.state};const _=t(k,E);return u&&!Object.is(_.state,k.state)&&d(_.state),_},...f),y=h.state,v=C.useRef(y);C.useEffect(()=>{v.current!==y&&(v.current=y,u||d(y))},[y,v,u]);const b=C.useMemo(()=>o!==void 0?{...h,state:o}:h,[h,o]);return C.useEffect(()=>{u&&!Object.is(o,h.state)&&m({type:T2,state:o})},[o,h.state,u]),[b,m]}Tc(E5,"useControllableStateReducer");var _5=Object.defineProperty,ns=(t,e)=>_5(t,"name",{value:e,configurable:!0});function x3(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}ns(x3,"useStateMachine");var as=ns(t=>{const{present:e,children:n}=t,r=v3(e),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=b3(r.ref,k3(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null},"Presence");function v3(t){const[e,n]=C.useState(),r=C.useRef(null),o=C.useRef(t),s=C.useRef("none"),i=C.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=x3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{u==="mounted"?(s.current=i.current??qa(r.current),i.current=void 0):s.current="none"},[u]),Ot(()=>{const f=r.current,h=o.current;if(h!==t){const y=s.current,v=qa(f);t?(i.current=v,d("MOUNT")):v==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&y!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),Ot(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=ns(v=>{const k=qa(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",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),y=ns(v=>{v.target===e&&(s.current=qa(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,i.current=qa(h)}else r.current=null;n(f)},[])}}ns(v3,"usePresence");function u1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ns(u1,"setRef");function b3(...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 l=u1(i,n);return!o&&typeof l=="function"&&(o=!0),l});if(o)return()=>{for(let i=0;i<s.length;i++){const l=s[i];typeof l=="function"?l():u1(r[i],null)}}},[])}ns(b3,"useStableComposedRefs");function qa(t){return(t==null?void 0:t.animationName)||"none"}ns(qa,"getAnimationName");function k3(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)}ns(k3,"getElementRef");var T5=Object.defineProperty,A5=(t,e)=>T5(t,"name",{value:e,configurable:!0}),N5=bl[" useId ".trim().toString()]||(()=>{}),M5=0;function yo(t){const[e,n]=C.useState(N5());return Ot(()=>{t||n(r=>r??String(M5++))},[t]),t||(e?`radix-${e}`:"")}A5(yo,"useId");var D5=Object.defineProperty,R5=(t,e)=>D5(t,"name",{value:e,configurable:!0}),O5=C.createContext(void 0);function ap(t){const e=C.useContext(O5);return t||e||"ltr"}R5(ap,"useDirection");var I5=Object.defineProperty,P5=(t,e)=>I5(t,"name",{value:e,configurable:!0});function Dr(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)}),[])}P5(Dr,"useCallbackRef");var j5=Object.defineProperty,cn=(t,e)=>j5(t,"name",{value:e,configurable:!0}),c1="dismissableLayer.update",L5="dismissableLayer.pointerDownOutside",z5="dismissableLayer.focusOutside",A2,w3=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lp=C.forwardRef(cn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,h=C.useContext(w3),[m,y]=C.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=C.useState({}),k=ot(n,y),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),T=_?E.indexOf(_):-1,N=m?E.indexOf(m):-1,M=h.layersWithOutsidePointerEventsDisabled.size>0,D=N>=T,I=C.useRef(!1),P=S3(J=>{i==null||i(J),u==null||u(J),J.defaultPrevented||d==null||d()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(J=>{if(!(J instanceof Node))return!1;const K=[...h.branches].some(Y=>Y.contains(J));return D&&!K},[h.branches,D])}),O=E3(J=>{if(o&&I.current)return;const K=J.target;[...h.branches].some(ee=>ee.contains(K))||(l==null||l(J),u==null||u(J),J.defaultPrevented||d==null||d())},v),W=m?N===E.length-1:!1,Z=Dr(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(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(A2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),d1(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=A2))}},[m,v,r,h]),C.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),d1())},[m,h]),C.useEffect(()=>{const J=cn(()=>b({}),"handleUpdate");return document.addEventListener(c1,J),()=>document.removeEventListener(c1,J)},[]),x.jsx(st.div,{...f,ref:k,style:{pointerEvents:M?D?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function C3(){const t=C.useContext(w3),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}cn(C3,"useDismissableLayerSurface");var F5=cn(()=>!0,"IS_TRUE");function S3(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=F5}=e,l=Dr(t),u=C.useRef(!1),d=C.useRef(!1),f=C.useRef(new Map),h=C.useRef(()=>{});return C.useEffect(()=>{function m(){d.current=!1,o.current=!1,f.current.clear()}cn(m,"resetOutsideInteraction");function y(){return Array.from(f.current.values()).some(Boolean)}cn(y,"isOutsideInteractionIntercepted");function v(T){if(!d.current)return;const N=T.target;N instanceof Node&&[...s].some(D=>D.contains(N))||f.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}cn(v,"handleInteractionCapture");function b(T){d.current&&f.current.set(T.type,!1)}cn(b,"handleInteractionBubble");const k=cn(T=>{if(T.target&&!u.current){let N=function(){n.removeEventListener("click",h.current);const D=y();m(),D||Dy(L5,l,M,{discrete:!0})};if(cn(N,"handleAndDispatchPointerDownOutsideEvent"),!i(T.target)){n.removeEventListener("click",h.current),m(),u.current=!1;return}const M={originalEvent:T};d.current=!0,o.current=r&&T.button===0,f.current.clear(),!r||T.button!==0?N():(n.removeEventListener("click",h.current),h.current=N,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();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",h.current);for(const T of E)n.removeEventListener(T,v,!0),n.removeEventListener(T,b)}},[n,l,r,o,s,i]),{onPointerDownCapture:cn(()=>u.current=!0,"onPointerDownCapture")}}cn(S3,"usePointerDownOutside");function E3(t,e=globalThis==null?void 0:globalThis.document){const n=Dr(t),r=C.useRef(!1);return C.useEffect(()=>{const o=cn(s=>{s.target&&!r.current&&Dy(z5,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(E3,"useFocusOutside");function d1(){const t=new CustomEvent(c1);document.dispatchEvent(t)}cn(d1,"dispatchUpdate");function Dy(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?Ny(o,s):o.dispatchEvent(s)}cn(Dy,"handleAndDispatchCustomEvent");var $5=Object.defineProperty,Pn=(t,e)=>$5(t,"name",{value:e,configurable:!0}),W0="focusScope.autoFocusOnMount",q0="focusScope.autoFocusOnUnmount",N2={bubbles:!1,cancelable:!0},Ry=C.forwardRef(Pn(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[u,d]=C.useState(null),f=Dr(s),h=Dr(i),m=C.useRef(null),y=ot(n,d),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(o){let k=function(N){if(v.paused||!u)return;const M=N.target;u.contains(M)?m.current=M:Wo(m.current,{select:!0})},E=function(N){if(v.paused||!u)return;const M=N.relatedTarget;M!==null&&(u.contains(M)||Wo(m.current,{select:!0}))},_=function(N){if(document.activeElement===document.body)for(const D of N)D.removedNodes.length>0&&Wo(u)};Pn(k,"handleFocusIn"),Pn(E,"handleFocusOut"),Pn(_,"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){M2.add(v);const k=document.activeElement;if(!u.contains(k)){const _=new CustomEvent(W0,N2);u.addEventListener(W0,f),u.dispatchEvent(_),_.defaultPrevented||(_3(D3(Oy(u)),{select:!0}),document.activeElement===k&&Wo(u))}return()=>{u.removeEventListener(W0,f),setTimeout(()=>{const _=new CustomEvent(q0,N2);u.addEventListener(q0,h),u.dispatchEvent(_),_.defaultPrevented||Wo(k??document.body,{select:!0}),u.removeEventListener(q0,h),M2.remove(v)},0)}}},[u,f,h,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,[N,M]=T3(T);N&&M?!k.shiftKey&&_===M?(k.preventDefault(),r&&Wo(N,{select:!0})):k.shiftKey&&_===N&&(k.preventDefault(),r&&Wo(M,{select:!0})):_===T&&k.preventDefault()}},[r,o,v.paused]);return x.jsx(st.div,{tabIndex:-1,...l,ref:y,onKeyDown:b})},"FocusScope"));function _3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wo(r,{select:e}),document.activeElement!==n)return}Pn(_3,"focusFirst");function T3(t){const e=Oy(t),n=f1(e,t),r=f1(e.reverse(),t);return[n,r]}Pn(T3,"getTabbableEdges");function Oy(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Pn(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}Pn(Oy,"getTabbableCandidates");function f1(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):A3(r,{upTo:e})))return r}Pn(f1,"findVisible");function A3(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}Pn(A3,"isHidden");function N3(t){return t instanceof HTMLInputElement&&"select"in t}Pn(N3,"isSelectableInput");function Wo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&N3(t)&&e&&t.select()}}Pn(Wo,"focus");var M2=M3();function M3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=h1(t,e),t.unshift(e)},remove(e){var n;t=h1(t,e),(n=t[0])==null||n.resume()}}}Pn(M3,"createFocusScopesStack");function h1(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Pn(h1,"arrayRemove");function D3(t){return t.filter(e=>e.tagName!=="A")}Pn(D3,"removeLinks");var B5=Object.defineProperty,V5=(t,e)=>B5(t,"name",{value:e,configurable:!0}),up=C.forwardRef(V5(function(e,n){var u;const{container:r,...o}=e,[s,i]=C.useState(!1);Ot(()=>i(!0),[]);const l=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Hr.createPortal(x.jsx(st.div,{...o,ref:n}),l):null},"Portal")),H5=Object.defineProperty,Iy=(t,e)=>H5(t,"name",{value:e,configurable:!0}),af=0,oo=null;function U5(t){return Ac(),t.children}Iy(U5,"FocusGuards");function Ac(){C.useEffect(()=>{oo||(oo={start:p1(),end:p1()});const{start:t,end:e}=oo;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),af++,()=>{af===1&&(oo==null||oo.start.remove(),oo==null||oo.end.remove(),oo=null),af=Math.max(0,af-1)}},[])}Iy(Ac,"useFocusGuards");function p1(){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}Iy(p1,"createFocusGuard");var fo=function(){return fo=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fo.apply(this,arguments)};function R3(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 W5(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 Ff="right-scroll-bar-position",$f="width-before-scroll-bar",q5="with-scroll-bars-hidden",K5="--removed-body-scroll-bar-size";function K0(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function G5(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 J5=typeof window<"u"?C.useLayoutEffect:C.useEffect,D2=new WeakMap;function Z5(t,e){var n=G5(null,function(r){return t.forEach(function(o){return K0(o,r)})});return J5(function(){var r=D2.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(l){s.has(l)||K0(l,null)}),s.forEach(function(l){o.has(l)||K0(l,i)})}D2.set(n,t)},[t]),n}function Y5(t){return t}function X5(t,e){e===void 0&&(e=Y5);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(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function Q5(t){t===void 0&&(t={});var e=X5(null);return e.options=fo({async:!0,ssr:!1},t),e}var O3=function(t){var e=t.sideCar,n=R3(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,fo({},n))};O3.isSideCarExport=!0;function eD(t,e){return t.useMedium(e),O3}var I3=Q5(),G0=function(){},cp=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:G0,onWheelCapture:G0,onTouchMoveCapture:G0}),o=r[0],s=r[1],i=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,y=t.noRelative,v=t.noIsolation,b=t.inert,k=t.allowPinchZoom,E=t.as,_=E===void 0?"div":E,T=t.gapMode,N=R3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=m,D=Z5([n,e]),I=fo(fo({},N),o);return C.createElement(C.Fragment,null,f&&C.createElement(M,{sideCar:I3,removeScrollBar:d,shards:h,noRelative:y,noIsolation:v,inert:b,setCallbacks:s,allowPinchZoom:!!k,lockRef:n,gapMode:T}),i?C.cloneElement(C.Children.only(l),fo(fo({},I),{ref:D})):C.createElement(_,fo({},I,{className:u,ref:D}),l))});cp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cp.classNames={fullWidth:$f,zeroRight:Ff};var tD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=tD();return e&&t.setAttribute("nonce",e),t}function rD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function oD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var sD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=nD())&&(rD(e,n),oD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},iD=function(){var t=sD();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},P3=function(){var t=iD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},aD={left:0,top:0,right:0,gap:0},J0=function(t){return parseInt(t||"",10)||0},lD=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[J0(n),J0(r),J0(o)]},uD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return aD;var e=lD(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=P3(),Ya="data-scroll-locked",dD=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
41
|
-
.`.concat(q5,` {
|
|
42
|
-
overflow: hidden `).concat(r,`;
|
|
43
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
44
|
-
}
|
|
45
|
-
body[`).concat(Ya,`] {
|
|
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(l,"px ").concat(r,`;
|
|
55
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.`).concat(Ff,` {
|
|
59
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.`).concat($f,` {
|
|
63
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.`).concat(Ff," .").concat(Ff,` {
|
|
67
|
-
right: 0 `).concat(r,`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat($f," .").concat($f,` {
|
|
71
|
-
margin-right: 0 `).concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
body[`).concat(Ya,`] {
|
|
75
|
-
`).concat(K5,": ").concat(l,`px;
|
|
76
|
-
}
|
|
77
|
-
`)},R2=function(){var t=parseInt(document.body.getAttribute(Ya)||"0",10);return isFinite(t)?t:0},fD=function(){C.useEffect(function(){return document.body.setAttribute(Ya,(R2()+1).toString()),function(){var t=R2()-1;t<=0?document.body.removeAttribute(Ya):document.body.setAttribute(Ya,t.toString())}},[])},hD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;fD();var s=C.useMemo(function(){return uD(o)},[o]);return C.createElement(cD,{styles:dD(s,!e,o,n?"":"!important")})},m1=!1;if(typeof window<"u")try{var lf=Object.defineProperty({},"passive",{get:function(){return m1=!0,!0}});window.addEventListener("test",lf,lf),window.removeEventListener("test",lf,lf)}catch{m1=!1}var Ba=m1?{passive:!1}:!1,pD=function(t){return t.tagName==="TEXTAREA"},j3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!pD(t)&&n[e]==="visible")},mD=function(t){return j3(t,"overflowY")},gD=function(t){return j3(t,"overflowX")},O2=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=L3(t,r);if(o){var s=z3(t,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},xD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},L3=function(t,e){return t==="v"?mD(e):gD(e)},z3=function(t,e){return t==="v"?yD(e):xD(e)},vD=function(t,e){return t==="h"&&e==="rtl"?-1:1},bD=function(t,e,n,r,o){var s=vD(t,window.getComputedStyle(e).direction),i=s*r,l=n.target,u=e.contains(l),d=!1,f=i>0,h=0,m=0;do{if(!l)break;var y=z3(t,l),v=y[0],b=y[1],k=y[2],E=b-k-s*v;(v||E)&&L3(t,l)&&(h+=E,m+=v);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},uf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},I2=function(t){return[t.deltaX,t.deltaY]},P2=function(t){return t&&"current"in t?t.current:t},kD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},wD=function(t){return`
|
|
78
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
79
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
80
|
-
`)},CD=0,Va=[];function SD(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),o=C.useState(CD++)[0],s=C.useState(P3)[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=W5([t.lockRef.current],(t.shards||[]).map(P2),!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 l=C.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var E=uf(b),_=n.current,T="deltaX"in b?b.deltaX:_[0]-E[0],N="deltaY"in b?b.deltaY:_[1]-E[1],M,D=b.target,I=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in b&&I==="h"&&D.type==="range")return!1;var P=window.getSelection(),O=P&&P.anchorNode,W=O?O===D||O.contains(D):!1;if(W)return!1;var Z=O2(I,D);if(!Z)return!0;if(Z?M=I:(M=I==="v"?"h":"v",Z=O2(I,D)),!Z)return!1;if(!r.current&&"changedTouches"in b&&(T||N)&&(r.current=M),!M)return!0;var J=r.current||M;return bD(J,k,b,J==="h"?T:N)},[]),u=C.useCallback(function(b){var k=b;if(!(!Va.length||Va[Va.length-1]!==s)){var E="deltaY"in k?I2(k):uf(k),_=e.current.filter(function(M){return M.name===k.type&&(M.target===k.target||k.target===M.shadowParent)&&kD(M.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(i.current.shards||[]).map(P2).filter(Boolean).filter(function(M){return M.contains(k.target)}),N=T.length>0?l(k,T[0]):!i.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),d=C.useCallback(function(b,k,E,_){var T={name:b,delta:k,target:E,should:_,shadowParent:ED(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(N){return N!==T})},1)},[]),f=C.useCallback(function(b){n.current=uf(b),r.current=void 0},[]),h=C.useCallback(function(b){d(b.type,I2(b),b.target,l(b,t.lockRef.current))},[]),m=C.useCallback(function(b){d(b.type,uf(b),b.target,l(b,t.lockRef.current))},[]);C.useEffect(function(){return Va.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Ba),document.addEventListener("touchmove",u,Ba),document.addEventListener("touchstart",f,Ba),function(){Va=Va.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Ba),document.removeEventListener("touchmove",u,Ba),document.removeEventListener("touchstart",f,Ba)}},[]);var y=t.removeScrollBar,v=t.inert;return C.createElement(C.Fragment,null,v?C.createElement(s,{styles:wD(o)}):null,y?C.createElement(hD,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function ED(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const _D=eD(I3,SD);var dp=C.forwardRef(function(t,e){return C.createElement(cp,fo({},t,{ref:e,sideCar:_D}))});dp.classNames=cp.classNames;var TD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ha=new WeakMap,cf=new WeakMap,df={},Z0=0,F3=function(t){return t&&(t.host||F3(t.parentNode))},AD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=F3(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})},ND=function(t,e,n,r){var o=AD(e,Array.isArray(t)?t:[t]);df[n]||(df[n]=new WeakMap);var s=df[n],i=[],l=new Set,u=new Set(o),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};o.forEach(d);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))f(m);else try{var y=m.getAttribute(r),v=y!==null&&y!=="false",b=(Ha.get(m)||0)+1,k=(s.get(m)||0)+1;Ha.set(m,b),s.set(m,k),i.push(m),b===1&&v&&cf.set(m,!0),k===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",m,E)}})};return f(e),l.clear(),Z0++,function(){i.forEach(function(h){var m=Ha.get(h)-1,y=s.get(h)-1;Ha.set(h,m),s.set(h,y),m||(cf.has(h)||h.removeAttribute(r),cf.delete(h)),y||h.removeAttribute(n)}),Z0--,Z0||(Ha=new WeakMap,Ha=new WeakMap,cf=new WeakMap,df={})}},Py=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=TD(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ND(r,o,n,"aria-hidden")):function(){return null}},MD=Object.defineProperty,fr=(t,e)=>MD(t,"name",{value:e,configurable:!0}),jy="Dialog",[$3,uQ]=Co(jy),[DD,Jr]=$3(jy),RD=fr(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,l=C.useRef(null),u=C.useRef(null),[d,f]=Yi({prop:r,defaultProp:o??!1,onChange:s,caller:jy}),[h,m]=C.useState(0),[y,v]=C.useState(0);return x.jsx(DD,{scope:e,triggerRef:l,contentRef:u,contentId:yo(),titleId:yo(),descriptionId:yo(),titlePresent:h>0,descriptionPresent:y>0,setTitleCount:m,setDescriptionCount:v,open:d,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(b=>!b),[f]),modal:i,children:n})},"Dialog"),OD="DialogTrigger",ID=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Jr(OD,r),i=ot(n,s.triggerRef);return x.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":fp(s.open),...o,ref:i,onClick:Oe(e.onClick,s.onOpenToggle)})},"DialogTrigger")),B3="DialogPortal",[PD,V3]=$3(B3,{forceMount:void 0}),jD=fr(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Jr(B3,e);return x.jsx(PD,{scope:e,forceMount:n,children:C.Children.map(r,i=>x.jsx(as,{present:n||s.open,children:x.jsx(up,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),g1="DialogOverlay",LD=C.forwardRef(fr(function(e,n){const r=V3(g1,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Jr(g1,e.__scopeDialog);return i.modal?x.jsx(as,{present:o||i.open,children:x.jsx(FD,{...s,ref:n})}):null},"DialogOverlay")),zD=vo("DialogOverlay.RemoveScroll"),FD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Jr(g1,r),i=C3(),l=ot(n,i);return x.jsx(dp,{as:zD,allowPinchZoom:!0,shards:[s.contentRef],children:x.jsx(st.div,{"data-state":fp(s.open),...o,ref:l,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Wu="DialogContent",$D=C.forwardRef(fr(function(e,n){const r=V3(Wu,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Jr(Wu,e.__scopeDialog);return x.jsx(as,{present:o||i.open,children:i.modal?x.jsx(BD,{...s,ref:n}):x.jsx(VD,{...s,ref:n})})},"DialogContent")),BD=C.forwardRef(fr(function(e,n){const r=Jr(Wu,e.__scopeDialog),o=C.useRef(null),s=ot(n,r.contentRef,o);return C.useEffect(()=>{const i=o.current;if(i)return Py(i)},[]),x.jsx(H3,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Oe(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),VD=C.forwardRef(fr(function(e,n){const r=Jr(Wu,e.__scopeDialog),o=C.useRef(!1),s=C.useRef(!1);return x.jsx(H3,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.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,f;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),H3=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,u=Jr(Wu,r);return Ac(),x.jsx(x.Fragment,{children:x.jsx(Ry,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:x.jsx(lp,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":fp(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),HD="DialogTitle",UD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Jr(HD,r),{setTitleCount:i}=s;return Ot(()=>(i(l=>l+1),()=>i(l=>l-1)),[i]),x.jsx(st.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),WD="DialogDescription",qD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Jr(WD,r),{setDescriptionCount:i}=s;return Ot(()=>(i(l=>l+1),()=>i(l=>l-1)),[i]),x.jsx(st.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),KD="DialogClose",Ly=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Jr(KD,r);return x.jsx(st.button,{type:"button",...o,ref:n,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function fp(t){return t?"open":"closed"}fr(fp,"getState");var GD=Object.defineProperty,JD=(t,e)=>GD(t,"name",{value:e,configurable:!0});function U3(t){const[e,n]=C.useState(void 0);return Ot(()=>{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,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,l=d.blockSize}else i=t.offsetWidth,l=t.offsetHeight;n({width:i,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}JD(U3,"useSize");const ZD=["top","right","bottom","left"],ri=Math.min,Zo=Math.max,Jf=Math.round,ff=Math.floor,Yo=t=>({x:t,y:t}),YD={left:"right",right:"left",bottom:"top",top:"bottom"};function W3(t,e,n){return Zo(t,ri(e,n))}function rs(t,e){return typeof t=="function"?t(e):t}function oi(t){return t.split("-")[0]}function wl(t){return t.split("-")[1]}function zy(t){return t==="x"?"y":"x"}function Fy(t){return t==="y"?"height":"width"}function ho(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function $y(t){return zy(ho(t))}function XD(t,e,n){n===void 0&&(n=!1);const r=wl(t),o=$y(t),s=Fy(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=Zf(i)),[i,Zf(i)]}function QD(t){const e=Zf(t);return[y1(t),e,y1(e)]}function y1(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const j2=["left","right"],L2=["right","left"],eR=["top","bottom"],tR=["bottom","top"];function nR(t,e,n){switch(t){case"top":case"bottom":return n?e?L2:j2:e?j2:L2;case"left":case"right":return e?eR:tR;default:return[]}}function rR(t,e,n,r){const o=wl(t);let s=nR(oi(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(y1)))),s}function Zf(t){const e=oi(t);return YD[e]+t.slice(e.length)}function oR(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"?oR(t):{top:t,right:t,bottom:t,left:t}}function Yf(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 z2(t,e,n){let{reference:r,floating:o}=t;const s=ho(e),i=$y(e),l=Fy(i),u=oi(e),d=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:f,y:r.y-o.height};break;case"bottom":y={x:f,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-o.width,y:h};break;default:y={x:r.x,y:r.y}}const v=wl(e);return v&&(y[i]+=m*(v==="end"?1:-1)*(n&&d?-1:1)),y}async function sR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:y=0}=rs(e,t),v=q3(y),k=l[m?h==="floating"?"reference":"floating":h],E=Yf(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(l.floating)),boundary:d,rootBoundary:f,strategy:u})),_=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},M=Yf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:T,strategy:u}):_);return{top:(E.top-M.top+v.top)/N.y,bottom:(M.bottom-E.bottom+v.bottom)/N.y,left:(E.left-M.left+v.left)/N.x,right:(M.right-E.right+v.right)/N.x}}const iR=50,aR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:sR},u=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:h}=z2(d,r,u),m=r,y=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:N,data:M,reset:D}=await _({x:f,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:v,rects:d,platform:l,elements:{reference:t,floating:e}});f=T??f,h=N??h,v[E]={...v[E],...M},D&&y<iR&&(y++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(d=D.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):D.rects),{x:f,y:h}=z2(d,m,u)),b=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:v}},lR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=rs(t,e)||{};if(d==null)return{};const h=q3(f),m={x:n,y:r},y=$y(o),v=Fy(y),b=await i.getDimensions(d),k=y==="y",E=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",N=s.reference[v]+s.reference[y]-m[y]-s.floating[v],M=m[y]-s.reference[y],D=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let I=D?D[T]:0;(!I||!await(i.isElement==null?void 0:i.isElement(D)))&&(I=l.floating[T]||s.floating[v]);const P=N/2-M/2,O=I/2-b[v]/2-1,W=ri(h[E],O),Z=ri(h[_],O),J=I-b[v]-Z,K=I/2-b[v]/2+P,Y=W3(W,K,J),ee=!u.arrow&&wl(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{[y]:m[y]+G,data:{[y]:Y,centerOffset:K-Y-G,...ee&&{alignmentOffset:G}},reset:ee}}}),uR=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:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...k}=rs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=oi(o),_=ho(l),T=oi(l)===l,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),M=m||(T||!b?[Zf(l)]:QD(l)),D=v!=="none";!m&&D&&M.push(...rR(l,b,v,N));const I=[l,...M],P=await u.detectOverflow(e,k),O=[];let W=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&O.push(P[E]),h){const Y=XD(o,i,N);O.push(P[Y[0]],P[Y[1]])}if(W=[...W,{placement:o,overflows:O}],!O.every(Y=>Y<=0)){var Z,J;const Y=(((Z=s.flip)==null?void 0:Z.index)||0)+1,ee=I[Y];if(ee&&(!(h==="alignment"?_!==ho(ee):!1)||W.every(q=>ho(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(y){case"bestFit":{var K;const X=(K=W.filter(q=>{if(D){const te=ho(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=l;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function F2(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function $2(t){return ZD.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}=rs(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=F2(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:$2(l)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),l=F2(i,n.floating);return{data:{escapedOffsets:l,escaped:$2(l)}}}default:return{}}}}},K3=new Set(["left","top"]);async function dR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=oi(n),l=wl(n),u=ho(n)==="y",d=K3.has(i)?-1:1,f=s&&u?-1:1,h=rs(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof v=="number"&&(y=l==="end"?v*-1:v),u?{x:y*f,y:m*d}:{x:m*d,y:y*f}}const fR=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:l}=e,u=await dR(e,t);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},hR=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:l=!1,limiter:u={fn:_=>{let{x:T,y:N}=_;return{x:T,y:N}}},...d}=rs(t,e),f={x:n,y:r},h=await s.detectOverflow(e,d),m=ho(o),y=zy(m);let v=f[y],b=f[m];const k=(_,T)=>W3(T+h[_==="y"?"top":"left"],T,T-h[_==="y"?"bottom":"right"]);i&&(v=k(y,v)),l&&(b=k(m,b));const E=u.fn({...e,[y]:v,[m]:b});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:i,[m]:l}}}}}},pR=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:o,y:s,placement:i,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=rs(t,e),m={x:o,y:s},y=ho(i),v=zy(y);let b=m[v],k=m[y];const E=rs(d,e),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(f){const M=v==="y"?"height":"width",D=l.reference[v]-l.floating[M]+_.mainAxis,I=l.reference[v]+l.reference[M]-_.mainAxis;b<D?b=D:b>I&&(b=I)}if(h){var T,N;const M=v==="y"?"width":"height",D=K3.has(oi(i)),I=l.reference[y]-l.floating[M]+(D&&((T=u.offset)==null?void 0:T[y])||0)+(D?0:_.crossAxis),P=l.reference[y]+l.reference[M]+(D?0:((N=u.offset)==null?void 0:N[y])||0)-(D?_.crossAxis:0);k<I?k=I:k>P&&(k=P)}return{[v]:b,[y]:k}}}},mR=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=()=>{},...l}=rs(t,e),u=await o.detectOverflow(e,l),d=oi(n),f=wl(n),h=ho(n)==="y",{width:m,height:y}=r.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,v=f==="end"?"top":"bottom");const k=y-u.top-u.bottom,E=m-u.left-u.right,_=ri(y-u[v],k),T=ri(m-u[b],E),N=e.middlewareData.shift,M=!N;let D=_,I=T;N!=null&&N.enabled.x&&(I=E),N!=null&&N.enabled.y&&(D=k),M&&!f&&(h?I=m-2*Zo(u.left,u.right):D=y-2*Zo(u.top,u.bottom)),await i({...e,availableWidth:I,availableHeight:D});const P=await o.getDimensions(s.floating);return m!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}};function hp(){return typeof window<"u"}function Cl(t){return G3(t)?(t.nodeName||"").toLowerCase():"#document"}function Qn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ls(t){var e;return(e=(G3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function G3(t){return hp()?t instanceof Node||t instanceof Qn(t).Node:!1}function bo(t){return hp()?t instanceof Element||t instanceof Qn(t).Element:!1}function pi(t){return hp()?t instanceof HTMLElement||t instanceof Qn(t).HTMLElement:!1}function B2(t){return!hp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qn(t).ShadowRoot}function pp(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=ko(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function gR(t){return/^(table|td|th)$/.test(Cl(t))}function mp(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const yR=/transform|translate|scale|rotate|perspective|filter/,xR=/paint|layout|strict|content/,ji=t=>!!t&&t!=="none";let Y0;function By(t){const e=bo(t)?ko(t):t;return ji(e.transform)||ji(e.translate)||ji(e.scale)||ji(e.rotate)||ji(e.perspective)||!Vy()&&(ji(e.backdropFilter)||ji(e.filter))||yR.test(e.willChange||"")||xR.test(e.contain||"")}function vR(t){let e=Xi(t);for(;pi(e)&&!qu(e);){if(By(e))return e;if(mp(e))return null;e=Xi(e)}return null}function Vy(){return Y0==null&&(Y0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Y0}function qu(t){return/^(html|body|#document)$/.test(Cl(t))}function ko(t){return Qn(t).getComputedStyle(t)}function gp(t){return bo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xi(t){if(Cl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||B2(t)&&t.host||ls(t);return B2(e)?e.host:e}function J3(t){const e=Xi(t);return qu(e)?(t.ownerDocument||t).body:pi(e)&&pp(e)?e:J3(e)}function Ku(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=J3(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=Qn(o);if(s){const l=x1(i);return e.concat(i,i.visualViewport||[],pp(o)?o:[],l&&n?Ku(l):[])}else return e.concat(o,Ku(o,[],n))}function x1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Z3(t){const e=ko(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=pi(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,l=Jf(n)!==s||Jf(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Hy(t){return bo(t)?t:t.contextElement}function Xa(t){const e=Hy(t);if(!pi(e))return Yo(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Z3(e);let i=(s?Jf(n.width):n.width)/r,l=(s?Jf(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const bR=Yo(0);function Y3(t){const e=Qn(t);return!Vy()||!e.visualViewport?bR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kR(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Qn(t)}function Qi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Hy(t);let i=Yo(1);e&&(r?bo(r)&&(i=Xa(r)):i=Xa(t));const l=kR(s,n,r)?Y3(s):Yo(0);let u=(o.left+l.x)/i.x,d=(o.top+l.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s&&r){const m=Qn(s),y=bo(r)?Qn(r):r;let v=m,b=x1(v);for(;b&&y!==v;){const k=Xa(b),E=b.getBoundingClientRect(),_=ko(b),T=E.left+(b.clientLeft+parseFloat(_.paddingLeft))*k.x,N=E.top+(b.clientTop+parseFloat(_.paddingTop))*k.y;u*=k.x,d*=k.y,f*=k.x,h*=k.y,u+=T,d+=N,v=Qn(b),b=x1(v)}}return Yf({width:f,height:h,x:u,y:d})}function yp(t,e){const n=gp(t).scrollLeft;return e?e.left+n:Qi(ls(t)).left+n}function X3(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-yp(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function wR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=ls(r),l=e?mp(e.floating):!1;if(r===i||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Yo(1);const f=Yo(0),h=pi(r);if((h||!s)&&((Cl(r)!=="body"||pp(i))&&(u=gp(r)),h)){const y=Qi(r);d=Xa(r),f.x=y.x+r.clientLeft,f.y=y.y+r.clientTop}const m=i&&!h&&!s?X3(i,u):Yo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function CR(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function SR(t){const e=gp(t),n=t.ownerDocument.body,r=Zo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Zo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+yp(t);const i=-e.scrollTop;return ko(n).direction==="rtl"&&(s+=Zo(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const ER=25;function _R(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=Qn(t),s=ls(t),i=o.visualViewport;let l=s.clientWidth,u=s.clientHeight,d=0,f=0;if(i){const m=!Vy()||e==="fixed";r?m||(d=-i.offsetLeft,f=-i.offsetTop):(l=i.width,u=i.height,m&&(d=i.offsetLeft,f=i.offsetTop))}if(yp(s)<=0){const m=s.ownerDocument,y=m.body,v=getComputedStyle(y),b=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(s.clientWidth-y.clientWidth-b),E=getComputedStyle(s).scrollbarGutter==="stable both-edges"?k/2:k;E<=ER&&(l-=E)}return{width:l,height:u,x:d,y:f}}function TR(t,e){const n=Qi(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Xa(t),i=t.clientWidth*s.x,l=t.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:l,x:u,y:d}}function V2(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=_R(t,n,e);else if(e==="document")r=SR(ls(t));else if(bo(e))r=TR(e,n);else{const o=Y3(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Yf(r)}function AR(t,e){const n=e.get(t);if(n)return n;let r=Ku(t,[],!1).filter(l=>bo(l)&&Cl(l)!=="body"),o=null;const s=ko(t).position==="fixed";let i=s?Xi(t):t;for(;bo(i)&&!qu(i);){const l=ko(i),u=By(i),d=o?o.position:s?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==i):o=l,i=Xi(i)}return e.set(t,r),r}function NR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?mp(e)?[]:AR(e,this._c):[].concat(n),r],l=V2(e,i[0],o);let u=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<i.length;m++){const y=V2(e,i[m],o);u=Zo(y.top,u),d=ri(y.right,d),f=ri(y.bottom,f),h=Zo(y.left,h)}return{width:d-h,height:f-u,x:h,y:u}}function MR(t){const{width:e,height:n}=Z3(t);return{width:e,height:n}}function DR(t,e,n){const r=pi(e),o=ls(e),s=n==="fixed",i=Qi(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Yo(0);if((r||!s)&&((Cl(e)!=="body"||pp(o))&&(l=gp(e)),r)){const m=Qi(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&o&&(u.x=yp(o));const d=o&&!r&&!s?X3(o,l):Yo(0),f=i.left+l.scrollLeft-u.x-d.x,h=i.top+l.scrollTop-u.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function X0(t){return ko(t).position==="static"}function H2(t,e){if(!pi(t)||ko(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ls(t)===n&&(n=n.ownerDocument.body),n}function Q3(t,e){const n=Qn(t);if(mp(t))return n;if(!pi(t)){let o=Xi(t);for(;o&&!qu(o);){if(bo(o)&&!X0(o))return o;o=Xi(o)}return n}let r=H2(t,e);for(;r&&gR(r)&&X0(r);)r=H2(r,e);return r&&qu(r)&&X0(r)&&!By(r)?n:r||vR(t)||n}const RR=async function(t){const e=this.getOffsetParent||Q3,n=this.getDimensions,r=await n(t.floating);return{reference:DR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OR(t){return ko(t).direction==="rtl"}const IR={convertOffsetParentRelativeRectToViewportRelativeRect:wR,getDocumentElement:ls,getClippingRect:NR,getOffsetParent:Q3,getElementRects:RR,getClientRects:CR,getDimensions:MR,getScale:Xa,isElement:bo,isRTL:OR};function eE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function PR(t,e,n){let r=null,o;const s=ls(t);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),i();const m=t.getBoundingClientRect(),{left:y,top:v,width:b,height:k}=m;if(f||e(),!b||!k)return;const E=ff(v),_=ff(s.clientWidth-(y+b)),T=ff(s.clientHeight-(v+k)),N=ff(y),D={rootMargin:-E+"px "+-_+"px "+-T+"px "+-N+"px",threshold:Zo(0,ri(1,h))||1};let I=!0;function P(O){const W=O[0].intersectionRatio;if(!eE(m,t.getBoundingClientRect()))return l();if(W!==h){if(!I)return l();W?l(!1,W):o=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(P,{...D,root:s.ownerDocument})}catch{r=new IntersectionObserver(P,D)}r.observe(t)}const u=Qn(t),d=()=>l(n);return u.addEventListener("resize",d),l(!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:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Hy(t),f=o||s?[...d?Ku(d):[],...e?Ku(e):[]]:[];f.forEach(E=>{o&&E.addEventListener("scroll",n),s&&E.addEventListener("resize",n)});const h=d&&l?PR(d,n,s):null;let m=-1,y=null;i&&(y=new ResizeObserver(E=>{let[_]=E;_&&_.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),d&&!u&&y.observe(d),e&&y.observe(e));let v,b=u?Qi(t):null;u&&k();function k(){const E=Qi(t);b&&!eE(b,E)&&n(),b=E,v=requestAnimationFrame(k)}return n(),()=>{var E;f.forEach(_=>{o&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),h==null||h(),(E=y)==null||E.disconnect(),y=null,u&&cancelAnimationFrame(v)}}const LR=fR,zR=hR,FR=uR,$R=mR,BR=cR,U2=lR,VR=pR,HR=(t,e,n)=>{const r=new Map,o=n??{},s={...IR,...o.platform,_c:r};return aR(t,e,{...o,platform:s})};var UR=typeof document<"u",WR=function(){},Bf=UR?C.useLayoutEffect:WR;function Xf(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(!Xf(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)&&!Xf(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tE(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function W2(t,e){const n=tE(t);return Math.round(e*n)/n}function Q0(t){const e=C.useRef(t);return Bf(()=>{e.current=t}),e}function qR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,h]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=C.useState(r);Xf(m,r)||y(r);const[v,b]=C.useState(null),[k,E]=C.useState(null),_=C.useCallback(q=>{q!==D.current&&(D.current=q,b(q))},[]),T=C.useCallback(q=>{q!==I.current&&(I.current=q,E(q))},[]),N=s||v,M=i||k,D=C.useRef(null),I=C.useRef(null),P=C.useRef(f),O=u!=null,W=Q0(u),Z=Q0(o),J=Q0(d),K=C.useCallback(()=>{if(!D.current||!I.current)return;const q={placement:e,strategy:n,middleware:m};Z.current&&(q.platform=Z.current),HR(D.current,I.current,q).then(te=>{const F={...te,isPositioned:J.current!==!1};Y.current&&!Xf(P.current,F)&&(P.current=F,Hr.flushSync(()=>{h(F)}))})},[m,e,n,Z,J]);Bf(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(q=>({...q,isPositioned:!1})))},[d]);const Y=C.useRef(!1);Bf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Bf(()=>{if(N&&(D.current=N),M&&(I.current=M),N&&M){if(W.current)return W.current(N,M,K);K()}},[N,M,K,W,O]);const ee=C.useMemo(()=>({reference:D,floating:I,setReference:_,setFloating:T}),[_,T]),G=C.useMemo(()=>({reference:N,floating:M}),[N,M]),X=C.useMemo(()=>{const q={position:n,left:0,top:0};if(!G.floating)return q;const te=W2(G.floating,f.x),F=W2(G.floating,f.y);return l?{...q,transform:"translate("+te+"px, "+F+"px)",...tE(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:F}},[n,l,G.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:K,refs:ee,elements:G,floatingStyles:X}),[f,K,ee,G,X])}const KR=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?U2({element:r.current,padding:o}).fn(n):{}:r?U2({element:r,padding:o}).fn(n):{}}}},GR=(t,e)=>{const n=LR(t);return{name:n.name,fn:n.fn,options:[t,e]}},JR=(t,e)=>{const n=zR(t);return{name:n.name,fn:n.fn,options:[t,e]}},ZR=(t,e)=>({fn:VR(t).fn,options:[t,e]}),YR=(t,e)=>{const n=FR(t);return{name:n.name,fn:n.fn,options:[t,e]}},XR=(t,e)=>{const n=$R(t);return{name:n.name,fn:n.fn,options:[t,e]}},QR=(t,e)=>{const n=BR(t);return{name:n.name,fn:n.fn,options:[t,e]}},e8=(t,e)=>{const n=KR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var t8=Object.defineProperty,n8=(t,e)=>t8(t,"name",{value:e,configurable:!0}),r8=C.forwardRef(n8(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return x.jsx(st.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:x.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),o8=r8,s8=Object.defineProperty,Xo=(t,e)=>s8(t,"name",{value:e,configurable:!0}),nE="Popper",[rE,Sl]=Co(nE),[i8,oE]=rE(nE),a8=Xo(t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null),[s,i]=C.useState(void 0);return x.jsx(i8,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),l8="PopperAnchor",u8=C.forwardRef(Xo(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=oE(l8,r),l=C.useRef(null),u=i.onAnchorChange,d=C.useCallback(b=>{l.current=b,b&&u(b)},[u]),f=ot(n,d),h=C.useRef(null);C.useEffect(()=>{if(!o)return;const b=h.current;h.current=o.current,b!==h.current&&u(h.current)});const m=i.placementState&&xp(i.placementState),y=m==null?void 0:m[0],v=m==null?void 0:m[1];return o?null:x.jsx(st.div,{"data-radix-popper-side":y,"data-radix-popper-align":v,...s,ref:f})},"PopperAnchor")),sE="PopperContent",[c8,d8]=rE(sE),f8=C.forwardRef(Xo(function(e,n){var de,me,Fe,Re,Be,Ye,Nt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:b,...k}=e,E=oE(sE,r),[_,T]=C.useState(null),N=ot(n,T),[M,D]=C.useState(null),I=U3(M),P=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,W=o+(i!=="center"?"-"+i:""),Z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},J=Array.isArray(f)?f:[f],K=J.length>0,Y={padding:Z,boundary:J.filter(iE),altBoundary:K},{refs:ee,floatingStyles:G,placement:X,isPositioned:q,middlewareData:te}=qR({strategy:"fixed",placement:W,whileElementsMounted:Xo((...jt)=>jR(...jt,{animationFrame:v==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[GR({mainAxis:s+O,alignmentAxis:l}),d&&JR({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?ZR():void 0,...Y}),d&&YR({...Y}),XR({...Y,apply:Xo(({elements:jt,rects:Ut,availableWidth:$n,availableHeight:Wt})=>{const{width:nn,height:Dn}=Ut.reference,pt=jt.floating.style;pt.setProperty("--radix-popper-available-width",`${$n}px`),pt.setProperty("--radix-popper-available-height",`${Wt}px`),pt.setProperty("--radix-popper-anchor-width",`${nn}px`),pt.setProperty("--radix-popper-anchor-height",`${Dn}px`)},"apply")}),M&&e8({element:M,padding:u}),g8({arrowWidth:P,arrowHeight:O}),y&&QR({strategy:"referenceHidden",...Y,boundary:K?Y.boundary:void 0})]}),F=E.setPlacementState;Ot(()=>(F(X),()=>{F(void 0)}),[X,F]);const[L,V]=xp(X),re=Dr(b);Ot(()=>{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,[De,Q]=C.useState();return Ot(()=>{_&&Q(window.getComputedStyle(_).zIndex)},[_]),x.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[(Re=te.transformOrigin)==null?void 0:Re.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:x.jsx(c8,{scope:r,placedSide:L,placedAlign:V,onArrowChange:D,arrowX:he,arrowY:ce,shouldHideArrow:pe,children:x.jsx(st.div,{"data-side":L,"data-align":V,...k,ref:N,style:{...k.style,animation:q?(Nt=k.style)==null?void 0:Nt.animation:"none"}})})})},"PopperContent")),h8="PopperArrow",p8={top:"bottom",right:"left",bottom:"top",left:"right"},m8=C.forwardRef(Xo(function(e,n){const{__scopePopper:r,...o}=e,s=d8(h8,r),i=p8[s.placedSide];return x.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:x.jsx(o8,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function iE(t){return t!==null}Xo(iE,"isNotNull");var g8=Xo(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,l=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[d,f]=xp(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((_=o.arrow)==null?void 0:_.y)??0)+u/2;let v="",b="";return d==="bottom"?(v=i?h:`${m}px`,b=`${-u}px`):d==="top"?(v=i?h:`${m}px`,b=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,b=i?h:`${y}px`):d==="left"&&(v=`${r.floating.width+u}px`,b=i?h:`${y}px`),{data:{x:v,y:b}}}}),"transformOrigin");function xp(t){const[e,n="center"]=t.split("-");return[e,n]}Xo(xp,"getSideAndAlignFromPlacement");var Uy=a8,Wy=u8,qy=f8,y8=m8,x8=Object.defineProperty,Ky=(t,e)=>x8(t,"name",{value:e,configurable:!0}),eg=!1;function aE(){const[t,e]=C.useState(eg);return C.useEffect(()=>{eg||(eg=!0,e(!0))},[]),t}Ky(aE,"useIsHydrated");var lE=bl[" useSyncExternalStore ".trim().toString()];function uE(){return()=>{}}Ky(uE,"subscribe");function cE(){return lE(uE,()=>!0,()=>!1)}Ky(cE,"useIsHydratedModern");var v8=typeof lE=="function"?cE:aE,b8=Object.defineProperty,la=(t,e)=>b8(t,"name",{value:e,configurable:!0}),tg="rovingFocusGroup.onEntryFocus",k8={bubbles:!1,cancelable:!0},vp="RovingFocusGroup",[v1,dE,w8]=ip(vp),[C8,fE]=Co(vp,[w8]),[S8,E8]=C8(vp),_8=C.forwardRef(la(function(e,n){return x.jsx(v1.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(v1.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(T8,{...e,ref:n})})})},"RovingFocusGroup")),T8=C.forwardRef(la(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...m}=e,y=C.useRef(null),v=ot(n,y),b=ap(i),[k,E]=Yi({prop:l,defaultProp:u??null,onChange:d,caller:vp}),[_,T]=C.useState(!1),N=Dr(f),M=dE(r),D=C.useRef(!1),[I,P]=C.useState(0);return C.useEffect(()=>{const O=y.current;if(O)return O.addEventListener(tg,N),()=>O.removeEventListener(tg,N)},[N]),x.jsx(S8,{scope:r,orientation:o,dir:b,loop:s,currentTabStopId:k,onItemFocus:C.useCallback(O=>E(O),[E]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:C.useCallback(()=>P(O=>O-1),[]),children:x.jsx(st.div,{tabIndex:_||I===0?-1:0,"data-orientation":o,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{D.current=!0}),onFocus:Oe(e.onFocus,O=>{const W=!D.current;if(O.target===O.currentTarget&&W&&!_){const Z=new CustomEvent(tg,k8);if(O.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const J=M().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);Gy(G,h)}}D.current=!1}),onBlur:Oe(e.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),A8="RovingFocusGroupItem",N8=C.forwardRef(la(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...u}=e,d=yo(),f=i||d,h=E8(A8,r),m=h.currentTabStopId===f,y=dE(r),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:k}=h,E=v8();return Ot(()=>{if(!(!E||!o))return v(),()=>b()},[E,o,v,b]),C.useEffect(()=>{if(!(E||!o))return v(),()=>b()},[E,o,v,b]),x.jsx(v1.ItemSlot,{scope:r,id:f,focusable:o,active:s,children:x.jsx(st.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...u,ref:n,onMouseDown:Oe(e.onMouseDown,_=>{o?h.onItemFocus(f):_.preventDefault()}),onFocus:Oe(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Oe(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){h.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=pE(_,h.orientation,h.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let M=y().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const D=M.indexOf(_.currentTarget);M=h.loop?mE(M,D+1):M.slice(D+1)}setTimeout(()=>Gy(M))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:k!=null}):l})})},"RovingFocusGroupItem")),M8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hE(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}la(hE,"getDirectionAwareKey");function pE(t,e,n){const r=hE(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return M8[r]}la(pE,"getFocusIntent");function Gy(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}la(Gy,"focusFirst");function mE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}la(mE,"wrapArray");var D8=_8,R8=N8,O8=Object.defineProperty,dt=(t,e)=>O8(t,"name",{value:e,configurable:!0}),I8=["Enter"," "],P8=["ArrowDown","PageUp","Home"],gE=["ArrowUp","PageDown","End"],j8=[...P8,...gE],bp="Menu",[b1,L8,z8]=ip(bp),[ua,yE]=Co(bp,[z8,Sl,fE]),Jy=Sl(),xE=fE(),[F8,Nc]=ua(bp),[$8,Zy]=ua(bp),B8=dt(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,l=Jy(e),[u,d]=C.useState(null),f=C.useRef(!1),h=Dr(s),m=ap(o);return C.useEffect(()=>{const y=dt(()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=dt(()=>f.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),C.useEffect(()=>{if(!n)return;const y=dt(()=>h(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[n,h]),x.jsx(Uy,{...l,children:x.jsx(F8,{scope:e,open:n,onOpenChange:h,content:u,onContentChange:d,children:x.jsx($8,{scope:e,onClose:C.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:r})})})},"Menu"),V8=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e,s=Jy(r);return x.jsx(Wy,{...s,...o,ref:n})},"MenuAnchor")),vE="MenuPortal",[H8,U8]=ua(vE,{forceMount:void 0}),W8=dt(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=Nc(vE,e);return x.jsx(H8,{scope:e,forceMount:n,children:x.jsx(as,{present:n||s.open,children:x.jsx(up,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Gs="MenuContent",[q8,bE]=ua(Gs),K8=C.forwardRef(dt(function(e,n){const r=U8(Gs,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=Nc(Gs,e.__scopeMenu),l=Zy(Gs,e.__scopeMenu);return x.jsx(b1.Provider,{scope:e.__scopeMenu,children:x.jsx(as,{present:o||i.open,children:x.jsx(b1.Slot,{scope:e.__scopeMenu,children:l.modal?x.jsx(G8,{...s,ref:n}):x.jsx(J8,{...s,ref:n})})})})},"MenuContent")),G8=C.forwardRef(dt(function(e,n){const r=Nc(Gs,e.__scopeMenu),o=C.useRef(null),s=ot(n,o);return C.useEffect(()=>{const i=o.current;if(i)return Py(i)},[]),x.jsx(kE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),J8=C.forwardRef(dt(function(e,n){const r=Nc(Gs,e.__scopeMenu);return x.jsx(kE,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Z8=vo("MenuContent.ScrollLock"),kE=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:y,onDismiss:v,disableOutsideScroll:b,...k}=e,E=Nc(Gs,r),_=Zy(Gs,r),T=Jy(r),N=xE(r),M=L8(r),[D,I]=C.useState(null),P=C.useRef(null),O=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?dp:C.Fragment,X=b?{as:Z8,allowPinchZoom:!0}:void 0,q=dt(F=>{var Q,de;const L=Z.current+F,V=M().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=TE(ce,L,he),De=(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),De&&setTimeout(()=>De.focus())},"handleTypeaheadSearch");C.useEffect(()=>()=>window.clearTimeout(W.current),[]),Ac();const te=C.useCallback(F=>{var V,re;return Y.current===((V=K.current)==null?void 0:V.side)&&NE(F,(re=K.current)==null?void 0:re.area)},[]);return x.jsx(q8,{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(),I(null))},[te]),onTriggerLeave:C.useCallback(F=>{te(F)&&F.preventDefault()},[te]),pointerGraceTimerRef:J,onPointerGraceIntentChange:C.useCallback(F=>{K.current=F},[]),children:x.jsx(G,{...X,children:x.jsx(Ry,{asChild:!0,trapped:s,onMountAutoFocus:Oe(i,F=>{var L;F.preventDefault(),(L=P.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:x.jsx(lp,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:y,onDismiss:v,children:x.jsx(D8,{asChild:!0,...N,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:I,onEntryFocus:Oe(d,F=>{_.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(qy,{role:"menu","aria-orientation":"vertical","data-state":SE(E.open),"data-radix-menu-content":"",dir:_.dir,...T,...k,ref:O,style:{outline:"none",...k.style},onKeyDown:Oe(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 De=M().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);gE.includes(F.key)&&De.reverse(),EE(De)}),onBlur:Oe(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(W.current),Z.current="")}),onPointerMove:Oe(e.onPointerMove,Qf(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")),Y8=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return x.jsx(st.div,{...o,ref:n})},"MenuLabel")),k1="MenuItem",q2="menu.itemSelect",wE=C.forwardRef(dt(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=C.useRef(null),l=Zy(k1,e.__scopeMenu),u=bE(k1,e.__scopeMenu),d=ot(n,i),f=C.useRef(!1),h=dt(()=>{const m=i.current;if(!r&&m){const y=new CustomEvent(q2,{bubbles:!0,cancelable:!0});m.addEventListener(q2,v=>o==null?void 0:o(v),{once:!0}),Ny(m,y),y.defaultPrevented?f.current=!1:l.onClose()}},"handleSelect");return x.jsx(X8,{...s,ref:d,disabled:r,onClick:Oe(e.onClick,h),onPointerDown:m=>{var y;(y=e.onPointerDown)==null||y.call(e,m),f.current=!0},onPointerUp:Oe(e.onPointerUp,m=>{var y;f.current||(y=m.currentTarget)==null||y.click()}),onKeyDown:Oe(e.onKeyDown,m=>{r||m.target!==m.currentTarget||u.searchRef.current!==""&&m.key===" "||I8.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})},"MenuItem")),X8=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,l=bE(k1,r),u=xE(r),d=C.useRef(null),f=ot(n,d),[h,m]=C.useState(!1),[y,v]=C.useState("");return C.useEffect(()=>{const b=d.current;b&&v((b.textContent??"").trim())},[i.children]),x.jsx(b1.ItemSlot,{scope:r,disabled:o,textValue:s??y,children:x.jsx(R8,{asChild:!0,...u,focusable:!o,children:x.jsx(st.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:f,onPointerMove:Oe(e.onPointerMove,Qf(b=>{o?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(e.onPointerLeave,Qf(b=>l.onItemLeave(b))),onFocus:Oe(e.onFocus,()=>m(!0)),onBlur:Oe(e.onBlur,()=>m(!1))})})})},"MenuItemImpl")),Q8=C.forwardRef(dt(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return x.jsx(tO,{scope:e.__scopeMenu,checked:r,children:x.jsx(wE,{role:"menuitemcheckbox","aria-checked":Gu(r)?"mixed":r,...s,ref:n,"data-state":Yy(r),onSelect:Oe(s.onSelect,()=>o==null?void 0:o(Gu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),eO="MenuRadioGroup",[cQ,dQ]=ua(eO,{value:void 0,onValueChange:dt(()=>{},"onValueChange")}),CE="MenuItemIndicator",[tO,nO]=ua(CE,{checked:!1}),rO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=nO(CE,r);return x.jsx(as,{present:o||Gu(i.checked)||i.checked===!0,children:x.jsx(st.span,{...s,ref:n,"data-state":Yy(i.checked)})})},"MenuItemIndicator")),oO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return x.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),sO="MenuSub",[fQ,hQ]=ua(sO);function SE(t){return t?"open":"closed"}dt(SE,"getOpenState");function Gu(t){return t==="indeterminate"}dt(Gu,"isIndeterminate");function Yy(t){return Gu(t)?"indeterminate":t?"checked":"unchecked"}dt(Yy,"getCheckedState");function EE(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}dt(EE,"focusFirst");function _E(t,e){return t.map((n,r)=>t[(e+r)%t.length])}dt(_E,"wrapArray");function TE(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=_E(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(TE,"getNextMatch");function AE(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 l=e[s],u=e[i],d=l.x,f=l.y,h=u.x,m=u.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(o=!o)}return o}dt(AE,"isPointInPolygon");function NE(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return AE(n,e)}dt(NE,"isPointerInGraceArea");function Qf(t){return e=>e.pointerType==="mouse"?t(e):void 0}dt(Qf,"whenMouse");var iO=B8,aO=V8,lO=W8,uO=K8,cO=Y8,dO=wE,fO=Q8,hO=rO,pO=oO,mO=Object.defineProperty,us=(t,e)=>mO(t,"name",{value:e,configurable:!0}),Xy="DropdownMenu",[gO,pQ]=Co(Xy,[yE]),cs=yE(),[yO,ME]=gO(Xy),xO=us(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,u=cs(e),d=C.useRef(null),[f,h]=Yi({prop:o,defaultProp:s??!1,onChange:i,caller:Xy});return x.jsx(yO,{scope:e,triggerId:yo(),triggerRef:d,contentId:yo(),open:f,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(m=>!m),[h]),modal:l,children:x.jsx(iO,{...u,open:f,onOpenChange:h,dir:r,modal:l,children:n})})},"DropdownMenu"),vO="DropdownMenuTrigger",bO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=ME(vO,r),l=cs(r),u=ot(n,i.triggerRef);return x.jsx(aO,{asChild:!0,...l,children:x.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:Oe(e.onPointerDown,d=>{!o&&d.button===0&&d.ctrlKey===!1&&(i.onOpenToggle(),i.open||d.preventDefault())}),onKeyDown:Oe(e.onKeyDown,d=>{o||(["Enter"," "].includes(d.key)&&i.onOpenToggle(),d.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})},"DropdownMenuTrigger")),kO=us(t=>{const{__scopeDropdownMenu:e,...n}=t,r=cs(e);return x.jsx(lO,{...r,...n})},"DropdownMenuPortal"),wO="DropdownMenuContent",CO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ME(wO,r),i=cs(r),l=C.useRef(!1);return x.jsx(uO,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:Oe(e.onCloseAutoFocus,u=>{var d;l.current||(d=s.triggerRef.current)==null||d.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!s.modal||h)&&(l.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")),SO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=cs(r);return x.jsx(cO,{...s,...o,ref:n})},"DropdownMenuLabel")),EO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=cs(r);return x.jsx(dO,{...s,...o,ref:n})},"DropdownMenuItem")),_O=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=cs(r);return x.jsx(fO,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),TO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=cs(r);return x.jsx(hO,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),AO=C.forwardRef(us(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=cs(r);return x.jsx(pO,{...s,...o,ref:n})},"DropdownMenuSeparator")),NO=xO,MO=bO,DO=kO,RO=CO,OO=SO,IO=EO,PO=_O,jO=TO,LO=AO,zO=Object.defineProperty,FO=(t,e)=>zO(t,"name",{value:e,configurable:!0}),$O=C.forwardRef(FO(function(e,n){return x.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")),BO=$O,VO=Object.defineProperty,HO=(t,e)=>VO(t,"name",{value:e,configurable:!0});function DE(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])}HO(DE,"usePrevious");var UO=Object.defineProperty,WO=(t,e)=>UO(t,"name",{value:e,configurable:!0});function w1(t,[e,n]){return Math.min(n,Math.max(e,t))}WO(w1,"clamp");var qO=Object.defineProperty,Qe=(t,e)=>qO(t,"name",{value:e,configurable:!0}),KO=[" ","Enter","ArrowUp","ArrowDown"],GO=[" ","Enter"],rl="Select",[kp,wp,JO]=ip(rl),[ca,mQ]=Co(rl,[JO,Sl]),Qy=Sl(),[ZO,mi]=ca(rl),[YO,XO]=ca(rl);function RE(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:h,disabled:m,required:y,form:v,internal_do_not_use_render:b}=t,k=Qy(e),[E,_]=C.useState(null),[T,N]=C.useState(null),[M,D]=C.useState(!1),I=ap(d),[P,O]=Yi({prop:r,defaultProp:o??!1,onChange:s,caller:rl}),[W,Z]=Yi({prop:i,defaultProp:l,onChange:u,caller:rl}),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=yo(),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:y,trigger:E,onTriggerChange:_,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:X,value:W,onValueChange:Z,open:P,onOpenChange:O,dir:I,triggerPointerDownPosRef:J,disabled:m,name:f,autoComplete:h,form:v,nativeOptions:ee,nativeSelectKey:q,isFormControl:Y};return x.jsx(Uy,{...k,children:x.jsx(ZO,{scope:e,...L,children:x.jsx(kp.Provider,{scope:e,children:x.jsx(YO,{scope:e,onNativeOptionAdd:te,onNativeOptionRemove:F,children:jE(b)?b(L):n})})})})}Qe(RE,"SelectProvider");var QO=Qe(t=>{const{__scopeSelect:e,children:n,...r}=t;return x.jsx(RE,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>x.jsxs(x.Fragment,{children:[n,o?x.jsx(EI,{__scopeSelect:e}):null]})})},"Select"),eI="SelectTrigger",tI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Qy(r),l=mi(eI,r),u=l.disabled||o,d=ot(n,l.onTriggerChange),f=wp(r),h=C.useRef("touch"),[m,y,v]=tx(k=>{const E=f().filter(N=>!N.disabled),_=E.find(N=>N.value===l.value),T=nx(E,k,_);T!==void 0&&l.onValueChange(T.value)}),b=Qe(k=>{u||(l.onOpenChange(!0),v()),k&&(l.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return x.jsx(Wy,{asChild:!0,...i,children:x.jsx(st.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Mc(l.value)?"":void 0,...s,ref:d,onClick:Oe(s.onClick,k=>{k.currentTarget.focus(),h.current!=="mouse"&&b(k)}),onPointerDown:Oe(s.onPointerDown,k=>{h.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:Oe(s.onKeyDown,k=>{const E=m.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&y(k.key),!(E&&k.key===" ")&&KO.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),nI="SelectValue",rI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:l="",...u}=e,d=mi(nI,r),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,m=ot(n,d.onValueNodeChange);Ot(()=>{f(h)},[f,h]);const y=Mc(d.value);return x.jsx(st.span,{...u,asChild:y?!1:u.asChild,ref:m,style:{pointerEvents:"none"},children:x.jsx(C.Fragment,{children:y?l:i},y?"placeholder":"value")})},"SelectValue")),oI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return x.jsx(st.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),sI="SelectPortal",[iI,aI]=ca(sI,{forceMount:void 0}),lI=Qe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return x.jsx(iI,{scope:t.__scopeSelect,forceMount:n,children:x.jsx(up,{asChild:!0,...r})})},"SelectPortal"),ea="SelectContent",uI=C.forwardRef(Qe(function(e,n){const r=aI(ea,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=mi(ea,e.__scopeSelect),[l,u]=C.useState();return Ot(()=>{u(new DocumentFragment)},[]),x.jsx(as,{present:o||i.open,children:({present:d})=>d?x.jsx(fI,{...s,ref:n}):x.jsx(cI,{...s,fragment:l})})},"SelectContent")),cI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Hr.createPortal(x.jsx(OE,{scope:r,children:x.jsx(kp.Slot,{scope:r,children:x.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),Br=10,[OE,da]=ca(ea),dI=vo("SelectContent.RemoveScroll"),fI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E,..._}=e,T=mi(ea,r),[N,M]=C.useState(null),[D,I]=C.useState(null),P=ot(n,M),[O,W]=C.useState(null),[Z,J]=C.useState(null),K=wp(r),[Y,ee]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(N)return Py(N)},[N]),Ac();const X=C.useCallback(Q=>{const[de,...me]=K().map(Be=>Be.ref.current),[Fe]=me.slice(-1),Re=document.activeElement;for(const Be of Q)if(Be===Re||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===de&&D&&(D.scrollTop=0),Be===Fe&&D&&(D.scrollTop=D.scrollHeight),Be==null||Be.focus(),document.activeElement!==Re))return},[K,D]),q=C.useCallback(()=>X([O,N]),[X,O,N]);C.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:te,triggerPointerDownPosRef:F}=T;C.useEffect(()=>{if(N){let Q={x:0,y:0};const de=Qe(Fe=>{var Re,Be;Q={x:Math.abs(Math.round(Fe.pageX)-(((Re=F.current)==null?void 0:Re.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(N)||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})}}},[N,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]=tx(Q=>{const de=K().filter(Re=>!Re.disabled),me=de.find(Re=>Re.ref.current===document.activeElement),Fe=nx(de,Q,me);Fe&&setTimeout(()=>{var Re;return(Re=Fe.ref.current)==null?void 0:Re.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(()=>N==null?void 0:N.focus(),[N]),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"?K2:hI,De=pe===K2?{side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E}:{};return x.jsx(OE,{scope:r,content:N,viewport:D,onViewportChange:I,itemRefCallback:re,selectedItem:O,onItemLeave:he,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:Z,position:o,isPositioned:Y,searchRef:L,children:x.jsx(dp,{as:dI,allowPinchZoom:!0,children:x.jsx(Ry,{asChild:!0,trapped:T.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Oe(s,Q=>{var de;(de=T.trigger)==null||de.focus({preventScroll:!0}),Q.preventDefault()}),children:x.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:x.jsx(pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:Q=>Q.preventDefault(),..._,...De,onPlaced:()=>ee(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Oe(_.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(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Re=Q.target,Be=Fe.indexOf(Re);Fe=Fe.slice(Be+1)}setTimeout(()=>X(Fe)),Q.preventDefault()}})})})})})})},"SelectContentImpl")),hI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=mi(ea,r),l=da(ea,r),[u,d]=C.useState(null),[f,h]=C.useState(null),m=ot(n,h),y=wp(r),v=C.useRef(!1),b=C.useRef(!0),{viewport:k,selectedItem:E,selectedItemText:_,focusSelectedItem:T}=l,N=C.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&k&&E&&_){const P=i.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),W=i.valueNode.getBoundingClientRect(),Z=_.getBoundingClientRect();if(i.dir!=="rtl"){const Re=Z.left-O.left,Be=W.left-Re,Ye=P.left-Be,Nt=P.width+Ye,jt=Math.max(Nt,O.width),Ut=window.innerWidth-Br,$n=w1(Be,[Br,Math.max(Br,Ut-jt)]);u.style.minWidth=Nt+"px",u.style.left=$n+"px"}else{const Re=O.right-Z.right,Be=window.innerWidth-W.right-Re,Ye=window.innerWidth-P.right-Be,Nt=P.width+Ye,jt=Math.max(Nt,O.width),Ut=window.innerWidth-Br,$n=w1(Be,[Br,Math.max(Br,Ut-jt)]);u.style.minWidth=Nt+"px",u.style.right=$n+"px"}const J=y(),K=window.innerHeight-Br*2,Y=k.scrollHeight,ee=window.getComputedStyle(f),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-Br,pe=K-ce,De=E.offsetHeight/2,Q=E.offsetTop+De,de=G+X+Q,me=F-de;if(de<=ce){const Re=J.length>0&&E===J[J.length-1].ref.current;u.style.bottom="0px";const Be=f.clientHeight-k.offsetTop-k.offsetHeight,Ye=Math.max(pe,De+(Re?he:0)+Be+q),Nt=de+Ye;u.style.height=Nt+"px"}else{const Re=J.length>0&&E===J[0].ref.current;u.style.top="0px";const Ye=Math.max(ce,G+k.offsetTop+(Re?re:0)+De)+me;u.style.height=Ye+"px",k.scrollTop=de-ce+k.offsetTop}u.style.margin=`${Br}px 0`,u.style.minHeight=L+"px",u.style.maxHeight=K+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[y,i.trigger,i.valueNode,u,f,k,E,_,i.dir,o]);Ot(()=>N(),[N]);const[M,D]=C.useState();Ot(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const I=C.useCallback(P=>{P&&b.current===!0&&(N(),T==null||T(),b.current=!1)},[N,T]);return x.jsx(pI,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:I,children:x.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:x.jsx(st.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),K2=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=Br,...i}=e,l=Qy(r);return x.jsx(qy,{...l,...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")),[pI,ex]=ca(ea,{}),G2="SelectViewport",mI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=da(G2,r),l=ex(G2,r),u=ot(n,i.onViewportChange),d=C.useRef(0);return x.jsxs(x.Fragment,{children:[x.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}),x.jsx(kp.Slot,{scope:r,children:x.jsx(st.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Oe(s.onScroll,f=>{const h=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=l;if(y!=null&&y.current&&m){const v=Math.abs(d.current-h.scrollTop);if(v>0){const b=window.innerHeight-Br*2,k=parseFloat(m.style.minHeight),E=parseFloat(m.style.height),_=Math.max(k,E);if(_<b){const T=_+v,N=Math.min(b,T),M=T-N;m.style.height=N+"px",m.style.bottom==="0px"&&(h.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})},"SelectViewport")),gI="SelectGroup",[gQ,yQ]=ca(gI),C1="SelectItem",[yI,IE]=ca(C1),xI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...l}=e,u=mi(C1,r),d=da(C1,r),f=u.value===o,[h,m]=C.useState(i??""),[y,v]=C.useState(!1),b=Dr(N=>{var M;return(M=d.itemRefCallback)==null?void 0:M.call(d,N,o,s)}),k=ot(n,b),E=yo(),_=C.useRef("touch"),T=Qe(()=>{s||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return x.jsx(yI,{scope:r,value:o,disabled:s,textId:E,isSelected:f,onItemTextChange:C.useCallback(N=>{m(M=>M||((N==null?void 0:N.textContent)??"").trim())},[]),children:x.jsx(kp.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:x.jsx(st.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:k,onFocus:Oe(l.onFocus,()=>v(!0)),onBlur:Oe(l.onBlur,()=>v(!1)),onClick:Oe(l.onClick,()=>{_.current!=="mouse"&&T()}),onPointerUp:Oe(l.onPointerUp,()=>{_.current==="mouse"&&T()}),onPointerDown:Oe(l.onPointerDown,N=>{_.current=N.pointerType}),onPointerMove:Oe(l.onPointerMove,N=>{var M;_.current=N.pointerType,s?(M=d.onItemLeave)==null||M.call(d):_.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(l.onPointerLeave,N=>{var M;N.currentTarget===document.activeElement&&((M=d.onItemLeave)==null||M.call(d))}),onKeyDown:Oe(l.onKeyDown,N=>{var D;s||N.target!==N.currentTarget||((D=d.searchRef)==null?void 0:D.current)!==""&&N.key===" "||(GO.includes(N.key)&&T(),N.key===" "&&N.preventDefault())})})})})},"SelectItem")),hf="SelectItemText",vI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,l=mi(hf,r),u=da(hf,r),d=IE(hf,r),f=XO(hf,r),[h,m]=C.useState(null),y=Dr(T=>{var N;return(N=u.itemTextRefCallback)==null?void 0:N.call(u,T,d.value,d.disabled)}),v=ot(n,m,d.onItemTextChange,y),b=h==null?void 0:h.textContent,k=C.useMemo(()=>x.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=f;return Ot(()=>(E(k),()=>_(k)),[E,_,k]),x.jsxs(x.Fragment,{children:[x.jsx(st.span,{id:d.textId,...i,ref:v}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!Mc(l.value)?Hr.createPortal(i.children,l.valueNode):null]})},"SelectItemText")),bI="SelectItemIndicator",kI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,...o}=e;return IE(bI,r).isSelected?x.jsx(st.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),J2="SelectScrollUpButton",wI=C.forwardRef(Qe(function(e,n){const r=da(J2,e.__scopeSelect),o=ex(J2,e.__scopeSelect),[s,i]=C.useState(!1),l=ot(n,o.onScrollButtonChange);return Ot(()=>{if(r.viewport&&r.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?x.jsx(PE,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),Z2="SelectScrollDownButton",CI=C.forwardRef(Qe(function(e,n){const r=da(Z2,e.__scopeSelect),o=ex(Z2,e.__scopeSelect),[s,i]=C.useState(!1),l=ot(n,o.onScrollButtonChange);return Ot(()=>{if(r.viewport&&r.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?x.jsx(PE,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),PE=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onAutoScroll:o,...s}=e,i=da("SelectScrollButton",r),l=C.useRef(null),u=wp(r),d=C.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return C.useEffect(()=>()=>d(),[d]),Ot(()=>{var h;const f=u().find(m=>m.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[u]),x.jsx(st.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Oe(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:Oe(s.onPointerMove,()=>{var f;(f=i.onItemLeave)==null||f.call(i),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:Oe(s.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),SI="SelectBubbleInput",EI=C.forwardRef(Qe(function({__scopeSelect:e,...n},r){const o=mi(SI,e),{value:s,onValueChange:i,required:l,disabled:u,name:d,autoComplete:f,form:h}=o,{nativeOptions:m,nativeSelectKey:y}=o,v=C.useRef(null),b=ot(r,v),k=s??"",E=DE(k),_=Array.from(m).some(T=>(T.props.value??"")==="");return C.useEffect(()=>{const T=v.current;if(!T)return;const N=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(N,"value").set;if(E!==k&&D){const I=new Event("change",{bubbles:!0});D.call(T,k),T.dispatchEvent(I)}},[E,k]),x.jsxs(st.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:f,disabled:u,form:h,onChange:T=>i(T.target.value),...n,style:{...i3,...n.style},ref:b,defaultValue:k,children:[Mc(s)&&!_?x.jsx("option",{value:""}):null,Array.from(m)]},y)},"SelectBubbleInput"));function jE(t){return typeof t=="function"}Qe(jE,"isFunction");function Mc(t){return t===""||t===void 0}Qe(Mc,"shouldShowPlaceholder");function tx(t){const e=Dr(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(i=>{const l=n.current+i;e(l),Qe((function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(l)},[e]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Qe(tx,"useTypeaheadSearch");function nx(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=LE(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(nx,"findNextItem");function LE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Qe(LE,"wrapArray");var _I=Object.defineProperty,en=(t,e)=>_I(t,"name",{value:e,configurable:!0}),[rx,xQ]=Co("Tooltip",[Sl]),Cp=Sl(),TI="TooltipProvider",AI=700,S1="tooltip.open",[NI,ox]=rx(TI),MI=en(t=>{const{__scopeTooltip:e,delayDuration:n=AI,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=C.useRef(!0),l=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),x.jsx(NI,{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:l,onPointerInTransitChange:C.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),E1="Tooltip",[DI,Dc]=rx(E1),RI=en(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=t,u=ox(E1,t.__scopeTooltip),d=Cp(e),[f,h]=C.useState(null),[m,y]=C.useState(void 0),v=yo(),b=C.useRef(0),k=i??u.disableHoverableContent,E=l??u.delayDuration,_=C.useRef(!1),[T,N]=Yi({prop:r,defaultProp:o??!1,onChange:en(W=>{W?(u.onOpen(),document.dispatchEvent(new CustomEvent(S1))):u.onClose(),s==null||s(W)},"onChange"),caller:E1}),M=C.useMemo(()=>T?_.current?"delayed-open":"instant-open":"closed",[T]),D=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,N(!0)},[N]),I=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),P=C.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,N(!0),b.current=0},E)},[E,N]);C.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const O=m??v;return x.jsx(Uy,{...d,children:x.jsx(DI,{scope:e,contentId:O,setContentId:y,open:T,stateAttribute:M,trigger:f,onTriggerChange:h,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?P():D()},[u.isOpenDelayedRef,P,D]),onTriggerLeave:C.useCallback(()=>{k?I():(window.clearTimeout(b.current),b.current=0)},[I,k]),onOpen:D,onClose:I,disableHoverableContent:k,children:n})})},"Tooltip"),Y2="TooltipTrigger",OI=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Dc(Y2,r),i=ox(Y2,r),l=Cp(r),u=C.useRef(null),d=ot(n,u,s.onTriggerChange),f=C.useRef(!1),h=C.useRef(!1),m=C.useCallback(()=>f.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),x.jsx(Wy,{asChild:!0,...l,children:x.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:d,onPointerMove:Oe(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Oe(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Oe(e.onBlur,s.onClose),onClick:Oe(e.onClick,s.onClose)})})},"TooltipTrigger")),zE="TooltipPortal",[II,PI]=rx(zE,{forceMount:void 0}),jI=en(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Dc(zE,e);return x.jsx(II,{scope:e,forceMount:n,children:x.jsx(as,{present:n||s.open,children:x.jsx(up,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Ju="TooltipContent",LI=C.forwardRef(en(function(e,n){const r=PI(Ju,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,l=Dc(Ju,e.__scopeTooltip);return x.jsx(as,{present:o||l.open,children:l.disableHoverableContent?x.jsx(FE,{side:s,...i,ref:n}):x.jsx(zI,{side:s,...i,ref:n})})},"TooltipContent")),zI=C.forwardRef(en(function(e,n){const r=Dc(Ju,e.__scopeTooltip),o=ox(Ju,e.__scopeTooltip),s=C.useRef(null),i=ot(n,s),[l,u]=C.useState(null),{trigger:d,onClose:f}=r,h=s.current,{onPointerInTransitChange:m}=o,y=C.useCallback(()=>{u(null),m(!1)},[m]),v=C.useCallback((b,k)=>{const E=b.currentTarget,_={x:b.clientX,y:b.clientY},T=$E(_,E.getBoundingClientRect()),N=BE(_,T),M=VE(k.getBoundingClientRect()),D=UE([...N,...M]);u(D),m(!0)},[m]);return C.useEffect(()=>()=>y(),[y]),C.useEffect(()=>{if(d&&h){const b=en(E=>v(E,h),"handleTriggerLeave"),k=en(E=>v(E,d),"handleContentLeave");return d.addEventListener("pointerleave",b),h.addEventListener("pointerleave",k),()=>{d.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",k)}}},[d,h,v,y]),C.useEffect(()=>{if(l){const b=en(k=>{const E=k.target,_={x:k.clientX,y:k.clientY},T=(d==null?void 0:d.contains(E))||(h==null?void 0:h.contains(E)),N=!HE(_,l);T?y():N&&(y(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,h,l,f,y]),x.jsx(FE,{...e,ref:i})},"TooltipContentHoverable")),FI=t3("TooltipContent"),FE=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Dc(Ju,r),h=Cp(r),{onClose:m}=f;C.useEffect(()=>(document.addEventListener(S1,m),()=>document.removeEventListener(S1,m)),[m]),C.useEffect(()=>{if(f.trigger){const v=en(b=>{b.target instanceof Node&&b.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,m]);const{setContentId:y}=f;return Ot(()=>(y(i),()=>{y(void 0)}),[i,y]),x.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:x.jsxs(qy,{"data-state":f.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:f.contentId,...h,...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:[x.jsx(FI,{children:o}),s?x.jsx(p5,{id:f.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),$I=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Cp(r);return x.jsx(y8,{...s,...o,ref:n})},"TooltipArrow"));function $E(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($E,"getExitSideFromRect");function BE(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(BE,"getPaddedExitPoints");function VE(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(VE,"getPointsFromRect");function HE(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 l=e[s],u=e[i],d=l.x,f=l.y,h=u.x,m=u.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(o=!o)}return o}en(HE,"isPointInPolygon");function UE(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),WE(e)}en(UE,"getHull");function WE(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(WE,"getHullPresorted");var BI=MI,VI=RI,HI=OI,UI=jI,WI=LI,qI=$I;const KI=(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},GI=(t,e)=>({classGroupId:t,validator:e}),qE=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),eh="-",X2=[],JI="arbitrary..",ZI=t=>{const e=XI(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return YI(i);const l=i.split(eh),u=l[0]===""&&l.length>1?1:0;return KE(l,u,e)},getConflictingClassGroupIds:(i,l)=>{if(l){const u=r[i],d=n[i];return u?d?KI(d,u):u:d||X2}return n[i]||X2}}},KE=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],s=n.nextPart.get(o);if(s){const d=KE(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=e===0?t.join(eh):t.slice(e).join(eh),u=i.length;for(let d=0;d<u;d++){const f=i[d];if(f.validator(l))return f.classGroupId}},YI=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?JI+r:void 0})(),XI=t=>{const{theme:e,classGroups:n}=t;return QI(n,e)},QI=(t,e)=>{const n=qE();for(const r in t){const o=t[r];sx(o,n,r,e)}return n},sx=(t,e,n,r)=>{const o=t.length;for(let s=0;s<o;s++){const i=t[s];eP(i,e,n,r)}},eP=(t,e,n,r)=>{if(typeof t=="string"){tP(t,e,n);return}if(typeof t=="function"){nP(t,e,n,r);return}rP(t,e,n,r)},tP=(t,e,n)=>{const r=t===""?e:GE(e,t);r.classGroupId=n},nP=(t,e,n,r)=>{if(oP(t)){sx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(GI(n,t))},rP=(t,e,n,r)=>{const o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[l,u]=o[i];sx(u,GE(e,l),n,r)}},GE=(t,e)=>{let n=t;const r=e.split(eh),o=r.length;for(let s=0;s<o;s++){const i=r[s];let l=n.nextPart.get(i);l||(l=qE(),n.nextPart.set(i,l)),n=l}return n},oP=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,sP=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)}}},_1="!",Q2=":",iP=[],ew=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),aP=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const s=[];let i=0,l=0,u=0,d;const f=o.length;for(let b=0;b<f;b++){const k=o[b];if(i===0&&l===0){if(k===Q2){s.push(o.slice(u,b)),u=b+1;continue}if(k==="/"){d=b;continue}}k==="["?i++:k==="]"?i--:k==="("?l++:k===")"&&l--}const h=s.length===0?o:o.slice(u);let m=h,y=!1;h.endsWith(_1)?(m=h.slice(0,-1),y=!0):h.startsWith(_1)&&(m=h.slice(1),y=!0);const v=d&&d>u?d-u:void 0;return ew(s,y,m,v)};if(e){const o=e+Q2,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):ew(iP,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},lP=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],l=i[0]==="[",u=e.has(i);l||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}},uP=t=>({cache:sP(t.cacheSize),parseClassName:aP(t),sortModifiers:lP(t),postfixLookupClassGroupIds:cP(t),...ZI(t)}),cP=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},dP=/\s+/,fP=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=e,l=[],u=t.trim().split(dP);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let E=!!k,_;if(E){const I=b.substring(0,k);_=r(I);const P=_&&i[_]?r(b):void 0;P&&P!==_&&(_=P,E=!1)}else _=r(b);if(!_){if(!E){d=h+(d.length>0?" "+d:d);continue}if(_=r(b),!_){d=h+(d.length>0?" "+d:d);continue}E=!1}const T=y.length===0?"":y.length===1?y[0]:s(y).join(":"),N=v?T+_1:T,M=N+_;if(l.indexOf(M)>-1)continue;l.push(M);const D=o(_,E);for(let I=0;I<D.length;++I){const P=D[I];l.push(N+P)}d=h+(d.length>0?" "+d:d)}return d},hP=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=JE(n))&&(o&&(o+=" "),o+=r);return o},JE=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=JE(t[r]))&&(n&&(n+=" "),n+=e);return n},pP=(t,...e)=>{let n,r,o,s;const i=u=>{const d=e.reduce((f,h)=>h(f),t());return n=uP(d),r=n.cache.get,o=n.cache.set,s=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=fP(u,n);return o(u,f),f};return s=i,(...u)=>s(hP(...u))},mP=[],Zt=t=>{const e=n=>n[t]||mP;return e.isThemeGetter=!0,e},ZE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xP=/\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$/,vP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=t=>gP.test(t),qe=t=>!!t&&!Number.isNaN(Number(t)),so=t=>!!t&&Number.isInteger(Number(t)),ng=t=>t.endsWith("%")&&qe(t.slice(0,-1)),Fo=t=>yP.test(t),XE=()=>!0,wP=t=>xP.test(t)&&!vP.test(t),ix=()=>!1,CP=t=>bP.test(t),SP=t=>kP.test(t),EP=t=>!ve(t)&&!ke(t),_P=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)),TP=t=>gi(t,t_,ix),ve=t=>ZE.test(t),Li=t=>gi(t,n_,wP),tw=t=>gi(t,PP,qe),AP=t=>gi(t,o_,XE),NP=t=>gi(t,r_,ix),nw=t=>gi(t,QE,ix),MP=t=>gi(t,e_,SP),pf=t=>gi(t,s_,CP),ke=t=>YE.test(t),fu=t=>fa(t,n_),DP=t=>fa(t,r_),rw=t=>fa(t,QE),RP=t=>fa(t,t_),OP=t=>fa(t,e_),mf=t=>fa(t,s_,!0),IP=t=>fa(t,o_,!0),gi=(t,e,n)=>{const r=ZE.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},fa=(t,e,n=!1)=>{const r=YE.exec(t);return r?r[1]?e(r[1]):n:!1},QE=t=>t==="position"||t==="percentage",e_=t=>t==="image"||t==="url",t_=t=>t==="length"||t==="size"||t==="bg-size",n_=t=>t==="length",PP=t=>t==="number",r_=t=>t==="family-name",o_=t=>t==="number"||t==="weight",s_=t=>t==="shadow",jP=()=>{const t=Zt("color"),e=Zt("font"),n=Zt("text"),r=Zt("font-weight"),o=Zt("tracking"),s=Zt("leading"),i=Zt("breakpoint"),l=Zt("container"),u=Zt("spacing"),d=Zt("radius"),f=Zt("shadow"),h=Zt("inset-shadow"),m=Zt("text-shadow"),y=Zt("drop-shadow"),v=Zt("blur"),b=Zt("perspective"),k=Zt("aspect"),E=Zt("ease"),_=Zt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...N(),ke,ve],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[ke,ve,u],O=()=>[Rs,"full","auto",...P()],W=()=>[so,"none","subgrid",ke,ve],Z=()=>["auto",{span:["full",so,ke,ve]},so,ke,ve],J=()=>[so,"auto",ke,ve],K=()=>["auto","min","max","fr",ke,ve],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=()=>[Rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],q=()=>[Rs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],te=()=>[Rs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],F=()=>[t,ke,ve],L=()=>[...N(),rw,nw,{position:[ke,ve]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",RP,TP,{size:[ke,ve]}],he=()=>[ng,fu,Li],ce=()=>["","none","full",d,ke,ve],pe=()=>["",qe,fu,Li],De=()=>["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,ng,rw,nw],me=()=>["","none",v,ke,ve],Fe=()=>["none",qe,ke,ve],Re=()=>["none",qe,ke,ve],Be=()=>[qe,ke,ve],Ye=()=>[Rs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fo],breakpoint:[Fo],color:[XE],container:[Fo],"drop-shadow":[Fo],ease:["in","out","in-out"],font:[EP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fo],shadow:[Fo],spacing:["px",qe],text:[Fo],"text-shadow":[Fo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rs,ve,ke,k]}],container:["container"],"container-type":[{"@container":["","normal","size",ke,ve]}],"container-named":[_P],columns:[{columns:[qe,ve,ke,l]}],"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:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[so,"auto",ke,ve]}],basis:[{basis:[Rs,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Rs,"auto","initial","none",ve]}],grow:[{grow:["",qe,ke,ve]}],shrink:[{shrink:["",qe,ke,ve]}],order:[{order:[so,"first","last","none",ke,ve]}],"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:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"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,fu,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,IP,AP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ng,ve]}],"font-family":[{font:[DP,NP,e]}],"font-features":[{"font-features":[ve]}],"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,ke,ve]}],"line-clamp":[{"line-clamp":[qe,"none",ke,tw]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",ke,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,ve]}],"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:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",ke,Li]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[qe,"auto",ke,ve]}],"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:[so,ke,ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,ve]}],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",ke,ve]}],"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"]},so,ke,ve],radial:["",ke,ve],conic:[so,ke,ve]},OP,MP]}],"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:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"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:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,ke,ve]}],"outline-w":[{outline:["",qe,fu,Li]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",f,mf,pf]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",h,mf,pf]}],"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,Li]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",m,mf,pf]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[qe,ke,ve]}],"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":[ke,ve]}],"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":N()}],"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",ke,ve]}],filter:[{filter:["","none",ke,ve]}],blur:[{blur:me()}],brightness:[{brightness:[qe,ke,ve]}],contrast:[{contrast:[qe,ke,ve]}],"drop-shadow":[{"drop-shadow":["","none",y,mf,pf]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",qe,ke,ve]}],"hue-rotate":[{"hue-rotate":[qe,ke,ve]}],invert:[{invert:["",qe,ke,ve]}],saturate:[{saturate:[qe,ke,ve]}],sepia:[{sepia:["",qe,ke,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,ve]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[qe,ke,ve]}],"backdrop-contrast":[{"backdrop-contrast":[qe,ke,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,ke,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,ke,ve]}],"backdrop-invert":[{"backdrop-invert":["",qe,ke,ve]}],"backdrop-opacity":[{"backdrop-opacity":[qe,ke,ve]}],"backdrop-saturate":[{"backdrop-saturate":[qe,ke,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,ke,ve]}],"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",ke,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",ke,ve]}],ease:[{ease:["linear","initial",E,ke,ve]}],delay:[{delay:[qe,ke,ve]}],animate:[{animate:["none",_,ke,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,ve]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[ke,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"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:[so,ke,ve]}],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",ke,ve]}],"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",ke,ve]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[qe,fu,Li,tw]}],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"]}},LP=pP(jP);function Ae(...t){return LP(JS(t))}const zP=ZS("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 si({className:t,variant:e="default",asChild:n=!1,...r}){const o=n?QS:"span";return x.jsx(o,{"data-slot":"badge","data-variant":e,className:Ae(zP({variant:e}),t),...r})}const ax=ZS("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"}}),Le=C.forwardRef(({className:t,variant:e="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?QS:"button";return x.jsx(i,{ref:s,"data-slot":"button","data-variant":e,"data-size":n,className:Ae(ax({variant:e,size:n,className:t})),...o})});Le.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 i_=(...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 FP=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 $P=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 ow=t=>{const e=$P(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 rg={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 BP=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},VP=C.createContext({}),HP=()=>C.useContext(VP),UP=C.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},u)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:y=""}=HP()??{},v=r??h?Number(n??f)*24/Number(e??d):n??f;return C.createElement("svg",{ref:u,...rg,width:e??d??rg.width,height:e??d??rg.height,stroke:t??m,strokeWidth:v,className:i_("lucide",y,o),...!s&&!BP(l)&&{"aria-hidden":"true"},...l},[...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 Ce=(t,e)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(UP,{ref:s,iconNode:e,className:i_(`lucide-${FP(ow(t))}`,`lucide-${t}`,r),...o}));return n.displayName=ow(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 WP=[["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"}]],qP=Ce("at-sign",WP);/**
|
|
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 KP=[["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"}]],GP=Ce("bold",KP);/**
|
|
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 JP=[["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"}]],ZP=Ce("book-open",JP);/**
|
|
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 YP=[["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"}]],Rc=Ce("boxes",YP);/**
|
|
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 XP=[["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"}]],El=Ce("braces",XP);/**
|
|
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 QP=[["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"}]],ej=Ce("calendar-days",QP);/**
|
|
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 tj=[["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"}]],nj=Ce("calendar",tj);/**
|
|
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 rj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lx=Ce("check",rj);/**
|
|
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 oj=[["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"}]],sj=Ce("chef-hat",oj);/**
|
|
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 ij=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ux=Ce("chevron-down",ij);/**
|
|
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 aj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cx=Ce("chevron-right",aj);/**
|
|
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 lj=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],uj=Ce("chevrons-down-up",lj);/**
|
|
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 cj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],dj=Ce("chevron-up",cj);/**
|
|
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 fj=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],a_=Ce("chevrons-up-down",fj);/**
|
|
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 hj=[["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"}]],dx=Ce("circle-alert",hj);/**
|
|
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 pj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mj=Ce("circle-check",pj);/**
|
|
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 gj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],yj=Ce("code",gj);/**
|
|
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 xj=[["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"}]],vj=Ce("copy",xj);/**
|
|
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 bj=[["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"}]],kj=Ce("download",bj);/**
|
|
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 wj=[["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"}]],Cj=Ce("file-braces-corner",wj);/**
|
|
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 Sj=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Ej=Ce("file-braces",Sj);/**
|
|
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 _j=[["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"}]],Tj=Ce("file-cog",_j);/**
|
|
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 Aj=[["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"}]],Nj=Ce("file-stack",Aj);/**
|
|
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 Mj=[["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"}]],l_=Ce("file-text",Mj);/**
|
|
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 Dj=[["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"}]],u_=Ce("folder-git-2",Dj);/**
|
|
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 Rj=[["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"}]],fx=Ce("grip-vertical",Rj);/**
|
|
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 Oj=[["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"}]],Ij=Ce("hash",Oj);/**
|
|
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 Pj=[["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"}]],jj=Ce("heading-2",Pj);/**
|
|
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 Lj=[["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"}]],zj=Ce("heading-3",Lj);/**
|
|
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 Fj=[["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"}]],c_=Ce("image",Fj);/**
|
|
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 $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bj=Ce("info",$j);/**
|
|
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 Vj=[["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"}]],Hj=Ce("italic",Vj);/**
|
|
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 Uj=[["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"}]],Wj=Ce("key-round",Uj);/**
|
|
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 qj=[["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"}]],Kj=Ce("layout-grid",qj);/**
|
|
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 Gj=[["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"}]],d_=Ce("link-2",Gj);/**
|
|
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 Jj=[["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"}]],Zj=Ce("link",Jj);/**
|
|
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 Yj=[["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"}]],Xj=Ce("list-ordered",Yj);/**
|
|
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 Qj=[["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"}]],f_=Ce("list",Qj);/**
|
|
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 e9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ta=Ce("loader-circle",e9);/**
|
|
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 t9=[["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"}]],n9=Ce("newspaper",t9);/**
|
|
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 r9=[["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"}]],o9=Ce("octagon-x",r9);/**
|
|
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 s9=[["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"}]],i9=Ce("palette",s9);/**
|
|
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 a9=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],l9=Ce("pen-line",a9);/**
|
|
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 u9=[["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"}]],h_=Ce("pencil-ruler",u9);/**
|
|
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:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ii=Ce("plus",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 d9=[["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"}]],f9=Ce("quote",d9);/**
|
|
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 h9=[["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"}]],p9=Ce("redo-2",h9);/**
|
|
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 m9=[["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"}]],g9=Ce("refresh-cw",m9);/**
|
|
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 y9=[["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"}]],x9=Ce("rotate-ccw-clock",y9);/**
|
|
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 v9=[["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"}]],b9=Ce("rotate-ccw",v9);/**
|
|
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 k9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],w9=Ce("rows-3",k9);/**
|
|
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 C9=[["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"}]],S9=Ce("search-x",C9);/**
|
|
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 E9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],_9=Ce("search",E9);/**
|
|
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 T9=[["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"}]],A9=Ce("shopping-bag",T9);/**
|
|
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 N9=[["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"}]],Zu=Ce("sparkles",N9);/**
|
|
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 M9=[["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"}]],D9=Ce("tags",M9);/**
|
|
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 R9=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],O9=Ce("toggle-left",R9);/**
|
|
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 I9=[["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"}]],p_=Ce("trash-2",I9);/**
|
|
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 P9=[["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"}]],hx=Ce("triangle-alert",P9);/**
|
|
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 j9=[["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"}]],L9=Ce("type",j9);/**
|
|
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 z9=[["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"}]],F9=Ce("undo-2",z9);/**
|
|
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 $9=[["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"}]],m_=Ce("upload",$9);/**
|
|
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 B9=[["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"}]],V9=Ce("user",B9);/**
|
|
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 H9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ha=Ce("x",H9);function Oc({...t}){return x.jsx(RD,{"data-slot":"dialog",...t})}function U9({...t}){return x.jsx(ID,{"data-slot":"dialog-trigger",...t})}function W9({...t}){return x.jsx(jD,{"data-slot":"dialog-portal",...t})}function Sp({...t}){return x.jsx(Ly,{"data-slot":"dialog-close",...t})}function q9({className:t,...e}){return x.jsx(LD,{"data-slot":"dialog-overlay",className:Ae("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 Ic({className:t,children:e,showCloseButton:n=!0,...r}){return x.jsxs(W9,{children:[x.jsx(q9,{}),x.jsxs($D,{"data-slot":"dialog-content",className:Ae("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&&x.jsx(Ly,{"data-slot":"dialog-close",asChild:!0,children:x.jsxs(Le,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[x.jsx(ha,{}),x.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Pc({className:t,...e}){return x.jsx("div",{"data-slot":"dialog-header",className:Ae("flex flex-col gap-2",t),...e})}function Ep({className:t,showCloseButton:e=!1,children:n,...r}){return x.jsxs("div",{"data-slot":"dialog-footer",className:Ae("-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&&x.jsx(Ly,{asChild:!0,children:x.jsx(Le,{variant:"outline",children:"Close"})})]})}function jc({className:t,...e}){return x.jsx(UD,{"data-slot":"dialog-title",className:Ae("font-heading text-base leading-none font-medium",t),...e})}function Lc({className:t,...e}){return x.jsx(qD,{"data-slot":"dialog-description",className:Ae("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...e})}function g_({...t}){return x.jsx(NO,{"data-slot":"dropdown-menu",...t})}function y_({...t}){return x.jsx(MO,{"data-slot":"dropdown-menu-trigger",...t})}function x_({className:t,align:e="start",sideOffset:n=4,...r}){return x.jsx(DO,{children:x.jsx(RO,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:Ae("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 og({className:t,inset:e,variant:n="default",...r}){return x.jsx(IO,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Ae("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 v_({className:t,children:e,checked:n,inset:r,...o}){return x.jsxs(PO,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:Ae("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:[x.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:x.jsx(jO,{children:x.jsx(lx,{})})}),e]})}function T1({className:t,inset:e,...n}){return x.jsx(OO,{"data-slot":"dropdown-menu-label","data-inset":e,className:Ae("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",t),...n})}function xu({className:t,...e}){return x.jsx(LO,{"data-slot":"dropdown-menu-separator",className:Ae("-mx-1 my-1 h-px bg-border",t),...e})}function Qt({className:t,type:e,...n}){return x.jsx("input",{type:e,"data-slot":"input",className:Ae("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 vu({className:t,...e}){return x.jsx(BO,{"data-slot":"label",className:Ae("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 Yu({...t}){return x.jsx(QO,{"data-slot":"select",...t})}function Xu({...t}){return x.jsx(rI,{"data-slot":"select-value",...t})}function Qu({className:t,size:e="default",children:n,...r}){return x.jsxs(tI,{"data-slot":"select-trigger","data-size":e,className:Ae("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,x.jsx(oI,{asChild:!0,children:x.jsx(ux,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function ec({className:t,children:e,position:n="item-aligned",align:r="center",...o}){return x.jsx(lI,{children:x.jsxs(uI,{"data-slot":"select-content","data-align-trigger":n==="item-aligned",className:Ae("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:[x.jsx(K9,{}),x.jsx(mI,{"data-position":n,className:Ae("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}),x.jsx(G9,{})]})})}function tc({className:t,children:e,...n}){return x.jsxs(xI,{"data-slot":"select-item",className:Ae("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:[x.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:x.jsx(kI,{children:x.jsx(lx,{className:"pointer-events-none"})})}),x.jsx(vI,{children:e})]})}function K9({className:t,...e}){return x.jsx(wI,{"data-slot":"select-scroll-up-button",className:Ae("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:x.jsx(dj,{})})}function G9({className:t,...e}){return x.jsx(CI,{"data-slot":"select-scroll-down-button",className:Ae("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:x.jsx(ux,{})})}var J9=(t,e,n,r,o,s,i,l)=>{let u=document.documentElement,d=["light","dark"];function f(y){(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[y]?s[y]:y)):u.setAttribute(v,y)}),h(y)}function h(y){l&&d.includes(y)&&(u.style.colorScheme=y)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let y=localStorage.getItem(e)||n,v=i&&y==="system"?m():y;f(v)}catch{}},Z9=C.createContext(void 0),Y9={setTheme:t=>{},themes:[]},X9=()=>{var t;return(t=C.useContext(Z9))!=null?t:Y9};C.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:l,nonce:u,scriptProps:d})=>{let f=JSON.stringify([n,e,s,t,l,i,r,o]).slice(1,-1);return C.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${J9.toString()})(${f})`}})});function Q9(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 eL=t=>{switch(t){case"success":return rL;case"info":return sL;case"warning":return oL;case"error":return iL;default:return null}},tL=Array(12).fill(0),nL=({visible:t,className:e})=>ne.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ne.createElement("div",{className:"sonner-spinner"},tL.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rL=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"})),oL=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"})),sL=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"})),iL=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"})),lL=()=>{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 A1=1;class uL{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:A1++,i=this.toasts.find(u=>u.id===s),l=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:l,title:r}):u):this.addToast({title:r,...o,dismissible:l,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 l=o.then(async d=>{if(i=["resolve",d],ne.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(dL(d)&&!d.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,v=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...v})}else if(d instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...v})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,...v})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,y=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...y})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));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)||A1++;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 Yn=new uL,cL=(t,e)=>{const n=(e==null?void 0:e.id)||A1++;return Yn.addToast({title:t,...e,id:n}),n},dL=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",fL=cL,hL=()=>Yn.toasts,pL=()=>Yn.getActiveToasts(),Yt=Object.assign(fL,{success:Yn.success,info:Yn.info,warning:Yn.warning,error:Yn.error,custom:Yn.custom,message:Yn.message,promise:Yn.promise,dismiss:Yn.dismiss,loading:Yn.loading},{getHistory:hL,getToasts:pL});Q9("[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 gf(t){return t.label!==void 0}const mL=3,gL="24px",yL="16px",sw=4e3,xL=356,vL=14,bL=45,kL=200;function io(...t){return t.filter(Boolean).join(" ")}function wL(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const CL=t=>{var e,n,r,o,s,i,l,u,d;const{invert:f,toast:h,unstyled:m,interacting:y,setHeights:v,visibleToasts:b,heights:k,index:E,toasts:_,expanded:T,removeToast:N,defaultRichColors:M,closeButton:D,style:I,cancelButtonStyle:P,actionButtonStyle:O,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),[De,Q]=ne.useState(!1),[de,me]=ne.useState(!1),[Fe,Re]=ne.useState(!1),[Be,Ye]=ne.useState(0),[Nt,jt]=ne.useState(0),Ut=ne.useRef(h.duration||J||sw),$n=ne.useRef(null),Wt=ne.useRef(null),nn=E===0,Dn=E+1<=b,pt=h.type,pr=h.dismissible!==!1,bi=h.className||"",ga=h.descriptionClassName||"",Ao=ne.useMemo(()=>k.findIndex(Ne=>Ne.toastId===h.id)||0,[k,h.id]),mr=ne.useMemo(()=>{var Ne;return(Ne=h.closeButton)!=null?Ne:D},[h.closeButton,D]),Bn=ne.useMemo(()=>h.duration||J||sw,[h.duration,J]),gr=ne.useRef(0),Rn=ne.useRef(0),mn=ne.useRef(0),Or=ne.useRef(null),[ya,xa]=K.split("-"),fs=ne.useMemo(()=>k.reduce((Ne,it,tt)=>tt>=Ao?Ne:Ne+it.height,0),[k,Ao]),No=lL(),ki=h.invert||f,Yr=pt==="loading";Rn.current=ne.useMemo(()=>Ao*Y+fs,[Ao,fs]),ne.useEffect(()=>{Ut.current=Bn},[Bn]),ne.useEffect(()=>{he(!0)},[]),ne.useEffect(()=>{const Ne=Wt.current;if(Ne){const it=Ne.getBoundingClientRect().height;return jt(it),v(tt=>[{toastId:h.id,height:it,position:h.position},...tt]),()=>v(tt=>tt.filter(at=>at.toastId!==h.id))}},[v,h.id]),ne.useLayoutEffect(()=>{if(!re)return;const Ne=Wt.current,it=Ne.style.height;Ne.style.height="auto";const tt=Ne.getBoundingClientRect().height;Ne.style.height=it,jt(tt),v(at=>at.find(mt=>mt.toastId===h.id)?at.map(mt=>mt.toastId===h.id?{...mt,height:tt}:mt):[{toastId:h.id,height:tt,position:h.position},...at])},[re,h.title,h.description,v,h.id,h.jsx,h.action,h.cancel]);const Vn=ne.useCallback(()=>{pe(!0),Ye(Rn.current),v(Ne=>Ne.filter(it=>it.toastId!==h.id)),setTimeout(()=>{N(h)},kL)},[h,N,v,Rn]);ne.useEffect(()=>{if(h.promise&&pt==="loading"||h.duration===1/0||h.type==="loading")return;let Ne;return T||y||No?(()=>{if(mn.current<gr.current){const at=new Date().getTime()-gr.current;Ut.current=Ut.current-at}mn.current=new Date().getTime()})():(()=>{Ut.current!==1/0&&(gr.current=new Date().getTime(),Ne=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Vn()},Ut.current))})(),()=>clearTimeout(Ne)},[T,y,h,pt,No,Vn]),ne.useEffect(()=>{h.delete&&(Vn(),h.onDismiss==null||h.onDismiss.call(h,h))},[Vn,h.delete]);function wi(){var Ne;if(X!=null&&X.loading){var it;return ne.createElement("div",{className:io(G==null?void 0:G.loader,h==null||(it=h.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":pt==="loading"},X.loading)}return ne.createElement(nL,{className:io(G==null?void 0:G.loader,h==null||(Ne=h.classNames)==null?void 0:Ne.loader),visible:pt==="loading"})}const Xr=h.icon||(X==null?void 0:X[pt])||eL(pt);var gt,qt;return ne.createElement("li",{tabIndex:0,ref:Wt,className:io(W,bi,G==null?void 0:G.toast,h==null||(e=h.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[pt],h==null||(n=h.classNames)==null?void 0:n[pt]),"data-sonner-toast":"","data-rich-colors":(gt=h.richColors)!=null?gt:M,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":re,"data-promise":!!h.promise,"data-swiped":Fe,"data-removed":ce,"data-visible":Dn,"data-y-position":ya,"data-x-position":xa,"data-index":E,"data-front":nn,"data-swiping":De,"data-dismissible":pr,"data-type":pt,"data-invert":ki,"data-swipe-out":de,"data-swipe-direction":L,"data-expanded":!!(T||ee&&re),"data-testid":h.testId,style:{"--index":E,"--toasts-before":E,"--z-index":_.length-E,"--offset":`${ce?Be:Rn.current}px`,"--initial-height":ee?"auto":`${Nt}px`,...I,...h.style},onDragEnd:()=>{Q(!1),F(null),Or.current=null},onPointerDown:Ne=>{Ne.button!==2&&(Yr||!pr||($n.current=new Date,Ye(Rn.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(Q(!0),Or.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,it,tt;if(de||!pr)return;Or.current=null;const at=Number(((Ne=Wt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kt=Number(((it=Wt.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((tt=$n.current)==null?void 0:tt.getTime()),Je=te==="x"?at:Kt,gn=Math.abs(Je)/mt;if(Math.abs(Je)>=bL||gn>.11){Ye(Rn.current),h.onDismiss==null||h.onDismiss.call(h,h),V(te==="x"?at>0?"right":"left":Kt>0?"down":"up"),Vn(),me(!0);return}else{var ft,_t;(ft=Wt.current)==null||ft.style.setProperty("--swipe-amount-x","0px"),(_t=Wt.current)==null||_t.style.setProperty("--swipe-amount-y","0px")}Re(!1),Q(!1),F(null)},onPointerMove:Ne=>{var it,tt,at;if(!Or.current||!pr||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const mt=Ne.clientY-Or.current.y,Je=Ne.clientX-Or.current.x;var gn;const ft=(gn=t.swipeDirections)!=null?gn:wL(K);!te&&(Math.abs(Je)>1||Math.abs(mt)>1)&&F(Math.abs(Je)>Math.abs(mt)?"x":"y");let _t={x:0,y:0};const Hn=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)_t.y=mt;else{const rn=mt*Hn(mt);_t.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)_t.x=Je;else{const rn=Je*Hn(Je);_t.x=Math.abs(rn)<Math.abs(Je)?rn:Je}(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&Re(!0),(tt=Wt.current)==null||tt.style.setProperty("--swipe-amount-x",`${_t.x}px`),(at=Wt.current)==null||at.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},mr&&!h.jsx&&pt!=="loading"?ne.createElement("button",{"aria-label":q,"data-disabled":Yr,"data-close-button":!0,onClick:Yr||!pr?()=>{}:()=>{Vn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:io(G==null?void 0:G.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(qt=X==null?void 0:X.close)!=null?qt:aL):null,(pt||h.icon||h.promise)&&h.icon!==null&&((X==null?void 0:X[pt])!==null||h.icon)?ne.createElement("div",{"data-icon":"",className:io(G==null?void 0:G.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||wi():null,h.type!=="loading"?Xr:null):null,ne.createElement("div",{"data-content":"",className:io(G==null?void 0:G.content,h==null||(s=h.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:io(G==null?void 0:G.title,h==null||(i=h.classNames)==null?void 0:i.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ne.createElement("div",{"data-description":"",className:io(Z,ga,G==null?void 0:G.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),ne.isValidElement(h.cancel)?h.cancel:h.cancel&&gf(h.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:Ne=>{gf(h.cancel)&&pr&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ne),Vn())},className:io(G==null?void 0:G.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,ne.isValidElement(h.action)?h.action:h.action&&gf(h.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||O,onClick:Ne=>{gf(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ne),!Ne.defaultPrevented&&Vn())},className:io(G==null?void 0:G.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function iw(){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 SL(t,e){const n={};return[t,e].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",l=s?yL:gL;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=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}`]=l:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const EL=ne.forwardRef(function(e,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:h,theme:m="light",richColors:y,duration:v,style:b,visibleToasts:k=mL,toastOptions:E,dir:_=iw(),gap:T=vL,icons:N,containerAriaLabel:M="Notifications"}=e,[D,I]=ne.useState([]),P=ne.useMemo(()=>r?D.filter(re=>re.toasterId===r):D.filter(re=>!re.toasterId),[D,r]),O=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(m!=="system"?m: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=>{I(he=>{var ce;return(ce=he.find(pe=>pe.id===re.id))!=null&&ce.delete||Yn.dismiss(re.id),he.filter(({id:pe})=>pe!==re.id)})},[]);return ne.useEffect(()=>Yn.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{I(he=>he.map(ce=>ce.id===re.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{YS.flushSync(()=>{I(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]})})})}),[D]),ne.useEffect(()=>{if(m!=="system"){X(m);return}if(m==="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)}})}},[m]),ne.useEffect(()=>{D.length<=1&&K(!1)},[D]),ne.useEffect(()=>{const re=he=>{var ce;if(i.every(Q=>he[Q]||he.code===Q)){var De;K(!0),(De=q.current)==null||De.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":`${M} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((re,he)=>{var ce;const[pe,De]=re.split("-");return P.length?ne.createElement("ol",{key:re,dir:_==="auto"?iw():_,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":pe,"data-x-position":De,style:{"--front-toast-height":`${((ce=W[0])==null?void 0:ce.height)||0}px`,"--width":`${xL}px`,"--gap":`${T}px`,...b,...SL(f,h)},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(CL,{key:Q.id,icons:N,index:de,toast:Q,defaultRichColors:y,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(Re=>Re.position==Q.position),heights:W.filter(Re=>Re.position==Q.position),setHeights:Z,expandByDefault:l,gap:T,expanded:J,swipeDirections:e.swipeDirections})})):null}))}),_L=({...t})=>{const{theme:e="system"}=X9();return x.jsx(EL,{theme:e,className:"toaster group",icons:{success:x.jsx(mj,{className:"size-4"}),info:x.jsx(Bj,{className:"size-4"}),warning:x.jsx(hx,{className:"size-4"}),error:x.jsx(o9,{className:"size-4"}),loading:x.jsx(ta,{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 TL({className:t,...e}){return x.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:x.jsx("table",{"data-slot":"table",className:Ae("w-full caption-bottom text-sm",t),...e})})}function AL({className:t,...e}){return x.jsx("thead",{"data-slot":"table-header",className:Ae("[&_tr]:border-b",t),...e})}function NL({className:t,...e}){return x.jsx("tbody",{"data-slot":"table-body",className:Ae("[&_tr:last-child]:border-0",t),...e})}function sg({className:t,...e}){return x.jsx("tr",{"data-slot":"table-row",className:Ae("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function yf({className:t,...e}){return x.jsx("th",{"data-slot":"table-head",className:Ae("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",t),...e})}function Os({className:t,...e}){return x.jsx("td",{"data-slot":"table-cell",className:Ae("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t),...e})}function ML({delayDuration:t=0,...e}){return x.jsx(BI,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function px({...t}){return x.jsx(VI,{"data-slot":"tooltip",...t})}function mx({...t}){return x.jsx(HI,{"data-slot":"tooltip-trigger",...t})}function gx({className:t,sideOffset:e=0,children:n,...r}){return x.jsx(UI,{children:x.jsxs(WI,{"data-slot":"tooltip-content",sideOffset:e,className:Ae("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,x.jsx(qI,{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(l=>typeof o[o[l]]!="number"),i={};for(const l of s)i[l]=o[l];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 aw;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(aw||(aw={}));const Ee=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),js=t=>{switch(typeof t){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return Number.isNaN(t)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(t)?Ee.array:t===null?Ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ee.promise:typeof Map<"u"&&t instanceof Map?Ee.map:typeof Set<"u"&&t instanceof Set?Ee.set:typeof Date<"u"&&t instanceof Date?Ee.date:Ee.object;default:return Ee.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 ss 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 l=r,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(i))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof ss))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()}}ss.create=t=>new ss(t);const N1=(t,e)=>{let n;switch(t.code){case le.invalid_type:t.received===Ee.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 DL=N1;function RL(){return DL}const OL=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 l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(i,{data:e,defaultError:l}).message;return{...o,path:s,message:l}};function ye(t,e){const n=RL(),r=OL({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===N1?void 0:N1].filter(o=>!!o)});t.common.issues.push(r)}class cr{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 cr.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"}),bu=t=>({status:"dirty",value:t}),Rr=t=>({status:"valid",value:t}),lw=t=>t.status==="aborted",uw=t=>t.status==="dirty",ol=t=>t.status==="valid",th=t=>typeof Promise<"u"&&t instanceof Promise;var Te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Te||(Te={}));class ai{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 cw=(t,e)=>{if(ol(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 ss(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,l)=>{const{message:u}=t;return i.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:o}}class et{get description(){return this._def.description}_getType(e){return js(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:js(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cr,ctx:{common:e.parent.common,data:e.data,parsedType:js(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(th(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:js(e)},o=this._parseSync({data:e,path:r.path,parent:r});return cw(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:js(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return ol(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=>ol(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:js(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(th(o)?o:Promise.resolve(o));return cw(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),l=()=>s.addIssue({code:le.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(l(),!1)):i?!0:(l(),!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 il({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 Js.create(this,this._def)}nullable(){return al.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xo.create(this)}promise(){return sh.create(this,this._def)}or(e){return rh.create([this,e],this._def)}and(e){return oh.create(this,e,this._def)}transform(e){return new il({...Ge(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new I1({...Ge(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new n7({typeName:He.ZodBranded,type:this,...Ge(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new P1({...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 yx.create(this,e)}readonly(){return j1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const IL=/^c[^\s-]{8,}$/i,PL=/^[0-9a-z]+$/,jL=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LL=/^[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,zL=/^[a-z0-9_-]{21}$/i,FL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$L=/^[-+]?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)?)??$/,BL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ig;const HL=/^(?:(?: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])$/,UL=/^(?:(?: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])$/,WL=/^(([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]))$/,qL=/^(([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])$/,KL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,b_="((\\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])))",JL=new RegExp(`^${b_}$`);function k_(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 ZL(t){return new RegExp(`^${k_(t)}$`)}function YL(t){let e=`${b_}T${k_(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 XL(t,e){return!!((e==="v4"||!e)&&HL.test(t)||(e==="v6"||!e)&&WL.test(t))}function QL(t,e){if(!FL.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 e7(t,e){return!!((e==="v4"||!e)&&UL.test(t)||(e==="v6"||!e)&&qL.test(t))}class Us extends et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ee.string){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.string,received:s.parsedType}),Ve}const r=new cr;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),ye(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),ye(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,l=e.data.length<s.value;(i||l)&&(o=this._getOrReturnCtx(e,o),i?ye(o,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&ye(o,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")BL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"email",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")ig||(ig=new RegExp(VL,"u")),ig.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"emoji",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")LL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"uuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")zL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"nanoid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")IL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")PL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cuid2",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")jL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(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),ye(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),ye(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),ye(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),ye(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),ye(o,{code:le.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?YL(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?JL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?ZL(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?$L.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"duration",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?XL(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"ip",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?QL(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"jwt",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?e7(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cidr",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?KL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"base64",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?GL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(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,...Te.errToObj(r)})}_addCheck(e){return new Us({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Te.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Te.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Te.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Te.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Te.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Te.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,...Te.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,...Te.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Te.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Te.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Te.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Te.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Te.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Te.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Te.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Te.errToObj(n)})}nonempty(e){return this.min(1,Te.errToObj(e))}trim(){return new Us({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Us({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Us({...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}}Us.create=t=>new Us({checks:[],typeName:He.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});function t7(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 nc 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)!==Ee.number){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.number,received:s.parsedType}),Ve}let r;const o=new cr;for(const s of this._def.checks)s.kind==="int"?rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ye(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),ye(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),ye(r,{code:le.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?t7(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ye(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),ye(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,Te.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Te.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Te.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Te.toString(n))}setLimit(e,n,r,o){return new nc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Te.toString(o)}]})}_addCheck(e){return new nc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Te.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Te.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Te.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)}}nc.create=t=>new nc({checks:[],typeName:He.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class rc 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)!==Ee.bigint)return this._getInvalidInput(e);let r;const o=new cr;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),ye(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),ye(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),ye(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 ye(n,{code:le.invalid_type,expected:Ee.bigint,received:n.parsedType}),Ve}gte(e,n){return this.setLimit("min",e,!0,Te.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Te.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Te.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Te.toString(n))}setLimit(e,n,r,o){return new rc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Te.toString(o)}]})}_addCheck(e){return new rc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Te.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}}rc.create=t=>new rc({checks:[],typeName:He.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});class M1 extends et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ee.boolean){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.boolean,received:r.parsedType}),Ve}return Rr(e.data)}}M1.create=t=>new M1({typeName:He.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class nh extends et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ee.date){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.date,received:s.parsedType}),Ve}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_date}),Ve}const r=new cr;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),ye(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),ye(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 nh({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Te.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Te.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}}nh.create=t=>new nh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:He.ZodDate,...Ge(t)});class dw extends et{_parse(e){if(this._getType(e)!==Ee.symbol){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.symbol,received:r.parsedType}),Ve}return Rr(e.data)}}dw.create=t=>new dw({typeName:He.ZodSymbol,...Ge(t)});class fw extends et{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.undefined,received:r.parsedType}),Ve}return Rr(e.data)}}fw.create=t=>new fw({typeName:He.ZodUndefined,...Ge(t)});class hw extends et{_parse(e){if(this._getType(e)!==Ee.null){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.null,received:r.parsedType}),Ve}return Rr(e.data)}}hw.create=t=>new hw({typeName:He.ZodNull,...Ge(t)});class pw extends et{constructor(){super(...arguments),this._any=!0}_parse(e){return Rr(e.data)}}pw.create=t=>new pw({typeName:He.ZodAny,...Ge(t)});class mw extends et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rr(e.data)}}mw.create=t=>new mw({typeName:He.ZodUnknown,...Ge(t)});class li extends et{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:le.invalid_type,expected:Ee.never,received:n.parsedType}),Ve}}li.create=t=>new li({typeName:He.ZodNever,...Ge(t)});class gw extends et{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.void,received:r.parsedType}),Ve}return Rr(e.data)}}gw.create=t=>new gw({typeName:He.ZodVoid,...Ge(t)});class xo extends et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Ee.array)return ye(n,{code:le.invalid_type,expected:Ee.array,received:n.parsedType}),Ve;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,l=n.data.length<o.exactLength.value;(i||l)&&(ye(n,{code:i?le.too_big:le.too_small,minimum:l?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&&(ye(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&&(ye(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,l)=>o.type._parseAsync(new ai(n,i,n.path,l)))).then(i=>cr.mergeArray(r,i));const s=[...n.data].map((i,l)=>o.type._parseSync(new ai(n,i,n.path,l)));return cr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new xo({...this._def,minLength:{value:e,message:Te.toString(n)}})}max(e,n){return new xo({...this._def,maxLength:{value:e,message:Te.toString(n)}})}length(e,n){return new xo({...this._def,exactLength:{value:e,message:Te.toString(n)}})}nonempty(e){return this.min(1,e)}}xo.create=(t,e)=>new xo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Ge(e)});function Ka(t){if(t instanceof Ft){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Js.create(Ka(r))}return new Ft({...t._def,shape:()=>e})}else return t instanceof xo?new xo({...t._def,type:Ka(t.element)}):t instanceof Js?Js.create(Ka(t.unwrap())):t instanceof al?al.create(Ka(t.unwrap())):t instanceof na?na.create(t.items.map(e=>Ka(e))):t}class Ft 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)!==Ee.object){const d=this._getOrReturnCtx(e);return ye(d,{code:le.invalid_type,expected:Ee.object,received:d.parsedType}),Ve}const{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof li&&this._def.unknownKeys==="strip"))for(const d in o.data)i.includes(d)||l.push(d);const u=[];for(const d of i){const f=s[d],h=o.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new ai(o,h,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof li){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")l.length>0&&(ye(o,{code:le.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const h=o.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new ai(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>cr.mergeObjectSync(r,d)):cr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Te.errToObj,new Ft({...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:Te.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Ft({...this._def,unknownKeys:"strip"})}passthrough(){return new Ft({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ft({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ft({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ft({...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 Ft({...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 Ft({...this._def,shape:()=>n})}deepPartial(){return Ka(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 Ft({...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 Js;)s=s._def.innerType;n[r]=s}return new Ft({...this._def,shape:()=>n})}keyof(){return w_(rt.objectKeys(this.shape))}}Ft.create=(t,e)=>new Ft({shape:()=>t,unknownKeys:"strip",catchall:li.create(),typeName:He.ZodObject,...Ge(e)});Ft.strictCreate=(t,e)=>new Ft({shape:()=>t,unknownKeys:"strict",catchall:li.create(),typeName:He.ZodObject,...Ge(e)});Ft.lazycreate=(t,e)=>new Ft({shape:t,unknownKeys:"strip",catchall:li.create(),typeName:He.ZodObject,...Ge(e)});class rh extends et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const i=s.map(l=>new ss(l.ctx.common.issues));return ye(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},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,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 l=i.map(u=>new ss(u));return ye(n,{code:le.invalid_union,unionErrors:l}),Ve}}get options(){return this._def.options}}rh.create=(t,e)=>new rh({options:t,typeName:He.ZodUnion,...Ge(e)});function D1(t,e){const n=js(t),r=js(e);if(t===e)return{valid:!0,data:t};if(n===Ee.object&&r===Ee.object){const o=rt.objectKeys(e),s=rt.objectKeys(t).filter(l=>o.indexOf(l)!==-1),i={...t,...e};for(const l of s){const u=D1(t[l],e[l]);if(!u.valid)return{valid:!1};i[l]=u.data}return{valid:!0,data:i}}else if(n===Ee.array&&r===Ee.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let s=0;s<t.length;s++){const i=t[s],l=e[s],u=D1(i,l);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===Ee.date&&r===Ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oh extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(lw(s)||lw(i))return Ve;const l=D1(s.value,i.value);return l.valid?((uw(s)||uw(i))&&n.dirty(),{status:n.value,value:l.data}):(ye(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}))}}oh.create=(t,e,n)=>new oh({left:t,right:e,typeName:He.ZodIntersection,...Ge(n)});class na extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.array)return ye(r,{code:le.invalid_type,expected:Ee.array,received:r.parsedType}),Ve;if(r.data.length<this._def.items.length)return ye(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&&(ye(r,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new ai(r,i,r.path,l)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>cr.mergeArray(n,i)):cr.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new na({...this._def,rest:e})}}na.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new na({items:t,typeName:He.ZodTuple,rest:null,...Ge(e)})};class yw 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!==Ee.map)return ye(r,{code:le.invalid_type,expected:Ee.map,received:r.parsedType}),Ve;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([l,u],d)=>({key:o._parse(new ai(r,l,r.path,[d,"key"])),value:s._parse(new ai(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return Ve;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of i){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return Ve;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}yw.create=(t,e,n)=>new yw({valueType:e,keyType:t,typeName:He.ZodMap,...Ge(n)});class oc extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.set)return ye(r,{code:le.invalid_type,expected:Ee.set,received:r.parsedType}),Ve;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ye(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&&(ye(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 f of u){if(f.status==="aborted")return Ve;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>s._parse(new ai(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>i(u)):i(l)}min(e,n){return new oc({...this._def,minSize:{value:e,message:Te.toString(n)}})}max(e,n){return new oc({...this._def,maxSize:{value:e,message:Te.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}oc.create=(t,e)=>new oc({valueType:t,minSize:null,maxSize:null,typeName:He.ZodSet,...Ge(e)});class R1 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})}}R1.create=(t,e)=>new R1({getter:t,typeName:He.ZodLazy,...Ge(e)});class O1 extends et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(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}}O1.create=(t,e)=>new O1({value:t,typeName:He.ZodLiteral,...Ge(e)});function w_(t,e){return new sl({values:t,typeName:He.ZodEnum,...Ge(e)})}class sl extends et{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(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 ye(n,{received:n.data,code:le.invalid_enum_value,options:r}),Ve}return Rr(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 sl.create(e,{...this._def,...n})}exclude(e,n=this._def){return sl.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}sl.create=w_;class xw extends et{_parse(e){const n=rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ee.string&&r.parsedType!==Ee.number){const o=rt.objectValues(n);return ye(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 ye(r,{received:r.data,code:le.invalid_enum_value,options:o}),Ve}return Rr(e.data)}get enum(){return this._def.values}}xw.create=(t,e)=>new xw({values:t,typeName:He.ZodNativeEnum,...Ge(e)});class sh extends et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ee.promise&&n.common.async===!1)return ye(n,{code:le.invalid_type,expected:Ee.promise,received:n.parsedType}),Ve;const r=n.parsedType===Ee.promise?n.data:Promise.resolve(n.data);return Rr(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}sh.create=(t,e)=>new sh({type:t,typeName:He.ZodPromise,...Ge(e)});class il 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=>{ye(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 l=>{if(n.value==="aborted")return Ve;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?Ve:u.status==="dirty"||n.value==="dirty"?bu(u.value):u});{if(n.value==="aborted")return Ve;const l=this._def.schema._parseSync({data:i,path:r.path,parent:r});return l.status==="aborted"?Ve:l.status==="dirty"||n.value==="dirty"?bu(l.value):l}}if(o.type==="refinement"){const i=l=>{const u=o.refinement(l,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 l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Ve:(l.status==="dirty"&&n.dirty(),i(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Ve:(l.status==="dirty"&&n.dirty(),i(l.value).then(()=>({status:n.value,value:l.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(!ol(i))return Ve;const l=o.transform(i.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ol(i)?Promise.resolve(o.transform(i.value,s)).then(l=>({status:n.value,value:l})):Ve);rt.assertNever(o)}}il.create=(t,e,n)=>new il({schema:t,typeName:He.ZodEffects,effect:e,...Ge(n)});il.createWithPreprocess=(t,e,n)=>new il({schema:e,effect:{type:"preprocess",transform:t},typeName:He.ZodEffects,...Ge(n)});class Js extends et{_parse(e){return this._getType(e)===Ee.undefined?Rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Js.create=(t,e)=>new Js({innerType:t,typeName:He.ZodOptional,...Ge(e)});class al extends et{_parse(e){return this._getType(e)===Ee.null?Rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}al.create=(t,e)=>new al({innerType:t,typeName:He.ZodNullable,...Ge(e)});class I1 extends et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ee.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}I1.create=(t,e)=>new I1({innerType:t,typeName:He.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ge(e)});class P1 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 th(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ss(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ss(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}P1.create=(t,e)=>new P1({innerType:t,typeName:He.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ge(e)});class vw extends et{_parse(e){if(this._getType(e)!==Ee.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.nan,received:r.parsedType}),Ve}return{status:"valid",value:e.data}}}vw.create=t=>new vw({typeName:He.ZodNaN,...Ge(t)});class n7 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 yx 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(),bu(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 yx({in:e,out:n,typeName:He.ZodPipeline})}}class j1 extends et{_parse(e){const n=this._def.innerType._parse(e),r=o=>(ol(o)&&(o.value=Object.freeze(o.value)),o);return th(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}j1.create=(t,e)=>new j1({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 po=Us.create,r7=M1.create;li.create;const ll=xo.create,_p=Ft.create;rh.create;oh.create;na.create;const o7=R1.create,s7=O1.create,i7=sl.create;sh.create;Js.create;al.create;var a7=["text","richtext","number","boolean","date","select","relation","image","url","email","list","color","group"],xx=o7(()=>_p({key:po().min(1),label:po().optional(),type:i7(a7),required:r7().optional(),options:ll(po()).optional(),to:po().optional(),fields:ll(xx).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"})})),l7=_p({name:po().min(1),label:po().optional(),path:po().min(1),fields:ll(xx)}),u7=_p({name:po().min(1),label:po().optional(),path:po().min(1),fields:ll(xx)});_p({version:s7(1),collections:ll(l7),singletons:ll(u7)}).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 l=new Set;for(const u of i.fields)l.has(u.key)&&e.addIssue({code:le.custom,message:`duplicate field key: ${u.key}`}),l.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 c7={ç:"c",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"c",Ğ:"g",İ:"i",Ö:"o",Ş:"s",Ü:"u",I:"i"};function Tp(t){return t.replace(/[çğıöşüÇĞİÖŞÜI]/g,r=>c7[r]??r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"content"}var C_="_status";function bw(t){return t[C_]==="draft"?"draft":"published"}function d7(t){return t==null||t===""}var f7=/^[a-z][a-z0-9+.-]*:\/\/.+/i,h7=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,p7=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function m7(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":f7.test(e)?null:"expected a valid URL";case"email":return typeof e!="string"?"expected text":h7.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 S_(t,e){const n=[],r=new Set(t.map(o=>o.key));for(const o of t){const s=e[o.key];if(d7(s)){o.required&&n.push({key:o.key,level:"warning",kind:"required",message:"required field is empty"});continue}const i=m7(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 ag={exports:{}},lg={};/**
|
|
436
|
-
* @license React
|
|
437
|
-
* use-sync-external-store-shim.production.js
|
|
438
|
-
*
|
|
439
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
440
|
-
*
|
|
441
|
-
* This source code is licensed under the MIT license found in the
|
|
442
|
-
* LICENSE file in the root directory of this source tree.
|
|
443
|
-
*/var kw;function g7(){if(kw)return lg;kw=1;var t=_c();function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function l(h,m){var y=m(),v=r({inst:{value:y,getSnapshot:m}}),b=v[0].inst,k=v[1];return s(function(){b.value=y,b.getSnapshot=m,u(b)&&k({inst:b})},[h,y,m]),o(function(){return u(b)&&k({inst:b}),h(function(){u(b)&&k({inst:b})})},[h]),i(y),y}function u(h){var m=h.getSnapshot;h=h.value;try{var y=m();return!n(h,y)}catch{return!0}}function d(h,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return lg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,lg}var ww;function E_(){return ww||(ww=1,ag.exports=g7()),ag.exports}var __=E_();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 T_(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,l=s.text,u=0;for(;i[u]==l[u];u++)n++;return u&&u<i.length&&u<l.length&&M_(i.charCodeAt(u-1))&&N_(i.charCodeAt(u))&&n--,n}if(o.content.size||s.content.size){let i=T_(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function A_(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),l=e.child(--s),u=i.nodeSize;if(i==l){n-=u,r-=u;continue}if(!i.sameMarkup(l))return{a:n,b:r};if(i.isText&&i.text!=l.text){let d=i.text,f=l.text,h=d.length,m=f.length;for(;h>0&&m>0&&d[h-1]==f[m-1];)h--,m--,n--,r--;return h&&m&&h<d.length&&M_(d.charCodeAt(h-1))&&N_(d.charCodeAt(h))&&(n++,r++),{a:n,b:r}}if(i.content.size||l.content.size){let d=A_(i.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}function N_(t){return t>=56320&&t<57344}function M_(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,l=0;l<n;i++){let u=this.content[i],d=l+u.nodeSize;if(d>e&&r(u,o+l,s||null,i)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,o+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.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 l=this.content[s],u=i+l.nodeSize;u>e&&((i<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,n-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,n-i-1))),r.push(l),o+=l.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 T_(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return A_(this,e,n,r)}findIndex(e){if(e==0)return xf(0,e);if(e==this.size)return xf(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?xf(n+1,s):xf(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 ug={index:0,offset:0};function xf(t,e){return ug.index=t,ug.offset=e,ug}function ih(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(!ih(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ih(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ut=class L1{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&&ih(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 L1.none;if(e instanceof L1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ut.none=[];class sc extends Error{}class xe{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=R_(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new xe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new xe(D_(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 xe.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 xe(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 xe(e,r,o)}}xe.empty=new xe(oe.empty,0,0);function D_(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:l}=t.findIndex(n);if(o==e||s.isText){if(l!=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(D_(s.content,e-o-1,n-o-1)))}function R_(t,e,n,r,o,s){let{index:i,offset:l}=t.findIndex(e),u=t.maybeChild(i);if(l==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=R_(u.content,e-l-1,n,i==0?r-1:0,i==t.childCount-1?o-1:0,u);return d&&t.replaceChild(i,u.copy(d))}function y7(t,e,n){if(n.openStart>t.depth)throw new sc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sc("Inconsistent open depths");return O_(t,e,n,0)}function O_(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=O_(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,l=i.content;return Ki(i,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=x7(n,t);return Ki(s,P_(t,i,l,e,r))}else return Ki(s,ah(t,e,r))}function I_(t,e){if(!e.type.compatibleContent(t.type))throw new sc("Cannot join "+e.type.name+" onto "+t.type.name)}function z1(t,e,n){let r=t.node(n);return I_(r,e.node(n)),r}function qi(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 Tu(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&&(qi(t.nodeAfter,r),s++));for(let l=s;l<i;l++)qi(o.child(l),r);e&&e.depth==n&&e.textOffset&&qi(e.nodeBefore,r)}function Ki(t,e){if(!t.type.validContent(e))throw new sc("Invalid content for node "+t.type.name);return t.copy(e)}function P_(t,e,n,r,o){let s=t.depth>o&&z1(t,e,o+1),i=r.depth>o&&z1(n,r,o+1),l=[];return Tu(null,t,o,l),s&&i&&e.index(o)==n.index(o)?(I_(s,i),qi(Ki(s,P_(t,e,n,r,o+1)),l)):(s&&qi(Ki(s,ah(t,e,o+1)),l),Tu(e,n,o,l),i&&qi(Ki(i,ah(n,r,o+1)),l)),Tu(r,null,o,l),new oe(l)}function ah(t,e,n){let r=[];if(Tu(null,t,n,r),t.depth>n){let o=z1(t,e,n+1);qi(Ki(o,ah(t,e,n+1)),r)}return Tu(e,null,n,r),new oe(r)}function x7(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 ic{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 l=r;r=o,o=l}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 lh(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:l,offset:u}=i.content.findIndex(s),d=s-u;if(r.push(i,l,o+u),!d||(i=i.child(l),i.isText))break;s=d-1,o+=u+1}return new ic(n,r,s)}static resolveCached(e,n){let r=Cw.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 Cw.set(e,r=new v7);let o=r.elts[r.i]=ic.resolve(e,n);return r.i=(r.i+1)%b7,o}}class v7{constructor(){this.elts=[],this.i=0}}const b7=12,Cw=new WeakMap;class lh{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 k7=Object.create(null);let Zs=class F1{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&&ih(this.attrs,n||e.defaultAttrs||k7)&&ut.sameSet(this.marks,r||ut.none)}copy(e=null){return e==this.content?this:new F1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new F1(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 xe.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),l=o.start(i),d=o.node(i).content.cut(o.pos-l,s.pos-l);return new xe(d,o.depth-i,s.depth-i)}replace(e,n,r){return y7(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 ic.resolveCached(this,e)}resolveNoCache(e){return ic.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()+")"),j_(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),l=i&&i.matchFragment(this.content,n);if(!l||!l.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}};Zs.prototype.text=void 0;class uh extends Zs{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):j_(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 uh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new uh(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 j_(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ra{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new w7(e,n);if(r.next==null)return ra.empty;let o=L_(r);r.next&&r.err("Unexpected trailing text");let s=N7(A7(o));return M7(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,l){let u=i.matchFragment(e,r);if(u&&(!n||u.validEnd))return oe.from(l.map(d=>d.createAndFill()));for(let d=0;d<i.next.length;d++){let{type:f,next:h}=i.next[d];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(h)==-1){o.push(h);let m=s(h,l.concat(f));if(m)return m}}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 l=o;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:l,next:u}=s.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.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(`
|
|
444
|
-
`)}}ra.empty=new ra(!0);class w7{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 L_(t){let e=[];do e.push(C7(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function C7(t){let e=[];do e.push(S7(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function S7(t){let e=T7(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=E7(t,e);else break;return e}function Sw(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function E7(t,e){let n=Sw(t),r=n;return t.eat(",")&&(t.next!="}"?r=Sw(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _7(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 T7(t){if(t.eat("(")){let e=L_(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=_7(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 A7(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,l,u){let d={term:u,to:l};return e[i].push(d),d}function o(i,l){i.forEach(u=>u.to=l)}function s(i,l){if(i.type=="choice")return i.exprs.reduce((u,d)=>u.concat(s(d,l)),[]);if(i.type=="seq")for(let u=0;;u++){let d=s(i.exprs[u],l);if(u==i.exprs.length-1)return d;o(d,l=n())}else if(i.type=="star"){let u=n();return r(l,u),o(s(i.expr,u),u),[r(u)]}else if(i.type=="plus"){let u=n();return o(s(i.expr,l),u),o(s(i.expr,u),u),[r(u)]}else{if(i.type=="opt")return[r(l)].concat(s(i.expr,l));if(i.type=="range"){let u=l;for(let d=0;d<i.min;d++){let f=n();o(s(i.expr,u),f),u=f}if(i.max==-1)o(s(i.expr,u),u);else for(let d=i.min;d<i.max;d++){let f=n();r(u,f),o(s(i.expr,u),f),u=f}return[r(u)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function z_(t,e){return e-t}function Ew(t,e){let n=[];return r(e),n.sort(z_);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:l,to:u}=s[i];!l&&n.indexOf(u)==-1&&r(u)}}}function N7(t){let e=Object.create(null);return n(Ew(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f<o.length;f++)o[f][0]==l&&(d=o[f][1]);Ew(t,u).forEach(f=>{d||o.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let s=e[r.join(",")]=new ra(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let l=o[i][1].sort(z_);s.next.push({type:o[i][0],next:e[l.join(",")]||n(l)})}return s}}function M7(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let l=0;l<o.next.length;l++){let{type:u,next:d}=o.next[l];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 F_(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 $_(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 B_(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 V_(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new R7(t,r,e[r]);return n}let _w=class H_{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=V_(e,r.attrs),this.defaultAttrs=F_(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==ra.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:$_(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zs(this,this.computeAttrs(e),oe.from(n),ut.setFrom(r))}createChecked(e=null,n,r){return n=oe.from(n),this.checkContent(n),new Zs(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 Zs(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){B_(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 H_(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 D7(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 R7{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?D7(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ap{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=V_(e,o.attrs),this.excluded=null;let s=F_(this.attrs);this.instance=s?new ut(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ut(this,$_(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new Ap(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){B_(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class vx{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=_w.compile(this.spec.nodes,this),this.marks=Ap.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||"",l=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=ra.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=l=="_"?null:l?Tw(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Tw(this,i.split(" "))}this.nodeFromJSON=o=>Zs.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 _w){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 uh(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 Tw(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 l in t.marks){let u=t.marks[l];(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 O7(t){return t.tag!=null}function I7(t){return t.style!=null}class Qo{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(O7(o))this.tags.push(o);else if(I7(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 Nw(this,n,!1);return r.addAll(e,ut.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Nw(this,n,!0);return r.addAll(e,ut.none,n.from,n.to),xe.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(L7(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],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.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 l=n[i];if((l.priority==null?50:l.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=Mw(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=Mw(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qo(e,Qo.schemaRules(e)))}}const U_={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},P7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W_={ol:!0,ul:!0},ac=1,$1=2,Au=4;function Aw(t,e,n){return e!=null?(e?ac:0)|(e==="full"?$1:0):t&&t.whitespace=="pre"?ac|$1:n&~Au}class vf{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&Au?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&ac)){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&&!U_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Nw{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=Aw(null,n.preserveWhitespace,0)|(r?Au:0);o?s=new vf(o.type,o.attrs,ut.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new vf(null,null,ut.none,!0,null,i):s=new vf(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&$1?"full":this.localPreserveWS||(o.options&ac)>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,`
|
|
445
|
-
`);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(i.linebreakReplacement.create(),n,!0),l[u]&&this.insertNode(i.text(l[u]),n,!/\S/.test(l[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 l=o.content[o.content.length-1],u=e.previousSibling;(!l||u&&u.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.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(),l;W_.hasOwnProperty(i)&&this.parser.normalizeLists&&j7(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:P7.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,f=this.needsBlock;if(U_.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 h=u&&u.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),d&&this.sync(s),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
446
|
-
`),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 l=void 0;;){let u=this.parser.matchStyle(s,i,this,l);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)l=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 l=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(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];i!=l;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,l=0;i>=0;i--){let u=this.nodes[i],d=u.findWrapping(e);if(d&&(!o||o.length>d.length+l)&&(o=d,s=u,!d.length))break;if(u.solid){if(r)break;l+=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 l of o.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):Dw(l.type,e.type))&&(i=l.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 l=Aw(e,s,i.options);i.options&Au&&i.content.length==0&&(l|=Au);let u=ut.none;return r=r.filter(d=>(i.type?i.type.allowsMarkType(d.type):Dw(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new vf(e,n,u,o,null,l)),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|=ac)}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=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(i(l-1,u))return!0;return!1}else{let f=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!f||f.name!=d&&!f.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 j7(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&W_.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function L7(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Mw(t){let e={};for(let n in t)e[n]=t[n];return e}function Dw(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:f}=l.edge(u);if(d==e||s.indexOf(f)<0&&i(f))return!0}};if(i(o.contentMatch))return!0}}class pa{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=bf(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let l=0,u=0;for(;l<s.length&&u<i.marks.length;){let d=i.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)o=s.pop()[1];for(;u<i.marks.length;){let d=i.marks[u++],f=this.serializeMark(d,i.isInline,n);f&&(s.push([d,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return bf(n).createTextNode(e.text);let{dom:r,contentDOM:o}=Vf(bf(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&&Vf(bf(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return typeof n=="string"?{dom:e.createTextNode(n)}:Vf(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pa(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Rw(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Rw(e.marks)}}function Rw(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function bf(t){return t.document||window.document}const Ow=new WeakMap;function z7(t){let e=Ow.get(t);return e===void 0&&Ow.set(t,e=F7(t)),e}function F7(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 Vf(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=z7(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 l,u=n?t.createElementNS(n,o):t.createElement(o),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):h=="style"&&u.style?u.style.cssText=d[h]:u.setAttribute(h,d[h])}}for(let h=f;h<e.length;h++){let m=e[h];if(m===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else if(typeof m=="string")u.appendChild(t.createTextNode(m));else{let{dom:y,contentDOM:v}=Vf(t,m,n,r);if(u.appendChild(y),v){if(l)throw new RangeError("Multiple content holes");l=v}}}return{dom:u,contentDOM:l}}const q_=65535,K_=Math.pow(2,16);function $7(t,e){return t+e*K_}function Iw(t){return t&q_}function B7(t){return(t-(t&q_))/K_}const G_=1,J_=2,Hf=4,Z_=8;class B1{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Z_)>0}get deletedBefore(){return(this.delInfo&(G_|Hf))>0}get deletedAfter(){return(this.delInfo&(J_|Hf))>0}get deletedAcross(){return(this.delInfo&Hf)>0}}class lr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&lr.empty)return lr.empty}recover(e){let n=0,r=Iw(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+B7(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 l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?o:0);if(u>e)break;let d=this.ranges[l+s],f=this.ranges[l+i],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,y=u+o+(m<0?0:f);if(r)return y;let v=e==(n<0?u:h)?null:$7(l/3,e-u),b=e==u?J_:e==h?G_:Hf;return(n<0?e!=u:e!=h)&&(b|=Z_),new B1(y,b,v)}o+=f-d}return r?e+o:new B1(e+o,0,null)}touches(e,n){let r=0,o=Iw(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[l+s],f=u+d;if(e<=f&&l==o*3)return!0;r+=this.ranges[l+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],l=i-(this.inverted?s:0),u=i+(this.inverted?0:s),d=this.ranges[o+n],f=this.ranges[o+r];e(l,l+d,u,u+f),s+=f-d}}invert(){return new lr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?lr.empty:new lr(e<0?[0,-e,0]:[0,0,e])}}lr.empty=new lr([]);class lc{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 lc(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 lc;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],l=i.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new B1(e,o,null)}}const cg=Object.create(null);class Mn{getMap(){return lr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=cg[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 cg)throw new RangeError("Duplicate use of step JSON ID "+e);return cg[e]=n,n.prototype.jsonID=e,n}}class Bt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Bt(e,null)}static fail(e){return new Bt(null,e)}static fromReplace(e,n,r,o){try{return Bt.ok(e.replace(n,r,o))}catch(s){if(s instanceof sc)return Bt.fail(s.message);throw s}}}function bx(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(bx(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return oe.fromArray(r)}class Ws extends Mn{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 xe(bx(n.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Bt.fromReplace(e,this.from,this.to,s)}invert(){return new Ur(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 Ws(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ws&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ws(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 Ws(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("addMark",Ws);class Ur extends Mn{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 xe(bx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Bt.fromReplace(e,this.from,this.to,r)}invert(){return new Ws(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 Ur(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ur&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ur(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 Ur(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("removeMark",Ur);class qs extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Bt.fromReplace(e,this.pos,this.pos+1,new xe(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 qs(this.pos,n.marks[o]);return new qs(this.pos,this.mark)}}return new oa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qs(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 qs(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("addNodeMark",qs);class oa extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Bt.fromReplace(e,this.pos,this.pos+1,new xe(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 qs(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new oa(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 oa(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("removeNodeMark",oa);class $t extends Mn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&V1(e,this.from,this.to)?Bt.fail("Structure replace would overwrite content"):Bt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new lr([this.from,this.to-this.from,this.slice.size])}invert(e){return new $t(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&&$t.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new $t(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof $t)||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?xe.empty:new xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $t(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?xe.empty:new xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $t(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 $t(n.from,n.to,xe.fromJSON(e,n.slice),!!n.structure)}}$t.MAP_BIAS=1;Mn.jsonID("replace",$t);class hn extends Mn{constructor(e,n,r,o,s,i,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=l}apply(e){if(this.structure&&(V1(e,this.from,this.gapFrom)||V1(e,this.gapTo,this.to)))return Bt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Bt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Bt.fromReplace(e,this.from,this.to,r):Bt.fail("Content does not fit in gap")}getMap(){return new lr([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,xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mn.jsonID("replaceAround",hn);function V1(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 V7(t,e,n,r){let o=[],s=[],i,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),y=Math.min(d+u.nodeSize,n),v=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(v)||(i&&i.to==m&&i.mark.eq(h[b])?i.to=y:o.push(i=new Ur(m,y,h[b])));l&&l.to==m?l.to=y:s.push(l=new Ws(m,y,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function H7(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,l)=>{if(!i.isInline)return;s++;let u=null;if(r instanceof Ap){let d=i.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(i.marks)&&(u=[r]):u=i.marks;if(u&&u.length){let d=Math.min(l+i.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let y=0;y<o.length;y++){let v=o[y];v.step==s-1&&h.eq(o[y].style)&&(m=v)}m?(m.to=d,m.step=s):o.push({style:h,from:Math.max(l,e),to:d,step:s})}}}),o.forEach(i=>t.step(new Ur(i.from,i.to,i.style)))}function kx(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],l=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),f=l+d.nodeSize,h=r.matchType(d.type);if(!h)i.push(new $t(l,f,xe.empty));else{r=h;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||t.step(new Ur(l,f,d.marks[m]));if(o&&d.isText&&n.whitespace!="pre"){let m,y=/\r?\n|\r/g,v;for(;m=y.exec(d.text);)v||(v=new xe(oe.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),i.push(new $t(l+m.index,l+m.index+m[0].length,v))}}l=f}if(!r.validEnd){let u=r.fillBefore(oe.empty,!0);t.replace(l,l,new xe(u,0,0))}for(let u=i.length-1;u>=0;u--)t.step(i[u])}function U7(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _l(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),l=t.$from.index(r)+o,u=t.$to.indexAfter(r)-s;if(r<t.depth&&i.canReplace(l,u,n))return r;if(r==0||i.type.spec.isolating||!U7(i,l,u))break;l&&(o=1),u<i.childCount&&(s=1)}return null}function W7(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),l=o.after(s+1),u=i,d=l,f=oe.empty,h=0;for(let v=s,b=!1;v>n;v--)b||r.index(v)>0?(b=!0,f=oe.from(r.node(v).copy(f)),h++):u--;let m=oe.empty,y=0;for(let v=s,b=!1;v>n;v--)b||o.after(v+1)<o.end(v)?(b=!0,m=oe.from(o.node(v).copy(m)),y++):d++;t.step(new hn(u,d,i,l,new xe(f.append(m),h,y),f.size-h,!0))}function wx(t,e,n=null,r=t){let o=q7(t,e),s=o&&K7(r,e);return s?o.map(Pw).concat({type:e,attrs:n}).concat(s.map(Pw)):null}function Pw(t){return{type:t,attrs:null}}function q7(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 K7(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 G7(t,e,n){let r=oe.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let l=n[i].type.contentMatch.matchFragment(r);if(!l||!l.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 xe(r,0,0),n.length,!0))}function J7(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,l)=>{let u=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,u)&&Z7(t.doc,t.mapping.slice(s).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!v?d=!1:!y&&v&&(d=!0)}d===!1&&X_(t,i,l,s),kx(t,t.mapping.slice(s).map(l,1),r,void 0,d===null);let f=t.mapping.slice(s),h=f.map(l,1),m=f.map(l+i.nodeSize,1);return t.step(new hn(h,m,h+1,m-1,new xe(oe.from(r.create(u,null,i.marks)),0,0),1,!0)),d===!0&&Y_(t,i,l,s),!1}})}function Y_(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,l=/\r?\n|\r/g;for(;i=l.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 X_(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(`
|
|
447
|
-
`))}})}function Z7(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Y7(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 xe(oe.from(i),0,0),1,!0))}function es(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,f=n-2;d>s;d--,f--){let h=o.node(d),m=o.index(d);if(h.type.spec.isolating)return!1;let y=h.content.cutByIndex(m,h.childCount),v=r&&r[f+1];v&&(y=y.replaceChild(0,v.type.create(v.attrs)));let b=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!b.type.validContent(y))return!1}let l=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(l,l,u?u.type:o.node(s+1).type)}function X7(t,e,n=1,r){let o=t.doc.resolve(e),s=oe.empty,i=oe.empty;for(let l=o.depth,u=o.depth-n,d=n-1;l>u;l--,d--){s=oe.from(o.node(l).copy(s));let f=r&&r[d];i=oe.from(f?f.type.create(f.attrs,i):o.node(l).copy(i))}t.step(new $t(e,e,new xe(s.append(i),n,n),!0))}function yi(t,e){let n=t.resolve(e),r=n.index();return Q_(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Q7(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 Q_(t,e){return!!(t&&e&&!t.isLeaf&&Q7(t,e))}function Np(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),l++,i=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),i=r.node(o+1)),s&&!s.isTextblock&&Q_(s,i)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function ez(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 f=i.whitespace=="pre",h=!!i.contentMatch.matchType(o);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);X_(t,f.node(),f.before(),l)}i.inlineContent&&kx(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new $t(d,u.map(e+n,-1),xe.empty,!0)),r===!0){let f=t.doc.resolve(d);Y_(t,f.node(),f.before(),t.steps.length)}return t}function tz(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 e4(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 l=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,u=r.index(i)+(l>0?1:0),d=r.node(i),f=!1;if(s==1)f=d.canReplace(u,u,o);else{let h=d.contentMatchAt(u).findWrapping(o.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(i+1):r.after(i+1)}return null}function Mp(t,e,n=e,r=xe.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return t4(o,s,r)?new $t(e,n,r):new nz(o,s,r).fit()}function t4(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class nz{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,l=o.depth;for(;i&&l&&s.childCount==1;)s=s.firstChild.content,i--,l--;let u=new xe(s,i,l);return e>-1?new hn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new $t(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=dg(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(i?d.matchType(i.type)||(h=d.fillBefore(oe.from(i),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:h};if(n==2&&i&&(f=d.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:f};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=dg(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new xe(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=dg(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new xe(ku(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new xe(ku(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,l=r?r.content:i.content,u=i.openStart-e,d=0,f=[],{match:h,type:m}=this.frontier[n];if(o){for(let b=0;b<o.childCount;b++)f.push(o.child(b));h=h.matchFragment(o)}let y=l.size+e-(i.content.size-i.openEnd);for(;d<l.childCount;){let b=l.child(d),k=h.matchType(b.type);if(!k)break;d++,(d>1||u==0||b.content.size)&&(h=k,f.push(n4(b.mark(m.allowedMarks(b.marks)),d==1?u:0,d==l.childCount?y:-1)))}let v=d==l.childCount;v||(y=-1),this.placed=wu(this.placed,n,oe.from(f)),this.frontier[n].match=h,v&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,k=l;b<y;b++){let E=k.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),k=E.content}this.unplaced=v?e==0?xe.empty:new xe(ku(i.content,e-1,1),e-1,y<0?i.openEnd:e-1):new xe(ku(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||!fg(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=fg(e,n,o,r,s);if(i){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],f=fg(e,l,d,u,!0);if(!f||f.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=wu(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=wu(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=wu(this.placed,this.frontier.length,n))}}function ku(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ku(t.firstChild.content,e-1,n)))}function wu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(wu(t.lastChild.content,e-1,n)))}function dg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function n4(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,n4(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 fg(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 l=r.fillBefore(s.content,!0,i);return l&&!rz(n,s.content,i)?l:null}function rz(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function oz(t){return t.spec.defining||t.spec.definingForContent}function sz(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(t4(o,s,r))return t.step(new $t(e,n,r));let i=o4(o,s);i[i.length-1]==0&&i.pop();let l=-(o.depth+1);i.unshift(l);for(let m=o.depth,y=o.pos-1;m>0;m--,y--){let v=o.node(m).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;i.indexOf(m)>-1?l=m:o.before(m)==y&&i.splice(1,0,-m)}let u=i.indexOf(l),d=[],f=r.openStart;for(let m=r.content,y=0;;y++){let v=m.firstChild;if(d.push(v),y==r.openStart)break;m=v.content}for(let m=f-1;m>=0;m--){let y=d[m],v=oz(y.type);if(v&&!y.sameMarkup(o.node(Math.abs(l)-1)))f=m;else if(v||!y.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let y=(m+f+1)%(r.openStart+1),v=d[y];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 xe(r4(r.content,0,r.openStart,y),y,r.openEnd))}}let h=t.steps.length;for(let m=i.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let y=i[m];y<0||(e=o.before(y),n=s.after(y))}}function r4(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(r4(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 iz(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=tz(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new xe(oe.from(r),0,0))}function az(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),l=!1;for(let u=r.depth;u>i;u--)r.node(u).type.spec.isolating&&(l=!0);for(let u=o.depth;u>i;u--)o.node(u).type.spec.isolating&&(l=!0);if(!l){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=o4(r,o);for(let i=0;i<s.length;i++){let l=s[i],u=i==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}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 o4(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 Qa extends Mn{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 Bt.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 Bt.fromReplace(e,this.pos,this.pos+1,new xe(oe.from(o),0,n.isLeaf?0:1))}getMap(){return lr.empty}invert(e){return new Qa(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 Qa(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 Qa(n.pos,n.attr,n.value)}}Mn.jsonID("attr",Qa);class uc extends Mn{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 Bt.ok(r)}getMap(){return lr.empty}invert(e){return new uc(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 uc(n.attr,n.value)}}Mn.jsonID("docAttr",uc);let ul=class extends Error{};ul=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ul.prototype=Object.create(Error.prototype);ul.prototype.constructor=ul;ul.prototype.name="TransformError";class s4{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ul(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,l,u)=>{e=Math.min(e,l),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=xe.empty){let o=Mp(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new xe(oe.from(r),0,0))}delete(e,n){return this.replace(e,n,xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return sz(this,e,n,r),this}replaceRangeWith(e,n,r){return iz(this,e,n,r),this}deleteRange(e,n){return az(this,e,n),this}lift(e,n){return W7(this,e,n),this}join(e,n=1){return ez(this,e,n),this}wrap(e,n){return G7(this,e,n),this}setBlockType(e,n=e,r,o=null){return J7(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Y7(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Qa(e,n,r)),this}setDocAttribute(e,n){return this.step(new uc(e,n)),this}addNodeMark(e,n){return this.step(new qs(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 oa(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new oa(e,s)),o=s.removeFromSet(o);for(let l=i.length-1;l>=0;l--)this.step(i[l])}return this}split(e,n=1,r){return X7(this,e,n,r),this}addMark(e,n,r){return V7(this,e,n,r),this}removeMark(e,n,r){return H7(this,e,n,r),this}clearIncompatible(e,n,r){return kx(this,e,n,r),this}}const hg=Object.create(null);class Ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new lz(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=xe.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){let{$from:u,$to:d}=i[l],f=e.mapping.slice(s);e.replaceRange(f.map(u.pos),f.map(d.pos),l?xe.empty:n),l==0&&zw(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:l}=o[s],u=e.mapping.slice(r),d=u.map(i.pos),f=u.map(l.pos);s?e.deleteRange(d,f):(e.replaceRangeWith(d,f,n),zw(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new ze(e):Ga(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?Ga(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ga(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 ur(e.node(0))}static atStart(e){return Ga(e,e,0,0,1)||new ur(e)}static atEnd(e){return Ga(e,e,e.content.size,e.childCount,-1)||new ur(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=hg[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 hg)throw new RangeError("Duplicate use of selection JSON ID "+e);return hg[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ze.between(this.$anchor,this.$head).getBookmark()}}Ue.prototype.visible=!0;class lz{constructor(e,n){this.$from=e,this.$to=n}}let jw=!1;function Lw(t){!jw&&!t.parent.inlineContent&&(jw=!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){Lw(e),Lw(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=xe.empty){if(super.replace(e,n),n==xe.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 Dp(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 Dp{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Dp(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 xe(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 Cx(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 Cx{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Dp(r,r):new Cx(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ie.isSelectable(r)?new Ie(n):Ue.near(n)}}class ur extends Ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=xe.empty){if(n==xe.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 ur(e)}map(e){return new ur(e)}eq(e){return e instanceof ur}getBookmark(){return uz}}Ue.jsonID("all",ur);const uz={map(){return this},resolve(t){return new ur(t)}};function Ga(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 l=e.child(i);if(l.isAtom){if(!s&&Ie.isSelectable(l))return Ie.create(t,n-(o<0?l.nodeSize:0))}else{let u=Ga(t,l,n+o,o<0?l.childCount:0,o,s);if(u)return u}n+=l.nodeSize*o}return null}function zw(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof $t||o instanceof hn))return;let s=t.mapping.maps[r],i;s.forEach((l,u,d,f)=>{i==null&&(i=f)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}const Fw=1,kf=2,$w=4;class cz extends s4{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|Fw)&~kf,this.storedMarks=null,this}get selectionSet(){return(this.updated&Fw)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=kf,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&kf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~kf,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|=$w,this}get scrolledIntoView(){return(this.updated&$w)>0}}function Bw(t,e){return!e||!t?t:t.bind(e)}class Cu{constructor(e,n,r){this.name=e,this.init=Bw(n.init,r),this.apply=Bw(n.apply,r)}}const dz=[new Cu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Cu("selection",{init(t,e){return t.selection||Ue.atStart(e.doc)},apply(t){return t.selection}}),new Cu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Cu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class pg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=dz.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 Cu(r.key,r.spec.state,r))})}}class $i{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 l=this.config.plugins[i];if(l.spec.appendTransaction){let u=o?o[i].n:0,d=o?o[i].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,d,r);if(f&&r.filterTransaction(f,i)){if(f.setMeta("appendedTransaction",e),!o){o=[];for(let h=0;h<this.config.plugins.length;h++)o.push(h<i?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),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 $i(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 cz(this)}static create(e){let n=new pg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $i(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 pg(this.schema,e.plugins),r=n.fields,o=new $i(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 pg(e.schema,e.plugins),s=new $i(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=Zs.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 l in r){let u=r[l],d=u.spec.state;if(u.key==i.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[i.name]=d.fromJSON.call(u,e,n[l],s);return}}s[i.name]=i.init(e,s)}}),s}}function i4(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=i4(o,e,{})),n[r]=o}return n}class Ct{constructor(e){this.spec=e,this.props={},e.props&&i4(e.props,this,this.props),this.key=e.key?e.key.key:a4("plugin")}getState(e){return e[this.key]}}const mg=Object.create(null);function a4(t){return t in mg?t+"$"+ ++mg[t]:(mg[t]=0,t+"$")}class Ht{constructor(e="key"){this.key=a4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const l4=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function u4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const c4=(t,e,n)=>{let r=u4(t,n);if(!r)return!1;let o=Sx(r);if(!o){let i=r.blockRange(),l=i&&_l(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(v4(t,o,e,-1))return!0;if(r.parent.content.size==0&&(cl(s,"end")||Ie.isSelectable(s)))for(let i=r.depth;;i--){let l=Mp(t.doc,r.before(i),r.after(i),xe.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(cl(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},fz=(t,e,n)=>{let r=u4(t,n);if(!r)return!1;let o=Sx(r);return o?d4(t,o,e):!1},hz=(t,e,n)=>{let r=h4(t,n);if(!r)return!1;let o=Ex(r);return o?d4(t,o,e):!1};function d4(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 f=o.lastChild;if(!f)return!1;o=f}let i=e.nodeAfter,l=i,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Mp(t.doc,s,u,xe.empty);if(!d||d.from!=s||d instanceof $t&&d.slice.size>=u-s)return!1;if(n){let f=t.tr.step(d);f.setSelection(ze.create(f.doc,s)),n(f.scrollIntoView())}return!0}function cl(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 f4=(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=Sx(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 Sx(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 h4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const p4=(t,e,n)=>{let r=h4(t,n);if(!r)return!1;let o=Ex(r);if(!o)return!1;let s=o.nodeAfter;if(v4(t,o,e,1))return!0;if(r.parent.content.size==0&&(cl(s,"start")||Ie.isSelectable(s))){let i=Mp(t.doc,r.before(),r.after(),xe.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=t.tr.step(i);l.setSelection(cl(s,"start")?Ue.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Ie.create(l.doc,l.mapping.map(o.pos))),e(l.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},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("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Ex(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 Ex(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 pz=(t,e)=>{let n=t.selection,r=n instanceof Ie,o;if(r){if(n.node.isTextblock||!yi(t.doc,n.from))return!1;o=n.from}else if(o=Np(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},mz=(t,e)=>{let n=t.selection,r;if(n instanceof Ie){if(n.node.isTextblock||!yi(t.doc,n.to))return!1;r=n.to}else if(r=Np(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},gz=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&_l(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},g4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
448
|
-
`).scrollIntoView()),!0)};function _x(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 yz=(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=_x(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,i.createAndFill());u.setSelection(Ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},y4=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof ur||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=_x(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,l=t.tr.insert(i,s.createAndFill());l.setSelection(ze.create(l.doc,i+1)),e(l.scrollIntoView())}return!0},x4=(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(es(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&_l(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function xz(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Ie&&e.selection.node.isBlock)return!r.parentOffset||!es(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,l,u=!1,d=!1;for(let y=r.depth;;y--)if(r.node(y).isBlock){u=r.end(y)==r.pos+(r.depth-y),d=r.start(y)==r.pos-(r.depth-y),l=_x(r.node(y-1).contentMatchAt(r.indexAfter(y-1))),s.unshift(u&&l?{type:l}:null),i=y;break}else{if(y==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof ze||e.selection instanceof ur)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=es(f.doc,h,s.length,s);if(m||(s[0]=l?{type:l}:null,m=es(f.doc,h,s.length,s)),!m)return!1;if(f.split(h,s.length,s),!u&&d&&r.node(i).type!=l){let y=f.mapping.map(r.before(i)),v=f.doc.resolve(y);l&&r.node(i-1).canReplaceWith(v.index(),v.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(i)),l)}return n&&n(f.scrollIntoView()),!0}}const vz=xz(),bz=(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 kz(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||yi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function v4(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,l,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&kz(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(i[0]||s.type).validEnd){if(n){let y=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,y,e.pos,y,new xe(v,1,0),i.length,!0)),k=b.doc.resolve(y+2*i.length);k.nodeAfter&&k.nodeAfter.type==o.type&&yi(b.doc,k.pos)&&b.join(k.pos),n(b.scrollIntoView())}return!0}let f=s.type.spec.isolating||r>0&&u?null:Ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&_l(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&cl(s,"start",!0)&&cl(o,"end")){let y=o,v=[];for(;v.push(y),!y.isTextblock;)y=y.lastChild;let b=s,k=1;for(;!b.isTextblock;b=b.firstChild)k++;if(y.canReplace(y.childCount,y.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 xe(E,v.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function b4(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 wz=b4(-1),Cz=b4(1);function Sz(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&wx(i,t,e);return l?(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0):!1}}function Vw(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:l}}=n.selection.ranges[s];n.doc.nodesBetween(i,l,(u,d)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let f=n.doc.resolve(d),h=f.index();o=f.parent.canReplaceWith(h,h+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:l},$to:{pos:u}}=n.selection.ranges[i];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function Tx(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}Tx(l4,c4,f4);Tx(l4,p4,m4);Tx(g4,y4,x4,vz);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Ez(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return _z(l,i,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function _z(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 lh(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new lh(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=wx(s,n,r,e);return l?(t&&Tz(t,e,l,o,n),!0):!1}function Tz(t,e,n,r,o){let s=oe.empty;for(let f=n.length-1;f>=0;f--)s=oe.from(n[f].type.create(n[f].attrs,s));t.step(new hn(e.start-(r?2:0),e.end,e.start,e.end,new xe(s,0,0),n.length,!0));let i=0;for(let f=0;f<n.length;f++)n[f].type==o&&(i=f+1);let l=n.length-i,u=e.start+n.length-(r?2:0),d=e.parent;for(let f=e.startIndex,h=e.endIndex,m=!0;f<h;f++,m=!1)!m&&es(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=d.child(f).nodeSize;return t}function Az(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?Nz(e,n,t,s):Mz(e,n,s):!0:!1}}function Nz(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 xe(oe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new lh(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=_l(r);if(l==null)return!1;o.lift(r,l);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return yi(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function Mz(t,e,n){let r=t.tr,o=n.parent;for(let y=n.end,v=n.endIndex-1,b=n.startIndex;v>b;v--)y-=o.child(v).nodeSize,r.delete(y-1,y+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 l=n.startIndex==0,u=n.endIndex==o.childCount,d=s.node(-1),f=s.index(-1);if(!d.canReplace(f+(l?0:1),f+1,i.content.append(u?oe.empty:oe.from(o))))return!1;let h=s.pos,m=h+i.nodeSize;return r.step(new hn(h-(l?1:0),m+(u?1:0),h+1,m-1,new xe((l?oe.empty:oe.from(o.copy(oe.empty))).append(u?oe.empty:oe.from(o.copy(oe.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Dz(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 l=s.parent,u=l.child(i-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=oe.from(d?t.create():null),h=new xe(oe.from(t.create(null,oe.from(l.type.create(null,f)))),d?3:1,0),m=s.start,y=s.end;n(e.tr.step(new hn(m-(d?3:1),y,m,y,h,1,!0)).scrollIntoView())}return!0}}const bn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},dl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let H1=null;const qo=function(t,e,n){let r=H1||(H1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Rz=function(){H1=null},sa=function(t,e,n,r){return n&&(Hw(t,e,n,r,-1)||Hw(t,e,n,r,1))},Oz=/^(img|br|input|textarea|hr)$/i;function Hw(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Ar(t))){let i=t.parentNode;if(!i||i.nodeType!=1||zc(t)||Oz.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?Ar(t):0}else return!1}}function Ar(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Iz(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=Ar(t)}else if(t.parentNode&&!zc(t))e=bn(t),t=t.parentNode;else return null}}function Pz(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&&!zc(t))e=bn(t)+1,t=t.parentNode;else return null}}function jz(t,e,n){for(let r=e==0,o=e==Ar(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==Ar(t)}}function zc(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 Rp=function(t){return t.focusNode&&sa(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Fi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Lz(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function zz(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ar(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ar(r.startContainer),r.startOffset)}}}const wo=typeof navigator<"u"?navigator:null,Uw=typeof document<"u"?document:null,xi=wo&&wo.userAgent||"",U1=/Edge\/(\d+)/.exec(xi),k4=/MSIE \d/.exec(xi),W1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xi),er=!!(k4||W1||U1),Ys=k4?document.documentMode:W1?+W1[1]:U1?+U1[1]:0,Nr=!er&&/gecko\/(\d+)/i.test(xi);Nr&&+(/Firefox\/(\d+)/.exec(xi)||[0,0])[1];const q1=!er&&/Chrome\/(\d+)/.exec(xi),wn=!!q1,w4=q1?+q1[1]:0,Nn=!er&&!!wo&&/Apple Computer/.test(wo.vendor),fl=Nn&&(/Mobile\/\w+/.test(xi)||!!wo&&wo.maxTouchPoints>2),Er=fl||(wo?/Mac/.test(wo.platform):!1),C4=wo?/Win/.test(wo.platform):!1,Go=/Android \d/.test(xi),Fc=!!Uw&&"webkitFontSmoothing"in Uw.documentElement.style,Fz=Fc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $z(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 $o(t,e){return typeof t=="number"?t:t[e]}function Bz(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 Ww(t,e,n){if(!K1(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=dl(i);continue}let l=i,u=l==s.body,d=u?$z(s):Bz(l),f=0,h=0;if(e.top<d.top+$o(r,"top")?h=-(d.top-e.top+$o(o,"top")):e.bottom>d.bottom-$o(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+$o(o,"top")-d.top:e.bottom-d.bottom+$o(o,"bottom")),e.left<d.left+$o(r,"left")?f=-(d.left-e.left+$o(o,"left")):e.right>d.right-$o(r,"right")&&(f=e.right-d.right+$o(o,"right")),f||h)if(u)s.defaultView.scrollBy(f,h);else{let y=l.scrollLeft,v=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-y,k=l.scrollTop-v;e={left:e.left-b,top:e.top-k,right:e.right-b,bottom:e.bottom-k}}let m=u?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(m))break;i=m=="absolute"?i.offsetParent:dl(i)}}function Vz(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 l=t.root.elementFromPoint(s,i);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,o=u.top;break}}return{refDOM:r,refTop:o,stack:S4(t.dom)}}function S4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=dl(r));return e}function Hz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;E4(n,r==0?0:r-e)}function E4(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 Ua=null;function Uz(t){if(t.setActive)return t.setActive();if(Ua)return t.focus(Ua);let e=S4(t);t.focus(Ua==null?{get preventScroll(){return Ua={preventScroll:!0},!0}}:void 0),Ua||(Ua=!1,E4(e,0))}function _4(t,e){let n,r=2e8,o,s=0,i=e.top,l=e.top,u,d;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=qo(f).getClientRects();else continue;for(let y=0;y<m.length;y++){let v=m[y];if(v.top<=i&&v.bottom>=l){i=Math.max(v.bottom,i),l=Math.min(v.top,l);let b=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(b<r){n=f,r=b,o=b&&n.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,f.nodeType==1&&b&&(s=h+(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=f,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=h+1)}}return!n&&u&&(n=u,o=d,r=0),n&&n.nodeType==3?Wz(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:_4(n,o)}function Wz(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=Ps(r,1);if(i.top!=i.bottom&&Ax(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 Ax(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function qz(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Kz(t,e,n){let{node:r,offset:o}=_4(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 Gz(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!i&&u.left>r.left||u.top>r.top?o=l.posBefore:(!i&&u.right<r.left||u.bottom<r.top)&&(o=l.posAfter),i=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function T4(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 l=i.getClientRects();for(let u=0;u<l.length;u++){let d=l[u];if(Ax(e,d))return T4(i,e,d)}}if((s=(s+1)%r)==o)break}return t}function Jz(t,e){let n=t.dom.ownerDocument,r,o=0,s=zz(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let d=t.dom.getBoundingClientRect();if(!Ax(e,d)||(i=T4(t.dom,e,d),!i))return null}if(Nn)for(let d=i;r&&d;d=dl(d))d.draggable&&(r=void 0);if(i=qz(i,e),r){if(Nr&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let f=r.childNodes[o],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&o++}let d;Fc&&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?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=Gz(t,r,o,e))}l==null&&(l=Kz(t,i,e));let u=t.docView.nearestDesc(i,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function K1(t){return t.top<t.bottom||t.left<t.right}function Ps(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(K1(r))return r}return Array.prototype.find.call(n,K1)||t.getBoundingClientRect()}const Zz=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function A4(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Fc||Nr;if(r.nodeType==3)if(i&&(Zz.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=Ps(qo(r,o,o),n);if(Nr&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=Ps(qo(r,o-1,o-1),-1);if(d.top==u.top){let f=Ps(qo(r,o,o+1),-1);if(f.top!=u.top)return hu(f,f.left<d.left)}}return u}else{let u=o,d=o,f=n<0?1:-1;return n<0&&!o?(d++,f=-1):n>=0&&o==r.nodeValue.length?(u--,f=1):n<0?u--:d++,hu(Ps(qo(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return gg(u.getBoundingClientRect(),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];if(u.nodeType==1)return gg(u.getBoundingClientRect(),!0)}return gg(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1],d=u.nodeType==3?qo(u,Ar(u)-(i?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return hu(Ps(d,1),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?qo(u,0,i?0:1):u.nodeType==1?u:null:null;if(d)return hu(Ps(d,-1),!0)}return hu(Ps(r.nodeType==3?qo(r):r,-n),n>=0)}function hu(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function gg(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function N4(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 Yz(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return N4(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let i=A4(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=qo(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let f=u[d];if(f.bottom>f.top+1&&(n=="up"?i.top-f.top>(f.bottom-i.top)*2:f.bottom-i.bottom>(i.bottom-f.top)*2))return!1}}return!0})}const Xz=/[\u0590-\u08ac]/;function Qz(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,l=t.domSelection();return l?!Xz.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:i:N4(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:v,focusOffset:b}=t.domSelectionRange(),k=v&&!y.contains(v.nodeType==1?v:v.parentNode)||u==v&&d==b;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),k}):r.pos==r.start()||r.pos==r.end()}let qw=null,Kw=null,Gw=!1;function eF(t,e,n){return qw==e&&Kw==n?Gw:(qw=e,Kw=n,Gw=n=="up"||n=="down"?Yz(t,e,n):Qz(t,e,n))}const Mr=0,Jw=1,Bi=2,Wr=3;class $c{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Mr,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 l=o.children[i];if(l.size){o=l;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],l=s+i.size;if(l>e||i instanceof D4){o=e-s;break}s=l}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 M4&&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,l=0;;l++){let u=this.children[l],d=i+u.size;if(o==-1&&e<=d){let f=i+u.border;if(e>=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=i;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=bn(m.dom)+1;break}e-=m.size}o==-1&&(o=0)}if(o>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=bn(h.dom);break}n+=h.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 y=0,v=0;y<this.children.length;y++){let b=this.children[y],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 l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),f=r.domSelectionRange(),h=!1;if((Nr||Nn)&&e==n){let{node:y,offset:v}=l;if(y.nodeType==3){if(h=!!(v&&y.nodeValue[v-1]==`
|
|
449
|
-
`),h&&v==y.nodeValue.length)for(let b=y,k;b;b=b.parentNode){if(k=b.nextSibling){k.nodeName=="BR"&&(l=u={node:k.parentNode,offset:bn(k)+1});break}let E=b.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let b=y.childNodes[v-1];h=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(Nr&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let y=f.focusNode.childNodes[f.focusOffset];y&&y.contentEditable=="false"&&(o=!0)}if(!(o||h&&Nn)&&sa(l.node,l.offset,f.anchorNode,f.anchorOffset)&&sa(u.node,u.offset,f.focusNode,f.focusOffset))return;let m=!1;if((d.extend||e==n)&&!(h&&Nr)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(e>n){let v=l;l=u,u=v}let y=document.createRange();y.setEnd(u.node,u.offset),y.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(y)}}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 l=r+s.border,u=i-s.border;if(e>=l&&n<=u){this.dirty=e==r||n==i?Bi:Jw,e==l&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Wr:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Bi:Wr}r=i}this.dirty=Bi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bi:Jw;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class M4 extends $c{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 l=document.createElement("span");l.appendChild(i),i=l}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==Mr&&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 tF extends $c{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 Xs extends $c{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=pa.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xs(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Wr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Wr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Mr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Mr}}slice(e,n,r){let o=Xs.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=J1(s,n,i,r)),e>0&&(s=J1(s,0,e,r));for(let l=0;l<s.length;l++)s[l].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 Qs extends $c{constructor(e,n,r,o,s,i,l){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,s,i){let l=s.nodeViews[n.type.name],u,d=l&&l(n,s,()=>{if(!u)return i;if(u.parent)return u.parent.posBeforeChild(u)},r,o),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=pa.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=I4(f,r,n),d?u=new nF(e,n,r,o,f,h||null,m,d):n.isText?new Op(e,n,r,o,f,m):new Qs(e,n,r,o,f,h||null,m)}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==Mr&&e.eq(this.node)&&ch(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,l=s&&s.pos<0,u=new oF(this,i&&i.node,e);aF(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,f):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?ut.none:this.node.child(f).marks,r,e,f),u.placeWidget(d,e,o)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e,m);let y;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(y=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,f,h,y,e)||u.updateNextNode(d,f,h,e,m,o)||u.addNode(d,f,h,e,o),o+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Bi)&&(i&&this.protectLocalComposition(e,i),R4(this.contentDOM,this.children,e),fl&&lF(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,l=uF(this.node.content,i,r-n,o-n);return l<0?null:{node:s,pos:l,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 tF(this,s,n,o);e.input.compositionNodes.push(i),this.children=J1(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==Wr||!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=Mr}updateOuterDeco(e){if(ch(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=O4(this.dom,this.nodeDOM,G1(this.outerDeco,this.node,n),G1(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 Zw(t,e,n,r,o){I4(r,e,t);let s=new Qs(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}class Op extends Qs{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==Wr||this.dirty!=Mr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Mr||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=Mr,!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 Op(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=Wr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class D4 extends $c{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Mr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class nF extends Qs{constructor(e,n,r,o,s,i,l,u){super(e,n,r,o,s,i,l),this.spec=u}update(e,n,r,o){if(this.dirty==Wr)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 R4(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],l=i.dom;if(l.parentNode==t){for(;l!=r;)r=Yw(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(i instanceof Xs){let u=r?r.previousSibling:t.lastChild;R4(i.contentDOM,i.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=Yw(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Nu=function(t){t&&(this.nodeName=t)};Nu.prototype=Object.create(null);const Vi=[new Nu];function G1(t,e,n){if(t.length==0)return Vi;let r=n?Vi[0]:new Nu,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Nu(i.nodeName));for(let l in i){let u=i[l];u!=null&&(n&&o.length==1&&o.push(r=new Nu(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return o}function O4(t,e,n,r){if(n==Vi&&r==Vi)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],l=n[s];if(s){let u;l&&l.nodeName==i.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==i.nodeName||(u=document.createElement(i.nodeName),u.pmIsDeco=!0,u.appendChild(o),l=Vi[0]),o=u}rF(o,l||Vi[0],i)}return o}function rF(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 I4(t,e,n){return O4(t,t,Vi,G1(e,n,t.nodeType!=1))}function ch(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 Yw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class oF{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=sF(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,l=Math.min(i,e.length);for(;s<l&&(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=Mr,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 f=this.index;f<d;f++){let h=this.top.children[f];if(h.matchesMark(e[i])&&!this.isLocked(h.dom)){u=f;break}}if(u<0&&this.index<this.top.children.length){let f=this.top.children[this.index];f instanceof Xs&&f.dirty!=Wr&&f.mark.type==e[i].type&&f.spec.update&&!this.isLocked(f.dom)&&f.spec.update(e[i])&&(f.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 f=Xs.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,f),this.top=f,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 l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=l;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==Wr&&i.dom==i.contentDOM&&(i.dirty=Bi),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 l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof Qs){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let f=u.dom,h,m=this.isLocked(f)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=Wr&&ch(n,u.outerDeco));if(!m&&u.update(e,n,r,o))return this.destroyBetween(this.index,l),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(u,e,n,r,o,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Bi,h.updateChildren(o,i+1),h.dirty=Mr),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)||!ch(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=Qs.create(this.top,n,r,o,s,i);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,o,s){let i=Qs.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 M4(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 Xs;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Op)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Nn||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 D4(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 sF(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Xs)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}function iF(t,e){return t.type.side-e.type.side}function aF(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let d=0;d<t.childCount;d++){let f=t.child(d);r(f,o,e.forChild(s,f),d),s+=f.nodeSize}return}let i=0,l=[],u=null;for(let d=0;;){let f,h;for(;i<o.length&&o[i].to==s;){let k=o[i++];k.widget&&(f?(h||(h=[f])).push(k):f=k)}if(f)if(h){h.sort(iF);for(let k=0;k<h.length;k++)n(h[k],d,!!u)}else n(f,d,!!u);let m,y;if(u)y=-1,m=u,u=null;else if(d<t.childCount)y=d,m=t.child(d++);else break;for(let k=0;k<l.length;k++)l[k].to<=s&&l.splice(k--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let v=s+m.nodeSize;if(m.isText){let k=v;i<o.length&&o[i].from<k&&(k=o[i].from);for(let E=0;E<l.length;E++)l[E].to<k&&(k=l[E].to);k<v&&(u=m.cut(k-s),m=m.cut(0,k-s),v=k,y=-1)}else for(;i<o.length&&o[i].to<v;)i++;let b=m.isInline&&!m.isLeaf?l.filter(k=>!k.inline):l.slice();r(m,b,e.forChild(s,m),y),s=v}}function lF(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 uF(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),l=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-l,r-l)==e)return r-e.length;let d=l<r?u.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function J1(t,e,n,r,o){let s=[];for(let i=0,l=0;i<t.length;i++){let u=t[i],d=l,f=l+=u.size;d>=n||f<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),o&&(s.push(o),o=void 0),f>n&&s.push(u.slice(n-d,u.size,r)))}return s}function Nx(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 l=r.resolve(i),u,d;if(Rp(n)){for(u=i;o&&!o.node;)o=o.parent;let h=o.node;if(o&&h.isAtom&&Ie.isSelectable(h)&&o.parent&&!(h.isInline&&jz(n.focusNode,n.focusOffset,o.dom))){let m=o.posBefore;d=new Ie(i==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=i,m=i;for(let y=0;y<n.rangeCount;y++){let v=n.getRangeAt(y);h=Math.min(h,t.docView.posFromDOM(v.startContainer,v.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(h<0)return null;[u,i]=m==t.state.selection.anchor?[m,h]:[h,m],l=r.resolve(i)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!d){let h=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;d=Mx(t,f,l,h)}return d}function P4(t){return t.editable?t.hasFocus():L4(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ts(t,e=!1){let n=t.state.selection;if(j4(t,n),!P4(t))return;let r=t.input.mouseDown;if(!e&&wn&&r){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&sa(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)dF(t);else{let{anchor:o,head:s}=n,i,l;Xw&&!(n instanceof ze)&&(n.$from.parent.inlineContent||(i=Qw(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=Qw(t,n.to))),t.docView.setSelection(o,s,t,e),Xw&&(i&&eC(i),l&&eC(l)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&cF(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const Xw=Nn||wn&&w4<63;function Qw(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(Nn&&o&&o.contentEditable=="false")return yg(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return yg(o);if(s)return yg(s)}}function yg(t){return t.contentEditable="true",Nn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function eC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function cF(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(()=>{(!P4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function dF(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&&er&&Ys<=11&&(n.disabled=!0,n.disabled=!1)}function j4(t,e){if(e instanceof Ie){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(tC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else tC(t)}function tC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Mx(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||ze.between(e,n,r)}function nC(t){return t.editable&&!t.hasFocus()?!1:L4(t)}function L4(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 fF(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return sa(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Z1(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 Ls(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function rC(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 Ls(t,new ze(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Z1(t.state,e);return o&&o instanceof Ie?Ls(t,o):!1}else if(!(Er&&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 l=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM?Ie.isSelectable(s)?Ls(t,new Ie(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Fc?Ls(t,new ze(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ie&&r.node.isInline)return Ls(t,new ze(e>0?r.$to:r.$from));{let o=Z1(t.state,e);return o?Ls(t,o):!1}}}function dh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Mu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Wa(t,e){return e<0?hF(t):pF(t)}function hF(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Nr&&n.nodeType==1&&r<dh(n)&&Mu(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Mu(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(z4(n))break;{let l=n.previousSibling;for(;l&&Mu(l,-1);)o=n.parentNode,s=bn(l),l=l.previousSibling;if(l)n=l,r=dh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?Y1(t,n,r):o&&Y1(t,o,s)}function pF(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=dh(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Mu(l,1))s=n,i=++r;else break}else{if(z4(n))break;{let l=n.nextSibling;for(;l&&Mu(l,1);)s=l.parentNode,i=bn(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=dh(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&Y1(t,s,i)}function z4(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function mF(t,e){for(;t&&e==t.childNodes.length&&!zc(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 gF(t,e){for(;t&&!e&&!zc(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 Y1(t,e,n){if(e.nodeType!=3){let s,i;(i=mF(e,n))?(e=i,n=0):(s=gF(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Rp(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&&ts(t)},50)}function oC(t,e){let n=t.state.doc.resolve(e);if(!(wn||C4)&&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 sC(t,e,n){let r=t.state.selection;if(r instanceof ze&&!r.empty||n.indexOf("s")>-1||Er&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=Z1(t.state,e);if(i&&i instanceof Ie)return Ls(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,l=r instanceof ur?Ue.near(i,e):Ue.findFrom(i,e);return l?Ls(t,l):!1}return!1}function iC(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 aC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function yF(t){if(!Nn||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;aC(t,r,"true"),setTimeout(()=>aC(t,r,"false"),20)}return!1}function xF(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function vF(t,e){let n=e.keyCode,r=xF(e);if(n==8||Er&&n==72&&r=="c")return iC(t,-1)||Wa(t,-1);if(n==46&&!e.shiftKey||Er&&n==68&&r=="c")return iC(t,1)||Wa(t,1);if(n==13||n==27)return!0;if(n==37||Er&&n==66&&r=="c"){let o=n==37?oC(t,t.state.selection.from)=="ltr"?-1:1:-1;return rC(t,o,r)||Wa(t,o)}else if(n==39||Er&&n==70&&r=="c"){let o=n==39?oC(t,t.state.selection.from)=="ltr"?1:-1:1;return rC(t,o,r)||Wa(t,o)}else{if(n==38||Er&&n==80&&r=="c")return sC(t,-1,r)||Wa(t,-1);if(n==40||Er&&n==78&&r=="c")return yF(t)||sC(t,1,r)||Wa(t,1);if(r==(Er?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Dx(t,e){t.someProp("transformCopied",y=>{e=y(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 y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let i=t.someProp("clipboardSerializer")||pa.fromSchema(t.state.schema),l=U4(),u=l.createElement("div");u.appendChild(i.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=H4[d.nodeName.toLowerCase()]);){for(let y=f.length-1;y>=0;y--){let v=l.createElement(f[y]);for(;u.firstChild;)v.appendChild(u.firstChild);u.appendChild(v),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,`
|
|
450
|
-
|
|
451
|
-
`);return{dom:u,text:m,slice:e}}function F4(t,e,n,r,o){let s=o.parent.type.spec.code,i,l;if(!n&&!e)return null;let u=!!e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,s||r,t)}),s)return l=new xe(oe.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
452
|
-
`))),0,0),t.someProp("transformPasted",m=>{l=m(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",m=>m(e,o,r,t));if(h)l=h;else{let m=o.marks(),{schema:y}=t.state,v=pa.fromSchema(y);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let k=i.appendChild(document.createElement("p"));b&&k.appendChild(v.serializeNode(y.text(b,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),i=CF(n),Fc&&SF(i);let d=i&&i.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=i.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;i=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Qo.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(u||f),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!bF.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=EF(lC(l,+f[1],+f[2]),f[4]);else if(l=xe.maxOpen(kF(l.content,o),!0),l.openStart||l.openEnd){let h=0,m=0;for(let y=l.content.firstChild;h<l.openStart&&!y.type.spec.isolating;h++,y=y.firstChild);for(let y=l.content.lastChild;m<l.openEnd&&!y.type.spec.isolating;m++,y=y.lastChild);l=lC(l,h,m)}return t.someProp("transformPasted",h=>{l=h(l,t,u)}),l}const bF=/^(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 kF(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(l=>{if(!i)return;let u=o.findWrapping(l.type),d;if(!u)return i=null;if(d=i.length&&s.length&&B4(u,s,l,i[i.length-1],0))i[i.length-1]=d;else{i.length&&(i[i.length-1]=V4(i[i.length-1],s.length));let f=$4(l,u);i.push(f),o=o.matchType(f.type),s=u}}),i)return oe.from(i)}return t}function $4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,oe.from(t));return t}function B4(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=B4(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($4(n,t,o+1))))}}function V4(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,V4(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(oe.empty,!0);return t.copy(n.append(r))}function X1(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,l=i.content;return t.childCount>1&&(s=0),o<r-1&&(l=X1(l,e,n,r,o+1,s)),o>=n&&(l=e<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(l))}function lC(t,e,n){return e<t.openStart&&(t=new xe(X1(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new xe(X1(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const H4={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 U4(){return document.implementation.createHTMLDocument("title")}let xg=null;function wF(t){let e=window.trustedTypes;return e?(xg||(xg=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),xg.createHTML(t)):t}function CF(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=U4(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),s;if((s=o&&H4[o[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=wF(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 l=n.styleSheets[i];for(let u=0;u<l.rules.length;u++){let d=l.rules[u];if(d instanceof CSSStyleRule){let f=r.querySelectorAll(d.selectorText);for(let h=0;h<f.length;h++)f[h].style.cssText+=d.style.cssText}}}return r}function SF(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 EF(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 l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;o=oe.from(u.create(r[l+1],o)),s++,i++}return new xe(o,s,i)}const Ln={},zn={},_F={touchstart:!0,touchmove:!0};class TF{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 AF(t){for(let e in Ln){let n=Ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{MF(t,r)&&!Rx(t,r)&&(t.editable||!(r.type in zn))&&n(t,r)},_F[e]?{passive:!0}:void 0)}Nn&&t.dom.addEventListener("input",()=>null),Q1(t)}function Jo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function NF(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 Q1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Rx(t,r))})}function Rx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function MF(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 DF(t,e){!Rx(t,e)&&Ln[e.type]&&(t.editable||!(e.type in zn))&&Ln[e.type](t,e)}zn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!G4(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Go&&wn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fl&&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,Fi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||vF(t,n)?n.preventDefault():Jo(t,"key")};zn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};zn.keypress=(t,e)=>{let n=e;if(G4(t)||!n.charCode||n.ctrlKey&&!n.altKey||Er&&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 Bc(t){return{left:t.clientX,top:t.clientY}}function RF(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Ox(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,l=>i>s.depth?l(t,n,s.nodeAfter,s.before(i),o,!0):l(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Vc(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 OF(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ie.isSelectable(r)?(Vc(t,new Ie(n)),!0):!1}function IF(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 l=i>s.depth?s.nodeAfter:s.node(i);if(Ie.isSelectable(l)){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?(Vc(t,Ie.create(t.state.doc,o)),!0):!1}function PF(t,e,n,r,o){return Ox(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?IF(t,n):OF(t,n))}function jF(t,e,n,r){return Ox(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function LF(t,e,n,r){return Ox(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||zF(t,n,r)}function zF(t,e,n){if(n.button!=0)return!1;let r=W4(t,e,!0),o=t.state.doc;return r?(Vc(t,r),r instanceof ze&&o.eq(t.state.doc)&&(t.input.mouseDown=new $F(t,r)),!0):!1}function W4(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),l=o.before(s);if(i.inlineContent)return ze.create(r,l+1,l+1+i.content.size);if(n&&Ie.isSelectable(i))return Ie.create(r,l)}return null}function Ix(t){return fh(t)}const q4=Er?"metaKey":"ctrlKey";Ln.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ix(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&RF(n,t.input.lastClick)&&!n[q4]&&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(Bc(n));i&&(s=="singleClick"?t.input.mouseDown=new FF(t,i,n,!!r):(s=="doubleClick"?jF:LF)(t,i.pos,i.inside,n)?n.preventDefault():Jo(t,"pointer"))};class K4{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 FF extends K4{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[q4],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let f=e.state.doc.resolve(n.pos);s=f.parent,i=f.depth?f.before():0}const l=o?null:r.target,u=l?e.docView.nearestDesc(l,!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&&Nr&&!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()),Jo(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||ts(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(Bc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Jo(this.view,"pointer"):PF(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Nn&&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)?(Vc(this.view,Ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Jo(this.view,"pointer")}move(e){this.updateAllowDefault(e),Jo(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 $F extends K4{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(),Jo(this.view,"pointer");let n=this.view.posAtCoords(Bc(e)),r=n&&W4(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,s=this.startSelection,[i,l]=r.from<s.from?[s.to,r.from]:[s.from,r.to];Vc(this.view,ze.create(o,i,l))}}Ln.touchstart=t=>{t.input.lastTouch=Date.now(),Ix(t),Jo(t,"pointer")};Ln.touchmove=t=>{t.input.lastTouch=Date.now(),Jo(t,"pointer")};Ln.contextmenu=t=>Ix(t);function G4(t,e){return t.composing?!0:Nn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const BF=Go?5e3:-1;zn.compositionstart=zn.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&&C4&&VF(t)))t.markCursor=t.state.storedMarks||n.marks(),fh(t,!0),t.markCursor=null;else if(fh(t,!e.selection.empty),Nr&&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 l=t.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}J4(t,BF)};function VF(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"}zn.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++,J4(t,20))};function J4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>fh(t),e))}function Z4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function HF(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Iz(e.focusNode,e.focusOffset),r=Pz(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 fh(t,e=!1){if(!(Go&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Z4(t),e||t.docView&&t.docView.dirty){let n=Nx(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 UF(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 cc=er&&Ys<15||fl&&Fz<604;Ln.copy=zn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=cc?null:n.clipboardData,i=r.content(),{dom:l,text:u}=Dx(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",u)):UF(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function WF(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function qF(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?dc(t,r.value,null,o,e):dc(t,r.textContent,r.innerHTML,o,e)},50)}function dc(t,e,n,r,o){let s=F4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,o,s||xe.empty)))return!0;if(!s)return!1;let i=WF(s),l=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Y4(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," "):""}zn.paste=(t,e)=>{let n=e;if(t.composing&&!Go)return;let r=cc?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&dc(t,Y4(r),r.getData("text/html"),o,n)?n.preventDefault():qF(t,n)};class X4{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const KF=Er?"altKey":"ctrlKey";function Q4(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[KF]}Ln.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(Bc(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 h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(i=Ie.create(t.state.doc,h.posBefore))}}let l=(i||t.state.selection).content(),{dom:u,text:d,slice:f}=Dx(t,l);(!n.dataTransfer.files.length||!wn||w4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(cc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",cc||n.dataTransfer.setData("text/plain",d),t.dragging=new X4(f,Q4(t,n),i)};Ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};zn.dragover=zn.dragenter=(t,e)=>e.preventDefault();zn.drop=(t,e)=>{try{GF(t,e,t.dragging)}finally{t.dragging=null}};function GF(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Bc(e));if(!r)return;let o=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",y=>{s=y(s,t,!1)}):s=F4(t,Y4(e.dataTransfer),cc?null:e.dataTransfer.getData("text/html"),!1,o);let i=!!(n&&Q4(t,e));if(t.someProp("handleDrop",y=>y(t,e,s||xe.empty,i))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?e4(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(i){let{node:y}=n;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(f?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(h))return;let m=u.doc.resolve(d);if(f&&Ie.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Ie(m));else{let y=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((v,b,k,E)=>y=E),u.setSelection(Mx(t,m,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}Ln.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())&&ts(t)},20))};Ln.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)};Ln.beforeinput=(t,e)=>{if(Go&&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,Fi(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 zn)Ln[t]=zn[t];function fc(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 hh{constructor(e,n){this.toDOM=e,this.spec=n||Gi,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 jn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof hh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&fc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ei{constructor(e,n){this.attrs=e,this.spec=n||Gi}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 jn(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ei&&fc(this.attrs,e.attrs)&&fc(this.spec,e.spec)}static is(e){return e.type instanceof ei}destroy(){}}class Px{constructor(e,n){this.attrs=e,this.spec=n||Gi}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 jn(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 Px&&fc(this.attrs,e.attrs)&&fc(this.spec,e.spec)}destroy(){}}class jn{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new jn(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 jn(e,e,new hh(n,r))}static inline(e,n,r,o){return new jn(e,n,new ei(r,o))}static node(e,n,r,o){return new jn(e,n,new Px(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ei}get widget(){return this.type instanceof hh}}const Ja=[],Gi={};class xt{constructor(e,n){this.local=e.length?e:Ja,this.children=n.length?n:Ja}static create(e,n){return n.length?ph(n,e,0,Gi):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 l=this.local[i];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let l=this.children[i]+1;this.children[i+2].findInner(e-l,n-l,r,o+l,s)}}map(e,n,r){return this==An||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Gi)}mapInner(e,n,r,o,s){let i;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,o);u&&u.type.valid(n,u)?(i||(i=[])).push(u):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?JF(this.children,i||[],e,n,r,o,s):i?new xt(i.sort(Ji),Ja):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((l,u)=>{let d=u+r,f;if(f=t6(n,l,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(l,f,d+1):o.splice(s,0,u,u+l.nodeSize,ph(f,l,d+1,Gi)),s+=3}});let i=e6(s?n6(n):n,-r);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||i.splice(l--,1);return new xt(i.length?this.local.concat(i).sort(Ji):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,l=r[s]+n,u=r[s+1]+n;for(let f=0,h;f<e.length;f++)(h=e[f])&&h.from>l&&h.to<u&&(e[f]=null,(i||(i=[])).push(h));if(!i)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(i,l+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 l=0;l<o.length;l++)o[l].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,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 l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,i=s+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<i&&u.to>s&&u.type instanceof ei){let d=Math.max(s,u.from)-s,f=Math.min(i,u.to)-s;d<f&&(o||(o=[])).push(u.copy(d,f))}}if(o){let l=new xt(o.sort(Ji),Ja);return r?new Hs([l,r]):l}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 jx(this.localsInner(e))}localsInner(e){if(this==An)return Ja;if(e.inlineContent||!this.local.some(ei.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ei||n.push(this.local[r]);return n}forEachSet(e){e(this)}}xt.empty=new xt([],[]);xt.removeOverlap=jx;const An=xt.empty;class Hs{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Gi));return Hs.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 Hs?r=r.concat(s.members):r.push(s))}return Hs.from(r)}eq(e){if(!(e instanceof Hs)||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?jx(r?n:n.sort(Ji)):Ja}static from(e){switch(e.length){case 0:return An;case 1:return e[0];default:return new Hs(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 JF(t,e,n,r,o,s,i){let l=t.slice();for(let d=0,f=s;d<n.maps.length;d++){let h=0;n.maps[d].forEach((m,y,v,b)=>{let k=b-v-(y-m);for(let E=0;E<l.length;E+=3){let _=l[E+1];if(_<0||m>_+f-h)continue;let T=l[E]+f-h;y>=T?l[E+1]=m<=T?-2:-1:m>=f&&k&&(l[E]+=k,l[E+1]+=k)}h+=k}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let f=n.map(t[d]+s),h=f-o;if(h<0||h>=r.content.size){u=!0;continue}let m=n.map(t[d+1]+s,-1),y=m-o,{index:v,offset:b}=r.content.findIndex(h),k=r.maybeChild(v);if(k&&b==h&&b+k.nodeSize==y){let E=l[d+2].mapInner(n,k,f+1,t[d]+s+1,i);E!=An?(l[d]=h,l[d+1]=y,l[d+2]=E):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=ZF(l,t,e,n,o,s,i),f=ph(d,r,0,i);e=f.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,m=0;h<f.children.length;h+=3){let y=f.children[h];for(;m<l.length&&l[m]<y;)m+=3;l.splice(m,0,f.children[h],f.children[h+1],f.children[h+2])}}return new xt(e.sort(Ji),l)}function e6(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 jn(o.from+e,o.to+e,o.type))}return n}function ZF(t,e,n,r,o,s,i){function l(u,d){for(let f=0;f<u.local.length;f++){let h=u.local[f].map(r,o,d);h?n.push(h):i.onRemove&&i.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)l(u.children[f+2],u.children[f]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+s+1);return n}function t6(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 n6(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ph(t,e,n,r){let o=[],s=!1;e.forEach((l,u)=>{let d=t6(t,l,u+n);if(d){s=!0;let f=ph(d,l,n+u+1,r);f!=An&&o.push(u,u+l.nodeSize,f)}});let i=e6(s?n6(t):t,-n).sort(Ji);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new xt(i,o):An}function Ji(t,e){return t.from-e.from||t.to-e.to}function jx(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),uC(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),uC(e,o,r.copy(s.from,r.to)));break}}}return e}function uC(t,e,n){for(;e<t.length&&Ji(n,t[e])>0;)e++;t.splice(e,0,n)}function vg(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])),Hs.from(e)}const YF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},XF=er&&Ys<=11;class QF{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 e${constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new QF,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]);er&&Ys<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Nn&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),XF&&(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,YF)),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(nC(this.view)){if(this.suppressingSelectionUpdates)return ts(this.view);if(er&&Ys<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sa(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=dl(s))n.add(s);for(let s=e.anchorNode;s;s=dl(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)&&nC(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,l=!1,u=[];if(e.editable)for(let f=0;f<n.length;f++){let h=this.registerMutation(n[f],u);h&&(s=s<0?h.from:Math.min(h.from,s),i=i<0?h.to:Math.max(h.to,i),h.typeOver&&(l=!0))}if(u.some(f=>f.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||wn&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(f=>f.type=="childList"&&f.removedNodes.length))){for(let f of u)if(f.nodeName=="BR"&&f.parentNode){let h=f.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){f.parentNode.removeChild(f);break}h=h.firstChild}}}else if(Nr&&u.length){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let y=m.parentNode;y&&y.nodeName=="LI"&&(!h||r$(e,h)!=y)&&m.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&&Rp(r)&&(d=Nx(e))&&d.eq(Ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ts(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),t$(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,o$(e,u)),this.handleDOMChange(s,i,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ts(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 f=0;f<e.addedNodes.length;f++){let h=e.addedNodes[f];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}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(er&&Ys<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:h,nextSibling:m}=e.addedNodes[f];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(s=m)}let i=o&&o.parentNode==e.target?bn(o)+1:0,l=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:l,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 cC=new WeakMap,dC=!1;function t$(t){if(!cC.has(t)&&(cC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Nr,dC)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."),dC=!0}}function fC(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return sa(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function n$(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return fC(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?fC(t,n):null}function r$(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 o$(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 l=i;for(;;){let u=l.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;l=u}l.insertBefore(s,l.firstChild),r==s&&t.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function s$(t,e,n,r){let{node:o,fromOffset:s,toOffset:i,from:l,to:u}=t.docView.parseRange(e,n),d=t.domSelectionRange(),f,h=d.anchorNode;if(h&&t.dom.contains(h.nodeType==1?h:h.parentNode)&&(f=[{node:h,offset:d.anchorOffset}],Rp(d)||f.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 m=t.state.doc,y=t.someProp("domParser")||Qo.fromSchema(t.state.schema),v=m.resolve(l),b=null,k=y.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:f,ruleFromNode:i$(r),context:v});if(f&&f[0].pos!=null){let E=f[0].pos,_=f[1]&&f[1].pos;_==null&&(_=E),b={anchor:E+l,head:_+l}}return{doc:k,sel:b,from:l,to:u}}const i$=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(Nn&&/^(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||Nn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},a$=/^(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 l$(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let I=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=Nx(t,I);if(P&&!t.state.selection.eq(P)){if(wn&&Go&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",W=>W(t,Fi(13,"Enter"))))return;let O=t.state.tr.setSelection(P);I=="pointer"?O.setMeta("pointer",!0):I=="key"&&O.scrollIntoView(),s&&O.setMeta("composition",s),t.dispatch(O)}return}let i=t.state.doc.resolve(e),l=i.sharedDepth(n);e=i.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=s$(t,e,n,o),f=t.state.doc,h=f.slice(d.from,d.to),m,y;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,y="end"):(m=t.state.selection.from,y="start"),t.input.lastKeyCode=null;let v=d$(h.content,d.doc.content,d.from,m,y);if(v&&t.input.domChangeCount++,(fl&&t.input.lastIOSEnter>Date.now()-225||Go)&&o.some(I=>I.nodeType==1&&!a$.test(I.nodeName))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",I=>I(t,Fi(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 I=hC(t,t.state.doc,d.sel);if(I&&!I.eq(t.state.selection)){let P=t.state.tr.setSelection(I);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)),er&&Ys<=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=f.resolve(v.start),_=b.sameParent(k)&&b.parent.inlineContent&&E.end()>=v.endA;if((fl&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(I=>I.nodeName=="DIV"||I.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",I=>I(t,Fi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>v.start&&c$(f,v.start,v.endA,b,k)&&t.someProp("handleKeyDown",I=>I(t,Fi(8,"Backspace")))){Go&&wn&&t.domObserver.suppressSelectionUpdates();return}wn&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),Go&&!_&&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(I){return I(t,Fi(13,"Enter"))})},20));let T=v.start,N=v.endA,M=I=>{let P=I||t.state.tr.replace(T,N,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let O=hC(t,P.doc,d.sel);O&&!(wn&&t.composing&&O.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==P.mapping.map(N)-1)||er&&O.empty&&O.head==T)&&P.setSelection(O)}return s&&P.setMeta("composition",s),P.scrollIntoView()},D;if(_)if(b.pos==k.pos){er&&Ys<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>ts(t),20));let I=M(t.state.tr.delete(T,N)),P=f.resolve(v.start).marksAcross(f.resolve(v.endA));P&&I.ensureMarks(P),t.dispatch(I)}else if(v.endA==v.endB&&(D=u$(b.parent.content.cut(b.parentOffset,k.parentOffset),E.parent.content.cut(E.parentOffset,v.endA-E.start())))){let I=M(t.state.tr);D.type=="add"?I.addMark(T,N,D.mark):I.removeMark(T,N,D.mark),t.dispatch(I)}else if(b.parent.child(b.index()).isText&&b.index()==k.index()-(k.textOffset?0:1)){let I=b.parent.textBetween(b.parentOffset,k.parentOffset),P=()=>M(t.state.tr.insertText(I,T,N));t.someProp("handleTextInput",O=>O(t,T,N,I,P))||t.dispatch(P())}else t.dispatch(M());else t.dispatch(M())}function hC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Mx(t,e.resolve(n.anchor),e.resolve(n.head))}function u$(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,l,u;for(let f=0;f<r.length;f++)o=r[f].removeFromSet(o);for(let f=0;f<n.length;f++)s=n[f].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],i="add",u=f=>f.mark(l.addToSet(f.marks));else if(o.length==0&&s.length==1)l=s[0],i="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<e.childCount;f++)d.push(u(e.child(f)));if(oe.from(d).eq(t))return{mark:l,type:i}}function c$(t,e,n,r,o){if(n-e<=o.pos-r.pos||bg(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(bg(s,!0,!0));return!i.parent.isTextblock||i.pos>n||bg(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function bg(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 d$(t,e,n,r,o){let s=t.findDiffStart(e,n),i=n+t.size,l=n+e.size;if(s==null)return null;let{a:u,b:d}=t.findDiffEnd(e,i,l);if(o=="end"){let f=Math.max(0,s-Math.min(u,d));r-=u+f-s}if(u<s&&i<l){let f=r<=s&&r>=u?s-r:0;s-=f,d=s+(d-u),u=s}else if(d<s){let f=r<=s&&r>=d?s-r:0;s-=f,u=s+(u-d),d=s}return{start:s,endA:u,endB:d}}class r6{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 TF,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(xC),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=gC(this),mC(this),this.nodeViews=yC(this),this.docView=Zw(this.state.doc,pC(this),vg(this),this.dom,this),this.domObserver=new e$(this,(r,o,s,i)=>l$(this,r,o,s,i)),this.domObserver.start(),AF(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&&Q1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(xC),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&&(Z4(this),i=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=yC(this);h$(y,this.nodeViews)&&(this.nodeViews=y,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Q1(this),this.editable=gC(this),mC(this);let u=vg(this),d=pC(this),f=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(o.selection))&&(i=!0);let m=f=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Vz(this);if(i){this.domObserver.stop();let y=h&&(er||wn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&f$(o.selection,e.selection);if(h){let b=wn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=HF(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Zw(e.doc,d,u,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(y=!0)}let v=this.input.mouseDown;y||!(v&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&fF(this)&&v.delaySelUpdate())?ts(this,y):(j4(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),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&Hz(m)}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&&Ww(this,n.getBoundingClientRect(),e)}else Ww(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 X4(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 l=this.directPlugins[i].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let l=s[i].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(er){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&&Uz(this.dom),ts(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 Jz(this,e)}coordsAtPos(e,n=1){return A4(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 eF(this,n||this.state,e)}pasteHTML(e,n){return dc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return dc(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Dx(this,e)}destroy(){this.docView&&(NF(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Rz())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return DF(this,e)}domSelectionRange(){let e=this.domSelection();return e?Nn&&this.root.nodeType===11&&Lz(this.dom.ownerDocument)==this.dom&&n$(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}r6.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function pC(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"),[jn.node(0,t.state.doc.content.size,e)]}function mC(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:jn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function gC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function f$(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 yC(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 h$(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 xC(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 ui={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:"'"},mh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},p$=typeof navigator<"u"&&/Mac/.test(navigator.platform),m$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var kn=0;kn<10;kn++)ui[48+kn]=ui[96+kn]=String(kn);for(var kn=1;kn<=24;kn++)ui[kn+111]="F"+kn;for(var kn=65;kn<=90;kn++)ui[kn]=String.fromCharCode(kn+32),mh[kn]=String.fromCharCode(kn);for(var kg in ui)mh.hasOwnProperty(kg)||(mh[kg]=ui[kg]);function g$(t){var e=p$&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||m$&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?mh:ui)[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 y$=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),x$=typeof navigator<"u"&&/Win/.test(navigator.platform);function v$(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l++){let u=e[l];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))y$?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 b$(t){let e=Object.create(null);for(let n in t)e[v$(n)]=t[n];return e}function wg(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 k$(t){return new Ct({props:{handleKeyDown:o6(t)}})}function o6(t){let e=b$(t);return function(n,r){let o=g$(r),s,i=e[wg(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[wg(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(x$&&r.ctrlKey&&r.altKey)&&(s=ui[r.keyCode])&&s!=o){let l=e[wg(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var w$=Object.defineProperty,Lx=(t,e)=>{for(var n in e)w$(t,n,{get:e[n],enumerable:!0})};function Ip(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 Pp=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,l])=>[i,(...d)=>{const f=l(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),f}]))}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=[],l=!!t,u=t||o.tr,d=()=>(!l&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),i.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(n).map(([h,m])=>[h,(...v)=>{const b=this.buildProps(u,e),k=m(...v)(b);return i.push(k),f}])),run:d};return f}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(([l,u])=>[l,(...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:Ip({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(([l,u])=>[l,(...d)=>u(...d)(i)]))}};return i}},s6={};Lx(s6,{blur:()=>C$,clearContent:()=>S$,clearNodes:()=>E$,command:()=>_$,createParagraphNear:()=>T$,cut:()=>A$,deleteCurrentNode:()=>N$,deleteNode:()=>M$,deleteRange:()=>D$,deleteSelection:()=>I$,enter:()=>P$,exitCode:()=>j$,extendMarkRange:()=>L$,first:()=>z$,focus:()=>$$,forEach:()=>B$,insertContent:()=>V$,insertContentAt:()=>U$,insertDefaultBlock:()=>W$,joinBackward:()=>G$,joinDown:()=>K$,joinForward:()=>J$,joinItemBackward:()=>Z$,joinItemForward:()=>Y$,joinTextblockBackward:()=>X$,joinTextblockForward:()=>Q$,joinUp:()=>q$,keyboardShortcut:()=>tB,lift:()=>nB,liftEmptyBlock:()=>rB,liftListItem:()=>oB,newlineInCode:()=>sB,resetAttributes:()=>iB,scrollIntoView:()=>aB,selectAll:()=>lB,selectNodeBackward:()=>uB,selectNodeForward:()=>cB,selectParentNode:()=>dB,selectTextblockEnd:()=>fB,selectTextblockStart:()=>hB,setContent:()=>pB,setMark:()=>IB,setMeta:()=>PB,setNode:()=>jB,setNodeSelection:()=>LB,setTextDirection:()=>zB,setTextSelection:()=>FB,sinkListItem:()=>$B,splitBlock:()=>BB,splitListItem:()=>VB,toggleList:()=>UB,toggleMark:()=>WB,toggleNode:()=>qB,toggleWrap:()=>KB,undoInputRule:()=>GB,unsetAllMarks:()=>JB,unsetMark:()=>ZB,unsetTextDirection:()=>YB,updateAttributes:()=>XB,wrapIn:()=>QB,wrapInList:()=>eV});var C$=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),S$=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),E$=()=>({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,(l,u)=>{if(l.type.isText)return;const{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),y=h.blockRange(m);if(!y)return;const v=_l(y);if(l.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(y.start,b)}(v||v===0)&&e.lift(y,v)})}),!0},_$=t=>e=>t(e),T$=()=>({state:t,dispatch:e})=>y4(t,e),A$=(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},N$=()=>({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 l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1};function Vt(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 M$=t=>({tr:e,state:n,dispatch:r})=>{const o=Vt(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},D$=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},R$=t=>t.content?/^text(\*|\+)/.test(t.content):!1,vC=(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 R$(r)?n==="left"?t.start()-1:t.end()+1:t.pos},O$=(t,e,n)=>{const r=vC(t,n,"left"),o=vC(e,n,"right");return{from:r,to:o}},I$=()=>({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),l=n.doc.resolve(i.map(s.$from.pos)),u=n.doc.resolve(i.map(s.$to.pos)),{from:d,to:f}=O$(l,u,t.schema);n.deleteRange(d,f)}),n.selection.empty||n.setSelection(ze.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},P$=()=>({commands:t})=>t.keyboardShortcut("Enter"),j$=()=>({state:t,dispatch:e})=>yz(t,e);function zx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function gh(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:zx(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function i6(t,e,n={}){return t.find(r=>r.type===e&&gh(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function bC(t,e,n={}){return!!i6(t,e,n)}function Fx(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(f=>f.type===e);d&&(n=d.attrs)}if(!i6([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,l=s+1,u=i+r.node.nodeSize;for(;s>0&&bC([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&bC([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:i,to:u}}function ds(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 L$=(t,e)=>({tr:n,state:r,dispatch:o})=>{const s=ds(t,r.schema),{doc:i,selection:l}=n,{$from:u,from:d,to:f}=l;if(o){const h=Fx(u,s,e);if(h&&h.from<=d&&h.to>=f){const m=ze.create(i,h.from,h.to);n.setSelection(m)}}return!0},z$=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 a6(t){return t instanceof ze}function Hi(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ey(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,Hi(0,o,s),Hi(t.content.size,o,s)):ze.create(t,Hi(e,o,s),Hi(e,o,s))}function kC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function yh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function F$(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var $$=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(yh()||kC())&&r.dom.focus(),F$()&&!yh()&&!kC()&&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&&!a6(n.state.selection))return i(),!0;const l=ey(o.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||o.setSelection(l),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},B$=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),V$=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),l6=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&&l6(r)}return t};function wf(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 l6(n)}function hl(t,e,n){if(t instanceof Zs||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(l=>e.nodeFromJSON(l)));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),hl("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,l="";const u=new vx({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,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Qo.fromSchema(u).parseSlice(wf(t),n.parseOptions):Qo.fromSchema(u).parse(wf(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Qo.fromSchema(e);return n.slice?s.parseSlice(wf(t),n.parseOptions).content:s.parse(wf(t),n.parseOptions)}return hl("",e,n)}function u6(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof $t||o instanceof hn))return;const s=t.mapping.maps[r];let i=0;s.forEach((l,u,d,f)=>{i===0&&(i=f)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}var H$=t=>!("type"in t),U$=(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 l;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{hl(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(k){u(k)}try{l=hl(e,s.schema,{parseOptions:d,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(k){return u(k),!1}let{from:f,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,y=!0;if((H$(l)?l:[l]).forEach(k=>{k.check(),m=m?k.isText&&k.marks.length===0:!1,y=y?k.isBlock:!1}),f===h&&y){const{parent:k}=r.doc.resolve(f);k.isTextblock&&!k.type.spec.code&&!k.childCount&&(f-=1,h+=1)}let b;if(m){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,f,h)}else{b=l;const k=r.doc.resolve(f),E=k.node(),_=k.parentOffset===0,T=E.isText||E.isTextblock,N=E.content.size>0;_&&T&&N&&y&&(f=Math.max(0,f-1)),r.replaceWith(f,h,b)}n.updateSelection&&u6(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0};function c6(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 W$=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:o,attrs:s,content:i,updateSelection:l=!0}=t;let u;typeof o=="number"?u=e.doc.resolve(o):o?u=o:u=e.selection.$from;const d=c6(u.parent.contentMatchAt(u.index()));if(!d)return!1;const f=Object.keys(d.spec.attrs||{}),h=s?Object.fromEntries(Object.entries(s).filter(([y])=>f.includes(y))):{};let m;if(i){const y=hl(i,r.schema);m=d.createAndFill(h,y)}else m=d.createAndFill(h);return m?(n&&(e.insert(u.pos,m),l&&u6(e,e.steps.length-1,-1)),!0):!1},q$=()=>({state:t,dispatch:e})=>pz(t,e),K$=()=>({state:t,dispatch:e})=>mz(t,e),G$=()=>({state:t,dispatch:e})=>c4(t,e),J$=()=>({state:t,dispatch:e})=>p4(t,e),Z$=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Np(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Y$=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Np(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},X$=()=>({state:t,dispatch:e})=>fz(t,e),Q$=()=>({state:t,dispatch:e})=>hz(t,e);function d6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function eB(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l+=1){const u=e[l];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))yh()||d6()?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 tB=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=eB(t).split(/-(?!$)/),i=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=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,l))});return u==null||u.steps.forEach(d=>{const f=d.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function ci(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Vt(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(h,m)=>{if(h.isText)return;const y=Math.max(r,m),v=Math.min(o,m+h.nodeSize);l.push({node:h,from:y,to:v})});const u=o-r,d=l.filter(h=>i?i.name===h.node.type.name:!0).filter(h=>gh(h.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var nB=(t,e={})=>({state:n,dispatch:r})=>{const o=Vt(t,n.schema);return ci(n,o,e)?gz(n,r):!1},rB=()=>({state:t,dispatch:e})=>x4(t,e),oB=t=>({state:e,dispatch:n})=>{const r=Vt(t,e.schema);return Az(r)(e,n)},sB=()=>({state:t,dispatch:e})=>g4(t,e);function jp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function wC(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 iB=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=jp(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=Vt(t,r.schema)),l==="mark"&&(i=ds(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,h)=>{s&&s===f.type&&(u=!0,o&&n.setNodeMarkup(h,void 0,wC(f.attrs,e))),i&&f.marks.length&&f.marks.forEach(m=>{i===m.type&&(u=!0,o&&n.addMark(h,h+f.nodeSize,i.create(wC(m.attrs,e))))})})}),u},aB=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),lB=()=>({tr:t,dispatch:e})=>{if(e){const n=new ur(t.doc);t.setSelection(n)}return!0},uB=()=>({state:t,dispatch:e})=>f4(t,e),cB=()=>({state:t,dispatch:e})=>m4(t,e),dB=()=>({state:t,dispatch:e})=>bz(t,e),fB=()=>({state:t,dispatch:e})=>Cz(t,e),hB=()=>({state:t,dispatch:e})=>wz(t,e);function ty(t,e,n={},r={}){return hl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var pB=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=ty(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),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function f6(t,e){const n=ds(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 l=i.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function h6(t,e){const n=new s4(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function mB(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function gB(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 Lp(t){return e=>gB(e.$from,t)}function Me(t,e,n){return t.config[e]===void 0&&t.parent?Me(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Me(t.parent,e,n):null}):t.config[e]}function $x(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Me(e,"addExtensions",n);return r?[e,...$x(r())]:e}).flat(10)}function Hc(t,e){const n=pa.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function p6(t){return typeof t=="function"}function lt(t,e=void 0,...n){return p6(t)?e?t.bind(e)(...n):t(...n):t}function yB(t={}){return Object.keys(t).length===0&&t.constructor===Object}function pl(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 m6(t){const e=[],{nodeExtensions:n,markExtensions:r}=pl(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),l=r.map(d=>d.name),u=[...i,...l];return t.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage,extensions:o},h=Me(d,"addGlobalAttributes",f);if(!h)return;h().forEach(y=>{let v;Array.isArray(y.types)?v=y.types:y.types==="*"?v=u:y.types==="nodes"?v=i:y.types==="marks"?v=l:v=[],v.forEach(b=>{Object.entries(y.attributes).forEach(([k,E])=>{e.push({type:b,name:k,attribute:{...s,...E}})})})})}),o.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage},h=Me(d,"addAttributes",f);if(!h)return;const m=h();Object.entries(m).forEach(([y,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:y,attribute:b})})}),e}function xB(t){const e=[];let n="",r=!1,o=!1,s=0;const i=t.length;for(let l=0;l<i;l+=1){const u=t[l];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 CC(t){const e=[],n=xB(t||""),r=n.length;for(let o=0;o<r;o+=1){const s=n[o],i=s.indexOf(":");if(i===-1)continue;const l=s.slice(0,i).trim(),u=s.slice(i+1).trim();l&&u&&e.push([l,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 l=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],d=l.filter(f=>!u.includes(f));r[o]=[...u,...d].join(" ")}else if(o==="style"){const l=new Map([...CC(r[o]),...CC(s)]);r[o]=Array.from(l.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=s}),r},{})}function hc(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 vB(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function SC(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 l=i.attribute.parseHTML?i.attribute.parseHTML(n):vB(n.getAttribute(i.name));return l==null?s:{...s,[i.name]:l}},{});return{...r,...o}}}}function EC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&yB(n)?!1:n!=null))}function _C(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 bB(t,e){var n;const r=m6(t),{nodeExtensions:o,markExtensions:s}=pl(t),i=(n=o.find(d=>Me(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(o.map(d=>{const f=r.filter(E=>E.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((E,_)=>{const T=Me(_,"extendNodeSchema",h);return{...E,...T?T(d):{}}},{}),y=EC({...m,content:lt(Me(d,"content",h)),marks:lt(Me(d,"marks",h)),group:lt(Me(d,"group",h)),inline:lt(Me(d,"inline",h)),atom:lt(Me(d,"atom",h)),selectable:lt(Me(d,"selectable",h)),draggable:lt(Me(d,"draggable",h)),code:lt(Me(d,"code",h)),whitespace:lt(Me(d,"whitespace",h)),linebreakReplacement:lt(Me(d,"linebreakReplacement",h)),defining:lt(Me(d,"defining",h)),isolating:lt(Me(d,"isolating",h)),attrs:Object.fromEntries(f.map(_C))}),v=lt(Me(d,"parseHTML",h));v&&(y.parseDOM=v.map(E=>SC(E,f)));const b=Me(d,"renderHTML",h);b&&(y.toDOM=E=>b({node:E,HTMLAttributes:hc(E,f)}));const k=Me(d,"renderText",h);return k&&(y.toText=k),[d.name,y]})),u=Object.fromEntries(s.map(d=>{const f=r.filter(k=>k.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((k,E)=>{const _=Me(E,"extendMarkSchema",h);return{...k,..._?_(d):{}}},{}),y=EC({...m,inclusive:lt(Me(d,"inclusive",h)),excludes:lt(Me(d,"excludes",h)),group:lt(Me(d,"group",h)),spanning:lt(Me(d,"spanning",h)),code:lt(Me(d,"code",h)),attrs:Object.fromEntries(f.map(_C))}),v=lt(Me(d,"parseHTML",h));v&&(y.parseDOM=v.map(k=>SC(k,f)));const b=Me(d,"renderHTML",h);return b&&(y.toDOM=k=>b({mark:k,HTMLAttributes:hc(k,f)})),[d.name,y]}));return new vx({topNode:i,nodes:l,marks:u})}function kB(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Du(t){return t.sort((n,r)=>{const o=Me(n,"priority")||100,s=Me(r,"priority")||100;return o>s?-1:o<s?1:0})}function g6(t){const e=Du($x(t)),n=kB(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 y6(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
|
|
453
|
-
|
|
454
|
-
`,textSerializers:i={}}=n||{};let l="";return t.nodesBetween(r,o,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=s);const y=i==null?void 0:i[u.type.name];if(y)return f&&(l+=y({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u==null?void 0:u.text)==null?void 0:m.slice(Math.max(r,d)-d,o-d))}),l}function wB(t,e){const n={from:0,to:t.content.size};return y6(t,n,e)}function x6(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function CB(t,e){const n=Vt(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const i=s.reverse().find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function v6(t,e){const n=jp(typeof e=="string"?e:e.name,t.schema);return n==="node"?CB(t,e):n==="mark"?f6(t,e):{}}function SB(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 EB(t){const e=SB(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 Bx(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((l,u)=>{i.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;i.push({from:l,to:u})}i.forEach(({from:l,to:u})=>{const d=e.slice(s).map(l,-1),f=e.slice(s).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),EB(r)}function Vx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=Fx(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 _B=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const l=o.node(s);(l==null?void 0:l.type.name)===e?i=l:s-=1}return[i,s]};function pu(t,e){return e.nodes[t]||e.marks[t]||null}function Uf(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 TB=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,l)=>{var u,d;const f=((d=(u=o.type.spec).toText)==null?void 0:d.call(u,{node:o,pos:s,parent:i,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?f:f.slice(0,Math.max(0,r-s))}),n};function ny(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?ds(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>gh(h.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:h,$to:m})=>{const y=h.pos,v=m.pos;t.doc.nodesBetween(y,v,(b,k)=>{if(s&&b.inlineContent&&!b.type.allowsMarkType(s))return!1;if(!b.isText&&!b.marks.length)return;const E=Math.max(y,k),_=Math.min(v,k+b.nodeSize),T=_-E;i+=T,l.push(...b.marks.map(N=>({mark:N,from:E,to:_})))})}),i===0)return!1;const u=l.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>gh(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=i}function AB(t,e,n={}){if(!e)return ci(t,null,n)||ny(t,null,n);const r=jp(e,t.schema);return r==="node"?ci(t,e,n):r==="mark"?ny(t,e,n):!1}var NB=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=Lp(l=>l.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)},MB=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function TC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Cg(t,e){const{nodeExtensions:n}=pl(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(Me(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Uc(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&&(Uc(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function b6(t){return t instanceof Ie}var k6=class w6{constructor(e){this.position=e}static fromJSON(e){return new w6(e.position)}toJSON(){return{position:this.position}}};function DB(t,e){const n=e.mapping.mapResult(t.position);return{position:new k6(n.pos),mapResult:n}}function RB(t){return new k6(t)}function OB(t,e,n){var r;const{selection:o}=e;let s=null;if(a6(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){const y=!m||m.type.allowsMarkType(n),v=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));d=y&&v}return!d}),d})}var IB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,u=ds(t,r.schema);if(o)if(i){const d=f6(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{const f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,y)=>{const v=Math.max(y,f),b=Math.min(y+m.nodeSize,h);m.marks.find(E=>E.type===u)?m.marks.forEach(E=>{u===E.type&&n.addMark(v,b,u.create({...E.attrs,...e}))}):n.addMark(v,b,u.create(e))})});return OB(r,n,u)},PB=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),jB=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Vt(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>Vw(s,{...i,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Vw(s,{...i,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LB=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Hi(t,0,r.content.size),s=Ie.create(r,o);e.setSelection(s)}return!0},zB=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,l;return typeof e=="number"?(i=e,l=e):e&&"from"in e&&"to"in e?(i=e.from,l=e.to):(i=s.from,l=s.to),o&&n.doc.nodesBetween(i,l,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},FB=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,l=ze.atEnd(r).to,u=Hi(o,i,l),d=Hi(s,i,l),f=ze.create(r,u,d);e.setSelection(f)}return!0},$B=t=>({state:e,dispatch:n})=>{const r=Vt(t,e.schema);return Dz(r)(e,n)};function AC(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 BB=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:l,$to:u}=s,d=o.extensionManager.attributes,f=Uf(d,l.node().type.name,l.node().attrs);if(s instanceof Ie&&s.node.isBlock)return!l.parentOffset||!es(i,l.pos)?!1:(r&&(t&&AC(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:c6(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=h&&m?[{type:m,attrs:f}]:void 0,v=es(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!v&&es(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(v=!0,y=m?[{type:m,attrs:f}]:void 0),r){if(v&&(s instanceof ze&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,y),m&&!h&&!l.parentOffset&&l.parent.type!==m)){const b=e.mapping.map(l.before()),k=e.doc.resolve(b);l.node(-1).canReplaceWith(k.index(),k.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&AC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return v},VB=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=Vt(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;const h=u.node(-1);if(h.type!==l)return!1;const m=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||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,N={...Uf(m,u.node().type.name,u.node().attrs),...e},M=((i=l.contentMatch.defaultType)==null?void 0:i.createAndFill(N))||void 0;E=E.append(oe.from(l.createAndFill(null,M)||void 0));const D=u.before(u.depth-(_-1));n.replace(D,u.after(-T),new xe(E,4-_,0));let I=-1;n.doc.nodesBetween(D,n.doc.content.size,(P,O)=>{if(I>-1)return!1;P.isTextblock&&P.content.size===0&&(I=O+1)}),I>-1&&n.setSelection(ze.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const y=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,v={...Uf(m,h.type.name,h.attrs),...e},b={...Uf(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const k=y?[{type:l,attrs:v},{type:y,attrs:b}]:[{type:l,attrs:v}];if(!es(n.doc,u.pos,2))return!1;if(o){const{selection:E,storedMarks:_}=r,{splittableMarks:T}=s.extensionManager,N=_||E.$to.parentOffset&&E.$from.marks();if(n.split(u.pos,2,k).scrollIntoView(),!N||!o)return!0;const M=N.filter(D=>T.includes(D.type.name));n.ensureMarks(M)}return!0};function NC(t){return!t||t==="1"?null:t}function C6(t,e){return NC(t)===NC(e)}var Sg=(t,e)=>{const n=Lp(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)&&yi(t.doc,n.pos))||!C6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(n.pos),!0},Eg=(t,e)=>{const n=Lp(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)&&yi(t.doc,r))||!C6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(r),!0};function HB(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 UB=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:u,commands:d,can:f})=>{const{extensions:h,splittableMarks:m}=o.extensionManager,y=Vt(t,i.schema),v=Vt(e,i.schema),{selection:b,storedMarks:k}=i,{$from:E,$to:_}=b,T=E.blockRange(_),N=k||b.$to.parentOffset&&b.$from.marks();if(!T)return!1;const M=Lp(K=>Cg(K.type.name,h))(b),D=b.from===0&&b.to===i.doc.content.size,I=i.doc.content.content,P=I.length===1?I[0]:null,O=D&&P&&Cg(P.type.name,h)?{node:P,pos:0}:null,W=M??O,Z=!!M&&T.depth>=1&&T.depth-M.depth<=1,J=!!O;if((Z||J)&&W){if(W.node.type===y)return D&&J?u().command(({tr:K,dispatch:Y})=>{const ee=HB(K);return ee?(K.setSelection(ee),Y&&Y(K),!0):!1}).liftListItem(v).run():d.liftListItem(v);if(Cg(W.node.type.name,h)&&y.validContent(W.node.content))return u().command(()=>(s.setNodeMarkup(W.pos,y),!0)).command(()=>Sg(s,y)).command(()=>Eg(s,y)).run()}return!n||!N||!l?u().command(()=>f().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>Sg(s,y)).command(()=>Eg(s,y)).run():u().command(()=>{const K=f().wrapInList(y,r),Y=N.filter(ee=>m.includes(ee.type.name));return s.ensureMarks(Y),K?!0:d.clearNodes()}).wrapInList(y,r).command(()=>Sg(s,y)).command(()=>Eg(s,y)).run()},WB=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=ds(t,r.schema);return ny(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},qB=(t,e,n={})=>({state:r,commands:o})=>{const s=Vt(t,r.schema),i=Vt(e,r.schema),l=ci(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?o.setNode(i,u):o.setNode(s,{...u,...n})},KB=(t,e={})=>({state:n,commands:r})=>{const o=Vt(t,n.schema);return ci(n,o,e)?r.lift(o):r.wrapIn(o,e)},GB=()=>({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,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)i.step(l.steps[u].invert(l.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},JB=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:i,ranges:l}=s;if(i)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(f=>o||!u.includes(f.name));l.forEach(f=>{for(const h of d)e.removeMark(f.$from.pos,f.$to.pos,h)})}return!0},ZB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:l}=n,u=ds(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!o)return!0;if(f&&i){let{from:m,to:y}=l;const v=(s=d.marks().find(k=>k.type===u))==null?void 0:s.attrs,b=Fx(d,u,v);b&&(m=b.from,y=b.to),n.removeMark(m,y,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},YB=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,(l,u)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},XB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=jp(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=Vt(t,r.schema)),l==="mark"&&(i=ds(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const f=d.$from.pos,h=d.$to.pos;let m,y,v,b;n.selection.empty?r.doc.nodesBetween(f,h,(k,E)=>{s&&s===k.type&&(u=!0,v=Math.max(E,f),b=Math.min(E+k.nodeSize,h),m=E,y=k)}):r.doc.nodesBetween(f,h,(k,E)=>{E<f&&s&&s===k.type&&(u=!0,v=Math.max(E,f),b=Math.min(E+k.nodeSize,h),m=E,y=k),E>=f&&E<=h&&(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,f),N=Math.min(E+k.nodeSize,h);n.addMark(T,N,i.create({..._.attrs,...e}))}}))}),y&&(m!==void 0&&o&&n.setNodeMarkup(m,void 0,{...y.attrs,...e}),i&&y.marks.length&&y.marks.forEach(k=>{i===k.type&&o&&n.addMark(v,b,i.create({...k.attrs,...e}))}))}),u},QB=(t,e={})=>({state:n,dispatch:r})=>{const o=Vt(t,n.schema);return Sz(o,e)(n,r)},eV=(t,e={})=>({state:n,dispatch:r})=>{const o=Vt(t,n.schema);return Ez(o,e)(n,r)},tV=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 nV(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 rV(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 oV(t){return typeof t=="number"}function sV(t){return Object.prototype.toString.call(t).slice(8,-1)}function Cf(t){return sV(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var iV={};Lx(iV,{createAtomBlockMarkdownSpec:()=>aV,createBlockMarkdownSpec:()=>lV,createInlineMarkdownSpec:()=>dV,parseAttributes:()=>Hx,parseIndentedBlocks:()=>ry,renderNestedMarkdownContent:()=>Wx,serializeAttributes:()=>Ux});function Hx(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(f=>f.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,f])=>{var h;const m=parseInt(((h=f.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),y=n[m];y&&(e[d]=y.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(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(e[f]=!0)}),e}function Ux(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 aV(t){const{nodeName:e,name:n,parseAttributes:r=Hx,serializeAttributes:o=Ux,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:l}=t,u=n||e,d=f=>{if(!l)return f;const h={};return l.forEach(m=>{m in f&&(h[m]=f[m])}),h};return{parseMarkdown:(f,h)=>{const m={...s,...f.attributes};return h.createNode(e,m,[])},markdownTokenizer:{name:e,level:"block",start(f){var h;const m=new RegExp(`^:::${u}(?:\\s|$)`,"m"),y=(h=f.match(m))==null?void 0:h.index;return y!==void 0?y:-1},tokenize(f,h,m){const y=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=f.match(y);if(!v)return;const b=v[1]||"",k=r(b);if(!i.find(_=>!(_ in k)))return{type:e,raw:v[0],attributes:k}}},renderMarkdown:f=>{const h=d(f.attrs||{}),m=o(h),y=m?` {${m}}`:"";return`:::${u}${y} :::`}}}function lV(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Hx,serializeAttributes:s=Ux,defaultAttributes:i={},content:l="block",allowedAttributes:u}=t,d=n||e,f=h=>{if(!u)return h;const m={};return u.forEach(y=>{y in h&&(m[y]=h[y])}),m};return{parseMarkdown:(h,m)=>{let y;if(r){const b=r(h);y=typeof b=="string"?[{type:"text",text:b}]:b}else l==="block"?y=m.parseChildren(h.tokens||[]):y=m.parseInline(h.tokens||[]);const v={...i,...h.attributes};return m.createNode(e,v,y)},markdownTokenizer:{name:e,level:"block",start(h){var m;const y=new RegExp(`^:::${d}`,"m"),v=(m=h.match(y))==null?void 0:m.index;return v!==void 0?v:-1},tokenize(h,m,y){var v;const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),k=h.match(b);if(!k)return;const[E,_=""]=k,T=o(_);let N=1;const M=E.length;let D="";const I=/^:::([\w-]*)(\s.*)?/gm,P=h.slice(M);for(I.lastIndex=0;;){const O=I.exec(P);if(O===null)break;const W=O.index,Z=O[1];if(!((v=O[2])!=null&&v.endsWith(":::"))){if(Z)N+=1;else if(N-=1,N===0){const J=P.slice(0,W);D=J.trim();const K=h.slice(0,M+W+O[0].length);let Y=[];if(D)if(l==="block")for(Y=y.blockTokens(J),Y.forEach(ee=>{ee.text&&(!ee.tokens||ee.tokens.length===0)&&(ee.tokens=y.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=y.inlineTokens(D);return{type:e,raw:K,attributes:T,content:D,tokens:Y}}}}}},renderMarkdown:(h,m)=>{const y=f(h.attrs||{}),v=s(y),b=v?` {${v}}`:"",k=m.renderChildren(h.content||[],`
|
|
455
|
-
|
|
456
|
-
`);return`:::${d}${b}
|
|
457
|
-
|
|
458
|
-
${k}
|
|
459
|
-
|
|
460
|
-
:::`}}}function uV(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 cV(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function dV(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=uV,serializeAttributes:s=cV,defaultAttributes:i={},selfClosing:l=!1,allowedAttributes:u}=t,d=n||e,f=m=>{if(!u)return m;const y={};return u.forEach(v=>{const b=typeof v=="string"?v:v.name,k=typeof v=="string"?void 0:v.skipIfDefault;if(b in m){const E=m[b];if(k!==void 0&&E===k)return;y[b]=E}}),y},h=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,y)=>{const v={...i,...m.attributes};if(l)return y.createNode(e,v);const b=r?r(m):m.content||"";return b?y.createNode(e,v,[y.createTextNode(b)]):y.createNode(e,v,[])},markdownTokenizer:{name:e,level:"inline",start(m){const y=l?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),v=m.match(y),b=v==null?void 0:v.index;return b!==void 0?b:-1},tokenize(m,y,v){const b=l?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),k=m.match(b);if(!k)return;let E="",_="";if(l){const[,N]=k;_=N}else{const[,N,M]=k;_=N,E=M||""}const T=o(_.trim());return{type:e,raw:k[0],content:E.trim(),attributes:T}}},renderMarkdown:m=>{let y="";r?y=r(m):m.content&&m.content.length>0&&(y=m.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const v=f(m.attrs||{}),b=s(v),k=b?` ${b}`:"";return l?`[${d}${k}]`:`[${d}${k}]${y}[/${d}]`}}}function ry(t,e,n){var r,o,s,i;const l=t.split(`
|
|
461
|
-
`),u=[];let d="",f=0;const h=e.baseIndentSize||2;for(;f<l.length;){const m=l[f],y=m.match(e.itemPattern);if(!y){if(u.length>0)break;if(m.trim()===""){f+=1,d=`${d}${m}
|
|
462
|
-
`;continue}else return}const v=e.extractItemData(y),{indentLevel:b,mainContent:k}=v;d=`${d}${m}
|
|
463
|
-
`;const E=[k];for(f+=1;f<l.length;){const M=l[f];if(M.trim()===""){const I=l.slice(f+1).findIndex(W=>W.trim()!=="");if(I===-1)break;if((((o=(r=l[f+1+I].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>b){E.push(M),d=`${d}${M}
|
|
464
|
-
`,f+=1;continue}else break}if((((i=(s=M.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:i.length)||0)>b)E.push(M),d=`${d}${M}
|
|
465
|
-
`,f+=1;else break}let _;const T=E.slice(1);if(T.length>0){const M=T.map(D=>D.slice(b+h)).join(`
|
|
466
|
-
`);M.trim()&&(e.customNestedParser?_=e.customNestedParser(M):_=n.blockTokens(M))}const N=e.createToken(v,_);u.push(N)}if(u.length!==0)return{items:u,raw:d}}function Wx(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[s,...i]=t.content,l=e.renderChildren([s]);let u=`${o}${l}`;return i&&i.length>0&&i.forEach((d,f)=>{var h,m;const y=(m=(h=e.renderChild)==null?void 0:h.call(e,d,f+1))!=null?m:e.renderChildren([d]);if(y!=null){const v=y.split(`
|
|
467
|
-
`).map(b=>b?e.indent(b):e.indent("")).join(`
|
|
468
|
-
`);u+=d.type==="paragraph"?`
|
|
469
|
-
|
|
470
|
-
${v}`:`
|
|
471
|
-
${v}`}}),u}function S6(t,e){const n={...t};return Cf(t)&&Cf(e)&&Object.keys(e).forEach(r=>{Cf(e[r])&&Cf(t[r])?n[r]=S6(t[r],e[r]):n[r]=e[r]}),n}function fV(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((l,u)=>{const d=s.mapping.map(u),f=s.mapping.map(u)+l.nodeSize;let h=null;if(l.marks.forEach(y=>{if(y!==i)return!1;h=y}),!h)return;let m=!1;if(Object.keys(n).forEach(y=>{n[y]!==h.attrs[y]&&(m=!0)}),m){const y=t.type.create({...t.attrs,...n});s.removeMark(d,f,t.type),s.addMark(d,f,y)}}),s.docChanged&&e.view.dispatch(s)}var Wc=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},hV=(t,e)=>{if(zx(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 Sf(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=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(m=>m.type.spec.code))return!1;let f=!1;const h=TB(d)+s;return i.forEach(m=>{if(f)return;const y=hV(h,m.find);if(!y)return;const v=y[0].length-s.length;if(v>0){const D=d.parentOffset-v;if(D<0||d.parent.textBetween(D,d.parentOffset)!==y[0].slice(0,v))return}const b=u.state.tr,k=Ip({state:u.state,transaction:b}),E={from:r-(y[0].length-s.length),to:o},{commands:_,chain:T,can:N}=new Pp({editor:n,state:k});m.handler({state:k,range:E,match:y,commands:_,chain:T,can:N})===null||!b.steps.length||(m.undoable&&b.setMeta(l,{transform:b,from:r,to:o,text:s}),u.dispatch(b),f=!0)}),f}function pV(t){const{editor:e,rules:n}=t,r=new Ct({state:{init(){return null},apply(o,s,i){const l=o.getMeta(r);if(l)return l;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Hc(oe.from(f),i.schema);const{from:h}=u,m=h+f.length;Sf({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,l){return Sf({editor:e,from:s,to:i,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Sf({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?Sf({editor:e,from:i.pos,to:i.pos,text:`
|
|
472
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var qx=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(Me(this,"addOptions",{name:this.name}))}}get storage(){return{...lt(Me(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>S6(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}},hr=class E6 extends qx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new E6(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)}},_6=class{constructor(t){this.find=t.find,this.handler=t.handler}},mV=(t,e,n)=>{if(zx(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 gV(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Pp({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,o,(y,v)=>{var b,k,E,_,T;if((k=(b=y.type)==null?void 0:b.spec)!=null&&k.code||!(y.isText||y.isTextblock||y.isInline))return;const N=(T=(_=(E=y.content)==null?void 0:E.size)!=null?_:y.nodeSize)!=null?T:0,M=Math.max(r,v),D=Math.min(o,v+N);if(M>=D)return;const I=y.isText?y.text||"":y.textBetween(M-v,D-v,void 0,"");mV(I,s.find,i).forEach(O=>{if(O.index===void 0)return;const W=M+O.index+1,Z=W+O[0].length,J={from:n.tr.mapping.map(W),to:n.tr.mapping.map(Z)},K=s.handler({state:n,range:J,match:O,commands:u,chain:d,can:f,pasteEvent:i,dropEvent:l});h.push(K)})}),h.every(y=>y!==null)}var Ef=null,yV=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function xV(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const u=({state:f,from:h,to:m,rule:y,pasteEvt:v})=>{const b=f.tr,k=Ip({state:f,transaction:b});if(!(!gV({editor:e,state:k,from:Math.max(h-1,0),to:m.b-1,rule:y,pasteEvent:v,dropEvent:l})||!b.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(f=>new Ct({view(h){const m=v=>{var b;r=(b=h.dom.parentElement)!=null&&b.contains(v.target)?h.dom.parentElement:null,r&&(Ef=e)},y=()=>{Ef&&(Ef=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",y),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",y)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(s=r===h.dom.parentElement,l=m,!s){const y=Ef;y!=null&&y.isEditable&&setTimeout(()=>{const v=y.state.selection;v&&y.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(h,m)=>{var y;const v=(y=m.clipboardData)==null?void 0:y.getData("text/html");return i=m,o=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,y)=>{const v=h[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:M}=E;typeof M=="string"?M=M:M=Hc(oe.from(M),y.schema);const{from:D}=E,I=D+M.length,P=yV(M);return u({rule:f,state:y,from:D,to:{b:I},pasteEvt:P})}const T=m.doc.content.findDiffStart(y.doc.content),N=m.doc.content.findDiffEnd(y.doc.content);if(!(!oV(T)||!N||T===N.b))return u({rule:f,state:y,from:T,to:N,pasteEvt:i})}}))}var zp=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=g6(t),this.schema=bB(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:pu(e.name,this.schema)},r=Me(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Du([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:pu(r.name,this.schema)},s=[],i=Me(r,"addKeyboardShortcuts",o);let l={};if(r.type==="mark"&&Me(r,"exitable",o)&&(l.ArrowRight=()=>hr.handleExit({editor:t,mark:r})),i){const m=Object.fromEntries(Object.entries(i()).map(([y,v])=>[y,()=>v({editor:t})]));l={...l,...m}}const u=k$(l);s.push(u);const d=Me(r,"addInputRules",o);if(TC(r,t.options.enableInputRules)&&d){const m=d();if(m&&m.length){const y=pV({editor:t,rules:m}),v=Array.isArray(y)?y:[y];s.push(...v)}}const f=Me(r,"addPasteRules",o);if(TC(r,t.options.enablePasteRules)&&f){const m=f();if(m&&m.length){const y=xV({editor:t,rules:m});s.push(...y)}}const h=Me(r,"addProseMirrorPlugins",o);if(h){const m=h();s.push(...m)}return s})}get attributes(){return m6(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=pl(this.extensions);return Object.fromEntries(e.filter(n=>!!Me(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:Vt(n.name,this.schema)},s=Me(n,"addNodeView",o);if(!s)return[];const i=s();if(!i)return[];const l=(u,d,f,h,m)=>{const y=hc(u,r);return i({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:t,extension:n,HTMLAttributes:y})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Du([...this.extensions].reverse()).reduceRight((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:pu(o.name,this.schema)},i=Me(o,"dispatchTransaction",s);return i?l=>{i.call(s,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Du([...this.extensions]).reduce((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:pu(o.name,this.schema)},i=Me(o,"transformPastedHTML",s);return i?(l,u)=>{const d=r(l,u);return i.call(s,d)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=pl(this.extensions);return Object.fromEntries(e.filter(n=>!!Me(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ds(n.name,this.schema)},s=Me(n,"addMarkView",o);if(!s)return[];const i=(l,u,d)=>{const f=hc(l,r);return s()({mark:l,view:u,inline:d,editor:t,extension:n,HTMLAttributes:f,updateAttributes:h=>{fV(l,t,h)}})};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:pu(e.name,this.schema)};e.type==="mark"&&(((n=lt(Me(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name),(r=lt(Me(e,"clearable",o)))==null||r||this.nonClearableMarks.push(e.name));const s=Me(e,"onBeforeCreate",o),i=Me(e,"onCreate",o),l=Me(e,"onUpdate",o),u=Me(e,"onSelectionUpdate",o),d=Me(e,"onTransaction",o),f=Me(e,"onFocus",o),h=Me(e,"onBlur",o),m=Me(e,"onDestroy",o);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),l&&this.editor.on("update",l),u&&this.editor.on("selectionUpdate",u),d&&this.editor.on("transaction",d),f&&this.editor.on("focus",f),h&&this.editor.on("blur",h),m&&this.editor.on("destroy",m)})}};zp.resolve=g6;zp.sort=Du;zp.flatten=$x;var T6={};Lx(T6,{ClipboardTextSerializer:()=>N6,Commands:()=>M6,Delete:()=>D6,Drop:()=>R6,Editable:()=>O6,FocusEvents:()=>P6,Keymap:()=>j6,Paste:()=>L6,Tabindex:()=>z6,TextDirection:()=>F6,focusEventsPluginKey:()=>I6});var St=class A6 extends qx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new A6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},N6=St.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ct({key:new Ht("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=x6(n),{blockSeparator:i}=this.options,l={...i!==void 0?{blockSeparator:i}:{},textSerializers:s};return[...o.ranges].sort((d,f)=>d.$from.pos-f.$from.pos).map(({$from:d,$to:f})=>y6(r,{from:d.pos,to:f.pos},l)).join(i??`
|
|
473
|
-
|
|
474
|
-
`)}}})]}}),M6=St.create({name:"commands",addCommands(){return{...s6}}}),D6=St.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,l,u,d;if((d=(u=(l=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:l.filterTransaction)==null?void 0:u.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const f=h6(t.before,[t,...e]);Bx(f).forEach(y=>{f.mapping.mapResult(y.oldRange.from).deletedAfter&&f.mapping.mapResult(y.oldRange.to).deletedBefore&&f.before.nodesBetween(y.oldRange.from,y.oldRange.to,(v,b)=>{const k=b+v.nodeSize-2,E=y.oldRange.from<=b&&k<=y.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:b,to:k,newFrom:f.mapping.map(b),newTo:f.mapping.map(k),deletedRange:y.oldRange,newRange:y.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:f})})});const m=f.mapping;f.steps.forEach((y,v)=>{var b,k;if(y instanceof Ur){const E=m.slice(v).map(y.from,-1),_=m.slice(v).map(y.to),T=m.invert().map(E,-1),N=m.invert().map(_),M=E>0?(b=f.doc.nodeAt(E-1))==null?void 0:b.marks.some(I=>I.eq(y.mark)):!1,D=(k=f.doc.nodeAt(_))==null?void 0:k.marks.some(I=>I.eq(y.mark));this.editor.emit("delete",{type:"mark",mark:y.mark,from:y.from,to:y.to,deletedRange:{from:T,to:N},newRange:{from:E,to:_},partial:!!(D||M),editor:this.editor,transaction:t,combinedTransform:f})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),R6=St.create({name:"drop",addProseMirrorPlugins(){return[new Ct({key:new Ht("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),O6=St.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new Ht("editable"),props:{editable:()=>this.editor.options.editable}})]}}),I6=new Ht("focusEvents"),P6=St.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ct({key:I6,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}}}})]}}),j6=St.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:l})=>{const{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:y}=h,v=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,b=v.parent.type.spec.isolating,k=h.pos-h.parentOffset,E=b&&v.parent.childCount===1?k===h.pos:Ue.atStart(d).from===m;return!f||!y.type.isTextblock||y.textContent.length||!E||E&&h.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 yh()||d6()?s:o},addProseMirrorPlugins(){return[new Ct({key:new Ht("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:l}=e.selection,u=Ue.atStart(e.doc).from,d=Ue.atEnd(e.doc).to;if(s||!(i===u&&l===d)||!Uc(n.doc))return;const m=n.tr,y=Ip({state:n,transaction:m}),{commands:v}=new Pp({editor:this.editor,state:y});if(v.clearNodes(),!!m.steps.length)return m}})]}}),L6=St.create({name:"paste",addProseMirrorPlugins(){return[new Ct({key:new Ht("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),z6=St.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ct({key:new Ht("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),F6=St.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=pl(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 Ct({key:new Ht("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),vV=class Su{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 Su(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 Su(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 Su(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,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(l);if(!o&&!i&&u.depth<=this.depth)return;const d=new Su(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 l=0;l<i.length;l+=1){const u=i[l];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)}},bV=`.ProseMirror {
|
|
475
|
-
position: relative;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
.ProseMirror {
|
|
479
|
-
word-wrap: break-word;
|
|
480
|
-
white-space: pre-wrap;
|
|
481
|
-
white-space: break-spaces;
|
|
482
|
-
-webkit-font-variant-ligatures: none;
|
|
483
|
-
font-variant-ligatures: none;
|
|
484
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.ProseMirror [contenteditable="false"] {
|
|
488
|
-
white-space: normal;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
492
|
-
white-space: pre-wrap;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.ProseMirror pre {
|
|
496
|
-
white-space: pre-wrap;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
img.ProseMirror-separator {
|
|
500
|
-
display: inline !important;
|
|
501
|
-
border: none !important;
|
|
502
|
-
margin: 0 !important;
|
|
503
|
-
width: 0 !important;
|
|
504
|
-
height: 0 !important;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
.ProseMirror-gapcursor {
|
|
508
|
-
display: none;
|
|
509
|
-
pointer-events: none;
|
|
510
|
-
position: absolute;
|
|
511
|
-
margin: 0;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.ProseMirror-gapcursor:after {
|
|
515
|
-
content: "";
|
|
516
|
-
display: block;
|
|
517
|
-
position: absolute;
|
|
518
|
-
top: -2px;
|
|
519
|
-
width: 20px;
|
|
520
|
-
border-top: 1px solid black;
|
|
521
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
@keyframes ProseMirror-cursor-blink {
|
|
525
|
-
to {
|
|
526
|
-
visibility: hidden;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
.ProseMirror-hideselection *::selection {
|
|
531
|
-
background: transparent;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
535
|
-
background: transparent;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
.ProseMirror-hideselection * {
|
|
539
|
-
caret-color: transparent;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
543
|
-
display: block;
|
|
544
|
-
}`,kV=class extends tV{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:DB,createMappablePosition:RB},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=ey(e,this.options.autofocus);this.editorState=$i.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=rV(bV,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=p6(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?[O6,N6.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),M6,P6,j6,z6.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),R6,L6,D6,F6.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 zp(s,this)}createCommandManager(){this.commandManager=new Pp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=ty(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=ty(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=$i.create({doc:n,schema:this.schema,selection:ey(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 r6(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 l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),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 f;return(f=this.capturedTransaction)==null?void 0:f.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")),l=i==null?void 0:i.getMeta("focus"),u=i==null?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.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 v6(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return AB(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Hc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
545
|
-
|
|
546
|
-
`,textSerializers:n={}}=t||{};return wB(this.state.doc,{blockSeparator:e,textSerializers:{...x6(this.schema),...n}})}get isEmpty(){return Uc(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 vV(e,this,!1,n)}get $doc(){return this.$pos(0)}};function ia(t){return new Wc({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],l=r[0];if(i){const u=l.search(/\S/),d=n.from+l.indexOf(i),f=d+i.length;if(Vx(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(b=>b===t.type&&b!==y.mark.type)).filter(y=>y.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+u,d);const m=n.from+u+i.length;s.addMark(n.from+u,m,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function wV(t){return new Wc({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 l=n.to;const u=t.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let f=i+d;f>l?f=l:l=f+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,i+r[0].length-1),s.replaceWith(f,l,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(l))}s.scrollIntoView()},undoable:t.undoable})}function oy(t){return new Wc({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 ml(t){return new Wc({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&&wx(u,t.type,s);if(!d)return null;if(i.wrap(u,d),t.keepMarks&&t.editor){const{selection:h,storedMarks:m}=e,{splittableMarks:y}=t.editor.extensionManager,v=m||h.$to.parentOffset&&h.$from.marks();if(v){const b=v.filter(k=>y.includes(k.type.name));i.ensureMarks(b)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(h,s).run()}const f=i.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&yi(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&i.join(n.from-1)},undoable:t.undoable})}var ht=class $6 extends qx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new $6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function di(t){return new _6({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,l=r[r.length-1],u=r[0];let d=n.to;if(l){const f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(Vx(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>h).length)return null;m<n.to&&i.delete(m,n.to),h>n.from&&i.delete(n.from+f,h),d=n.from+f+l.length,i.addMark(n.from+f,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:CV,getOwnPropertySymbols:SV}=Object,{hasOwnProperty:EV}=Object.prototype;function _g(t,e){return function(r,o,s){return t(r,o,s)&&e(r,o,s)}}function _f(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),l=s.get(r);if(i&&l)return i===r&&l===n;s.set(n,r),s.set(r,n);const u=t(n,r,o);return s.delete(n),s.delete(r),u}}function _V(t){return t!=null?t[Symbol.toStringTag]:void 0}function MC(t){return CV(t).concat(SV(t))}const TV=Object.hasOwn||((t,e)=>EV.call(t,e));function ma(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const AV="__v",NV="__o",MV="_owner",{getOwnPropertyDescriptor:DC,keys:RC}=Object;function DV(t,e){return t.byteLength===e.byteLength&&xh(new Uint8Array(t),new Uint8Array(e))}function RV(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 OV(t,e){return t.byteLength===e.byteLength&&xh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function IV(t,e){return ma(t.getTime(),e.getTime())}function PV(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function jV(t,e){return t===e}function OC(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,l,u=0;for(;(i=s.next())&&!i.done;){const d=e.entries();let f=!1,h=0;for(;(l=d.next())&&!l.done;){if(o[h]){h++;continue}const m=i.value,y=l.value;if(n.equals(m[0],y[0],u,h,t,e,n)&&n.equals(m[1],y[1],m[0],y[0],t,e,n)){f=o[h]=!0;break}h++}if(!f)return!1;u++}return!0}const LV=ma;function zV(t,e,n){const r=RC(t);let o=r.length;if(RC(e).length!==o)return!1;for(;o-- >0;)if(!B6(t,e,n,r[o]))return!1;return!0}function mu(t,e,n){const r=MC(t);let o=r.length;if(MC(e).length!==o)return!1;let s,i,l;for(;o-- >0;)if(s=r[o],!B6(t,e,n,s)||(i=DC(t,s),l=DC(e,s),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function FV(t,e){return ma(t.valueOf(),e.valueOf())}function $V(t,e){return t.source===e.source&&t.flags===e.flags}function IC(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,l;for(;(i=s.next())&&!i.done;){const u=e.values();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(!o[f]&&n.equals(i.value,l.value,i.value,l.value,t,e,n)){d=o[f]=!0;break}f++}if(!d)return!1}return!0}function xh(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 BV(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 B6(t,e,n,r){return(r===MV||r===NV||r===AV)&&(t.$$typeof||e.$$typeof)?!0:TV(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const VV="[object ArrayBuffer]",HV="[object Arguments]",UV="[object Boolean]",WV="[object DataView]",qV="[object Date]",KV="[object Error]",GV="[object Map]",JV="[object Number]",ZV="[object Object]",YV="[object RegExp]",XV="[object Set]",QV="[object String]",eH={"[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},tH="[object URL]",nH=Object.prototype.toString;function rH({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:f,areSetsEqual:h,areTypedArraysEqual:m,areUrlsEqual:y,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"?l(k,E,_):T==="function"?s(k,E,_):!1;const N=k.constructor;if(N!==E.constructor)return!1;if(N===Object)return u(k,E,_);if(Array.isArray(k))return e(k,E,_);if(N===Date)return r(k,E,_);if(N===RegExp)return f(k,E,_);if(N===Map)return i(k,E,_);if(N===Set)return h(k,E,_);const M=nH.call(k);if(M===qV)return r(k,E,_);if(M===YV)return f(k,E,_);if(M===GV)return i(k,E,_);if(M===XV)return h(k,E,_);if(M===ZV)return typeof k.then!="function"&&typeof E.then!="function"&&u(k,E,_);if(M===tH)return y(k,E,_);if(M===KV)return o(k,E,_);if(M===HV)return u(k,E,_);if(eH[M])return m(k,E,_);if(M===VV)return t(k,E,_);if(M===WV)return n(k,E,_);if(M===UV||M===JV||M===QV)return d(k,E,_);if(v){let D=v[M];if(!D){const I=_V(k);I&&(D=v[I])}if(D)return D(k,E,_)}return!1}}function oH({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:DV,areArraysEqual:n?mu:RV,areDataViewsEqual:OV,areDatesEqual:IV,areErrorsEqual:PV,areFunctionsEqual:jV,areMapsEqual:n?_g(OC,mu):OC,areNumbersEqual:LV,areObjectsEqual:n?mu:zV,arePrimitiveWrappersEqual:FV,areRegExpsEqual:$V,areSetsEqual:n?_g(IC,mu):IC,areTypedArraysEqual:n?_g(xh,mu):xh,areUrlsEqual:BV,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=_f(r.areArraysEqual),s=_f(r.areMapsEqual),i=_f(r.areObjectsEqual),l=_f(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:l})}return r}function sH(t){return function(e,n,r,o,s,i,l){return t(e,n,l)}}function iH({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(l,u){const{cache:d=t?new WeakMap:void 0,meta:f}=n();return e(l,u,{cache:d,equals:r,meta:f,strict:o})};if(t)return function(l,u){return e(l,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(l,u){return e(l,u,s)}}const aH=vi();vi({strict:!0});vi({circular:!0});vi({circular:!0,strict:!0});vi({createInternalComparator:()=>ma});vi({strict:!0,createInternalComparator:()=>ma});vi({circular:!0,createInternalComparator:()=>ma});vi({circular:!0,createInternalComparator:()=>ma,strict:!0});function vi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,s=oH(t),i=rH(s),l=n?n(i):sH(i);return iH({circular:e,comparator:i,createState:r,equals:l,strict:o})}var Tg={exports:{}},Ag={};/**
|
|
547
|
-
* @license React
|
|
548
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
549
|
-
*
|
|
550
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
551
|
-
*
|
|
552
|
-
* This source code is licensed under the MIT license found in the
|
|
553
|
-
* LICENSE file in the root directory of this source tree.
|
|
554
|
-
*/var PC;function lH(){if(PC)return Ag;PC=1;var t=_c(),e=E_();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,s=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;return Ag.useSyncExternalStoreWithSelector=function(d,f,h,m,y){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=l(function(){function E(D){if(!_){if(_=!0,T=D,D=m(D),y!==void 0&&b.hasValue){var I=b.value;if(y(I,D))return N=I}return N=D}if(I=N,r(T,D))return I;var P=m(D);return y!==void 0&&y(I,P)?(T=D,I):(T=D,N=P)}var _=!1,T,N,M=h===void 0?null:h;return[function(){return E(f())},M===null?void 0:function(){return E(M())}]},[f,h,m,y]);var k=o(d,v[0],v[1]);return i(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},Ag}var jC;function uH(){return jC||(jC=1,Tg.exports=lH()),Tg.exports}var cH=uH(),dH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},fH=({contentComponent:t})=>{const e=__.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return x.jsx(x.Fragment,{children:Object.values(e)})};function hH(){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]:YS.createPortal(s.reactElement,s.element,o)},r()},removeRenderer(o){const s={...e};delete s[o],e=s,r()}}}var pH=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=hH(),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 x.jsxs(x.Fragment,{children:[x.jsx("div",{ref:dH(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&x.jsx(fH,{contentComponent:t.contentComponent})]})}},mH=C.forwardRef((t,e)=>{const n=ne.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ne.createElement(pH,{key:n,innerRef:e,...t})}),V6=ne.memo(mH),gH=typeof window<"u"?C.useLayoutEffect:C.useEffect,yH=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 xH(t){var e;const[n]=C.useState(()=>new yH(t.editor)),r=cH.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:aH);return gH(()=>n.watch(t.editor),[t.editor,n]),C.useDebugValue(r),r}var vH=!1,H6=typeof window>"u",bH=H6||!!(typeof window<"u"&&window.next),kH=class U6{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 H6?(n&&vH&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):bH&&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 kV(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?U6.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 wH(t={},e=[]){const n=C.useRef(t);n.current=t;const[r]=C.useState(()=>new kH(n)),o=__.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(o),C.useEffect(r.onRender(e)),xH({editor:o,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),o}var W6=C.createContext({editor:null});W6.Consumer;var CH=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),SH=()=>C.useContext(CH);ne.forwardRef((t,e)=>{const{onDragStart:n}=SH(),r=t.as||"div";return x.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});ne.createContext({markViewContentRef:()=>{}});var Kx=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Kx.displayName="TiptapContext";var EH=()=>C.useContext(Kx);function q6({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 x.jsx(W6.Provider,{value:o,children:x.jsx(Kx.Provider,{value:r,children:t})})}q6.displayName="Tiptap";function K6({...t}){const{editor:e}=EH();return x.jsx(V6,{editor:e,...t})}K6.displayName="Tiptap.Content";Object.assign(q6,{Content:K6});var vh=(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]},_H=(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 l=i.depth-1;if(l<0)return!1;const u=i.node(l),d=i.index(l);if(d===0)return!1;if(u.type===e)return t.commands.lift(e.name);const f=u.child(d-1);if(f.type!==e||!((n=f.lastChild)!=null&&n.isTextblock))return!1;const h=i.before(),y=h-1-1,{tr:v}=r;return v.delete(h,i.after()).insert(y,i.parent.content),v.setSelection(ze.create(v.doc,y)),o.dispatch(v.scrollIntoView()),!0},TH=/^\s*>\s$/,AH=ht.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return vh("blockquote",{...tn(this.options.HTMLAttributes,t),children:vh("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,l;const f=((l=(i=e.renderChild)==null?void 0:i.call(e,o,s))!=null?l:e.renderChildren([o])).split(`
|
|
555
|
-
`).map(h=>h.trim()===""?n:`${n} ${h}`);r.push(f.join(`
|
|
556
|
-
`))}),r.join(`
|
|
557
|
-
${n}
|
|
558
|
-
`)},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:()=>_H(this.editor,this.type)}},addInputRules(){return[ml({find:TH,type:this.type})]}}),NH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,MH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,DH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,RH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,OH=hr.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 vh("strong",{...tn(this.options.HTMLAttributes,t),children:vh("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[ia({find:NH,type:this.type}),ia({find:DH,type:this.type})]},addPasteRules(){return[di({find:MH,type:this.type}),di({find:RH,type:this.type})]}}),IH=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},PH=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},jH=hr.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[ia({find:IH,type:this.type})]},addPasteRules(){return[di({find:PH,type:this.type})]}}),Ng=4,LH=/^```([a-z]+)?[\s\n]$/,zH=/^~~~([a-z]+)?[\s\n]$/,FH=ht.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Ng,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(`
|
|
559
|
-
`):r=`\`\`\`${o}
|
|
560
|
-
|
|
561
|
-
\`\`\``,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:Ng,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return i?t.commands.insertContent(l):t.commands.command(({tr:u})=>{const{from:d,to:f}=o,y=r.doc.textBetween(d,f,`
|
|
562
|
-
`,`
|
|
563
|
-
`).split(`
|
|
564
|
-
`).map(v=>l+v).join(`
|
|
565
|
-
`);return u.replaceWith(d,f,r.schema.text(y)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Ng,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;return s.parent.type!==this.type?!1:i?t.commands.command(({tr:l})=>{var u;const{pos:d}=s,f=s.start(),h=s.end(),y=r.doc.textBetween(f,h,`
|
|
566
|
-
`,`
|
|
567
|
-
`).split(`
|
|
568
|
-
`);let v=0,b=0;const k=d-f;for(let D=0;D<y.length;D+=1){if(b+y[D].length>=k){v=D;break}b+=y[D].length+1}const _=((u=y[v].match(/^ */))==null?void 0:u[0])||"",T=Math.min(_.length,n);if(T===0)return!0;let N=f;for(let D=0;D<v;D+=1)N+=y[D].length+1;return l.delete(N,N+T),d-N<=T&&l.setSelection(ze.create(l.doc,N)),!0}):t.commands.command(({tr:l})=>{const{from:u,to:d}=o,m=r.doc.textBetween(u,d,`
|
|
569
|
-
`,`
|
|
570
|
-
`).split(`
|
|
571
|
-
`).map(y=>{var v;const b=((v=y.match(/^ */))==null?void 0:v[0])||"",k=Math.min(b.length,n);return y.slice(k)}).join(`
|
|
572
|
-
`);return l.replaceWith(u,d,r.schema.text(m)),!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(`
|
|
573
|
-
|
|
574
|
-
`);return!s||!i?!1:t.chain().command(({tr:l})=>(l.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 l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(Ue.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[oy({find:LH,type:this.type,getAttributes:t=>({language:t[1]})}),oy({find:zH,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new Ht("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:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
|
|
575
|
-
`));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}}})]}}),$H=ht.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
576
|
-
|
|
577
|
-
`):""}),BH=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`
|
|
578
|
-
`},renderMarkdown:()=>`
|
|
579
|
-
`,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:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&i){const h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),VH=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=>oy({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),HH=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(!nV(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return b6(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:i,dispatch:l})=>{if(l){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 f=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,h=f==null?void 0:f.create();h&&(i.insert(d,h),i.setSelection(ze.create(i.doc,d+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[wV({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),UH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,WH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,qH=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,KH=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,GH=hr.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[ia({find:UH,type:this.type}),ia({find:qH,type:this.type})]},addPasteRules(){return[di({find:WH,type:this.type}),di({find:KH,type:this.type})]}});const JH="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ZH="ελ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",sy="numeric",iy="ascii",ay="alpha",Ru="asciinumeric",Eu="alphanumeric",ly="domain",G6="emoji",YH="scheme",XH="slashscheme",Mg="whitespace";function QH(t,e){return t in e||(e[t]=[]),e[t]}function Ui(t,e,n){e[sy]&&(e[Ru]=!0,e[Eu]=!0),e[iy]&&(e[Ru]=!0,e[ay]=!0),e[Ru]&&(e[Eu]=!0),e[ay]&&(e[Eu]=!0),e[Eu]&&(e[ly]=!0),e[G6]&&(e[ly]=!0);for(const r in e){const o=QH(r,n);o.indexOf(t)<0&&o.push(t)}}function eU(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Xn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Xn.groups={};Xn.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||Xn.groups;let o;return e&&e.j?o=e:(o=new Xn(e),n&&r&&Ui(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||Xn.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,l=o.go(t);if(l?(i=new Xn,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new Xn,s){if(r)if(i.t&&typeof i.t=="string"){const u=Object.assign(eU(i.t,r),n);Ui(s,u,r)}else n&&Ui(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),Dt=(t,e,n,r,o)=>t.tr(e,n,r,o),LC=(t,e,n,r,o)=>t.ts(e,n,r,o),ue=(t,e,n,r,o)=>t.tt(e,n,r,o),Uo="WORD",uy="UWORD",J6="ASCIINUMERICAL",Z6="ALPHANUMERICAL",pc="LOCALHOST",cy="TLD",dy="UTLD",Wf="SCHEME",Za="SLASH_SCHEME",Gx="NUM",fy="WS",Jx="NL",Ou="OPENBRACE",Iu="CLOSEBRACE",bh="OPENBRACKET",kh="CLOSEBRACKET",wh="OPENPAREN",Ch="CLOSEPAREN",Sh="OPENANGLEBRACKET",Eh="CLOSEANGLEBRACKET",_h="FULLWIDTHLEFTPAREN",Th="FULLWIDTHRIGHTPAREN",Ah="LEFTCORNERBRACKET",Nh="RIGHTCORNERBRACKET",Mh="LEFTWHITECORNERBRACKET",Dh="RIGHTWHITECORNERBRACKET",Rh="FULLWIDTHLESSTHAN",Oh="FULLWIDTHGREATERTHAN",Ih="AMPERSAND",Ph="APOSTROPHE",jh="ASTERISK",zs="AT",Lh="BACKSLASH",zh="BACKTICK",Fh="CARET",Wi="COLON",Zx="COMMA",$h="DOLLAR",lo="DOT",Bh="EQUALS",Yx="EXCLAMATION",Sr="HYPHEN",Pu="PERCENT",Vh="PIPE",Hh="PLUS",Uh="POUND",ju="QUERY",Xx="QUOTE",Y6="FULLWIDTHMIDDLEDOT",Qx="SEMI",uo="SLASH",Lu="TILDE",Wh="UNDERSCORE",X6="EMOJI",qh="SYM";var Q6=Object.freeze({__proto__:null,ALPHANUMERICAL:Z6,AMPERSAND:Ih,APOSTROPHE:Ph,ASCIINUMERICAL:J6,ASTERISK:jh,AT:zs,BACKSLASH:Lh,BACKTICK:zh,CARET:Fh,CLOSEANGLEBRACKET:Eh,CLOSEBRACE:Iu,CLOSEBRACKET:kh,CLOSEPAREN:Ch,COLON:Wi,COMMA:Zx,DOLLAR:$h,DOT:lo,EMOJI:X6,EQUALS:Bh,EXCLAMATION:Yx,FULLWIDTHGREATERTHAN:Oh,FULLWIDTHLEFTPAREN:_h,FULLWIDTHLESSTHAN:Rh,FULLWIDTHMIDDLEDOT:Y6,FULLWIDTHRIGHTPAREN:Th,HYPHEN:Sr,LEFTCORNERBRACKET:Ah,LEFTWHITECORNERBRACKET:Mh,LOCALHOST:pc,NL:Jx,NUM:Gx,OPENANGLEBRACKET:Sh,OPENBRACE:Ou,OPENBRACKET:bh,OPENPAREN:wh,PERCENT:Pu,PIPE:Vh,PLUS:Hh,POUND:Uh,QUERY:ju,QUOTE:Xx,RIGHTCORNERBRACKET:Nh,RIGHTWHITECORNERBRACKET:Dh,SCHEME:Wf,SEMI:Qx,SLASH:uo,SLASH_SCHEME:Za,SYM:qh,TILDE:Lu,TLD:cy,UNDERSCORE:Wh,UTLD:dy,UWORD:uy,WORD:Uo,WS:fy});const Bo=/[a-z]/,gu=new RegExp("\\p{L}","u"),Dg=new RegExp("\\p{Emoji}","u"),Vo=/\d/,Rg=/\s/,zC="\r",Og=`
|
|
580
|
-
`,tU="️",nU="",Ig="";let Tf=null,Af=null;function rU(t=[]){const e={};Xn.groups=e;const n=new Xn;Tf==null&&(Tf=FC(JH)),Af==null&&(Af=FC(ZH)),ue(n,"'",Ph),ue(n,"{",Ou),ue(n,"}",Iu),ue(n,"[",bh),ue(n,"]",kh),ue(n,"(",wh),ue(n,")",Ch),ue(n,"<",Sh),ue(n,">",Eh),ue(n,"(",_h),ue(n,")",Th),ue(n,"「",Ah),ue(n,"」",Nh),ue(n,"『",Mh),ue(n,"』",Dh),ue(n,"<",Rh),ue(n,">",Oh),ue(n,"&",Ih),ue(n,"*",jh),ue(n,"@",zs),ue(n,"`",zh),ue(n,"^",Fh),ue(n,":",Wi),ue(n,",",Zx),ue(n,"$",$h),ue(n,".",lo),ue(n,"=",Bh),ue(n,"!",Yx),ue(n,"-",Sr),ue(n,"%",Pu),ue(n,"|",Vh),ue(n,"+",Hh),ue(n,"#",Uh),ue(n,"?",ju),ue(n,'"',Xx),ue(n,"/",uo),ue(n,";",Qx),ue(n,"~",Lu),ue(n,"_",Wh),ue(n,"\\",Lh),ue(n,"・",Y6);const r=Dt(n,Vo,Gx,{[sy]:!0});Dt(r,Vo,r);const o=Dt(r,Bo,J6,{[Ru]:!0}),s=Dt(r,gu,Z6,{[Eu]:!0}),i=Dt(n,Bo,Uo,{[iy]:!0});Dt(i,Vo,o),Dt(i,Bo,i),Dt(o,Vo,o),Dt(o,Bo,o);const l=Dt(n,gu,uy,{[ay]:!0});Dt(l,Bo),Dt(l,Vo,s),Dt(l,gu,l),Dt(s,Vo,s),Dt(s,Bo),Dt(s,gu,s);const u=ue(n,Og,Jx,{[Mg]:!0}),d=ue(n,zC,fy,{[Mg]:!0}),f=Dt(n,Rg,fy,{[Mg]:!0});ue(n,Ig,f),ue(d,Og,u),ue(d,Ig,f),Dt(d,Rg,f),ue(f,zC),ue(f,Og),Dt(f,Rg,f),ue(f,Ig,f);const h=Dt(n,Dg,X6,{[G6]:!0});ue(h,"#"),Dt(h,Dg,h),ue(h,tU,h);const m=ue(h,nU);ue(m,"#"),Dt(m,Dg,h);const y=[[Bo,i],[Vo,o]],v=[[Bo,null],[gu,l],[Vo,s]];for(let b=0;b<Tf.length;b++)Is(n,Tf[b],cy,Uo,y);for(let b=0;b<Af.length;b++)Is(n,Af[b],dy,uy,v);Ui(cy,{tld:!0,ascii:!0},e),Ui(dy,{utld:!0,alpha:!0},e),Is(n,"file",Wf,Uo,y),Is(n,"mailto",Wf,Uo,y),Is(n,"http",Za,Uo,y),Is(n,"https",Za,Uo,y),Is(n,"ftp",Za,Uo,y),Is(n,"ftps",Za,Uo,y),Ui(Wf,{scheme:!0,ascii:!0},e),Ui(Za,{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]?{[YH]:!0}:{[XH]:!0};k.indexOf("-")>=0?_[ly]=!0:Bo.test(k)?Vo.test(k)?_[Ru]=!0:_[iy]=!0:_[sy]=!0,LC(n,k,k,_)}return LC(n,"localhost",pc,{ascii:!0}),n.jd=new Xn(qh),{start:n,tokens:Object.assign({groups:e},Q6)}}function eT(t,e){const n=oU(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=t,u=null,d=0,f=null,h=-1,m=-1;for(;i<r&&(u=l.go(n[i]));)l=u,l.accepts()?(h=0,m=0,f=l):h>=0&&(h+=n[i].length,m++),d+=n[i].length,s+=n[i].length,i++;s-=h,i-=m,d-=h,o.push({t:f.t,v:e.slice(s-d,s),s:s-d,e:s})}return o}function oU(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 Is(t,e,n,r,o){let s;const i=e.length;for(let l=0;l<i-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new Xn(r),s.jr=o.slice(),t.j[u]=s),t=s}return s=new Xn(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function FC(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 mc={defaultProtocol:"http",events:null,format:$C,formatHref:$C,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ev(t,e=null){let n=Object.assign({},mc);t&&(n=Object.assign(n,t instanceof ev?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}ev.prototype={o:mc,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]:mc[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 $C(t){return t}function tT(t,e){this.t="token",this.v=t,this.tk=e}tT.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=mc.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={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return i.href=r,l&&(i.class=l),u&&(i.target=u),d&&(i.rel=d),f&&Object.assign(i,f),{tagName:o,attributes:i,content:s,eventListeners:h}}};function Fp(t,e){class n extends tT{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 sU=Fp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),BC=Fp("text"),iU=Fp("nl"),Nf=Fp("url",{isLink:!0,toHref(t=mc.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==pc&&t[1].t===Wi}}),Cr=t=>new Xn(t);function aU({groups:t}){const e=t.domain.concat([Ih,jh,zs,Lh,zh,Fh,$h,Bh,Sr,Gx,Pu,Vh,Hh,Uh,uo,qh,Lu,Wh]),n=[Ph,Wi,Zx,lo,Yx,Pu,ju,Xx,Qx,Sh,Eh,Ou,Iu,kh,bh,wh,Ch,_h,Th,Ah,Nh,Mh,Dh,Rh,Oh],r=[Ih,Ph,jh,Lh,zh,Fh,$h,Bh,Sr,Ou,Iu,Pu,Vh,Hh,Uh,ju,uo,qh,Lu,Wh],o=Cr(),s=ue(o,Lu);We(s,r,s),We(s,t.domain,s);const i=Cr(),l=Cr(),u=Cr();We(o,t.domain,i),We(o,t.scheme,l),We(o,t.slashscheme,u),We(i,r,s),We(i,t.domain,i);const d=ue(i,zs);ue(s,zs,d),ue(l,zs,d),ue(u,zs,d);const f=ue(s,lo);We(f,r,s),We(f,t.domain,s);const h=Cr();We(d,t.domain,h),We(h,t.domain,h);const m=ue(h,lo);We(m,t.domain,h);const y=Cr(sU);We(m,t.tld,y),We(m,t.utld,y),ue(d,pc,y);const v=ue(h,Sr);ue(v,Sr,v),We(v,t.domain,h),We(y,t.domain,h),ue(y,lo,m),ue(y,Sr,v);const b=ue(i,Sr),k=ue(i,lo);ue(b,Sr,b),We(b,t.domain,i),We(k,r,s),We(k,t.domain,i);const E=Cr(Nf);We(k,t.tld,E),We(k,t.utld,E),We(E,t.domain,i),We(E,r,s),ue(E,lo,k),ue(E,Sr,b),ue(E,zs,d);const _=ue(E,Wi),T=Cr(Nf);We(_,t.numeric,T);const N=Cr(Nf),M=Cr();We(N,e,N),We(N,n,M),We(M,e,N),We(M,n,M),ue(E,uo,N),ue(T,uo,N);const D=ue(l,Wi),I=ue(u,Wi),P=ue(I,uo),O=ue(P,uo);We(l,t.domain,i),ue(l,lo,k),ue(l,Sr,b),We(u,t.domain,i),ue(u,lo,k),ue(u,Sr,b),We(D,t.domain,N),ue(D,uo,N),ue(D,ju,N),We(O,t.domain,N),We(O,e,N),ue(O,uo,N);const W=[[Ou,Iu],[bh,kh],[wh,Ch],[Sh,Eh],[_h,Th],[Ah,Nh],[Mh,Dh],[Rh,Oh]];for(let Z=0;Z<W.length;Z++){const[J,K]=W[Z],Y=ue(N,J);ue(M,J,Y);const ee=Cr(Nf);We(Y,e,ee);const G=Cr();We(Y,n,G),ue(Y,K,N),We(ee,e,ee),We(ee,n,G),We(G,e,ee),We(G,n,G),ue(ee,K,N),ue(G,K,N)}return ue(o,pc,E),ue(o,Jx,iU),{start:o,tokens:Q6}}function lU(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=t,u=null,d=null,f=0,h=null,m=-1;for(;o<r&&!(u=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(d=u||l.go(n[o].t));)u=null,l=d,l.accepts()?(m=0,h=l):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Pg(BC,e,i)),i=[]),o-=m,f-=m;const y=h.t,v=n.slice(o-f,o);s.push(Pg(y,e,v))}}return i.length>0&&s.push(Pg(BC,e,i)),s}function Pg(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 uU=typeof console<"u"&&console&&console.warn||(()=>{}),cU="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 dU(){return Xn.groups={},wt.scanner=null,wt.parser=null,wt.tokenQueue=[],wt.pluginQueue=[],wt.customSchemes=[],wt.initialized=!1,wt}function VC(t,e=!1){if(wt.initialized&&uU(`linkifyjs: already initialized - will not register custom scheme "${t}" ${cU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
581
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
582
|
-
2. Cannot start or end with "-"
|
|
583
|
-
3. "-" cannot repeat`);wt.customSchemes.push([t,e])}function fU(){wt.scanner=rU(wt.customSchemes);for(let t=0;t<wt.tokenQueue.length;t++)wt.tokenQueue[t][1]({scanner:wt.scanner});wt.parser=aU(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 tv(t){return wt.initialized||fU(),lU(wt.parser.start,t,eT(wt.scanner.start,t))}tv.scan=eT;function nT(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 ev(n),o=tv(t),s=[];for(let i=0;i<o.length;i++){const l=o[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var nv="[\0- -\u2029 ]",hU=new RegExp(nv),pU=new RegExp(`${nv}$`),mU=new RegExp(nv,"g");function gU(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yU(t){return new Ct({key:new Ht("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,l=h6(n.doc,[...e]);if(Bx(l).forEach(({newRange:d})=>{const f=mB(r.doc,d,y=>y.isTextblock);let h,m;if(f.length>1)h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(f.length){const y=r.doc.textBetween(d.from,d.to," "," ");if(!pU.test(y))return;h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")}if(h&&m){const y=m.split(hU).filter(Boolean);if(y.length<=0)return!1;const v=y[y.length-1],b=h.pos+m.lastIndexOf(v);if(!v)return!1;const k=tv(v).map(E=>E.toObject(t.defaultProtocol));if(!gU(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=>{Vx(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 xU(t){return new Ct({key:new Ht("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 l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=v6(e.state,t.type.name),d=(o=i.href)!=null?o:u.href,f=(s=i.target)!=null?s:u.target;d&&(window.open(d,f),l=!0)}return l}}})}var vU=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,bU=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function rT(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function kU(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&rT(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 oT(t,e,n){var r,o;const[,s,i]=e;return(e.index?t[e.index-1]:void 0)==="!"||rT(t,(r=e.index)!=null?r:0)||kU(t,(o=e.index)!=null?o:0)?!1:!!s.trim()&&n(i)}function sT(t){var e,n;const[r,o,s,,i,l,u]=t,d=(e=i??l)!=null?e:u;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:o,data:{href:s,title:d||null,markdown:!0}}}function wU(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function iT(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 CU(t){const e=ia({find:n=>{const r=vU.exec(n);return!r||!oT(n,r,t.isAllowedHref)?null:sT(r)},type:t.type,getAttributes:iT});return new Wc({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 SU(t){const e=di({find:n=>{var r,o;const s=[];for(const l of n.matchAll(bU))oT(n,l,t.isAllowedHref)&&s.push(sT(l));const i=((o=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?o:[]).filter(l=>!s.some(u=>wU(u,l)));return[...s,...i]},type:t.type,getAttributes:iT});return new _6({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 EU(t){return new Ct({key:new Ht("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:s}=e,{selection:i}=s,{empty:l}=i;if(l)return!1;let u="";r.content.forEach(f=>{u+=f.textContent});const d=nT(u,{defaultProtocol:t.defaultProtocol}).find(f=>f.isLink&&f.value===u);return!u||!d||o!==void 0&&!o(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function Ho(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(mU,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var _U=hr.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"){VC(t);return}VC(t.scheme,t.optionalSlashes)})},onDestroy(){dU()},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)=>!!Ho(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=>!!Ho(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=>!!Ho(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:"",l=(s=(o=t.attrs)==null?void 0:o.title)!=null?s:"",u=e.renderChildren(t);return l?`[${u}](${i} "${l}")`:`[${u}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ho(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=>!!Ho(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?[CU({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Ho(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;nT(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:l=>!!Ho(l,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?[SU({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Ho(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[di({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(yU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Ho(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(xU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(EU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),TU=Object.defineProperty,AU=(t,e)=>{for(var n in e)TU(t,n,{get:e[n],enumerable:!0})},NU="listItem",HC="textStyle",UC=/^\s*([-+*])\s$/,aT=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,`
|
|
584
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(NU,this.editor.getAttributes(HC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ml({find:UC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ml({find:UC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(HC),editor:this.editor})),[t]}}),MU=(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 y=o.depth;y>0;y-=1)if(o.node(y).type.name===e){s=y;break}if(s<0)return null;const i=o.node(s),l=o.index(s);if(l+1>=i.childCount)return null;const u=i.child(l+1);if(!n.includes(u.type.name))return null;const d=t.schema.nodes[e];let f=!1;if(u.forEach(y=>{y.type===d&&y.childCount>1&&(f=!0)}),!f)return null;const h=t.doc.resolve(o.after()).nodeAfter;if(!h||!n.includes(h.type.name))return null;const m=[];return h.forEach(y=>{m.push(y)}),m.length===0?null:{listItemDepth:s,nestedList:h,nestedListPos:o.after(),insertPos:o.after(s),items:m}},DU=(t,e,n,r)=>{const o=MU(t,n,r);if(!o)return!1;const{selection:s}=t,{nestedList:i,nestedListPos:l,insertPos:u,items:d}=o,f=t.tr;f.delete(l,l+i.nodeSize);const h=f.mapping.map(u);return f.insert(h,oe.from(d)),f.setSelection(s.map(f.doc,f.mapping)),e&&e(f),!0},RU=(t,e,n)=>DU(t.state,t.view.dispatch,e,n),lT=(t,e)=>St.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>RU(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),uT=[[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"]],Mf="abcdefghijklmnopqrstuvwxyz",OU="[a-zA-Z]{1,2}",cT=String.raw`\d+|[ivxlcdmIVXLCDM]+|${OU}`;function $p(t){let e=t,n="";for(const[r,o]of uT)for(;e>=r;)n+=o,e-=r;return n}function rv(t){return $p(t).toUpperCase()}function dT(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let o=!1;for(const[s,i]of uT)if(e.startsWith(i,n)){r+=s,n+=i.length,o=!0;break}if(!o)return 0}return r}function IU(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=dT(t);return e<=0?!1:(t===t.toLowerCase()?$p(e):rv(e))===t}function PU(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 Kh(t){if(t<=26)return Mf[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Mf[n]:Mf[e]+Mf[n]}function Bp(t){if(!(!t||/^\d+$/.test(t))){if(IU(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 ov(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=Bp(t);if(e==="i"||e==="I")return dT(t);if(e==="a"||e==="A"){const r=PU(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function jU(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Kh(e);case"A":return Kh(e).toUpperCase();case"i":return $p(e);case"I":return rv(e);default:return String(e)}}function LU(t){var e;if(t.length===0)return!1;const n=(e=Bp(t[0]))!=null?e:"numeric",r=ov(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){const s=jU(n,r+o);if(t[o]!==s)return!1}return!0}function zU(t){return{type:Bp(t),start:ov(t)}}function FU(t){const{type:e,start:n}=zU(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function $U(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Kh(r)}${n}`;case"A":return`${Kh(r).toUpperCase()}${n}`;case"i":return`${$p(r)}${n}`;case"I":return`${rv(r)}${n}`;default:return`${r}${n}`}}function BU(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 VU(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var fT=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(BU(t))return{type:"listItem",content:[{type:"paragraph",content:VU(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)=>Wx(t,e,r=>{var o,s,i,l;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=(l=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:l.type,f=u-1+(r.index||0);return $U(d,f,". ")}return"- "},n),addExtensions(){return[lT(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)}}}),HU={};AU(HU,{findListItemPos:()=>Vp,getNextListDepth:()=>sv,handleBackspace:()=>hy,handleDelete:()=>py,hasListBefore:()=>hT,hasListItemAfter:()=>UU,hasListItemBefore:()=>WU,listItemHasSubList:()=>qU,nextListIsDeeper:()=>pT,nextListIsHigher:()=>mT});var Vp=(t,e)=>{const{$from:n}=e.selection,r=Vt(t,e.schema);let o=null,s=n.depth,i=n.pos,l=null;for(;s>0&&l===null;)o=n.node(s),o.type===r?l=s:(s-=1,i-=1);return l===null?null:{$pos:e.doc.resolve(i),depth:l}},sv=(t,e)=>{const n=Vp(t,e);if(!n)return!1;const[,r]=_B(e,t,n.$pos.pos+4);return r},hT=(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))},hy=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!ci(t.state,e)&&hT(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 l=t.state.doc.resolve(o.start()+i.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},l.end()).joinForward().run()}return!ci(t.state,e)||!MB(t.state)?!1:t.chain().liftListItem(e).run()},pT=(t,e)=>{const n=sv(t,e),r=Vp(t,e);return!r||!n?!1:n>r.depth},mT=(t,e)=>{const n=sv(t,e),r=Vp(t,e);return!r||!n?!1:n<r.depth},py=(t,e)=>{if(!ci(t.state,e)||!NB(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:pT(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():mT(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},UU=(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)},WU=(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)},qU=(t,e,n)=>{if(!n)return!1;const r=Vt(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},gT=St.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&&py(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&&py(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&&hy(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&&hy(t,n,r)&&(e=!0)}),e}}}}),my=new RegExp(`^(\\s*)(${cT})([.)])\\s+(.*)$`),KU=/^\s/,_u={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function GU(t){return my.test(t.trimStart())}function JU(t){const e=t.trimStart();return _u.bulletItem.test(e)||GU(e)||_u.heading.test(e)||_u.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||_u.codeFence.test(e)}function ZU(t){return Object.values(_u).some(e=>e.test(t))}function YU(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&&JU(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function XU(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],s=o.match(my);if(!s)break;const[,i,l,u,d]=s,f=i.length,h=parseInt(l,10),m=isNaN(h)?Bp(l):void 0,y=isNaN(h)?ov(l):h,v=[d];let b=n+1;const k=[o];let E=!1;for(;b<t.length;){const _=t[b];if(_.match(my))break;if(_.trim()==="")k.push(_),v.push(""),E=!0,b+=1;else if(_.match(KU)){const N=_.length-_.trimStart().length,M=f+l.length+1;k.push(_),v.push(_.slice(Math.min(N,M))),b+=1}else{if(E||ZU(_))break;k.push(_),v.push(_),b+=1}}e.push({indent:f,number:y,type:m,content:v.join(`
|
|
585
|
-
`).trim(),contentLines:v,raw:k.join(`
|
|
586
|
-
`)}),r=b,n=b}return[e,r]}var QU=new RegExp(`^(${cT})([.)])\\s+(.+)$`);function eW(t){const e=t.split(`
|
|
587
|
-
`).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const i=s.trim().match(QU);if(!i)return null;n.push({marker:i[1],content:i[3]})}const r=n.map(s=>s.marker);return LU(r)?{type:"orderedList",attrs:FU(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function yT(t,e,n){const r=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const{paragraphLines:i,blockLines:l}=YU(s.contentLines),u=i.join(`
|
|
588
|
-
`).trim(),d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const f=l.join(`
|
|
589
|
-
`).trim();if(f){const y=n.blockTokens(f);d.push(...y)}let h=o+1;const m=[];for(;h<t.length&&t[h].indent>e;)m.push(t[h]),h+=1;if(m.length>0){const y=Math.min(...m.map(b=>b.indent)),v=yT(m,y,n);d.push({type:"list",ordered:!0,start:m[0].number,typeMarker:m[0].type,items:v,raw:m.map(b=>b.raw).join(`
|
|
590
|
-
`)})}r.push({type:"list_item",raw:s.raw,tokens:d}),o=h}else o+=1}return r}function tW(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 nW="listItem",WC="textStyle",qC=/^(\d+)\.\s$/;function KC(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 xT=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=KC(n);if(o)return o}const r=t.querySelector("li");if(r){const o=r.getAttribute("style");if(o){const s=KC(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?tW(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,`
|
|
591
|
-
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;const s=t.split(`
|
|
592
|
-
`),[i,l]=XU(s);if(i.length===0)return;const u=yT(i,i[0].indent,n);if(u.length===0)return;const d=((r=i[0])==null?void 0:r.number)||1,f=(o=i[0])==null?void 0:o.type;return{type:"list",ordered:!0,start:d,typeMarker:f,items:u,raw:s.slice(0,l).join(`
|
|
593
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(nW,this.editor.getAttributes(WC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Ct({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=eW(s);if(!i)return!1;try{const l=t.state.schema.nodeFromJSON(i),u=t.state.tr.replaceSelectionWith(l);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=ml({find:qC,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ml({find:qC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(WC)}),joinPredicate:t,editor:this.editor})),[e]}}),rW=/^\s*(\[([( |x])?\])\s$/,oW=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 Wx(t,e,o)},addExtensions(){return this.options.nested?[lT(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"),l=document.createElement("input"),u=document.createElement("div"),d=h=>{var m,y;l.ariaLabel=((y=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:y.call(m,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:y})=>{const v=n();if(typeof v!="number")return!1;const b=y.doc.nodeAt(v);return y.setNodeMarkup(v,void 0,{...b==null?void 0:b.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,m])=>{o.setAttribute(h,m)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,i),o.append(s,u),Object.entries(e).forEach(([h,m])=>{o.setAttribute(h,m)});let f=new Set(Object.keys(e));return{dom:o,contentDOM:u,update:h=>{if(h.type!==this.type)return!1;o.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,d(h);const m=r.extensionManager.attributes,y=hc(h,m),v=new Set(Object.keys(y)),b=this.options.HTMLAttributes;return f.forEach(k=>{v.has(k)||(k in b?o.setAttribute(k,b[k]):o.removeAttribute(k))}),Object.entries(y).forEach(([k,E])=>{E==null?k in b?o.setAttribute(k,b[k]):o.removeAttribute(k):o.setAttribute(k,E)}),f=v,!0}}}},addInputRules(){return[ml({find:rW,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),sW=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,`
|
|
594
|
-
`):"",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=ry(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);if(i){const l={type:"taskList",raw:i.raw,items:i.items},u=s.slice(i.raw.length);return u.trim()?[l,...n.blockTokens(u)]:[l]}return n.blockTokens(s)},o=ry(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()}}});St.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(aT.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(fT.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(gT.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(xT.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(oW.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(sW.configure(this.options.taskList)),t}});var Df=" ",jg=" ",iW=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===Df||n[0].text===Df||n[0].raw===jg||n[0].text===jg)&&r.length===1&&r[0].type==="text"&&(r[0].text===Df||r[0].text===jg)?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?Df:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,uW=hr.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[ia({find:aW,type:this.type})]},addPasteRules(){return[di({find:lW,type:this.type})]}}),cW=ht.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),dW=hr.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 fW(t={}){return new Ct({view(e){return new hW(e,t)}})}class hW{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,l=s.height/o.offsetHeight;if(n){let h=e.nodeBefore,m=e.nodeAfter;if(h||m){let y=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(y){let v=y.getBoundingClientRect(),b=h?v.bottom:v.top;h&&m&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*l;r={left:v.left,right:v.right,top:b-k,bottom:b+k}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*i;r={left:h.left-m,right:h.left+m,top:h.top,bottom:h.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,f;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,f=-pageYOffset;else{let h=u.getBoundingClientRect(),m=h.width/u.offsetWidth,y=h.height/u.offsetHeight;d=h.left-u.scrollLeft*m,f=h.top-u.scrollTop*y}this.element.style.left=(r.left-d)/i+"px",this.element.style.top=(r.top-f)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"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 l=e4(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}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 Rt extends Ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Rt.valid(r)?new Rt(r):Ue.near(r)}content(){return xe.empty}eq(e){return e instanceof Rt&&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 Rt(e.resolve(n.pos))}getBookmark(){return new iv(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!pW(e)||!mW(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&&Rt.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){s=l.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(Rt.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 l=e.doc.resolve(o);if(Rt.valid(l))return l}return null}}}Rt.prototype.visible=!1;Rt.findFrom=Rt.findGapCursorFrom;Ue.jsonID("gapcursor",Rt);class iv{constructor(e){this.pos=e}map(e){return new iv(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Rt.valid(n)?new Rt(n):Ue.near(n)}}function vT(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function pW(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||vT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function mW(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||vT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function gW(){return new Ct({props:{decorations:bW,createSelectionBetween(t,e,n){return e.pos==n.pos&&Rt.valid(n)?new Rt(n):null},handleClick:xW,handleKeyDown:yW,handleDOMEvents:{beforeinput:vW}}})}const yW=o6({ArrowLeft:Rf("horiz",-1),ArrowRight:Rf("horiz",1),ArrowUp:Rf("vert",-1),ArrowDown:Rf("vert",1)});function Rf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,l=e>0?i.$to:i.$from,u=i.empty;if(i instanceof ze){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=Rt.findGapCursorFrom(l,e,u);return d?(o&&o(r.tr.setSelection(new Rt(d))),!0):!1}}function xW(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Rt.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 Rt(r))),!0)}function vW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Rt))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 xe(o,0,0));return s.setSelection(ze.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function bW(t){if(!(t.selection instanceof Rt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xt.create(t.doc,[jn.widget(t.selection.head,e,{key:"gapcursor"})])}var Gh=200,pn=function(){};pn.prototype.append=function(e){return e.length?(e=pn.from(e),!this.length&&e||e.length<Gh&&this.leafAppend(e)||this.length<Gh&&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 kW(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 bT(e):pn.empty};var bT=(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,l){for(var u=s;u<i;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,l){for(var u=s-1;u>=i;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Gh)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Gh)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 bT([]);var kW=(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 l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),i)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,i+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),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 wW=500;class Vr{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,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(h);return}if(o){f.push(new co(h.map));let y=h.step.map(o.slice(s)),v;y&&i.maybeStep(y).doc&&(v=i.mapping.maps[i.mapping.maps.length-1],d.push(new co(v,void 0,void 0,d.length+f.length))),s--,v&&o.appendMap(v,s)}else i.maybeStep(h.step);if(h.selection)return l=o?h.selection.map(o.slice(s)):h.selection,u=new Vr(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:i,selection:l}}addTransform(e,n,r,o){let s=[],i=this.eventCount,l=this.items,u=!o&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),m=new co(e.mapping.maps[f],h,n),y;(y=u&&u.merge(m))&&(m=y,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(i++,n=void 0),o||(u=m)}let d=i-r.depth;return d>SW&&(l=CW(l,d),i-=d),new Vr(l.append(s),i)}remapping(e,n){let r=new lc;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 Vr(this.items.append(e.map(n=>new co(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,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);let u=n;this.items.forEach(m=>{let y=s.getMirror(--u);if(y==null)return;i=Math.min(i,y);let v=s.maps[y];if(m.step){let b=e.steps[y].invert(e.docs[y]),k=m.selection&&m.selection.map(s.slice(u+1,y));k&&l++,r.push(new co(v,b,k))}else r.push(new co(v))},o);let d=[];for(let m=n;m<i;m++)d.push(new co(s.maps[m]));let f=this.items.slice(0,o).append(d).append(r),h=new Vr(f,l);return h.emptyItemCount()>wW&&(h=h.compress(this.items.length-r.length)),h}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,l)=>{if(l>=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 f=i.selection&&i.selection.map(n.slice(r));f&&s++;let h=new co(d.invert(),u,f),m,y=o.length-1;(m=o.length&&o[y].merge(h))?o[y]=m:o.push(h)}}else i.map&&r--},this.items.length,0),new Vr(pn.from(o.reverse()),s)}}Vr.empty=new Vr(pn.empty,0);function CW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class co{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 co(n.getMap().invert(),n,this.selection)}}}class Fs{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const SW=20;function EW(t,e,n,r){let o=n.getMeta(Zi),s;if(o)return o.historyState;n.getMeta(AW)&&(t=new Fs(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(Zi))return i.getMeta(Zi).redo?new Fs(t.done.addTransform(n,void 0,r,qf(e)),t.undone,GC(n.mapping.maps),t.prevTime,t.prevComposition):new Fs(t.done,t.undone.addTransform(n,void 0,r,qf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!_W(n,t.prevRanges)),d=i?Lg(t.prevRanges,n.mapping):GC(n.mapping.maps);return new Fs(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,qf(e)),Vr.empty,d,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Fs(t.done.rebased(n,s),t.undone.rebased(n,s),Lg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Fs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Lg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function _W(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 GC(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 Lg(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 TW(t,e,n){let r=qf(e),o=Zi.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),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new Fs(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(Zi,{redo:n,historyState:u})}let zg=!1,JC=null;function qf(t){let e=t.plugins;if(JC!=e){zg=!1,JC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){zg=!0;break}}return zg}const Zi=new Ht("history"),AW=new Ht("closeHistory");function NW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ct({key:Zi,state:{init(){return new Fs(Vr.empty,Vr.empty,null,0,-1)},apply(e,n,r){return EW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?wT:r=="historyRedo"?CT:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function kT(t,e){return(n,r)=>{let o=Zi.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=TW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const wT=kT(!1,!0),CT=kT(!0,!0);St.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 Ct({key:new Ht("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 l=i-o,u=0,d=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const f=r.tr.deleteRange(u,d);return t=!0,f}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 l=e.selection.$head.pos,u=s-r,d=l-u,f=l;return e.deleteRange(d,f),!(this.storage.characters({node:e.doc})>r)}})]}});var MW=St.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[fW(this.options)]}});St.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ct({key:new Ht("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 l=0;return t.descendants((u,d)=>{if(u.isText||!(o>=d&&o<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(jn.node(d,d+u.nodeSize,{class:this.options.className}))}),xt.create(t,s)}}})]}});var DW=St.create({name:"gapCursor",addProseMirrorPlugins(){return[gW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=lt(Me(t,"allowGapCursor",n)))!=null?e:null}}}),ST="placeholder",ZC=new Ht("tiptap__placeholder");function ET(t){const{editor:e,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:i,hasAnchor:l,classes:{emptyNode:u,emptyEditor:d}}=t,f=[u];return i&&f.push(d),jn.node(o,o+s.nodeSize,{class:f.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:o,hasAnchor:l}):n})}function _T(t,e){return typeof t=="function"?t(e):t}function TT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:s,to:i}){const{anchor:l}=o,u=[],d=t.isEmpty;return r.nodesBetween(s,i,(f,h)=>{const m=l>=h&&l<=h+f.nodeSize,y=!f.isLeaf&&Uc(f);return f.type.isTextblock&&(m||!e.showOnlyCurrent)&&y&&u.push(ET({editor:t,isEmptyDoc:d,dataAttribute:n,hasAnchor:m,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:_T(e.emptyNodeClass,{editor:t,node:f,pos:h,hasAnchor:m})},node:f,pos:h})),e.includeChildren}),u}function AT({editor:t,options:e,dataAttribute:n,doc:r,selection:o}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=o,l=[],u=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const f=r.resolve(i),h=f.depth>0?f.node(1):f.nodeAfter,m=f.depth>0?f.before(1):i;if(h&&h.type.isTextblock&&Uc(h)){const y=i>=m&&i<=m+h.nodeSize;l.push(ET({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:y,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:_T(e.emptyNodeClass,{editor:t,node:h,pos:m,hasAnchor:y})},node:h,pos:m}))}}else l.push(...TT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return xt.create(r,l)}function zu(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 l=r.nodeAfter?e:e-i.nodeSize;return{from:l,to:l+i.nodeSize}}const o=r.before(1),s=r.node(1);return{from:o,to:o+s.nodeSize}}function Fu(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function RW(t,e,n){const r=[];return t.forEach((o,s)=>{const i=s,l=i+o.nodeSize,u=i+1,d=l+1;u<n&&d>e&&r.push({from:i,to:l})}),r}function OW(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 IW(t,e){const n=RW(t,e.from,e.to);return n.push(Fu(t,zu(t,e.from))),e.to>e.from?n.push(Fu(t,zu(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(Fu(t,zu(t,Math.min(e.from+1,t.content.size)))),n}function PW(t,e,n){const r=[];if(t.docChanged){const o=Bx(t);for(const s of o)r.push(...IW(n.doc,s.newRange))}return t.selectionSet&&(r.push(Fu(n.doc,zu(n.doc,t.mapping.map(e.selection.anchor)))),r.push(Fu(n.doc,zu(n.doc,n.selection.anchor)))),OW(r)}function jW(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 LW({decorations:t,ranges:e,editor:n,options:r,dataAttribute:o,doc:s,selection:i}){let l=t;for(const u of e){const{from:d,to:f}=jW(u.from,u.to,s),h=l.find(d,f).filter(y=>y.from>=d&&y.to<=f);h.length&&(l=l.remove(h));const m=TT({editor:n,options:r,dataAttribute:o,doc:s,selection:i,from:d,to:f});m.length&&(l=l.add(s,m))}return l}function zW({editor:t,options:e,dataAttribute:n}){return{init(r,o){const s=AT({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 l=o.map(r.mapping,r.doc),u=PW(r,s,i);return LW({decorations:l,ranges:u,editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection})}}}function FW(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function $W({editor:t,options:e}){const n=e.dataAttribute?`data-${FW(e.dataAttribute)}`:`data-${ST}`,r=e.showOnlyCurrent&&!e.includeChildren;return new Ct({key:ZC,...r?{}:{state:zW({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:o,selection:s})=>AT({editor:t,options:e,dataAttribute:n,doc:o,selection:s}):o=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?xt.empty:(s=ZC.getState(o))!=null?s:xt.empty}}})}St.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:ST,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[$W({editor:this.editor,options:this.options})]}});function gy(t,e){return!t.selection.empty&&!b6(t.selection)&&e.isEditable}function BW(t,e){return gy(t,e)&&!e.isFocused&&!e.view.dragging}function VW(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function HW(t){t.focus()}St.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ct({key:new Ht("selection"),props:{decorations(n){return BW(n,t)?xt.create(n.doc,[jn.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return gy(n.state,t)&&VW(),!1},focus(n){return gy(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&HW(n)}),!1}}}})]}});var UW="skipTrailingNode";function YC({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var WW=St.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Ht(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 Ct({key:e,appendTransaction:(o,s,i)=>{const{doc:l,tr:u,schema:d}=i,f=e.getState(i),h=l.content.size,m=d.nodes[n];if(!o.some(y=>y.getMeta(UW))&&f)return u.insert(h,m.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!YC({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!YC({node:i,types:r})}}})]}}),qW=St.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wT(t,e),redo:()=>({state:t,dispatch:e})=>CT(t,e)}},addProseMirrorPlugins(){return[NW(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()}}}),KW=St.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(OH.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(AH.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(aT.configure(this.options.bulletList)),this.options.code!==!1&&o.push(jH.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(FH.configure(this.options.codeBlock)),this.options.document!==!1&&o.push($H.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(MW.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(DW.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(BH.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(VH.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(qW.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(HH.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(GH.configure(this.options.italic)),this.options.listItem!==!1&&o.push(fT.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(gT.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(_U.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(xT.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(iW.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(uW.configure(this.options.strike)),this.options.text!==!1&&o.push(cW.configure(this.options.text)),this.options.underline!==!1&&o.push(dW.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(WW.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),GW=KW;const XC={};function JW(t){let e=XC[t];if(e)return e;e=XC[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 gl(t,e){typeof e!="string"&&(e=gl.defaultChars);const n=JW(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 l=parseInt(r.slice(s+1,s+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&s+3<i){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const d=l<<6&1984|u&63;d<128?o+="��":o+=String.fromCharCode(d),s+=3;continue}}if((l&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 f=l<<12&61440|u<<6&4032|d&63;f<2048||f>=55296&&f<=57343?o+="���":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+9<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16),f=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(d&192)===128&&(f&192)===128){let h=l<<18&1835008|u<<12&258048|d<<6&4032|f&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="�"}return o})}gl.defaultChars=";/?:@&=+$,#";gl.componentChars="";const QC={};function ZW(t){let e=QC[t];if(e)return e;e=QC[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 qc(t,e,n){typeof e!="string"&&(n=e,e=qc.defaultChars),typeof n>"u"&&(n=!0);const r=ZW(e);let o="";for(let s=0,i=t.length;s<i;s++){const l=t.charCodeAt(s);if(n&&l===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(l<128){o+=r[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=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}qc.defaultChars=";/?:@&=+$,-_.!~*'()#";qc.componentChars="-_.!~*'()";function av(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 Jh(){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 YW=/^([a-z0-9.+-]+:)/i,XW=/:[0-9]*$/,QW=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,eq=["<",">",'"',"`"," ","\r",`
|
|
595
|
-
`," "],tq=["{","}","|","\\","^","`"].concat(eq),nq=["'"].concat(tq),eS=["%","/","?",";","#"].concat(nq),tS=["/","?","#"],rq=255,nS=/^[+a-z0-9A-Z_-]{0,63}$/,oq=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,rS={javascript:!0,"javascript:":!0},oS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lv(t,e){if(t&&t instanceof Jh)return t;const n=new Jh;return n.parse(t,e),n}Jh.prototype.parse=function(t,e){let n,r,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const d=QW.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=YW.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&&rS[i])&&(s=s.substr(2),this.slashes=!0)),!rS[i]&&(o||i&&!oS[i])){let d=-1;for(let v=0;v<tS.length;v++)r=s.indexOf(tS[v]),r!==-1&&(d===-1||r<d)&&(d=r);let f,h;d===-1?h=s.lastIndexOf("@"):h=s.lastIndexOf("@",d),h!==-1&&(f=s.slice(0,h),s=s.slice(h+1),this.auth=f),d=-1;for(let v=0;v<eS.length;v++)r=s.indexOf(eS[v]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=s.length),s[d-1]===":"&&d--;const m=s.slice(0,d);s=s.slice(d),this.parseHost(m),this.hostname=this.hostname||"";const y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y){const v=this.hostname.split(/\./);for(let b=0,k=v.length;b<k;b++){const E=v[b];if(E&&!E.match(nS)){let _="";for(let T=0,N=E.length;T<N;T++)E.charCodeAt(T)>127?_+="x":_+=E[T];if(!_.match(nS)){const T=v.slice(0,b),N=v.slice(b+1),M=E.match(oq);M&&(T.push(M[1]),N.unshift(M[2])),N.length&&(s=N.join(".")+s),this.hostname=T.join(".");break}}}}this.hostname.length>rq&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),oS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Jh.prototype.parseHost=function(t){let e=XW.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 sq=Object.freeze(Object.defineProperty({__proto__:null,decode:gl,encode:qc,format:av,parse:lv},Symbol.toStringTag,{value:"Module"})),NT=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,MT=/[\0-\x1F\x7F-\x9F]/,iq=/[\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]/,uv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,DT=/[\$\+<->\^`\|~\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]/,RT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,aq=Object.freeze(Object.defineProperty({__proto__:null,Any:NT,Cc:MT,Cf:iq,P:uv,S:DT,Z:RT},Symbol.toStringTag,{value:"Module"})),lq=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),uq=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Fg;const cq=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]]),dq=(Fg=String.fromCodePoint)!==null&&Fg!==void 0?Fg: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 fq(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=cq.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 hq=32;var Ks;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ks||(Ks={}));function yy(t){return t>=fn.ZERO&&t<=fn.NINE}function pq(t){return t>=fn.UPPER_A&&t<=fn.UPPER_F||t>=fn.LOWER_A&&t<=fn.LOWER_F}function mq(t){return t>=fn.UPPER_A&&t<=fn.UPPER_Z||t>=fn.LOWER_A&&t<=fn.LOWER_Z||yy(t)}function gq(t){return t===fn.EQUALS||mq(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 Ko;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Ko||(Ko={}));class yq{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=Ko.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)|hq)===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(yy(o)||pq(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(yy(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===Ko.Strict)return 0;return this.emitCodePoint(fq(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&Ks.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=xq(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Ko.Attribute&&(s===0||gq(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&Ks.VALUE_LENGTH)>>14,s!==0){if(i===fn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ko.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]&Ks.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]&~Ks.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!==Ko.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 OT(t){let e="";const n=new yq(t,r=>e+=dq(r));return function(o,s){let i=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(i,l),n.startEntity(s);const d=n.write(o,l+1);if(d<0){i=l+n.end();break}i=l+d,l=d===0?i+1:i}const u=e+o.slice(i);return e="",u}}function xq(t,e,n,r){const o=(e&Ks.BRANCH_LENGTH)>>7,s=e&Ks.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,l=i+o-1;for(;i<=l;){const u=i+l>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)l=u-1;else return t[u+o]}return-1}const IT=OT(lq);OT(uq);function vq(t,e=Ko.Legacy){return IT(t,e)}function bq(t){return IT(t,Ko.Strict)}function kq(t){return Object.prototype.toString.call(t)}function cv(t){return kq(t)==="[object String]"}const wq=Object.prototype.hasOwnProperty;function Cq(t,e){return wq.call(t,e)}function Hp(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 PT(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function dv(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 gc(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 jT=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Sq=/&([a-z#][a-z0-9]{1,31});/gi,Eq=new RegExp(jT.source+"|"+Sq.source,"gi"),_q=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Tq(t,e){if(e.charCodeAt(0)===35&&_q.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return dv(r)?gc(r):t}const n=vq(t);return n!==t?n:t}function Aq(t){return t.indexOf("\\")<0?t:t.replace(jT,"$1")}function yl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Eq,function(e,n,r){return n||Tq(e,r)})}const Nq=/[&<>"]/,Mq=/[&<>"]/g,Dq={"&":"&","<":"<",">":">",'"':"""};function Rq(t){return Dq[t]}function fi(t){return Nq.test(t)?t.replace(Mq,Rq):t}const Oq=/[.?*+^$[\]\\(){}|-]/g;function Iq(t){return t.replace(Oq,"\\$&")}function vt(t){switch(t){case 9:case 32:return!0}return!1}function yc(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 LT(t){return uv.test(t)||DT.test(t)}function xc(t){return LT(gc(t))}function vc(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 Up(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function sS(t){return t===32||t===9||t===10||t===13}function Wp(t){let e=0;for(;e<t.length&&sS(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&sS(t.charCodeAt(n));n--);return t.slice(e,n+1)}const Pq={mdurl:sq,ucmicro:aq},jq=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:PT,asciiTrim:Wp,assign:Hp,escapeHtml:fi,escapeRE:Iq,fromCodePoint:gc,has:Cq,isMdAsciiPunct:vc,isPunctChar:LT,isPunctCharCode:xc,isSpace:vt,isString:cv,isValidEntityCode:dv,isWhiteSpace:yc,lib:Pq,normalizeReference:Up,unescapeAll:yl,unescapeMd:Aq},Symbol.toStringTag,{value:"Module"}));function Lq(t,e,n){let r,o,s,i;const l=t.posMax,u=t.pos;for(t.pos=e+1,r=1;t.pos<l;){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 zq(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=yl(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=yl(t.slice(e,o)),s.pos=o,s.ok=!0),s}function Fq(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 l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return i;e++,s++,l===40&&(l=41),i.marker=l}for(;s<n;){if(o=t.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=yl(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+=yl(t.slice(e,s)),i}const $q=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:zq,parseLinkLabel:Lq,parseLinkTitle:Fq},Symbol.toStringTag,{value:"Module"})),So={};So.code_inline=function(t,e,n,r,o){const s=t[e];return"<code"+o.renderAttrs(s)+">"+fi(s.content)+"</code>"};So.code_block=function(t,e,n,r,o){const s=t[e];return"<pre"+o.renderAttrs(s)+"><code>"+fi(t[e].content)+`</code></pre>
|
|
596
|
-
`};So.fence=function(t,e,n,r,o){const s=t[e],i=s.info?yl(s.info).trim():"";let l="",u="";if(i){const f=i.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(n.highlight?d=n.highlight(s.content,l,u)||fi(s.content):d=fi(s.content),d.indexOf("<pre")===0)return d+`
|
|
597
|
-
`;if(i){const f=s.attrIndex("class"),h=s.attrs?s.attrs.slice():[];f<0?h.push(["class",n.langPrefix+l]):(h[f]=h[f].slice(),h[f][1]+=" "+n.langPrefix+l);const m={attrs:h};return`<pre><code${o.renderAttrs(m)}>${d}</code></pre>
|
|
598
|
-
`}return`<pre><code${o.renderAttrs(s)}>${d}</code></pre>
|
|
599
|
-
`};So.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)};So.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
|
|
600
|
-
`:`<br>
|
|
601
|
-
`};So.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
|
|
602
|
-
`:`<br>
|
|
603
|
-
`:`
|
|
604
|
-
`};So.text=function(t,e){return fi(t[e].content)};So.html_block=function(t,e){return t[e].content};So.html_inline=function(t,e){return t[e].content};function Tl(){this.rules=Hp({},So)}Tl.prototype.renderAttrs=function(e){let n,r,o;if(!e.attrs)return"";for(o="",n=0,r=e.attrs.length;n<r;n++)o+=" "+fi(e.attrs[n][0])+'="'+fi(e.attrs[n][1])+'"';return o};Tl.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+=`
|
|
605
|
-
`),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 l=e[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===o.tag)&&(i=!1)}return s+=i?`>
|
|
606
|
-
`:">",s};Tl.prototype.renderInline=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;typeof o[l]<"u"?r+=o[l](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};Tl.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+=`
|
|
607
|
-
`;break}return r};Tl.prototype.render=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;l==="inline"?r+=this.renderInline(t[s].children,e,n):typeof o[l]<"u"?r+=o[l](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function tr(){this.__rules__=[],this.__cache__=null}tr.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};tr.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))})})};tr.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};tr.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};tr.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};tr.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};tr.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};tr.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};tr.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};tr.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Zr(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}Zr.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};Zr.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Zr.prototype.attrSet=function(e,n){const r=this.attrIndex(e),o=[e,n];r<0?this.attrPush(o):this.attrs[r]=o};Zr.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Zr.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 zT(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}zT.prototype.Token=Zr;const Bq=/\r\n?|\n/g,Vq=/\0/g;function Hq(t){let e;e=t.src.replace(Bq,`
|
|
608
|
-
`),e=e.replace(Vq,"�"),t.src=e}function Uq(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 Wq(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 qq(t){return/^<a[>\s]/i.test(t)}function Kq(t){return/^<\/a\s*>/i.test(t)}function Gq(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 l=o[i];if(l.type==="link_close"){for(i--;o[i].level!==l.level&&o[i].type!=="link_open";)i--;continue}if(l.type==="html_inline"&&(qq(l.content)&&s>0&&s--,Kq(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){const u=l.content;let d=t.md.linkify.match(u);const f=[];let h=l.level,m=0;d.length>0&&d[0].index===0&&i>0&&o[i-1].type==="text_special"&&(d=d.slice(1));for(let y=0;y<d.length;y++){const v=d[y].url,b=t.md.normalizeLink(v);if(!t.md.validateLink(b))continue;let k=d[y].text;d[y].schema?d[y].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[y].index;if(E>m){const M=new t.Token("text","",0);M.content=u.slice(m,E),M.level=h,f.push(M)}const _=new t.Token("link_open","a",1);_.attrs=[["href",b]],_.level=h++,_.markup="linkify",_.info="auto",f.push(_);const T=new t.Token("text","",0);T.content=k,T.level=h,f.push(T);const N=new t.Token("link_close","a",-1);N.level=--h,N.markup="linkify",N.info="auto",f.push(N),m=d[y].lastIndex}if(m<u.length){const y=new t.Token("text","",0);y.content=u.slice(m),y.level=h,f.push(y)}e[n].children=o=PT(o,i,f)}}}}const FT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Jq=/\((c|tm|r)\)/i,Zq=/\((c|tm|r)\)/ig,Yq={c:"©",r:"®",tm:"™"};function Xq(t,e){return Yq[e.toLowerCase()]}function Qq(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(Zq,Xq)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function eK(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&FT.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 tK(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Jq.test(t.tokens[e].content)&&Qq(t.tokens[e].children),FT.test(t.tokens[e].content)&&eK(t.tokens[e].children))}const nK=/['"]/,iS=/['"]/g,aS="’";function Of(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function rK(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 oK(t,e){let n;const r=[],o={};for(let s=0;s<t.length;s++){const i=t[s],l=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(r.length=n+1,i.type!=="text")continue;const u=i.content;let d=0;const f=u.length;e:for(;d<f;){iS.lastIndex=d;const h=iS.exec(u);if(!h)break;let m=!0,y=!0;d=h.index+1;const v=h[0]==="'";let b=32;if(h.index-1>=0)b=u.charCodeAt(h.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<f)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=vc(b)||xc(b),_=vc(k)||xc(k),T=yc(b),N=yc(k);if(N?m=!1:_&&(T||E||(m=!1)),T?y=!1:E&&(N||_||(y=!1)),k===34&&h[0]==='"'&&b>=48&&b<=57&&(y=m=!1),m&&y&&(m=E,y=_),!m&&!y){v&&Of(o,s,h.index,aS);continue}if(y)for(n=r.length-1;n>=0;n--){let M=r[n];if(r[n].level<l)break;if(M.single===v&&r[n].level===l){M=r[n];let D,I;v?(D=e.md.options.quotes[2],I=e.md.options.quotes[3]):(D=e.md.options.quotes[0],I=e.md.options.quotes[1]),Of(o,s,h.index,I),Of(o,M.token,M.pos,D),r.length=n;continue e}}m?r.push({token:s,pos:h.index,single:v,level:l}):y&&v&&Of(o,s,h.index,aS)}}Object.keys(o).forEach(function(s){t[s].content=rK(t[s].content,o[s])})}function sK(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!nK.test(t.tokens[e].content)||oK(t.tokens[e].children,t)}function iK(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,l=i.length;for(e=0;e<l;e++)i[e].type==="text_special"&&(i[e].type="text");for(e=n=0;e<l;e++)i[e].type==="text"&&e+1<l&&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 $g=[["normalize",Hq],["block",Uq],["inline",Wq],["linkify",Gq],["replacements",tK],["smartquotes",sK],["text_join",iK]];function fv(){this.ruler=new tr;for(let t=0;t<$g.length;t++)this.ruler.push($g[t][0],$g[t][1])}fv.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};fv.prototype.State=zT;function Eo(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,l=0,u=0,d=o.length,f=!1;i<d;i++){const h=o.charCodeAt(i);if(!f)if(vt(h)){l++,h===9?u+=4-u%4:u++;continue}else f=!0;(h===10||i===d-1)&&(h!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),f=!1,l=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}Eo.prototype.push=function(t,e,n){const r=new Zr(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};Eo.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Eo.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Eo.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};Eo.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!vt(this.src.charCodeAt(--e)))return e+1;return e};Eo.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};Eo.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};Eo.prototype.getLines=function(e,n,r,o){if(e>=n)return"";const s=new Array(n-e);for(let i=0,l=e;l<n;l++,i++){let u=0;const d=this.bMarks[l];let f=d,h;for(l+1<n||o?h=this.eMarks[l]+1:h=this.eMarks[l];f<h&&u<r;){const m=this.src.charCodeAt(f);if(vt(m))m===9?u+=4-(u+this.bsCount[l])%4:u++;else if(f-d<this.tShift[l])u++;else break;f++}u>r?s[i]=new Array(u-r+1).join(" ")+this.src.slice(f,h):s[i]=this.src.slice(f,h)}return s.join("")};Eo.prototype.Token=Zr;const aK=65536;function Bg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function lS(t){const e=[],n=t.length;let r=0,o=t.charCodeAt(r),s=!1,i=0,l="";for(;r<n;)o===124&&(s?(l+=t.substring(i,r-1),i=r):(e.push(l+t.substring(i,r)),l="",i=r+1)),s=o===92,r++,o=t.charCodeAt(r);return e.push(l+t.substring(i)),e}function lK(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 l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!vt(l)||i===45&&vt(l))return!1;for(;s<t.eMarks[o];){const N=t.src.charCodeAt(s);if(N!==124&&N!==45&&N!==58&&!vt(N))return!1;s++}let u=Bg(t,e+1),d=u.split("|");const f=[];for(let N=0;N<d.length;N++){const M=d[N].trim();if(!M){if(N===0||N===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(M))return!1;M.charCodeAt(M.length-1)===58?f.push(M.charCodeAt(0)===58?"center":"right"):M.charCodeAt(0)===58?f.push("left"):f.push("")}if(u=Bg(t,e).trim(),u.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;d=lS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const h=d.length;if(h===0||h!==f.length)return!1;if(r)return!0;const m=t.parentType;t.parentType="table";const y=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 N=0;N<d.length;N++){const M=t.push("th_open","th",1);f[N]&&(M.attrs=[["style","text-align:"+f[N]]]);const D=t.push("inline","",0);D.content=d[N].trim(),D.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 N=!1;for(let D=0,I=y.length;D<I;D++)if(y[D](t,o,n,!0)){N=!0;break}if(N||(u=Bg(t,o).trim(),!u)||t.sCount[o]-t.blkIndent>=4||(d=lS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),T+=h-d.length,T>aK))break;if(o===e+2){const D=t.push("tbody_open","tbody",1);D.map=_=[e+2,0]}const M=t.push("tr_open","tr",1);M.map=[o,o+1];for(let D=0;D<h;D++){const I=t.push("td_open","td",1);f[D]&&(I.attrs=[["style","text-align:"+f[D]]]);const P=t.push("inline","",0);P.content=d[D]?d[D].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=m,t.line=o,!0}function uK(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)+`
|
|
609
|
-
`,s.map=[e,t.line],!0}function cK(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 l=o;o=t.skipChars(o,i);let u=o-l;if(u<3)return!1;const d=t.src.slice(l,o),f=t.src.slice(o,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let h=e,m=!1;for(;h++,!(h>=n||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o<s&&t.sCount[h]<t.blkIndent));)if(t.src.charCodeAt(o)===i&&!(t.sCount[h]-t.blkIndent>=4)&&(o=t.skipChars(o,i),!(o-l<u)&&(o=t.skipSpaces(o),!(o<s)))){m=!0;break}u=t.sCount[e],t.line=h+(m?1:0);const y=t.push("fence","code",0);return y.info=f,y.content=t.getLines(e+1,h,u,!0),y.markup=d,y.map=[e,t.line],!0}function dK(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 l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let y=!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 M=t.sCount[v]+1,D,I;t.src.charCodeAt(o)===32?(o++,M++,I=!1,D=!0):t.src.charCodeAt(o)===9?(D=!0,(t.bsCount[v]+M)%4===3?(o++,M++,I=!1):I=!0):D=!1;let P=M;for(l.push(t.bMarks[v]),t.bMarks[v]=o;o<s;){const O=t.src.charCodeAt(o);if(vt(O))O===9?P+=4-(P+t.bsCount[v]+(I?1:0))%4:P++;else break;o++}y=o>=s,u.push(t.bsCount[v]),t.bsCount[v]=t.sCount[v]+1+(D?1:0),d.push(t.sCount[v]),t.sCount[v]=P-M,f.push(t.tShift[v]),t.tShift[v]=o-t.bMarks[v];continue}if(y)break;let N=!1;for(let M=0,D=h.length;M<D;M++)if(h[M](t,v,n,!0)){N=!0;break}if(N){t.lineMax=v,t.blkIndent!==0&&(l.push(t.bMarks[v]),u.push(t.bsCount[v]),f.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]-=t.blkIndent);break}l.push(t.bMarks[v]),u.push(t.bsCount[v]),f.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=m,E[1]=t.line;for(let T=0;T<f.length;T++)t.bMarks[T+e]=l[T],t.tShift[T+e]=f[T],t.sCount[T+e]=d[T],t.bsCount[T+e]=u[T];return t.blkIndent=b,!0}function fK(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 l=1;for(;s<o;){const d=t.src.charCodeAt(s++);if(d!==i&&!vt(d))return!1;d===i&&l++}if(l<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(l+1).join(String.fromCharCode(i)),!0}function uS(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 cS(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 hK(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 pK(t,e,n,r){let o,s,i,l,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 f=!1;r&&t.parentType==="paragraph"&&t.sCount[u]>=t.blkIndent&&(f=!0);let h,m,y;if((y=cS(t,u))>=0){if(h=!0,i=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(i,y-1)),f&&m!==1)return!1}else if((y=uS(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(y)>=t.eMarks[u])return!1;if(r)return!0;const v=t.src.charCodeAt(y-1),b=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);const k=[u,0];l.map=k,l.markup=String.fromCharCode(v);let E=!1;const _=t.md.block.ruler.getRules("list"),T=t.parentType;for(t.parentType="list";u<n;){s=y,o=t.eMarks[u];const N=t.sCount[u]+y-(t.bMarks[u]+t.tShift[u]);let M=N;for(;s<o;){const ee=t.src.charCodeAt(s);if(ee===9)M+=4-(M+t.bsCount[u])%4;else if(ee===32)M++;else break;s++}const D=s;let I;D>=o?I=1:I=M-N,I>4&&(I=1);const P=N+I;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(v);const O=[u,0];l.map=O,h&&(l.info=t.src.slice(i,y-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]=D-t.bMarks[u],t.sCount[u]=M,D>=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,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(v),u=t.line,O[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(h){if(y=cS(t,u),y<0)break;i=t.bMarks[u]+t.tShift[u]}else if(y=uS(t,u),y<0)break;if(v!==t.src.charCodeAt(y-1))break}return h?l=t.push("ordered_list_close","ol",-1):l=t.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(v),k[1]=u,t.line=u,t.parentType=T,d&&hK(t,b),!0}function mK(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 l(_){const T=t.lineMax;if(_>=T||t.isEmpty(_))return null;let N=!1;if(t.sCount[_]-t.blkIndent>3&&(N=!0),t.sCount[_]<0&&(N=!0),!N){const I=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let O=!1;for(let W=0,Z=I.length;W<Z;W++)if(I[W](t,_,T,!0)){O=!0;break}if(t.parentType=P,O)return null}const M=t.bMarks[_]+t.tShift[_],D=t.eMarks[_];return t.src.slice(M,D+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=l(i);T!==null&&(u+=T,s=u.length,i++)}else if(_===92&&(o++,o<s&&u.charCodeAt(o)===10)){const T=l(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=l(i);T!==null&&(u+=T,s=u.length,i++)}else if(!vt(_))break}const f=t.md.helpers.parseLinkDestination(u,o,s);if(!f.ok)return!1;const h=t.md.normalizeLink(f.str);if(!t.md.validateLink(h))return!1;o=f.pos;const m=o,y=i,v=o;for(;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=l(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 _=l(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=m,i=y);o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10&&k)for(k="",o=m,i=y;o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10)return!1;const E=Up(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:h}),t.line=i),!0):!1}const gK=["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"],yK="[a-zA-Z_:][a-zA-Z0-9:._-]*",xK="[^\"'=<>`\\x00-\\x20]+",vK="'[^']*'",bK='"[^"]*"',kK="(?:"+xK+"|"+vK+"|"+bK+")",wK="(?:\\s+"+yK+"(?:\\s*=\\s*"+kK+")?)",$T="<[A-Za-z][A-Za-z0-9\\-]*"+wK+"*\\s*\\/?>",BT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",CK="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",SK="<[?][\\s\\S]*?[?]>",EK="<![A-Za-z][^>]*>",_K="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",TK=new RegExp("^(?:"+$T+"|"+BT+"|"+CK+"|"+SK+"|"+EK+"|"+_K+")"),AK=new RegExp("^(?:"+$T+"|"+BT+")"),zi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+gK.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(AK.source+"\\s*$"),/^$/,!1]];function NK(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),l=0;for(;l<zi.length&&!zi[l][0].test(i);l++);if(l===zi.length)return!1;if(r)return zi[l][2];let u=e+1;const d=zi[l][1].test("");if(!zi[l][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),zi[l][1].test(i)){i.length!==0&&u++;break}}t.line=u;const f=t.push("html_block","",0);return f.map=[e,u],f.content=t.getLines(e,u,t.blkIndent,!0),!0}function MK(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 l=1;for(i=t.src.charCodeAt(++o);i===35&&o<s&&l<=6;)l++,i=t.src.charCodeAt(++o);if(l>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(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];const f=t.push("inline","",0);f.content=Wp(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];const h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}function DK(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,l=e+1;for(;l<n&&!t.isEmpty(l);l++){if(t.sCount[l]-t.blkIndent>3)continue;if(t.sCount[l]>=t.blkIndent){let y=t.bMarks[l]+t.tShift[l];const v=t.eMarks[l];if(y<v&&(i=t.src.charCodeAt(y),(i===45||i===61)&&(y=t.skipChars(y,i),y=t.skipSpaces(y),y>=v))){s=i===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let y=0,v=r.length;y<v;y++)if(r[y](t,l,n,!0)){m=!0;break}if(m)break}if(!s)return t.parentType=o,!1;const u=Wp(t.getLines(e,l,t.blkIndent,!1));t.line=l+1;const d=t.push("heading_open","h"+String(s),1);d.markup=String.fromCharCode(i),d.map=[e,t.line];const f=t.push("inline","",0);f.content=u,f.map=[e,t.line-1],f.children=[];const h=t.push("heading_close","h"+String(s),-1);return h.markup=String.fromCharCode(i),t.parentType=o,!0}function RK(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 f=0,h=r.length;f<h;f++)if(r[f](t,s,n,!0)){d=!0;break}if(d)break}const i=Wp(t.getLines(e,s,t.blkIndent,!1));t.line=s;const l=t.push("paragraph_open","p",1);l.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 If=[["table",lK,["paragraph","reference"]],["code",uK],["fence",cK,["paragraph","reference","blockquote","list"]],["blockquote",dK,["paragraph","reference","blockquote","list"]],["hr",fK,["paragraph","reference","blockquote","list"]],["list",pK,["paragraph","reference","blockquote"]],["reference",mK],["html_block",NK,["paragraph","reference","blockquote"]],["heading",MK,["paragraph","reference","blockquote"]],["lheading",DK],["paragraph",RK]];function qp(){this.ruler=new tr;for(let t=0;t<If.length;t++)this.ruler.push(If[t][0],If[t][1],{alt:(If[t][2]||[]).slice()})}qp.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),o=r.length,s=t.md.options.maxNesting;let i=e,l=!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 f=0;f<o;f++)if(d=r[f](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=!l,t.isEmpty(t.line-1)&&(l=!0),i=t.line,i<n&&t.isEmpty(i)&&(l=!0,i++,t.line=i)}};qp.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)};qp.prototype.State=Eo;function Kc(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}Kc.prototype.pushPending=function(){const t=new Zr("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Kc.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new Zr(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};Kc.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 l=s<n?this.src.charCodeAt(s):32;if((l&64512)===55296){const k=this.src.charCodeAt(s+1);l=(k&64512)===56320?65536+(l-55296<<10)+(k-56320):65533}else(l&64512)===56320&&(l=65533);const u=vc(o)||xc(o),d=vc(l)||xc(l),f=yc(o),h=yc(l),m=!h&&(!d||f||u),y=!f&&(!u||h||d);return{can_open:m&&(e||!y||u),can_close:y&&(e||!m||d),length:i}};Kc.prototype.Token=Zr;function OK(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 IK(t,e){let n=t.pos;for(;n<t.posMax&&!OK(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const PK=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function jK(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(PK);if(!o)return!1;const s=o[1],i=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!i)return!1;let l=i.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));const d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";const h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);const m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}function LK(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 hv=[];for(let t=0;t<256;t++)hv.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){hv[t.charCodeAt(0)]=1});function zK(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 l=t.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return t.pos=n,!0}let s=t.src[n];if(o>=55296&&o<=56319&&n+1<r){const l=t.src.charCodeAt(n+1);l>=56320&&l<=57343&&(s+=t.src[n+1],n++)}const i="\\"+s;if(!e){const l=t.push("text_special","",0);o<256&&hv[o]!==0?l.content=s:l.content=i,l.markup=i,l.info="escape"}return t.pos=n+1,!0}function FK(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),l=i.length;if(t.backticksScanned&&(t.backticks[l]||0)<=o)return e||(t.pending+=i),t.pos+=l,!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 f=u-d;if(f===l){if(!e){const h=t.push("code_inline","code",0);h.markup=i,h.content=t.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=u,!0}t.backticks[f]=d}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=l,!0}function $K(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 l;s%2&&(l=t.push("text","",0),l.content=i,s--);for(let u=0;u<s;u+=2)l=t.push("text","",0),l.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 dS(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 l=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[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[l.token-1].type==="text"&&t.tokens[l.token-1].content==="~"&&r.push(l.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 BK(t){const e=t.tokens_meta,n=t.tokens_meta.length;dS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&dS(t,e[r].delimiters)}const VT={tokenize:$K,postProcess:BK};function VK(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 fS(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,l=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?l+l:l,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?l+l:l,d.content="",i&&(t.tokens[e[r-1].token].content="",t.tokens[e[o.end+1].token].content="",r--)}}function HK(t){const e=t.tokens_meta,n=t.tokens_meta.length;fS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&fS(t,e[r].delimiters)}const HT={tokenize:VK,postProcess:HK};function UK(t,e){let n,r,o,s,i="",l="",u=t.pos,d=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const f=t.pos,h=t.posMax,m=t.pos+1,y=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(y<0)return!1;let v=y+1;if(v<h&&t.src.charCodeAt(v)===40){for(d=!1,v++;v<h&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(v>=h)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<h&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(o=t.md.helpers.parseLinkTitle(t.src,v,t.posMax),v<h&&u!==v&&o.ok)for(l=o.str,v=o.pos;v<h&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);}(v>=h||t.src.charCodeAt(v)!==41)&&(d=!0),v++}if(d){if(typeof t.env.references>"u")return!1;if(v<h&&t.src.charCodeAt(v)===91?(u=v+1,v=t.md.helpers.parseLinkLabel(t,v),v>=0?r=t.src.slice(u,v++):v=y+1):v=y+1,r||(r=t.src.slice(m,y)),s=t.env.references[Up(r)],!s)return t.pos=f,!1;i=s.href,l=s.title}if(!e){t.pos=m,t.posMax=y;const b=t.push("link_open","a",1),k=[["href",i]];b.attrs=k,l&&k.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=v,t.posMax=h,!0}function WK(t,e){let n,r,o,s,i,l,u,d,f="";const h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const y=t.pos+2,v=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(v<0)return!1;if(s=v+1,s<m&&t.src.charCodeAt(s)===40){for(s++;s<m&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);if(s>=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s<m&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);if(l=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<m&&d!==s&&l.ok)for(u=l.str,s=l.pos;s<m&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);else u="";if(s>=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<m&&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(y,v)),i=t.env.references[Up(o)],!i)return t.pos=h,!1;f=i.href,u=i.title}if(!e){r=t.src.slice(y,v);const b=[];t.md.inline.parse(r,t.md,t.env,b);const k=t.push("image","img",0),E=[["src",f],["alt",""]];k.attrs=E,k.children=b,k.content=r,u&&E.push(["title",u])}return t.pos=s,t.posMax=m,!0}const qK=/^([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])?)*)$/,KK=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function GK(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(KK.test(s)){const i=t.md.normalizeLink(s);if(!t.md.validateLink(i))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.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(qK.test(s)){const i=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(i))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.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 JK(t){return/^<a[>\s]/i.test(t)}function ZK(t){return/^<\/a\s*>/i.test(t)}function YK(t){const e=t|32;return e>=97&&e<=122}function XK(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&&!YK(o))return!1;const s=t.src.slice(r).match(TK);if(!s)return!1;if(!e){const i=t.push("html_inline","",0);i.content=s[0],JK(i.content)&&t.linkLevel++,ZK(i.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const QK=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,eG=/^&([a-z][a-z0-9]{1,31});/i;function tG(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(QK);if(s){if(!e){const i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=dv(i)?gc(i):gc(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(eG);if(s){const i=bq(s[0]);if(i!==s[0]){if(!e){const l=t.push("text_special","",0);l.content=i,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function hS(t){const e={},n=t.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const l=t[i];if(s.push(0),(t[r].marker!==l.marker||o!==l.token-1)&&(r=i),o=l.token,l.length=l.length||0,!l.close)continue;e.hasOwnProperty(l.marker)||(e[l.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[l.marker][(l.open?3:0)+l.length%3];let d=r-s[r]-1,f=d;for(;d>u;d-=s[d]+1){const h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){const y=d>0&&!t[d-1].open?s[d-1]+1:0;s[i]=i-d+y,s[d]=y,l.open=!1,h.end=i,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function nG(t){const e=t.tokens_meta,n=t.tokens_meta.length;hS(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&hS(e[r].delimiters)}function rG(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 Vg=[["text",IK],["linkify",jK],["newline",LK],["escape",zK],["backticks",FK],["strikethrough",VT.tokenize],["emphasis",HT.tokenize],["link",UK],["image",WK],["autolink",GK],["html_inline",XK],["entity",tG]],Hg=[["balance_pairs",nG],["strikethrough",VT.postProcess],["emphasis",HT.postProcess],["fragments_join",rG]];function Gc(){this.ruler=new tr;for(let t=0;t<Vg.length;t++)this.ruler.push(Vg[t][0],Vg[t][1]);this.ruler2=new tr;for(let t=0;t<Hg.length;t++)this.ruler2.push(Hg[t][0],Hg[t][1])}Gc.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 l=0;l<r;l++)if(t.level++,i=n[l](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};Gc.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 l=0;l<n;l++)if(i=e[l](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()};Gc.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 l=0;l<i;l++)s[l](o)};Gc.prototype.State=Kc;function oG(t){const e={};t=t||{},e.src_Any=NT.source,e.src_Cc=MT.source,e.src_Z=RT.source,e.src_P=uv.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 xy(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Kp(t){return Object.prototype.toString.call(t)}function sG(t){return Kp(t)==="[object String]"}function iG(t){return Kp(t)==="[object Object]"}function aG(t){return Kp(t)==="[object RegExp]"}function pS(t){return Kp(t)==="[object Function]"}function lG(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const UT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function uG(t){return Object.keys(t||{}).reduce(function(e,n){return e||UT.hasOwnProperty(n)},!1)}const cG={"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}}},dG="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]",fG="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function hG(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function mS(){return function(t,e){e.normalize(t)}}function Zh(t){const e=t.re=oG(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(dG),n.push(e.src_xn),e.src_tlds=n.join("|");function r(l){return l.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(l,u){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${u}`)}Object.keys(t.__schemas__).forEach(function(l){const u=t.__schemas__[l];if(u===null)return;const d={validate:null,link:null};if(t.__compiled__[l]=d,iG(u)){aG(u.validate)?d.validate=hG(u.validate):pS(u.validate)?d.validate=u.validate:s(l,u),pS(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=mS();return}if(sG(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:mS()};const i=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(lG).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 WT(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 dr(t,e){if(!(this instanceof dr))return new dr(t,e);e||uG(t)&&(e=t,t={}),this.__opts__=xy({},UT,e),this.__schemas__=xy({},cG,t),this.__compiled__={},this.__tlds__=fG,this.__tlds_replaced__=!1,this.re={},Zh(this)}dr.prototype.add=function(e,n){return this.__schemas__[e]=n,Zh(this),this};dr.prototype.set=function(e){return this.__opts__=xy(this.__opts__,e),this};dr.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)};dr.prototype.pretest=function(e){return this.re.pretest.test(e)};dr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};dr.prototype.match=function(e){const n=[],r=[],o=[],s=[];let i,l,u;function d(m,y){return m?y?m.index!==y.index?m.index<y.index?m:y:m.lastIndex>=y.lastIndex?m:y:m:y}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;)l=this.testSchemaAt(e,i[2],u.lastIndex),l&&r.push({schema:i[2],index:i.index+i[1].length,lastIndex:i.index+i[0].length+l});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 f=[0,0,0];let h=0;for(;;){const m=[r[f[0]],s[f[1]],o[f[2]]],y=d(d(m[0],m[1]),m[2]);if(!y)break;if(y===m[0]?f[0]++:y===m[1]?f[1]++:f[2]++,y.index<h)continue;const v=new WT(e,y.schema,y.index,y.lastIndex);this.__compiled__[v.schema].normalize(v,this),n.push(v),h=y.lastIndex}return n.length?n:null};dr.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 WT(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[o.schema].normalize(o,this),o};dr.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(),Zh(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Zh(this),this)};dr.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};dr.prototype.onCompile=function(){};const el=2147483647,mo=36,pv=1,bc=26,pG=38,mG=700,qT=72,KT=128,GT="-",gG=/^xn--/,yG=/[^\0-\x7F]/,xG=/[\x2E\u3002\uFF0E\uFF61]/g,vG={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ug=mo-pv,go=Math.floor,Wg=String.fromCharCode;function $s(t){throw new RangeError(vG[t])}function bG(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function JT(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(xG,".");const o=t.split("."),s=bG(o,e).join(".");return r+s}function ZT(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 kG=t=>String.fromCodePoint(...t),wG=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:mo},gS=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},YT=function(t,e,n){let r=0;for(t=n?go(t/mG):t>>1,t+=go(t/e);t>Ug*bc>>1;r+=mo)t=go(t/Ug);return go(r+(Ug+1)*t/(t+pG))},XT=function(t){const e=[],n=t.length;let r=0,o=KT,s=qT,i=t.lastIndexOf(GT);i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&$s("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){const u=r;for(let f=1,h=mo;;h+=mo){l>=n&&$s("invalid-input");const m=wG(t.charCodeAt(l++));m>=mo&&$s("invalid-input"),m>go((el-r)/f)&&$s("overflow"),r+=m*f;const y=h<=s?pv:h>=s+bc?bc:h-s;if(m<y)break;const v=mo-y;f>go(el/v)&&$s("overflow"),f*=v}const d=e.length+1;s=YT(r-u,d,u==0),go(r/d)>el-o&&$s("overflow"),o+=go(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},QT=function(t){const e=[];t=ZT(t);const n=t.length;let r=KT,o=0,s=qT;for(const u of t)u<128&&e.push(Wg(u));const i=e.length;let l=i;for(i&&e.push(GT);l<n;){let u=el;for(const f of t)f>=r&&f<u&&(u=f);const d=l+1;u-r>go((el-o)/d)&&$s("overflow"),o+=(u-r)*d,r=u;for(const f of t)if(f<r&&++o>el&&$s("overflow"),f===r){let h=o;for(let m=mo;;m+=mo){const y=m<=s?pv:m>=s+bc?bc:m-s;if(h<y)break;const v=h-y,b=mo-y;e.push(Wg(gS(y+v%b,0))),h=go(v/b)}e.push(Wg(gS(h,0))),s=YT(o,d,l===i),o=0,++l}++o,++r}return e.join("")},CG=function(t){return JT(t,function(e){return gG.test(e)?XT(e.slice(4).toLowerCase()):e})},SG=function(t){return JT(t,function(e){return yG.test(e)?"xn--"+QT(e):e})},eA={version:"2.3.1",ucs2:{decode:ZT,encode:kG},decode:XT,encode:QT,toASCII:SG,toUnicode:CG},EG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},_G={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"]}}},TG={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"]}}},AG={default:EG,zero:_G,commonmark:TG},NG=/^(vbscript|javascript|file|data):/,MG=/^data:image\/(gif|png|jpeg|webp);/;function DG(t){const e=t.trim().toLowerCase();return NG.test(e)?MG.test(e):!0}const tA=["http:","https:","mailto:"];function RG(t){const e=lv(t,!0);if(e.hostname&&(!e.protocol||tA.indexOf(e.protocol)>=0))try{e.hostname=eA.toASCII(e.hostname)}catch{}return qc(av(e))}function OG(t){const e=lv(t,!0);if(e.hostname&&(!e.protocol||tA.indexOf(e.protocol)>=0))try{e.hostname=eA.toUnicode(e.hostname)}catch{}return gl(av(e),gl.defaultChars+"%")}function nr(t,e){if(!(this instanceof nr))return new nr(t,e);e||cv(t)||(e=t||{},t="default"),this.inline=new Gc,this.block=new qp,this.core=new fv,this.renderer=new Tl,this.linkify=new dr,this.validateLink=DG,this.normalizeLink=RG,this.normalizeLinkText=OG,this.utils=jq,this.helpers=Hp({},$q),this.options={},this.configure(t),e&&this.set(e)}nr.prototype.set=function(t){return Hp(this.options,t),this};nr.prototype.configure=function(t){const e=this;if(cv(t)){const n=t;if(t=AG[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};nr.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};nr.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};nr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};nr.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};nr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};nr.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};nr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const IG=new vx({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 PG(t,e){if(t.isText&&e.isText&&ut.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class jG{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=PG(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 yu(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function qg(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function yS(t){return t[t.length-1]==`
|
|
610
|
-
`?t.slice(0,t.length-1):t}function Kg(){}function LG(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);qg(o,r)?n[r]=(i,l,u,d)=>{i.openNode(s,yu(o,l,u,d)),i.addText(yS(l.content)),i.closeNode()}:(n[r+"_open"]=(i,l,u,d)=>i.openNode(s,yu(o,l,u,d)),n[r+"_close"]=i=>i.closeNode())}else if(o.node){let s=t.nodeType(o.node);n[r]=(i,l,u,d)=>i.addNode(s,yu(o,l,u,d))}else if(o.mark){let s=t.marks[o.mark];qg(o,r)?n[r]=(i,l,u,d)=>{i.openMark(s.create(yu(o,l,u,d))),i.addText(yS(l.content)),i.closeMark(s)}:(n[r+"_open"]=(i,l,u,d)=>i.openMark(s.create(yu(o,l,u,d))),n[r+"_close"]=i=>i.closeMark(s))}else if(o.ignore)qg(o,r)?n[r]=Kg:(n[r+"_open"]=Kg,n[r+"_close"]=Kg);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 zG=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=LG(e,r)}parse(e,n={}){let r=new jG(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 xS(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new zG(IG,nr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:xS(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:xS(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 FG={open:"",close:"",mixable:!0};let $G=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 nA(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const _o=new $G({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||"")+`
|
|
611
|
-
`),t.text(e.textContent,!1),t.write(`
|
|
612
|
-
`),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 l=String(r+i);return t.repeat(" ",o-l.length)+l+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("]/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(`\\
|
|
613
|
-
`);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=BG(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 vS(n.child(r),-1)},close(t,e,n,r){return vS(n.child(r-1),1)},escape:!1}});function vS(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 BG(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 nA=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+=`
|
|
614
|
-
`),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+`
|
|
615
|
-
`}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=FG}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+=`
|
|
616
|
-
`)}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(`
|
|
617
|
-
`);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+=`
|
|
618
|
-
`)}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,l,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 f=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&&(f+=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 h=d.length?d[d.length-1]:null,m=h&&this.getMark(h.type.name).escape===!1,y=d.length-(m?1:0);e:for(let b=0;b<y;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,y)):E>b&&(d=d.slice(0,b).concat(d.slice(b+1,E)).concat(k).concat(d.slice(E,y)));continue e}}}let v=0;for(;v<Math.min(r.length,y)&&d[v].eq(r[v]);)++v;for(;v<r.length;)this.text(this.markString(r.pop(),!1,e,u),!1);if(f&&this.text(f),i){for(;r.length<y;){let b=d[r.length];r.push(b),this.text(this.markString(b,!0,e,u),!1),this.atBlockStart=!1}m&&i.isText?this.text(this.markString(h,!0,e,u)+i.text+this.markString(h,!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,l,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 Gg,bS;function VG(){if(bS)return Gg;bS=1;var t=!0,e=!1,n=!1;Gg=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 h(b[k])&&m(b[k-1])&&y(b[k-2])&&v(b[k])}function i(b,k){if(b.children.unshift(l(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(f(b.content,E,k))}else b.children.unshift(u(k)),b.children.push(d(k))}function l(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 f(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 h(b){return b.type==="inline"}function m(b){return b.type==="paragraph_open"}function y(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 Gg}var HG=VG();const UG=Ty(HG);var WG=Object.defineProperty,qG=(t,e,n)=>e in t?WG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yh=(t,e,n)=>(qG(t,typeof e!="symbol"?e+"":e,n),n);const KG=St.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 l=r.getAttributes(i);return o.updateAttributes(i,{tight:e??!(l!=null&&l.tight)})}return t.options.listTypes.some(i=>s(i))}}}}}),kS=nr();function rA(t,e){return kS.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new kS.inline.State(t,null,null,[]).scanDelims(e,!0)}function oA(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 GG(t,e,n,r){let o=n,s=t;for(;o<r&&!rA(s,o).can_open;)s=oA(s,e,o,1),o++;return{text:s,from:o,to:r}}function JG(t,e,n,r){let o=r,s=t;for(;o>n&&!rA(s,o).can_close;)s=oA(s,e,o,-1),o--;return{text:s,from:n,to:o}}function ZG(t,e,n,r){let o={text:t,from:n,to:r};return o=GG(o.text,e,o.from,o.to),o=JG(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 YG extends nA{constructor(e,n,r){super(e,n,r??{}),Yh(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:l}=this.normalizeInline(o);this.out=ZG(this.out,s,i,l),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 sA=hr.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=wS(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=wS(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function wS(t){const e=t.type.schema,n=e.text(" ",[t]),o=Hc(oe.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return o?[o[1],o[2]]:null}function mv(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function XG(t){return t==null?void 0:t.replace(/</g,"<").replace(/>/g,">")}function QG(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 eJ(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Gp=ht.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(tJ(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 tJ(t,e){const n=t.type.schema,r=Hc(oe.from(t),n);return t.isBlock&&(e instanceof oe||e.type.name===n.topNodeType.name)?nJ(r):r}function nJ(t){const n=mv(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
619
|
-
${n.innerHTML}
|
|
620
|
-
`:`
|
|
621
|
-
`,n.outerHTML}const rJ=ht.create({name:"blockquote"}),oJ=rJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.blockquote,parse:{}}}}}),sJ=ht.create({name:"bulletList"}),iA=sJ.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),iJ=ht.create({name:"codeBlock"}),aJ=iJ.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
|
|
622
|
-
`),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>")}}}}}}),lJ=ht.create({name:"hardBreak"}),aA=lJ.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?Gp.storage.markdown.serialize.call(this,t,e,n):`\\
|
|
623
|
-
`);return}},parse:{}}}}}),uJ=ht.create({name:"heading"}),cJ=uJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.heading,parse:{}}}}}),dJ=ht.create({name:"horizontalRule"}),fJ=dJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.horizontal_rule,parse:{}}}}}),hJ=ht.create({name:"image"}),pJ=hJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.image,parse:{}}}}}),mJ=ht.create({name:"listItem"}),gJ=mJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.list_item,parse:{}}}}}),yJ=ht.create({name:"orderedList"});function xJ(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const vJ=yJ.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=xJ(e,n,r)%2?") ":". ";t.renderList(e,i,d=>{const f=String(o+d);return t.repeat(" ",s-f.length)+f+u})},parse:{}}}}}),bJ=ht.create({name:"paragraph"}),kJ=bJ.extend({addStorage(){return{markdown:{serialize:_o.nodes.paragraph,parse:{}}}}});function Jg(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 wJ=ht.create({name:"table"}),CJ=wJ.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!SJ(e)){Gp.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,o,s)=>{if(t.write("| "),r.forEach((i,l,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 CS(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function SJ(t){const e=Jg(t),n=e[0],r=e.slice(1);return!(Jg(n).some(o=>o.type.name!=="tableHeader"||CS(o)||o.childCount>1)||r.some(o=>Jg(o).some(s=>s.type.name==="tableHeader"||CS(s)||s.childCount>1)))}const EJ=ht.create({name:"taskItem"}),_J=EJ.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())})}}}}}}),TJ=ht.create({name:"taskList"}),AJ=TJ.extend({addStorage(){return{markdown:{serialize:iA.storage.markdown.serialize,parse:{setup(t){t.use(UG)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),NJ=ht.create({name:"text"}),MJ=NJ.extend({addStorage(){return{markdown:{serialize(t,e){t.text(XG(e.text))},parse:{}}}}}),DJ=hr.create({name:"bold"}),RJ=DJ.extend({addStorage(){return{markdown:{serialize:_o.marks.strong,parse:{}}}}}),OJ=hr.create({name:"code"}),IJ=OJ.extend({addStorage(){return{markdown:{serialize:_o.marks.code,parse:{}}}}}),PJ=hr.create({name:"italic"}),jJ=PJ.extend({addStorage(){return{markdown:{serialize:_o.marks.em,parse:{}}}}}),LJ=hr.create({name:"link"}),zJ=LJ.extend({addStorage(){return{markdown:{serialize:_o.marks.link,parse:{}}}}}),FJ=hr.create({name:"strike"}),$J=FJ.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),BJ=[oJ,iA,aJ,aA,cJ,fJ,Gp,pJ,gJ,vJ,kJ,CJ,_J,AJ,MJ,RJ,IJ,sA,jJ,zJ,$J];function Xh(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,o=(n=BJ.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||o?{...o,...r}:null}class VJ{constructor(e){Yh(this,"editor",null),this.editor=e}serialize(e){const n=new YG(this.nodes,this.marks,{hardBreakNodeName:aA.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(Gp)])),...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(sA)])),...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=Xh(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=Xh(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 HJ{constructor(e,n){Yh(this,"editor",null),Yh(this,"md",null);let{html:r,linkify:o,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(nr({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=Xh(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=mv(r);return this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=Xh(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")&&QG(o)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var o,s,i,l;const u=e.firstElementChild,{nextElementSibling:d}=u,f=(o=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&o!==void 0?o:"",h=d?"":(i=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&i!==void 0?i:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${h}`;return}eJ(u),e.innerHTML=`${f}${e.innerHTML}${h}`}}withPatchedRenderer(e){const n=r=>function(){const o=r(...arguments);return o===`
|
|
624
|
-
`?o:o[o.length-1]===`
|
|
625
|
-
`?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 UJ=St.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Ct({key:new Ht("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 Qo.fromSchema(this.editor.schema).parseSlice(mv(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),WJ=St.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=T6.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 HJ(this.editor,this.options),serializer:new VJ(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[KG.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),UJ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),qJ={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ç","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.","The template you pick creates your schema and content files — you can change all of it later.":"Seçtiğin şablon, içerik dosyalarını ve şemanı senin için oluşturur — hepsini sonra değiştirebilirsin.","Could not load the template list.":"Şablon listesi yüklenemedi.","What it creates":"Oluşturulacak yapı","Use this template":"Bu şablonu kullan","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.","Nothing here yet — you build the structure from the ground up.":"Henüz içerik yok — yapıyı baştan sen kurarsın.","Continue with an empty project":"Boş projeyle devam et","Import — your own JSON":"İçe aktar — kendi JSON’un","Import your own JSON":"Kendi JSON’unu içe aktar",Import:"İçe aktar","Importing…":"İçe aktarılıyor…","Bring the JSON you already have; JustJSON infers the structure and sets your project up.":"Elindeki JSON’u getir; JustJSON yapıyı çıkarıp projeni kurar.","Your content JSON, or an existing":"İçerik JSON’un ya da hazır bir","— the structure is inferred automatically.":"— yapı otomatik çıkarılır.","Paste or pick your content JSON, or an existing":"İçerik JSON’unu ya da hazır bir","— JustJSON works out the collections and singletons for you.":"— JustJSON koleksiyon ve tekil yapısını otomatik çıkarır.","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."},KJ=[{code:"en",label:"English"},{code:"tr",label:"Türkçe"}],lA="justjson.lang";function GJ(t){return t==="en"||t==="tr"}function JJ(){if(typeof localStorage>"u")return"en";const t=localStorage.getItem(lA);return GJ(t)?t:"en"}let Jp=JJ();const vy=new Set;typeof document<"u"&&(document.documentElement.lang=Jp);function kc(){return Jp}function ZJ(t){Jp=t,typeof localStorage<"u"&&localStorage.setItem(lA,t),typeof document<"u"&&(document.documentElement.lang=t);for(const e of vy)e()}function YJ(t){return vy.add(t),()=>{vy.delete(t)}}function uA(){return C.useSyncExternalStore(YJ,kc,kc)}function j(t,e){const n=Jp==="tr"?qJ[t]??t:t;return e?n.replace(/\{(\w+)\}/g,(r,o)=>o in e?String(e[o]):r):n}function hi(t,e,n,r){return j(t===1?e:n,{n:t,...r})}function XJ({value:t,onChange:e}){const n=wH({extensions:[GW,WJ],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?x.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:[x.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border bg-muted/50 px-2 py-1.5",children:[x.jsx(ao,{editor:n,on:"bold",cmd:r=>r.toggleBold(),title:j("Bold"),children:x.jsx(GP,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,on:"italic",cmd:r=>r.toggleItalic(),title:j("Italic"),children:x.jsx(Hj,{className:"h-4 w-4"})}),x.jsx(Zg,{}),x.jsx(ao,{editor:n,on:"heading",attrs:{level:2},cmd:r=>r.toggleHeading({level:2}),title:j("Heading 2"),children:x.jsx(jj,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,on:"heading",attrs:{level:3},cmd:r=>r.toggleHeading({level:3}),title:j("Heading 3"),children:x.jsx(zj,{className:"h-4 w-4"})}),x.jsx(Zg,{}),x.jsx(ao,{editor:n,on:"bulletList",cmd:r=>r.toggleBulletList(),title:j("Bullet list"),children:x.jsx(f_,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,on:"orderedList",cmd:r=>r.toggleOrderedList(),title:j("Ordered list"),children:x.jsx(Xj,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,on:"blockquote",cmd:r=>r.toggleBlockquote(),title:j("Quote"),children:x.jsx(f9,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,on:"codeBlock",cmd:r=>r.toggleCodeBlock(),title:j("Code"),children:x.jsx(yj,{className:"h-4 w-4"})}),x.jsx(Zg,{}),x.jsx(ao,{editor:n,cmd:r=>r.undo(),title:j("Undo"),children:x.jsx(F9,{className:"h-4 w-4"})}),x.jsx(ao,{editor:n,cmd:r=>r.redo(),title:j("Redo"),children:x.jsx(p9,{className:"h-4 w-4"})})]}),x.jsx(V6,{editor:n})]}):null}function ao({editor:t,on:e,attrs:n,cmd:r,title:o,children:s}){const i=e?t.isActive(e,n):!1;return x.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 Zg(){return x.jsx("span",{className:"mx-1 h-5 w-px bg-border"})}function QJ(){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 Zp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Al(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function gv(t){return"nodeType"in t}function Fn(t){var e,n;return t?Al(t)?t:gv(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function yv(t){const{Document:e}=Fn(t);return t instanceof e}function Jc(t){return Al(t)?!1:t instanceof Fn(t).HTMLElement}function cA(t){return t instanceof Fn(t).SVGElement}function Nl(t){return t?Al(t)?t.document:gv(t)?yv(t)?t:Jc(t)||cA(t)?t.ownerDocument:document:document:document}const qr=Zp?C.useLayoutEffect:C.useEffect;function Yp(t){const e=C.useRef(t);return qr(()=>{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 eZ(){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 wc(t,e){e===void 0&&(e=[t]);const n=C.useRef(t);return qr(()=>{n.current!==t&&(n.current=t)},e),n}function Zc(t,e){const n=C.useRef();return C.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Qh(t){const e=Yp(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 ep(t){const e=C.useRef();return C.useEffect(()=>{e.current=t},[t]),e.current}let Yg={};function Yc(t,e){return C.useMemo(()=>{if(e)return e;const n=Yg[t]==null?0:Yg[t]+1;return Yg[t]=n,t+"-"+n},[t,e])}function dA(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 l=Object.entries(i);for(const[u,d]of l){const f=s[u];f!=null&&(s[u]=f+t*d)}return s},{...e})}}const tl=dA(1),Cc=dA(-1);function tZ(t){return"clientX"in t&&"clientY"in t}function Xp(t){if(!t)return!1;const{KeyboardEvent:e}=Fn(t.target);return e&&t instanceof e}function nZ(t){if(!t)return!1;const{TouchEvent:e}=Fn(t.target);return e&&t instanceof e}function tp(t){if(nZ(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 tZ(t)?{x:t.clientX,y:t.clientY}:null}const is=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[is.Translate.toString(t),is.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),SS="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function rZ(t){return t.matches(SS)?t:t.querySelector(SS)}const oZ={display:"none"};function sZ(t){let{id:e,value:n}=t;return ne.createElement("div",{id:e,style:oZ},n)}function iZ(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 aZ(){const[t,e]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const fA=C.createContext(null);function lZ(t){const e=C.useContext(fA);C.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function uZ(){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 l;return(l=i[o])==null?void 0:l.call(i,s)})},[t]),e]}const cZ={draggable:`
|
|
626
|
-
To pick up a draggable item, press the space bar.
|
|
627
|
-
While dragging, use the arrow keys to move the item.
|
|
628
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
629
|
-
`},dZ={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 fZ(t){let{announcements:e=dZ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=cZ}=t;const{announce:s,announcement:i}=aZ(),l=Yc("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),lZ(C.useMemo(()=>({onDragStart(h){let{active:m}=h;s(e.onDragStart({active:m}))},onDragMove(h){let{active:m,over:y}=h;e.onDragMove&&s(e.onDragMove({active:m,over:y}))},onDragOver(h){let{active:m,over:y}=h;s(e.onDragOver({active:m,over:y}))},onDragEnd(h){let{active:m,over:y}=h;s(e.onDragEnd({active:m,over:y}))},onDragCancel(h){let{active:m,over:y}=h;s(e.onDragCancel({active:m,over:y}))}}),[s,e])),!u)return null;const f=ne.createElement(ne.Fragment,null,ne.createElement(sZ,{id:r,value:o.draggable}),ne.createElement(iZ,{id:l,announcement:i}));return n?Hr.createPortal(f,n):f}var Xt;(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"})(Xt||(Xt={}));function np(){}function ES(t,e){return C.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function hZ(){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 Kr=Object.freeze({x:0,y:0});function hA(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pZ(t,e){const n=tp(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 pA(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function mZ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function _S(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 mA(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function TS(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 gZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=TS(e,e.left,e.top),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const d=hA(TS(u),o);s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(pA)},yZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=_S(e),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const d=_S(u),f=o.reduce((m,y,v)=>m+hA(d[v],y),0),h=Number((f/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:h}})}}return s.sort(pA)};function xZ(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,l=s-n;if(r<o&&n<s){const u=e.width*e.height,d=t.width*t.height,f=i*l,h=f/(u+d-f);return Number(h.toFixed(4))}return 0}const vZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const u=xZ(l,e);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(mZ)};function bZ(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function gA(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Kr}function kZ(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,l)=>({...i,top:i.top+t*l.y,bottom:i.bottom+t*l.y,left:i.left+t*l.x,right:i.right+t*l.x}),{...n})}}const wZ=kZ(1);function yA(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 CZ(t,e,n){const r=yA(e);if(!r)return t;const{scaleX:o,scaleY:s,x:i,y:l}=r,u=t.left-i-(1-o)*parseFloat(n),d=t.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?t.width/o:t.width,h=s?t.height/s:t.height;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u}}const SZ={ignoreTransform:!1};function Ml(t,e){e===void 0&&(e=SZ);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=Fn(t).getComputedStyle(t);d&&(n=CZ(n,d,f))}const{top:r,left:o,width:s,height:i,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:u}}function AS(t){return Ml(t,{ignoreTransform:!0})}function EZ(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function _Z(t,e){return e===void 0&&(e=Fn(t).getComputedStyle(t)),e.position==="fixed"}function TZ(t,e){e===void 0&&(e=Fn(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 Qp(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(yv(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Jc(o)||cA(o)||n.includes(o))return n;const s=Fn(t).getComputedStyle(o);return o!==t&&TZ(o,s)&&n.push(o),_Z(o,s)?n:r(o.parentNode)}return t?r(t):n}function xA(t){const[e]=Qp(t,1);return e??null}function Xg(t){return!Zp||!t?null:Al(t)?t:gv(t)?yv(t)||t===Nl(t).scrollingElement?window:Jc(t)?t:null:null}function vA(t){return Al(t)?t.scrollX:t.scrollLeft}function bA(t){return Al(t)?t.scrollY:t.scrollTop}function by(t){return{x:vA(t),y:bA(t)}}var un;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(un||(un={}));function kA(t){return!Zp||!t?!1:t===document.scrollingElement}function wA(t){const e={x:0,y:0},n=kA(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,l=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:e}}const AZ={x:.2,y:.2};function NZ(t,e,n,r,o){let{top:s,left:i,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=AZ);const{isTop:d,isBottom:f,isLeft:h,isRight:m}=wA(t),y={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?(y.y=un.Backward,v.y=r*Math.abs((e.top+b.height-s)/b.height)):!f&&u>=e.bottom-b.height&&(y.y=un.Forward,v.y=r*Math.abs((e.bottom-b.height-u)/b.height)),!m&&l>=e.right-b.width?(y.x=un.Forward,v.x=r*Math.abs((e.right-b.width-l)/b.width)):!h&&i<=e.left+b.width&&(y.x=un.Backward,v.x=r*Math.abs((e.left+b.width-i)/b.width)),{direction:y,speed:v}}function MZ(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 CA(t){return t.reduce((e,n)=>tl(e,by(n)),Kr)}function DZ(t){return t.reduce((e,n)=>e+vA(n),0)}function RZ(t){return t.reduce((e,n)=>e+bA(n),0)}function SA(t,e){if(e===void 0&&(e=Ml),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);xA(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const OZ=[["x",["left","right"],DZ],["y",["top","bottom"],RZ]];class xv{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=Qp(n),o=CA(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,i,l]of OZ)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=l(r),f=o[s]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $u{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 IZ(t){const{EventTarget:e}=Fn(t);return t instanceof e?t:Nl(t)}function Qg(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 _r;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(_r||(_r={}));function NS(t){t.preventDefault()}function PZ(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 EA={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},jZ=(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 vv{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 $u(Nl(n)),this.windowListeners=new $u(Fn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_r.Resize,this.handleCancel),this.windowListeners.add(_r.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_r.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&SA(r),n(Kr)}handleKeyDown(e){if(Xp(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=EA,coordinateGetter:i=jZ,scrollBehavior:l="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,f=d?{x:d.left,y:d.top}:Kr;this.referenceCoordinates||(this.referenceCoordinates=f);const h=i(e,{active:n,context:r.current,currentCoordinates:f});if(h){const m=Cc(h,f),y={x:0,y:0},{scrollableAncestors:v}=r.current;for(const b of v){const k=e.code,{isTop:E,isRight:_,isLeft:T,isBottom:N,maxScroll:M,minScroll:D}=wA(b),I=MZ(b),P={x:Math.min(k===Ze.Right?I.right-I.width/2:I.right,Math.max(k===Ze.Right?I.left:I.left+I.width/2,h.x)),y:Math.min(k===Ze.Down?I.bottom-I.height/2:I.bottom,Math.max(k===Ze.Down?I.top:I.top+I.height/2,h.y))},O=k===Ze.Right&&!_||k===Ze.Left&&!T,W=k===Ze.Down&&!N||k===Ze.Up&&!E;if(O&&P.x!==h.x){const Z=b.scrollLeft+m.x,J=k===Ze.Right&&Z<=M.x||k===Ze.Left&&Z>=D.x;if(J&&!m.y){b.scrollTo({left:Z,behavior:l});return}J?y.x=b.scrollLeft-Z:y.x=k===Ze.Right?b.scrollLeft-M.x:b.scrollLeft-D.x,y.x&&b.scrollBy({left:-y.x,behavior:l});break}else if(W&&P.y!==h.y){const Z=b.scrollTop+m.y,J=k===Ze.Down&&Z<=M.y||k===Ze.Up&&Z>=D.y;if(J&&!m.x){b.scrollTo({top:Z,behavior:l});return}J?y.y=b.scrollTop-Z:y.y=k===Ze.Down?b.scrollTop-M.y:b.scrollTop-D.y,y.y&&b.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(e,tl(Cc(h,this.referenceCoordinates),y))}}}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()}}vv.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=EA,onActivation:o}=e,{active:s}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function MS(t){return!!(t&&"distance"in t)}function DS(t){return!!(t&&"delay"in t)}class bv{constructor(e,n,r){var o;r===void 0&&(r=IZ(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=Nl(i),this.documentListeners=new $u(this.document),this.listeners=new $u(r),this.windowListeners=new $u(Fn(i)),this.initialCoordinates=(o=tp(s))!=null?o:Kr,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(_r.Resize,this.handleCancel),this.windowListeners.add(_r.DragStart,NS),this.windowListeners.add(_r.VisibilityChange,this.handleCancel),this.windowListeners.add(_r.ContextMenu,NS),this.documentListeners.add(_r.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(DS(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(MS(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(_r.Click,PZ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_r.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=tp(e))!=null?n:Kr,d=Cc(o,u);if(!r&&l){if(MS(l)){if(l.tolerance!=null&&Qg(d,l.tolerance))return this.handleCancel();if(Qg(d,l.distance))return this.handleStart()}if(DS(l)&&Qg(d,l.tolerance))return this.handleCancel();this.handlePending(l,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 LZ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class kv extends bv{constructor(e){const{event:n}=e,r=Nl(n.target);super(e,LZ,r)}}kv.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 zZ={move:{name:"mousemove"},end:{name:"mouseup"}};var ky;(function(t){t[t.RightClick=2]="RightClick"})(ky||(ky={}));class FZ extends bv{constructor(e){super(e,zZ,Nl(e.event.target))}}FZ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ky.RightClick?!1:(r==null||r({event:n}),!0)}}];const e1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class $Z extends bv{constructor(e){super(e,e1)}static setup(){return window.addEventListener(e1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(e1.move.name,e)};function e(){}}}$Z.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 Bu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Bu||(Bu={}));var rp;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(rp||(rp={}));function BZ(t){let{acceleration:e,activator:n=Bu.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=rp.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:m}=t;const y=HZ({delta:h,disabled:!s}),[v,b]=eZ(),k=C.useRef({x:0,y:0}),E=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case Bu.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Bu.DraggableRect:return o}},[n,o,u]),T=C.useRef(null),N=C.useCallback(()=>{const D=T.current;if(!D)return;const I=k.current.x*E.current.x,P=k.current.y*E.current.y;D.scrollBy(I,P)},[]),M=C.useMemo(()=>l===rp.TreeOrder?[...d].reverse():d,[l,d]);C.useEffect(()=>{if(!s||!d.length||!_){b();return}for(const D of M){if((r==null?void 0:r(D))===!1)continue;const I=d.indexOf(D),P=f[I];if(!P)continue;const{direction:O,speed:W}=NZ(D,P,_,e,m);for(const Z of["x","y"])y[Z][O[Z]]||(W[Z]=0,O[Z]=0);if(W.x>0||W.y>0){b(),T.current=D,v(N,i),k.current=W,E.current=O;return}}k.current={x:0,y:0},E.current={x:0,y:0},b()},[e,N,r,b,s,i,JSON.stringify(_),JSON.stringify(y),v,d,M,f,JSON.stringify(m)])}const VZ={x:{[un.Backward]:!1,[un.Forward]:!1},y:{[un.Backward]:!1,[un.Forward]:!1}};function HZ(t){let{delta:e,disabled:n}=t;const r=ep(e);return Zc(o=>{if(n||!r||!o)return VZ;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 UZ(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Zc(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function WZ(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 Sc;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Sc||(Sc={}));var wy;(function(t){t.Optimized="optimized"})(wy||(wy={}));const RS=new Map;function qZ(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,i]=C.useState(null),{frequency:l,measure:u,strategy:d}=o,f=C.useRef(t),h=k(),m=wc(h),y=C.useCallback(function(E){E===void 0&&(E=[]),!m.current&&i(_=>_===null?E:_.concat(E.filter(T=>!_.includes(T))))},[m]),v=C.useRef(null),b=Zc(E=>{if(h&&!n)return RS;if(!E||E===RS||f.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 N=T.node.current,M=N?new xv(u(N),N):null;T.rect.current=M,M&&_.set(T.id,M)}return _}return E},[t,s,n,h,u]);return C.useEffect(()=>{f.current=t},[t]),C.useEffect(()=>{h||y()},[n,h]),C.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),C.useEffect(()=>{h||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{y(),v.current=null},l))},[l,h,y,...r]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:s!=null};function k(){switch(d){case Sc.Always:return!1;case Sc.BeforeDragging:return n;default:return!n}}}function wv(t,e){return Zc(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function KZ(t,e){return wv(t,e)}function GZ(t){let{callback:e,disabled:n}=t;const r=Yp(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 em(t){let{callback:e,disabled:n}=t;const r=Yp(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 JZ(t){return new xv(Ml(t),t)}function OS(t,e,n){e===void 0&&(e=JZ);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 f=e(t);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const i=GZ({callback(u){if(t)for(const d of u){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(t)){s();break}}}}),l=em({callback:s});return qr(()=>{s(),t?(l==null||l.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[t]),r}function ZZ(t){const e=wv(t);return gA(t,e)}const IS=[];function YZ(t){const e=C.useRef(t),n=Zc(r=>t?r&&r!==IS&&t&&e.current&&t.parentNode===e.current.parentNode?r:Qp(t):IS,[t]);return C.useEffect(()=>{e.current=t},[t]),n}function XZ(t){const[e,n]=C.useState(null),r=C.useRef(t),o=C.useCallback(s=>{const i=Xg(s.target);i&&n(l=>l?(l.set(i,by(i)),new Map(l)):null)},[]);return C.useEffect(()=>{const s=r.current;if(t!==s){i(s);const l=t.map(u=>{const d=Xg(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,by(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=t}return()=>{i(t),i(s)};function i(l){l.forEach(u=>{const d=Xg(u);d==null||d.removeEventListener("scroll",o)})}},[o,t]),C.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,i)=>tl(s,i),Kr):CA(t):Kr,[t,e])}function PS(t,e){e===void 0&&(e=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},e),C.useEffect(()=>{const r=t!==Kr;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Cc(t,n.current):Kr}function QZ(t){C.useEffect(()=>{if(!Zp)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 eY(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 _A(t){return C.useMemo(()=>t?EZ(t):null,[t])}const jS=[];function tY(t,e){e===void 0&&(e=Ml);const[n]=t,r=_A(n?Fn(n):null),[o,s]=C.useState(jS);function i(){s(()=>t.length?t.map(u=>kA(u)?r:new xv(e(u),u)):jS)}const l=em({callback:i});return qr(()=>{l==null||l.disconnect(),i(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),o}function TA(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Jc(e)?e:t}function nY(t){let{measure:e}=t;const[n,r]=C.useState(null),o=C.useCallback(d=>{for(const{target:f}of d)if(Jc(f)){r(h=>{const m=e(f);return h?{...h,width:m.width,height:m.height}:m});break}},[e]),s=em({callback:o}),i=C.useCallback(d=>{const f=TA(d);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?e(f):null)},[e,s]),[l,u]=Qh(i);return C.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const rY=[{sensor:kv,options:{}},{sensor:vv,options:{}}],oY={current:{}},Kf={draggable:{measure:AS},droppable:{measure:AS,strategy:Sc.WhileDragging,frequency:wy.Optimized},dragOverlay:{measure:Ml}};class Vu 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 sY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Vu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:np},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kf,measureDroppableContainers:np,windowRect:null,measuringScheduled:!1},AA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:np,draggableNodes:new Map,over:null,measureDroppableContainers:np},Xc=C.createContext(AA),NA=C.createContext(sY);function iY(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Vu}}}function aY(t,e){switch(e.type){case Xt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Xt.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 Xt.DragEnd:case Xt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xt.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new Vu(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case Xt.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 Vu(t.droppable.containers);return i.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:i}}}case Xt.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new Vu(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function lY(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=C.useContext(Xc),s=ep(r),i=ep(n==null?void 0:n.id);return C.useEffect(()=>{if(!e&&!r&&s&&i!=null){if(!Xp(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const h=rZ(f);if(h){h.focus();break}}})}},[r,e,o,i,s]),null}function MA(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function uY(t){return C.useMemo(()=>({draggable:{...Kf.draggable,...t==null?void 0:t.draggable},droppable:{...Kf.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Kf.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 cY(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=C.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;qr(()=>{if(!i&&!l||!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 f=n(d),h=gA(f,r);if(i||(h.x=0),l||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const m=xA(d);m&&m.scrollBy({top:h.y,left:h.x})}},[e,i,l,r,n])}const tm=C.createContext({...Kr,scaleX:1,scaleY:1});var Bs;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Bs||(Bs={}));const dY=C.memo(function(e){var n,r,o,s;let{id:i,accessibility:l,autoScroll:u=!0,children:d,sensors:f=rY,collisionDetection:h=vZ,measuring:m,modifiers:y,...v}=e;const b=C.useReducer(aY,void 0,iY),[k,E]=b,[_,T]=uZ(),[N,M]=C.useState(Bs.Uninitialized),D=N===Bs.Initialized,{draggable:{active:I,nodes:P,translate:O},droppable:{containers:W}}=k,Z=I!=null?P.get(I):null,J=C.useRef({initial:null,translated:null}),K=C.useMemo(()=>{var gt;return I!=null?{id:I,data:(gt=Z==null?void 0:Z.data)!=null?gt:oY,rect:J}:null},[I,Z]),Y=C.useRef(null),[ee,G]=C.useState(null),[X,q]=C.useState(null),te=wc(v,Object.values(v)),F=Yc("DndDescribedBy",i),L=C.useMemo(()=>W.getEnabled(),[W]),V=uY(m),{droppableRects:re,measureDroppableContainers:he,measuringScheduled:ce}=qZ(L,{dragging:D,dependencies:[O.x,O.y],config:V.droppable}),pe=UZ(P,I),De=C.useMemo(()=>X?tp(X):null,[X]),Q=Xr(),de=KZ(pe,V.draggable.measure);cY({activeNode:I!=null?P.get(I):null,config:Q.layoutShiftCompensation,initialRect:de,measure:V.draggable.measure});const me=OS(pe,V.draggable.measure,de),Fe=OS(pe?pe.parentElement:null),Re=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=Re.current.over)==null?void 0:n.id),Ye=nY({measure:V.dragOverlay.measure}),Nt=(r=Ye.nodeRef.current)!=null?r:pe,jt=D?(o=Ye.rect)!=null?o:me:null,Ut=!!(Ye.nodeRef.current&&Ye.rect),$n=ZZ(Ut?null:me),Wt=_A(Nt?Fn(Nt):null),nn=YZ(D?Be??pe:null),Dn=tY(nn),pt=MA(y,{transform:{x:O.x-$n.x,y:O.y-$n.y,scaleX:1,scaleY:1},activatorEvent:X,active:K,activeNodeRect:me,containerNodeRect:Fe,draggingNodeRect:jt,over:Re.current.over,overlayNodeRect:Ye.rect,scrollableAncestors:nn,scrollableAncestorRects:Dn,windowRect:Wt}),pr=De?tl(De,O):null,bi=XZ(nn),ga=PS(bi),Ao=PS(bi,[me]),mr=tl(pt,ga),Bn=jt?wZ(jt,pt):null,gr=K&&Bn?h({active:K,collisionRect:Bn,droppableRects:re,droppableContainers:L,pointerCoordinates:pr}):null,Rn=mA(gr,"id"),[mn,Or]=C.useState(null),ya=Ut?pt:tl(pt,Ao),xa=bZ(ya,(s=mn==null?void 0:mn.rect)!=null?s:null,me),fs=C.useRef(null),No=C.useCallback((gt,qt)=>{let{sensor:Ne,options:it}=qt;if(Y.current==null)return;const tt=P.get(Y.current);if(!tt)return;const at=gt.nativeEvent,Kt=new Ne({active:Y.current,activeNode:tt,event:at,options:it,context:Re,onAbort(Je){if(!P.get(Je))return;const{onDragAbort:ft}=te.current,_t={id:Je};ft==null||ft(_t),_({type:"onDragAbort",event:_t})},onPending(Je,gn,ft,_t){if(!P.get(Je))return;const{onDragPending:rn}=te.current,Un={id:Je,constraint:gn,initialCoordinates:ft,offset:_t};rn==null||rn(Un),_({type:"onDragPending",event:Un})},onStart(Je){const gn=Y.current;if(gn==null)return;const ft=P.get(gn);if(!ft)return;const{onDragStart:_t}=te.current,Hn={activatorEvent:at,active:{id:gn,data:ft.data,rect:J}};Hr.unstable_batchedUpdates(()=>{_t==null||_t(Hn),M(Bs.Initializing),E({type:Xt.DragStart,initialCoordinates:Je,active:gn}),_({type:"onDragStart",event:Hn}),G(fs.current),q(at)})},onMove(Je){E({type:Xt.DragMove,coordinates:Je})},onEnd:mt(Xt.DragEnd),onCancel:mt(Xt.DragCancel)});fs.current=Kt;function mt(Je){return async function(){const{active:ft,collisions:_t,over:Hn,scrollAdjustedTranslate:rn}=Re.current;let Un=null;if(ft&&rn){const{cancelDrop:Mo}=te.current;Un={activatorEvent:at,active:ft,collisions:_t,delta:rn,over:Hn},Je===Xt.DragEnd&&typeof Mo=="function"&&await Promise.resolve(Mo(Un))&&(Je=Xt.DragCancel)}Y.current=null,Hr.unstable_batchedUpdates(()=>{E({type:Je}),M(Bs.Uninitialized),Or(null),G(null),q(null),fs.current=null;const Mo=Je===Xt.DragEnd?"onDragEnd":"onDragCancel";if(Un){const Dl=te.current[Mo];Dl==null||Dl(Un),_({type:Mo,event:Un})}})}}},[P]),ki=C.useCallback((gt,qt)=>(Ne,it)=>{const tt=Ne.nativeEvent,at=P.get(it);if(Y.current!==null||!at||tt.dndKit||tt.defaultPrevented)return;const Kt={active:at};gt(Ne,qt.options,Kt)===!0&&(tt.dndKit={capturedBy:qt.sensor},Y.current=it,No(Ne,qt))},[P,No]),Yr=WZ(f,ki);QZ(f),qr(()=>{me&&N===Bs.Initializing&&M(Bs.Initialized)},[me,N]),C.useEffect(()=>{const{onDragMove:gt}=te.current,{active:qt,activatorEvent:Ne,collisions:it,over:tt}=Re.current;if(!qt||!Ne)return;const at={active:qt,activatorEvent:Ne,collisions:it,delta:{x:mr.x,y:mr.y},over:tt};Hr.unstable_batchedUpdates(()=>{gt==null||gt(at),_({type:"onDragMove",event:at})})},[mr.x,mr.y]),C.useEffect(()=>{const{active:gt,activatorEvent:qt,collisions:Ne,droppableContainers:it,scrollAdjustedTranslate:tt}=Re.current;if(!gt||Y.current==null||!qt||!tt)return;const{onDragOver:at}=te.current,Kt=it.get(Rn),mt=Kt&&Kt.rect.current?{id:Kt.id,rect:Kt.rect.current,data:Kt.data,disabled:Kt.disabled}:null,Je={active:gt,activatorEvent:qt,collisions:Ne,delta:{x:tt.x,y:tt.y},over:mt};Hr.unstable_batchedUpdates(()=>{Or(mt),at==null||at(Je),_({type:"onDragOver",event:Je})})},[Rn]),qr(()=>{Re.current={activatorEvent:X,active:K,activeNode:pe,collisionRect:Bn,collisions:gr,droppableRects:re,draggableNodes:P,draggingNode:Nt,draggingNodeRect:jt,droppableContainers:W,over:mn,scrollableAncestors:nn,scrollAdjustedTranslate:mr},J.current={initial:jt,translated:Bn}},[K,pe,gr,Bn,P,Nt,jt,re,W,mn,nn,mr]),BZ({...Q,delta:O,draggingRect:Bn,pointerCoordinates:pr,scrollableAncestors:nn,scrollableAncestorRects:Dn});const Vn=C.useMemo(()=>({active:K,activeNode:pe,activeNodeRect:me,activatorEvent:X,collisions:gr,containerNodeRect:Fe,dragOverlay:Ye,draggableNodes:P,droppableContainers:W,droppableRects:re,over:mn,measureDroppableContainers:he,scrollableAncestors:nn,scrollableAncestorRects:Dn,measuringConfiguration:V,measuringScheduled:ce,windowRect:Wt}),[K,pe,me,X,gr,Fe,Ye,P,W,re,mn,he,nn,Dn,V,ce,Wt]),wi=C.useMemo(()=>({activatorEvent:X,activators:Yr,active:K,activeNodeRect:me,ariaDescribedById:{draggable:F},dispatch:E,draggableNodes:P,over:mn,measureDroppableContainers:he}),[X,Yr,K,me,E,F,P,mn,he]);return ne.createElement(fA.Provider,{value:T},ne.createElement(Xc.Provider,{value:wi},ne.createElement(NA.Provider,{value:Vn},ne.createElement(tm.Provider,{value:xa},d)),ne.createElement(lY,{disabled:(l==null?void 0:l.restoreFocus)===!1})),ne.createElement(fZ,{...l,hiddenTextDescribedById:F}));function Xr(){const gt=(ee==null?void 0:ee.autoScrollEnabled)===!1,qt=typeof u=="object"?u.enabled===!1:u===!1,Ne=D&&!gt&&!qt;return typeof u=="object"?{...u,enabled:Ne}:{enabled:Ne}}}),fY=C.createContext(null),LS="button",hY="Draggable";function pY(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=Yc(hY),{activators:i,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:m}=C.useContext(Xc),{role:y=LS,roleDescription:v="draggable",tabIndex:b=0}=o??{},k=(u==null?void 0:u.id)===e,E=C.useContext(k?tm:fY),[_,T]=Qh(),[N,M]=Qh(),D=eY(i,e),I=wc(n);qr(()=>(h.set(e,{id:e,key:s,node:_,activatorNode:N,data:I}),()=>{const O=h.get(e);O&&O.key===s&&h.delete(e)}),[h,e]);const P=C.useMemo(()=>({role:y,tabIndex:b,"aria-disabled":r,"aria-pressed":k&&y===LS?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,y,b,k,v,f.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:P,isDragging:k,listeners:r?void 0:D,node:_,over:m,setNodeRef:T,setActivatorNodeRef:M,transform:E}}function DA(){return C.useContext(NA)}const mY="Droppable",gY={timeout:25};function yY(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=Yc(mY),{active:i,dispatch:l,over:u,measureDroppableContainers:d}=C.useContext(Xc),f=C.useRef({disabled:n}),h=C.useRef(!1),m=C.useRef(null),y=C.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:k}={...gY,...o},E=wc(b??r),_=C.useCallback(()=>{if(!h.current){h.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),y.current=null},k)},[k]),T=em({callback:_,disabled:v||!i}),N=C.useCallback((P,O)=>{T&&(O&&(T.unobserve(O),h.current=!1),P&&T.observe(P))},[T]),[M,D]=Qh(N),I=wc(e);return C.useEffect(()=>{!T||!M.current||(T.disconnect(),h.current=!1,T.observe(M.current))},[M,T]),C.useEffect(()=>(l({type:Xt.RegisterDroppable,element:{id:r,key:s,disabled:n,node:M,rect:m,data:I}}),()=>l({type:Xt.UnregisterDroppable,key:s,id:r})),[r]),C.useEffect(()=>{n!==f.current.disabled&&(l({type:Xt.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,l]),{active:i,rect:m,isOver:(u==null?void 0:u.id)===r,node:M,over:u,setNodeRef:D}}function xY(t){let{animation:e,children:n}=t;const[r,o]=C.useState(null),[s,i]=C.useState(null),l=ep(n);return!n&&!r&&l&&o(l),qr(()=>{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 vY={x:0,y:0,scaleX:1,scaleY:1};function bY(t){let{children:e}=t;return ne.createElement(Xc.Provider,{value:AA},ne.createElement(tm.Provider,{value:vY},e))}const kY={position:"fixed",touchAction:"none"},wY=t=>Xp(t)?"transform 250ms ease":void 0,CY=C.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:l,style:u,transform:d,transition:f=wY}=t;if(!l)return null;const h=o?d:{...d,scaleX:1,scaleY:1},m={...kY,width:l.width,height:l.height,top:l.top,left:l.left,transform:is.Transform.toString(h),transformOrigin:o&&r?pZ(r,l):void 0,transition:typeof f=="function"?f(r):f,...u};return ne.createElement(n,{className:i,style:m,ref:e},s)}),SY=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:i}=t;if(s!=null&&s.active)for(const[l,u]of Object.entries(s.active))u!==void 0&&(o[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(s!=null&&s.dragOverlay)for(const[l,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(l,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)}},EY=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:is.Transform.toString(e)},{transform:is.Transform.toString(n)}]},_Y={duration:250,easing:"ease",keyframes:EY,sideEffects:SY({styles:{active:{opacity:"0"}}})};function TY(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return Yp((s,i)=>{if(e===null)return;const l=n.get(s);if(!l)return;const u=l.node.current;if(!u)return;const d=TA(i);if(!d)return;const{transform:f}=Fn(i).getComputedStyle(i),h=yA(f);if(!h)return;const m=typeof e=="function"?e:AY(e);return SA(u,o.draggable.measure),m({active:{id:s,data:l.data,node:u,rect:o.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:h})})}function AY(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={..._Y,...t};return s=>{let{active:i,dragOverlay:l,transform:u,...d}=s;if(!e)return;const f={x:l.rect.left-i.rect.left,y:l.rect.top-i.rect.top},h={scaleX:u.scaleX!==1?i.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?i.rect.height*u.scaleY/l.rect.height:1},m={x:u.x-f.x,y:u.y-f.y,...h},y=o({...d,active:i,dragOverlay:l,transform:{initial:u,final:m}}),[v]=y,b=y[y.length-1];if(JSON.stringify(v)===JSON.stringify(b))return;const k=r==null?void 0:r({active:i,dragOverlay:l,...d}),E=l.node.animate(y,{duration:e,easing:n,fill:"forwards"});return new Promise(_=>{E.onfinish=()=>{k==null||k(),_()}})}}let zS=0;function NY(t){return C.useMemo(()=>{if(t!=null)return zS++,zS},[t])}const MY=ne.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:l="div",className:u,zIndex:d=999}=t;const{activatorEvent:f,active:h,activeNodeRect:m,containerNodeRect:y,draggableNodes:v,droppableContainers:b,dragOverlay:k,over:E,measuringConfiguration:_,scrollableAncestors:T,scrollableAncestorRects:N,windowRect:M}=DA(),D=C.useContext(tm),I=NY(h==null?void 0:h.id),P=MA(i,{activatorEvent:f,active:h,activeNodeRect:m,containerNodeRect:y,draggingNodeRect:k.rect,over:E,overlayNodeRect:k.rect,scrollableAncestors:T,scrollableAncestorRects:N,transform:D,windowRect:M}),O=wv(m),W=TY({config:r,draggableNodes:v,droppableContainers:b,measuringConfiguration:_}),Z=O?k.setRef:void 0;return ne.createElement(bY,null,ne.createElement(xY,{animation:W},h&&I?ne.createElement(CY,{key:I,id:h.id,ref:Z,as:l,activatorEvent:f,adjustScale:e,className:u,transition:s,rect:O,style:{zIndex:d,...o},transform:P},n):null))});function DY(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 RY=t=>{let{containerNodeRect:e,draggingNodeRect:n,transform:r}=t;return!n||!e?r:DY(r,n,e)},OY=t=>{let{transform:e}=t;return{...e,x:0}};function Vs(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function IY(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function Pf(t){return t!==null&&t>=0}function PY(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 jY(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const RA=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=Vs(e,r,n),i=e[o],l=s[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},jf={scaleX:1,scaleY:1},LY=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=t;const l=(e=s[n])!=null?e:r;if(!l)return null;if(o===n){const d=s[i];return d?{x:0,y:n<i?d.top+d.height-(l.top+l.height):d.top-l.top,...jf}:null}const u=zY(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-u,...jf}:o<n&&o>=i?{x:0,y:l.height+u,...jf}:{x:0,y:0,...jf}};function zY(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 OA="Sortable",IA=ne.createContext({activeIndex:-1,containerId:OA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:RA,disabled:{draggable:!1,droppable:!1}});function FY(t){let{children:e,id:n,items:r,strategy:o=RA,disabled:s=!1}=t;const{active:i,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:f}=DA(),h=Yc(OA,n),m=l.rect!==null,y=C.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),v=i!=null,b=i?y.indexOf(i.id):-1,k=d?y.indexOf(d.id):-1,E=C.useRef(y),_=!PY(y,E.current),T=k!==-1&&b===-1||_,N=jY(s);qr(()=>{_&&v&&f(y)},[_,y,v,f]),C.useEffect(()=>{E.current=y},[y]);const M=C.useMemo(()=>({activeIndex:b,containerId:h,disabled:N,disableTransforms:T,items:y,overIndex:k,useDragOverlay:m,sortedRects:IY(y,u),strategy:o}),[b,h,N.draggable,N.droppable,T,y,k,u,m,o]);return ne.createElement(IA.Provider,{value:M},e)}const $Y=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return Vs(n,r,o).indexOf(e)},BY=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:l,previousContainerId:u,transition:d}=t;return!d||!r||l!==s&&o===i?!1:n?!0:i!==o&&e===u},VY={duration:200,easing:"ease"},PA="transform",HY=is.Transition.toString({property:PA,duration:0,easing:"linear"}),UY={roleDescription:"sortable"};function WY(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,i]=C.useState(null),l=C.useRef(n);return qr(()=>{if(!e&&n!==l.current&&r.current){const u=o.current;if(u){const d=Ml(r.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&i(f)}}n!==l.current&&(l.current=n)},[e,n,r,o]),C.useEffect(()=>{s&&i(null)},[s]),s}function jA(t){let{animateLayoutChanges:e=BY,attributes:n,disabled:r,data:o,getNewIndex:s=$Y,id:i,strategy:l,resizeObserverConfig:u,transition:d=VY}=t;const{items:f,containerId:h,activeIndex:m,disabled:y,disableTransforms:v,sortedRects:b,overIndex:k,useDragOverlay:E,strategy:_}=C.useContext(IA),T=qY(r,y),N=f.indexOf(i),M=C.useMemo(()=>({sortable:{containerId:h,index:N,items:f},...o}),[h,o,N,f]),D=C.useMemo(()=>f.slice(f.indexOf(i)),[f,i]),{rect:I,node:P,isOver:O,setNodeRef:W}=yY({id:i,data:M,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:Z,activatorEvent:J,activeNodeRect:K,attributes:Y,setNodeRef:ee,listeners:G,isDragging:X,over:q,setActivatorNodeRef:te,transform:F}=pY({id:i,data:M,attributes:{...UY,...n},disabled:T.draggable}),L=QJ(W,ee),V=!!Z,re=V&&!v&&Pf(m)&&Pf(k),he=!E&&X,ce=he&&re?F:null,De=re?ce??(l??_)({rects:b,activeNodeRect:K,activeIndex:m,overIndex:k,index:N}):null,Q=Pf(m)&&Pf(k)?s({id:i,items:f,activeIndex:m,overIndex:k}):N,de=Z==null?void 0:Z.id,me=C.useRef({activeId:de,items:f,newIndex:Q,containerId:h}),Fe=f!==me.current.items,Re=e({active:Z,containerId:h,isDragging:X,isSorting:V,id:i,index:N,items:f,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:d,wasDragging:me.current.activeId!=null}),Be=WY({disabled:!Re,index:N,node:P,rect:I});return C.useEffect(()=>{V&&me.current.newIndex!==Q&&(me.current.newIndex=Q),h!==me.current.containerId&&(me.current.containerId=h),f!==me.current.items&&(me.current.items=f)},[V,Q,h,f]),C.useEffect(()=>{if(de===me.current.activeId)return;if(de!=null&&me.current.activeId==null){me.current.activeId=de;return}const Nt=setTimeout(()=>{me.current.activeId=de},50);return()=>clearTimeout(Nt)},[de]),{active:Z,activeIndex:m,attributes:Y,data:M,rect:I,index:N,newIndex:Q,items:f,isOver:O,isSorting:V,isDragging:X,listeners:G,node:P,overIndex:k,over:q,setNodeRef:L,setActivatorNodeRef:te,setDroppableNodeRef:W,setDraggableNodeRef:ee,transform:Be??De,transition:Ye()};function Ye(){if(Be||Fe&&me.current.newIndex===N)return HY;if(!(he&&!Xp(J)||!d)&&(V||Re))return is.Transition.toString({...d,property:PA})}}function qY(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 op(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 KY=[Ze.Down,Ze.Right,Ze.Up,Ze.Left],GY=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:i,scrollableAncestors:l}}=e;if(KY.includes(t.code)){if(t.preventDefault(),!n||!r)return;const u=[];s.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const m=o.get(h.id);if(m)switch(t.code){case Ze.Down:r.top<m.top&&u.push(h);break;case Ze.Up:r.top>m.top&&u.push(h);break;case Ze.Left:r.left>m.left&&u.push(h);break;case Ze.Right:r.left<m.left&&u.push(h);break}});const d=yZ({collisionRect:r,droppableRects:o,droppableContainers:u});let f=mA(d,"id");if(f===(i==null?void 0:i.id)&&d.length>1&&(f=d[1].id),f!=null){const h=s.get(n.id),m=s.get(f),y=m?o.get(m.id):null,v=m==null?void 0:m.node.current;if(v&&y&&h&&m){const k=Qp(v).some((D,I)=>l[I]!==D),E=LA(h,m),_=JY(h,m),T=k||!E?{x:0,y:0}:{x:_?r.width-y.width:0,y:_?r.height-y.height:0},N={x:y.left,y:y.top};return T.x&&T.y?N:Cc(N,T)}}}};function LA(t,e){return!op(t)||!op(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function JY(t,e){return!op(t)||!op(e)||!LA(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const Cv=C.forwardRef(({label:t,className:e,...n},r)=>x.jsx(Le,{ref:r,type:"button",variant:"ghost",size:"icon-xs","aria-label":t,title:t,className:Ae("cursor-grab touch-none text-muted-foreground/50 hover:bg-transparent hover:text-foreground active:cursor-grabbing",e),...n,children:x.jsx(fx,{})}));Cv.displayName="DragHandle";function zA({ids:t,onReorder:e,renderOverlay:n,children:r}){const[o,s]=C.useState(null),i=hZ(ES(kv,{activationConstraint:{distance:4}}),ES(vv,{coordinateGetter:GY})),l=d=>t.indexOf(String(d))+1,u={onDragStart:()=>j("Item picked up. Use the arrow keys to move it, space to drop it."),onDragOver:({over:d})=>d?j("Moving to position {n}.",{n:l(d.id)}):j("The item is outside the list."),onDragEnd:({over:d})=>d?j("Dropped at position {n}.",{n:l(d.id)}):j("The item returned to its original place."),onDragCancel:()=>j("Move cancelled.")};return x.jsxs(dY,{accessibility:{announcements:u},sensors:i,collisionDetection:gZ,modifiers:[OY,RY],onDragStart:({active:d})=>s(String(d.id)),onDragCancel:()=>s(null),onDragEnd:({active:d,over:f})=>{if(s(null),!f||d.id===f.id)return;const h=t.indexOf(String(d.id)),m=t.indexOf(String(f.id));h<0||m<0||e(h,m)},children:[x.jsx(FY,{items:t,strategy:LY,children:r}),x.jsx(MY,{children:o?n(o):null})]})}function xl({className:t,size:e="default",...n}){return x.jsx("div",{"data-slot":"card","data-size":e,className:Ae("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 Ec({className:t,...e}){return x.jsx("div",{"data-slot":"card-header",className:Ae("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 Cy({className:t,...e}){return x.jsx("div",{"data-slot":"card-title",className:Ae("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...e})}function Sy({className:t,...e}){return x.jsx("div",{"data-slot":"card-description",className:Ae("text-sm text-muted-foreground",t),...e})}function vl({className:t,...e}){return x.jsx("div",{"data-slot":"card-content",className:Ae("px-(--card-spacing)",t),...e})}function sp({className:t,...e}){return x.jsx("div",{"data-slot":"card-footer",className:Ae("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",t),...e})}async function To(t){if(!t.ok)throw new Error(`Request failed: ${t.status}`);return t}async function ZY(){return(await To(await fetch("/api/_project"))).json()}async function FS(){return(await To(await fetch("/api/_schema"))).json()}async function YY(){return(await(await To(await fetch("/api/_templates"))).json()).items}async function XY(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 FA(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 QY="/api/_export";function eX(){const t=document.createElement("a");t.href=QY,t.download="justjson-export.zip",document.body.appendChild(t),t.click(),t.remove()}async function $A(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 Sv(t){return(await(await To(await fetch(`/api/${encodeURIComponent(t)}`))).json()).items}async function tX(t){return(await Sv(t)).map(e=>e.slug)}async function Ey(t,e){const n=await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`);return n.status===404?null:(await To(n),n.json())}async function nX(t,e,n){return(await(await To(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}))).json()).slug}async function rX(t,e){await To(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"DELETE"}))}async function oX(t,e){return(await(await To(await fetch("/api/_media",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dataBase64:t,filename:e})}))).json()).path}async function BA(t){return(await To(await fetch(`/api/_singleton/${encodeURIComponent(t)}`))).json()}async function sX(t,e){await To(await fetch(`/api/_singleton/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}))}async function VA(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 iX(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}const Ev=[{type:"text",label:"Text",desc:"Single line of text",icon:L9},{type:"richtext",label:"Rich text",desc:"Markdown content",icon:l_},{type:"number",label:"Number",desc:"Numeric value",icon:Ij},{type:"boolean",label:"Yes / No",desc:"True or false",icon:O9},{type:"date",label:"Date",desc:"Calendar date",icon:nj},{type:"select",label:"Select",desc:"A fixed list of options",icon:f_},{type:"relation",label:"Relation",desc:"Link to another collection",icon:d_},{type:"image",label:"Image",desc:"Image URL or path",icon:c_},{type:"url",label:"URL",desc:"Web address",icon:Zj},{type:"email",label:"Email",desc:"Email address",icon:qP},{type:"list",label:"List",desc:"Free-text tags",icon:D9},{type:"color",label:"Color",desc:"Hex color picker",icon:i9},{type:"group",label:"Group",desc:"Nested fields",icon:Rc}],_v=Object.fromEntries(Ev.map(t=>[t.type,t]));let $S=0;function aa(t){return $S+=1,`${t}${$S}`}function t1(t){return JSON.parse(JSON.stringify(t))}function aX(t){const e=(n,r)=>n.map(o=>({id:aa(r),fields:o.fields.map(()=>aa("f"))}));return{collections:e(t.collections,"c"),singletons:e(t.singletons,"s")}}function lX(t){const e=n=>n.map(r=>({id:r.id,fields:[...r.fields]}));return{collections:e(t.collections),singletons:e(t.singletons)}}function uX(t,e){const n=(r,o,s)=>r.map((i,l)=>{const u=o[l];return{id:(u==null?void 0:u.id)??aa(s),fields:i.fields.map((d,f)=>(u==null?void 0:u.fields[f])??aa("f"))}});return{collections:n(t.collections,e.collections,"c"),singletons:n(t.singletons,e.singletons,"s")}}function BS(){return{fields:[{key:"field1",label:"",type:"text"}]}}function nm(t,e){let n=1;for(;e.includes(`${t}${n}`);)n+=1;return`${t}${n}`}function n1(t,e){const n=nm("collection",t.collections.map(r=>r.name));t.collections.push({name:n,label:j("New collection"),path:n,fields:[]}),e.collections.push({id:aa("c"),fields:[]})}function r1(t,e){const n=nm("singleton",t.singletons.map(r=>r.name));t.singletons.push({name:n,label:j("New singleton"),path:`${n}.json`,fields:[]}),e.singletons.push({id:aa("s"),fields:[]})}function cX({schema:t,onSaved:e,onBrowseTemplates:n,initialAdd:r}){const[o,s]=C.useState(()=>{const O=t1(t),W=aX(O);return r==="collection"?n1(O,W):r==="singleton"&&r1(O,W),{schema:O,ids:W}}),[i,l]=C.useState(()=>{const O=[...o.ids.collections,...o.ids.singletons];return O.length<=5?{}:Object.fromEntries(O.map(W=>[W.id,!0]))}),[u,d]=C.useState(!1),[f,h]=C.useState(null),[m,y]=C.useState(null),v=o.schema,b=o.ids,k=v.collections.map(O=>O.name),E=O=>s(W=>{const Z=t1(W.schema);return O(Z),{schema:Z,ids:W.ids}}),_=O=>s(W=>{const Z=t1(W.schema),J=lX(W.ids);return O(Z,J),{schema:Z,ids:uX(Z,J)}}),T=(O,W)=>l(Z=>({...Z,[O]:W})),N=(O,W)=>l(Z=>{const J={...Z};for(const K of O)J[K.id]=W;return J}),M=v.collections.length===0&&v.singletons.length===0,D=O=>{m&&(_((W,Z)=>{var ee;const J=m.kind==="collection"?W.collections:W.singletons,K=m.kind==="collection"?Z.collections:Z.singletons,Y=J[m.ci];if(Y)if(m.fi===null){const G=nm("field",Y.fields.map(X=>X.key));Y.fields.push({key:G,label:"",type:O,...O==="group"?BS():{}}),(ee=K[m.ci])==null||ee.fields.push(aa("f"))}else{const G=Y.fields[m.fi];if(!G)return;G.type=O,O!=="select"&&(G.options=void 0),O!=="relation"&&(G.to=void 0),O!=="group"?G.fields=void 0:(!G.fields||G.fields.length===0)&&(G.fields=BS().fields)}}),y(null))},I=async()=>{h(null),d(!0);try{await $A(v),e()}catch(O){h(O.message)}finally{d(!1)}},P=O=>{const W=O==="collection"?v.collections:v.singletons,Z=O==="collection"?b.collections:b.singletons;return x.jsx(zA,{ids:Z.map(J=>J.id),onReorder:(J,K)=>_((Y,ee)=>{O==="collection"?(Y.collections=Vs(Y.collections,J,K),ee.collections=Vs(ee.collections,J,K)):(Y.singletons=Vs(Y.singletons,J,K),ee.singletons=Vs(ee.singletons,J,K))}),renderOverlay:J=>{const K=Z.findIndex(ee=>ee.id===J),Y=W[K];return Y?x.jsx(pX,{container:Y}):null},children:W.map((J,K)=>{const Y=Z[K];return Y?x.jsx(fX,{id:Y.id,container:J,kind:O,collectionNames:k,fieldIds:Y.fields,collapsed:i[Y.id]??!1,onToggleCollapse:()=>T(Y.id,!i[Y.id]),onChange:ee=>E(G=>{const q=(O==="collection"?G.collections:G.singletons)[K];q&&ee(q)}),onRemove:()=>_((ee,G)=>{O==="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=O==="collection"?G.collections:G.singletons,te=O==="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=O==="collection"?X.collections:X.singletons,F=O==="collection"?q.collections:q.singletons,L=te[K],V=F[K];!L||!V||(L.fields=Vs(L.fields,ee,G),V.fields=Vs(V.fields,ee,G))}),onAddField:()=>y({kind:O,ci:K,fi:null}),onChangeType:ee=>y({kind:O,ci:K,fi:ee})},Y.id):null})})};return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("header",{className:"sticky top-0 z-10 shrink-0 border-b bg-card px-8 py-4",children:x.jsxs("div",{className:"mx-auto flex w-full max-w-4xl items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"font-heading text-lg font-semibold text-foreground",children:j("Schema")}),x.jsx("p",{className:"text-sm text-muted-foreground",children:j("Design your collections and fields.")})]}),x.jsxs(Le,{type:"button",onClick:I,disabled:u,children:[x.jsx(lx,{}),j(u?"Saving…":"Save schema")]})]})}),x.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:x.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[f&&x.jsx("p",{className:"mb-5 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:f}),M?x.jsx(dX,{onAddCollection:()=>_(n1),onAddSingleton:()=>_(r1),onBrowseTemplates:n}):x.jsxs("div",{className:"space-y-10",children:[x.jsx(VS,{title:j("Collections"),hint:j("Content with many entries (posts, products…)"),onAdd:()=>_(n1),allCollapsed:b.collections.length>0&&b.collections.every(O=>i[O.id]),onToggleAll:b.collections.length>1?O=>N(b.collections,O):void 0,children:P("collection")}),x.jsx(VS,{title:j("Singletons"),hint:j("A single record (site settings, profile…)"),onAdd:()=>_(r1),allCollapsed:b.singletons.length>0&&b.singletons.every(O=>i[O.id]),onToggleAll:b.singletons.length>1?O=>N(b.singletons,O):void 0,children:P("singleton")})]})]})}),x.jsx(bX,{open:m!==null,onPick:D,onClose:()=>y(null)})]})}function VS({title:t,hint:e,onAdd:n,allCollapsed:r,onToggleAll:o,children:s}){return x.jsxs("section",{children:[x.jsxs("div",{className:"mb-3 flex items-end justify-between gap-3",children:[x.jsxs("div",{children:[x.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t}),x.jsx("p",{className:"text-xs text-muted-foreground/70",children:e})]}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&x.jsxs(Le,{type:"button",variant:"ghost",size:"sm",onClick:()=>o(!r),className:"text-muted-foreground",children:[r?x.jsx(a_,{}):x.jsx(uj,{}),j(r?"Expand all":"Collapse all")]}),x.jsxs(Le,{type:"button",variant:"outline",size:"sm",onClick:n,children:[x.jsx(ii,{})," ",j("Add")]})]})]}),x.jsx("div",{className:"space-y-3",children:s})]})}function dX({onAddCollection:t,onAddSingleton:e,onBrowseTemplates:n}){return x.jsx(xl,{className:"mx-auto max-w-md",children:x.jsxs(vl,{className:"flex flex-col items-center px-8 py-10 text-center",children:[x.jsx("div",{className:"mb-4 flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:x.jsx(Rc,{className:"size-7"})}),x.jsx("h2",{className:"font-heading text-lg font-semibold text-foreground",children:j("Your schema is empty")}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:j("A collection describes one type of your content — posts, products, projects. Start by adding the first one.")}),x.jsxs(Le,{type:"button",size:"lg",onClick:t,className:"mt-6",children:[x.jsx(ii,{})," ",j("Add collection")]}),x.jsxs("div",{className:"mt-3 flex items-center gap-3 text-sm",children:[x.jsx(Le,{type:"button",variant:"link",onClick:e,className:"h-auto p-0 text-muted-foreground hover:text-foreground",children:j("Add a singleton")}),n&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-border",children:"·"}),x.jsx(Le,{type:"button",variant:"link",onClick:n,className:"h-auto p-0",children:j("or start from a template")})]})]})]})})}function fX({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:l,isDragging:u}=jA({id:t});return x.jsx("div",{ref:o,style:{transform:is.Translate.toString(i),transition:l},className:Ae(u&&"opacity-40"),children:x.jsx(hX,{...e,dragHandle:x.jsx(Cv,{ref:s,label:j("Drag to reorder"),...n,...r})})})}function hX({container:t,kind:e,collectionNames:n,fieldIds:r,collapsed:o,onToggleCollapse:s,onChange:i,onRemove:l,onRemoveField:u,onReorderFields:d,onAddField:f,onChangeType:h,dragHandle:m}){const y=b=>{const k=Tp(b);i(E=>{E.name=k,E.path=e==="collection"?k:`${k}.json`})},v=t.fields.length;return x.jsxs(xl,{className:"gap-0 overflow-hidden py-0 shadow-sm",children:[x.jsxs(Ec,{className:Ae("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:[x.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,onClick:s,className:"absolute inset-0 cursor-pointer"}),x.jsx("div",{className:"relative opacity-0 transition group-focus-within/card:opacity-100 group-hover/card:opacity-100 focus-within:opacity-100",children:m}),x.jsx(Le,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,"aria-expanded":!o,"aria-label":j(o?"Expand":"Collapse"),className:"relative text-muted-foreground",children:x.jsx(ux,{className:Ae("transition-transform",o&&"-rotate-90")})}),x.jsx(Qt,{className:"relative h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:j(e==="collection"?"Collection name":"Singleton name"),onChange:b=>i(k=>{k.label=b.target.value})}),x.jsxs("div",{className:"relative flex items-center gap-2",children:[o&&x.jsx("span",{className:"whitespace-nowrap rounded-full bg-foreground/5 px-2 py-0.5 text-xs text-muted-foreground",children:hi(v,"{n} field","{n} fields")}),x.jsx(Qt,{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=>y(b.target.value)})]}),x.jsx(Tv,{label:j("Delete"),danger:!0,onClick:l,className:"relative",children:x.jsx(p_,{})})]}),!o&&x.jsxs(x.Fragment,{children:[x.jsxs(vl,{className:"px-0",children:[v===0&&x.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:j("No fields yet. Add the first one below.")}),x.jsx(zA,{ids:r,onReorder:d,renderOverlay:b=>{const k=r.indexOf(b),E=t.fields[k];return E?x.jsx(vX,{field:E}):null},children:x.jsx("div",{className:"divide-y divide-border/60",children:t.fields.map((b,k)=>{const E=r[k];return E?x.jsx(mX,{id:E,field:b,collectionNames:n,onChange:_=>i(T=>_(T.fields[k])),onRemove:()=>u(k),onChangeType:()=>h(k)},E):null})})})]}),x.jsxs(Le,{type:"button",variant:"ghost",onClick:f,className:"h-11 w-full justify-center gap-1.5 rounded-none border-t text-primary hover:bg-primary/5 hover:text-primary",children:[x.jsx(ii,{})," ",j("Add field")]})]})]})}function pX({container:t}){return x.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:[x.jsx(fx,{className:"size-4 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||t.name}),x.jsx("span",{className:"truncate font-mono text-xs text-primary",children:t.name}),x.jsx("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:hi(t.fields.length,"{n} field","{n} fields")})]})}function mX({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:l,isDragging:u}=jA({id:t});return x.jsx(gX,{...e,rowRef:o,style:{transform:is.Translate.toString(i),transition:l},dragging:u,dragHandle:x.jsx(Cv,{ref:s,label:j("Drag to reorder"),...n,...r})})}function gX({field:t,collectionNames:e,onChange:n,onRemove:r,onChangeType:o,rowRef:s,style:i,dragging:l,dragHandle:u}){const d=_v[t.type],f=d.icon,h="opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100 focus-within:opacity-100";return x.jsxs("div",{ref:s,style:i,className:Ae("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]",l&&"opacity-40"),children:[x.jsx("div",{className:h,children:u}),x.jsxs(px,{children:[x.jsx(mx,{asChild:!0,children:x.jsx(Le,{type:"button",variant:"ghost",size:"icon",onClick:o,"aria-label":j("Change type"),className:"bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",children:x.jsx(f,{})})}),x.jsxs(gx,{children:[j(d.label)," · ",j("change type")]})]}),x.jsx(Qt,{className:"h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:j("Field name"),onChange:m=>n(y=>{y.label=m.target.value})}),x.jsx(Qt,{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:j("key"),onChange:m=>n(y=>{y.key=Tp(m.target.value)})}),x.jsx(Le,{type:"button",size:"xs",variant:t.required?"default":"ghost","aria-pressed":t.required??!1,title:t.required?j("Required field"):j("Make it required"),onClick:()=>n(m=>{m.required=!m.required}),className:Ae("w-full rounded-full",!t.required&&`border-dashed border-border text-muted-foreground ${h}`),children:j("Required")}),x.jsx(Tv,{label:j("Delete"),danger:!0,onClick:r,className:h,children:x.jsx(ha,{})}),t.type==="select"&&x.jsx(Qt,{className:"col-start-3 col-end-[-1] row-start-2 mt-1",value:(t.options??[]).join(", "),placeholder:j("options (comma separated)"),onChange:m=>n(y=>{y.options=m.target.value.split(",").map(v=>v.trim()).filter(Boolean)})}),t.type==="relation"&&x.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:x.jsxs(Yu,{value:t.to||void 0,onValueChange:m=>n(y=>{y.to=m}),children:[x.jsx(Qu,{className:"w-full",children:x.jsx(Xu,{placeholder:j("pick a target collection…")})}),x.jsx(ec,{children:e.map(m=>x.jsx(tc,{value:m,children:m},m))})]})}),t.type==="group"&&x.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:x.jsx(xX,{field:t,onChange:n})})]})}const yX=Ev.filter(t=>t.type!=="group");function xX({field:t,onChange:e}){const n=t.fields??[];return x.jsxs("div",{className:"space-y-1.5 rounded-lg border border-dashed bg-muted/20 p-2.5",children:[n.map((r,o)=>x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsxs(Yu,{value:r.type,onValueChange:s=>e(i=>{var u;const l=(u=i.fields)==null?void 0:u[o];l&&(l.type=s)}),children:[x.jsx(Qu,{className:"h-8 w-[7.5rem] shrink-0",children:x.jsx(Xu,{})}),x.jsx(ec,{children:yX.map(({type:s,label:i})=>x.jsx(tc,{value:s,children:j(i)},s))})]}),x.jsx(Qt,{className:"h-8 flex-1 font-mono text-xs",value:r.key,placeholder:j("key"),onChange:s=>e(i=>{var u;const l=(u=i.fields)==null?void 0:u[o];l&&(l.key=Tp(s.target.value))})}),x.jsx(Qt,{className:"h-8 flex-1",value:r.label??"",placeholder:j("Display name"),onChange:s=>e(i=>{var u;const l=(u=i.fields)==null?void 0:u[o];l&&(l.label=s.target.value)})}),x.jsx(Tv,{label:j("Delete sub-field"),danger:!0,onClick:()=>e(s=>{s.fields&&(s.fields=s.fields.filter((i,l)=>l!==o))}),children:x.jsx(ha,{})})]},o)),x.jsxs(Le,{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:nm("field",o),label:"",type:"text"}]}),children:[x.jsx(ii,{})," ",j("Add sub-field")]})]})}function vX({field:t}){const e=_v[t.type],n=e.icon;return x.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:[x.jsx(fx,{className:"size-4 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:x.jsx(n,{className:"size-4"})}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||j(e.label)}),x.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:t.key})]})}function bX({open:t,onPick:e,onClose:n}){return x.jsx(Oc,{open:t,onOpenChange:r=>{r||n()},children:x.jsxs(Ic,{className:"sm:max-w-lg",children:[x.jsxs(Pc,{children:[x.jsx(jc,{children:j("Pick a field type")}),x.jsx(Lc,{children:j("Choose what kind of data this field holds.")})]}),x.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:Ev.map(({type:r,label:o,desc:s,icon:i})=>x.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:[x.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:x.jsx(i,{className:"size-4"})}),x.jsxs("span",{children:[x.jsx("span",{className:"block text-sm font-medium text-foreground",children:j(o)}),x.jsx("span",{className:"block text-xs text-muted-foreground",children:j(s)})]})]},r))})]})})}function Tv({children:t,label:e,danger:n,onClick:r,className:o}){return x.jsxs(px,{children:[x.jsx(mx,{asChild:!0,children:x.jsx(Le,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":e,className:Ae("text-muted-foreground",n&&"hover:bg-destructive/10 hover:text-destructive",o),children:t})}),x.jsx(gx,{children:e})]})}function Av({className:t,...e}){return x.jsx("textarea",{"data-slot":"textarea",className:Ae("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 _y={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:""}},kX=Object.values(_y),Nv="jj-ai-config";function wX(){try{const t=localStorage.getItem(Nv);if(!t)return null;const e=JSON.parse(t);return!e.provider||!e.model||!e.apiKey?null:e}catch{return null}}function CX(t){localStorage.setItem(Nv,JSON.stringify(t))}function SX(){localStorage.removeItem(Nv)}const HA=C.createContext(null);function Mv(){const t=C.useContext(HA);if(!t)throw new Error("useAiSettings must be used inside AiSettingsProvider");return t}function EX({children:t}){const[e,n]=C.useState(()=>wX()),[r,o]=C.useState(!1),[s,i]=C.useState((e==null?void 0:e.provider)??"gemini"),[l,u]=C.useState((e==null?void 0:e.model)??""),[d,f]=C.useState((e==null?void 0:e.apiKey)??""),[h,m]=C.useState((e==null?void 0:e.baseUrl)??""),[y,v]=C.useState([]),[b,k]=C.useState(!1),[E,_]=C.useState(!1),T=C.useMemo(()=>_y[s],[s]),N=()=>{i((e==null?void 0:e.provider)??"gemini"),u((e==null?void 0:e.model)??""),f((e==null?void 0:e.apiKey)??""),m((e==null?void 0:e.baseUrl)??""),v([]),_(!1),o(!0)},M=O=>{i(O),u(""),v([]),_(!1)},D=async()=>{var W;const O=_y[s];if(!O.needsBaseUrl&&!d.trim()){Yt.error(j("Enter an API key first"));return}if(O.needsBaseUrl&&!h.trim()){Yt.error(j("Enter a base URL first"));return}k(!0);try{const Z=await iX({provider:s,apiKey:d.trim(),...O.needsBaseUrl?{baseUrl:h.trim()}:{}});if(Z.length===0){_(!0),Yt.error(j("No models found — you can type one in"));return}v(Z),_(!1),Z.some(J=>J.id===l)||u(((W=Z[0])==null?void 0:W.id)??"")}catch(Z){_(!0),Yt.error(Z.message)}finally{k(!1)}},I=()=>{if(!l.trim()){Yt.error(j("A model name is required"));return}if(T.needsBaseUrl&&!h.trim()){Yt.error(j("A base URL is required"));return}if(!T.needsBaseUrl&&!d.trim()){Yt.error(j("An API key is required"));return}const O={provider:s,model:l.trim(),apiKey:d.trim(),...T.needsBaseUrl?{baseUrl:h.trim()}:{}};CX(O),n(O),o(!1),Yt.success(j("AI settings saved"))},P=()=>{SX(),n(null),f(""),u(""),Yt.success(j("AI disconnected"))};return x.jsxs(HA.Provider,{value:{config:e,openSettings:N},children:[t,x.jsx(Oc,{open:r,onOpenChange:o,children:x.jsxs(Ic,{children:[x.jsxs(Pc,{children:[x.jsxs(jc,{className:"flex items-center gap-2",children:[x.jsx(Wj,{className:"h-4 w-4 text-primary"})," ",j("AI settings")]}),x.jsx(Lc,{children:j("Entirely optional. Your key is stored in this browser only and goes straight to the provider — nothing reaches us.")})]}),x.jsxs("div",{className:"space-y-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx(vu,{children:j("Provider")}),x.jsxs(Yu,{value:s,onValueChange:O=>M(O),children:[x.jsx(Qu,{className:"w-full",children:x.jsx(Xu,{})}),x.jsx(ec,{children:kX.map(O=>x.jsx(tc,{value:O.id,children:j(O.label)},O.id))})]}),x.jsx("p",{className:"text-xs text-muted-foreground",children:j(T.hint)})]}),T.needsBaseUrl&&x.jsxs("div",{className:"space-y-2",children:[x.jsx(vu,{children:j("Base URL")}),x.jsx(Qt,{value:h,onChange:O=>m(O.target.value),placeholder:"http://localhost:11434/v1",className:"font-mono"})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs(vu,{children:["API key",T.needsBaseUrl&&x.jsxs("span",{className:"ml-1 font-normal text-muted-foreground",children:["(",j("optional"),")"]})]}),x.jsx(Qt,{type:"password",value:d,onChange:O=>f(O.target.value),placeholder:"••••••••••••",className:"font-mono"}),T.keyUrl&&x.jsxs("a",{href:T.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-block text-xs text-primary hover:underline",children:[j("Get a free key")," →"]})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx(vu,{children:"Model"}),E?x.jsx(Qt,{value:l,onChange:O=>u(O.target.value),placeholder:T.modelPlaceholder,className:"font-mono"}):y.length===0?x.jsx(Le,{type:"button",variant:"outline",className:"w-full",onClick:D,disabled:b,children:b?x.jsxs(x.Fragment,{children:[x.jsx(ta,{className:"animate-spin"})," ",j("Loading models…")]}):j("Load models")}):x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Yu,{value:l,onValueChange:u,children:[x.jsx(Qu,{className:"w-full font-mono",children:x.jsx(Xu,{placeholder:j("Pick a model…")})}),x.jsx(ec,{children:y.map(O=>x.jsx(tc,{value:O.id,className:"font-mono",children:O.label},O.id))})]}),x.jsxs(Le,{type:"button",variant:"ghost",size:"icon-sm",onClick:D,disabled:b,title:j("Refresh models"),className:"text-muted-foreground",children:[b?x.jsx(ta,{className:"animate-spin"}):x.jsx(g9,{}),x.jsx("span",{className:"sr-only",children:j("Refresh models")})]})]}),!E&&y.length>0&&x.jsx("button",{type:"button",onClick:()=>_(!0),className:"text-xs text-muted-foreground hover:text-primary",children:j("Type the model manually")})]})]}),x.jsxs(Ep,{className:"sm:justify-between",children:[e?x.jsx(Le,{variant:"ghost",onClick:P,className:"text-muted-foreground",children:j("Disconnect")}):x.jsx("span",{}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx(Sp,{asChild:!0,children:x.jsx(Le,{variant:"outline",children:j("Cancel")})}),x.jsx(Le,{onClick:I,children:j("Save")})]})]})]})})]})}const _X={blog:n9,cv:V9,portfolio:Kj,docs:ZP,changelog:x9,recipe:sj,event:ej,catalog:A9};function TX(t){const e=[];return t.collections.length&&e.push(hi(t.collections.length,"{n} collection","{n} collections")),t.singletons.length&&e.push(hi(t.singletons.length,"{n} singleton","{n} singletons")),e.join(" · ")}function AX(){return x.jsxs(xl,{className:"h-full",children:[x.jsxs(Ec,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"size-10 shrink-0 animate-pulse rounded-lg bg-muted"}),x.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"})]}),x.jsx("div",{className:"mt-2 h-3 w-full animate-pulse rounded bg-muted"}),x.jsx("div",{className:"mt-1.5 h-3 w-2/3 animate-pulse rounded bg-muted"})]}),x.jsxs(vl,{className:"flex-1 space-y-1.5",children:[x.jsx("div",{className:"h-8 animate-pulse rounded-md bg-muted"}),x.jsx("div",{className:"h-8 animate-pulse rounded-md bg-muted"})]}),x.jsx(sp,{children:x.jsx("div",{className:"h-9 w-full animate-pulse rounded-lg bg-muted"})})]})}const NX={en:"English",tr:"Turkish"};function MX(){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 ${NX[kc()]??"English"}.`].join(" ")}function DX(t){return t.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"").trim()}function RX({onApplied:t,disabled:e}){const{config:n,openSettings:r}=Mv(),[o,s]=C.useState(""),[i,l]=C.useState(!1),[u,d]=C.useState(null),f=async()=>{if(!n){r();return}if(o.trim()){d(null),l(!0);try{const h=await VA(n,MX(),o.trim());let m;try{m=JSON.parse(DX(h))}catch{throw new Error(j("The AI did not return valid JSON — try again."))}await FA(m),t()}catch(h){d(h.message),l(!1)}}};return x.jsxs("div",{className:"mb-8 rounded-2xl border border-primary/30 bg-accent/40 p-6 sm:p-8",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[x.jsx(Zu,{className:"size-4"})," ",j("Generate with AI")]}),x.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground underline-offset-2 hover:text-primary hover:underline",children:j(n?"AI settings":"Connect a provider")})]}),x.jsx("h2",{className:"mt-2 font-heading text-lg font-semibold text-foreground sm:text-xl",children:j("Describe what you want to manage and let it design the schema")}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:j("Runs on your own API key — entirely optional, nothing reaches us. It only creates collections and fields; the content is yours to write.")}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-start",children:[x.jsx(Av,{value:o,onChange:h=>{s(h.target.value),u&&d(null)},disabled:i||e,rows:2,placeholder:j('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:h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&f()}}),x.jsx(Le,{onClick:f,disabled:i||e||!o.trim(),className:"shrink-0 sm:mt-0",children:i?x.jsxs(x.Fragment,{children:[x.jsx(ta,{className:"animate-spin"})," ",j("Generating…")]}):x.jsxs(x.Fragment,{children:[x.jsx(Zu,{})," ",j("Generate schema")]})})]}),!n&&x.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:j("No AI provider connected yet — the settings open when you press the button.")}),u&&x.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:[x.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{className:"break-words",children:u})]})]})}function OX({onApplied:t,disabled:e}){const[n,r]=C.useState(!1),[o,s]=C.useState(""),[i,l]=C.useState(null),[u,d]=C.useState(!1),f=async m=>{var v;const y=(v=m.target.files)==null?void 0:v[0];if(m.target.value="",!!y){l(null);try{s(await y.text())}catch{l(j("Could not read the file."))}}},h=async()=>{let m;try{m=JSON.parse(o)}catch{l(j("Invalid JSON"));return}const y=m&&typeof m=="object"&&"schema"in m?m.schema:m;l(null),d(!0);try{await FA(y),r(!1),t()}catch(v){l(v.message),d(!1)}};return x.jsxs(Oc,{open:n,onOpenChange:m=>{r(m),!m&&!u&&(s(""),l(null))},children:[x.jsxs(xl,{className:"h-full border border-dashed border-border bg-transparent ring-0 transition-colors hover:border-foreground/25 data-[busy=true]:opacity-60","data-busy":e,children:[x.jsxs(Ec,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:x.jsx(Ej,{className:"size-5"})}),x.jsx(Cy,{className:"text-base",children:j("Import — your own JSON")})]}),x.jsx(Sy,{className:"mt-2 leading-relaxed",children:j("Bring the JSON you already have; JustJSON infers the structure and sets your project up.")})]}),x.jsx(vl,{className:"flex-1",children:x.jsxs("div",{className:"flex h-full items-center rounded-md border border-dashed border-border/70 px-3 py-4 text-sm text-muted-foreground",children:[j("Your content JSON, or an existing"),x.jsx("code",{className:"mx-1 font-mono text-xs text-foreground",children:"_schema.json"}),j("— the structure is inferred automatically.")]})}),x.jsx(sp,{children:x.jsx(U9,{asChild:!0,children:x.jsx(Le,{variant:"outline",className:"h-9 w-full",disabled:e,children:j("Import your own JSON")})})})]}),x.jsxs(Ic,{className:"sm:max-w-lg",children:[x.jsxs(Pc,{children:[x.jsx(jc,{children:j("Import your own JSON")}),x.jsxs(Lc,{children:[j("Paste or pick your content JSON, or an existing")," ",x.jsx("code",{className:"font-mono text-xs",children:"_schema.json"})," ",j("— JustJSON works out the collections and singletons for you.")]})]}),x.jsxs("div",{className:"space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between gap-3",children:[x.jsx("span",{className:"text-sm font-medium text-foreground",children:"JSON"}),x.jsxs("label",{className:Ae(ax({variant:"outline",size:"sm"}),"cursor-pointer",u&&"pointer-events-none opacity-50"),children:[x.jsx(m_,{}),j("Choose a file"),x.jsx("input",{type:"file",accept:".json,application/json",className:"sr-only",disabled:u,onChange:f})]})]}),x.jsx(Av,{value:o,onChange:m=>{s(m.target.value),i&&l(null)},disabled:u,spellCheck:!1,rows:10,placeholder:'{ "collections": { ... }, "singletons": { ... } }',className:"max-h-72 resize-y font-mono text-xs leading-relaxed"}),i&&x.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:[x.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{className:"break-words",children:i})]})]}),x.jsxs(Ep,{children:[x.jsx(Sp,{asChild:!0,children:x.jsx(Le,{variant:"ghost",disabled:u,children:j("Cancel")})}),x.jsx(Le,{disabled:u||!o.trim(),onClick:h,children:u?x.jsxs(x.Fragment,{children:[x.jsx(ta,{className:"animate-spin"}),j("Importing…")]}):j("Import")})]})]})]})}function IX({onApplied:t,onScratch:e}){const[n,r]=C.useState(null),[o,s]=C.useState(null),[i,l]=C.useState(null);C.useEffect(()=>{YY().then(r).catch(()=>s(j("Could not load the template list.")))},[]);const u=async f=>{s(null),l(f);try{await XY(f),t()}catch(h){s(h.message),l(null)}},d=i!==null;return x.jsx("div",{className:"h-full overflow-y-auto bg-muted/30",children:x.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12 sm:px-8",children:[x.jsxs("header",{className:"mb-9 max-w-2xl",children:[x.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[x.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground",children:x.jsx(El,{className:"size-3.5"})}),"JustJSON"]}),x.jsx("h1",{className:"font-heading text-2xl font-semibold tracking-tight text-foreground sm:text-3xl",children:j("Pick a template")}),x.jsx("p",{className:"mt-2 text-base leading-relaxed text-muted-foreground",children:j("Edit your content visually; everything stays in your folder as plain JSON — no server, no account.")}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:j("The template you pick creates your schema and content files — you can change all of it later.")})]}),o&&x.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:[x.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{children:o})]}),x.jsx(RX,{onApplied:t,disabled:d}),x.jsxs("div",{className:"mb-5 flex items-center gap-3 text-xs font-medium text-muted-foreground",children:[x.jsx("span",{className:"h-px flex-1 bg-border"}),j("or start from a template"),x.jsx("span",{className:"h-px flex-1 bg-border"})]}),x.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[n===null&&!o&&[0,1,2,3,4].map(f=>x.jsx(AX,{},f)),n==null?void 0:n.map(f=>{const h=_X[f.id]??Nj,m=i===f.id;return x.jsxs(xl,{className:"h-full transition-shadow hover:shadow-md data-[busy=true]:opacity-60","data-busy":d&&!m,children:[x.jsxs(Ec,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-accent text-accent-foreground",children:x.jsx(h,{className:"size-5"})}),x.jsx(Cy,{className:"text-base",children:f.title})]}),x.jsx(Sy,{className:"mt-2 leading-relaxed",children:f.description})]}),x.jsxs(vl,{className:"flex-1",children:[x.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[x.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:j("What it creates")}),x.jsx("span",{className:"text-xs text-muted-foreground/80",children:TX(f)})]}),x.jsxs("div",{className:"space-y-1.5",children:[f.collections.map(y=>x.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5",children:[x.jsx(w9,{className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y.label}),x.jsx(si,{variant:"secondary",className:"ml-auto shrink-0 font-normal",children:hi(y.fields,"{n} field","{n} fields")})]},y.label)),f.singletons.map(y=>x.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5",children:[x.jsx(l_,{className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y.label}),x.jsx(si,{variant:"outline",className:"ml-auto shrink-0 font-normal",children:j("singleton")})]},y.label))]})]}),x.jsx(sp,{children:x.jsx(Le,{className:"h-9 w-full",disabled:d,onClick:()=>u(f.id),children:m?x.jsxs(x.Fragment,{children:[x.jsx(ta,{className:"animate-spin"}),j("Applying…")]}):j("Use this template")})})]},f.id)}),x.jsxs(xl,{className:"h-full border border-dashed border-border bg-transparent ring-0 transition-colors hover:border-foreground/25 data-[busy=true]:opacity-60","data-busy":d,children:[x.jsxs(Ec,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:x.jsx(l9,{className:"size-5"})}),x.jsx(Cy,{className:"text-base",children:j("Start from scratch")})]}),x.jsx(Sy,{className:"mt-2 leading-relaxed",children:j("Begin with an empty schema and define your own collections and fields.")})]}),x.jsx(vl,{className:"flex-1",children:x.jsx("div",{className:"flex h-full items-center rounded-md border border-dashed border-border/70 px-3 py-4 text-sm text-muted-foreground",children:j("Nothing here yet — you build the structure from the ground up.")})}),x.jsx(sp,{children:x.jsx(Le,{variant:"outline",className:"h-9 w-full",disabled:d,onClick:e,children:j("Continue with an empty project")})})]}),x.jsx(OX,{onApplied:t,disabled:d})]})]})})}const PX={en:"Write in English.",tr:"Write in Turkish."};function jX({context:t,fieldLabel:e,currentValue:n,richtext:r,onResult:o}){const{config:s,openSettings:i}=Mv(),[l,u]=C.useState(!1),[d,f]=C.useState(""),[h,m]=C.useState(!1),y=()=>{if(!s){i();return}f(""),u(!0)},v=async()=>{if(s){m(!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.",PX[kc()]].join(" "),k=[d.trim()||`Write suitable content for ${e}.`,n.trim()?`
|
|
630
|
-
|
|
631
|
-
Current text (improve on it / use as a base):
|
|
632
|
-
${n}`:""].join(""),E=await VA(s,b,k);o(E.trim()),u(!1),Yt.success(j("Content generated"))}catch(b){Yt.error(b.message)}finally{m(!1)}}};return x.jsxs(x.Fragment,{children:[x.jsxs(Le,{type:"button",variant:"ghost",size:"icon-xs",onClick:y,className:"text-muted-foreground hover:text-primary",title:j("Fill with AI"),children:[x.jsx(Zu,{className:"h-3.5 w-3.5"}),x.jsx("span",{className:"sr-only",children:j("Fill with AI")})]}),x.jsx(Oc,{open:l,onOpenChange:u,children:x.jsxs(Ic,{children:[x.jsxs(Pc,{children:[x.jsxs(jc,{className:"flex items-center gap-2",children:[x.jsx(Zu,{className:"h-4 w-4 text-primary"})," ",e]}),x.jsxs(Lc,{children:[j("Say what you want in a sentence; the model fills it in using {context} as context.",{context:t}),n.trim()?` ${j("The current text is sent along as context.")}`:""]})]}),x.jsx(Av,{autoFocus:!0,value:d,onChange:b=>f(b.target.value),placeholder:j('e.g. "write a short, friendly {field}"',{field:e}),className:"min-h-24",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&v()}}),x.jsxs(Ep,{children:[x.jsx(Sp,{asChild:!0,children:x.jsx(Le,{variant:"outline",children:j("Cancel")})}),x.jsx(Le,{onClick:v,disabled:h,children:h?x.jsxs(x.Fragment,{children:[x.jsx(ta,{className:"h-4 w-4 animate-spin"})," ",j("Generating…")]}):j("Generate")})]})]})})]})}function ti({children:t}){return x.jsx("div",{className:"flex h-full min-h-0 flex-col",children:t})}function ni({title:t,badge:e,subtitle:n,actions:r,toolbar:o}){return x.jsxs("header",{className:"sticky top-0 z-20 shrink-0 border-b bg-card px-8 pt-4 pb-3.5",children:[x.jsxs("div",{className:"flex items-start justify-between gap-6",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[x.jsx("h1",{className:"truncate text-lg font-semibold leading-tight tracking-tight text-foreground",children:t}),e]}),n&&x.jsx("div",{className:"mt-1.5 flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:n})]}),r&&x.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]}),o&&x.jsx("div",{className:"mt-3.5",children:o})]})}function UA({children:t}){return x.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t})}function LX({children:t}){return x.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-8 py-6",children:t})}function zX({className:t,children:e}){return x.jsx("div",{className:Ae("overflow-hidden rounded-xl border bg-card shadow-sm",t),children:e})}function Gf({children:t}){return x.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:[x.jsx(Cj,{className:"h-3 w-3 shrink-0 text-muted-foreground/70"}),x.jsx("span",{className:"truncate",children:t})]})}function HS({icon:t,title:e,hint:n,action:r}){return x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-16 text-center",children:[x.jsx("div",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:t}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:e}),n&&x.jsx("p",{className:"mt-1 max-w-xs text-sm text-muted-foreground",children:n}),r&&x.jsx("div",{className:"mt-5",children:r})]})}const WA=["a","b","c","d","e"];function Hu({className:t}){return x.jsx("div",{className:Ae("animate-pulse rounded-md bg-muted",t)})}function FX(){return x.jsxs(ML,{delayDuration:300,children:[x.jsx(EX,{children:x.jsx($X,{})}),x.jsx(_L,{position:"bottom-right"})]})}function $X(){uA();const[t,e]=C.useState(null),[n,r]=C.useState(null),[o,s]=C.useState(null),[i,l]=C.useState(null),[u,d]=C.useState(!1),[f,h]=C.useState(0),[m,y]=C.useState(null),v=C.useCallback(async()=>{const T=await FS();return e(T),T},[]),b=C.useCallback(T=>{T&&(y(T),h(N=>N+1)),l({kind:"schema"})},[]);if(C.useEffect(()=>{FS().then(T=>{e(T),T.collections.length===0&&T.singletons.length===0&&d(!0)}).catch(()=>s(j("Could not load the schema. Is `justjson serve` running?")))},[]),C.useEffect(()=>{ZY().then(r).catch(()=>{})},[]),o)return x.jsx(Uu,{children:o});if(!t)return x.jsx(Uu,{children:j("Loading…")});if(u)return x.jsx(IX,{onApplied:async()=>{const T=await v();d(!1),l(T.collections[0]?{kind:"collection",name:T.collections[0].name}:{kind:"schema"})},onScratch:()=>{d(!1),l({kind:"schema"})}});const k=t.collections.length===0&&t.singletons.length===0,E=()=>{eX(),Yt.success(j("Downloading export"))},_=async()=>{await $A({version:1,collections:[],singletons:[]}),await v(),l(null),d(!0),Yt.success(j("Schema reset"))};return x.jsxs("div",{className:"flex h-full bg-background",children:[x.jsx(HX,{project:n,schema:t,selection:i,onSelect:l,onOpenSchema:b,onExport:E,onReset:_}),x.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden bg-muted/30",children:[x.jsx(VX,{project:n,crumbs:BX(t,i,l)}),x.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:x.jsx(qX,{schema:t,selection:i,onSelect:l,onReload:v,onOpenSchema:b,addSeq:f,addKind:m,onBrowseTemplates:k?()=>d(!0):void 0})})]})]})}function BX(t,e,n){if(!e)return[];if(e.kind==="schema")return[{label:j("Schema")}];if(e.kind==="json")return[{label:j("Raw JSON")}];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:j("New entry")}]}const r=t.singletons.find(o=>o.name===e.name);return[{label:(r==null?void 0:r.label)??e.name,tag:j("singleton")}]}function VX({project:t,crumbs:e}){return x.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-1 overflow-x-auto border-b bg-card px-8 text-xs",children:[x.jsxs("span",{title:t==null?void 0:t.path,className:"inline-flex shrink-0 items-center gap-1.5 text-muted-foreground",children:[x.jsx(u_,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),(t==null?void 0:t.name)??"…"]}),e.map(n=>x.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[x.jsx(cx,{className:"h-3.5 w-3.5 text-muted-foreground/40"}),n.onClick?x.jsx("button",{type:"button",onClick:n.onClick,className:"rounded text-muted-foreground transition-colors hover:text-primary",children:n.label}):x.jsx("span",{className:"font-medium text-foreground/80",children:n.label}),n.tag&&x.jsx(si,{variant:"secondary",className:"ml-0.5 font-normal",children:n.tag})]},n.label))]})}function Uu({children:t}){return x.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:t})}function HX({project:t,schema:e,selection:n,onSelect:r,onOpenSchema:o,onExport:s,onReset:i}){const l=u=>n?n.kind==="collection"?n.name===u:n.kind==="entry"||n.kind==="newEntry"?n.collection===u:!1:!1;return x.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r bg-card",children:[x.jsx("div",{className:"flex h-12 shrink-0 items-center border-b px-5",children:x.jsxs("div",{className:"font-mono text-[15px] font-bold tracking-tight text-foreground",children:["Just",x.jsx("span",{className:"text-primary",children:"JSON"})]})}),t&&x.jsx("div",{className:"px-3 pt-3",children:x.jsx(UX,{project:t,onExport:s,onReset:i})}),x.jsxs("nav",{className:"flex-1 space-y-1 overflow-y-auto px-3 pt-3 pb-4",children:[x.jsx(WX,{active:(n==null?void 0:n.kind)==="schema",onClick:()=>o()}),x.jsx(o1,{icon:x.jsx(El,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="json",onClick:()=>r({kind:"json"}),children:j("Raw JSON")}),x.jsx(US,{label:j("Collections"),addLabel:j("Add collection"),onAdd:()=>o("collection"),children:e.collections.length===0?x.jsx(WS,{onClick:()=>o("collection"),children:j("Add collection")}):e.collections.map(u=>x.jsx(o1,{icon:x.jsx(Rc,{className:"h-4 w-4"}),active:l(u.name),onClick:()=>r({kind:"collection",name:u.name}),children:u.label??u.name},u.name))}),x.jsx(US,{label:j("Singletons"),addLabel:j("Add singleton"),onAdd:()=>o("singleton"),children:e.singletons.length===0?x.jsx(WS,{onClick:()=>o("singleton"),children:j("Add singleton")}):e.singletons.map(u=>x.jsx(o1,{icon:x.jsx(Tj,{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 UX({project:t,onExport:e,onReset:n}){const[r,o]=C.useState(!1),[s,i]=C.useState(!1),{config:l,openSettings:u}=Mv(),d=uA(),f=async()=>{i(!0);try{await n(),o(!1)}finally{i(!1)}};return x.jsxs(x.Fragment,{children:[x.jsxs(g_,{children:[x.jsx(y_,{asChild:!0,children:x.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:[x.jsx(u_,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),x.jsx("span",{className:"truncate",children:t.name}),x.jsx(a_,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]})}),x.jsxs(x_,{align:"start",className:"w-56",children:[x.jsx(T1,{className:"truncate",children:t.name}),x.jsx(xu,{}),x.jsxs(og,{onSelect:e,children:[x.jsx(kj,{}),j("Export (.zip)")]}),x.jsx(xu,{}),x.jsxs(og,{onSelect:u,children:[x.jsx(Zu,{}),j("AI settings"),l&&x.jsx(si,{variant:"secondary",className:"ml-auto font-normal",children:j("connected")})]}),x.jsx(xu,{}),x.jsx(T1,{className:"text-xs font-normal text-muted-foreground",children:j("Language")}),KJ.map(h=>x.jsx(v_,{checked:d===h.code,onCheckedChange:()=>ZJ(h.code),children:h.label},h.code)),x.jsx(xu,{}),x.jsxs(og,{variant:"destructive",onSelect:()=>o(!0),children:[x.jsx(b9,{}),j("Start over (reset)")]})]})]}),x.jsx(Oc,{open:r,onOpenChange:o,children:x.jsxs(Ic,{children:[x.jsxs(Pc,{children:[x.jsx(jc,{children:j("Reset the schema?")}),x.jsx(Lc,{children:j("Your content files stay on disk, but the schema is cleared so you can pick a template or JSON again.")})]}),x.jsxs(Ep,{children:[x.jsx(Sp,{asChild:!0,children:x.jsx(Le,{variant:"outline",children:j("Cancel")})}),x.jsx(Le,{variant:"destructive",onClick:f,disabled:s,children:j(s?"Resetting…":"Reset")})]})]})})]})}function WX({active:t,onClick:e}){return x.jsxs("button",{type:"button",onClick:e,className:Ae("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:[x.jsx(h_,{className:"h-4 w-4 shrink-0"}),x.jsxs("span",{className:"min-w-0",children:[x.jsx("span",{className:"block text-sm font-medium leading-tight",children:j("Schema")}),x.jsx("span",{className:Ae("block text-xs leading-tight",t?"text-primary/70":"text-muted-foreground/70"),children:j("Content structure")})]})]})}function US({label:t,addLabel:e,onAdd:n,children:r}){return x.jsxs("div",{className:"pt-4",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 pb-1",children:[x.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground/80",children:t}),x.jsxs(px,{children:[x.jsx(mx,{asChild:!0,children:x.jsxs(Le,{variant:"ghost",size:"icon-xs",onClick:n,className:"text-muted-foreground hover:text-primary",children:[x.jsx(ii,{}),x.jsx("span",{className:"sr-only",children:e})]})}),x.jsx(gx,{children:e})]})]}),x.jsx("div",{className:"space-y-0.5",children:r})]})}function WS({onClick:t,children:e}){return x.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:[x.jsx(ii,{className:"h-4 w-4"})," ",e]})}function o1({children:t,icon:e,active:n,onClick:r}){return x.jsxs("button",{type:"button",onClick:r,className:Ae("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&&x.jsx("span",{className:n?"text-primary":"text-muted-foreground/70",children:e}),x.jsx("span",{className:"truncate",children:t})]})}function qX({schema:t,selection:e,onSelect:n,onReload:r,onOpenSchema:o,addSeq:s,addKind:i,onBrowseTemplates:l}){if(!e)return x.jsx(KX,{icon:x.jsx(Rc,{className:"h-6 w-6"}),title:j("Start on the left"),hint:j("Pick a collection or singleton to start editing. To change the structure, go to Schema."),action:x.jsxs(Le,{onClick:()=>o(),children:[x.jsx(h_,{})," ",j("Open schema")]})});if(e.kind==="schema")return x.jsx(cX,{schema:t,initialAdd:i??void 0,onSaved:()=>void r(),onBrowseTemplates:l},s);if(e.kind==="json")return x.jsx(JX,{schema:t});if(e.kind==="collection"){const d=t.collections.find(f=>f.name===e.name);return d?x.jsx(YX,{collection:d,onOpen:f=>n({kind:"entry",collection:d.name,slug:f}),onNew:()=>n({kind:"newEntry",collection:d.name})}):x.jsx(Uu,{children:j("This collection no longer exists.")})}if(e.kind==="entry"||e.kind==="newEntry"){const d=t.collections.find(h=>h.name===e.collection);if(!d)return x.jsx(Uu,{children:j("This collection no longer exists.")});const f=e.kind==="entry"?e.slug:null;return x.jsx(QX,{collection:d,slug:f,onSaved:h=>n({kind:"entry",collection:d.name,slug:h}),onDeleted:()=>n({kind:"collection",name:d.name})},`${d.name}/${f??"new"}`)}const u=t.singletons.find(d=>d.name===e.name);return u?x.jsx(eQ,{singleton:u},u.name):x.jsx(Uu,{children:j("This singleton no longer exists.")})}function KX({icon:t,title:e,hint:n,action:r}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[t&&x.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}),x.jsx("p",{className:"text-base font-semibold text-foreground",children:e}),n&&x.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-muted-foreground",children:n}),r&&x.jsx("div",{className:"mt-5",children:r})]})}function rm({children:t}){return x.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t})}function qA(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 KA({path:t,data:e}){const n=C.useMemo(()=>JSON.stringify(e,null,2),[e]),r=n==="{}",o=()=>{navigator.clipboard&&navigator.clipboard.writeText(n),Yt.success(j("JSON copied"))};return x.jsxs("div",{className:"overflow-hidden rounded-xl border shadow-sm",children:[x.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-2",children:[x.jsx(El,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),x.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:t}),x.jsxs(Le,{variant:"ghost",size:"xs",onClick:o,disabled:r,className:"ml-auto text-muted-foreground hover:text-primary",children:[x.jsx(vj,{})," ",j("Copy")]})]}),r?x.jsx("p",{className:"jk-pre text-muted-foreground/70",children:j("No fields filled in yet.")}):x.jsx("pre",{className:"jk-pre overflow-x-auto",children:x.jsx("code",{dangerouslySetInnerHTML:{__html:qA(n)}})})]})}function nl({children:t}){return x.jsx(UA,{children:x.jsx("div",{className:"mx-auto max-w-3xl space-y-5 px-8 py-6",children:t})})}function GX({path:t,data:e,defaultOpen:n}){const[r,o]=C.useState(n??!1),s=C.useMemo(()=>JSON.stringify(e,null,2),[e]);return x.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[x.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:[x.jsx(cx,{className:Ae("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),x.jsx(El,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),x.jsx("span",{className:"truncate font-mono text-xs text-foreground/80",children:t})]}),r&&x.jsx("pre",{className:"jk-pre overflow-x-auto border-t",children:x.jsx("code",{dangerouslySetInnerHTML:{__html:qA(s)}})})]})}function JX({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 l of t.collections){const u=await Sv(l.name),d=await Promise.all(u.map(f=>Ey(l.name,f.slug).then(h=>({slug:f.slug,d:h}))));for(const f of d)f.d&&i.push({path:`${l.name}/${f.slug}.json`,data:f.d})}for(const l of t.singletons){const u=await BA(l.name);i.push({path:`${l.name}.json`,data:u})}s||n(i)}catch(i){s||o(i.message)}})(),()=>{s=!0}},[t]),x.jsxs(ti,{children:[x.jsx(ni,{title:j("Raw JSON"),subtitle:e?`content/ • ${hi(e.length,"{n} file","{n} files")}`:j("Every file in content/, exactly as written to disk")}),x.jsx(UA,{children:x.jsxs("div",{className:"mx-auto max-w-3xl space-y-2 px-8 py-6",children:[r&&x.jsx(Dv,{title:j("Could not load"),children:r}),e===null&&!r&&x.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:j("Loading…")}),e==null?void 0:e.map((s,i)=>x.jsx(GX,{path:s.path,data:s.data,defaultOpen:i===0},s.path))]})})]})}function GA(){return x.jsx(rm,{children:x.jsx("div",{className:"space-y-6",children:WA.slice(0,4).map(t=>x.jsxs("div",{className:"space-y-2",children:[x.jsx(Hu,{className:"h-3.5 w-28"}),x.jsx(Hu,{className:"h-8 w-full"})]},t))})})}function JA({onRetry:t,onBack:e}){return x.jsx(rm,{children:x.jsxs("div",{className:"flex flex-col items-center py-8 text-center",children:[x.jsx("div",{className:"mb-3 flex size-12 items-center justify-center rounded-xl bg-destructive/10 text-destructive",children:x.jsx(hx,{className:"size-5"})}),x.jsx("p",{className:"font-medium text-foreground",children:j("Could not load the entry")}),x.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:j("The file could not be read, or it may have been deleted. Editing is disabled so an empty form does not overwrite it.")}),x.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[x.jsx(Le,{onClick:t,children:j("Try again")}),e&&x.jsx(Le,{variant:"outline",onClick:e,children:j("Back to the list")})]})]})})}function ZX(t){return t?new Intl.DateTimeFormat(kc()==="tr"?"tr-TR":"en-GB",{day:"numeric",month:"short",year:"numeric"}).format(new Date(t)):"—"}function YX({collection:t,onOpen:e,onNew:n}){const[r,o]=C.useState(null),[s,i]=C.useState("");C.useEffect(()=>{Sv(t.name).then(o)},[t.name]);const l=s.trim().toLowerCase(),u=r==null?void 0:r.filter(f=>f.title.toLowerCase().includes(l)||f.slug.includes(l)),d=!!r&&r.length>0;return x.jsxs(ti,{children:[x.jsx(ni,{title:t.label??t.name,subtitle:r?hi(r.length,"{n} entry","{n} entries"):j("Loading entries…"),actions:x.jsxs(Le,{onClick:n,children:[x.jsx(ii,{})," ",j("New entry")]}),toolbar:d?x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("div",{className:"relative w-full max-w-sm",children:[x.jsx(_9,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),x.jsx(Qt,{className:"pl-9",placeholder:j("Search by title or slug…"),value:s,onChange:f=>i(f.target.value)})]}),x.jsx("span",{className:"ml-auto shrink-0 text-xs tabular-nums text-muted-foreground",children:l?hi((u==null?void 0:u.length)??0,"{n} result","{n} results"):null})]}):void 0}),x.jsx(LX,{children:x.jsxs(zX,{className:"flex h-full flex-col [&>[data-slot=table-container]]:min-h-0 [&>[data-slot=table-container]]:flex-1",children:[r===null&&x.jsx(qS,{rows:null,onOpen:e}),r!==null&&r.length===0&&x.jsx(HS,{icon:x.jsx(Rc,{className:"h-6 w-6"}),title:j("No entries yet"),hint:j("Add the first piece of content to this collection."),action:x.jsxs(Le,{onClick:n,variant:"outline",children:[x.jsx(ii,{})," ",j("Create the first entry")]})}),d&&(u==null?void 0:u.length)===0&&x.jsx(HS,{icon:x.jsx(S9,{className:"h-6 w-6"}),title:j("No matching entries"),hint:j("Nothing found for “{q}”. Change the search or clear it.",{q:s.trim()}),action:x.jsx(Le,{variant:"outline",onClick:()=>i(""),children:j("Clear search")})}),d&&u&&u.length>0&&x.jsx(qS,{rows:u,onOpen:e})]})})]})}const Lf="h-9 bg-muted/50 px-4 text-xs font-medium uppercase tracking-wide text-muted-foreground";function qS({rows:t,onOpen:e}){return x.jsxs(TL,{children:[x.jsx(AL,{className:"sticky top-0 z-10",children:x.jsxs(sg,{className:"hover:bg-transparent",children:[x.jsx(yf,{className:Ae(Lf,"w-full"),children:j("Title")}),x.jsx(yf,{className:Lf,children:j("File")}),x.jsx(yf,{className:Ae(Lf,"text-right"),children:j("Updated")}),x.jsx(yf,{className:Ae(Lf,"w-10 pl-0"),children:x.jsx("span",{className:"sr-only",children:j("Open")})})]})}),x.jsx(NL,{children:t===null?WA.map(n=>x.jsxs(sg,{className:"hover:bg-transparent",children:[x.jsx(Os,{className:"px-4 py-3",children:x.jsx(Hu,{className:"h-3.5 w-48"})}),x.jsx(Os,{className:"px-4 py-3",children:x.jsx(Hu,{className:"h-3 w-24"})}),x.jsx(Os,{className:"px-4 py-3",children:x.jsx(Hu,{className:"ml-auto h-3 w-20"})}),x.jsx(Os,{className:"w-10 py-3 pl-0"})]},n)):t.map(n=>x.jsxs(sg,{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:[x.jsx(Os,{className:"px-4 py-3 font-medium text-foreground",children:n.title}),x.jsx(Os,{className:"px-4 py-3 font-mono text-xs text-muted-foreground",children:n.slug}),x.jsx(Os,{className:"px-4 py-3 text-right text-xs tabular-nums text-muted-foreground",children:ZX(n.updatedAt)}),x.jsxs(Os,{className:"w-10 py-3 pr-4 pl-0 text-right",children:[x.jsx(cx,{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"}),x.jsx("span",{className:"sr-only",children:j("Open")})]})]},n.slug))})]})}function ZA(t,e){const[n,r]=C.useState({}),[o,s]=C.useState(!0),[i,l]=C.useState(!1),[u,d]=C.useState(0),f=C.useRef(0);C.useEffect(()=>{const m=++f.current;s(!0),l(!1),t().then(y=>{m===f.current&&(y===null&&e?l(!0):r(y??{}),s(!1))}).catch(()=>{m===f.current&&(l(!0),s(!1))})},[u]);const h=C.useCallback(()=>d(m=>m+1),[]);return{data:n,setData:r,loading:o,failed:i,retry:h}}function XX({status:t,onToggle:e}){const n=t==="draft";return x.jsxs(Le,{type:"button",variant:"outline",onClick:e,title:j(n?"Draft — publish it":"Published — move back to draft"),className:Ae(n&&"border-dashed text-muted-foreground"),children:[x.jsx("span",{className:Ae("inline-block size-2 rounded-full",n?"bg-muted-foreground/50":"bg-primary")}),j(n?"Draft":"Published")]})}function QX({collection:t,slug:e,onSaved:n,onDeleted:r}){const o=e===null,s=C.useCallback(()=>o?Promise.resolve({}):Ey(t.name,e),[t.name,e,o]),{data:i,setData:l,loading:u,failed:d,retry:f}=ZA(s,!o),[h,m]=C.useState(""),[y,v]=C.useState(!1),[b,k]=C.useState(null),[E,_]=C.useState(!1),T=(O,W)=>l(Z=>{const J={...Z};return W===""||W===void 0?delete J[O]:J[O]=W,J}),N=C.useMemo(()=>S_(t.fields,i),[i,t.fields]),M=o?Tp(h||String(i.title??"entry")):e,D=async()=>{k(null),v(!0);try{if(o&&await Ey(t.name,M)){const W=j('"{slug}" already exists — pick a different slug.',{slug:M});k(W),Yt.error(W);return}const O=await nX(t.name,M,i);Yt.success(j('"{slug}" saved',{slug:O})),n(O)}finally{v(!1)}},I=async()=>{o||(await rX(t.name,e),Yt.success(j('"{slug}" deleted',{slug:e})),r())},P=t.label??t.name;return u?x.jsxs(ti,{children:[x.jsx(ni,{title:P,subtitle:x.jsx(Gf,{children:`${t.name}/…`})}),x.jsx(nl,{children:x.jsx(GA,{})})]}):d?x.jsxs(ti,{children:[x.jsx(ni,{title:P,subtitle:x.jsx(Gf,{children:`${t.name}/${e}.json`})}),x.jsx(nl,{children:x.jsx(JA,{onRetry:f,onBack:r})})]}):x.jsxs(ti,{children:[x.jsx(ni,{title:P,badge:o?x.jsx(si,{variant:"secondary",className:"font-normal",children:j("new")}):void 0,subtitle:x.jsx(Gf,{children:`${t.name}/${M}.json`}),actions:x.jsxs(x.Fragment,{children:[x.jsx(XX,{status:bw(i),onToggle:()=>T(C_,bw(i)==="draft"?"":"draft")}),x.jsxs(Le,{variant:E?"secondary":"outline",onClick:()=>_(O=>!O),children:[x.jsx(El,{})," JSON"]}),!o&&x.jsxs(Le,{variant:"destructive",onClick:I,children:[x.jsx(p_,{})," ",j("Delete")]}),x.jsx(Le,{onClick:D,disabled:y||!N.ok,children:j(y?"Saving…":"Save")})]})}),x.jsxs(nl,{children:[b&&x.jsx(Dv,{title:j("Could not save"),children:b}),E&&x.jsx(KA,{path:`${t.name}/${M}.json`,data:i}),x.jsxs(rm,{children:[o&&x.jsxs("div",{className:"mb-6 rounded-lg border bg-muted/40 p-4",children:[x.jsx(Rv,{label:j("File name"),hint:`${M}.json`,children:x.jsx(Qt,{value:h,onChange:O=>m(O.target.value),placeholder:j("automatic"),className:"bg-card font-mono"})}),x.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:j("Leave it empty to derive it from the title. It cannot change after saving.")})]}),x.jsx("div",{className:"space-y-6",children:t.fields.map(O=>x.jsx(XA,{field:O,value:i[O.key],onChange:T,context:t.label??t.name},O.key))})]}),x.jsx(YA,{result:N})]})]})}function eQ({singleton:t}){const e=C.useCallback(()=>BA(t.name),[t.name]),{data:n,setData:r,loading:o,failed:s,retry:i}=ZA(e,!1),[l,u]=C.useState(!1),[d,f]=C.useState(!1),h=(k,E)=>r(_=>{const T={..._};return E===""||E===void 0?delete T[k]:T[k]=E,T}),m=C.useMemo(()=>S_(t.fields,n),[n,t.fields]),y=async()=>{u(!0);try{await sX(t.name,n),Yt.success(j("{name} saved",{name:t.label??t.name}))}finally{u(!1)}},v=t.label??t.name,b=x.jsx(si,{variant:"secondary",className:"font-normal",children:j("singleton")});return o?x.jsxs(ti,{children:[x.jsx(ni,{title:v,badge:b}),x.jsx(nl,{children:x.jsx(GA,{})})]}):s?x.jsxs(ti,{children:[x.jsx(ni,{title:v,badge:b}),x.jsx(nl,{children:x.jsx(JA,{onRetry:i})})]}):x.jsxs(ti,{children:[x.jsx(ni,{title:v,badge:b,subtitle:x.jsx(Gf,{children:`${t.name}.json`}),actions:x.jsxs(x.Fragment,{children:[x.jsxs(Le,{variant:d?"secondary":"outline",onClick:()=>f(k=>!k),children:[x.jsx(El,{})," JSON"]}),x.jsx(Le,{onClick:y,disabled:l||!m.ok,children:j(l?"Saving…":"Save")})]})}),x.jsxs(nl,{children:[d&&x.jsx(KA,{path:`${t.name}.json`,data:n}),x.jsx(rm,{children:x.jsx("div",{className:"space-y-6",children:t.fields.map(k=>x.jsx(XA,{field:k,value:n[k.key],onChange:h,context:t.label??t.name},k.key))})}),x.jsx(YA,{result:m})]})]})}function Dv({title:t,tone:e="error",children:n}){const r=e==="error";return x.jsxs("div",{className:Ae("rounded-xl border p-4",r?"border-destructive/30 bg-destructive/5":"border-border bg-muted/40"),children:[x.jsxs("div",{className:Ae("flex items-center gap-2 text-sm font-medium",r?"text-destructive":"text-foreground"),children:[x.jsx(hx,{className:"h-4 w-4 shrink-0"}),t]}),x.jsx("div",{className:"mt-2.5 text-sm text-muted-foreground",children:n})]})}function YA({result:t}){if(t.issues.length===0)return null;const e=t.issues.some(n=>n.level==="error");return x.jsx(Dv,{tone:e?"error":"warning",title:j(e?"Fix these before saving":"Warnings"),children:x.jsx("ul",{className:"space-y-2",children:t.issues.map(n=>x.jsxs("li",{className:"flex items-start gap-2.5",children:[x.jsx("span",{"aria-hidden":!0,className:Ae("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",n.level==="error"?"bg-destructive":"bg-muted-foreground/50")}),x.jsx("span",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-xs text-foreground",children:n.key}),x.jsx("span",{className:"min-w-0",children:j(n.message)})]},`${n.key}-${n.message}`))})})}function Rv({label:t,required:e,type:n,hint:r,actions:o,children:s}){var l;const i=n?(l=_v[n])==null?void 0:l.icon:null;return x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&x.jsx(i,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"}),x.jsx(vu,{className:"text-sm font-medium text-foreground",children:t}),e&&x.jsx("span",{className:"text-destructive","aria-hidden":!0,children:"*"}),r&&x.jsx("span",{className:"ml-auto truncate font-mono text-xs text-primary",children:r}),o&&x.jsx("span",{className:r?"":"ml-auto",children:o})]}),s]})}const tQ=new Set(["text","richtext"]);function XA({field:t,value:e,onChange:n,context:r}){const[o,s]=C.useState(0),i=l=>{n(t.key,l),t.type==="richtext"&&s(u=>u+1)};return x.jsx(Rv,{label:t.label||t.key,required:t.required,type:t.type,actions:tQ.has(t.type)?x.jsx(jX,{context:r,fieldLabel:t.label||t.key,currentValue:typeof e=="string"?e:"",richtext:t.type==="richtext",onResult:i}):void 0,children:x.jsx(QA,{field:t,value:e,onChange:n,richtextKey:o})})}function QA({field:t,value:e,onChange:n,richtextKey:r}){const o=t.key;switch(t.type){case"richtext":return x.jsx(XJ,{value:e??"",onChange:s=>n(o,s)},r);case"number":return x.jsx(Qt,{type:"number",value:e===void 0?"":String(e),onChange:s=>n(o,s.target.value===""?"":Number(s.target.value))});case"boolean":return x.jsx(Le,{type:"button",variant:e?"default":"outline",role:"switch","aria-checked":!!e,onClick:()=>n(o,!e),className:"min-w-20",children:j(e?"Yes":"No")});case"date":return x.jsx(Qt,{type:"date",className:"w-[240px]",value:e??"",onChange:s=>n(o,s.target.value)});case"select":return x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Yu,{value:e||void 0,onValueChange:s=>n(o,s),children:[x.jsx(Qu,{className:"w-[240px]",children:x.jsx(Xu,{placeholder:j("Select…")})}),x.jsx(ec,{children:(t.options??[]).map(s=>x.jsx(tc,{value:s,children:s},s))})]}),e?x.jsxs(Le,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>n(o,""),className:"text-muted-foreground",children:[x.jsx(ha,{}),x.jsx("span",{className:"sr-only",children:j("Clear")})]}):null]});case"relation":return x.jsx(sQ,{field:t,value:e,onChange:n});case"image":return x.jsx(aQ,{value:e,onChange:s=>n(o,s)});case"url":return x.jsx(Qt,{type:"url",inputMode:"url",placeholder:"https://…",value:e??"",onChange:s=>n(o,s.target.value)});case"email":return x.jsx(Qt,{type:"email",inputMode:"email",placeholder:"name@example.com",value:e??"",onChange:s=>n(o,s.target.value)});case"color":return x.jsx(nQ,{value:e,onChange:s=>n(o,s)});case"list":return x.jsx(rQ,{value:e,onChange:s=>n(o,s)});case"group":return x.jsx(oQ,{field:t,value:e,onChange:s=>n(o,s)});default:return x.jsx(Qt,{value:e??"",onChange:s=>n(o,s.target.value)})}}function nQ({value:t,onChange:e}){const n=typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t)?t:"";return x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs("label",{className:"relative size-9 shrink-0 cursor-pointer overflow-hidden rounded-lg border shadow-sm",children:[x.jsx("span",{className:"block size-full",style:{backgroundColor:n||"#ffffff"}}),x.jsx("input",{type:"color",value:n||"#000000",onChange:r=>e(r.target.value),className:"absolute inset-0 cursor-pointer opacity-0","aria-label":j("Pick a color")})]}),x.jsx(Qt,{className:"w-[140px] font-mono",placeholder:"#000000",value:t??"",onChange:r=>e(r.target.value)}),t?x.jsxs(Le,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>e(""),className:"text-muted-foreground",children:[x.jsx(ha,{}),x.jsx("span",{className:"sr-only",children:j("Clear")})]}):null]})}function rQ({value:t,onChange:e}){const n=Array.isArray(t)?t:[],[r,o]=C.useState(""),s=()=>{const l=r.trim();if(!l||n.includes(l)){o("");return}e([...n,l]),o("")},i=l=>{const u=n.filter((d,f)=>f!==l);e(u.length?u:"")};return x.jsxs("div",{className:"space-y-2.5",children:[n.length>0&&x.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map((l,u)=>x.jsxs(si,{variant:"secondary",className:"gap-1 pr-1",children:[l,x.jsx("button",{type:"button",onClick:()=>i(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":j("Remove {item}",{item:l}),children:x.jsx(ha,{className:"h-3 w-3"})})]},l))}),x.jsx(Qt,{value:r,onChange:l=>o(l.target.value),onKeyDown:l=>{(l.key==="Enter"||l.key===",")&&(l.preventDefault(),s())},onBlur:s,placeholder:j("Type and press Enter…")})]})}function oQ({field:t,value:e,onChange:n}){const r=e&&typeof e=="object"&&!Array.isArray(e)?e:{},o=(s,i)=>{const l={...r};i===""||i===void 0?delete l[s]:l[s]=i,n(Object.keys(l).length?l:"")};return x.jsx("div",{className:"space-y-5 rounded-lg border border-dashed bg-muted/20 p-4",children:(t.fields??[]).map(s=>x.jsx(Rv,{label:s.label||s.key,required:s.required,type:s.type,children:x.jsx(QA,{field:s,value:r[s.key],onChange:o})},s.key))})}function sQ({field:t,value:e,onChange:n}){const[r,o]=C.useState([]),s=Array.isArray(e)?e:[];C.useEffect(()=>{t.to&&tX(t.to).then(o).catch(()=>o([]))},[t.to]);const i=u=>n(t.key,u.length?u:""),l=u=>{i(s.includes(u)?s.filter(d=>d!==u):[...s,u])};return r.length===0?x.jsx("p",{className:"rounded-lg border border-dashed bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground",children:j("No entries in “{name}”.",{name:t.to??""})}):x.jsxs("div",{className:"space-y-2.5",children:[s.length>0&&x.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(u=>x.jsxs(si,{variant:"secondary",className:"gap-1 pr-1 font-mono",children:[u,x.jsx("button",{type:"button",onClick:()=>l(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":j("Remove the link to {slug}",{slug:u}),children:x.jsx(ha,{className:"h-3 w-3"})})]},u))}),x.jsxs(g_,{children:[x.jsx(y_,{asChild:!0,children:x.jsxs(Le,{variant:"outline",children:[x.jsx(d_,{})," ",j("Add link")]})}),x.jsxs(x_,{align:"start",className:"max-h-72 w-56 overflow-y-auto",children:[x.jsx(T1,{children:j("Entries in “{name}”",{name:t.to??""})}),x.jsx(xu,{}),r.map(u=>x.jsx(v_,{checked:s.includes(u),onCheckedChange:()=>l(u),onSelect:d=>d.preventDefault(),className:"font-mono text-xs",children:u},u))]})]})]})}async function iQ(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 l=i.getContext("2d");if(!l)throw new Error("no canvas context");l.drawImage(n,0,0,o,s);const u=await new Promise(h=>i.toBlob(h,"image/webp",.85));if(!u)throw new Error("conversion failed");const d=new Uint8Array(await u.arrayBuffer());let f="";for(const h of d)f+=String.fromCharCode(h);return btoa(f)}function aQ({value:t,onChange:e}){const[n,r]=C.useState(!1),o=typeof t=="string"?t:"",s=o?`/media/${o.split("/").pop()}`:null,i=async l=>{r(!0);try{e(await oX(await iQ(l),l.name)),Yt.success(j("Image uploaded"))}finally{r(!1)}};return x.jsxs("div",{className:"flex items-center gap-4 rounded-lg border bg-muted/30 p-3",children:[x.jsx("div",{className:Ae("flex h-24 w-24 shrink-0 items-center justify-center overflow-hidden rounded-lg border bg-card",!s&&"border-dashed"),children:s?x.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):x.jsx(c_,{className:"h-6 w-6 text-muted-foreground/60"})}),x.jsxs("div",{className:"min-w-0 space-y-2",children:[x.jsxs("label",{className:Ae(ax({variant:"outline"}),"cursor-pointer bg-card"),children:[x.jsx(m_,{}),j(n?"Uploading…":"Upload image"),x.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:l=>{var d;const u=(d=l.target.files)==null?void 0:d[0];u&&i(u)}})]}),o&&x.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[x.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:o}),x.jsx(Le,{type:"button",variant:"ghost",size:"xs",onClick:()=>e(""),className:"text-muted-foreground hover:text-destructive",children:j("remove")})]})]})]})}const eN=document.getElementById("root");if(!eN)throw new Error("no root element");t5.createRoot(eN).render(x.jsx(C.StrictMode,{children:x.jsx(FX,{})}));
|