poro-editor 1.0.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/dist/AlignMenu.d.ts +5 -0
- package/dist/BubbleMenuContent.d.ts +5 -0
- package/dist/ColorPickerButton.d.ts +6 -0
- package/dist/CustomHeading.d.ts +2 -0
- package/dist/CustomImage.d.ts +3 -0
- package/dist/EmojiPicker.d.ts +4 -0
- package/dist/FloatingMenuContent.d.ts +5 -0
- package/dist/FontSizeSelector.d.ts +4 -0
- package/dist/HeadingSelector.d.ts +4 -0
- package/dist/HtmlPreview.d.ts +5 -0
- package/dist/ImageMenu.d.ts +5 -0
- package/dist/ImagePaste.d.ts +3 -0
- package/dist/ImagePlaceholder.d.ts +6 -0
- package/dist/ImageToolbar.d.ts +4 -0
- package/dist/ImageView.d.ts +8 -0
- package/dist/LinkButton.d.ts +4 -0
- package/dist/MenuBar.d.ts +4 -0
- package/dist/MenuButton.d.ts +8 -0
- package/dist/OutlineExtension.d.ts +3 -0
- package/dist/OutlineNodeView.d.ts +7 -0
- package/dist/PasteMarkdown.d.ts +2 -0
- package/dist/SourceCodeViewer.d.ts +5 -0
- package/dist/TableBubbleMenu.d.ts +4 -0
- package/dist/TableMenu.d.ts +5 -0
- package/dist/VariableExtension.d.ts +3 -0
- package/dist/VariableNodeView.d.ts +4 -0
- package/dist/VariablePanel.d.ts +5 -0
- package/dist/config.d.ts +27 -0
- package/dist/imageUpload.d.ts +14 -0
- package/dist/index.d.ts +8 -0
- package/dist/locales/index.d.ts +452 -0
- package/dist/menuBarState.d.ts +30 -0
- package/dist/poro-editor.css +1 -0
- package/dist/poro-editor.js +58619 -0
- package/dist/poro-editor.js.map +1 -0
- package/dist/poro-editor.umd.cjs +563 -0
- package/dist/poro-editor.umd.cjs.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
(function(Yn,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],w):(Yn=typeof globalThis<"u"?globalThis:Yn||self,w(Yn.PoroEditor={},Yn.React,Yn.ReactDOM))})(this,(function(Yn,w,En){"use strict";var oee=Object.defineProperty;var iee=(Yn,w,En)=>w in Yn?oee(Yn,w,{enumerable:!0,configurable:!0,writable:!0,value:En}):Yn[w]=En;var nn=(Yn,w,En)=>iee(Yn,typeof w!="symbol"?w+"":w,En);var lh;function h0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const g=h0(w),p0=h0(En);function LI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mc={exports:{}},Us={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and 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 m0;function jI(){if(m0)return Us;m0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var a=null;if(i!==void 0&&(a=""+i),o.key!==void 0&&(a=""+o.key),"key"in o){i={};for(var s in o)s!=="key"&&(i[s]=o[s])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:i}}return Us.Fragment=t,Us.jsx=n,Us.jsxs=n,Us}var qs={},g0;function zI(){if(g0)return qs;g0=1;var e={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and 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
|
+
*/return e.NODE_ENV!=="production"&&(function(){function t(j){if(j==null)return null;if(typeof j=="function")return j.$$typeof===I?null:j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case b:return"Fragment";case C:return"Profiler";case y:return"StrictMode";case $:return"Suspense";case O:return"SuspenseList";case T:return"Activity"}if(typeof j=="object")switch(typeof j.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case m:return"Portal";case S:return j.displayName||"Context";case x:return(j._context.displayName||"Context")+".Consumer";case E:var D=j.render;return j=j.displayName,j||(j=D.displayName||D.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case k:return D=j.displayName||null,D!==null?D:t(j.type)||"Memo";case M:D=j._payload,j=j._init;try{return t(j(D))}catch{}}return null}function n(j){return""+j}function r(j){try{n(j);var D=!1}catch{D=!0}if(D){D=console;var H=D.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return H.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),n(j)}}function o(j){if(j===b)return"<>";if(typeof j=="object"&&j!==null&&j.$$typeof===M)return"<...>";try{var D=t(j);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function i(){var j=R.A;return j===null?null:j.getOwner()}function a(){return Error("react-stack-top-frame")}function s(j){if(N.call(j,"key")){var D=Object.getOwnPropertyDescriptor(j,"key").get;if(D&&D.isReactWarning)return!1}return j.key!==void 0}function l(j,D){function H(){_||(_=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}H.isReactWarning=!0,Object.defineProperty(j,"key",{get:H,configurable:!0})}function c(){var j=t(this.type);return B[j]||(B[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function u(j,D,H,W,q,te){var G=H.ref;return j={$$typeof:v,type:j,key:D,props:H,_owner:W},(G!==void 0?G:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:c}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function d(j,D,H,W,q,te){var G=D.children;if(G!==void 0)if(W)if(P(G)){for(W=0;W<G.length;W++)f(G[W]);Object.freeze&&Object.freeze(G)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(G);if(N.call(D,"key")){G=t(j);var re=Object.keys(D).filter(function(ne){return ne!=="key"});W=0<re.length?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}",K[G+W]||(re=0<re.length?"{"+re.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,W,G,re,G),K[G+W]=!0)}if(G=null,H!==void 0&&(r(H),G=""+H),s(D)&&(r(D.key),G=""+D.key),"key"in D){H={};for(var oe in D)oe!=="key"&&(H[oe]=D[oe])}else H=D;return G&&l(H,typeof j=="function"?j.displayName||j.name||"Unknown":j),u(j,G,H,i(),q,te)}function f(j){h(j)?j._store&&(j._store.validated=1):typeof j=="object"&&j!==null&&j.$$typeof===M&&(j._payload.status==="fulfilled"?h(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function h(j){return typeof j=="object"&&j!==null&&j.$$typeof===v}var p=w,v=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),R=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,P=Array.isArray,A=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(j){return j()}};var _,B={},F=p.react_stack_bottom_frame.bind(p,a)(),U=A(o(a)),K={};qs.Fragment=b,qs.jsx=function(j,D,H){var W=1e4>R.recentlyCreatedOwnerStacks++;return d(j,D,H,!1,W?Error("react-stack-top-frame"):F,W?A(o(j)):U)},qs.jsxs=function(j,D,H){var W=1e4>R.recentlyCreatedOwnerStacks++;return d(j,D,H,!0,W?Error("react-stack-top-frame"):F,W?A(o(j)):U)}})(),qs}var v0;function BI(){if(v0)return Mc.exports;v0=1;var e={};return e.NODE_ENV==="production"?Mc.exports=jI():Mc.exports=zI(),Mc.exports}var L=BI(),Nc={exports:{}},hh={};/**
|
|
23
|
+
* @license React
|
|
24
|
+
* use-sync-external-store-shim.production.js
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the MIT license found in the
|
|
29
|
+
* LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/var b0;function FI(){if(b0)return hh;b0=1;var e=w;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),v=p[0].inst,m=p[1];return i(function(){v.value=h,v.getSnapshot=f,l(v)&&m({inst:v})},[d,h,f]),o(function(){return l(v)&&m({inst:v}),d(function(){l(v)&&m({inst:v})})},[d]),a(h),h}function l(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,hh}var ph={},y0;function HI(){if(y0)return ph;y0=1;var e={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* use-sync-external-store-shim.development.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/return e.NODE_ENV!=="production"&&(function(){function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}function n(p,v){d||i.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=v();if(!f){var b=v();a(m,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}b=s({inst:{value:m,getSnapshot:v}});var y=b[0].inst,C=b[1];return c(function(){y.value=m,y.getSnapshot=v,r(y)&&C({inst:y})},[p,m,v]),l(function(){return r(y)&&C({inst:y}),p(function(){r(y)&&C({inst:y})})},[p]),u(m),m}function r(p){var v=p.getSnapshot;p=p.value;try{var m=v();return!a(p,m)}catch{return!0}}function o(p,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=w,a=typeof Object.is=="function"?Object.is:t,s=i.useState,l=i.useEffect,c=i.useLayoutEffect,u=i.useDebugValue,d=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:n;ph.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),ph}var C0;function mh(){if(C0)return Nc.exports;C0=1;var e={};return e.NODE_ENV==="production"?Nc.exports=FI():Nc.exports=HI(),Nc.exports}var S0=mh();function Wn(e){this.content=e}Wn.prototype={constructor:Wn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return o==-1?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Wn(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Wn(n)},addToStart:function(e,t){return new Wn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Wn(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(i==-1?o.length:i,0,t,n),new Wn(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Wn.from(e),e.size?new Wn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Wn.from(e),e.size?new Wn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Wn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Wn.from=function(e){if(e instanceof Wn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Wn(t)};function x0(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){let a=x0(o.content,i.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function w0(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let a=e.child(--o),s=t.child(--i),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,u=Math.min(a.text.length,s.text.length);for(;c<u&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=w0(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class be{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,o=0,i){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,o+s,i||null,a)!==!1&&l.content.size){let u=s+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,o+u)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?o?typeof o=="function"?o(s):o:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:i+=r),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new be(o,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],o=0;if(n>t)for(let i=0,a=0;a<n;i++){let s=this.content[i],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=l}return new be(r,o)}cutByIndex(t,n){return t==n?be.empty:t==0&&n==this.content.length?this:new be(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new be(o,i)}addToStart(t){return new be([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new be(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];t(o,r,n),r+=o.nodeSize}}findDiffStart(t,n=0){return x0(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return w0(this,t,n,r)}findIndex(t){if(t==0)return Tc(0,t);if(t==this.size)return Tc(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=t)return i==t?Tc(n+1,i):Tc(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return be.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new be(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return be.empty;let n,r=0;for(let o=0;o<t.length;o++){let i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new be(n||t,r)}static from(t){if(!t)return be.empty;if(t instanceof be)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new be([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}be.empty=new be([],0);const gh={index:0,offset:0};function Tc(e,t){return gh.index=e,gh.offset=t,gh}function Ic(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Ic(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Ic(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let rn=class c0{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,o));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ic(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.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(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return c0.none;if(t instanceof c0)return[t];let n=t.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};rn.none=[];class Pc extends Error{}class He{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=$0(this.content,t+this.openStart,n);return r&&new He(r,this.openStart,this.openEnd)}removeBetween(t,n){return new He(E0(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return He.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 He(be.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new He(t,r,o)}}He.empty=new He(be.empty,0,0);function E0(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(o==t||i.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(E0(i.content,t-o-1,n-o-1)))}function $0(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),a=e.maybeChild(o);if(i==t||a.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=$0(a.content,t-i-1,n,a);return s&&e.replaceChild(o,a.copy(s))}function VI(e,t,n){if(n.openStart>e.depth)throw new Pc("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Pc("Inconsistent open depths");return O0(e,t,n,0)}function O0(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let a=O0(e,t,n,r+1);return i.copy(i.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Xi(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=WI(n,e);return Xi(i,M0(e,a,s,t,r))}else return Xi(i,Ac(e,t,r))}function k0(e,t){if(!t.type.compatibleContent(e.type))throw new Pc("Cannot join "+t.type.name+" onto "+e.type.name)}function vh(e,t,n){let r=e.node(n);return k0(r,t.node(n)),r}function Gi(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ks(e,t,n,r){let o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Gi(e.nodeAfter,r),i++));for(let s=i;s<a;s++)Gi(o.child(s),r);t&&t.depth==n&&t.textOffset&&Gi(t.nodeBefore,r)}function Xi(e,t){return e.type.checkContent(t),e.copy(t)}function M0(e,t,n,r,o){let i=e.depth>o&&vh(e,t,o+1),a=r.depth>o&&vh(n,r,o+1),s=[];return Ks(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(k0(i,a),Gi(Xi(i,M0(e,t,n,r,o+1)),s)):(i&&Gi(Xi(i,Ac(e,t,o+1)),s),Ks(t,n,o,s),a&&Gi(Xi(a,Ac(n,r,o+1)),s)),Ks(r,null,o,s),new be(s)}function Ac(e,t,n){let r=[];if(Ks(null,e,n,r),e.depth>n){let o=vh(e,t,n+1);Gi(Xi(o,Ac(e,t,n+1)),r)}return Ks(t,null,n,r),new be(r)}function WI(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(be.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Gs{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)o+=r.child(i).nodeSize;return o}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return rn.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),o=t.maybeChild(n);if(!r){let s=r;r=o,o=s}let i=r.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!o||!i[a].isInSet(o.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Rc(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(i),c=i-l;if(r.push(a,s,o+l),!c||(a=a.child(s),a.isText))break;i=c-1,o+=l+1}return new Gs(n,r,i)}static resolveCached(t,n){let r=N0.get(t);if(r)for(let i=0;i<r.elts.length;i++){let a=r.elts[i];if(a.pos==n)return a}else N0.set(t,r=new UI);let o=r.elts[r.i]=Gs.resolve(t,n);return r.i=(r.i+1)%qI,o}}class UI{constructor(){this.elts=[],this.i=0}}const qI=12,N0=new WeakMap;class Rc{constructor(t,n,r){this.$from=t,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 KI=Object.create(null);let li=class u0{constructor(t,n,r,o=rn.none){this.type=t,this.attrs=n,this.marks=o,this.content=r||be.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,o=0){this.content.nodesBetween(t,n,r,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,o){return this.content.textBetween(t,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Ic(this.attrs,n||t.defaultAttrs||KI)&&rn.sameSet(this.marks,r||rn.none)}copy(t=null){return t==this.content?this:new u0(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new u0(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return He.empty;let o=this.resolve(t),i=this.resolve(n),a=r?0:o.sharedDepth(n),s=o.start(a),c=o.node(a).content.cut(o.pos-s,i.pos-s);return new He(c,o.depth-a,i.depth-a)}replace(t,n,r){return VI(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(o==t||n.isText)return n;t-=o+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)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(t){return Gs.resolveCached(this,t)}resolveNoCache(t){return Gs.resolve(this,t)}rangeHasMark(t,n,r){let o=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),T0(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=be.empty,o=0,i=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,o,i),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(t).matchType(r),a=i&&i.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=rn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!rn.sameSet(t,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 t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,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(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=be.fromJSON(t,n.content),i=t.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};li.prototype.text=void 0;class _c extends li{constructor(t,n,r,o){if(super(t,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):T0(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new _c(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _c(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function T0(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Yi{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new GI(t,n);if(r.next==null)return Yi.empty;let o=I0(r);r.next&&r.err("Unexpected trailing text");let i=tP(eP(o));return nP(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(t.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let o=[this];function i(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return be.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:u,next:d}=a.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,s.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(t)){let a=[];for(let s=o;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:s,next:l}=i.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!o.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:o}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o<r.next.length;o++)t.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),t.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)i+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return i}).join(`
|
|
39
|
+
`)}}Yi.empty=new Yi(!0);class GI{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function I0(e){let t=[];do t.push(XI(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function XI(e){let t=[];do t.push(YI(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function YI(e){let t=ZI(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=JI(e,t);else break;return t}function P0(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function JI(e,t){let n=P0(e),r=n;return e.eat(",")&&(e.next!="}"?r=P0(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function QI(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let a=n[i];a.isInGroup(t)&&o.push(a)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function ZI(e){if(e.eat("(")){let t=I0(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=QI(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function eP(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,l){let c={term:l,to:s};return t[a].push(c),c}function o(a,s){a.forEach(l=>l.to=s)}function i(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(i(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=i(a.exprs[l],s);if(l==a.exprs.length-1)return c;o(c,s=n())}else if(a.type=="star"){let l=n();return r(s,l),o(i(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return o(i(a.expr,s),l),o(i(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(i(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let u=n();o(i(a.expr,l),u),l=u}if(a.max==-1)o(i(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let u=n();r(l,u),o(i(a.expr,l),u),l=u}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function A0(e,t){return t-e}function R0(e,t){let n=[];return r(t),n.sort(A0);function r(o){let i=e[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let a=0;a<i.length;a++){let{term:s,to:l}=i[a];!s&&n.indexOf(l)==-1&&r(l)}}}function tP(e){let t=Object.create(null);return n(R0(e,0));function n(r){let o=[];r.forEach(a=>{e[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let u=0;u<o.length;u++)o[u][0]==s&&(c=o[u][1]);R0(e,l).forEach(u=>{c||o.push([s,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[r.join(",")]=new Yi(r.indexOf(e.length-1)>-1);for(let a=0;a<o.length;a++){let s=o[a][1].sort(A0);i.next.push({type:o[a][0],next:t[s.join(",")]||n(s)})}return i}}function nP(e,t){for(let n=0,r=[e];n<r.length;n++){let o=r[n],i=!o.validEnd,a=[];for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];a.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _0(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function D0(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(o===void 0){let i=e[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function L0(e,t,n,r){for(let o in t)if(!(o in e))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in e){let i=e[o];i.validate&&i.validate(t[o])}}function j0(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new oP(e,r,t[r]);return n}let z0=class NI{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=j0(t,r.attrs),this.defaultAttrs=_0(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:D0(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new li(this,this.computeAttrs(t),be.from(n),rn.setFrom(r))}createChecked(t=null,n,r){return n=be.from(n),this.checkContent(n),new li(this,this.computeAttrs(t),n,rn.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=be.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(be.empty,!0);return i?new li(this,t,n.append(i),rn.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){L0(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:rn.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,a)=>r[i]=new NI(i,n,a));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function rP(e,t,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}class oP{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?rP(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dc{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=j0(t,o.attrs),this.excluded=null;let i=_0(this.attrs);this.instance=i?new rn(this,i):null}create(t=null){return!t&&this.instance?this.instance:new rn(this,D0(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,a)=>r[i]=new Dc(i,o++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){L0(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}let B0=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Wn.from(t.nodes),n.marks=Wn.from(t.marks||{}),this.nodes=z0.compile(this.spec.nodes,this),this.marks=Dc.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],a=i.spec.content||"",s=i.spec.marks;if(i.contentMatch=r[a]||(r[a]=Yi.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=s=="_"?null:s?F0(this,s.split(" ")):s==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],a=i.spec.excludes;i.excluded=a==null?[i]:a==""?[]:F0(this,a.split(" "))}this.nodeFromJSON=o=>li.fromJSON(this,o),this.markFromJSON=o=>rn.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof z0){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new _c(r,r.defaultAttrs,t,rn.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function F0(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(let s in e.marks){let l=e.marks[s];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function iP(e){return e.tag!=null}function aP(e){return e.style!=null}class Bo{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(iP(o))this.tags.push(o);else if(aP(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=t.nodes[o.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new U0(this,n,!1);return r.addAll(t,rn.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new U0(this,n,!0);return r.addAll(t,rn.none,n.from,n.to),He.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(cP(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let a=i.getAttrs(t);if(a===!1)continue;i.attrs=a||void 0}return i}}}matchStyle(t,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let a=this.styles[i],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<i)break}n.splice(a,0,o)}for(let o in t.marks){let i=t.marks[o].spec.parseDOM;i&&i.forEach(a=>{r(a=q0(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(a=>{r(a=q0(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Bo(t,Bo.schemaRules(t)))}}const H0={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},sP={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},V0={ol:!0,ul:!0},Xs=1,bh=2,Ys=4;function W0(e,t,n){return t!=null?(t?Xs:0)|(t==="full"?bh:0):e&&e.whitespace=="pre"?Xs|bh:n&~Ys}class Lc{constructor(t,n,r,o,i,a){this.type=t,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=rn.none,this.match=i||(a&Ys?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(be.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Xs)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=be.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(be.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!H0.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class U0{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,a=W0(null,n.preserveWhitespace,0)|(r?Ys:0);o?i=new Lc(o.type,o.attrs,rn.none,!0,n.topMatch||o.type.contentMatch,a):r?i=new Lc(null,null,rn.none,!0,null,a):i=new Lc(t.schema.topNodeType,null,rn.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,o=this.top,i=o.options&bh?"full":this.localPreserveWS||(o.options&Xs)>0,{schema:a}=this.parser;if(i==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
40
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let s=r.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(a.linebreakReplacement.create(),n,!0),s[l]&&this.insertNode(a.text(s[l]),n,!/\S/.test(s[l]));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 s=o.content[o.content.length-1],l=t.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let o=this.localPreserveWS,i=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),s;V0.hasOwnProperty(a)&&this.parser.normalizeLists&&lP(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:sP.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,u=this.needsBlock;if(H0.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let d=l&&l.skip?n:this.readStyles(t,n);d&&this.addAll(t,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=o}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
41
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],a=r.getPropertyValue(i);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(i,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(t,n,r,o){let i,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(t);else if(o)this.addElement(t,r,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}i&&this.sync(s)&&this.open--}addAll(t,n,r,o){let i=r||0;for(let a=r?t.childNodes[r]:t.firstChild,s=o==null?null:t.childNodes[o];a!=s;a=a.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(a,n);this.findAtPoint(t,i)}findPlace(t,n,r){let o,i;for(let a=this.open,s=0;a>=0;a--){let l=this.nodes[a],c=l.findWrapping(t);if(c&&(!o||o.length>c.length+s)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;s+=2}}if(!o)return null;this.sync(i);for(let a=0;a<o.length;a++)n=this.enterInner(o[a],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(t,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let a=rn.none;for(let s of o.concat(t.marks))(i.type?i.type.allowsMarkType(s.type):K0(s.type,t.type))&&(a=s.addToSet(a));return i.content.push(t.mark(a)),!0}return!1}enter(t,n,r,o){let i=this.findPlace(t.create(n),r,!1);return i&&(i=this.enterInner(t,n,r,!0,o)),i}enterInner(t,n,r,o=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let s=W0(t,i,a.options);a.options&Ys&&a.content.length==0&&(s|=Ys);let l=rn.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):K0(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Lc(t,n,l,o,null,s)),this.open++,r}closeExtra(t=!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(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Xs)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&t.nodeType==1&&t.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=(s,l)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;l>=i;l--)if(a(s-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.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 lP(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&V0.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function cP(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function q0(e){let t={};for(let n in e)t[n]=e[n];return t}function K0(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],a=s=>{i.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:u}=s.edge(l);if(c==t||i.indexOf(u)<0&&a(u))return!0}};if(a(o.contentMatch))return!0}}class Ji{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=yh(n).createDocumentFragment());let o=r,i=[];return t.forEach(a=>{if(i.length||a.marks.length){let s=0,l=0;for(;s<i.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<i.length;)o=i.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],u=this.serializeMark(c,a.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:o}=jc(yh(n),this.nodes[t.type.name](t),null,t.attrs);if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let o=t.marks.length-1;o>=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&jc(yh(r),o(t,n),null,t.attrs)}static renderSpec(t,n,r=null,o){return jc(t,n,r,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ji(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=G0(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return G0(t.marks)}}function G0(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function yh(e){return e.document||window.document}const X0=new WeakMap;function uP(e){let t=X0.get(e);return t===void 0&&X0.set(e,t=dP(e)),t}function dP(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.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(e),t}function jc(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let o=t[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=uP(r))&&i.indexOf(t)>-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 a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let s,l=n?e.createElementNS(n,o):e.createElement(o),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<t.length;d++){let f=t[d];if(f===0){if(d<t.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=jc(e,f,n,r);if(l.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}const Y0=65535,J0=Math.pow(2,16);function fP(e,t){return e+t*J0}function Q0(e){return e&Y0}function hP(e){return(e-(e&Y0))/J0}const Z0=1,ey=2,zc=4,ty=8;class Ch{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ty)>0}get deletedBefore(){return(this.delInfo&(Z0|zc))>0}get deletedAfter(){return(this.delInfo&(ey|zc))>0}get deletedAcross(){return(this.delInfo&zc)>0}}class vr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&vr.empty)return vr.empty}recover(t){let n=0,r=Q0(t);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+hP(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let o=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?o:0);if(l>t)break;let c=this.ranges[s+i],u=this.ranges[s+a],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:n:n,h=l+o+(f<0?0:u);if(r)return h;let p=t==(n<0?l:d)?null:fP(s/3,t-l),v=t==l?ey:t==d?Z0:zc;return(n<0?t!=l:t!=d)&&(v|=ty),new Ch(h,v,p)}o+=u-c}return r?t+o:new Ch(t+o,0,null)}touches(t,n){let r=0,o=Q0(n),i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+i],u=l+c;if(t<=u&&s==o*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let a=this.ranges[o],s=a-(this.inverted?i:0),l=a+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];t(s,s+c,l,l+u),i+=u-c}}invert(){return new vr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?vr.empty:new vr(t<0?[0,-t,0]:[0,0,t])}}vr.empty=new vr([]);class Js{constructor(t,n,r=0,o=t?t.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Js(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let o=t.getMirror(n);this.appendMap(t._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new Js;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let o=0;for(let i=this.from;i<this.to;i++){let a=this._maps[i],s=a.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this._maps[l].recover(s.recover);continue}}o|=s.delInfo,t=s.pos}return r?t:new Ch(t,o,null)}}const Sh=Object.create(null);class Jn{getMap(){return vr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Sh[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Sh)throw new RangeError("Duplicate use of step JSON ID "+t);return Sh[t]=n,n.prototype.jsonID=t,n}}class kn{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new kn(t,null)}static fail(t){return new kn(null,t)}static fromReplace(t,n,r,o){try{return kn.ok(t.replace(n,r,o))}catch(i){if(i instanceof Pc)return kn.fail(i.message);throw i}}}function xh(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(xh(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return be.fromArray(r)}class ci extends Jn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new He(xh(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return kn.fromReplace(t,this.from,this.to,i)}invert(){return new Jr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ci(n.pos,r.pos,this.mark)}merge(t){return t instanceof ci&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ci(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ci(n.from,n.to,t.markFromJSON(n.mark))}}Jn.jsonID("addMark",ci);class Jr extends Jn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new He(xh(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return kn.fromReplace(t,this.from,this.to,r)}invert(){return new ci(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Jr(n.pos,r.pos,this.mark)}merge(t){return t instanceof Jr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Jr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jr(n.from,n.to,t.markFromJSON(n.mark))}}Jn.jsonID("removeMark",Jr);class ui extends Jn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return kn.fromReplace(t,this.pos,this.pos+1,new He(be.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.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 ui(this.pos,n.marks[o]);return new ui(this.pos,this.mark)}}return new Qi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ui(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ui(n.pos,t.markFromJSON(n.mark))}}Jn.jsonID("addNodeMark",ui);class Qi extends Jn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return kn.fromReplace(t,this.pos,this.pos+1,new He(be.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ui(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Qi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Qi(n.pos,t.markFromJSON(n.mark))}}Jn.jsonID("removeNodeMark",Qi);class Mn extends Jn{constructor(t,n,r,o=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=o}apply(t){return this.structure&&wh(t,this.from,this.to)?kn.fail("Structure replace would overwrite content"):kn.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new vr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Mn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&Mn.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Mn(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Mn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?He.empty:new He(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Mn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?He.empty:new He(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Mn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Mn(n.from,n.to,He.fromJSON(t,n.slice),!!n.structure)}}Mn.MAP_BIAS=1,Jn.jsonID("replace",Mn);class Ln extends Jn{constructor(t,n,r,o,i,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=s}apply(t){if(this.structure&&(wh(t,this.from,this.gapFrom)||wh(t,this.gapTo,this.to)))return kn.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return kn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?kn.fromReplace(t,this.from,this.to,r):kn.fail("Content does not fit in gap")}getMap(){return new vr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ln(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Ln(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,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 Ln(n.from,n.to,n.gapFrom,n.gapTo,He.fromJSON(t,n.slice),n.insert,!!n.structure)}}Jn.jsonID("replaceAround",Ln);function wh(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let a=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function pP(e,t,n,r){let o=[],i=[],a,s;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,t),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let v=0;v<d.length;v++)d[v].isInSet(p)||(a&&a.to==f&&a.mark.eq(d[v])?a.to=h:o.push(a=new Jr(f,h,d[v])));s&&s.to==f?s.to=h:i.push(s=new ci(f,h,r))}}),o.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function mP(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;i++;let l=null;if(r instanceof Dc){let c=a.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==i-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(s,t),to:c,step:i})}}}),o.forEach(a=>e.step(new Jr(a.from,a.to,a.style)))}function Eh(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),a=[],s=t+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=s+c.nodeSize,d=r.matchType(c.type);if(!d)a.push(new Mn(s,u,He.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||e.step(new Jr(s,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new He(be.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new Mn(s+f.index,s+f.index+f[0].length,p))}}s=u}if(!r.validEnd){let l=r.fillBefore(be.empty,!0);e.replace(s,s,new He(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function gP(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function La(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,o=0,i=0;;--r){let a=e.$from.node(r),s=e.$from.index(r)+o,l=e.$to.indexAfter(r)-i;if(r<e.depth&&a.canReplace(s,l,n))return r;if(r==0||a.type.spec.isolating||!gP(a,s,l))break;s&&(o=1),l<a.childCount&&(i=1)}return null}function vP(e,t,n){let{$from:r,$to:o,depth:i}=t,a=r.before(i+1),s=o.after(i+1),l=a,c=s,u=be.empty,d=0;for(let p=i,v=!1;p>n;p--)v||r.index(p)>0?(v=!0,u=be.from(r.node(p).copy(u)),d++):l--;let f=be.empty,h=0;for(let p=i,v=!1;p>n;p--)v||o.after(p+1)<o.end(p)?(v=!0,f=be.from(o.node(p).copy(f)),h++):c++;e.step(new Ln(l,c,a,s,new He(u.append(f),d,h),u.size-d,!0))}function $h(e,t,n=null,r=e){let o=bP(e,t),i=o&&yP(r,t);return i?o.map(ny).concat({type:t,attrs:n}).concat(i.map(ny)):null}function ny(e){return{type:e,attrs:null}}function bP(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}function yP(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;let l=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:a}function CP(e,t,n){let r=be.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=be.from(n[a].type.create(n[a].attrs,r))}let o=t.start,i=t.end;e.step(new Ln(o,i,o,i,new He(r,0,0),n.length,!0))}function SP(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(a,s)=>{let l=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,l)&&xP(e.doc,e.mapping.slice(i).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&oy(e,a,s,i),Eh(e,e.mapping.slice(i).map(s,1),r,void 0,c===null);let u=e.mapping.slice(i),d=u.map(s,1),f=u.map(s+a.nodeSize,1);return e.step(new Ln(d,f,d+1,f-1,new He(be.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&ry(e,a,s,i),!1}})}function ry(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(o.text);){let l=e.mapping.slice(r).map(n+1+i+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function oy(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+i);e.replaceWith(a,a+1,t.type.schema.text(`
|
|
42
|
+
`))}})}function xP(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function wP(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let a=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ln(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new He(be.from(a),0,0),1,!0))}function Fo(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let v=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!v.type.validContent(h))return!1}let s=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(s,s,l?l.type:o.node(i+1).type)}function EP(e,t,n=1,r){let o=e.doc.resolve(t),i=be.empty,a=be.empty;for(let s=o.depth,l=o.depth-n,c=n-1;s>l;s--,c--){i=be.from(o.node(s).copy(i));let u=r&&r[c];a=be.from(u?u.type.create(u.attrs,a):o.node(s).copy(a))}e.step(new Mn(t,t,new He(i.append(a),n,n),!0))}function di(e,t){let n=e.resolve(t),r=n.index();return iy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $P(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),a=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}function iy(e,t){return!!(e&&t&&!e.isLeaf&&$P(e,t))}function Bc(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let i,a,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&iy(i,a)&&r.node(o).canReplace(s,s+1))return t;if(o==0)break;t=n<0?r.before(o):r.after(o)}}function OP(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),a=i.node().type;if(o&&a.inlineContent){let u=a.whitespace=="pre",d=!!a.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let s=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);oy(e,u.node(),u.before(),s)}a.inlineContent&&Eh(e,t+n-1,a,i.node().contentMatchAt(i.index()),r==null);let l=e.mapping.slice(s),c=l.map(t-n);if(e.step(new Mn(c,l.map(t+n,-1),He.empty,!0)),r===!0){let u=e.doc.resolve(c);ry(e,u.node(),u.before(),e.steps.length)}return e}function kP(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function ay(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(s>0?1:0),c=r.node(a),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function Fc(e,t,n=t,r=He.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return sy(o,i,r)?new Mn(t,n,r):new MP(o,i,r).fit()}function sy(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class MP{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=be.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=be.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,a=r.depth,s=o.depth;for(;a&&s&&i.childCount==1;)i=i.firstChild.content,a--,s--;let l=new He(i,a,s);return t>-1?new Ln(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Mn(r.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Oh(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let a=o.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],u,d=null;if(n==1&&(a?c.matchType(a.type)||(d=c.fillBefore(be.from(a),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:s,parent:i,inject:d};if(n==2&&a&&(u=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=Oh(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new He(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=Oh(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new He(Qs(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new He(Qs(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let v=0;v<i.length;v++)this.openFrontierNode(i[v]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-t,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let v=0;v<o.childCount;v++)u.push(o.child(v));d=d.matchFragment(o)}let h=s.size+t-(a.content.size-a.openEnd);for(;c<s.childCount;){let v=s.child(c),m=d.matchType(v.type);if(!m)break;c++,(c>1||l==0||v.content.size)&&(d=m,u.push(ly(v.mark(f.allowedMarks(v.marks)),c==1?l:0,c==s.childCount?h:-1)))}let p=c==s.childCount;p||(h=-1),this.placed=Zs(this.placed,n,be.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=s;v<h;v++){let b=m.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),m=b.content}this.unplaced=p?t==0?He.empty:new He(Qs(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new He(Qs(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!kh(this.$to,this.$to.depth,t.type,t.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(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=kh(t,n,o,r,i);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],u=kh(t,s,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Zs(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Zs(this.placed,this.depth,be.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(be.empty,!0);n.childCount&&(this.placed=Zs(this.placed,this.frontier.length,n))}}function Qs(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Qs(e.firstChild.content,t-1,n)))}function Zs(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Zs(e.lastChild.content,t-1,n)))}function Oh(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ly(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ly(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(be.empty,!0)))),e.copy(r)}function kh(e,t,n,r,o){let i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;let s=r.fillBefore(i.content,!0,a);return s&&!NP(n,i.content,a)?s:null}function NP(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function TP(e){return e.spec.defining||e.spec.definingForContent}function IP(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(sy(o,i,r))return e.step(new Mn(t,n,r));let a=uy(o,i);a[a.length-1]==0&&a.pop();let s=-(o.depth+1);a.unshift(s);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;a.indexOf(f)>-1?s=f:o.before(f)==h&&a.splice(1,0,-f)}let l=a.indexOf(s),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=TP(h.type);if(p&&!h.sameMarkup(o.node(Math.abs(s)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let v=0;v<a.length;v++){let m=a[(v+l)%a.length],b=!0;m<0&&(b=!1,m=-m);let y=o.node(m-1),C=o.index(m-1);if(y.canReplaceWith(C,C,p.type,p.marks))return e.replace(o.before(m),b?i.after(m):n,new He(cy(r.content,0,r.openStart,h),h,r.openEnd))}}let d=e.steps.length;for(let f=a.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>d));f--){let h=a[f];h<0||(t=o.before(h),n=i.after(h))}}function cy(e,t,n,r,o){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(cy(i.content,t+1,n,r,i)))}if(t>r){let i=o.contentMatchAt(0),a=i.fillBefore(e).append(e);e=a.append(i.matchFragment(a).fillBefore(be.empty,!0))}return e}function PP(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=kP(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new He(be.from(r),0,0))}function AP(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let a=r.sharedDepth(n),s=!1;for(let l=r.depth;l>a;l--)r.node(l).type.spec.isolating&&(s=!0);for(let l=o.depth;l>a;l--)o.node(l).type.spec.isolating&&(s=!0);if(!s){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=o.depth;l>0&&n==o.start(l);l--)n=o.before(l);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=uy(r,o);for(let a=0;a<i.length;a++){let s=i[a],l=a==i.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),o.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function uy(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class ja extends Jn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return kn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return kn.fromReplace(t,this.pos,this.pos+1,new He(be.from(o),0,n.isLeaf?0:1))}getMap(){return vr.empty}invert(t){return new ja(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ja(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ja(n.pos,n.attr,n.value)}}Jn.jsonID("attr",ja);class el extends Jn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return kn.ok(r)}getMap(){return vr.empty}invert(t){return new el(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new el(n.attr,n.value)}}Jn.jsonID("docAttr",el);let za=class extends Error{};za=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},za.prototype=Object.create(Error.prototype),za.prototype.constructor=za,za.prototype.name="TransformError";let Mh=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Js}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new za(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(t=o.map(t,1),n=o.map(n,-1)),o.forEach((i,a,s,l)=>{t=Math.min(t,s),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=He.empty){let o=Fc(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new He(be.from(r),0,0))}delete(t,n){return this.replace(t,n,He.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return IP(this,t,n,r),this}replaceRangeWith(t,n,r){return PP(this,t,n,r),this}deleteRange(t,n){return AP(this,t,n),this}lift(t,n){return vP(this,t,n),this}join(t,n=1){return OP(this,t,n),this}wrap(t,n){return CP(this,t,n),this}setBlockType(t,n=t,r,o=null){return SP(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return wP(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new ja(t,n,r)),this}setDocAttribute(t,n){return this.step(new el(t,n)),this}addNodeMark(t,n){return this.step(new ui(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof rn)n.isInSet(r.marks)&&this.step(new Qi(t,n));else{let o=r.marks,i,a=[];for(;i=n.isInSet(o);)a.push(new Qi(t,i)),o=i.removeFromSet(o);for(let s=a.length-1;s>=0;s--)this.step(a[s])}return this}split(t,n=1,r){return EP(this,t,n,r),this}addMark(t,n,r){return pP(this,t,n,r),this}removeMark(t,n,r){return mP(this,t,n,r),this}clearIncompatible(t,n,r){return Eh(this,t,n,r),this}};const Nh=Object.create(null);class ht{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new dy(t.min(n),t.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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=He.empty){let r=n.content.lastChild,o=null;for(let s=0;s<n.openEnd;s++)o=r,r=r.lastChild;let i=t.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:l,$to:c}=a[s],u=t.mapping.slice(i);t.replaceRange(u.map(l.pos),u.map(c.pos),s?He.empty:n),s==0&&py(t,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:a,$to:s}=o[i],l=t.mapping.slice(r),c=l.map(a.pos),u=l.map(s.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),py(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let o=t.parent.inlineContent?new lt(t):Ba(t.node(0),t.parent,t.pos,t.index(),n,r);if(o)return o;for(let i=t.depth-1;i>=0;i--){let a=n<0?Ba(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):Ba(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new br(t.node(0))}static atStart(t){return Ba(t,t,0,0,1)||new br(t)}static atEnd(t){return Ba(t,t,t.content.size,t.childCount,-1)||new br(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Nh[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Nh)throw new RangeError("Duplicate use of selection JSON ID "+t);return Nh[t]=n,n.prototype.jsonID=t,n}getBookmark(){return lt.between(this.$anchor,this.$head).getBookmark()}}ht.prototype.visible=!0;class dy{constructor(t,n){this.$from=t,this.$to=n}}let fy=!1;function hy(e){!fy&&!e.parent.inlineContent&&(fy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class lt extends ht{constructor(t,n=t){hy(t),hy(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return ht.near(r);let o=t.resolve(n.map(this.anchor));return new lt(o.parent.inlineContent?o:r,r)}replace(t,n=He.empty){if(super.replace(t,n),n==He.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof lt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Hc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new lt(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=ht.findFrom(n,r,!0)||ht.findFrom(n,-r,!0);if(i)n=i.$head;else return ht.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(ht.findFrom(t,-r,!0)||ht.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=o<0&&(t=n))),new lt(t,n)}}ht.jsonID("text",lt);class Hc{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Hc(t.map(this.anchor),t.map(this.head))}resolve(t){return lt.between(t.resolve(this.anchor),t.resolve(this.head))}}class at extends ht{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?ht.near(i):new at(i)}content(){return new He(be.from(this.node),0,0)}eq(t){return t instanceof at&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Th(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new at(t.resolve(n.anchor))}static create(t,n){return new at(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}at.prototype.visible=!1,ht.jsonID("node",at);class Th{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Hc(r,r):new Th(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&at.isSelectable(r)?new at(n):ht.near(n)}}class br extends ht{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=He.empty){if(n==He.empty){t.delete(0,t.doc.content.size);let r=ht.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new br(t)}map(t){return new br(t)}eq(t){return t instanceof br}getBookmark(){return RP}}ht.jsonID("all",br);const RP={map(){return this},resolve(e){return new br(e)}};function Ba(e,t,n,r,o,i=!1){if(t.inlineContent)return lt.create(e,n);for(let a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){let s=t.child(a);if(s.isAtom){if(!i&&at.isSelectable(s))return at.create(e,n-(o<0?s.nodeSize:0))}else{let l=Ba(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}return null}function py(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof Mn||o instanceof Ln))return;let i=e.mapping.maps[r],a;i.forEach((s,l,c,u)=>{a==null&&(a=u)}),e.setSelection(ht.near(e.doc.resolve(a),n))}const my=1,Vc=2,gy=4;class _P extends Mh{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|my)&~Vc,this.storedMarks=null,this}get selectionSet(){return(this.updated&my)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Vc,this}ensureMarks(t){return rn.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Vc)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Vc,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||rn.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let a=this.doc.resolve(n);i=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(ht.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gy,this}get scrolledIntoView(){return(this.updated&gy)>0}}function vy(e,t){return!t||!e?e:e.bind(t)}class tl{constructor(t,n,r){this.name=t,this.init=vy(n.init,r),this.apply=vy(n.apply,r)}}const DP=[new tl("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new tl("selection",{init(e,t){return e.selection||ht.atStart(t.doc)},apply(e){return e.selection}}),new tl("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new tl("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Ih{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=DP.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 tl(r.key,r.spec.state,r))})}}class Fa{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,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,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),o=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let l=o?o[a].n:0,c=o?o[a].state:this,u=l<n.length&&s.spec.appendTransaction.call(s,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",t),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<a?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[a]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Fa(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new _P(this)}static create(t){let n=new Ih(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Fa(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}reconfigure(t){let n=new Ih(this.schema,t.plugins),r=n.fields,o=new Fa(n);for(let i=0;i<r.length;i++){let a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(t,o)}return o}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Ih(t.schema,t.plugins),i=new Fa(o);return o.fields.forEach(a=>{if(a.name=="doc")i.doc=li.fromJSON(t.schema,n.doc);else if(a.name=="selection")i.selection=ht.fromJSON(i.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let s in r){let l=r[s],c=l.spec.state;if(l.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,s)){i[a.name]=c.fromJSON.call(l,t,n[s],i);return}}i[a.name]=a.init(t,i)}}),i}}function by(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=by(o,t,{})),n[r]=o}return n}class Kt{constructor(t){this.spec=t,this.props={},t.props&&by(t.props,this,this.props),this.key=t.key?t.key.key:yy("plugin")}getState(t){return t[this.key]}}const Ph=Object.create(null);function yy(e){return e in Ph?e+"$"+ ++Ph[e]:(Ph[e]=0,e+"$")}class on{constructor(t="key"){this.key=yy(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Ah=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Cy(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Sy=(e,t,n)=>{let r=Cy(e,n);if(!r)return!1;let o=Rh(r);if(!o){let a=r.blockRange(),s=a&&La(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let i=o.nodeBefore;if(Ty(e,o,t,-1))return!0;if(r.parent.content.size==0&&(Ha(i,"end")||at.isSelectable(i)))for(let a=r.depth;;a--){let s=Fc(e.doc,r.before(a),r.after(a),He.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection(Ha(i,"end")?ht.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):at.create(l.doc,o.pos-i.nodeSize)),t(l.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},LP=(e,t,n)=>{let r=Cy(e,n);if(!r)return!1;let o=Rh(r);return o?xy(e,o,t):!1},jP=(e,t,n)=>{let r=Ey(e,n);if(!r)return!1;let o=_h(r);return o?xy(e,o,t):!1};function xy(e,t,n){let r=t.nodeBefore,o=r,i=t.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let a=t.nodeAfter,s=a,l=t.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let u=s.firstChild;if(!u)return!1;s=u}let c=Fc(e.doc,i,l,He.empty);if(!c||c.from!=i||c instanceof Mn&&c.slice.size>=l-i)return!1;if(n){let u=e.tr.step(c);u.setSelection(lt.create(u.doc,i)),n(u.scrollIntoView())}return!0}function Ha(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const wy=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=Rh(r)}let a=i&&i.nodeBefore;return!a||!at.isSelectable(a)?!1:(t&&t(e.tr.setSelection(at.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Rh(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ey(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const $y=(e,t,n)=>{let r=Ey(e,n);if(!r)return!1;let o=_h(r);if(!o)return!1;let i=o.nodeAfter;if(Ty(e,o,t,1))return!0;if(r.parent.content.size==0&&(Ha(i,"start")||at.isSelectable(i))){let a=Fc(e.doc,r.before(),r.after(),He.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Ha(i,"start")?ht.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):at.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Oy=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=_h(r)}let a=i&&i.nodeAfter;return!a||!at.isSelectable(a)?!1:(t&&t(e.tr.setSelection(at.create(e.doc,i.pos)).scrollIntoView()),!0)};function _h(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const zP=(e,t)=>{let n=e.selection,r=n instanceof at,o;if(r){if(n.node.isTextblock||!di(e.doc,n.from))return!1;o=n.from}else if(o=Bc(e.doc,n.from,-1),o==null)return!1;if(t){let i=e.tr.join(o);r&&i.setSelection(at.create(i.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},BP=(e,t)=>{let n=e.selection,r;if(n instanceof at){if(n.node.isTextblock||!di(e.doc,n.to))return!1;r=n.to}else if(r=Bc(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},FP=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&La(o);return i==null?!1:(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},ky=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
43
|
+
`).scrollIntoView()),!0)};function Dh(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const HP=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),a=Dh(o.contentMatchAt(i));if(!a||!o.canReplaceWith(i,i,a))return!1;if(t){let s=n.after(),l=e.tr.replaceWith(s,s,a.createAndFill());l.setSelection(ht.near(l.doc.resolve(s),1)),t(l.scrollIntoView())}return!0},My=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof br||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Dh(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(a,i.createAndFill());s.setSelection(lt.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},Ny=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Fo(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&La(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function VP(e){return(t,n)=>{let{$from:r,$to:o}=t.selection;if(t.selection instanceof at&&t.selection.node.isBlock)return!r.parentOffset||!Fo(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],a,s,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),s=Dh(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),i.unshift(l&&s?{type:s}:null),a=h;break}else{if(h==1)return!1;i.unshift(null)}let u=t.tr;(t.selection instanceof lt||t.selection instanceof br)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Fo(u.doc,d,i.length,i);if(f||(i[0]=s?{type:s}:null,f=Fo(u.doc,d,i.length,i)),!f)return!1;if(u.split(d,i.length,i),!l&&c&&r.node(a).type!=s){let h=u.mapping.map(r.before(a)),p=u.doc.resolve(h);s&&r.node(a-1).canReplaceWith(p.index(),p.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(a)),s)}return n&&n(u.scrollIntoView()),!0}}const WP=VP(),UP=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(at.create(e.doc,o))),!0)};function qP(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||di(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Ty(e,t,n,r){let o=t.nodeBefore,i=t.nodeAfter,a,s,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&qP(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(a=(s=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&s.matchType(a[0]||i.type).validEnd){if(n){let h=t.pos+i.nodeSize,p=be.empty;for(let b=a.length-1;b>=0;b--)p=be.from(a[b].create(null,p));p=be.from(o.copy(p));let v=e.tr.step(new Ln(t.pos-1,h,t.pos,h,new He(p,1,0),a.length,!0)),m=v.doc.resolve(h+2*a.length);m.nodeAfter&&m.nodeAfter.type==o.type&&di(v.doc,m.pos)&&v.join(m.pos),n(v.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:ht.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&La(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(c&&Ha(i,"start",!0)&&Ha(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let v=i,m=1;for(;!v.isTextblock;v=v.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(n){let b=be.empty;for(let C=p.length-1;C>=0;C--)b=be.from(p[C].copy(b));let y=e.tr.step(new Ln(t.pos-p.length,t.pos+i.nodeSize,t.pos+m,t.pos+i.nodeSize-m,new He(b,p.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function Iy(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(lt.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const KP=Iy(-1),GP=Iy(1);function XP(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,a=o.blockRange(i),s=a&&$h(a,e,t);return s?(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Py(e,t=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:a},$to:{pos:s}}=n.selection.ranges[i];n.doc.nodesBetween(a,s,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,e)}})}if(!o)return!1;if(r){let i=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[a];i.setBlockType(s,l,e,t)}r(i.scrollIntoView())}return!0}}function Lh(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}Lh(Ah,Sy,wy),Lh(Ah,$y,Oy),Lh(ky,My,Ny,WP),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function YP(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,a=o.blockRange(i);if(!a)return!1;let s=r?n.tr:null;return JP(s,a,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function JP(e,t,n,r=null){let o=!1,i=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=a.resolve(t.start-2);i=new Rc(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new Rc(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let s=$h(i,n,r,t);return s?(e&&QP(e,t,s,o,n),!0):!1}function QP(e,t,n,r,o){let i=be.empty;for(let u=n.length-1;u>=0;u--)i=be.from(n[u].type.create(n[u].attrs,i));e.step(new Ln(t.start-(r?2:0),t.end,t.start,t.end,new He(i,0,0),n.length,!0));let a=0;for(let u=0;u<n.length;u++)n[u].type==o&&(a=u+1);let s=n.length-a,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,f=!0;u<d;u++,f=!1)!f&&Fo(e.doc,l,s)&&(e.split(l,s),l+=2*s),l+=c.child(u).nodeSize;return e}function ZP(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?eA(t,n,e,i):tA(t,n,i):!0:!1}}function eA(e,t,n,r){let o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new Ln(i-1,a,i,a,new He(be.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Rc(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const s=La(r);if(s==null)return!1;o.lift(r,s);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return di(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),t(o.scrollIntoView()),!0}function tA(e,t,n){let r=e.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,v=n.startIndex;p>v;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),a=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(s?0:1),u+1,a.content.append(l?be.empty:be.from(o))))return!1;let d=i.pos,f=d+a.nodeSize;return r.step(new Ln(d-(s?1:0),f+(l?1:0),d+1,f-1,new He((s?be.empty:be.from(o.copy(be.empty))).append(l?be.empty:be.from(o.copy(be.empty))),s?0:1,l?0:1),s?0:1)),t(r.scrollIntoView()),!0}function nA(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==e);if(!i)return!1;let a=i.startIndex;if(a==0)return!1;let s=i.parent,l=s.child(a-1);if(l.type!=e)return!1;if(n){let c=l.lastChild&&l.lastChild.type==s.type,u=be.from(c?e.create():null),d=new He(be.from(e.create(null,be.from(s.type.create(null,u)))),c?3:1,0),f=i.start,h=i.end;n(t.tr.step(new Ln(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}const Un=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Va=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let jh=null;const Ho=function(e,t,n){let r=jh||(jh=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},rA=function(){jh=null},Zi=function(e,t,n,r){return n&&(Ay(e,t,n,r,-1)||Ay(e,t,n,r,1))},oA=/^(img|br|input|textarea|hr)$/i;function Ay(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Pr(e))){let a=e.parentNode;if(!a||a.nodeType!=1||nl(e)||oA.test(e.nodeName)||e.contentEditable=="false")return!1;t=Un(e)+(o<0?0:1),e=a}else if(e.nodeType==1){let a=e.childNodes[t+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((i=a.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)t+=o;else return!1;else e=a,t=o<0?Pr(e):0}else return!1}}function Pr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function iA(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Pr(e)}else if(e.parentNode&&!nl(e))t=Un(e),e=e.parentNode;else return null}}function aA(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!nl(e))t=Un(e)+1,e=e.parentNode;else return null}}function sA(e,t,n){for(let r=t==0,o=t==Pr(e);r||o;){if(e==n)return!0;let i=Un(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==Pr(e)}}function nl(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Wc=function(e){return e.focusNode&&Zi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ea(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function lA(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function cA(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Pr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Pr(r.startContainer),r.startOffset)}}}const Co=typeof navigator<"u"?navigator:null,Ry=typeof document<"u"?document:null,fi=Co&&Co.userAgent||"",zh=/Edge\/(\d+)/.exec(fi),_y=/MSIE \d/.exec(fi),Bh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fi),dr=!!(_y||Bh||zh),hi=_y?document.documentMode:Bh?+Bh[1]:zh?+zh[1]:0,Ar=!dr&&/gecko\/(\d+)/i.test(fi);Ar&&+(/Firefox\/(\d+)/.exec(fi)||[0,0])[1];const Fh=!dr&&/Chrome\/(\d+)/.exec(fi),qn=!!Fh,Dy=Fh?+Fh[1]:0,Qn=!dr&&!!Co&&/Apple Computer/.test(Co.vendor),Wa=Qn&&(/Mobile\/\w+/.test(fi)||!!Co&&Co.maxTouchPoints>2),Rr=Wa||(Co?/Mac/.test(Co.platform):!1),Ly=Co?/Win/.test(Co.platform):!1,Vo=/Android \d/.test(fi),rl=!!Ry&&"webkitFontSmoothing"in Ry.documentElement.style,uA=rl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function dA(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Wo(e,t){return typeof e=="number"?e:e[t]}function fA(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function jy(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let a=n||e.dom;a;){if(a.nodeType!=1){a=Va(a);continue}let s=a,l=s==i.body,c=l?dA(i):fA(s),u=0,d=0;if(t.top<c.top+Wo(r,"top")?d=-(c.top-t.top+Wo(o,"top")):t.bottom>c.bottom-Wo(r,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Wo(o,"top")-c.top:t.bottom-c.bottom+Wo(o,"bottom")),t.left<c.left+Wo(r,"left")?u=-(c.left-t.left+Wo(o,"left")):t.right>c.right-Wo(r,"right")&&(u=t.right-c.right+Wo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let h=s.scrollLeft,p=s.scrollTop;d&&(s.scrollTop+=d),u&&(s.scrollLeft+=u);let v=s.scrollLeft-h,m=s.scrollTop-p;t={left:t.left-v,top:t.top-m,right:t.right-v,bottom:t.bottom-m}}let f=l?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(f))break;a=f=="absolute"?a.offsetParent:Va(a)}}function hA(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let s=e.root.elementFromPoint(i,a);if(!s||s==e.dom||!e.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=n-20){r=s,o=l.top;break}}return{refDOM:r,refTop:o,stack:zy(e.dom)}}function zy(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Va(r));return t}function pA({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;By(n,r==0?0:r-t)}function By(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Ua=null;function mA(e){if(e.setActive)return e.setActive();if(Ua)return e.focus(Ua);let t=zy(e);e.focus(Ua==null?{get preventScroll(){return Ua={preventScroll:!0},!0}}:void 0),Ua||(Ua=!1,By(t,0))}function Fy(e,t){let n,r=2e8,o,i=0,a=t.top,s=t.top,l,c;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Ho(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=a&&p.bottom>=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);let v=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(v<r){n=u,r=v,o=v&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&v&&(i=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?gA(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:Fy(n,o)}function gA(e,t){let n=e.nodeValue.length,r=document.createRange(),o;for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let a=pi(r,1);if(a.top!=a.bottom&&Hh(t,a)){o={node:e,offset:i+(t.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:e,offset:0}}function Hh(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function vA(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function bA(e,t,n){let{node:r,offset:o}=Fy(t,n),i=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();i=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function yA(e,t,n,r){let o=-1;for(let i=t,a=!1;i!=e.dom;){let s=e.docView.nearestDesc(i,!0),l;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!a&&l.left>r.left||l.top>r.top?o=s.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(o=s.posAfter),a=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;i=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function Hy(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let a=e.childNodes[i];if(a.nodeType==1){let s=a.getClientRects();for(let l=0;l<s.length;l++){let c=s[l];if(Hh(t,c))return Hy(a,t,c)}}if((i=(i+1)%r)==o)break}return e}function CA(e,t){let n=e.dom.ownerDocument,r,o=0,i=cA(n,t.left,t.top);i&&({node:r,offset:o}=i);let a=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!a||!e.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=e.dom.getBoundingClientRect();if(!Hh(t,c)||(a=Hy(e.dom,t,c),!a))return null}if(Qn)for(let c=a;r&&c;c=Va(c))c.draggable&&(r=void 0);if(a=vA(a,t),r){if(Ar&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&o++}let c;rl&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(s=yA(e,r,o,t))}s==null&&(s=bA(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Vy(e){return e.top<e.bottom||e.left<e.right}function pi(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(Vy(r))return r}return Array.prototype.find.call(n,Vy)||e.getBoundingClientRect()}const SA=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wy(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),a=rl||Ar;if(r.nodeType==3)if(a&&(SA.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=pi(Ho(r,o,o),n);if(Ar&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=pi(Ho(r,o-1,o-1),-1);if(c.top==l.top){let u=pi(Ho(r,o,o+1),-1);if(u.top!=l.top)return ol(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,ol(pi(Ho(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Pr(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Vh(l.getBoundingClientRect(),!1)}if(i==null&&o<Pr(r)){let l=r.childNodes[o];if(l.nodeType==1)return Vh(l.getBoundingClientRect(),!0)}return Vh(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Pr(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Ho(l,Pr(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ol(pi(c,1),!1)}if(i==null&&o<Pr(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Ho(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return ol(pi(c,-1),!0)}return ol(pi(r.nodeType==3?Ho(r):r,-n),n>=0)}function ol(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Vh(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Uy(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function xA(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return Uy(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(i,!0);if(!s)break;if(s.node.isBlock){i=s.contentDOM||s.dom;break}i=s.dom.parentNode}let a=Wy(e,o.pos,1);for(let s=i.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Ho(s,0,s.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const wA=/[\u0590-\u08ac]/;function EA(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return s?!wA.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?i:a:Uy(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:v}=e.domSelectionRange(),m=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==v;try{s.collapse(u,d),l&&(l!=u||c!=d)&&s.extend&&s.extend(l,c)}catch{}return f!=null&&(s.caretBidiLevel=f),m}):r.pos==r.start()||r.pos==r.end()}let qy=null,Ky=null,Gy=!1;function $A(e,t,n){return qy==t&&Ky==n?Gy:(qy=t,Ky=n,Gy=n=="up"||n=="down"?xA(e,t,n):EA(e,t,n))}const _r=0,Xy=1,ta=2,So=3;class il{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=_r,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)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(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let i,a;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(a)+a.size:this.posAtStart}else{let i,a;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>Un(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),a;if(i&&(!n||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let s=o.children[a];if(s.size){o=s;break}}return o}if(t<i)return o.descAt(t-r-o.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let a=this.children[r],s=i+a.size;if(s>t||a instanceof Qy){o=t-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Yy&&i.side>=0;r--);if(n<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&n&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Un(i.dom)+1:0}}else{let i,a=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,a=!1);return i&&a&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Un(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let a=r,s=0;;s++){let l=this.children[s],c=a+l.size;if(o==-1&&t<=c){let u=a+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=a;for(let d=s;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Un(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||s==this.children.length-1)){n=c;for(let u=s+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Un(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let i=Math.min(t,n),a=Math.max(t,n);for(let h=0,p=0;h<this.children.length;h++){let v=this.children[h],m=p+v.size;if(i>p&&a<m)return v.setSelection(t-p-v.border,n-p-v.border,r,o);p=m}let s=this.domFromPos(t,t?-1:1),l=n==t?s:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((Ar||Qn)&&t==n){let{node:h,offset:p}=s;if(h.nodeType==3){if(d=!!(p&&h.nodeValue[p-1]==`
|
|
44
|
+
`),d&&p==h.nodeValue.length)for(let v=h,m;v;v=v.parentNode){if(m=v.nextSibling){m.nodeName=="BR"&&(s=l={node:m.parentNode,offset:Un(m)+1});break}let b=v.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let v=h.childNodes[p-1];d=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Ar&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||d&&Qn)&&Zi(s.node,s.offset,u.anchorNode,u.anchorOffset)&&Zi(l.node,l.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||t==n)&&!(d&&Ar)){c.collapse(s.node,s.offset);try{t!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let p=s;s=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(s.node,s.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],a=r+i.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let s=r+i.border,l=a-i.border;if(t>=s&&n<=l){this.dirty=t==r||n==a?ta:Xy,t==s&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=So:i.markDirty(t-s,n-s);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ta:So}r=a}this.dirty=ta}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ta:Xy;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class Yy extends il{constructor(t,n,r,o){let i,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==_r&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.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 OA extends il{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class na extends il{constructor(t,n,r,o,i){super(t,[],r,o),this.mark=n,this.spec=i}static create(t,n,r,o){let i=o.nodeViews[n.type.name],a=i&&i(n,o,r);return(!a||!a.dom)&&(a=Ji.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new na(t,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&So||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=So&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=_r){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=_r}}slice(t,n,r){let o=na.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=Uh(i,n,a,r)),t>0&&(i=Uh(i,0,t,r));for(let s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class mi extends il{constructor(t,n,r,o,i,a,s,l,c){super(t,[],i,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=s}static create(t,n,r,o,i,a){let s=i.nodeViews[n.type.name],l,c=s&&s(n,i,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ji.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=tC(u,r,n),c?l=new kA(t,n,r,o,u,d||null,f,c,i,a+1):n.isText?new Uc(t,n,r,o,u,f,i):new mi(t,n,r,o,u,d||null,f,i,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>be.empty)}return t}matchesNode(t,n,r){return this.dirty==_r&&t.eq(this.node)&&qc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new NA(this,a&&a.node,t);PA(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,t,u):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?rn.none:this.node.child(u).marks,r,t,u),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,t,f);let h;l.findNodeMatch(c,u,d,f)||s&&t.state.selection.from>o&&t.state.selection.to<o+c.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,h,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ta)&&(a&&this.protectLocalComposition(t,a),Zy(this.contentDOM,this.children,t),Wa&&AA(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof lt)||r<n||o>n+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,s=RA(this.node.content,a,r-n,o-n);return s<0?null:{node:i,pos:s,text:a}}else return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new OA(this,i,n,o);t.input.compositionNodes.push(a),this.children=Uh(this.children,r,r+o.length,t,a)}update(t,n,r,o){return this.dirty==So||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_r}updateOuterDeco(t){if(qc(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=eC(this.dom,this.nodeDOM,Wh(this.outerDeco,this.node,n),Wh(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 Jy(e,t,n,r,o){tC(r,t,e);let i=new mi(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Uc extends mi{constructor(t,n,r,o,i,a,s){super(t,n,r,o,i,null,a,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==So||this.dirty!=_r&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=_r||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=_r,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new Uc(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=So)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Qy extends il{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_r&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class kA extends mi{constructor(t,n,r,o,i,a,s,l,c,u){super(t,n,r,o,i,a,s,c,u),this.spec=l}update(t,n,r,o){if(this.dirty==So)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Zy(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let a=t[i],s=a.dom;if(s.parentNode==e){for(;s!=r;)r=nC(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof na){let l=r?r.previousSibling:e.lastChild;Zy(a.contentDOM,a.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=nC(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const al=function(e){e&&(this.nodeName=e)};al.prototype=Object.create(null);const ra=[new al];function Wh(e,t,n){if(e.length==0)return ra;let r=n?ra[0]:new al,o=[r];for(let i=0;i<e.length;i++){let a=e[i].type.attrs;if(a){a.nodeName&&o.push(r=new al(a.nodeName));for(let s in a){let l=a[s];l!=null&&(n&&o.length==1&&o.push(r=new al(t.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+l:s=="style"?r.style=(r.style?r.style+";":"")+l:s!="nodeName"&&(r[s]=l))}}}return o}function eC(e,t,n,r){if(n==ra&&r==ra)return t;let o=t;for(let i=0;i<r.length;i++){let a=r[i],s=n[i];if(i){let l;s&&s.nodeName==a.nodeName&&o!=e&&(l=o.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(o),s=ra[0]),o=l}MA(o,s||ra[0],a)}return o}function MA(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.add(o[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function tC(e,t,n){return eC(e,e,ra,Wh(t,n,e.nodeType!=1))}function qc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function nC(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class NA{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=TA(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,o){let i=0,a=this.stack.length>>1,s=Math.min(a,t.length);for(;i<s&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=_r,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<t.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;o<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let d=this.top.children[u];if(d.matchesMark(t[a])&&!this.isLocked(d.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=na.create(this.top,t[a],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,a++}}findNodeMatch(t,n,r,o){let i=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))i=this.top.children.indexOf(a,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let c=this.top.children[s];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){i=s;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,o,i){let a=this.top.children[o];return a.dirty==So&&a.dom==a.contentDOM&&(a.dirty=ta),a.update(t,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,i,a){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof mi){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=So&&qc(n,l.outerDeco));if(!f&&l.update(t,n,r,o))return this.destroyBetween(this.index,s),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,t,n,r,o,a)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ta,d.updateChildren(o,a+1),d.dirty=_r),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,i,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!qc(r,t.outerDeco)||!o.eq(t.innerDeco))return null;let s=mi.create(this.top,n,r,o,i,a);if(s.contentDOM){s.children=t.children,t.children=[];for(let l of s.children)l.parent=s}return t.destroy(),s}addNode(t,n,r,o,i){let a=mi.create(this.top,t,n,r,o,i);a.contentDOM&&a.updateChildren(o,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Yy(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof na;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Uc)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Qn||qn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Qy(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function TA(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:for(;o>0;){let s;for(;;)if(r){let c=n.children[r-1];if(c instanceof na)n=c,r=c.children.length;else{s=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=s.node;if(l){if(l!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}function IA(e,t){return e.type.side-t.type.side}function PA(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,o,t.forChild(i,u),c),i+=u.nodeSize}return}let a=0,s=[],l=null;for(let c=0;;){let u,d;for(;a<o.length&&o[a].to==i;){let m=o[a++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(IA);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<e.childCount)h=c,f=e.child(c++);else break;for(let m=0;m<s.length;m++)s[m].to<=i&&s.splice(m--,1);for(;a<o.length&&o[a].from<=i&&o[a].to>i;)s.push(o[a++]);let p=i+f.nodeSize;if(f.isText){let m=p;a<o.length&&o[a].from<m&&(m=o[a].from);for(let b=0;b<s.length;b++)s[b].to<m&&(m=s[b].to);m<p&&(l=f.cut(m-i),f=f.cut(0,m-i),p=m,h=-1)}else for(;a<o.length&&o[a].to<p;)a++;let v=f.isInline&&!f.isLeaf?s.filter(m=>!m.inline):s.slice();r(f,v,t.forChild(i,f),h),i=p}}function AA(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function RA(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let a=e.child(o++),s=i;if(i+=a.nodeSize,!a.isText)continue;let l=a.text;for(;o<e.childCount;){let c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-t.length-s,r-s)==t)return r-t.length;let c=s<r?l.lastIndexOf(t,r-s-1):-1;if(c>=0&&c+t.length+s>=n)return s+c;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}return-1}function Uh(e,t,n,r,o){let i=[];for(let a=0,s=0;a<e.length;a++){let l=e[a],c=s,u=s+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function qh(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),l,c;if(Wc(n)){for(l=a;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&at.isSelectable(d)&&o.parent&&!(d.isInline&&sA(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;c=new at(a==f?s:r.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=a,f=a;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);d=Math.min(d,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,a]=f==e.state.selection.anchor?[f,d]:[d,f],s=r.resolve(a)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=t=="pointer"||e.state.selection.head<s.pos&&!i?1:-1;c=Gh(e,u,s,d)}return c}function rC(e){return e.editable?e.hasFocus():uC(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Uo(e,t=!1){let n=e.state.selection;if(sC(e,n),!!rC(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&qn){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Zi(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)DA(e);else{let{anchor:r,head:o}=n,i,a;oC&&!(n instanceof lt)&&(n.$from.parent.inlineContent||(i=iC(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=iC(e,n.to))),e.docView.setSelection(r,o,e,t),oC&&(i&&aC(i),a&&aC(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&_A(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const oC=Qn||qn&&Dy<63;function iC(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Qn&&o&&o.contentEditable=="false")return Kh(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Kh(o);if(i)return Kh(i)}}function Kh(e){return e.contentEditable="true",Qn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function aC(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function _A(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!rC(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function DA(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,Un(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&dr&&hi<=11&&(n.disabled=!0,n.disabled=!1)}function sC(e,t){if(t instanceof at){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(lC(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else lC(e)}function lC(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Gh(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||lt.between(t,n,r)}function cC(e){return e.editable&&!e.hasFocus()?!1:uC(e)}function uC(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function LA(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Zi(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Xh(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&ht.findFrom(i,t)}function gi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function dC(e,t,n){let r=e.state.selection;if(r instanceof lt)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return gi(e,new lt(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=Xh(e.state,t);return o&&o instanceof at?gi(e,o):!1}else if(!(Rr&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,a;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?at.isSelectable(i)?gi(e,new at(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):rl?gi(e,new lt(e.state.doc.resolve(t<0?s:s+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof at&&r.node.isInline)return gi(e,new lt(t>0?r.$to:r.$from));{let o=Xh(e.state,t);return o?gi(e,o):!1}}}function Kc(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function sl(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function qa(e,t){return t<0?jA(e):zA(e)}function jA(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=!1;for(Ar&&n.nodeType==1&&r<Kc(n)&&sl(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(sl(s,-1))o=n,i=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(fC(n))break;{let s=n.previousSibling;for(;s&&sl(s,-1);)o=n.parentNode,i=Un(s),s=s.previousSibling;if(s)n=s,r=Kc(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?Yh(e,n,r):o&&Yh(e,o,i)}function zA(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=Kc(n),i,a;for(;;)if(r<o){if(n.nodeType!=1)break;let s=n.childNodes[r];if(sl(s,1))i=n,a=++r;else break}else{if(fC(n))break;{let s=n.nextSibling;for(;s&&sl(s,1);)i=s.parentNode,a=Un(s)+1,s=s.nextSibling;if(s)n=s,r=0,o=Kc(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&Yh(e,i,a)}function fC(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function BA(e,t){for(;e&&t==e.childNodes.length&&!nl(e);)t=Un(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function FA(e,t){for(;e&&!t&&!nl(e);)t=Un(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Yh(e,t,n){if(t.nodeType!=3){let i,a;(a=BA(t,n))?(t=a,n=0):(i=FA(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Wc(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&Uo(e)},50)}function hC(e,t){let n=e.state.doc.resolve(t);if(!(qn||Ly)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function pC(e,t,n){let r=e.state.selection;if(r instanceof lt&&!r.empty||n.indexOf("s")>-1||Rr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=Xh(e.state,t);if(a&&a instanceof at)return gi(e,a)}if(!o.parent.inlineContent){let a=t<0?o:i,s=r instanceof br?ht.near(a,t):ht.findFrom(a,t);return s?gi(e,s):!1}return!1}function mC(e,t){if(!(e.state.selection instanceof lt))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let a=e.state.tr;return t<0?a.delete(n.pos-i.nodeSize,n.pos):a.delete(n.pos,n.pos+i.nodeSize),e.dispatch(a),!0}return!1}function gC(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function HA(e){if(!Qn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;gC(e,r,"true"),setTimeout(()=>gC(e,r,"false"),20)}return!1}function VA(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function WA(e,t){let n=t.keyCode,r=VA(t);if(n==8||Rr&&n==72&&r=="c")return mC(e,-1)||qa(e,-1);if(n==46&&!t.shiftKey||Rr&&n==68&&r=="c")return mC(e,1)||qa(e,1);if(n==13||n==27)return!0;if(n==37||Rr&&n==66&&r=="c"){let o=n==37?hC(e,e.state.selection.from)=="ltr"?-1:1:-1;return dC(e,o,r)||qa(e,o)}else if(n==39||Rr&&n==70&&r=="c"){let o=n==39?hC(e,e.state.selection.from)=="ltr"?1:-1:1;return dC(e,o,r)||qa(e,o)}else{if(n==38||Rr&&n==80&&r=="c")return pC(e,-1,r)||qa(e,-1);if(n==40||Rr&&n==78&&r=="c")return HA(e)||pC(e,1,r)||qa(e,1);if(r==(Rr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Jh(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=e.someProp("clipboardSerializer")||Ji.fromSchema(e.state.schema),s=EC(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=xC[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=s.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
|
|
45
|
+
|
|
46
|
+
`);return{dom:l,text:f,slice:t}}function vC(e,t,n,r,o){let i=o.parent.type.spec.code,a,s;if(!n&&!t)return null;let l=!!t&&(r||i||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||r,e)}),i)return s=new He(be.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
47
|
+
`))),0,0),e.someProp("transformPasted",f=>{s=f(s,e,!0)}),s;let d=e.someProp("clipboardTextParser",f=>f(t,o,r,e));if(d)s=d;else{let f=o.marks(),{schema:h}=e.state,p=Ji.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=a.appendChild(document.createElement("p"));v&&m.appendChild(p.serializeNode(h.text(v,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),a=GA(n),rl&&XA(a);let c=a&&a.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||Bo.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!UA.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)s=YA(SC(s,+u[1],+u[2]),u[4]);else if(s=He.maxOpen(qA(s.content,o),!0),s.openStart||s.openEnd){let d=0,f=0;for(let h=s.content.firstChild;d<s.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=s.content.lastChild;f<s.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);s=SC(s,d,f)}return e.someProp("transformPasted",d=>{s=d(s,e,l)}),s}const UA=/^(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 qA(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(s=>{if(!a)return;let l=o.findWrapping(s.type),c;if(!l)return a=null;if(c=a.length&&i.length&&yC(l,i,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=CC(a[a.length-1],i.length));let u=bC(s,l);a.push(u),o=o.matchType(u.type),i=l}}),a)return be.from(a)}return e}function bC(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,be.from(e));return e}function yC(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=yC(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(be.from(bC(n,e,o+1))))}}function CC(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,CC(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(be.empty,!0);return e.copy(n.append(r))}function Qh(e,t,n,r,o,i){let a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(i=0),o<r-1&&(s=Qh(s,t,n,r,o+1,i)),o>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(be.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function SC(e,t,n){return t<e.openStart&&(e=new He(Qh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new He(Qh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const xC={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let wC=null;function EC(){return wC||(wC=document.implementation.createHTMLDocument("title"))}let Zh=null;function KA(e){let t=window.trustedTypes;return t?(Zh||(Zh=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Zh.createHTML(e)):e}function GA(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=EC().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&xC[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=KA(e),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function XA(e){let t=e.querySelectorAll(qn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function YA(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:o,openStart:i,openEnd:a}=e;for(let s=r.length-2;s>=0;s-=2){let l=n.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;o=be.from(l.create(r[s+1],o)),i++,a++}return new He(o,i,a)}const or={},ir={},JA={touchstart:!0,touchmove:!0};class QA{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 ZA(e){for(let t in or){let n=or[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{tR(e,r)&&!tp(e,r)&&(e.editable||!(r.type in ir))&&n(e,r)},JA[t]?{passive:!0}:void 0)}Qn&&e.dom.addEventListener("input",()=>null),ep(e)}function vi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function eR(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ep(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>tp(e,r))})}function tp(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function tR(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function nR(e,t){!tp(e,t)&&or[t.type]&&(e.editable||!(t.type in ir))&&or[t.type](e,t)}ir.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!OC(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Vo&&qn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Wa&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,ea(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||WA(e,n)?n.preventDefault():vi(e,"key")},ir.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},ir.keypress=(e,t)=>{let n=t;if(OC(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Rr&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof lt)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",a=>a(e,r.$from.pos,r.$to.pos,o,i))&&e.dispatch(i()),n.preventDefault()}};function Gc(e){return{left:e.clientX,top:e.clientY}}function rR(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function np(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let a=i.depth+1;a>0;a--)if(e.someProp(t,s=>a>i.depth?s(e,n,i.nodeAfter,i.before(a),o,!0):s(e,n,i.node(a),i.before(a),o,!1)))return!0;return!1}function Ka(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function oR(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&at.isSelectable(r)?(Ka(e,new at(n)),!0):!1}function iR(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof at&&(r=n.node);let i=e.state.doc.resolve(t);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a);if(at.isSelectable(s)){r&&n.$from.depth>0&&a>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(a);break}}return o!=null?(Ka(e,at.create(e.state.doc,o)),!0):!1}function aR(e,t,n,r,o){return np(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?iR(e,n):oR(e,n))}function sR(e,t,n,r){return np(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function lR(e,t,n,r){return np(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||cR(e,n,r)}function cR(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Ka(e,lt.create(r,0,r.content.size)),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)Ka(e,lt.create(r,s+1,s+1+a.content.size));else if(at.isSelectable(a))Ka(e,at.create(r,s));else continue;return!0}}function rp(e){return Xc(e)}const $C=Rr?"metaKey":"ctrlKey";or.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=rp(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&rR(n,e.input.lastClick)&&!n[$C]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let a=e.posAtCoords(Gc(n));a&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new uR(e,a,n,!!r)):(i=="doubleClick"?sR:lR)(e,a.pos,a.inside,n)?n.preventDefault():vi(e,"pointer"))};class uR{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[$C],this.allowDefault=r.shiftKey;let i,a;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);i=u.parent,a=u.depth?u.before():0}const s=o?null:r.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=t.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof at&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ar&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),vi(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Uo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Gc(t))),this.updateAllowDefault(t),this.allowDefault||!n?vi(this.view,"pointer"):aR(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Qn&&this.mightDrag&&!this.mightDrag.node.isAtom||qn&&!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)?(Ka(this.view,ht.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):vi(this.view,"pointer")}move(t){this.updateAllowDefault(t),vi(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}or.touchstart=e=>{e.input.lastTouch=Date.now(),rp(e),vi(e,"pointer")},or.touchmove=e=>{e.input.lastTouch=Date.now(),vi(e,"pointer")},or.contextmenu=e=>rp(e);function OC(e,t){return e.composing?!0:Qn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const dR=Vo?5e3:-1;ir.compositionstart=ir.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof lt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||qn&&Ly&&fR(e)))e.markCursor=e.state.storedMarks||n.marks(),Xc(e,!0),e.markCursor=null;else if(Xc(e,!t.selection.empty),Ar&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(a.nodeType==3){let s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else o=a,i=-1}}e.input.composing=!0}kC(e,dR)};function fR(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ir.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,kC(e,20))};function kC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Xc(e),t))}function MC(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=pR());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function hR(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=iA(t.focusNode,t.focusOffset),r=aA(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function pR(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Xc(e,t=!1){if(!(Vo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),MC(e),t||e.docView&&e.docView.dirty){let n=qh(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function mR(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const ll=dr&&hi<15||Wa&&uA<604;or.copy=ir.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=ll?null:n.clipboardData,a=r.content(),{dom:s,text:l}=Jh(e,a);i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):mR(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function gR(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function vR(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.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=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?cl(e,r.value,null,o,t):cl(e,r.textContent,r.innerHTML,o,t)},50)}function cl(e,t,n,r,o){let i=vC(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||He.empty)))return!0;if(!i)return!1;let a=gR(i),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function NC(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ir.paste=(e,t)=>{let n=t;if(e.composing&&!Vo)return;let r=ll?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&cl(e,NC(r),r.getData("text/html"),o,n)?n.preventDefault():vR(e,n)};class TC{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const bR=Rr?"altKey":"ctrlKey";function IC(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[bR]}or.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Gc(n)),a;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof at?o.to-1:o.to))){if(r&&r.mightDrag)a=at.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(a=at.create(e.state.doc,d.posBefore))}}let s=(a||e.state.selection).content(),{dom:l,text:c,slice:u}=Jh(e,s);(!n.dataTransfer.files.length||!qn||Dy>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ll?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ll||n.dataTransfer.setData("text/plain",c),e.dragging=new TC(u,IC(e,n),a)},or.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},ir.dragover=ir.dragenter=(e,t)=>t.preventDefault(),ir.drop=(e,t)=>{try{yR(e,t,e.dragging)}finally{e.dragging=null}};function yR(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Gc(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",h=>{i=h(i,e,!1)}):i=vC(e,NC(t.dataTransfer),ll?null:t.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&IC(e,t));if(e.someProp("handleDrop",h=>h(e,t,i||He.empty,a))){t.preventDefault();return}if(!i)return;t.preventDefault();let s=i?ay(e.state.doc,o.pos,i):o.pos;s==null&&(s=o.pos);let l=e.state.tr;if(a){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(s),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(d))return;let f=l.doc.resolve(c);if(u&&at.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new at(f));else{let h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((p,v,m,b)=>h=b),l.setSelection(Gh(e,f,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}or.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Uo(e)},20))},or.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},or.beforeinput=(e,t)=>{if(qn&&Vo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,ea(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in ir)or[e]=ir[e];function ul(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Yc{constructor(t,n){this.toDOM=t,this.spec=n||oa,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:a}=t.mapResult(n.from+o,this.side<0?-1:1);return a?null:new jn(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Yc&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ul(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class bi{constructor(t,n){this.attrs=t,this.spec=n||oa}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=a?null:new jn(i,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof bi&&ul(this.attrs,t.attrs)&&ul(this.spec,t.spec)}static is(t){return t.type instanceof bi}destroy(){}}class op{constructor(t,n){this.attrs=t,this.spec=n||oa}map(t,n,r,o){let i=t.mapResult(n.from+o,1);if(i.deleted)return null;let a=t.mapResult(n.to+o,-1);return a.deleted||a.pos<=i.pos?null:new jn(i.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),i;return o==n.from&&!(i=t.child(r)).isText&&o+i.nodeSize==n.to}eq(t){return this==t||t instanceof op&&ul(this.attrs,t.attrs)&&ul(this.spec,t.spec)}destroy(){}}class jn{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new jn(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new jn(t,t,new Yc(n,r))}static inline(t,n,r,o){return new jn(t,n,new bi(r,o))}static node(t,n,r,o){return new jn(t,n,new op(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof bi}get widget(){return this.type instanceof Yc}}const Ga=[],oa={};class sn{constructor(t,n){this.local=t.length?t:Ga,this.children=n.length?n:Ga}static create(t,n){return n.length?Jc(n,t,0,oa):Zn}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,i){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=n&&s.to>=t&&(!i||i(s.spec))&&r.push(s.copy(s.from+o,s.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let s=this.children[a]+1;this.children[a+2].findInner(t-s,n-s,r,o+s,i)}}map(t,n,r){return this==Zn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||oa)}mapInner(t,n,r,o,i){let a;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(t,r,o);l&&l.type.valid(n,l)?(a||(a=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?CR(this.children,a||[],t,n,r,o,i):a?new sn(a.sort(ia),Ga):Zn}add(t,n){return n.length?this==Zn?sn.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((s,l)=>{let c=l+r,u;if(u=AC(n,s,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(s,u,c+1):o.splice(i,0,l,l+s.nodeSize,Jc(u,s,c+1,oa)),i+=3}});let a=PC(i?RC(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new sn(a.length?this.local.concat(a).sort(ia):this.local,o||this.children)}remove(t){return t.length==0||this==Zn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let a,s=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<t.length;u++)(d=t[u])&&d.from>s&&d.to<l&&(t[u]=null,(a||(a=[])).push(d));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(a,s+1);c!=Zn?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,a;i<t.length;i++)if(a=t[i])for(let s=0;s<o.length;s++)o[s].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(s--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new sn(o,r):Zn}forChild(t,n){if(this==Zn)return this;if(n.isLeaf)return sn.empty;let r,o;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let i=t+1,a=i+n.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof bi){let c=Math.max(i,l.from)-i,u=Math.min(a,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let s=new sn(o.sort(ia),Ga);return r?new yi([s,r]):s}return r||Zn}eq(t){if(this==t)return!0;if(!(t instanceof sn)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return ip(this.localsInner(t))}localsInner(t){if(this==Zn)return Ga;if(t.inlineContent||!this.local.some(bi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof bi||n.push(this.local[r]);return n}forEachSet(t){t(this)}}sn.empty=new sn([],[]),sn.removeOverlap=ip;const Zn=sn.empty;class yi{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,oa));return yi.from(r)}forChild(t,n){if(n.isLeaf)return sn.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=Zn&&(i instanceof yi?r=r.concat(i.members):r.push(i))}return yi.from(r)}eq(t){if(!(t instanceof yi)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let a=0;a<i.length;a++)n.push(i[a])}}return n?ip(r?n:n.sort(ia)):Ga}static from(t){switch(t.length){case 0:return Zn;case 1:return t[0];default:return new yi(t.every(n=>n instanceof sn)?t:t.reduce((n,r)=>n.concat(r instanceof sn?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function CR(e,t,n,r,o,i,a){let s=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,v)=>{let m=v-p-(h-f);for(let b=0;b<s.length;b+=3){let y=s[b+1];if(y<0||f>y+u-d)continue;let C=s[b]+u-d;h>=C?s[b+1]=f<=C?-2:-1:f>=u&&m&&(s[b]+=m,s[b+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){l=!0,s[c+1]=-1;continue}let u=n.map(e[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(e[c+1]+i,-1),h=f-o,{index:p,offset:v}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&v==d&&v+m.nodeSize==h){let b=s[c+2].mapInner(n,m,u+1,e[c]+i+1,a);b!=Zn?(s[c]=d,s[c+1]=h,s[c+2]=b):(s[c+1]=-2,l=!0)}else l=!0}if(l){let c=SR(s,e,t,n,o,i,a),u=Jc(c,r,0,a);t=u.local;for(let d=0;d<s.length;d+=3)s[d+1]<0&&(s.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<s.length&&s[f]<h;)f+=3;s.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new sn(t.sort(ia),s)}function PC(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new jn(o.from+t,o.to+t,o.type))}return n}function SR(e,t,n,r,o,i,a){function s(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):a.onRemove&&a.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)s(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&s(e[l+2],t[l]+i+1);return n}function AC(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i=0,a;i<e.length;i++)(a=e[i])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),e[i]=null);return o}function RC(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Jc(e,t,n,r){let o=[],i=!1;t.forEach((s,l)=>{let c=AC(e,s,l+n);if(c){i=!0;let u=Jc(c,s,n+l+1,r);u!=Zn&&o.push(l,l+s.nodeSize,u)}});let a=PC(i?RC(e):e,-n).sort(ia);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new sn(a,o):Zn}function ia(e,t){return e.from-t.from||e.to-t.to}function ip(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),_C(t,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),_C(t,o,r.copy(i.from,r.to)));break}}}return t}function _C(e,t,n){for(;t<e.length&&ia(n,e[t])>0;)t++;e.splice(t,0,n)}function ap(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Zn&&t.push(r)}),e.cursorWrapper&&t.push(sn.create(e.state.doc,[e.cursorWrapper.deco])),yi.from(t)}const xR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},wR=dr&&hi<=11;class ER{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class $R{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ER,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]);dr&&hi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Qn&&t.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),wR&&(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,xR)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(cC(this.view)){if(this.suppressingSelectionUpdates)return Uo(this.view);if(dr&&hi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Zi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Va(i))n.add(i);for(let i=t.anchorNode;i;i=Va(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&cC(t)&&!this.ignoreSelectionChange(r),i=-1,a=-1,s=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),a=a<0?d.to:Math.max(d.to,a),d.typeOver&&(s=!0))}if(l.some(u=>u.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(Ar&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||MR(t,d)!=h)&&f.remove()}}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Wc(r)&&(c=qh(t))&&c.eq(ht.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Uo(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,a),OR(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,NR(t,l)),this.handleDOMChange(i,a,s,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Uo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++){let d=t.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,i=t.nextSibling;if(dr&&hi<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=t.addedNodes[u];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f)}let a=o&&o.parentNode==t.target?Un(o)+1:0,s=r.localPosFromDOM(t.target,a,-1),l=i&&i.parentNode==t.target?Un(i):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:s,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let DC=new WeakMap,LC=!1;function OR(e){if(!DC.has(e)&&(DC.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ar,LC)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."),LC=!0}}function jC(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return Zi(a.node,a.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function kR(e,t){if(t.getComposedRanges){let o=t.getComposedRanges(e.root)[0];if(o)return jC(e,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?jC(e,n):null}function MR(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function NR(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=i.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let s=a;for(;;){let l=s.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;s=l}s.insertBefore(i,s.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}function TR(e,t,n){let{node:r,fromOffset:o,toOffset:i,from:a,to:s}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c,u=l.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Wc(l)||c.push({node:l.focusNode,offset:l.focusOffset})),qn&&e.input.lastKeyCode===8)for(let m=i;m>o;m--){let b=r.childNodes[m-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){i=m;break}if(!y||y.size)break}let d=e.state.doc,f=e.someProp("domParser")||Bo.fromSchema(e.state.schema),h=d.resolve(a),p=null,v=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:IR,context:h});if(c&&c[0].pos!=null){let m=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=m),p={anchor:m+a,head:b+a}}return{doc:v,sel:p,from:a,to:s}}function IR(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Qn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Qn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const PR=/^(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 AR(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let $=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=qh(e,$);if(O&&!e.state.selection.eq(O)){if(qn&&Vo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",M=>M(e,ea(13,"Enter"))))return;let k=e.state.tr.setSelection(O);$=="pointer"?k.setMeta("pointer",!0):$=="key"&&k.scrollIntoView(),i&&k.setMeta("composition",i),e.dispatch(k)}return}let a=e.state.doc.resolve(t),s=a.sharedDepth(n);t=a.before(s+1),n=e.state.doc.resolve(n).after(s+1);let l=e.state.selection,c=TR(e,t,n),u=e.state.doc,d=u.slice(c.from,c.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let p=DR(d.content,c.doc.content,c.from,f,h);if(p&&e.input.domChangeCount++,(Wa&&e.input.lastIOSEnter>Date.now()-225||Vo)&&o.some($=>$.nodeType==1&&!PR.test($.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",$=>$(e,ea(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof lt&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let $=zC(e,e.state.doc,c.sel);if($&&!$.eq(e.state.selection)){let O=e.state.tr.setSelection($);i&&O.setMeta("composition",i),e.dispatch(O)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof lt&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),dr&&hi<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)==" "&&(p.start--,p.endA--,p.endB--);let v=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),b=u.resolve(p.start),y=v.sameParent(m)&&v.parent.inlineContent&&b.end()>=p.endA;if((Wa&&e.input.lastIOSEnter>Date.now()-225&&(!y||o.some($=>$.nodeName=="DIV"||$.nodeName=="P"))||!y&&v.pos<c.doc.content.size&&(!v.sameParent(m)||!v.parent.inlineContent)&&v.pos<m.pos&&!/\S/.test(c.doc.textBetween(v.pos,m.pos,"","")))&&e.someProp("handleKeyDown",$=>$(e,ea(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&_R(u,p.start,p.endA,v,m)&&e.someProp("handleKeyDown",$=>$(e,ea(8,"Backspace")))){Vo&&qn&&e.domObserver.suppressSelectionUpdates();return}qn&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),Vo&&!y&&v.start()!=m.start()&&m.parentOffset==0&&v.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function($){return $(e,ea(13,"Enter"))})},20));let C=p.start,x=p.endA,S=$=>{let O=$||e.state.tr.replace(C,x,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let k=zC(e,O.doc,c.sel);k&&!(qn&&e.composing&&k.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(k.head==C||k.head==O.mapping.map(x)-1)||dr&&k.empty&&k.head==C)&&O.setSelection(k)}return i&&O.setMeta("composition",i),O.scrollIntoView()},E;if(y)if(v.pos==m.pos){dr&&hi<=11&&v.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Uo(e),20));let $=S(e.state.tr.delete(C,x)),O=u.resolve(p.start).marksAcross(u.resolve(p.endA));O&&$.ensureMarks(O),e.dispatch($)}else if(p.endA==p.endB&&(E=RR(v.parent.content.cut(v.parentOffset,m.parentOffset),b.parent.content.cut(b.parentOffset,p.endA-b.start())))){let $=S(e.state.tr);E.type=="add"?$.addMark(C,x,E.mark):$.removeMark(C,x,E.mark),e.dispatch($)}else if(v.parent.child(v.index()).isText&&v.index()==m.index()-(m.textOffset?0:1)){let $=v.parent.textBetween(v.parentOffset,m.parentOffset),O=()=>S(e.state.tr.insertText($,C,x));e.someProp("handleTextInput",k=>k(e,C,x,$,O))||e.dispatch(O())}else e.dispatch(S());else e.dispatch(S())}function zC(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Gh(e,t.resolve(n.anchor),t.resolve(n.head))}function RR(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,a,s,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)s=o[0],a="add",l=u=>u.mark(s.addToSet(u.marks));else if(o.length==0&&i.length==1)s=i[0],a="remove",l=u=>u.mark(s.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(be.from(c).eq(e))return{mark:s,type:a}}function _R(e,t,n,r,o){if(n-t<=o.pos-r.pos||sp(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let s=i.nodeAfter;return s!=null&&n==t+s.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let a=e.resolve(sp(i,!0,!0));return!a.parent.isTextblock||a.pos>n||sp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function sp(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function DR(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(a,s));r-=a+l-i}if(a<i&&e.size<t.size){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&BC(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}else if(s<i){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&BC(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}return{start:i,endA:a,endB:s}}function BC(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class FC{constructor(t,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 QA,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(qC),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=WC(this),VC(this),this.nodeViews=UC(this),this.docView=Jy(this.state.doc,HC(this),ap(this),this.dom,this),this.domObserver=new $R(this,(r,o,i,a)=>AR(this,r,o,i,a)),this.domObserver.start(),ZA(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ep(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(qC),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let o=this.state,i=!1,a=!1;t.storedMarks&&this.composing&&(MC(this),a=!0),this.state=t;let s=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=UC(this);jR(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&ep(this),this.editable=WC(this),VC(this);let l=ap(this),c=HC(this),u=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(t.doc,c,l);(d||!t.selection.eq(o.selection))&&(a=!0);let f=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&hA(this);if(a){this.domObserver.stop();let h=d&&(dr||qn)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&LR(o.selection,t.selection);if(d){let p=qn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=hR(this)),(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Jy(t.doc,c,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&LA(this))?Uo(this,h):(sC(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&pA(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof at){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&jy(this,n.getBoundingClientRect(),t)}else jy(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.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,t)}}updateDraggedNode(t,n){let r=t.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new TC(t.slice,t.move,o<0?void 0:at.create(this.state.doc,o))}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[t];if(s!=null&&(o=n?n(s):s))return o}let i=this.state.plugins;if(i)for(let a=0;a<i.length;a++){let s=i[a].props[t];if(s!=null&&(o=n?n(s):s))return o}}hasFocus(){if(dr){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&mA(this.dom),Uo(this),this.domObserver.start()}get root(){let t=this._root;if(t==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 t||document}updateRoot(){this._root=null}posAtCoords(t){return CA(this,t)}coordsAtPos(t,n=1){return Wy(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return $A(this,n||this.state,t)}pasteHTML(t,n){return cl(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return cl(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Jh(this,t)}destroy(){this.docView&&(eR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ap(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rA())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return nR(this,t)}domSelectionRange(){let t=this.domSelection();return t?Qn&&this.root.nodeType===11&&lA(this.dom.ownerDocument)==this.dom&&kR(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}FC.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function HC(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[jn.node(0,e.state.doc.content.size,t)]}function VC(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:jn.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function WC(e){return!e.someProp("editable",t=>t(e.state)===!1)}function LR(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function UC(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function jR(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function qC(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Ci={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:"'"},Qc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zR=typeof navigator<"u"&&/Mac/.test(navigator.platform),BR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Kn=0;Kn<10;Kn++)Ci[48+Kn]=Ci[96+Kn]=String(Kn);for(var Kn=1;Kn<=24;Kn++)Ci[Kn+111]="F"+Kn;for(var Kn=65;Kn<=90;Kn++)Ci[Kn]=String.fromCharCode(Kn+32),Qc[Kn]=String.fromCharCode(Kn);for(var lp in Ci)Qc.hasOwnProperty(lp)||(Qc[lp]=Ci[lp]);function FR(e){var t=zR&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||BR&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Qc:Ci)[e.keyCode]||e.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 HR=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),VR=typeof navigator<"u"&&/Win/.test(navigator.platform);function WR(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,a;for(let s=0;s<t.length-1;s++){let l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))HR?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function UR(e){let t=Object.create(null);for(let n in e)t[WR(n)]=e[n];return t}function cp(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function qR(e){return new Kt({props:{handleKeyDown:up(e)}})}function up(e){let t=UR(e);return function(n,r){let o=FR(r),i,a=t[cp(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let s=t[cp(o,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(VR&&r.ctrlKey&&r.altKey)&&(i=Ci[r.keyCode])&&i!=o){let s=t[cp(i,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}var KR=Object.defineProperty,dp=(e,t)=>{for(var n in t)KR(e,n,{get:t[n],enumerable:!0})};function Zc(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var eu=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,s])=>[a,(...c)=>{const u=s(...c)(i);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a=[],s=!!e,l=e||o.tr,c=()=>(!s&&t&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),a.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(n).map(([d,f])=>[d,(...p)=>{const v=this.buildProps(l,t),m=f(...p)(v);return a.push(m),u}])),run:c};return u}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([s,l])=>[s,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a={tr:e,editor:r,view:i,state:Zc({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...c)=>l(...c)(a)]))}};return a}},Qr={};dp(Qr,{blur:()=>GR,clearContent:()=>XR,clearNodes:()=>YR,command:()=>JR,createParagraphNear:()=>QR,cut:()=>ZR,deleteCurrentNode:()=>e2,deleteNode:()=>t2,deleteRange:()=>n2,deleteSelection:()=>r2,enter:()=>o2,exitCode:()=>i2,extendMarkRange:()=>a2,first:()=>s2,focus:()=>c2,forEach:()=>u2,insertContent:()=>d2,insertContentAt:()=>p2,joinBackward:()=>v2,joinDown:()=>g2,joinForward:()=>b2,joinItemBackward:()=>y2,joinItemForward:()=>C2,joinTextblockBackward:()=>S2,joinTextblockForward:()=>x2,joinUp:()=>m2,keyboardShortcut:()=>E2,lift:()=>$2,liftEmptyBlock:()=>O2,liftListItem:()=>k2,newlineInCode:()=>M2,resetAttributes:()=>N2,scrollIntoView:()=>T2,selectAll:()=>I2,selectNodeBackward:()=>P2,selectNodeForward:()=>A2,selectParentNode:()=>R2,selectTextblockEnd:()=>_2,selectTextblockStart:()=>D2,setContent:()=>L2,setMark:()=>r_,setMeta:()=>o_,setNode:()=>i_,setNodeSelection:()=>a_,setTextDirection:()=>s_,setTextSelection:()=>l_,sinkListItem:()=>c_,splitBlock:()=>u_,splitListItem:()=>d_,toggleList:()=>h_,toggleMark:()=>p_,toggleNode:()=>m_,toggleWrap:()=>g_,undoInputRule:()=>v_,unsetAllMarks:()=>b_,unsetMark:()=>y_,unsetTextDirection:()=>C_,updateAttributes:()=>S_,wrapIn:()=>x_,wrapInList:()=>w_});var GR=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),XR=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),YR=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:a})=>{e.doc.nodesBetween(i.pos,a.pos,(s,l)=>{if(s.type.isText)return;const{doc:c,mapping:u}=t,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+s.nodeSize)),h=d.blockRange(f);if(!h)return;const p=La(h);if(s.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(h.start,v)}(p||p===0)&&t.lift(h,p)})}),!0},JR=e=>t=>e(t),QR=()=>({state:e,dispatch:t})=>My(e,t),ZR=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,i.content),r.setSelection(new lt(r.doc.resolve(Math.max(a-1,0)))),!0},e2=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(t){const s=o.before(i),l=o.after(i);e.delete(s,l).scrollIntoView()}return!0}return!1};function Nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var t2=e=>({tr:t,state:n,dispatch:r})=>{const o=Nn(e,n.schema),i=t.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===o){if(r){const l=i.before(a),c=i.after(a);t.delete(l,c).scrollIntoView()}return!0}return!1},n2=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},r2=()=>({state:e,dispatch:t})=>Ah(e,t),o2=()=>({commands:e})=>e.keyboardShortcut("Enter"),i2=()=>({state:e,dispatch:t})=>HP(e,t);function fp(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function tu(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:fp(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function KC(e,t,n={}){return e.find(r=>r.type===t&&tu(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function GC(e,t,n={}){return!!KC(e,t,n)}function hp(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===t))return;if(!n){const c=r.node.marks.find(u=>u.type===t);c&&(n=c.attrs)}if(!KC([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,s=i+1,l=a+r.node.nodeSize;for(;i>0&&GC([...e.parent.child(i-1).marks],t,n);)i-=1,a-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&GC([...e.parent.child(s).marks],t,n);)l+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:l}}function qo(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var a2=(e,t)=>({tr:n,state:r,dispatch:o})=>{const i=qo(e,r.schema),{doc:a,selection:s}=n,{$from:l,from:c,to:u}=s;if(o){const d=hp(l,i,t);if(d&&d.from<=c&&d.to>=u){const f=lt.create(a,d.from,d.to);n.setSelection(f)}}return!0},s2=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function pp(e){return e instanceof lt}function Ko(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function XC(e,t=null){if(!t)return null;const n=ht.atStart(e),r=ht.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const o=n.from,i=r.to;return t==="all"?lt.create(e,Ko(0,o,i),Ko(e.content.size,o,i)):lt.create(e,Ko(t,o,i),Ko(t,o,i))}function mp(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function dl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function l2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var c2=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const a=()=>{(dl()||mp())&&r.dom.focus(),l2()&&!dl()&&!mp()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(i&&e===null&&!pp(n.state.selection))return a(),!0;const s=XC(o.doc,e)||n.state.selection,l=n.state.selection.eq(s);return i&&(l||o.setSelection(s),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},u2=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),d2=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),YC=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&YC(r)}return e};function fl(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return YC(n)}function hl(e,t,n){if(e instanceof li||e instanceof be)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,o=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return be.fromArray(e.map(s=>t.nodeFromJSON(s)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),hl("",t,n)}if(o){if(n.errorOnInvalidContent){let a=!1,s="";const l=new B0({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Bo.fromSchema(l).parseSlice(fl(e),n.parseOptions):Bo.fromSchema(l).parse(fl(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const i=Bo.fromSchema(t);return n.slice?i.parseSlice(fl(e),n.parseOptions).content:i.parse(fl(e),n.parseOptions)}return hl("",t,n)}function f2(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Mn||o instanceof Ln))return;const i=e.mapping.maps[r];let a=0;i.forEach((s,l,c,u)=>{a===0&&(a=u)}),e.setSelection(ht.near(e.doc.resolve(a),n))}var h2=e=>!("type"in e),p2=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var a;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;const l=m=>{i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{hl(t,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){l(m)}try{s=hl(t,i.schema,{parseOptions:c,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:i.options.enableContentCheck})}catch(m){return l(m),!1}let{from:u,to:d}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},f=!0,h=!0;if((h2(s)?s:[s]).forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,h=h?m.isBlock:!1}),u===d&&h){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,d+=1)}let v;if(f){if(Array.isArray(t))v=t.map(m=>m.text||"").join("");else if(t instanceof be){let m="";t.forEach(b=>{b.text&&(m+=b.text)}),v=m}else typeof t=="object"&&t&&t.text?v=t.text:v=t;r.insertText(v,u,d)}else{v=s;const m=r.doc.resolve(u),b=m.node(),y=m.parentOffset===0,C=b.isText||b.isTextblock,x=b.content.size>0;y&&C&&x&&h&&(u=Math.max(0,u-1)),r.replaceWith(u,d,v)}n.updateSelection&&f2(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:v}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:v})}return!0},m2=()=>({state:e,dispatch:t})=>zP(e,t),g2=()=>({state:e,dispatch:t})=>BP(e,t),v2=()=>({state:e,dispatch:t})=>Sy(e,t),b2=()=>({state:e,dispatch:t})=>$y(e,t),y2=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Bc(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},C2=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Bc(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},S2=()=>({state:e,dispatch:t})=>LP(e,t),x2=()=>({state:e,dispatch:t})=>jP(e,t);function JC(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function w2(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,o,i,a;for(let s=0;s<t.length-1;s+=1){const l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))dl()||JC()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var E2=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=w2(e).split(/-(?!$)/),a=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,s))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Si(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,a=t?Nn(t,e.schema):null,s=[];e.doc.nodesBetween(r,o,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(o,f+d.nodeSize);s.push({node:d,from:h,to:p})});const l=o-r,c=s.filter(d=>a?a.name===d.node.type.name:!0).filter(d=>tu(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}var $2=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Si(n,o,t)?FP(n,r):!1},O2=()=>({state:e,dispatch:t})=>Ny(e,t),k2=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return ZP(r)(t,n)},M2=()=>({state:e,dispatch:t})=>ky(e,t);function nu(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function QC(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,o)=>(n.includes(o)||(r[o]=e[o]),r),{})}var N2=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null;const s=nu(typeof e=="string"?e:e.name,r.schema);if(!s)return!1;s==="node"&&(i=Nn(e,r.schema)),s==="mark"&&(a=qo(e,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{i&&i===u.type&&(l=!0,o&&n.setNodeMarkup(d,void 0,QC(u.attrs,t))),a&&u.marks.length&&u.marks.forEach(f=>{a===f.type&&(l=!0,o&&n.addMark(d,d+u.nodeSize,a.create(QC(f.attrs,t))))})})}),l},T2=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),I2=()=>({tr:e,dispatch:t})=>{if(t){const n=new br(e.doc);e.setSelection(n)}return!0},P2=()=>({state:e,dispatch:t})=>wy(e,t),A2=()=>({state:e,dispatch:t})=>Oy(e,t),R2=()=>({state:e,dispatch:t})=>UP(e,t),_2=()=>({state:e,dispatch:t})=>GP(e,t),D2=()=>({state:e,dispatch:t})=>KP(e,t);function gp(e,t,n={},r={}){return hl(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var L2=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:a,commands:s})=>{const{doc:l}=i;if(r.preserveWhitespace!=="full"){const c=gp(e,o.schema,r,{errorOnInvalidContent:t??o.options.enableContentCheck});return a&&i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return a&&i.setMeta("preventUpdate",!n),s.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:t??o.options.enableContentCheck})};function ZC(e,t){const n=qo(t,e.schema),{from:r,to:o,empty:i}=e.selection,a=[];i?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,l=>{a.push(...l.marks)});const s=a.find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function eS(e,t){const n=new Mh(e);return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function j2(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function z2(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function tS(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function ru(e){return t=>tS(t.$from,e)}function nt(e,t,n){return e.config[t]===void 0&&e.parent?nt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?nt(e.parent,t,n):null}):e.config[t]}function ou(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=nt(t,"addExtensions",n);return r?[t,...ou(r())]:t}).flat(10)}function vp(e,t){const n=Ji.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function nS(e){return typeof e=="function"}function Vt(e,t=void 0,...n){return nS(e)?t?e.bind(t)(...n):e(...n):e}function B2(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Xa(e){const t=e.filter(o=>o.type==="extension"),n=e.filter(o=>o.type==="node"),r=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function rS(e){const t=[],{nodeExtensions:n,markExtensions:r}=Xa(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(c=>c.name!=="text").map(c=>c.name),s=r.map(c=>c.name),l=[...a,...s];return e.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:o},d=nt(c,"addGlobalAttributes",u);if(!d)return;d().forEach(h=>{let p;Array.isArray(h.types)?p=h.types:h.types==="*"?p=l:h.types==="nodes"?p=a:h.types==="marks"?p=s:p=[],p.forEach(v=>{Object.entries(h.attributes).forEach(([m,b])=>{t.push({type:v,name:m,attribute:{...i,...b}})})})})}),o.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},d=nt(c,"addAttributes",u);if(!d)return;const f=d();Object.entries(f).forEach(([h,p])=>{const v={...i,...p};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,t.push({type:c.name,name:h,attribute:v})})}),t}function F2(e){const t=[];let n="",r=!1,o=!1,i=0;const a=e.length;for(let s=0;s<a;s+=1){const l=e[s];if(l==="'"&&!o){r=!r,n+=l;continue}if(l==='"'&&!r){o=!o,n+=l;continue}if(!r&&!o){if(l==="("){i+=1,n+=l;continue}if(l===")"&&i>0){i-=1,n+=l;continue}if(l===";"&&i===0){t.push(n),n="";continue}}n+=l}return n&&t.push(n),t}function oS(e){const t=[],n=F2(e||""),r=n.length;for(let o=0;o<r;o+=1){const i=n[o],a=i.indexOf(":");if(a===-1)continue;const s=i.slice(0,a).trim(),l=i.slice(a+1).trim();s&&l&&t.push([s,l])}return t}function en(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const s=i?String(i).split(" "):[],l=r[o]?r[o].split(" "):[],c=s.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const s=new Map([...oS(r[o]),...oS(i)]);r[o]=Array.from(s.entries()).map(([l,c])=>`${l}: ${c}`).join("; ")}else r[o]=i}),r},{})}function Ya(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>en(n,r),{})}function H2(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function iS(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const o=t.reduce((i,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(n):H2(n.getAttribute(a.name));return s==null?i:{...i,[a.name]:s}},{});return{...r,...o}}}}function aS(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&B2(n)?!1:n!=null))}function sS(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function lS(e,t){var n;const r=rS(e),{nodeExtensions:o,markExtensions:i}=Xa(e),a=(n=o.find(c=>nt(c,"topNode")))==null?void 0:n.name,s=Object.fromEntries(o.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},f=e.reduce((b,y)=>{const C=nt(y,"extendNodeSchema",d);return{...b,...C?C(c):{}}},{}),h=aS({...f,content:Vt(nt(c,"content",d)),marks:Vt(nt(c,"marks",d)),group:Vt(nt(c,"group",d)),inline:Vt(nt(c,"inline",d)),atom:Vt(nt(c,"atom",d)),selectable:Vt(nt(c,"selectable",d)),draggable:Vt(nt(c,"draggable",d)),code:Vt(nt(c,"code",d)),whitespace:Vt(nt(c,"whitespace",d)),linebreakReplacement:Vt(nt(c,"linebreakReplacement",d)),defining:Vt(nt(c,"defining",d)),isolating:Vt(nt(c,"isolating",d)),attrs:Object.fromEntries(u.map(sS))}),p=Vt(nt(c,"parseHTML",d));p&&(h.parseDOM=p.map(b=>iS(b,u)));const v=nt(c,"renderHTML",d);v&&(h.toDOM=b=>v({node:b,HTMLAttributes:Ya(b,u)}));const m=nt(c,"renderText",d);return m&&(h.toText=m),[c.name,h]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},f=e.reduce((m,b)=>{const y=nt(b,"extendMarkSchema",d);return{...m,...y?y(c):{}}},{}),h=aS({...f,inclusive:Vt(nt(c,"inclusive",d)),excludes:Vt(nt(c,"excludes",d)),group:Vt(nt(c,"group",d)),spanning:Vt(nt(c,"spanning",d)),code:Vt(nt(c,"code",d)),attrs:Object.fromEntries(u.map(sS))}),p=Vt(nt(c,"parseHTML",d));p&&(h.parseDOM=p.map(m=>iS(m,u)));const v=nt(c,"renderHTML",d);return v&&(h.toDOM=m=>v({mark:m,HTMLAttributes:Ya(m,u)})),[c.name,h]}));return new B0({topNode:a,nodes:s,marks:l})}function V2(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function pl(e){return e.sort((n,r)=>{const o=nt(n,"priority")||100,i=nt(r,"priority")||100;return o>i?-1:o<i?1:0})}function bp(e){const t=pl(ou(e)),n=V2(t.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.`),t}function W2(e,t){const n=bp(e);return lS(n,t)}function U2(e,t){const n=W2(t),r=fl(e);return Bo.fromSchema(n).parse(r).toJSON()}function cS(e,t,n){const{from:r,to:o}=t,{blockSeparator:i=`
|
|
48
|
+
|
|
49
|
+
`,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,o,(l,c,u,d)=>{var f;l.isBlock&&c>r&&(s+=i);const h=a==null?void 0:a[l.type.name];if(h)return u&&(s+=h({node:l,pos:c,parent:u,index:d,range:t})),!1;l.isText&&(s+=(f=l==null?void 0:l.text)==null?void 0:f.slice(Math.max(r,c)-c,o-c))}),s}function uS(e,t){const n={from:0,to:e.content.size};return cS(e,n,t)}function yp(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function q2(e,t){const n=Nn(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,s=>{i.push(s)});const a=i.reverse().find(s=>s.type.name===n.name);return a?{...a.attrs}:{}}function dS(e,t){const n=nu(typeof t=="string"?t:t.name,e.schema);return n==="node"?q2(e,t):n==="mark"?ZC(e,t):{}}function K2(e,t=JSON.stringify){const n={};return e.filter(r=>{const o=t(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function G2(e){const t=K2(e);return t.length===1?t:t.filter((n,r)=>!t.filter((i,a)=>a!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function fS(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((o,i)=>{const a=[];if(o.ranges.length)o.forEach((s,l)=>{a.push({from:s,to:l})});else{const{from:s,to:l}=n[i];if(s===void 0||l===void 0)return;a.push({from:s,to:l})}a.forEach(({from:s,to:l})=>{const c=t.slice(i).map(s,-1),u=t.slice(i).map(l),d=t.invert().map(c,-1),f=t.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),G2(r)}function Cp(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(o=>{const i=n.resolve(e),a=hp(i,o.type);a&&r.push({mark:o,...a})}):n.nodesBetween(e,t,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(a=>({from:i,to:i+o.nodeSize,mark:a})))}),r}var X2=(e,t,n,r=20)=>{const o=e.doc.resolve(n);let i=r,a=null;for(;i>0&&a===null;){const s=o.node(i);(s==null?void 0:s.type.name)===t?a=s:i-=1}return[a,i]};function ml(e,t){return t.nodes[e]||t.marks[e]||null}function iu(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=e.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var Y2=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(o,i,a,s)=>{var l,c;const u=((c=(l=o.type.spec).toText)==null?void 0:c.call(l,{node:o,pos:i,parent:a,index:s}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Sp(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?qo(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>tu(d.attrs,n,{strict:!1}));let a=0;const s=[];if(o.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;e.doc.nodesBetween(h,p,(v,m)=>{if(i&&v.inlineContent&&!v.type.allowsMarkType(i))return!1;if(!v.isText&&!v.marks.length)return;const b=Math.max(h,m),y=Math.min(p,m+v.nodeSize),C=y-b;a+=C,s.push(...v.marks.map(x=>({mark:x,from:b,to:y})))})}),a===0)return!1;const l=s.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>tu(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=s.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=a}function J2(e,t,n={}){if(!t)return Si(e,null,n)||Sp(e,null,n);const r=nu(t,e.schema);return r==="node"?Si(e,t,n):r==="mark"?Sp(e,t,n):!1}var Q2=(e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const i=ru(s=>s.type.name===t)(e.selection);if(!i)return!1;const a=e.doc.resolve(i.pos+1);return o.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Z2=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function hS(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function xp(e,t){const{nodeExtensions:n}=Xa(t),r=n.find(a=>a.name===e);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Vt(nt(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function au(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let o=!0;return e.content.forEach(i=>{o!==!1&&(au(i,{ignoreWhitespace:n,checkChildren:t})||(o=!1))}),o}return!1}function pS(e){return e instanceof at}var mS=class TI{constructor(t){this.position=t}static fromJSON(t){return new TI(t.position)}toJSON(){return{position:this.position}}};function e_(e,t){const n=t.mapping.mapResult(e.position);return{position:new mS(n.pos),mapResult:n}}function t_(e){return new mS(e)}function gS(e,t,n){const o=e.state.doc.content.size,i=Ko(t,0,o),a=Ko(n,0,o),s=e.coordsAtPos(i),l=e.coordsAtPos(a,-1),c=Math.min(s.top,l.top),u=Math.max(s.bottom,l.bottom),d=Math.min(s.left,l.left),f=Math.max(s.right,l.right),h=f-d,p=u-c,b={top:c,bottom:u,left:d,right:f,width:h,height:p,x:d,y:c};return{...b,toJSON:()=>b}}function n_(e,t,n){var r;const{selection:o}=t;let i=null;if(pp(o)&&(i=o.$cursor),i){const s=(r=e.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(s)||!s.some(c=>c.type.excludes(n)))}const{ranges:a}=o;return a.some(({$from:s,$to:l})=>{let c=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(v=>v.type.excludes(n));c=h&&p}return!c}),c})}var r_=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:a,ranges:s}=i,l=qo(e,r.schema);if(o)if(a){const c=ZC(r,l);n.addStoredMark(l.create({...c,...t}))}else s.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),v=Math.min(h+f.nodeSize,d);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&n.addMark(p,v,l.create({...b.attrs,...t}))}):n.addMark(p,v,l.create(t))})});return n_(r,n,l)},o_=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),i_=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Nn(e,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:s})=>Py(i,{...a,...t})(n)?!0:s.clearNodes()).command(({state:s})=>Py(i,{...a,...t})(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},a_=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=Ko(e,0,r.content.size),i=at.create(r,o);t.setSelection(i)}return!0},s_=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let a,s;return typeof t=="number"?(a=t,s=t):t&&"from"in t&&"to"in t?(a=t.from,s=t.to):(a=i.from,s=i.to),o&&n.doc.nodesBetween(a,s,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:e})}),!0},l_=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,a=lt.atStart(r).from,s=lt.atEnd(r).to,l=Ko(o,a,s),c=Ko(i,a,s),u=lt.create(r,l,c);t.setSelection(u)}return!0},c_=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return nA(r)(t,n)};function vS(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(o=>t==null?void 0:t.includes(o.type.name));e.tr.ensureMarks(r)}}var u_=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:a}=t,{$from:s,$to:l}=i,c=o.extensionManager.attributes,u=iu(c,s.node().type.name,s.node().attrs);if(i instanceof at&&i.node.isBlock)return!s.parentOffset||!Fo(a,s.pos)?!1:(r&&(e&&vS(n,o.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=s.depth===0?void 0:j2(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=Fo(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!p&&Fo(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(p&&(i instanceof lt&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),f&&!d&&!s.parentOffset&&s.parent.type!==f)){const v=t.mapping.map(s.before()),m=t.doc.resolve(v);s.node(-1).canReplaceWith(m.index(),m.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&vS(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},d_=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var a;const s=Nn(e,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==s)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=be.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-y;O>=l.depth-3;O-=1)b=be.from(l.node(O).copy(b));const C=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,x={...iu(f,l.node().type.name,l.node().attrs),...t},S=((a=s.contentMatch.defaultType)==null?void 0:a.createAndFill(x))||void 0;b=b.append(be.from(s.createAndFill(null,S)||void 0));const E=l.before(l.depth-(y-1));n.replace(E,l.after(-C),new He(b,4-y,0));let $=-1;n.doc.nodesBetween(E,n.doc.content.size,(O,k)=>{if($>-1)return!1;O.isTextblock&&O.content.size===0&&($=k+1)}),$>-1&&n.setSelection(lt.near(n.doc.resolve($))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...iu(f,d.type.name,d.attrs),...t},v={...iu(f,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const m=h?[{type:s,attrs:p},{type:h,attrs:v}]:[{type:s,attrs:p}];if(!Fo(n.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:y}=r,{splittableMarks:C}=i.extensionManager,x=y||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,m).scrollIntoView(),!x||!o)return!0;const S=x.filter(E=>C.includes(E.type.name));n.ensureMarks(S)}return!0},wp=(e,t)=>{const n=ru(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&di(e.doc,n.pos)&&e.join(n.pos),!0},Ep=(e,t)=>{const n=ru(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&di(e.doc,r)&&e.join(r),!0};function f_(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return lt.between(r,o)}var h_=(e,t,n,r={})=>({editor:o,tr:i,state:a,dispatch:s,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,h=Nn(e,a.schema),p=Nn(t,a.schema),{selection:v,storedMarks:m}=a,{$from:b,$to:y}=v,C=b.blockRange(y),x=m||v.$to.parentOffset&&v.$from.marks();if(!C)return!1;const S=ru(R=>xp(R.type.name,d))(v),E=v.from===0&&v.to===a.doc.content.size,$=a.doc.content.content,O=$.length===1?$[0]:null,k=E&&O&&xp(O.type.name,d)?{node:O,pos:0}:null,M=S??k,T=!!S&&C.depth>=1&&C.depth-S.depth<=1,I=!!k;if((T||I)&&M){if(M.node.type===h)return E&&I?l().command(({tr:R,dispatch:N})=>{const P=f_(R);return P?(R.setSelection(P),N&&N(R),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(xp(M.node.type.name,d)&&h.validContent(M.node.content))return l().command(()=>(i.setNodeMarkup(M.pos,h),!0)).command(()=>wp(i,h)).command(()=>Ep(i,h)).run()}return!n||!x||!s?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>wp(i,h)).command(()=>Ep(i,h)).run():l().command(()=>{const R=u().wrapInList(h,r),N=x.filter(P=>f.includes(P.type.name));return i.ensureMarks(N),R?!0:c.clearNodes()}).wrapInList(h,r).command(()=>wp(i,h)).command(()=>Ep(i,h)).run()},p_=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,a=qo(e,r.schema);return Sp(r,a,t)?o.unsetMark(a,{extendEmptyMarkRange:i}):o.setMark(a,t)},m_=(e,t,n={})=>({state:r,commands:o})=>{const i=Nn(e,r.schema),a=Nn(t,r.schema),s=Si(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),s?o.setNode(a,l):o.setNode(i,{...l,...n})},g_=(e,t={})=>({state:n,commands:r})=>{const o=Nn(e,n.schema);return Si(n,o,t)?r.lift(o):r.wrapIn(o,t)},v_=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const a=e.tr,s=i.transform;for(let l=s.steps.length-1;l>=0;l-=1)a.step(s.steps[l].invert(s.docs[l]));if(i.text){const l=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else a.delete(i.from,i.to)}return!0}}return!1},b_=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(i=>{e.removeMark(i.$from.pos,i.$to.pos)}),!0},y_=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,l=qo(e,r.schema),{$from:c,empty:u,ranges:d}=s;if(!o)return!0;if(u&&a){let{from:f,to:h}=s;const p=(i=c.marks().find(m=>m.type===l))==null?void 0:i.attrs,v=hp(c,l,p);v&&(f=v.from,h=v.to),n.removeMark(f,h,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},C_=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,a;return typeof e=="number"?(i=e,a=e):e&&"from"in e&&"to"in e?(i=e.from,a=e.to):(i=o.from,a=o.to),r&&t.doc.nodesBetween(i,a,(s,l)=>{if(s.isText)return;const c={...s.attrs};delete c.dir,t.setNodeMarkup(l,void 0,c)}),!0},S_=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null;const s=nu(typeof e=="string"?e:e.name,r.schema);if(!s)return!1;s==="node"&&(i=Nn(e,r.schema)),s==="mark"&&(a=qo(e,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let f,h,p,v;n.selection.empty?r.doc.nodesBetween(u,d,(m,b)=>{i&&i===m.type&&(l=!0,p=Math.max(b,u),v=Math.min(b+m.nodeSize,d),f=b,h=m)}):r.doc.nodesBetween(u,d,(m,b)=>{b<u&&i&&i===m.type&&(l=!0,p=Math.max(b,u),v=Math.min(b+m.nodeSize,d),f=b,h=m),b>=u&&b<=d&&(i&&i===m.type&&(l=!0,o&&n.setNodeMarkup(b,void 0,{...m.attrs,...t})),a&&m.marks.length&&m.marks.forEach(y=>{if(a===y.type&&(l=!0,o)){const C=Math.max(b,u),x=Math.min(b+m.nodeSize,d);n.addMark(C,x,a.create({...y.attrs,...t}))}}))}),h&&(f!==void 0&&o&&n.setNodeMarkup(f,void 0,{...h.attrs,...t}),a&&h.marks.length&&h.marks.forEach(m=>{a===m.type&&o&&n.addMark(p,v,a.create({...m.attrs,...t}))}))}),l},x_=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return XP(o,t)(n,r)},w_=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return YP(o,t)(n,r)},E_=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},su=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},$_=(e,t)=>{if(fp(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,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 lu(e){var t;const{editor:n,from:r,to:o,text:i,rules:a,plugin:s}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(t=c.nodeBefore||c.nodeAfter)!=null&&t.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Y2(c)+i;return a.forEach(f=>{if(u)return;const h=$_(d,f.find);if(!h)return;const p=l.state.tr,v=Zc({state:l.state,transaction:p}),m={from:r-(h[0].length-i.length),to:o},{commands:b,chain:y,can:C}=new eu({editor:n,state:v});f.handler({state:v,range:m,match:h,commands:b,chain:y,can:C})===null||!p.steps.length||(f.undoable&&p.setMeta(s,{transform:p,from:r,to:o,text:i}),l.dispatch(p),u=!0)}),u}function O_(e){const{editor:t,rules:n}=e,r=new Kt({state:{init(){return null},apply(o,i,a){const s=o.getMeta(r);if(s)return s;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=vp(be.from(u),a.schema);const{from:d}=l,f=d+u.length;lu({editor:t,from:d,to:f,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,a,s){return lu({editor:t,from:i,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&lu({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?lu({editor:t,from:a.pos,to:a.pos,text:`
|
|
50
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function k_(e){return Object.prototype.toString.call(e).slice(8,-1)}function cu(e){return k_(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function bS(e,t){const n={...e};return cu(e)&&cu(t)&&Object.keys(t).forEach(r=>{cu(t[r])&&cu(e[r])?n[r]=bS(e[r],t[r]):n[r]=t[r]}),n}var $p=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Vt(nt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Vt(nt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>bS(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Go=class II extends $p{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new II(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=a.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function M_(e){return typeof e=="number"}var N_=class{constructor(e){this.find=e.find,this.handler=e.handler}},T_=(e,t,n)=>{if(fp(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=e,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function I_(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:a,dropEvent:s}=e,{commands:l,chain:c,can:u}=new eu({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,o,(h,p)=>{var v,m,b,y,C;if((m=(v=h.type)==null?void 0:v.spec)!=null&&m.code||!(h.isText||h.isTextblock||h.isInline))return;const x=(C=(y=(b=h.content)==null?void 0:b.size)!=null?y:h.nodeSize)!=null?C:0,S=Math.max(r,p),E=Math.min(o,p+x);if(S>=E)return;const $=h.isText?h.text||"":h.textBetween(S-p,E-p,void 0,"");T_($,i.find,a).forEach(k=>{if(k.index===void 0)return;const M=S+k.index+1,T=M+k[0].length,I={from:n.tr.mapping.map(M),to:n.tr.mapping.map(T)},R=i.handler({state:n,range:I,match:k,commands:l,chain:c,can:u,pasteEvent:a,dropEvent:s});d.push(R)})}),d.every(h=>h!==null)}var uu=null,P_=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function A_(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const l=({state:u,from:d,to:f,rule:h,pasteEvt:p})=>{const v=u.tr,m=Zc({state:u,transaction:v});if(!(!I_({editor:t,state:m,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:s})||!v.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(u=>new Kt({view(d){const f=p=>{var v;r=(v=d.dom.parentElement)!=null&&v.contains(p.target)?d.dom.parentElement:null,r&&(uu=t)},h=()=>{uu&&(uu=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(i=r===d.dom.parentElement,s=f,!i){const h=uu;h!=null&&h.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,f)=>{var h;const p=(h=f.clipboardData)==null?void 0:h.getData("text/html");return a=f,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const p=d[0],v=p.getMeta("uiEvent")==="paste"&&!o,m=p.getMeta("uiEvent")==="drop"&&!i,b=p.getMeta("applyPasteRules"),y=!!b;if(!v&&!m&&!y)return;if(y){let{text:S}=b;typeof S=="string"?S=S:S=vp(be.from(S),h.schema);const{from:E}=b,$=E+S.length,O=P_(S);return l({rule:u,state:h,from:E,to:{b:$},pasteEvt:O})}const C=f.doc.content.findDiffStart(h.doc.content),x=f.doc.content.findDiffEnd(h.doc.content);if(!(!M_(C)||!x||C===x.b))return l({rule:u,state:h,from:C,to:x,pasteEvt:a})}}))}var du=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=bp(e),this.schema=lS(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:ml(t.name,this.schema)},r=nt(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return pl([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:ml(r.name,this.schema)},i=[],a=nt(r,"addKeyboardShortcuts",o);let s={};if(r.type==="mark"&&nt(r,"exitable",o)&&(s.ArrowRight=()=>Go.handleExit({editor:e,mark:r})),a){const f=Object.fromEntries(Object.entries(a()).map(([h,p])=>[h,()=>p({editor:e})]));s={...s,...f}}const l=qR(s);i.push(l);const c=nt(r,"addInputRules",o);if(hS(r,e.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=O_({editor:e,rules:f}),p=Array.isArray(h)?h:[h];i.push(...p)}}const u=nt(r,"addPasteRules",o);if(hS(r,e.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=A_({editor:e,rules:f});i.push(...h)}}const d=nt(r,"addProseMirrorPlugins",o);if(d){const f=d();i.push(...f)}return i})}get attributes(){return rS(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Xa(this.extensions);return Object.fromEntries(t.filter(n=>!!nt(n,"addNodeView")).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:e,type:Nn(n.name,this.schema)},i=nt(n,"addNodeView",o);if(!i)return[];const a=i();if(!a)return[];const s=(l,c,u,d,f)=>{const h=Ya(l,r);return a({node:l,view:c,getPos:u,decorations:d,innerDecorations:f,editor:e,extension:n,HTMLAttributes:h})};return[n.name,s]}))}dispatchTransaction(e){const{editor:t}=this;return pl([...this.extensions].reverse()).reduceRight((r,o)=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:ml(o.name,this.schema)},a=nt(o,"dispatchTransaction",i);return a?s=>{a.call(i,{transaction:s,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return pl([...this.extensions]).reduce((r,o)=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:ml(o.name,this.schema)},a=nt(o,"transformPastedHTML",i);return a?(s,l)=>{const c=r(s,l);return a.call(i,c)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Xa(this.extensions);return Object.fromEntries(t.filter(n=>!!nt(n,"addMarkView")).map(n=>{const r=this.attributes.filter(s=>s.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:qo(n.name,this.schema)},i=nt(n,"addMarkView",o);if(!i)return[];const a=(s,l,c)=>{const u=Ya(s,r);return i()({mark:s,view:l,inline:c,editor:e,extension:n,HTMLAttributes:u,updateAttributes:d=>{Y_(s,e,d)}})};return[n.name,a]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:ml(t.name,this.schema)};t.type==="mark"&&((n=Vt(nt(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const o=nt(t,"onBeforeCreate",r),i=nt(t,"onCreate",r),a=nt(t,"onUpdate",r),s=nt(t,"onSelectionUpdate",r),l=nt(t,"onTransaction",r),c=nt(t,"onFocus",r),u=nt(t,"onBlur",r),d=nt(t,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}};du.resolve=bp,du.sort=pl,du.flatten=ou;var R_={};dp(R_,{ClipboardTextSerializer:()=>yS,Commands:()=>CS,Delete:()=>SS,Drop:()=>xS,Editable:()=>wS,FocusEvents:()=>$S,Keymap:()=>OS,Paste:()=>kS,Tabindex:()=>MS,TextDirection:()=>NS,focusEventsPluginKey:()=>ES});var _t=class PI extends $p{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new PI(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},yS=_t.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kt({key:new on("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,a=Math.min(...i.map(u=>u.$from.pos)),s=Math.max(...i.map(u=>u.$to.pos)),l=yp(n);return cS(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),CS=_t.create({name:"commands",addCommands(){return{...Qr}}}),SS=_t.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var a,s,l,c;if((c=(l=(s=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:s.filterTransaction)==null?void 0:l.call(s,e))!=null?c:e.getMeta("y-sync$"))return;const u=eS(e.before,[e,...t]);fS(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,v)=>{const m=v+p.nodeSize-2,b=h.oldRange.from<=v&&m<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:v,to:m,newFrom:u.mapping.map(v),newTo:u.mapping.map(m),deletedRange:h.oldRange,newRange:h.newRange,partial:!b,editor:this.editor,transaction:e,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((h,p)=>{var v,m;if(h instanceof Jr){const b=f.slice(p).map(h.from,-1),y=f.slice(p).map(h.to),C=f.invert().map(b,-1),x=f.invert().map(y),S=b>0?(v=u.doc.nodeAt(b-1))==null?void 0:v.marks.some($=>$.eq(h.mark)):!1,E=(m=u.doc.nodeAt(y))==null?void 0:m.marks.some($=>$.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:C,to:x},newRange:{from:b,to:y},partial:!!(E||S),editor:this.editor,transaction:e,combinedTransform:u})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(i,0):i()}}),xS=_t.create({name:"drop",addProseMirrorPlugins(){return[new Kt({key:new on("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),wS=_t.create({name:"editable",addProseMirrorPlugins(){return[new Kt({key:new on("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ES=new on("focusEvents"),$S=_t.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kt({key:ES,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),OS=_t.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:l,doc:c}=s,{empty:u,$anchor:d}=l,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?s.doc.resolve(f-1):d,v=p.parent.type.spec.isolating,m=d.pos-d.parentOffset,b=v&&p.parent.childCount===1?m===d.pos:ht.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return dl()||JC()?i:o},addProseMirrorPlugins(){return[new Kt({key:new on("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(v=>v.getMeta("composition")))return;const r=e.some(v=>v.docChanged)&&!t.doc.eq(n.doc),o=e.some(v=>v.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:a,to:s}=t.selection,l=ht.atStart(t.doc).from,c=ht.atEnd(t.doc).to;if(i||!(a===l&&s===c)||!au(n.doc))return;const f=n.tr,h=Zc({state:n,transaction:f}),{commands:p}=new eu({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),kS=_t.create({name:"paste",addProseMirrorPlugins(){return[new Kt({key:new on("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),MS=_t.create({name:"tabindex",addProseMirrorPlugins(){return[new Kt({key:new on("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),NS=_t.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Xa(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Kt({key:new on("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),__=class kc{constructor(t,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,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 t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){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},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new kc(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new kc(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new kc(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,a=n.isInline,s=this.pos+r+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(s);if(!o&&!a&&l.depth<=this.depth)return;const c=new kc(l,this.editor,o,o||a?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===t)if(Object.keys(n).length>0){const i=o.node.attrs,a=Object.keys(n);for(let s=0;s<a.length;s+=1){const l=a[s];if(i[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===t&&i.every(l=>n[l]===a.node.attrs[l])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(t,n,r))))}),o}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},D_=`.ProseMirror {
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ProseMirror {
|
|
55
|
+
word-wrap: break-word;
|
|
56
|
+
white-space: pre-wrap;
|
|
57
|
+
white-space: break-spaces;
|
|
58
|
+
-webkit-font-variant-ligatures: none;
|
|
59
|
+
font-variant-ligatures: none;
|
|
60
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ProseMirror [contenteditable="false"] {
|
|
64
|
+
white-space: normal;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
68
|
+
white-space: pre-wrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror pre {
|
|
72
|
+
white-space: pre-wrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
img.ProseMirror-separator {
|
|
76
|
+
display: inline !important;
|
|
77
|
+
border: none !important;
|
|
78
|
+
margin: 0 !important;
|
|
79
|
+
width: 0 !important;
|
|
80
|
+
height: 0 !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ProseMirror-gapcursor {
|
|
84
|
+
display: none;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
position: absolute;
|
|
87
|
+
margin: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ProseMirror-gapcursor:after {
|
|
91
|
+
content: "";
|
|
92
|
+
display: block;
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: -2px;
|
|
95
|
+
width: 20px;
|
|
96
|
+
border-top: 1px solid black;
|
|
97
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes ProseMirror-cursor-blink {
|
|
101
|
+
to {
|
|
102
|
+
visibility: hidden;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ProseMirror-hideselection *::selection {
|
|
107
|
+
background: transparent;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
111
|
+
background: transparent;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ProseMirror-hideselection * {
|
|
115
|
+
caret-color: transparent;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
119
|
+
display: block;
|
|
120
|
+
}`;function L_(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}var j_=class extends E_{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:e_,createMappablePosition:t_},this.setOptions(e),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:r,slice:o,moved:i})=>this.options.onDrop(r,o,i)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=XC(t,this.options.autofocus);this.editorState=Fa.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){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(e),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 e=this.editorView.dom;e!=null&&e.editor&&delete e.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(e){console.warn("Failed to remove CSS element:",e)}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=L_(D_,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=nS(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(o=>{const i=typeof o=="string"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(i))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[wS,yS.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),CS,$S,OS,MS,xS,kS,SS,NS.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new du(r,this)}createCommandManager(){this.commandManager=new eu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=gp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,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(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=gp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,a=this.extensionManager.transformPastedHTML(i);this.editorView=new FC(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();const l=this.view.dom;l.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),s=a==null?void 0:a.getMeta("focus"),l=a==null?void 0:a.getMeta("blur");s&&this.emit("focus",{editor:this,event:s.event,transaction:a}),l&&this.emit("blur",{editor:this,event:l.event,transaction:a}),!(e.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return dS(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return J2(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return vp(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
121
|
+
|
|
122
|
+
`,textSerializers:n={}}=e||{};return uS(this.state.doc,{blockSeparator:t,textSerializers:{...yp(this.schema),...n}})}get isEmpty(){return au(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new __(t,this)}get $doc(){return this.$pos(0)}};function aa(e){return new su({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Vt(e.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=t,a=r[r.length-1],s=r[0];if(a){const l=s.search(/\S/),c=n.from+s.indexOf(a),u=c+a.length;if(Cp(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(v=>v===e.type&&v!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const f=n.from+l+a.length;i.addMark(n.from+l,f,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function z_(e){return new su({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Vt(e.getAttributes,void 0,r)||{},{tr:i}=t,a=n.from;let s=n.to;const l=e.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=a+c;u>s?u=s:s=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,a+r[0].length-1),i.replaceWith(u,s,l)}else if(r[0]){const c=e.type.isInline?a:a-1;i.insert(c,e.type.create(o)).delete(i.mapping.map(a),i.mapping.map(s))}i.scrollIntoView()},undoable:e.undoable})}function Op(e){return new su({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Vt(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function Ja(e){return new su({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=Vt(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&$h(l,e.type,i);if(!c)return null;if(a.wrap(l,c),e.keepMarks&&e.editor){const{selection:d,storedMarks:f}=t,{splittableMarks:h}=e.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const v=p.filter(m=>h.includes(m.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=a.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&di(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,u))&&a.join(n.from-1)},undoable:e.undoable})}function B_(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof at){const i=r.index();return r.parent.canReplaceWith(i,i+1,t)}let o=r.depth;for(;o>=0;){const i=r.index(o);if(r.node(o).contentMatchAt(i).matchType(t))return!0;o-=1}return!1}function TS(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function F_(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var H_={};dp(H_,{createAtomBlockMarkdownSpec:()=>V_,createBlockMarkdownSpec:()=>W_,createInlineMarkdownSpec:()=>K_,parseAttributes:()=>kp,parseIndentedBlocks:()=>Np,renderNestedMarkdownContent:()=>Tp,serializeAttributes:()=>Mp});function kp(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const c=o.map(u=>u.trim().slice(1));t.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,c,u])=>{var d;const f=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),h=n[f];h&&(t[c]=h.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(t[u]=!0)}),t}function Mp(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function V_(e){const{nodeName:t,name:n,parseAttributes:r=kp,serializeAttributes:o=Mp,defaultAttributes:i={},requiredAttributes:a=[],allowedAttributes:s}=e,l=n||t,c=u=>{if(!s)return u;const d={};return s.forEach(f=>{f in u&&(d[f]=u[f])}),d};return{parseMarkdown:(u,d)=>{const f={...i,...u.attributes};return d.createNode(t,f,[])},markdownTokenizer:{name:t,level:"block",start(u){var d;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(d=u.match(f))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(u,d,f){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(h);if(!p)return;const v=p[1]||"",m=r(v);if(!a.find(y=>!(y in m)))return{type:t,raw:p[0],attributes:m}}},renderMarkdown:u=>{const d=c(u.attrs||{}),f=o(d),h=f?` {${f}}`:"";return`:::${l}${h} :::`}}}function W_(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=kp,serializeAttributes:i=Mp,defaultAttributes:a={},content:s="block",allowedAttributes:l}=e,c=n||t,u=d=>{if(!l)return d;const f={};return l.forEach(h=>{h in d&&(f[h]=d[h])}),f};return{parseMarkdown:(d,f)=>{let h;if(r){const v=r(d);h=typeof v=="string"?[{type:"text",text:v}]:v}else s==="block"?h=f.parseChildren(d.tokens||[]):h=f.parseInline(d.tokens||[]);const p={...a,...d.attributes};return f.createNode(t,p,h)},markdownTokenizer:{name:t,level:"block",start(d){var f;const h=new RegExp(`^:::${c}`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){var p;const v=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),m=d.match(v);if(!m)return;const[b,y=""]=m,C=o(y);let x=1;const S=b.length;let E="";const $=/^:::([\w-]*)(\s.*)?/gm,O=d.slice(S);for($.lastIndex=0;;){const k=$.exec(O);if(k===null)break;const M=k.index,T=k[1];if(!((p=k[2])!=null&&p.endsWith(":::"))){if(T)x+=1;else if(x-=1,x===0){const I=O.slice(0,M);E=I.trim();const R=d.slice(0,S+M+k[0].length);let N=[];if(E)if(s==="block")for(N=h.blockTokens(I),N.forEach(P=>{P.text&&(!P.tokens||P.tokens.length===0)&&(P.tokens=h.inlineTokens(P.text))});N.length>0;){const P=N[N.length-1];if(P.type==="paragraph"&&(!P.text||P.text.trim()===""))N.pop();else break}else N=h.inlineTokens(E);return{type:t,raw:R,attributes:C,content:E,tokens:N}}}}}},renderMarkdown:(d,f)=>{const h=u(d.attrs||{}),p=i(h),v=p?` {${p}}`:"",m=f.renderChildren(d.content||[],`
|
|
123
|
+
|
|
124
|
+
`);return`:::${c}${v}
|
|
125
|
+
|
|
126
|
+
${m}
|
|
127
|
+
|
|
128
|
+
:::`}}}function U_(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,o,i,a]=r;t[o]=i||a,r=n.exec(e)}return t}function q_(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function K_(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=U_,serializeAttributes:i=q_,defaultAttributes:a={},selfClosing:s=!1,allowedAttributes:l}=e,c=n||t,u=f=>{if(!l)return f;const h={};return l.forEach(p=>{const v=typeof p=="string"?p:p.name,m=typeof p=="string"?void 0:p.skipIfDefault;if(v in f){const b=f[v];if(m!==void 0&&b===m)return;h[v]=b}}),h},d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{const p={...a,...f.attributes};if(s)return h.createNode(t,p);const v=r?r(f):f.content||"";return v?h.createNode(t,p,[h.createTextNode(v)]):h.createNode(t,p,[])},markdownTokenizer:{name:t,level:"inline",start(f){const h=s?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),p=f.match(h),v=p==null?void 0:p.index;return v!==void 0?v:-1},tokenize(f,h,p){const v=s?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),m=f.match(v);if(!m)return;let b="",y="";if(s){const[,x]=m;y=x}else{const[,x,S]=m;y=x,b=S||""}const C=o(y.trim());return{type:t,raw:m[0],content:b.trim(),attributes:C}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(b=>b.type==="text").map(b=>b.text).join(""));const p=u(f.attrs||{}),v=i(p),m=v?` ${v}`:"";return s?`[${c}${m}]`:`[${c}${m}]${h}[/${c}]`}}}function Np(e,t,n){var r,o,i,a;const s=e.split(`
|
|
129
|
+
`),l=[];let c="",u=0;const d=t.baseIndentSize||2;for(;u<s.length;){const f=s[u],h=f.match(t.itemPattern);if(!h){if(l.length>0)break;if(f.trim()===""){u+=1,c=`${c}${f}
|
|
130
|
+
`;continue}else return}const p=t.extractItemData(h),{indentLevel:v,mainContent:m}=p;c=`${c}${f}
|
|
131
|
+
`;const b=[m];for(u+=1;u<s.length;){const S=s[u];if(S.trim()===""){const $=s.slice(u+1).findIndex(M=>M.trim()!=="");if($===-1)break;if((((o=(r=s[u+1+$].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>v){b.push(S),c=`${c}${S}
|
|
132
|
+
`,u+=1;continue}else break}if((((a=(i=S.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:a.length)||0)>v)b.push(S),c=`${c}${S}
|
|
133
|
+
`,u+=1;else break}let y;const C=b.slice(1);if(C.length>0){const S=C.map(E=>E.slice(v+d)).join(`
|
|
134
|
+
`);S.trim()&&(t.customNestedParser?y=t.customNestedParser(S):y=n.blockTokens(S))}const x=t.createToken(p,y);l.push(x)}if(l.length!==0)return{items:l,raw:c}}function Tp(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o=typeof n=="function"?n(r):n,[i,...a]=e.content,s=t.renderChildren([i]);let l=`${o}${s}`;return a&&a.length>0&&a.forEach((c,u)=>{var d,f;const h=(f=(d=t.renderChild)==null?void 0:d.call(t,c,u+1))!=null?f:t.renderChildren([c]);if(h!=null){const p=h.split(`
|
|
135
|
+
`).map(v=>v?t.indent(v):t.indent("")).join(`
|
|
136
|
+
`);l+=c.type==="paragraph"?`
|
|
137
|
+
|
|
138
|
+
${p}`:`
|
|
139
|
+
${p}`}}),l}var fu=new WeakMap;function G_(e,t){let n=fu.get(e);if(!n){const r={callbacks:new Set,rafId:null,handler:()=>{r.rafId!==null&&cancelAnimationFrame(r.rafId),r.rafId=requestAnimationFrame(()=>{r.rafId=null,r.callbacks.forEach(o=>o())})}};fu.set(e,r),e.on("update",r.handler),n=r}n.callbacks.add(t)}function X_(e,t){const n=fu.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off("update",n.handler),fu.delete(e)))}function Y_(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,a=e;o.descendants((s,l)=>{const c=i.mapping.map(l),u=i.mapping.map(l)+s.nodeSize;let d=null;if(s.marks.forEach(h=>{if(h!==a)return!1;d=h}),!d)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==d.attrs[h]&&(f=!0)}),f){const h=e.type.create({...e.attrs,...n});i.removeMark(c,u,e.type),i.addMark(c,u,h)}}),i.docChanged&&t.view.dispatch(i)}var Tn=class AI extends $p{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new AI(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},J_=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,i,a,s;const{view:l}=this.editor,c=e.target,u=c.nodeType===3?(t=c.parentElement)==null?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(c)||!u)return;let d=0,f=0;if(this.dom!==u){const y=this.dom.getBoundingClientRect(),C=u.getBoundingClientRect(),x=(o=e.offsetX)!=null?o:(r=e.nativeEvent)==null?void 0:r.offsetX,S=(a=e.offsetY)!=null?a:(i=e.nativeEvent)==null?void 0:i.offsetY;d=C.x-y.x+x,f=C.y-y.y+S}const h=this.dom.cloneNode(!0);try{const y=this.dom.getBoundingClientRect();h.style.width=`${Math.round(y.width)}px`,h.style.height=`${Math.round(y.height)}px`,h.style.boxSizing="border-box",h.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(h),document.body.appendChild(p),(s=e.dataTransfer)==null||s.setDragImage(h,d,f)}finally{p&&setTimeout(()=>{try{p==null||p.remove()}catch{}},0)}const v=this.getPos();if(typeof v!="number")return;const m=at.create(l.state.doc,v),b=l.state.tr.setSelection(m);l.dispatch(b)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const o=e.type.startsWith("drag"),i=e.type==="dragover"||e.type==="dragenter",a=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!a&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=at.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",p=e.type==="cut",v=e.type==="mousedown";if(!u&&d&&o&&e.target===this.dom&&e.preventDefault(),u&&o&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&v){const m=n.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||i||a||f||h||p||v&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(dl()||mp())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function xi(e){return new N_({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Vt(e.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:a}=t,s=r[r.length-1],l=r[0];let c=n.to;if(s){const u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(Cp(n.from,n.to,t.doc).filter(v=>v.mark.type.excluded.find(b=>b===e.type&&b!==v.mark.type)).filter(v=>v.to>d).length)return null;f<n.to&&a.delete(f,n.to),d>n.from&&a.delete(n.from+u,d),c=n.from+u+s.length,a.addMark(n.from+u,c,e.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||a.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:Q_,getOwnPropertySymbols:Z_}=Object,{hasOwnProperty:eD}=Object.prototype;function Ip(e,t){return function(r,o,i){return e(r,o,i)&&t(r,o,i)}}function hu(e){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,o);const{cache:i}=o,a=i.get(n),s=i.get(r);if(a&&s)return a===r&&s===n;i.set(n,r),i.set(r,n);const l=e(n,r,o);return i.delete(n),i.delete(r),l}}function tD(e){return e!=null?e[Symbol.toStringTag]:void 0}function IS(e){return Q_(e).concat(Z_(e))}const nD=Object.hasOwn||((e,t)=>eD.call(e,t));function sa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const rD="__v",oD="__o",iD="_owner",{getOwnPropertyDescriptor:PS,keys:AS}=Object;function aD(e,t){return e.byteLength===t.byteLength&&pu(new Uint8Array(e),new Uint8Array(t))}function sD(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function lD(e,t){return e.byteLength===t.byteLength&&pu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function cD(e,t){return sa(e.getTime(),t.getTime())}function uD(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function dD(e,t){return e===t}function RS(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.entries();let a,s,l=0;for(;(a=i.next())&&!a.done;){const c=t.entries();let u=!1,d=0;for(;(s=c.next())&&!s.done;){if(o[d]){d++;continue}const f=a.value,h=s.value;if(n.equals(f[0],h[0],l,d,e,t,n)&&n.equals(f[1],h[1],f[0],h[0],e,t,n)){u=o[d]=!0;break}d++}if(!u)return!1;l++}return!0}const fD=sa;function hD(e,t,n){const r=AS(e);let o=r.length;if(AS(t).length!==o)return!1;for(;o-- >0;)if(!DS(e,t,n,r[o]))return!1;return!0}function gl(e,t,n){const r=IS(e);let o=r.length;if(IS(t).length!==o)return!1;let i,a,s;for(;o-- >0;)if(i=r[o],!DS(e,t,n,i)||(a=PS(e,i),s=PS(t,i),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function pD(e,t){return sa(e.valueOf(),t.valueOf())}function mD(e,t){return e.source===t.source&&e.flags===t.flags}function _S(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.values();let a,s;for(;(a=i.next())&&!a.done;){const l=t.values();let c=!1,u=0;for(;(s=l.next())&&!s.done;){if(!o[u]&&n.equals(a.value,s.value,a.value,s.value,e,t,n)){c=o[u]=!0;break}u++}if(!c)return!1}return!0}function pu(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function gD(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function DS(e,t,n,r){return(r===iD||r===oD||r===rD)&&(e.$$typeof||t.$$typeof)?!0:nD(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const vD="[object ArrayBuffer]",bD="[object Arguments]",yD="[object Boolean]",CD="[object DataView]",SD="[object Date]",xD="[object Error]",wD="[object Map]",ED="[object Number]",$D="[object Object]",OD="[object RegExp]",kD="[object Set]",MD="[object String]",ND={"[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},TD="[object URL]",ID=Object.prototype.toString;function PD({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:p}){return function(m,b,y){if(m===b)return!0;if(m==null||b==null)return!1;const C=typeof m;if(C!==typeof b)return!1;if(C!=="object")return C==="number"?s(m,b,y):C==="function"?i(m,b,y):!1;const x=m.constructor;if(x!==b.constructor)return!1;if(x===Object)return l(m,b,y);if(Array.isArray(m))return t(m,b,y);if(x===Date)return r(m,b,y);if(x===RegExp)return u(m,b,y);if(x===Map)return a(m,b,y);if(x===Set)return d(m,b,y);const S=ID.call(m);if(S===SD)return r(m,b,y);if(S===OD)return u(m,b,y);if(S===wD)return a(m,b,y);if(S===kD)return d(m,b,y);if(S===$D)return typeof m.then!="function"&&typeof b.then!="function"&&l(m,b,y);if(S===TD)return h(m,b,y);if(S===xD)return o(m,b,y);if(S===bD)return l(m,b,y);if(ND[S])return f(m,b,y);if(S===vD)return e(m,b,y);if(S===CD)return n(m,b,y);if(S===yD||S===ED||S===MD)return c(m,b,y);if(p){let E=p[S];if(!E){const $=tD(m);$&&(E=p[$])}if(E)return E(m,b,y)}return!1}}function AD({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:aD,areArraysEqual:n?gl:sD,areDataViewsEqual:lD,areDatesEqual:cD,areErrorsEqual:uD,areFunctionsEqual:dD,areMapsEqual:n?Ip(RS,gl):RS,areNumbersEqual:fD,areObjectsEqual:n?gl:hD,arePrimitiveWrappersEqual:pD,areRegExpsEqual:mD,areSetsEqual:n?Ip(_S,gl):_S,areTypedArraysEqual:n?Ip(pu,gl):pu,areUrlsEqual:gD,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const o=hu(r.areArraysEqual),i=hu(r.areMapsEqual),a=hu(r.areObjectsEqual),s=hu(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:a,areSetsEqual:s})}return r}function RD(e){return function(t,n,r,o,i,a,s){return e(t,n,s)}}function _D({circular:e,comparator:t,createState:n,equals:r,strict:o}){if(n)return function(s,l){const{cache:c=e?new WeakMap:void 0,meta:u}=n();return t(s,l,{cache:c,equals:r,meta:u,strict:o})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const i={cache:void 0,equals:r,meta:void 0,strict:o};return function(s,l){return t(s,l,i)}}const DD=wi();wi({strict:!0}),wi({circular:!0}),wi({circular:!0,strict:!0}),wi({createInternalComparator:()=>sa}),wi({strict:!0,createInternalComparator:()=>sa}),wi({circular:!0,createInternalComparator:()=>sa}),wi({circular:!0,createInternalComparator:()=>sa,strict:!0});function wi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:o=!1}=e,i=AD(e),a=PD(i),s=n?n(a):RD(a);return _D({circular:t,comparator:a,createState:r,equals:s,strict:o})}var mu={exports:{}},Pp={};/**
|
|
140
|
+
* @license React
|
|
141
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
142
|
+
*
|
|
143
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license found in the
|
|
146
|
+
* LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/var LS;function LD(){if(LS)return Pp;LS=1;var e=w,t=mh();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Pp.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var p=i(null);if(p.current===null){var v={hasValue:!1,value:null};p.current=v}else v=p.current;p=s(function(){function b(E){if(!y){if(y=!0,C=E,E=f(E),h!==void 0&&v.hasValue){var $=v.value;if(h($,E))return x=$}return x=E}if($=x,r(C,E))return $;var O=f(E);return h!==void 0&&h($,O)?(C=E,$):(C=E,x=O)}var y=!1,C,x,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var m=o(c,p[0],p[1]);return a(function(){v.hasValue=!0,v.value=m},[m]),l(m),m},Pp}var Ap={},jS;function jD(){if(jS)return Ap;jS=1;var e={};/**
|
|
148
|
+
* @license React
|
|
149
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
150
|
+
*
|
|
151
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the MIT license found in the
|
|
154
|
+
* LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/return e.NODE_ENV!=="production"&&(function(){function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=w,r=mh(),o=typeof Object.is=="function"?Object.is:t,i=r.useSyncExternalStore,a=n.useRef,s=n.useEffect,l=n.useMemo,c=n.useDebugValue;Ap.useSyncExternalStoreWithSelector=function(u,d,f,h,p){var v=a(null);if(v.current===null){var m={hasValue:!1,value:null};v.current=m}else m=v.current;v=l(function(){function y($){if(!C){if(C=!0,x=$,$=h($),p!==void 0&&m.hasValue){var O=m.value;if(p(O,$))return S=O}return S=$}if(O=S,o(x,$))return O;var k=h($);return p!==void 0&&p(O,k)?(x=$,O):(x=$,S=k)}var C=!1,x,S,E=f===void 0?null:f;return[function(){return y(d())},E===null?void 0:function(){return y(E())}]},[d,f,h,p]);var b=i(u,v[0],v[1]);return s(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),Ap}var zS;function zD(){if(zS)return mu.exports;zS=1;var e={};return e.NODE_ENV==="production"?mu.exports=LD():mu.exports=jD(),mu.exports}var BD=zD(),FD={},HD=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},VD=({contentComponent:e})=>{const t=S0.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return L.jsx(L.Fragment,{children:Object.values(t)})};function WD(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:En.createPortal(r.reactElement,r.element,n)},e.forEach(o=>o())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(o=>o())}}}var UD=class extends w.Component{constructor(e){super(e),this.editorContentRef=w.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=WD(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return L.jsxs(L.Fragment,{children:[L.jsx("div",{ref:HD(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&L.jsx(VD,{contentComponent:e.contentComponent})]})}},qD=w.forwardRef((e,t)=>{const n=w.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return w.createElement(UD,{key:n,innerRef:t,...e})}),BS=w.memo(qD),KD=typeof window<"u"?w.useLayoutEffect:w.useEffect,GD=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function Ei(e){var t;const[n]=w.useState(()=>new GD(e.editor)),r=BD.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:DD);return KD(()=>n.watch(e.editor),[e.editor,n]),w.useDebugValue(r),r}var FS=FD.NODE_ENV!=="production",Rp=typeof window>"u",XD=Rp||!!(typeof window<"u"&&window.next),YD=class RI{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(Rp||XD){if(FS)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&Rp&&FS)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)==null?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)==null?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)==null?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)==null?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)==null?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)==null?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)==null?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)==null?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)==null?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return(i=(o=this.options.current).onDrop)==null?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return(i=(o=this.options.current).onPaste)==null?void 0:i.call(o,...r)},onDelete:(...r)=>{var o,i;return(i=(o=this.options.current).onDelete)==null?void 0:i.call(o,...r)}};return new j_(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((o,i)=>{var a;return o===((a=n.extensions)==null?void 0:a[i])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?RI.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,o)=>r===t[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function JD(e={},t=[]){const n=w.useRef(e);n.current=e;const[r]=w.useState(()=>new YD(n)),o=S0.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return w.useDebugValue(o),w.useEffect(r.onRender(t)),Ei({editor:o,selector:({transactionNumber:i})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&i===0?0:i+1}),o}var _p=w.createContext({editor:null});_p.Consumer;var HS=()=>w.useContext(_p),VS=w.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),QD=()=>w.useContext(VS),gu=w.forwardRef((e,t)=>{const{onDragStart:n}=QD(),r=e.as||"div";return L.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function WS(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function US(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function ZD(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function eL(e){if(WS(e)||US(e))return!0;if(ZD(e)){const t=e.type;if(t)return WS(t)||US(t)}return!1}function tL(){try{if(w.version)return parseInt(w.version.split(".")[0],10)>=19}catch{}return!1}var nL=class{constructor(e,{editor:t,props:n={},as:r="div",className:o=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isEditorContentInitialized?En.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,n=this.props,r=this.editor,o=tL(),i=eL(t),a={...n};a.ref&&!(o||i)&&delete a.ref,!a.ref&&(o||i)&&(a.ref=s=>{this.ref=s}),this.reactElement=L.jsx(t,{...a}),(e=r==null?void 0:r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;(e=t==null?void 0:t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};w.createContext({markViewContentRef:()=>{}});var rL=class extends J_{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,o){var i;return r==="storage"?(i=e.storage[t.name])!=null?i:{}:Reflect.get(n,r,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:w.createRef()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&(l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper"),l.appendChild(this.contentDOMElement))}},o=this.component,i=w.memo(l=>L.jsx(VS.Provider,{value:r,children:w.createElement(o,l)}));i.displayName="ReactNodeView";let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:s=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new nL(i,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${s}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{const l=this.getPos();typeof l!="number"||l===this.currentPos||(this.currentPos=l,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},G_(this.editor,this.positionCheckCallback)}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)!=null&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n=="number")if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){const r=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,a=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}const o=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?(o===this.currentPos||(this.currentPos=o,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()})),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=o,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.positionCheckCallback&&(X_(this.editor,this.positionCheckCallback),this.positionCheckCallback=null),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,n=Ya(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Dp(e,t){return n=>n.editor.contentComponent?new rL(e,n,t):{}}var Lp=w.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Lp.displayName="TiptapContext";var oL=()=>w.useContext(Lp);function qS({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=w.useMemo(()=>({editor:r}),[r]),i=w.useMemo(()=>({editor:r}),[r]);return L.jsx(_p.Provider,{value:i,children:L.jsx(Lp.Provider,{value:o,children:n})})}qS.displayName="Tiptap";function KS({...e}){const{editor:t}=oL();return L.jsx(BS,{editor:t,...e})}KS.displayName="Tiptap.Content",Object.assign(qS,{Content:KS});const GS=["top","right","bottom","left"],XS=["start","end"],YS=GS.reduce((e,t)=>e.concat(t,t+"-"+XS[0],t+"-"+XS[1]),[]),xo=Math.min,ar=Math.max,vu=Math.round,wo=e=>({x:e,y:e}),iL={left:"right",right:"left",bottom:"top",top:"bottom"};function jp(e,t,n){return ar(e,xo(t,n))}function Xo(e,t){return typeof e=="function"?e(t):e}function Dr(e){return e.split("-")[0]}function Zr(e){return e.split("-")[1]}function JS(e){return e==="x"?"y":"x"}function zp(e){return e==="y"?"height":"width"}function Eo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Bp(e){return JS(Eo(e))}function QS(e,t,n){n===void 0&&(n=!1);const r=Zr(e),o=Bp(e),i=zp(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=yu(a)),[a,yu(a)]}function aL(e){const t=yu(e);return[bu(e),t,bu(t)]}function bu(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ZS=["left","right"],ex=["right","left"],sL=["top","bottom"],lL=["bottom","top"];function cL(e,t,n){switch(e){case"top":case"bottom":return n?t?ex:ZS:t?ZS:ex;case"left":case"right":return t?sL:lL;default:return[]}}function uL(e,t,n,r){const o=Zr(e);let i=cL(Dr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(bu)))),i}function yu(e){const t=Dr(e);return iL[t]+e.slice(t.length)}function dL(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fp(e){return typeof e!="number"?dL(e):{top:e,right:e,bottom:e,left:e}}function Qa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tx(e,t,n){let{reference:r,floating:o}=e;const i=Eo(t),a=Bp(t),s=zp(a),l=Dr(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Zr(t)){case"start":h[a]-=f*(n&&c?-1:1);break;case"end":h[a]+=f*(n&&c?-1:1);break}return h}async function fL(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Xo(t,e),p=Fp(h),m=s[f?d==="floating"?"reference":"floating":d],b=Qa(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),x=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},S=Qa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:C,strategy:l}):y);return{top:(b.top-S.top+p.top)/x.y,bottom:(S.bottom-b.bottom+p.bottom)/x.y,left:(b.left-S.left+p.left)/x.x,right:(S.right-b.right+p.right)/x.x}}const hL=50,pL=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:fL},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=tx(c,r,l),f=r,h=0;const p={};for(let v=0;v<i.length;v++){const m=i[v];if(!m)continue;const{name:b,fn:y}=m,{x:C,y:x,data:S,reset:E}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});u=C??u,d=x??d,p[b]={...p[b],...S},E&&h<hL&&(h++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=tx(c,f,l)),v=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}},mL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Xo(e,t)||{};if(c==null)return{};const d=Fp(u),f={x:n,y:r},h=Bp(o),p=zp(h),v=await a.getDimensions(c),m=h==="y",b=m?"top":"left",y=m?"bottom":"right",C=m?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],S=f[h]-i.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let $=E?E[C]:0;(!$||!await(a.isElement==null?void 0:a.isElement(E)))&&($=s.floating[C]||i.floating[p]);const O=x/2-S/2,k=$/2-v[p]/2-1,M=xo(d[b],k),T=xo(d[y],k),I=M,R=$-v[p]-T,N=$/2-v[p]/2+O,P=jp(I,N,R),A=!l.arrow&&Zr(o)!=null&&N!==P&&i.reference[p]/2-(N<I?M:T)-v[p]/2<0,_=A?N<I?N-I:N-R:0;return{[h]:f[h]+_,data:{[h]:P,centerOffset:N-P-_,...A&&{alignmentOffset:_}},reset:A}}});function gL(e,t,n){return(e?[...n.filter(o=>Zr(o)===e),...n.filter(o=>Zr(o)!==e)]:n.filter(o=>Dr(o)===o)).filter(o=>e?Zr(o)===e||(t?bu(o)!==o:!1):!0)}const vL=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:a,placement:s,platform:l,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=YS,autoAlignment:h=!0,...p}=Xo(e,t),v=d!==void 0||f===YS?gL(d||null,h,f):f,m=await l.detectOverflow(t,p),b=((n=a.autoPlacement)==null?void 0:n.index)||0,y=v[b];if(y==null)return{};const C=QS(y,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(s!==y)return{reset:{placement:v[0]}};const x=[m[Dr(y)],m[C[0]],m[C[1]]],S=[...((r=a.autoPlacement)==null?void 0:r.overflows)||[],{placement:y,overflows:x}],E=v[b+1];if(E)return{data:{index:b+1,overflows:S},reset:{placement:E}};const $=S.map(M=>{const T=Zr(M.placement);return[M.placement,T&&u?M.overflows.slice(0,2).reduce((I,R)=>I+R,0):M.overflows[0],M.overflows]}).sort((M,T)=>M[1]-T[1]),k=((o=$.filter(M=>M[2].slice(0,Zr(M[0])?2:3).every(T=>T<=0))[0])==null?void 0:o[0])||$[0][0];return k!==s?{data:{index:b+1,overflows:S},reset:{placement:k}}:{}}}},bL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...m}=Xo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Dr(o),y=Eo(s),C=Dr(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(C||!v?[yu(s)]:aL(s)),E=p!=="none";!f&&E&&S.push(...uL(s,v,p,x));const $=[s,...S],O=await l.detectOverflow(t,m),k=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[b]),d){const N=QS(o,a,x);k.push(O[N[0]],O[N[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(N=>N<=0)){var T,I;const N=(((T=i.flip)==null?void 0:T.index)||0)+1,P=$[N];if(P&&(!(d==="alignment"?y!==Eo(P):!1)||M.every(B=>Eo(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:N,overflows:M},reset:{placement:P}};let A=(I=M.filter(_=>_.overflows[0]<=0).sort((_,B)=>_.overflows[1]-B.overflows[1])[0])==null?void 0:I.placement;if(!A)switch(h){case"bestFit":{var R;const _=(R=M.filter(B=>{if(E){const F=Eo(B.placement);return F===y||F==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(F=>F>0).reduce((F,U)=>F+U,0)]).sort((B,F)=>B[1]-F[1])[0])==null?void 0:R[0];_&&(A=_);break}case"initialPlacement":A=s;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function nx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rx(e){return GS.some(t=>e[t]>=0)}const yL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Xo(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=nx(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rx(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=nx(a,n.floating);return{data:{escapedOffsets:s,escaped:rx(s)}}}default:return{}}}}};function ox(e){const t=xo(...e.map(i=>i.left)),n=xo(...e.map(i=>i.top)),r=ar(...e.map(i=>i.right)),o=ar(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function CL(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>Qa(ox(o)))}const SL=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=Xo(e,t),u=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),d=CL(u),f=Qa(ox(u)),h=Fp(s);function p(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(m=>l>m.left-h.left&&l<m.right+h.right&&c>m.top-h.top&&c<m.bottom+h.bottom)||f;if(d.length>=2){if(Eo(n)==="y"){const M=d[0],T=d[d.length-1],I=Dr(n)==="top",R=M.top,N=T.bottom,P=I?M.left:T.left,A=I?M.right:T.right,_=A-P,B=N-R;return{top:R,bottom:N,left:P,right:A,width:_,height:B,x:P,y:R}}const m=Dr(n)==="left",b=ar(...d.map(M=>M.right)),y=xo(...d.map(M=>M.left)),C=d.filter(M=>m?M.left===y:M.right===b),x=C[0].top,S=C[C.length-1].bottom,E=y,$=b,O=$-E,k=S-x;return{top:x,bottom:S,left:E,right:$,width:O,height:k,x:E,y:x}}return f}const v=await i.getElementRects({reference:{getBoundingClientRect:p},floating:r.floating,strategy:a});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},xL=new Set(["left","top"]);async function wL(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Dr(n),s=Zr(n),l=Eo(n)==="y",c=xL.has(a)?-1:1,u=i&&l?-1:1,d=Xo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const EL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await wL(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},$L=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:y,y:C}=b;return{x:y,y:C}}},...c}=Xo(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),f=Eo(Dr(o)),h=JS(f);let p=u[h],v=u[f];if(a){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",C=p+d[b],x=p-d[y];p=jp(C,p,x)}if(s){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",C=v+d[b],x=v-d[y];v=jp(C,v,x)}const m=l.fn({...t,[h]:p,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[f]:s}}}}}},OL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Xo(e,t),u=await a.detectOverflow(t,c),d=Dr(o),f=Zr(o),h=Eo(o)==="y",{width:p,height:v}=i.floating;let m,b;d==="top"||d==="bottom"?(m=d,b=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,m=f==="end"?"top":"bottom");const y=v-u.top-u.bottom,C=p-u.left-u.right,x=xo(v-u[m],y),S=xo(p-u[b],C),E=!t.middlewareData.shift;let $=x,O=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&($=y),E&&!f){const M=ar(u.left,0),T=ar(u.right,0),I=ar(u.top,0),R=ar(u.bottom,0);h?O=p-2*(M!==0||T!==0?M+T:ar(u.left,u.right)):$=v-2*(I!==0||R!==0?I+R:ar(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:$});const k=await a.getDimensions(s.floating);return p!==k.width||v!==k.height?{reset:{rects:!0}}:{}}}};function Cu(){return typeof window<"u"}function Za(e){return ix(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yo(e){var t;return(t=(ix(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ix(e){return Cu()?e instanceof Node||e instanceof yr(e).Node:!1}function eo(e){return Cu()?e instanceof Element||e instanceof yr(e).Element:!1}function Jo(e){return Cu()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function ax(e){return!Cu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function vl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=to(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function kL(e){return/^(table|td|th)$/.test(Za(e))}function Su(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ML=/transform|translate|scale|rotate|perspective|filter/,NL=/paint|layout|strict|content/,la=e=>!!e&&e!=="none";let Hp;function Vp(e){const t=eo(e)?to(e):e;return la(t.transform)||la(t.translate)||la(t.scale)||la(t.rotate)||la(t.perspective)||!Wp()&&(la(t.backdropFilter)||la(t.filter))||ML.test(t.willChange||"")||NL.test(t.contain||"")}function TL(e){let t=$i(e);for(;Jo(t)&&!es(t);){if(Vp(t))return t;if(Su(t))return null;t=$i(t)}return null}function Wp(){return Hp==null&&(Hp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hp}function es(e){return/^(html|body|#document)$/.test(Za(e))}function to(e){return yr(e).getComputedStyle(e)}function xu(e){return eo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(Za(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ax(e)&&e.host||Yo(e);return ax(t)?t.host:t}function sx(e){const t=$i(e);return es(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&vl(t)?t:sx(t)}function lx(e,t,n){var r;t===void 0&&(t=[]);const o=sx(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=yr(o);return i?(Up(a),t.concat(a,a.visualViewport||[],vl(o)?o:[],[])):t.concat(o,lx(o,[]))}function Up(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cx(e){const t=to(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=vu(n)!==i||vu(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ux(e){return eo(e)?e:e.contextElement}function ts(e){const t=ux(e);if(!Jo(t))return wo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cx(t);let a=(i?vu(n.width):n.width)/r,s=(i?vu(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const IL=wo(0);function dx(e){const t=yr(e);return!Wp()||!t.visualViewport?IL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function bl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ux(e);let a=wo(1);t&&(r?eo(r)&&(a=ts(r)):a=ts(e));const s=PL(i,n,r)?dx(i):wo(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const f=yr(i),h=r&&eo(r)?yr(r):r;let p=f,v=Up(p);for(;v&&r&&h!==p;){const m=ts(v),b=v.getBoundingClientRect(),y=to(v),C=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,x=b.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=C,c+=x,p=yr(v),v=Up(p)}}return Qa({width:u,height:d,x:l,y:c})}function wu(e,t){const n=xu(e).scrollLeft;return t?t.left+n:bl(Yo(e)).left+n}function fx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wu(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function AL(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Yo(r),s=t?Su(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=wo(1);const u=wo(0),d=Jo(r);if((d||!d&&!i)&&((Za(r)!=="body"||vl(a))&&(l=xu(r)),d)){const h=bl(r);c=ts(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=a&&!d&&!i?fx(a,l):wo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function RL(e){return Array.from(e.getClientRects())}function _L(e){const t=Yo(e),n=xu(e),r=e.ownerDocument.body,o=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+wu(e);const s=-n.scrollTop;return to(r).direction==="rtl"&&(a+=ar(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const hx=25;function DL(e,t){const n=yr(e),r=Yo(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const u=Wp();(!u||u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const c=wu(r);if(c<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-h);p<=hx&&(i-=p)}else c<=hx&&(i+=c);return{width:i,height:a,x:s,y:l}}function LL(e,t){const n=bl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?ts(e):wo(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function px(e,t,n){let r;if(t==="viewport")r=DL(e,n);else if(t==="document")r=_L(Yo(e));else if(eo(t))r=LL(t,n);else{const o=dx(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qa(r)}function mx(e,t){const n=$i(e);return n===t||!eo(n)||es(n)?!1:to(n).position==="fixed"||mx(n,t)}function jL(e,t){const n=t.get(e);if(n)return n;let r=lx(e,[]).filter(s=>eo(s)&&Za(s)!=="body"),o=null;const i=to(e).position==="fixed";let a=i?$i(e):e;for(;eo(a)&&!es(a);){const s=to(a),l=Vp(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||vl(a)&&!l&&mx(e,a))?r=r.filter(u=>u!==a):o=s,a=$i(a)}return t.set(e,r),r}function zL(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Su(t)?[]:jL(t,this._c):[].concat(n),r],s=px(t,a[0],o);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let f=1;f<a.length;f++){const h=px(t,a[f],o);l=ar(h.top,l),c=xo(h.right,c),u=xo(h.bottom,u),d=ar(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function BL(e){const{width:t,height:n}=cx(e);return{width:t,height:n}}function FL(e,t,n){const r=Jo(t),o=Yo(t),i=n==="fixed",a=bl(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=wo(0);function c(){l.x=wu(o)}if(r||!r&&!i)if((Za(t)!=="body"||vl(o))&&(s=xu(t)),r){const h=bl(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?fx(o,s):wo(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function qp(e){return to(e).position==="static"}function gx(e,t){if(!Jo(e)||to(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yo(e)===n&&(n=n.ownerDocument.body),n}function vx(e,t){const n=yr(e);if(Su(e))return n;if(!Jo(e)){let o=$i(e);for(;o&&!es(o);){if(eo(o)&&!qp(o))return o;o=$i(o)}return n}let r=gx(e,t);for(;r&&kL(r)&&qp(r);)r=gx(r,t);return r&&es(r)&&qp(r)&&!Vp(r)?n:r||TL(e)||n}const HL=async function(e){const t=this.getOffsetParent||vx,n=this.getDimensions,r=await n(e.floating);return{reference:FL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VL(e){return to(e).direction==="rtl"}const WL={convertOffsetParentRelativeRectToViewportRelativeRect:AL,getDocumentElement:Yo,getClippingRect:zL,getOffsetParent:vx,getElementRects:HL,getClientRects:RL,getDimensions:BL,getScale:ts,isElement:eo,isRTL:VL},bx=EL,yx=vL,Cx=$L,Sx=bL,xx=OL,wx=yL,Ex=mL,$x=SL,Ox=(e,t,n)=>{const r=new Map,o={platform:WL,...n},i={...o.platform,_c:r};return pL(e,t,{...o,platform:i})};let Kp,Gp;if(typeof WeakMap<"u"){let e=new WeakMap;Kp=t=>e.get(t),Gp=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Kp=r=>{for(let o=0;o<e.length;o+=2)if(e[o]==r)return e[o+1]},Gp=(r,o)=>(n==10&&(n=0),e[n++]=r,e[n++]=o)}var yn=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,a=o+1;for(let s=1;i<this.width&&this.map[t+s]==n;s++)i++;for(let s=1;a<this.height&&this.map[t+this.width*s]==n;s++)a++;return{left:r,top:o,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:a}=this.findCell(e);return t=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:a,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(o,l),right:Math.max(r,s),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,!(o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a)&&t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let a=t+e*this.width;const s=(e+1)*this.width;for(;a<s&&this.map[a]<o;)a++;return a==s?i-1:this.map[a]}o=i}}static get(e){return Kp(e)||Gp(e,UL(e))}};function UL(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=qL(e),n=e.childCount,r=[];let o=0,i=null;const a=[];for(let c=0,u=t*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;o<r.length&&r[o]!=0;)o++;if(p==d.childCount)break;const v=d.child(p),{colspan:m,rowspan:b,colwidth:y}=v.attrs;for(let C=0;C<b;C++){if(C+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:b-C});break}const x=o+C*t;for(let S=0;S<m;S++){r[x+S]==0?r[x+S]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:m-S});const E=y&&y[S];if(E){const $=(x+S)%t*2,O=a[$];O==null||O!=E&&a[$+1]==1?(a[$]=E,a[$+1]=1):O==E&&a[$+1]++}}}o+=m,u+=v.nodeSize}const f=(c+1)*t;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:c,n:h}),u++}(t===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const s=new yn(t,n,r,i);let l=!1;for(let c=0;!l&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(l=!0);return l&&KL(s,a,e),s}function qL(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let a=0;a<r;a++){const s=e.child(a);for(let l=0;l<s.childCount;l++){const c=s.child(l);a+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let a=0;a<o.childCount;a++){const s=o.child(a);i+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}t==-1?t=i:t!=i&&(t=Math.max(t,i))}return t}function KL(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const a=n.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let s=null;const l=a.attrs;for(let c=0;c<l.colspan;c++){const u=t[(o+c)%e.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((s||(s=GL(l)))[c]=u)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}function GL(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function er(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const Oi=new on("selectingCells");function ca(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function XL(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function no(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Eu(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=ca(t.$head)||YL(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function YL(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Xp(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function JL(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Yp(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function kx(e,t,n){const r=e.node(-1),o=yn.get(r),i=e.start(-1),a=o.nextCell(e.pos-i,t,n);return a==null?null:e.node(0).resolve(i+a)}function ua(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Mx(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}function QL(e,t,n){const r=er(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0}var an=class si extends ht{constructor(t,n=t){const r=t.node(-1),o=yn.get(r),i=t.start(-1),a=o.rectBetween(t.pos-i,n.pos-i),s=t.node(0),l=o.cellsInRect(a).filter(u=>u!=n.pos-i);l.unshift(n.pos-i);const c=l.map(u=>{const d=r.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new dy(s.resolve(f),s.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(Xp(r)&&Xp(o)&&Yp(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?si.rowSelection(r,o):i&&this.isColSelection()?si.colSelection(r,o):new si(r,o)}return lt.between(r,o)}content(){const t=this.$anchorCell.node(-1),n=yn.get(t),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},a=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(i[f])continue;i[f]=!0;const h=n.findCell(f);let p=t.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);const v=o.left-h.left,m=h.right-o.right;if(v>0||m>0){let b=p.attrs;if(v>0&&(b=ua(b,0,v)),m>0&&(b=ua(b,b.colspan-m,m)),h.left<o.left){if(p=p.type.createAndFill(b),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`)}else p=p.type.create(b,p.content)}if(h.top<o.top||h.bottom>o.bottom){const b={...p.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}c.push(p)}a.push(t.child(l).copy(be.from(c)))}const s=this.isColSelection()&&this.isRowSelection()?t:a;return new He(be.from(s),1,1)}replace(t,n=He.empty){const r=t.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:s,$to:l}=o[a],c=t.mapping.slice(r);t.replace(c.map(s.pos),c.map(l.pos),a?He.empty:n)}const i=ht.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);i&&t.setSelection(i)}replaceWith(t,n){this.replace(t,new He(be.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=yn.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<i.length;a++)t(n.nodeAt(i[a]),o+i[a])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),o=yn.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new si(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=yn.get(t),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,s)==n.width}eq(t){return t instanceof si&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),o=yn.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(n=l.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=l.resolve(i+o.map[o.width*(a.top+1)-1]))),new si(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new si(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new si(t.resolve(n),t.resolve(r))}getBookmark(){return new ZL(this.$anchorCell.pos,this.$headCell.pos)}};an.prototype.visible=!1,ht.jsonID("cell",an);var ZL=class _I{constructor(t,n){this.anchor=t,this.head=n}map(t){return new _I(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Yp(n,r)?new an(n,r):ht.near(r,1)}};function ej(e){if(!(e.selection instanceof an))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(jn.node(r,r+n.nodeSize,{class:"selectedCell"}))}),sn.create(e.doc,t)}function tj({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}function nj({$from:e,$to:t}){let n,r;for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&t.parentOffset===0}function rj(e,t,n){const r=(t||e).selection,o=(t||e).doc;let i,a;if(r instanceof at&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")i=an.create(o,r.from);else if(a=="row"){const s=o.resolve(r.from+1);i=an.rowSelection(s,s)}else if(!n){const s=yn.get(r.node),l=r.from+1,c=l+s.map[s.width*s.height-1];i=an.create(o,l+1,c)}}else r instanceof lt&&tj(r)?i=lt.create(o,r.from):r instanceof lt&&nj(r)&&(i=lt.create(o,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}const oj=new on("fix-tables");function Nx(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let a=0,s=0;a<i;a++){const l=t.child(a);for(let c=s,u=Math.min(o,a+3);c<u;c++)if(e.child(c)==l){s=c+1,n+=l.nodeSize;continue e}r(l,n),s<o&&e.child(s).sameMarkup(l)?Nx(e.child(s),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function Tx(e,t){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=ij(e,o,i,n))};return t?t.doc!=e.doc&&Nx(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ij(e,t,n,r){const o=yn.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)i[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,ua(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+t.nodeSize)}}let a,s;for(let l=0;l<i.length;l++)i[l]&&(a==null&&(a=l),s=l);for(let l=0,c=n+1;l<o.height;l++){const u=t.child(l),d=c+u.nodeSize,f=i[l];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<f;m++){const b=er(e.schema)[h].createAndFill();b&&p.push(b)}const v=(l==0||a==l-1)&&s==l?c+1:d-1;r.insert(r.mapping.map(v),p)}c=d}return r.setMeta(oj,{fixTables:!0})}function $o(e){const t=e.selection,n=Eu(e),r=n.node(-1),o=n.start(-1),i=yn.get(r);return{...t instanceof an?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Ix(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;QL(t,r,o+i)&&(i=o==0||o==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+o;if(o>0&&o<t.width&&t.map[s-1]==t.map[s]){const l=t.map[s],c=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,Mx(c.attrs,o-t.colCount(l))),a+=c.attrs.rowspan-1}else{const l=i==null?er(r.type.schema).cell:r.nodeAt(t.map[s+i]).type,c=t.positionAt(a,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function aj(e,t){if(!no(e))return!1;if(t){const n=$o(e);t(Ix(e.tr,n,n.left))}return!0}function sj(e,t){if(!no(e))return!1;if(t){const n=$o(e);t(Ix(e.tr,n,n.right))}return!0}function lj(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+o,l=t.map[s],c=n.nodeAt(l),u=c.attrs;if(o>0&&t.map[s-1]==l||o<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,ua(u,o-t.colCount(l)));else{const d=e.mapping.slice(i).map(r+l);e.delete(d,d+c.nodeSize)}a+=u.rowspan}}function cj(e,t){if(!no(e))return!1;if(t){const n=$o(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;lj(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=yn.get(i)}t(r)}return!0}function uj(e,t,n){var r;const o=er(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(((r=t.nodeAt(e.map[i+n*e.width]))===null||r===void 0?void 0:r.type)!=o)return!1;return!0}function Px(e,{map:t,tableStart:n,table:r},o){let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const a=[];let s=o>0?-1:0;uj(t,r,o+s)&&(s=o==0||o==t.height?null:0);for(let c=0,u=t.width*o;c<t.width;c++,u++)if(o>0&&o<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],f=r.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{var l;const d=s==null?er(r.type.schema).cell:(l=r.nodeAt(t.map[u+s*t.width]))===null||l===void 0?void 0:l.type,f=d==null?void 0:d.createAndFill();f&&a.push(f)}return e.insert(i,er(r.type.schema).row.create(null,a)),e}function dj(e,t){if(!no(e))return!1;if(t){const n=$o(e);t(Px(e.tr,n,n.top))}return!0}function fj(e,t){if(!no(e))return!1;if(t){const n=$o(e);t(Px(e.tr,n,n.bottom))}return!0}function hj(e,{map:t,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const a=i+n.child(o).nodeSize,s=e.mapping.maps.length;e.delete(i+r,a+r);const l=new Set;for(let c=0,u=o*t.width;c<t.width;c++,u++){const d=t.map[u];if(!l.has(d)){if(l.add(d),o>0&&d==t.map[u-t.width]){const f=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(s).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<t.height&&d==t.map[u+t.width]){const f=n.nodeAt(d),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),v=t.positionAt(o+1,c,n);e.insert(e.mapping.slice(s).map(r+v),p),c+=h.colspan-1}}}}function pj(e,t){if(!no(e))return!1;if(t){const n=$o(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;hj(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=yn.get(n.table)}t(r)}return!0}function Ax(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mj({width:e,height:t,map:n},r){let o=r.top*e+r.left,i=o,a=(r.bottom-1)*e+r.left,s=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[i]==n[i-1]||r.right<e&&n[s]==n[s+1])return!0;i+=e,s+=e}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-e]||r.bottom<t&&n[a]==n[a+e])return!0;o++,a++}return!1}function Rx(e,t){const n=e.selection;if(!(n instanceof an)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=$o(e),{map:o}=r;if(mj(o,r))return!1;if(t){const i=e.tr,a={};let s=be.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],h=r.table.nodeAt(f);if(!(a[f]||!h))if(a[f]=!0,l==null)l=f,c=h;else{Ax(h)||(s=s.append(h.content));const p=i.mapping.map(f+r.tableStart);i.delete(p,p+h.nodeSize)}}if(l==null||c==null)return!0;if(i.setNodeMarkup(l+r.tableStart,null,{...Mx(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),s.size>0){const u=l+1+c.content.size,d=Ax(c)?l+1:u;i.replaceWith(d+r.tableStart,u+r.tableStart,s)}i.setSelection(new an(i.doc.resolve(l+r.tableStart))),t(i)}return!0}function _x(e,t){const n=er(e.schema);return gj(({node:r})=>n[r.type.spec.tableRole])(e,t)}function gj(e){return(t,n)=>{const r=t.selection;let o,i;if(r instanceof an){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;o=r.$anchorCell.nodeAfter,i=r.$anchorCell.pos}else{var a;if(o=XL(r.$from),!o)return!1;i=(a=ca(r.$from))===null||a===void 0?void 0:a.pos}if(o==null||i==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let s=o.attrs;const l=[],c=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=$o(t),d=t.tr;for(let h=0;h<u.right-u.left;h++)l.push(c?{...s,colwidth:c&&c[h]?[c[h]]:null}:s);let f;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=o.nodeSize);for(let v=u.left,m=0;v<u.right;v++,m++)v==u.left&&h==u.top||d.insert(f=d.mapping.map(p+u.tableStart,1),e({node:o,row:h,col:v}).createAndFill(l[m]))}d.setNodeMarkup(i,e({node:o,row:u.top,col:u.left}),l[0]),r instanceof an&&d.setSelection(new an(d.doc.resolve(r.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function vj(e,t){return function(n,r){if(!no(n))return!1;const o=Eu(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof an?n.selection.forEachCell((a,s)=>{a.attrs[e]!==t&&i.setNodeMarkup(s,null,{...a.attrs,[e]:t})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}function bj(e){return function(t,n){if(!no(t))return!1;if(n){const r=er(t.schema),o=$o(t),i=t.tr,a=o.map.cellsInRect(e=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:e=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=a.map(l=>o.table.nodeAt(l));for(let l=0;l<a.length;l++)s[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[l],r.cell,s[l].attrs);if(i.steps.length===0)for(let l=0;l<a.length;l++)i.setNodeMarkup(o.tableStart+a[l],r.header_cell,s[l].attrs);n(i)}return!0}}function Dx(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let o=0;o<r.length;o++){const i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function yl(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bj(e):function(n,r){if(!no(n))return!1;if(r){const o=er(n.schema),i=$o(n),a=n.tr,s=Dx("row",i,o),l=Dx("column",i,o),c=(e==="column"?s:e==="row"&&l)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:i.map.height}:e=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,d=e=="column"?l?o.cell:o.header_cell:e=="row"?s?o.cell:o.header_cell:o.cell;i.map.cellsInRect(u).forEach(f=>{const h=f+i.tableStart,p=a.doc.nodeAt(h);p&&a.setNodeMarkup(h,d,p.attrs)}),r(a)}return!0}}yl("row",{useDeprecatedLogic:!0}),yl("column",{useDeprecatedLogic:!0});const yj=yl("cell",{useDeprecatedLogic:!0});function Cj(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,o=e.before();r>=0;r--){const i=e.node(-1).child(r),a=i.lastChild;if(a)return o-1-a.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),o=e.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function Lx(e){return function(t,n){if(!no(t))return!1;const r=Cj(Eu(t),e);if(r==null)return!1;if(n){const o=t.doc.resolve(r);n(t.tr.setSelection(lt.between(o,JL(o))).scrollIntoView())}return!0}}function Sj(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function $u(e,t){const n=e.selection;if(!(n instanceof an))return!1;if(t){const r=e.tr,o=er(e.schema).cell.createAndFill().content;n.forEachCell((i,a)=>{i.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+i.nodeSize-1),new He(o,0,0))}),r.docChanged&&t(r)}return!0}function xj(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,s=[];if(i=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const u=l?0:Math.max(0,n-1),d=l<t.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Jp(er(a).row,new He(c,u,d)).content),s.push(c)}else if(i=="cell"||i=="header_cell")s.push(n||r?Jp(er(a).row,new He(t,n,r)).content:t);else return null;return wj(a,s)}function wj(e,t){const n=[];for(let o=0;o<t.length;o++){const i=t[o];for(let a=i.childCount-1;a>=0;a--){const{rowspan:s,colspan:l}=i.child(a).attrs;for(let c=o;c<o+s;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(be.empty),n[o]<r){const i=er(e).cell.createAndFill(),a=[];for(let s=n[o];s<r;s++)a.push(i);t[o]=t[o].append(be.from(a))}return{height:t.length,width:r,rows:t}}function Jp(e,t){const n=e.createAndFill();return new Mh(n).replace(0,n.content.size,t).doc}function Ej({width:e,height:t,rows:n},r,o){if(e!=r){const i=[],a=[];for(let s=0;s<n.length;s++){const l=n[s],c=[];for(let u=i[s]||0,d=0;u<r;d++){let f=l.child(d%l.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(ua(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[s+h]=(i[s+h]||0)+f.attrs.colspan}a.push(be.from(c))}n=a,e=r}if(t!=o){const i=[];for(let a=0,s=0;a<o;a++,s++){const l=[],c=n[s%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);a+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),l.push(d)}i.push(be.from(l))}n=i,t=o}return{width:e,height:t,rows:n}}function $j(e,t,n,r,o,i,a){const s=e.doc.type.schema,l=er(s);let c,u;if(o>t.width)for(let d=0,f=0;d<t.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let v;h.lastChild==null||h.lastChild.type==l.cell?v=c||(c=l.cell.createAndFill()):v=u||(u=l.header_cell.createAndFill());for(let m=t.width;m<o;m++)p.push(v);e.insert(e.mapping.slice(a).map(f-1+r),p)}if(i>t.height){const d=[];for(let p=0,v=(t.height-1)*t.width;p<Math.max(t.width,o);p++){const m=p>=t.width?!1:n.nodeAt(t.map[v+p]).type==l.header_cell;d.push(m?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const f=l.row.create(null,be.from(d)),h=[];for(let p=t.height;p<i;p++)h.push(f);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(c||u)}function jx(e,t,n,r,o,i,a,s){if(a==0||a==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const u=a*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){l=!0;const f=n.nodeAt(d),{top:h,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(s).map(d+r),null,{...f.attrs,rowspan:a-h}),e.insert(e.mapping.slice(s).map(t.positionAt(a,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-a})),c+=f.attrs.colspan-1}}return l}function zx(e,t,n,r,o,i,a,s){if(a==0||a==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const u=c*t.width+a,d=t.map[u];if(t.map[u-1]==d){l=!0;const f=n.nodeAt(d),h=t.colCount(d),p=e.mapping.slice(s).map(d+r);e.setNodeMarkup(p,null,ua(f.attrs,a-h,f.attrs.colspan-(a-h))),e.insert(p+f.nodeSize,f.type.createAndFill(ua(f.attrs,0,a-h))),c+=f.attrs.rowspan-1}}return l}function Bx(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=yn.get(i);const{top:s,left:l}=r,c=l+o.width,u=s+o.height,d=e.tr;let f=0;function h(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");a=yn.get(i),f=d.mapping.maps.length}$j(d,a,i,n,c,u,f)&&h(),jx(d,a,i,n,l,c,s,f)&&h(),jx(d,a,i,n,l,c,u,f)&&h(),zx(d,a,i,n,s,u,l,f)&&h(),zx(d,a,i,n,s,u,c,f)&&h();for(let p=s;p<u;p++){const v=a.positionAt(p,l,i),m=a.positionAt(p,c,i);d.replace(d.mapping.slice(f).map(v+n),d.mapping.slice(f).map(m+n),new He(o.rows[p-s],0,0))}h(),d.setSelection(new an(d.doc.resolve(n+a.positionAt(s,l,i)),d.doc.resolve(n+a.positionAt(u-1,c-1,i)))),t(d)}const Oj=up({ArrowLeft:ku("horiz",-1),ArrowRight:ku("horiz",1),ArrowUp:ku("vert",-1),ArrowDown:ku("vert",1),"Shift-ArrowLeft":Mu("horiz",-1),"Shift-ArrowRight":Mu("horiz",1),"Shift-ArrowUp":Mu("vert",-1),"Shift-ArrowDown":Mu("vert",1),Backspace:$u,"Mod-Backspace":$u,Delete:$u,"Mod-Delete":$u});function Ou(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function ku(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof an)return Ou(n,r,ht.near(i.$headCell,t));if(e!="horiz"&&!i.empty)return!1;const a=Fx(o,e,t);if(a==null)return!1;if(e=="horiz")return Ou(n,r,ht.near(n.doc.resolve(i.head+t),t));{const s=n.doc.resolve(a),l=kx(s,e,t);let c;return l?c=ht.near(l,1):t<0?c=ht.near(n.doc.resolve(s.before(-1)),-1):c=ht.near(n.doc.resolve(s.after(-1)),1),Ou(n,r,c)}}}function Mu(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let a;if(i instanceof an)a=i;else{const l=Fx(o,e,t);if(l==null)return!1;a=new an(n.doc.resolve(l))}const s=kx(a.$headCell,e,t);return s?Ou(n,r,new an(a.$anchorCell,s)):!1}}function kj(e,t){const n=e.state.doc,r=ca(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new an(r))),!0):!1}function Mj(e,t,n){if(!no(e.state))return!1;let r=xj(n);const o=e.state.selection;if(o instanceof an){r||(r={width:1,height:1,rows:[be.from(Jp(er(e.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),s=yn.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=Ej(r,s.right-s.left,s.bottom-s.top),Bx(e.state,e.dispatch,a,s,r),!0}else if(r){const i=Eu(e.state),a=i.start(-1);return Bx(e.state,e.dispatch,a,yn.get(i.node(-1)).findCell(i.pos-a),r),!0}else return!1}function Nj(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const r=Hx(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof an)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(o=ca(e.state.selection.$anchor))!=null&&((n=Qp(e,t))===null||n===void 0?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(l,c){let u=Qp(e,c);const d=Oi.getState(e.state)==null;if(!u||!Yp(l,u))if(d)u=l;else return;const f=new an(l,u);if(d||!e.state.selection.eq(f)){const h=e.state.tr.setSelection(f);d&&h.setMeta(Oi,l.pos),e.dispatch(h)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),Oi.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Oi,-1))}function s(l){const c=l,u=Oi.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(Hx(e,c.target)!=r&&(d=Qp(e,t),!d))return a();d&&i(d,c)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function Fx(e,t,n){if(!(e.state.selection instanceof lt))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=r.before(o),s=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?a:null}}return null}function Hx(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Qp(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&ca(e.state.doc.resolve(r))||ca(e.state.doc.resolve(o))}var Tj=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Zp(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Zp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Zp(e,t,n,r,o,i){let a=0,s=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let d=0,f=0;d<c.childCount;d++){const{colspan:h,colwidth:p}=c.child(d).attrs;for(let v=0;v<h;v++,f++){const m=o==f?i:p&&p[v],b=m?m+"px":"";if(a+=m||r,m||(s=!1),l)l.style.width!=b&&(l.style.width=b),l=l.nextSibling;else{const y=document.createElement("col");y.style.width=b,t.appendChild(y)}}}for(;l;){var u;const d=l.nextSibling;(u=l.parentNode)===null||u===void 0||u.removeChild(l),l=d}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}const Cr=new on("tableColumnResizing");function Ij({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Tj,lastColumnResizable:o=!0}={}){const i=new Kt({key:Cr,state:{init(a,s){var l;const c=(l=i.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,u=er(s.schema).table.name;return r&&c&&(c[u]=(d,f)=>new r(d,n,f)),new Pj(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=Cr.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{Aj(a,s,e,o)},mouseleave:a=>{Rj(a)},mousedown:(a,s)=>{_j(a,s,t,n)}},decorations:a=>{const s=Cr.getState(a);if(s&&s.activeHandle>-1)return Bj(a,s.activeHandle)},nodeViews:{}}});return i}var Pj=class fh{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(Cr);if(r&&r.setHandle!=null)return new fh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new fh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let o=t.mapping.map(n.activeHandle,-1);return Xp(t.doc.resolve(o))||(o=-1),new fh(o,n.dragging)}return n}};function Aj(e,t,n,r){if(!e.editable)return;const o=Cr.getState(e.state);if(o&&!o.dragging){const i=Lj(t.target);let a=-1;if(i){const{left:s,right:l}=i.getBoundingClientRect();t.clientX-s<=n?a=Vx(e,t,"left",n):l-t.clientX<=n&&(a=Vx(e,t,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const s=e.state.doc.resolve(a),l=s.node(-1),c=yn.get(l),u=s.start(-1);if(c.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==c.width-1)return}Ux(e,a)}}}function Rj(e){if(!e.editable)return;const t=Cr.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Ux(e,-1)}function _j(e,t,n,r){var o;if(!e.editable)return!1;const i=(o=e.dom.ownerDocument.defaultView)!==null&&o!==void 0?o:window,a=Cr.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=Dj(e,a.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(Cr,{setDragging:{startX:t.clientX,startWidth:l}}));function c(d){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const f=Cr.getState(e.state);f!=null&&f.dragging&&(jj(e,f.activeHandle,Wx(f.dragging,d,n)),e.dispatch(e.state.tr.setMeta(Cr,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=Cr.getState(e.state);if(f&&f.dragging){const h=Wx(f.dragging,d,n);qx(e,f.activeHandle,h,r)}}return qx(e,a.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),t.preventDefault(),!0}function Dj(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let a=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let l=0;l<n;l++)r[l]&&(a-=r[l],s--);return a/s}function Lj(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function Vx(e,t,n,r){const o=n=="right"?-r:r,i=e.posAtCoords({left:t.clientX+o,top:t.clientY});if(!i)return-1;const{pos:a}=i,s=ca(e.state.doc.resolve(a));if(!s)return-1;if(n=="right")return s.pos;const l=yn.get(s.node(-1)),c=s.start(-1),u=l.map.indexOf(s.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function Wx(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Ux(e,t){e.dispatch(e.state.tr.setMeta(Cr,{setHandle:t}))}function jj(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=yn.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+s;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],f=o.nodeAt(d).attrs,h=f.colspan==1?0:s-i.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():zj(f.colspan);p[h]=n,l.setNodeMarkup(a+d,null,{...f,colwidth:p})}l.docChanged&&e.dispatch(l)}function qx(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=yn.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Zp(i,l.firstChild,l,r,s,n)}function zj(e){return Array(e).fill(0)}function Bj(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return sn.empty;const i=yn.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const u=s+c*i.width;if((s==i.width-1||i.map[u]!=i.map[u+1])&&(c==0||i.map[u]!=i.map[u-i.width])){var l;const d=i.map[u],f=a+d+o.nodeAt(d).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((l=Cr.getState(e))===null||l===void 0)&&l.dragging&&n.push(jn.node(a+d,a+d+o.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(jn.widget(f,h))}}return sn.create(e.doc,n)}function Fj({allowTableNodeSelection:e=!1}={}){return new Kt({key:Oi,state:{init(){return null},apply(t,n){const r=t.getMeta(Oi);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:o,pos:i}=t.mapping.mapResult(n);return o?null:i}},props:{decorations:ej,handleDOMEvents:{mousedown:Nj},createSelectionBetween(t){return Oi.getState(t.state)!=null?t.state.selection:null},handleTripleClick:kj,handleKeyDown:Oj,handlePaste:Mj},appendTransaction(t,n,r){return rj(r,Tx(r,n),e)}})}function Hj(e,t){const n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),o=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-o,s=r-n,l=o,c=n;return new DOMRect(l,c,a,s)}var Vj=class{constructor({editor:e,element:t,view:n,pluginKey:r="bubbleMenu",updateDelay:o=250,resizeDelay:i=60,shouldShow:a,appendTo:s,getReferencedVirtualElement:l,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:f,from:h,to:p})=>{const{doc:v,selection:m}=f,{empty:b}=m,y=!v.textBetween(h,p).length&&pp(f.selection),C=this.element.contains(document.activeElement);return!(!(d.hasFocus()||C)||b||y||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var f;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d!=null&&d.relatedTarget&&((f=this.element.parentNode)!=null&&f.contains(d.relatedTarget))||(d==null?void 0:d.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,f)=>{const h=!(f!=null&&f.selection.eq(d.state.selection)),p=!(f!=null&&f.doc.eq(d.state.doc));!h&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,h,p,f)},this.updateDelay))},this.updateHandler=(d,f,h,p)=>{const{composing:v}=d;if(v||!f&&!h)return;if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:d})=>{const f=d.getMeta(this.pluginKey);f==="updatePosition"?this.updatePosition():f&&typeof f=="object"&&f.type==="updateOptions"?this.updateOptions(f.options):f==="hide"?this.hide():f==="show"&&(this.updatePosition(),this.show())};var u;this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=o,this.resizeDelay=i,this.appendTo=s,this.scrollTarget=(u=c==null?void 0:c.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(Sx(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Cx(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(bx(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Ex(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(xx(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(yx(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(wx(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push($x(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t,n;const{selection:r}=this.editor.state,o=(e=this.getReferencedVirtualElement)==null?void 0:e.call(this);if(o)return o;if(!((n=(t=this.view)==null?void 0:t.dom)!=null&&n.parentNode))return;const i=gS(this.view,r.from,r.to);let a={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof at){let s=this.view.nodeDOM(r.from);const l=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");l&&(s=l),s&&(a={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(r instanceof an){const{$anchorCell:s,$headCell:l}=r,c=s?s.pos:l.pos,u=l?l.pos:s.pos,d=this.view.nodeDOM(c),f=this.view.nodeDOM(u);if(!d||!f)return;const h=d===f?d.getBoundingClientRect():Hj(d.getBoundingClientRect(),f.getBoundingClientRect());a={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return a}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ox(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:r,middlewareData:o})=>{var i,a;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((i=o.hide)!=null&&i.referenceHidden||(a=o.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),i=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,i,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:r}=n,{ranges:o}=r,i=Math.min(...o.map(l=>l.$from.pos)),a=Math.max(...o.map(l=>l.$to.pos));return((t=this.shouldShow)==null?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:i,to:a}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){var t;if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){const n=(t=e.options.scrollTarget)!=null?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Kx=e=>new Kt({key:typeof e.pluginKey=="string"?new on(e.pluginKey):e.pluginKey,view:t=>new Vj({view:t,...e})});_t.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Kx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Wj=class{constructor({editor:e,element:t,view:n,pluginKey:r="floatingMenu",updateDelay:o=250,resizeDelay:i=60,options:a,appendTo:s,shouldShow:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:f}=d,{$anchor:h,empty:p}=f,v=h.depth===1,m=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!p||!v||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,f,h)=>{const{composing:p}=u;if(p||!d&&!f)return;if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(u.relatedTarget))||(u==null?void 0:u.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var c;this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=o,this.resizeDelay=i,this.appendTo=s,this.scrollTarget=(c=a==null?void 0:a.scrollTarget)!=null?c:window,this.floatingUIOptions={...this.floatingUIOptions,...a},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return uS(e,{textSerializers:yp(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(Sx(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Cx(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(bx(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Ex(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(xx(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(yx(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(wx(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push($x(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var t;const{state:n}=this.view,{selection:r}=n,{ranges:o}=r,i=Math.min(...o.map(l=>l.$from.pos)),a=Math.max(...o.map(l=>l.$to.pos));return(t=this.shouldShow)==null?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:i,to:a})}updateOptions(e){var t;if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){const n=(t=e.options.scrollTarget)!=null?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){const{selection:e}=this.editor.state,t=gS(this.view,e.from,e.to);Ox({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:o,strategy:i,middlewareData:a})=>{var s,l;if((s=a.hide)!=null&&s.referenceHidden||(l=a.hide)!=null&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${r}px`,this.element.style.top=`${o}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!(t!=null&&t.selection.eq(e.state.selection)),r=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,n,r,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Gx=e=>new Kt({key:typeof e.pluginKey=="string"?new on(e.pluginKey):e.pluginKey,view:t=>new Wj({view:t,...e})});_t.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Gx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Xx(e,t){return e??new on(t)}var Uj=typeof window<"u"?w.useLayoutEffect:w.useEffect,Yx=new Set(["left","opacity","position","top","visibility","width"]),qj=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),Kj=new Set(["children","className","style"]),Gj=new Set(["tabIndex"]),Xj=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),Yj={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function em(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function Jj(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Qj(e){return e.startsWith("aria-")||e.startsWith("data-")||Xj.has(e)}function Jx(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zj(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=Yj[o])!=null?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function ez(e,t){let n=t.defaultPrevented,r=!1;const o=Object.create(t);return Object.defineProperties(o,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),o}function tm(e){return Gj.has(e)}function Qx(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function tz(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function nz(e,t){return typeof t!="number"||t===0||e.startsWith("--")||qj.has(e)?String(t):`${t}px`}function rz(e,t){Yx.has(t)||e.style.removeProperty(Jx(t))}function oz(e,t,n){Yx.has(t)||e.style.setProperty(Jx(t),nz(t,n))}function iz(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(Kj.has(o)||!Qj(o)||em(o,t[o])||em(o,n[o]))return;const i=t[o],a=n[o];if(i===a)return;const s=Jj(o);if(a==null||a===!1){tm(o)&&tz(e,o),e.removeAttribute(s);return}if(a===!0){tm(o)&&Qx(e,o,!0),e.setAttribute(s,"");return}if(tm(o)){Qx(e,o,a);return}e.setAttribute(s,String(a))})}function az(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function sz(e,t,n){const r=t??{},o=n??{};new Set([...Object.keys(r),...Object.keys(o)]).forEach(a=>{const s=r[a],l=o[a];if(s!==l){if(l==null){rz(e,a);return}oz(e,a,l)}})}function lz(e,t,n){t.forEach(({eventName:o,listener:i,options:a})=>{e.removeEventListener(o,i,a)});const r=[];return Object.entries(n).forEach(([o,i])=>{if(!em(o,i))return;const{eventName:a,options:s}=Zj(o),l=c=>{i(ez(e,c))};e.addEventListener(a,l,s),r.push({eventName:a,listener:l,options:s})}),r}function Zx(e,t){const n=w.useRef({}),r=w.useRef([]);Uj(()=>{const o=n.current;return az(e,o.className,t.className),sz(e,o.style,t.style),iz(e,o,t),r.current=lz(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:i,listener:a,options:s})=>{e.removeEventListener(i,a,s)}),r.current=[]}},[e,t])}var cz=w.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:o,shouldShow:i=null,getReferencedVirtualElement:a,options:s,children:l,...c},u)=>{const d=w.useRef(document.createElement("div")),f=w.useRef(Xx(e,"bubbleMenu")).current;Zx(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:h}=HS(),p=t||h,v={updateDelay:n,resizeDelay:r,appendTo:o,pluginKey:f,shouldShow:i,getReferencedVirtualElement:a,options:s},m=w.useRef(v);m.current=v;const[b,y]=w.useState(!1),C=w.useRef(!0);return w.useEffect(()=>{if(p!=null&&p.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const x=d.current;x.style.visibility="hidden",x.style.position="absolute";const S=Kx({...m.current,editor:p,element:x});p.registerPlugin(S);const E=m.current.pluginKey;return C.current=!0,y(!0),()=>{y(!1),p.unregisterPlugin(E),window.requestAnimationFrame(()=>{x.parentNode&&x.parentNode.removeChild(x)})}},[p]),w.useEffect(()=>{if(!(!b||!p||p.isDestroyed)){if(C.current){C.current=!1;return}p.view.dispatch(p.state.tr.setMeta(f,{type:"updateOptions",options:m.current}))}},[b,p,n,r,i,s,o,a,f]),En.createPortal(l,d.current)}),uz=w.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:o,shouldShow:i=null,options:a,children:s,...l},c)=>{const u=w.useRef(document.createElement("div")),d=w.useRef(Xx(e,"floatingMenu")).current;Zx(u.current,l),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:f}=HS(),h=t||f,p={updateDelay:n,resizeDelay:r,appendTo:o,pluginKey:d,shouldShow:i,options:a},v=w.useRef(p);v.current=p;const[m,b]=w.useState(!1),y=w.useRef(!0);return w.useEffect(()=>{if(h!=null&&h.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const C=u.current;C.style.visibility="hidden",C.style.position="absolute";const x=Gx({...v.current,editor:h,element:C});h.registerPlugin(x);const S=v.current.pluginKey;return y.current=!0,b(!0),()=>{b(!1),h.unregisterPlugin(S),window.requestAnimationFrame(()=>{C.parentNode&&C.parentNode.removeChild(C)})}},[h]),w.useEffect(()=>{if(!(!m||!h||h.isDestroyed)){if(y.current){y.current=!1;return}h.view.dispatch(h.state.tr.setMeta(d,{type:"updateOptions",options:v.current}))}},[m,h,n,r,i,a,o,d]),En.createPortal(s,u.current)}),Nu=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},dz=/^\s*>\s$/,fz=Tn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return Nu("blockquote",{...en(this.options.HTMLAttributes,e),children:Nu("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((o,i)=>{var a,s;const u=((s=(a=t.renderChild)==null?void 0:a.call(t,o,i))!=null?s:t.renderChildren([o])).split(`
|
|
156
|
+
`).map(d=>d.trim()===""?n:`${n} ${d}`);r.push(u.join(`
|
|
157
|
+
`))}),r.join(`
|
|
158
|
+
${n}
|
|
159
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ja({find:dz,type:this.type})]}}),hz=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,pz=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,mz=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,gz=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vz=Go.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Nu("strong",{...en(this.options.HTMLAttributes,e),children:Nu("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[aa({find:hz,type:this.type}),aa({find:mz,type:this.type})]},addPasteRules(){return[xi({find:pz,type:this.type}),xi({find:gz,type:this.type})]}}),bz=/(^|[^`])`([^`]+)`(?!`)$/,yz=/(^|[^`])`([^`]+)`(?!`)/g,Cz=Go.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",en(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[aa({find:bz,type:this.type})]},addPasteRules(){return[xi({find:yz,type:this.type})]}}),nm=4,Sz=/^```([a-z]+)?[\s\n]$/,xz=/^~~~([a-z]+)?[\s\n]$/,wz=Tn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:nm,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",en(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&((r=e.raw)==null?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const o=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${o}`,t.renderChildren(e.content),"```"].join(`
|
|
160
|
+
`):r=`\`\`\`${o}
|
|
161
|
+
|
|
162
|
+
\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:nm,{state:r}=e,{selection:o}=r,{$from:i,empty:a}=o;if(i.parent.type!==this.type)return!1;const s=" ".repeat(n);return a?e.commands.insertContent(s):e.commands.command(({tr:l})=>{const{from:c,to:u}=o,h=r.doc.textBetween(c,u,`
|
|
163
|
+
`,`
|
|
164
|
+
`).split(`
|
|
165
|
+
`).map(p=>s+p).join(`
|
|
166
|
+
`);return l.replaceWith(c,u,r.schema.text(h)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:nm,{state:r}=e,{selection:o}=r,{$from:i,empty:a}=o;return i.parent.type!==this.type?!1:a?e.commands.command(({tr:s})=>{var l;const{pos:c}=i,u=i.start(),d=i.end(),h=r.doc.textBetween(u,d,`
|
|
167
|
+
`,`
|
|
168
|
+
`).split(`
|
|
169
|
+
`);let p=0,v=0;const m=c-u;for(let E=0;E<h.length;E+=1){if(v+h[E].length>=m){p=E;break}v+=h[E].length+1}const y=((l=h[p].match(/^ */))==null?void 0:l[0])||"",C=Math.min(y.length,n);if(C===0)return!0;let x=u;for(let E=0;E<p;E+=1)x+=h[E].length+1;return s.delete(x,x+C),c-x<=C&&s.setSelection(lt.create(s.doc,x)),!0}):e.commands.command(({tr:s})=>{const{from:l,to:c}=o,f=r.doc.textBetween(l,c,`
|
|
170
|
+
`,`
|
|
171
|
+
`).split(`
|
|
172
|
+
`).map(h=>{var p;const v=((p=h.match(/^ */))==null?void 0:p[0])||"",m=Math.min(v.length,n);return h.slice(m)}).join(`
|
|
173
|
+
`);return s.replaceWith(l,c,r.schema.text(f)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
174
|
+
|
|
175
|
+
`);return!i||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:c})=>(c.setSelection(ht.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[Op({find:Sz,type:this.type,getAttributes:e=>({language:e[1]})}),Op({find:xz,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kt({key:new on("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:a,schema:s}=e.state,l=s.text(n.replace(/\r\n?/g,`
|
|
176
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(lt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),Ez=Tn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
177
|
+
|
|
178
|
+
`):""}),$z=Tn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",en(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
179
|
+
`},renderMarkdown:()=>`
|
|
180
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const d=l.filter(f=>s.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ew=Tn.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,en(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Op({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Oz=ew,kz=Tn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",en(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!B_(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return pS(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:i,tr:a,dispatch:s})=>{if(s){const{$to:l}=a.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(lt.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(at.create(a.doc,l.pos)):a.setSelection(lt.create(a.doc,l.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(a.insert(c,d),a.setSelection(lt.create(a.doc,c+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[z_({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Mz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Nz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Tz=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Iz=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Pz=Go.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",en(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[aa({find:Mz,type:this.type}),aa({find:Tz,type:this.type})]},addPasteRules(){return[xi({find:Nz,type:this.type}),xi({find:Iz,type:this.type})]}});const Az="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Rz="ελ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",rm="numeric",om="ascii",im="alpha",Cl="asciinumeric",Sl="alphanumeric",am="domain",tw="emoji",_z="scheme",Dz="slashscheme",sm="whitespace";function Lz(e,t){return e in t||(t[e]=[]),t[e]}function da(e,t,n){t[rm]&&(t[Cl]=!0,t[Sl]=!0),t[om]&&(t[Cl]=!0,t[im]=!0),t[Cl]&&(t[Sl]=!0),t[im]&&(t[Sl]=!0),t[Sl]&&(t[am]=!0),t[tw]&&(t[am]=!0);for(const r in t){const o=Lz(r,n);o.indexOf(e)<0&&o.push(e)}}function jz(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function fr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}fr.groups={},fr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const o=t.jr[r][0],i=t.jr[r][1];if(i&&o.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){r=r||fr.groups;let o;return t&&t.j?o=t:(o=new fr(t),n&&r&&da(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||fr.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let a,s=o.go(e);if(s?(a=new fr,Object.assign(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new fr,i){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(jz(a.t,r),n);da(i,l,r)}else n&&da(i,n,r);a.t=i}return o.j[e]=a,a}};const kt=(e,t,n,r,o)=>e.ta(t,n,r,o),Cn=(e,t,n,r,o)=>e.tr(t,n,r,o),nw=(e,t,n,r,o)=>e.ts(t,n,r,o),Ee=(e,t,n,r,o)=>e.tt(t,n,r,o),Qo="WORD",lm="UWORD",rw="ASCIINUMERICAL",ow="ALPHANUMERICAL",xl="LOCALHOST",cm="TLD",um="UTLD",Tu="SCHEME",ns="SLASH_SCHEME",dm="NUM",fm="WS",hm="NL",wl="OPENBRACE",El="CLOSEBRACE",Iu="OPENBRACKET",Pu="CLOSEBRACKET",Au="OPENPAREN",Ru="CLOSEPAREN",_u="OPENANGLEBRACKET",Du="CLOSEANGLEBRACKET",Lu="FULLWIDTHLEFTPAREN",ju="FULLWIDTHRIGHTPAREN",zu="LEFTCORNERBRACKET",Bu="RIGHTCORNERBRACKET",Fu="LEFTWHITECORNERBRACKET",Hu="RIGHTWHITECORNERBRACKET",Vu="FULLWIDTHLESSTHAN",Wu="FULLWIDTHGREATERTHAN",Uu="AMPERSAND",qu="APOSTROPHE",Ku="ASTERISK",ki="AT",Gu="BACKSLASH",Xu="BACKTICK",Yu="CARET",Mi="COLON",pm="COMMA",Ju="DOLLAR",Oo="DOT",Qu="EQUALS",mm="EXCLAMATION",Lr="HYPHEN",$l="PERCENT",Zu="PIPE",ed="PLUS",td="POUND",Ol="QUERY",gm="QUOTE",iw="FULLWIDTHMIDDLEDOT",vm="SEMI",ko="SLASH",kl="TILDE",nd="UNDERSCORE",aw="EMOJI",rd="SYM";var sw=Object.freeze({__proto__:null,ALPHANUMERICAL:ow,AMPERSAND:Uu,APOSTROPHE:qu,ASCIINUMERICAL:rw,ASTERISK:Ku,AT:ki,BACKSLASH:Gu,BACKTICK:Xu,CARET:Yu,CLOSEANGLEBRACKET:Du,CLOSEBRACE:El,CLOSEBRACKET:Pu,CLOSEPAREN:Ru,COLON:Mi,COMMA:pm,DOLLAR:Ju,DOT:Oo,EMOJI:aw,EQUALS:Qu,EXCLAMATION:mm,FULLWIDTHGREATERTHAN:Wu,FULLWIDTHLEFTPAREN:Lu,FULLWIDTHLESSTHAN:Vu,FULLWIDTHMIDDLEDOT:iw,FULLWIDTHRIGHTPAREN:ju,HYPHEN:Lr,LEFTCORNERBRACKET:zu,LEFTWHITECORNERBRACKET:Fu,LOCALHOST:xl,NL:hm,NUM:dm,OPENANGLEBRACKET:_u,OPENBRACE:wl,OPENBRACKET:Iu,OPENPAREN:Au,PERCENT:$l,PIPE:Zu,PLUS:ed,POUND:td,QUERY:Ol,QUOTE:gm,RIGHTCORNERBRACKET:Bu,RIGHTWHITECORNERBRACKET:Hu,SCHEME:Tu,SEMI:vm,SLASH:ko,SLASH_SCHEME:ns,SYM:rd,TILDE:kl,TLD:cm,UNDERSCORE:nd,UTLD:um,UWORD:lm,WORD:Qo,WS:fm});const Zo=/[a-z]/,Ml=new RegExp("\\p{L}","u"),bm=new RegExp("\\p{Emoji}","u"),ei=/\d/,ym=/\s/,lw="\r",Cm=`
|
|
181
|
+
`,zz="️",Bz="",Sm="";let od=null,id=null;function Fz(e=[]){const t={};fr.groups=t;const n=new fr;od==null&&(od=uw(Az)),id==null&&(id=uw(Rz)),Ee(n,"'",qu),Ee(n,"{",wl),Ee(n,"}",El),Ee(n,"[",Iu),Ee(n,"]",Pu),Ee(n,"(",Au),Ee(n,")",Ru),Ee(n,"<",_u),Ee(n,">",Du),Ee(n,"(",Lu),Ee(n,")",ju),Ee(n,"「",zu),Ee(n,"」",Bu),Ee(n,"『",Fu),Ee(n,"』",Hu),Ee(n,"<",Vu),Ee(n,">",Wu),Ee(n,"&",Uu),Ee(n,"*",Ku),Ee(n,"@",ki),Ee(n,"`",Xu),Ee(n,"^",Yu),Ee(n,":",Mi),Ee(n,",",pm),Ee(n,"$",Ju),Ee(n,".",Oo),Ee(n,"=",Qu),Ee(n,"!",mm),Ee(n,"-",Lr),Ee(n,"%",$l),Ee(n,"|",Zu),Ee(n,"+",ed),Ee(n,"#",td),Ee(n,"?",Ol),Ee(n,'"',gm),Ee(n,"/",ko),Ee(n,";",vm),Ee(n,"~",kl),Ee(n,"_",nd),Ee(n,"\\",Gu),Ee(n,"・",iw);const r=Cn(n,ei,dm,{[rm]:!0});Cn(r,ei,r);const o=Cn(r,Zo,rw,{[Cl]:!0}),i=Cn(r,Ml,ow,{[Sl]:!0}),a=Cn(n,Zo,Qo,{[om]:!0});Cn(a,ei,o),Cn(a,Zo,a),Cn(o,ei,o),Cn(o,Zo,o);const s=Cn(n,Ml,lm,{[im]:!0});Cn(s,Zo),Cn(s,ei,i),Cn(s,Ml,s),Cn(i,ei,i),Cn(i,Zo),Cn(i,Ml,i);const l=Ee(n,Cm,hm,{[sm]:!0}),c=Ee(n,lw,fm,{[sm]:!0}),u=Cn(n,ym,fm,{[sm]:!0});Ee(n,Sm,u),Ee(c,Cm,l),Ee(c,Sm,u),Cn(c,ym,u),Ee(u,lw),Ee(u,Cm),Cn(u,ym,u),Ee(u,Sm,u);const d=Cn(n,bm,aw,{[tw]:!0});Ee(d,"#"),Cn(d,bm,d),Ee(d,zz,d);const f=Ee(d,Bz);Ee(f,"#"),Cn(f,bm,d);const h=[[Zo,a],[ei,o]],p=[[Zo,null],[Ml,s],[ei,i]];for(let v=0;v<od.length;v++)Ni(n,od[v],cm,Qo,h);for(let v=0;v<id.length;v++)Ni(n,id[v],um,lm,p);da(cm,{tld:!0,ascii:!0},t),da(um,{utld:!0,alpha:!0},t),Ni(n,"file",Tu,Qo,h),Ni(n,"mailto",Tu,Qo,h),Ni(n,"http",ns,Qo,h),Ni(n,"https",ns,Qo,h),Ni(n,"ftp",ns,Qo,h),Ni(n,"ftps",ns,Qo,h),da(Tu,{scheme:!0,ascii:!0},t),da(ns,{slashscheme:!0,ascii:!0},t),e=e.sort((v,m)=>v[0]>m[0]?1:-1);for(let v=0;v<e.length;v++){const m=e[v][0],y=e[v][1]?{[_z]:!0}:{[Dz]:!0};m.indexOf("-")>=0?y[am]=!0:Zo.test(m)?ei.test(m)?y[Cl]=!0:y[om]=!0:y[rm]=!0,nw(n,m,m,y)}return nw(n,"localhost",xl,{ascii:!0}),n.jd=new fr(rd),{start:n,tokens:Object.assign({groups:t},sw)}}function cw(e,t){const n=Hz(t.replace(/[A-Z]/g,s=>s.toLowerCase())),r=n.length,o=[];let i=0,a=0;for(;a<r;){let s=e,l=null,c=0,u=null,d=-1,f=-1;for(;a<r&&(l=s.go(n[a]));)s=l,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[a].length,f++),c+=n[a].length,i+=n[a].length,a++;i-=d,a-=f,c-=d,o.push({t:u.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function Hz(e){const t=[],n=e.length;let r=0;for(;r<n;){let o=e.charCodeAt(r),i,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}function Ni(e,t,n,r,o){let i;const a=t.length;for(let s=0;s<a-1;s++){const l=t[s];e.j[l]?i=e.j[l]:(i=new fr(r),i.jr=o.slice(),e.j[l]=i),e=i}return i=new fr(n),i.jr=o.slice(),e.j[t[a-1]]=i,i}function uw(e){const t=[],n=[];let r=0,o="0123456789";for(;r<e.length;){let i=0;for(;o.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let a=parseInt(e.substring(r,r+i),10);a>0;a--)n.pop();r+=i}else n.push(e[r]),r++}return t}const Nl={defaultProtocol:"http",events:null,format:dw,formatHref:dw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function xm(e,t=null){let n=Object.assign({},Nl);e&&(n=Object.assign(n,e instanceof xm?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}xm.prototype={o:Nl,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let o=this.o[e];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Nl[e],typeof o=="function"&&r&&(o=o(t,n))):typeof o=="function"&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function dw(e){return e}function fw(e,t){this.t="token",this.v=e,this.tk=t}fw.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Nl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),a={},s=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return a.href=r,s&&(a.class=s),l&&(a.target=l),c&&(a.rel=c),u&&Object.assign(a,u),{tagName:o,attributes:a,content:i,eventListeners:d}}};function ad(e,t){class n extends fw{constructor(o,i){super(o,i),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const hw=ad("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),pw=ad("text"),Vz=ad("nl"),sd=ad("url",{isLink:!0,toHref(e=Nl.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==xl&&e[1].t===Mi}}),jr=e=>new fr(e);function Wz({groups:e}){const t=e.domain.concat([Uu,Ku,ki,Gu,Xu,Yu,Ju,Qu,Lr,dm,$l,Zu,ed,td,ko,rd,kl,nd]),n=[qu,Mi,pm,Oo,mm,$l,Ol,gm,vm,_u,Du,wl,El,Pu,Iu,Au,Ru,Lu,ju,zu,Bu,Fu,Hu,Vu,Wu],r=[Uu,qu,Ku,Gu,Xu,Yu,Ju,Qu,Lr,wl,El,$l,Zu,ed,td,Ol,ko,rd,kl,nd],o=jr(),i=Ee(o,kl);kt(i,r,i),kt(i,e.domain,i);const a=jr(),s=jr(),l=jr();kt(o,e.domain,a),kt(o,e.scheme,s),kt(o,e.slashscheme,l),kt(a,r,i),kt(a,e.domain,a);const c=Ee(a,ki);Ee(i,ki,c),Ee(s,ki,c),Ee(l,ki,c);const u=Ee(i,Oo);kt(u,r,i),kt(u,e.domain,i);const d=jr();kt(c,e.domain,d),kt(d,e.domain,d);const f=Ee(d,Oo);kt(f,e.domain,d);const h=jr(hw);kt(f,e.tld,h),kt(f,e.utld,h),Ee(c,xl,h);const p=Ee(d,Lr);Ee(p,Lr,p),kt(p,e.domain,d),kt(h,e.domain,d),Ee(h,Oo,f),Ee(h,Lr,p);const v=Ee(h,Mi);kt(v,e.numeric,hw);const m=Ee(a,Lr),b=Ee(a,Oo);Ee(m,Lr,m),kt(m,e.domain,a),kt(b,r,i),kt(b,e.domain,a);const y=jr(sd);kt(b,e.tld,y),kt(b,e.utld,y),kt(y,e.domain,a),kt(y,r,i),Ee(y,Oo,b),Ee(y,Lr,m),Ee(y,ki,c);const C=Ee(y,Mi),x=jr(sd);kt(C,e.numeric,x);const S=jr(sd),E=jr();kt(S,t,S),kt(S,n,E),kt(E,t,S),kt(E,n,E),Ee(y,ko,S),Ee(x,ko,S);const $=Ee(s,Mi),O=Ee(l,Mi),k=Ee(O,ko),M=Ee(k,ko);kt(s,e.domain,a),Ee(s,Oo,b),Ee(s,Lr,m),kt(l,e.domain,a),Ee(l,Oo,b),Ee(l,Lr,m),kt($,e.domain,S),Ee($,ko,S),Ee($,Ol,S),kt(M,e.domain,S),kt(M,t,S),Ee(M,ko,S);const T=[[wl,El],[Iu,Pu],[Au,Ru],[_u,Du],[Lu,ju],[zu,Bu],[Fu,Hu],[Vu,Wu]];for(let I=0;I<T.length;I++){const[R,N]=T[I],P=Ee(S,R);Ee(E,R,P),Ee(P,N,S);const A=jr(sd);kt(P,t,A);const _=jr();kt(P,n),kt(A,t,A),kt(A,n,_),kt(_,t,A),kt(_,n,_),Ee(A,N,S),Ee(_,N,S)}return Ee(o,xl,y),Ee(o,hm,Vz),{start:o,tokens:sw}}function Uz(e,t,n){let r=n.length,o=0,i=[],a=[];for(;o<r;){let s=e,l=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(l=s.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=l||s.go(n[o].t));)l=null,s=c,s.accepts()?(f=0,d=s):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(wm(pw,t,a)),a=[]),o-=f,u-=f;const h=d.t,p=n.slice(o-u,o);i.push(wm(h,t,p))}}return a.length>0&&i.push(wm(pw,t,a)),i}function wm(e,t,n){const r=n[0].s,o=n[n.length-1].e,i=t.slice(r,o);return new e(i,n)}const qz=typeof console<"u"&&console&&console.warn||(()=>{}),Kz="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ln={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Gz(){return fr.groups={},ln.scanner=null,ln.parser=null,ln.tokenQueue=[],ln.pluginQueue=[],ln.customSchemes=[],ln.initialized=!1,ln}function mw(e,t=!1){if(ln.initialized&&qz(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Kz}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
182
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
183
|
+
2. Cannot start or end with "-"
|
|
184
|
+
3. "-" cannot repeat`);ln.customSchemes.push([e,t])}function Xz(){ln.scanner=Fz(ln.customSchemes);for(let e=0;e<ln.tokenQueue.length;e++)ln.tokenQueue[e][1]({scanner:ln.scanner});ln.parser=Wz(ln.scanner.tokens);for(let e=0;e<ln.pluginQueue.length;e++)ln.pluginQueue[e][1]({scanner:ln.scanner,parser:ln.parser});return ln.initialized=!0,ln}function Em(e){return ln.initialized||Xz(),Uz(ln.parser.start,e,cw(ln.scanner.start,e))}Em.scan=cw;function gw(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new xm(n),o=Em(e),i=[];for(let a=0;a<o.length;a++){const s=o[a];s.isLink&&(!t||s.t===t)&&r.check(s)&&i.push(s.toFormattedObject(r))}return i}var $m="[\0- -\u2029 ]",Yz=new RegExp($m),Jz=new RegExp(`${$m}$`),Qz=new RegExp($m,"g");function Zz(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function eB(e){return new Kt({key:new on("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=t.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:a}=r,s=eS(n.doc,[...t]);if(fS(s).forEach(({newRange:c})=>{const u=z2(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!Jz.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(Yz).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],v=d.pos+f.lastIndexOf(p);if(!p)return!1;const m=Em(p).map(b=>b.toObject(e.defaultProtocol));if(!Zz(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:v+b.start+1,to:v+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>e.validate(b.value)).filter(b=>e.shouldAutoLink(b.value)).forEach(b=>{Cp(b.from,b.to,r.doc).some(y=>y.mark.type===e.type)||a.addMark(b.from,b.to,e.type.create({href:b.href}))})}}),!!a.steps.length)return a}})}function tB(e){return new Kt({key:new on("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(r.button!==0||!t.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const l=r.target;if(!l)return!1;const c=e.editor.view.dom;a=l.closest("a"),a&&!c.contains(a)&&(a=null)}if(!a)return!1;let s=!1;if(e.enableClickSelection&&(s=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const l=dS(t.state,e.type.name),c=(o=a.href)!=null?o:l.href,u=(i=a.target)!=null?i:l.target;c&&(window.open(c,u),s=!0)}return s}}})}function nB(e){return new Kt({key:new on("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:a}=i,{empty:s}=a;if(s)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=gw(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||o!==void 0&&!o(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function fa(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!e||e.replace(Qz,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var vw=Go.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(e=>{if(typeof e=="string"){mw(e);return}mw(e.scheme,e.optionalSlashes)})},onDestroy(){Gz()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!fa(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const o=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!fa(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!fa(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",en(this.options.HTMLAttributes,e),0]:["a",en(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,i;const a=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",s=(i=(o=e.attrs)==null?void 0:o.title)!=null?i:"",l=t.renderChildren(e);return s?`[${l}](${a} "${s}")`:`[${l}](${a})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!fa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!fa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xi({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=gw(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!fa(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>{this.options.shouldAutoLink(i.value)&&t.push({text:i.value,data:{href:i.href},index:i.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(eB({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!fa(o,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(tB({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(nB({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),rB=vw,oB=Object.defineProperty,iB=(e,t)=>{for(var n in t)oB(e,n,{get:t[n],enumerable:!0})},aB="listItem",bw="textStyle",yw=/^\s*([-+*])\s$/,Cw=Tn.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:e}){return["ul",en(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
185
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(aB,this.editor.getAttributes(bw)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ja({find:yw,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ja({find:yw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(bw),editor:this.editor})),[e]}}),Sw=Tn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",en(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(a=>a.type==="paragraph"))o=r(e.tokens);else{const a=e.tokens[0];if(a&&a.type==="text"&&a.tokens&&a.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(a.tokens)}],e.tokens.length>1){const l=e.tokens.slice(1),c=r(l);o.push(...c)}}else o=r(e.tokens)}return o.length===0&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>Tp(e,t,r=>{var o,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(o=r.meta)==null?void 0:o.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),sB={};iB(sB,{findListItemPos:()=>Tl,getNextListDepth:()=>Om,handleBackspace:()=>km,handleDelete:()=>Mm,hasListBefore:()=>xw,hasListItemAfter:()=>lB,hasListItemBefore:()=>ww,listItemHasSubList:()=>Ew,nextListIsDeeper:()=>$w,nextListIsHigher:()=>Ow});var Tl=(e,t)=>{const{$from:n}=t.selection,r=Nn(e,t.schema);let o=null,i=n.depth,a=n.pos,s=null;for(;i>0&&s===null;)o=n.node(i),o.type===r?s=i:(i-=1,a-=1);return s===null?null:{$pos:t.doc.resolve(a),depth:s}},Om=(e,t)=>{const n=Tl(e,t);if(!n)return!1;const[,r]=X2(t,e,n.$pos.pos+4);return r},xw=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},ww=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==e)},Ew=(e,t,n)=>{if(!n)return!1;const r=Nn(e,t.schema);let o=!1;return n.descendants(i=>{i.type===r&&(o=!0)}),o},km=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Si(e.state,t)&&xw(e.state,t,n)){const{$anchor:s}=e.state.selection,l=e.state.doc.resolve(s.before()-1),c=[];l.node().descendants((f,h)=>{f.type.name===t&&c.push({node:f,pos:h})});const u=c.at(-1);if(!u)return!1;const d=e.state.doc.resolve(l.start()+u.pos+1);return e.chain().cut({from:s.start()-1,to:s.end()+1},d.end()).joinForward().run()}if(!Si(e.state,t)||!Z2(e.state))return!1;const r=Tl(t,e.state);if(!r)return!1;const i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Ew(t,e.state,i);return ww(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},$w=(e,t)=>{const n=Om(e,t),r=Tl(e,t);return!r||!n?!1:n>r.depth},Ow=(e,t)=>{const n=Om(e,t),r=Tl(e,t);return!r||!n?!1:n<r.depth},Mm=(e,t)=>{if(!Si(e.state,t)||!Q2(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:$w(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Ow(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},lB=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==e)},kw=_t.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Mm(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Mm(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&km(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&km(e,n,r)&&(t=!0)}),t}}}}),Mw=/^(\s*)(\d+)\.\s+(.*)$/,cB=/^\s/;function uB(e){const t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function dB(e){const t=[],n=[];let r=!1;return e.forEach(o=>{if(r){n.push(o);return}if(o.trim()===""){r=!0,n.push(o);return}if(t.length>0&&uB(o)){r=!0,n.push(o);return}t.push(o)}),{paragraphLines:t,blockLines:n}}function fB(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],i=o.match(Mw);if(!i)break;const[,a,s,l]=i,c=a.length,u=[l];let d=n+1;const f=[o];let h=!1;for(;d<e.length;){const p=e[d];if(p.match(Mw))break;if(p.trim()==="")f.push(p),u.push(""),h=!0,d+=1;else if(p.match(cB))f.push(p),u.push(p.slice(c+2)),d+=1;else{if(h)break;f.push(p),u.push(p),d+=1}}t.push({indent:c,number:parseInt(s,10),content:u.join(`
|
|
186
|
+
`).trim(),contentLines:u,raw:f.join(`
|
|
187
|
+
`)}),r=d,n=d}return[t,r]}function Nw(e,t,n){const r=[];let o=0;for(;o<e.length;){const i=e[o];if(i.indent===t){const{paragraphLines:a,blockLines:s}=dB(i.contentLines),l=a.join(`
|
|
188
|
+
`).trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const u=s.join(`
|
|
189
|
+
`).trim();if(u){const h=n.blockTokens(u);c.push(...h)}let d=o+1;const f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){const h=Math.min(...f.map(v=>v.indent)),p=Nw(f,h,n);c.push({type:"list",ordered:!0,start:f[0].number,items:p,raw:f.map(v=>v.raw).join(`
|
|
190
|
+
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=d}else o+=1}return r}function hB(e,t){return e.map(n=>{if(n.type!=="list_item")return t.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(...t.parseChildren([o]));else if(o.type==="text"&&o.tokens){const i=t.parseChildren([o]);r.push({type:"paragraph",content:i})}else{const i=t.parseChildren([o]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var pB="listItem",Tw="textStyle",Iw=/^(\d+)\.\s$/,Pw=Tn.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",en(this.options.HTMLAttributes,n),0]:["ol",en(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?hB(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
191
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const o=e.split(`
|
|
192
|
+
`),[i,a]=fB(o);if(i.length===0)return;const s=Nw(i,0,n);return s.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:s,raw:o.slice(0,a).join(`
|
|
193
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pB,this.editor.getAttributes(Tw)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Ja({find:Iw,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ja({find:Iw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Tw)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),mB=/^\s*(\[([( |x])?\])\s$/,gB=Tn.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:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",en(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const o=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return Tp(e,t,o)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),a=document.createElement("span"),s=document.createElement("input"),l=document.createElement("div"),c=d=>{var f,h;s.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,d,s.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(e),i.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",d=>d.preventDefault()),s.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=n();if(typeof p!="number")return!1;const v=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...v==null?void 0:v.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,f)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{o.setAttribute(d,f)}),o.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,i.append(s,a),o.append(i,l),Object.entries(t).forEach(([d,f])=>{o.setAttribute(d,f)});let u=new Set(Object.keys(t));return{dom:o,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;o.dataset.checked=d.attrs.checked,s.checked=d.attrs.checked,c(d);const f=r.extensionManager.attributes,h=Ya(d,f),p=new Set(Object.keys(h)),v=this.options.HTMLAttributes;return u.forEach(m=>{p.has(m)||(m in v?o.setAttribute(m,v[m]):o.removeAttribute(m))}),Object.entries(h).forEach(([m,b])=>{b==null?m in v?o.setAttribute(m,v[m]):o.removeAttribute(m):o.setAttribute(m,b)}),u=p,!0}}}},addInputRules(){return[Ja({find:mB,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),vB=Tn.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:e}){return["ul",en(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
194
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=i=>{const a=Np(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,l)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:l}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(i)},o=Np(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,a)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:a}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});_t.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(Cw.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Sw.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(kw.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Pw.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(gB.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(vB.configure(this.options.taskList)),e}});var ld=" ",Nm=" ",bB=Tn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",en(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===ld||n[0].text===ld||n[0].raw===Nm||n[0].text===Nm)&&r.length===1&&r[0].type==="text"&&(r[0].text===ld||r[0].text===Nm)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(i.length===0){const a=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"&&a.length===0?ld:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,SB=Go.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",en(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[aa({find:yB,type:this.type})]},addPasteRules(){return[xi({find:CB,type:this.type})]}}),xB=Tn.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),Aw=Go.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",en(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!o)return;const i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),wB=Aw;function EB(e={}){return new Kt({view(t){return new $B(t,e)}})}class $B{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=a=>{this[o](a)};return t.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,o=this.editorView.dom,i=o.getBoundingClientRect(),a=i.width/o.offsetWidth,s=i.height/o.offsetHeight;if(n){let d=t.nodeBefore,f=t.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),v=d?p.bottom:p.top;d&&f&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*s;r={left:p.left,right:p.right,top:v-m,bottom:v+m}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*a;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,h=d.height/l.offsetHeight;c=d.left-l.scrollLeft*f,u=d.top-l.scrollTop*h}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-u)/s+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!i){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=ay(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Sn extends ht{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Sn.valid(r)?new Sn(r):ht.near(r)}content(){return He.empty}eq(t){return t instanceof Sn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Sn(t.resolve(n.pos))}getBookmark(){return new Tm(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!OB(t)||!kB(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Sn.valid(t))return t;let o=t.pos,i=null;for(let a=t.depth;;a--){let s=t.node(a);if(n>0?t.indexAfter(a)<s.childCount:t.index(a)>0){i=s.child(n>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;o+=n;let l=t.doc.resolve(o);if(Sn.valid(l))return l}for(;;){let a=n>0?i.firstChild:i.lastChild;if(!a){if(i.isAtom&&!i.isText&&!at.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=a,o+=n;let s=t.doc.resolve(o);if(Sn.valid(s))return s}return null}}}Sn.prototype.visible=!1,Sn.findFrom=Sn.findGapCursorFrom,ht.jsonID("gapcursor",Sn);class Tm{constructor(t){this.pos=t}map(t){return new Tm(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Sn.valid(n)?new Sn(n):ht.near(n)}}function Rw(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function OB(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);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||Rw(o.type))return!0;if(o.inlineContent)return!1}}return!0}function kB(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);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||Rw(o.type))return!0;if(o.inlineContent)return!1}}return!0}function MB(){return new Kt({props:{decorations:PB,createSelectionBetween(e,t,n){return t.pos==n.pos&&Sn.valid(n)?new Sn(n):null},handleClick:TB,handleKeyDown:NB,handleDOMEvents:{beforeinput:IB}}})}const NB=up({ArrowLeft:cd("horiz",-1),ArrowRight:cd("horiz",1),ArrowUp:cd("vert",-1),ArrowDown:cd("vert",1)});function cd(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let a=r.selection,s=t>0?a.$to:a.$from,l=a.empty;if(a instanceof lt){if(!i.endOfTextblock(n)||s.depth==0)return!1;l=!1,s=r.doc.resolve(t>0?s.after():s.before())}let c=Sn.findGapCursorFrom(s,t,l);return c?(o&&o(r.tr.setSelection(new Sn(c))),!0):!1}}function TB(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Sn.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&at.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Sn(r))),!0)}function IB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Sn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=be.empty;for(let a=r.length-1;a>=0;a--)o=be.from(r[a].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new He(o,0,0));return i.setSelection(lt.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function PB(e){if(!(e.selection instanceof Sn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",sn.create(e.doc,[jn.widget(e.selection.head,t,{key:"gapcursor"})])}var ud=200,zn=function(){};zn.prototype.append=function(t){return t.length?(t=zn.from(t),!this.length&&t||t.length<ud&&this.leafAppend(t)||this.length<ud&&t.leafPrepend(this)||this.appendInner(t)):this},zn.prototype.prepend=function(t){return t.length?zn.from(t).append(this):this},zn.prototype.appendInner=function(t){return new AB(this,t)},zn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?zn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},zn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},zn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},zn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,a){return o.push(t(i,a))},n,r),o},zn.from=function(t){return t instanceof zn?t:t&&t.length?new _w(t):zn.empty};var _w=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,a,s){for(var l=i;l<a;l++)if(o(this.values[l],s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(o,i,a,s){for(var l=i-1;l>=a;l--)if(o(this.values[l],s+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=ud)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=ud)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(zn);zn.empty=new _w([]);var AB=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,o,i,a){var s=this.left.length;if(o<s&&this.left.forEachInner(r,o,Math.min(i,s),a)===!1||i>s&&this.right.forEachInner(r,Math.max(o-s,0),Math.min(this.length,i)-s,a+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,a){var s=this.left.length;if(o>s&&this.right.forEachInvertedInner(r,o-s,Math.max(i,s)-s,a+s)===!1||i<s&&this.left.forEachInvertedInner(r,Math.min(o,s),i,a)===!1)return!1},t.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(zn);const RB=500;class ro{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let a=t.tr,s,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Ti(d.map));let h=d.step.map(o.slice(i)),p;h&&a.maybeStep(h).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],c.push(new Ti(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else a.maybeStep(d.step);if(d.selection)return s=o?d.selection.map(o.slice(i)):d.selection,l=new ro(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:s}}addTransform(t,n,r,o){let i=[],a=this.eventCount,s=this.items,l=!o&&s.length?s.get(s.length-1):null;for(let u=0;u<t.steps.length;u++){let d=t.steps[u].invert(t.docs[u]),f=new Ti(t.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?i.pop():s=s.slice(0,s.length-1)),i.push(f),n&&(a++,n=void 0),o||(l=f)}let c=a-r.depth;return c>DB&&(s=_B(s,c),a-=c),new ro(s.append(i),a)}remapping(t,n){let r=new Js;return this.items.forEach((o,i)=>{let a=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new ro(this.items.append(t.map(n=>new Ti(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach(f=>{f.selection&&s--},o);let l=n;this.items.forEach(f=>{let h=i.getMirror(--l);if(h==null)return;a=Math.min(a,h);let p=i.maps[h];if(f.step){let v=t.steps[h].invert(t.docs[h]),m=f.selection&&f.selection.map(i.slice(l+1,h));m&&s++,r.push(new Ti(p,v,m))}else r.push(new Ti(p))},o);let c=[];for(let f=n;f<a;f++)c.push(new Ti(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new ro(u,s);return d.emptyItemCount()>RB&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((a,s)=>{if(s>=t)o.push(a),a.selection&&i++;else if(a.step){let l=a.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=a.selection&&a.selection.map(n.slice(r));u&&i++;let d=new Ti(c.invert(),l,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else a.map&&r--},this.items.length,0),new ro(zn.from(o.reverse()),i)}}ro.empty=new ro(zn.empty,0);function _B(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}let Ti=class DI{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new DI(n.getMap().invert(),n,this.selection)}}};class Ii{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const DB=20;function LB(e,t,n,r){let o=n.getMeta(ha),i;if(o)return o.historyState;n.getMeta(BB)&&(e=new Ii(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(ha))return a.getMeta(ha).redo?new Ii(e.done.addTransform(n,void 0,r,dd(t)),e.undone,Dw(n.mapping.maps),e.prevTime,e.prevComposition):new Ii(e.done,e.undone.addTransform(n,void 0,r,dd(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),l=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!jB(n,e.prevRanges)),c=a?Im(e.prevRanges,n.mapping):Dw(n.mapping.maps);return new Ii(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,dd(t)),ro.empty,c,n.time,s??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Ii(e.done.rebased(n,i),e.undone.rebased(n,i),Im(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ii(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Im(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function jB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&o>=t[i]&&(n=!0)}),n}function Dw(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,o,i,a)=>t.push(i,a));return t}function Im(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function zB(e,t,n){let r=dd(t),o=ha.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),s=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new Ii(n?s:i.remaining,n?i.remaining:s,null,0,-1);return i.transform.setSelection(a).setMeta(ha,{redo:n,historyState:l})}let Pm=!1,Lw=null;function dd(e){let t=e.plugins;if(Lw!=t){Pm=!1,Lw=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Pm=!0;break}}return Pm}const ha=new on("history"),BB=new on("closeHistory");function FB(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Kt({key:ha,state:{init(){return new Ii(ro.empty,ro.empty,null,0,-1)},apply(t,n,r){return LB(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,o=r=="historyUndo"?zw:r=="historyRedo"?Bw:null;return!o||!t.editable?!1:(n.preventDefault(),o(t.state,t.dispatch))}}}})}function jw(e,t){return(n,r)=>{let o=ha.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(r){let i=zB(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const zw=jw(!1,!0),Bw=jw(!0,!0);_t.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Kt({key:new on("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(o==null||o===0){e=!0;return}const i=this.storage.characters({node:r.doc});if(i>o){const a=i-o,s=0,l=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(s,l);return e=!0,c}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=r||o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o||!t.getMeta("paste"))return!1;const s=t.selection.$head.pos,l=i-r,c=s-l,u=s;return t.deleteRange(c,u),!(this.storage.characters({node:t.doc})>r)}})]}});var HB=_t.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[EB(this.options)]}});_t.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Kt({key:new on("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return sn.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((l,c)=>{if(l.isText)return;if(!(o>=c&&o<=c+l.nodeSize-1))return!1;a+=1});let s=0;return e.descendants((l,c)=>{if(l.isText||!(o>=c&&o<=c+l.nodeSize-1))return!1;if(s+=1,this.options.mode==="deepest"&&a-s>0||this.options.mode==="shallowest"&&s>1)return this.options.mode==="deepest";i.push(jn.node(c,c+l.nodeSize,{class:this.options.className}))}),sn.create(e,i)}}})]}});var VB=_t.create({name:"gapCursor",addProseMirrorPlugins(){return[MB()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Vt(nt(e,"allowGapCursor",n)))!=null?t:null}}}),Fw="placeholder";function WB(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}_t.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Fw,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${WB(this.options.dataAttribute)}`:`data-${Fw}`;return[new Kt({key:new on("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,i=[];if(!r)return null;const a=this.editor.isEmpty;return t.descendants((s,l)=>{const c=o>=l&&o<=l+s.nodeSize,u=!s.isLeaf&&au(s);if(!s.type.isTextblock)return this.options.includeChildren;if((c||!this.options.showOnlyCurrent)&&u){const d=[this.options.emptyNodeClass];a&&d.push(this.options.emptyEditorClass);const f=jn.node(l,l+s.nodeSize,{class:d.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:c}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),sn.create(t,i)}}})]}}),_t.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Kt({key:new on("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||pS(n.selection)||e.view.dragging?null:sn.create(n.doc,[jn.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});var UB="skipTrailingNode";function Hw({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var qB=_t.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new on(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new Kt({key:t,appendTransaction:(o,i,a)=>{const{doc:s,tr:l,schema:c}=a,u=t.getState(a),d=s.content.size,f=c.nodes[n];if(!o.some(h=>h.getMeta(UB))&&u)return l.insert(d,f.create())},state:{init:(o,i)=>{const a=i.tr.doc.lastChild;return!Hw({node:a,types:r})},apply:(o,i)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return i;const a=o.doc.lastChild;return!Hw({node:a,types:r})}}})]}}),KB=_t.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>zw(e,t),redo:()=>({state:e,dispatch:t})=>Bw(e,t)}},addProseMirrorPlugins(){return[FB(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()}}}),GB=_t.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return this.options.bold!==!1&&o.push(vz.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(fz.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(Cw.configure(this.options.bulletList)),this.options.code!==!1&&o.push(Cz.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(wz.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(Ez.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(HB.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(VB.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push($z.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(ew.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(KB.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(kz.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(Pz.configure(this.options.italic)),this.options.listItem!==!1&&o.push(Sw.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(kw.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&o.push(vw.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&o.push(Pw.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(bB.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(SB.configure(this.options.strike)),this.options.text!==!1&&o.push(xB.configure(this.options.text)),this.options.underline!==!1&&o.push(Aw.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(qB.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),XB=GB,YB=20,Vw=(e,t=0)=>{const n=[];return!e.children.length||t>YB||Array.from(e.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...Vw(r,t+1))}),n},JB=e=>{if(!e.children.length)return;const t=Vw(e);t&&t.forEach(n=>{var r,o;const i=n.getAttribute("style"),a=(o=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:o.getAttribute("style");n.setAttribute("style",`${a};${i}`)})},Ww=Go.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&JB(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",en(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||e.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),QB=_t.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=e.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const i=r[o].split(":");if(i.length>=2){const a=i[0].trim().toLowerCase(),s=i.slice(1).join(":").trim();if(a==="background-color")return s.replace(/['"]+/g,"")}}}return(t=e.style.backgroundColor)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),Uw=_t.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=e.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const i=r[o].split(":");if(i.length>=2){const a=i[0].trim().toLowerCase(),s=i.slice(1).join(":").trim();if(a==="color")return s.replace(/['"]+/g,"")}}}return(t=e.style.color)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),ZB=_t.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),eF=_t.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),tF=_t.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});_t.create({name:"textStyleKit",addExtensions(){const e=[];return this.options.backgroundColor!==!1&&e.push(QB.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(Uw.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(ZB.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(eF.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(tF.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(Ww.configure(this.options.textStyle)),e}});var nF=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,rF=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,oF=Go.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",en(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark("highlight",t.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,t,n){const o=/^(==)([^=]+)(==)/.exec(e);if(o){const i=o[2].trim(),a=n.inlineTokens(i);return{type:"highlight",raw:o[0],text:i,tokens:a}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[aa({find:nF,type:this.type})]},addPasteRules(){return[xi({find:rF,type:this.type})]}}),iF=oF,Am={exports:{}};/*!
|
|
195
|
+
Copyright (c) 2018 Jed Watson.
|
|
196
|
+
Licensed under the MIT License (MIT), see
|
|
197
|
+
http://jedwatson.github.io/classnames
|
|
198
|
+
*/var qw;function aF(){return qw||(qw=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=o(i,r(s)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=o(a,s));return a}function o(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Am)),Am.exports}var sF=aF();const J=LI(sF);function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},he.apply(null,arguments)}function Ue(e){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(e)}var lF=Symbol.for("react.element"),cF=Symbol.for("react.transitional.element"),uF=Symbol.for("react.fragment");function Kw(e){return e&&Ue(e)==="object"&&(e.$$typeof===lF||e.$$typeof===cF)&&e.type===uF}function oo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return w.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(oo(r)):Kw(r)&&r.props?n=n.concat(oo(r.props.children,t)):n.push(r))}),n}var Gw={},Rm={},_m=[],dF=function(t){_m.push(t)};function Mo(e,t){if(Gw.NODE_ENV!=="production"&&!e&&console!==void 0){var n=_m.reduce(function(r,o){return o(r??"","warning")},t);n&&console.error("Warning: ".concat(n))}}function fF(e,t){if(Gw.NODE_ENV!=="production"&&!e&&console!==void 0){var n=_m.reduce(function(r,o){return o(r??"","note")},t);n&&console.warn("Note: ".concat(n))}}function Xw(){Rm={}}function Yw(e,t,n){!t&&!Rm[n]&&(e(!1,n),Rm[n]=!0)}function ft(e,t){Yw(Mo,e,t)}function Dm(e,t){Yw(fF,e,t)}ft.preMessage=dF,ft.resetWarned=Xw,ft.noteOnce=Dm;function hF(e,t){if(Ue(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ue(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jw(e){var t=hF(e,"string");return Ue(t)=="symbol"?t:t+""}function z(e,t,n){return(t=Jw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qw(Object(n),!0).forEach(function(r){z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Il(e){return e instanceof HTMLElement||e instanceof SVGElement}function pF(e){return e&&Ue(e)==="object"&&Il(e.nativeElement)?e.nativeElement:Il(e)?e:null}function fd(e){var t=pF(e);if(t)return t;if(e instanceof w.Component){var n;return(n=En.findDOMNode)===null||n===void 0?void 0:n.call(En,e)}return null}var hd={exports:{}},Gt={};/**
|
|
199
|
+
* @license React
|
|
200
|
+
* react-is.production.min.js
|
|
201
|
+
*
|
|
202
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the MIT license found in the
|
|
205
|
+
* LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/var Zw;function mF(){if(Zw)return Gt;Zw=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function v(m){if(typeof m=="object"&&m!==null){var b=m.$$typeof;switch(b){case e:switch(m=m.type,m){case n:case o:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case s:case a:case l:case f:case d:case i:return m;default:return b}}case t:return b}}}return Gt.ContextConsumer=a,Gt.ContextProvider=i,Gt.Element=e,Gt.ForwardRef=l,Gt.Fragment=n,Gt.Lazy=f,Gt.Memo=d,Gt.Portal=t,Gt.Profiler=o,Gt.StrictMode=r,Gt.Suspense=c,Gt.SuspenseList=u,Gt.isAsyncMode=function(){return!1},Gt.isConcurrentMode=function(){return!1},Gt.isContextConsumer=function(m){return v(m)===a},Gt.isContextProvider=function(m){return v(m)===i},Gt.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},Gt.isForwardRef=function(m){return v(m)===l},Gt.isFragment=function(m){return v(m)===n},Gt.isLazy=function(m){return v(m)===f},Gt.isMemo=function(m){return v(m)===d},Gt.isPortal=function(m){return v(m)===t},Gt.isProfiler=function(m){return v(m)===o},Gt.isStrictMode=function(m){return v(m)===r},Gt.isSuspense=function(m){return v(m)===c},Gt.isSuspenseList=function(m){return v(m)===u},Gt.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===o||m===r||m===c||m===u||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===d||m.$$typeof===i||m.$$typeof===a||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},Gt.typeOf=v,Gt}var Xt={},e1;function gF(){if(e1)return Xt;e1=1;var e={};/**
|
|
207
|
+
* @license React
|
|
208
|
+
* react-is.development.js
|
|
209
|
+
*
|
|
210
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the MIT license found in the
|
|
213
|
+
* LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/return e.NODE_ENV!=="production"&&(function(){var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=!1,m=!1,b=!1,y=!1,C=!1,x;x=Symbol.for("react.module.reference");function S(X){return!!(typeof X=="string"||typeof X=="function"||X===r||X===i||C||X===o||X===u||X===d||y||X===p||v||m||b||typeof X=="object"&&X!==null&&(X.$$typeof===h||X.$$typeof===f||X.$$typeof===a||X.$$typeof===s||X.$$typeof===c||X.$$typeof===x||X.getModuleId!==void 0))}function E(X){if(typeof X=="object"&&X!==null){var ee=X.$$typeof;switch(ee){case t:var le=X.type;switch(le){case r:case i:case o:case u:case d:return le;default:var ce=le&&le.$$typeof;switch(ce){case l:case s:case c:case h:case f:case a:return ce;default:return ee}}case n:return ee}}}var $=s,O=a,k=t,M=c,T=r,I=h,R=f,N=n,P=i,A=o,_=u,B=d,F=!1,U=!1;function K(X){return F||(F=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function j(X){return U||(U=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function D(X){return E(X)===s}function H(X){return E(X)===a}function W(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function q(X){return E(X)===c}function te(X){return E(X)===r}function G(X){return E(X)===h}function re(X){return E(X)===f}function oe(X){return E(X)===n}function ne(X){return E(X)===i}function Z(X){return E(X)===o}function ae(X){return E(X)===u}function ie(X){return E(X)===d}Xt.ContextConsumer=$,Xt.ContextProvider=O,Xt.Element=k,Xt.ForwardRef=M,Xt.Fragment=T,Xt.Lazy=I,Xt.Memo=R,Xt.Portal=N,Xt.Profiler=P,Xt.StrictMode=A,Xt.Suspense=_,Xt.SuspenseList=B,Xt.isAsyncMode=K,Xt.isConcurrentMode=j,Xt.isContextConsumer=D,Xt.isContextProvider=H,Xt.isElement=W,Xt.isForwardRef=q,Xt.isFragment=te,Xt.isLazy=G,Xt.isMemo=re,Xt.isPortal=oe,Xt.isProfiler=ne,Xt.isStrictMode=Z,Xt.isSuspense=ae,Xt.isSuspenseList=ie,Xt.isValidElementType=S,Xt.typeOf=E})(),Xt}var t1;function vF(){if(t1)return hd.exports;t1=1;var e={};return e.NODE_ENV==="production"?hd.exports=mF():hd.exports=gF(),hd.exports}var Lm=vF();function Pl(e,t,n){var r=g.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var bF=Number(w.version.split(".")[0]),jm=function(t,n){typeof t=="function"?t(n):Ue(t)==="object"&&t&&"current"in t&&(t.current=n)},sr=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.filter(Boolean);return o.length<=1?o[0]:function(i){n.forEach(function(a){jm(a,i)})}},Pi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Pl(function(){return sr.apply(void 0,n)},n,function(o,i){return o.length!==i.length||o.every(function(a,s){return a!==i[s]})})},pa=function(t){var n,r;if(!t)return!1;if(n1(t)&&bF>=19)return!0;var o=Lm.isMemo(t)?t.type.type:t.type;return!(typeof o=="function"&&!((n=o.prototype)!==null&&n!==void 0&&n.render)&&o.$$typeof!==Lm.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==Lm.ForwardRef)};function n1(e){return w.isValidElement(e)&&!Kw(e)}var rs=function(t){if(t&&n1(t)){var n=t;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},zm=g.createContext(null);function yF(e){var t=e.children,n=e.onBatchResize,r=g.useRef(0),o=g.useRef([]),i=g.useContext(zm),a=g.useCallback(function(s,l,c){r.current+=1;var u=r.current;o.current.push({size:s,element:l,data:c}),Promise.resolve().then(function(){u===r.current&&(n==null||n(o.current),o.current=[])}),i==null||i(s,l,c)},[n,i]);return g.createElement(zm.Provider,{value:a},t)}var r1=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t})()})(),Bm=typeof window<"u"&&typeof document<"u"&&window.document===document,pd=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),CF=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(pd):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),SF=2;function xF(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){CF(i)}function s(){var l=Date.now();if(n){if(l-o<SF)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var wF=20,EF=["top","right","bottom","left","width","height","size","weight"],$F=typeof MutationObserver<"u",OF=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xF(this.refresh.bind(this),wF)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Bm||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),$F?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Bm||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=EF.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),o1=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),is=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||pd}),i1=gd(0,0,0,0);function md(e){return parseFloat(e)||0}function a1(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+md(i)},0)}function kF(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=md(a)}return n}function MF(e){var t=e.getBBox();return gd(0,0,t.width,t.height)}function NF(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return i1;var r=is(e).getComputedStyle(e),o=kF(r),i=o.left+o.right,a=o.top+o.bottom,s=md(r.width),l=md(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=a1(r,"left","right")+i),Math.round(l+a)!==n&&(l-=a1(r,"top","bottom")+a)),!IF(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return gd(o.left,o.top,s,l)}var TF=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof is(e).SVGGraphicsElement}:function(e){return e instanceof is(e).SVGElement&&typeof e.getBBox=="function"}})();function IF(e){return e===is(e).document.documentElement}function PF(e){return Bm?TF(e)?MF(e):NF(e):i1}function AF(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return o1(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function gd(e,t,n,r){return{x:e,y:t,width:n,height:r}}var RF=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=gd(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=PF(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),_F=(function(){function e(t,n){var r=AF(n);o1(this,{target:t,contentRect:r})}return e})(),DF=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new r1,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof is(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new RF(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof is(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new _F(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),s1=typeof WeakMap<"u"?new WeakMap:new r1,l1=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=OF.getInstance(),r=new DF(t,n,this);s1.set(this,r)}return e})();["observe","unobserve","disconnect"].forEach(function(e){l1.prototype[e]=function(){var t;return(t=s1.get(this))[e].apply(t,arguments)}});var LF=(function(){return typeof pd.ResizeObserver<"u"?pd.ResizeObserver:l1})(),Ai=new Map;function jF(e){e.forEach(function(t){var n,r=t.target;(n=Ai.get(r))===null||n===void 0||n.forEach(function(o){return o(r)})})}var c1=new LF(jF);function zF(e,t){Ai.has(e)||(Ai.set(e,new Set),c1.observe(e)),Ai.get(e).add(t)}function BF(e,t){Ai.has(e)&&(Ai.get(e).delete(t),Ai.get(e).size||(c1.unobserve(e),Ai.delete(e)))}function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jw(r.key),r)}}function fn(e,t,n){return t&&u1(e.prototype,t),n&&u1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Al(e,t){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Al(e,t)}function io(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Al(e,t)}function Rl(e){return Rl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rl(e)}function Fm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fm=function(){return!!e})()}function ct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FF(e,t){if(t&&(Ue(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ct(e)}function ao(e){var t=Fm();return function(){var n,r=Rl(e);if(t){var o=Rl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return FF(this,n)}}var HF=(function(e){io(n,e);var t=ao(n);function n(){return dn(this,n),t.apply(this,arguments)}return fn(n,[{key:"render",value:function(){return this.props.children}}]),n})(g.Component),VF={};function WF(e,t){var n=e.children,r=e.disabled,o=g.useRef(null),i=g.useRef(null),a=g.useContext(zm),s=typeof n=="function",l=s?n(o):n,c=g.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!s&&g.isValidElement(l)&&pa(l),d=u?rs(l):null,f=Pi(d,o),h=function(){var b;return fd(o.current)||(o.current&&Ue(o.current)==="object"?fd((b=o.current)===null||b===void 0?void 0:b.nativeElement):null)||fd(i.current)};g.useImperativeHandle(t,function(){return h()});var p=g.useRef(e);p.current=e;var v=g.useCallback(function(m){var b=p.current,y=b.onResize,C=b.data,x=m.getBoundingClientRect(),S=x.width,E=x.height,$=m.offsetWidth,O=m.offsetHeight,k=Math.floor(S),M=Math.floor(E);if(c.current.width!==k||c.current.height!==M||c.current.offsetWidth!==$||c.current.offsetHeight!==O){var T={width:k,height:M,offsetWidth:$,offsetHeight:O};c.current=T;var I=$===Math.round(S)?S:$,R=O===Math.round(E)?E:O,N=V(V({},T),{},{offsetWidth:I,offsetHeight:R});a==null||a(N,m,C),y&&Promise.resolve().then(function(){y(N,m)})}},[]);return g.useEffect(function(){var m=h();return m&&!r&&zF(m,v),function(){return BF(m,v)}},[o.current,r]),g.createElement(HF,{ref:i},u?g.cloneElement(l,{ref:f}):l)}var d1=g.forwardRef(WF);VF.NODE_ENV!=="production"&&(d1.displayName="SingleObserver");var f1={},UF="rc-observer-key";function qF(e,t){var n=e.children,r=typeof n=="function"?[n]:oo(n);return f1.NODE_ENV!=="production"&&(r.length>1?Mo(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&Mo(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map(function(o,i){var a=(o==null?void 0:o.key)||"".concat(UF,"-").concat(i);return g.createElement(d1,he({},e,{key:a,ref:i===0?t:void 0}),o)})}var zr=g.forwardRef(qF);f1.NODE_ENV!=="production"&&(zr.displayName="ResizeObserver"),zr.Collection=yF;function Hm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function KF(e){if(Array.isArray(e))return Hm(e)}function h1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vm(e,t){if(e){if(typeof e=="string")return Hm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hm(e,t):void 0}}function GF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
215
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(e){return KF(e)||h1(e)||Vm(e)||GF()}var XF={},p1=function(t){return+setTimeout(t,16)},m1=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(p1=function(t){return window.requestAnimationFrame(t)},m1=function(t){return window.cancelAnimationFrame(t)});var g1=0,vd=new Map;function v1(e){vd.delete(e)}var Nt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;g1+=1;var r=g1;function o(i){if(i===0)v1(r),t();else{var a=p1(function(){o(i-1)});vd.set(r,a)}}return o(n),r};Nt.cancel=function(e){var t=vd.get(e);return v1(e),m1(t)},XF.NODE_ENV!=="production"&&(Nt.ids=function(){return vd});function b1(e){if(Array.isArray(e))return e}function YF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function y1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
216
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y(e,t){return b1(e)||YF(e,t)||Vm(e,t)||y1()}function _l(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function Gn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Wm(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var C1="data-rc-order",S1="data-rc-priority",JF="rc-util-key",Um=new Map;function x1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):JF}function bd(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function QF(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function qm(e){return Array.from((Um.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function w1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Gn())return null;var n=t.csp,r=t.prepend,o=t.priority,i=o===void 0?0:o,a=QF(r),s=a==="prependQueue",l=document.createElement("style");l.setAttribute(C1,a),s&&i&&l.setAttribute(S1,"".concat(i)),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;var c=bd(t),u=c.firstChild;if(r){if(s){var d=(t.styles||qm(c)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(C1)))return!1;var h=Number(f.getAttribute(S1)||0);return i>=h});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function E1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=bd(t);return(t.styles||qm(n)).find(function(r){return r.getAttribute(x1(t))===e})}function Dl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=E1(e,t);if(n){var r=bd(t);r.removeChild(n)}}function ZF(e,t){var n=Um.get(e);if(!n||!Wm(document,n)){var r=w1("",t),o=r.parentNode;Um.set(e,o),e.removeChild(r)}}function ti(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=bd(n),o=qm(r),i=V(V({},n),{},{styles:o});ZF(r,i);var a=E1(t,i);if(a){var s,l;if((s=i.csp)!==null&&s!==void 0&&s.nonce&&a.nonce!==((l=i.csp)===null||l===void 0?void 0:l.nonce)){var c;a.nonce=(c=i.csp)===null||c===void 0?void 0:c.nonce}return a.innerHTML!==e&&(a.innerHTML=e),a}var u=w1(e,i);return u.setAttribute(x1(i),t),u}function eH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function st(e,t){if(e==null)return{};var n,r,o=eH(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function as(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function o(i,a){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=r.has(i);if(ft(!l,"Warning: There may be circular references"),l)return!1;if(i===a)return!0;if(n&&s>1)return!1;r.add(i);var c=s+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u<i.length;u++)if(!o(i[u],a[u],c))return!1;return!0}if(i&&a&&Ue(i)==="object"&&Ue(a)==="object"){var d=Object.keys(i);return d.length!==Object.keys(a).length?!1:d.every(function(f){return o(i[f],a[f],c)})}return!1}return o(e,t)}var tH="%";function Km(e){return e.join(tH)}var nH=(function(){function e(t){dn(this,e),z(this,"instanceId",void 0),z(this,"cache",new Map),z(this,"extracted",new Set),this.instanceId=t}return fn(e,[{key:"get",value:function(n){return this.opGet(Km(n))}},{key:"opGet",value:function(n){return this.cache.get(n)||null}},{key:"update",value:function(n,r){return this.opUpdate(Km(n),r)}},{key:"opUpdate",value:function(n,r){var o=this.cache.get(n),i=r(o);i===null?this.cache.delete(n):this.cache.set(n,i)}}]),e})(),ss="data-token-hash",so="data-css-hash",rH="data-cache-path",Ri="__cssinjs_instance__";function oH(){var e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(so,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(o){o[Ri]=o[Ri]||e,o[Ri]===e&&document.head.insertBefore(o,n)});var r={};Array.from(document.querySelectorAll("style[".concat(so,"]"))).forEach(function(o){var i=o.getAttribute(so);if(r[i]){if(o[Ri]===e){var a;(a=o.parentNode)===null||a===void 0||a.removeChild(o)}}else r[i]=!0})}return new nH(e)}var Ll=g.createContext({hashPriority:"low",cache:oH(),defaultCache:!0});function iH(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Gm=(function(){function e(){dn(this,e),z(this,"cache",void 0),z(this,"keys",void 0),z(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return fn(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(n){var r,o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a={map:this.cache};return n.forEach(function(s){if(!a)a=void 0;else{var l;a=(l=a)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(s)}}),(r=a)!==null&&r!==void 0&&r.value&&i&&(a.value[1]=this.cacheCallTimes++),(o=a)===null||o===void 0?void 0:o.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var o=this;if(!this.has(n)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(c,u){var d=Y(c,2),f=d[1];return o.internalGet(u)[1]<f?[u,o.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),a=Y(i,1),s=a[0];this.delete(s)}this.keys.push(n)}var l=this.cache;n.forEach(function(c,u){if(u===n.length-1)l.set(c,{value:[r,o.cacheCallTimes++]});else{var d=l.get(c);d?d.map||(d.map=new Map):l.set(c,{map:new Map}),l=l.get(c).map}})}},{key:"deleteByPath",value:function(n,r){var o=n.get(r[0]);if(r.length===1){var i;return o.map?n.set(r[0],{map:o.map}):n.delete(r[0]),(i=o.value)===null||i===void 0?void 0:i[0]}var a=this.deleteByPath(o.map,r.slice(1));return(!o.map||o.map.size===0)&&!o.value&&n.delete(r[0]),a}},{key:"delete",value:function(n){if(this.has(n))return this.keys=this.keys.filter(function(r){return!iH(r,n)}),this.deleteByPath(this.cache,n)}}]),e})();z(Gm,"MAX_CACHE_SIZE",20),z(Gm,"MAX_CACHE_OFFSET",5);var $1=0,O1=(function(){function e(t){dn(this,e),z(this,"derivatives",void 0),z(this,"id",void 0),this.derivatives=Array.isArray(t)?t:[t],this.id=$1,t.length===0&&Mo(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),$1+=1}return fn(e,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,o){return o(n,r)},void 0)}}]),e})(),Xm=new Gm;function Ym(e){var t=Array.isArray(e)?e:[e];return Xm.has(t)||Xm.set(t,new O1(t)),Xm.get(t)}var aH=new WeakMap,Jm={};function sH(e,t){for(var n=aH,r=0;r<t.length;r+=1){var o=t[r];n.has(o)||n.set(o,new WeakMap),n=n.get(o)}return n.has(Jm)||n.set(Jm,e()),n.get(Jm)}var k1=new WeakMap;function jl(e){var t=k1.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof O1?t+=r.id:r&&Ue(r)==="object"?t+=jl(r):t+=r}),t=_l(t),k1.set(e,t)),t}function M1(e,t){return _l("".concat(t,"_").concat(jl(e)))}var Qm=Gn();function Q(e){return typeof e=="number"?"".concat(e,"px"):e}function yd(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(o)return e;var i=V(V({},r),{},z(z({},ss,t),so,n)),a=Object.keys(i).map(function(s){var l=i[s];return l?"".concat(s,'="').concat(l,'"'):null}).filter(function(s){return s}).join(" ");return"<style ".concat(a,">").concat(e,"</style>")}var Cd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},lH=function(t,n,r){return Object.keys(t).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(t).map(function(o){var i=Y(o,2),a=i[0],s=i[1];return"".concat(a,":").concat(s,";")}).join(""),"}"):""},N1=function(t,n,r){var o={},i={};return Object.entries(t).forEach(function(a){var s,l,c=Y(a,2),u=c[0],d=c[1];if(r!=null&&(s=r.preserve)!==null&&s!==void 0&&s[u])i[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(r!=null&&(l=r.ignore)!==null&&l!==void 0&&l[u])){var f,h=Cd(u,r==null?void 0:r.prefix);o[h]=typeof d=="number"&&!(r!=null&&(f=r.unitless)!==null&&f!==void 0&&f[u])?"".concat(d,"px"):String(d),i[u]="var(".concat(h,")")}}),[i,lH(o,n,{scope:r==null?void 0:r.scope})]},cH={},T1=cH.NODE_ENV!=="test"&&Gn()?g.useLayoutEffect:g.useEffect,Yt=function(t,n){var r=g.useRef(!0);T1(function(){return t(r.current)},n),T1(function(){return r.current=!1,function(){r.current=!0}},[])},ls=function(t,n){Yt(function(r){if(!r)return t()},n)},uH=V({},g),I1=uH.useInsertionEffect,dH=function(t,n,r){g.useMemo(t,r),Yt(function(){return n(!0)},r)},fH=I1?function(e,t,n){return I1(function(){return e(),t()},n)}:dH,hH={},pH=V({},g),mH=pH.useInsertionEffect,gH=function(t){var n=[],r=!1;function o(i){if(r){hH.NODE_ENV!=="production"&&Mo(!1,"[Ant Design CSS-in-JS] You are registering a cleanup function after unmount, which will not have any effect.");return}n.push(i)}return g.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(i){return i()})}},t),o},vH=function(){return function(t){t()}},bH=typeof mH<"u"?gH:vH,P1={};function yH(){return!1}var Zm=!1;function CH(){return Zm}const SH=P1.NODE_ENV==="production"?yH:CH;if(P1.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){var Sd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null;if(Sd&&typeof Sd.webpackHotUpdate=="function"){var xH=Sd.webpackHotUpdate;Sd.webpackHotUpdate=function(){return Zm=!0,setTimeout(function(){Zm=!1},0),xH.apply(void 0,arguments)}}}var A1={};function eg(e,t,n,r,o){var i=g.useContext(Ll),a=i.cache,s=[e].concat(de(t)),l=Km(s),c=bH([l]),u=SH(),d=function(v){a.opUpdate(l,function(m){var b=m||[void 0,void 0],y=Y(b,2),C=y[0],x=C===void 0?0:C,S=y[1],E=S;A1.NODE_ENV!=="production"&&S&&u&&(r==null||r(E,u),E=null);var $=E||n(),O=[x,$];return v?v(O):O})};g.useMemo(function(){d()},[l]);var f=a.opGet(l);A1.NODE_ENV!=="production"&&!f&&(d(),f=a.opGet(l));var h=f[1];return fH(function(){o==null||o(h)},function(p){return d(function(v){var m=Y(v,2),b=m[0],y=m[1];return p&&b===0&&(o==null||o(h)),[b+1,y]}),function(){a.opUpdate(l,function(v){var m=v||[],b=Y(m,2),y=b[0],C=y===void 0?0:y,x=b[1],S=C-1;return S===0?(c(function(){(p||!a.opGet(l))&&(r==null||r(x,!1))}),null):[C-1,x]})}},[l]),h}var wH={},EH={},$H=wH.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",ma=new Map;function OH(e){ma.set(e,(ma.get(e)||0)+1)}function kH(e,t){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(ss,'="').concat(e,'"]'));n.forEach(function(r){if(r[Ri]===t){var o;(o=r.parentNode)===null||o===void 0||o.removeChild(r)}})}}var MH=0;function NH(e,t){ma.set(e,(ma.get(e)||0)-1);var n=new Set;ma.forEach(function(r,o){r<=0&&n.add(o)}),ma.size-n.size>MH&&n.forEach(function(r){kH(r,t),ma.delete(r)})}var TH=function(t,n,r,o){var i=r.getDerivativeToken(t),a=V(V({},i),n);return o&&(a=o(a)),a},R1="token";function IH(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=w.useContext(Ll),o=r.cache.instanceId,i=r.container,a=n.salt,s=a===void 0?"":a,l=n.override,c=l===void 0?EH:l,u=n.formatToken,d=n.getComputedToken,f=n.cssVar,h=sH(function(){return Object.assign.apply(Object,[{}].concat(de(t)))},t),p=jl(h),v=jl(c),m=f?jl(f):"",b=eg(R1,[s,e.id,p,v,m],function(){var y,C=d?d(h,c,e):TH(h,c,e,u),x=V({},C),S="";if(f){var E=N1(C,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),$=Y(E,2);C=$[0],S=$[1]}var O=M1(C,s);C._tokenKey=O,x._tokenKey=M1(x,s);var k=(y=f==null?void 0:f.key)!==null&&y!==void 0?y:O;C._themeKey=k,OH(k);var M="".concat($H,"-").concat(_l(O));return C._hashId=M,[C,M,x,S,(f==null?void 0:f.key)||""]},function(y){NH(y[0]._themeKey,o)},function(y){var C=Y(y,4),x=C[0],S=C[3];if(f&&S){var E=ti(S,_l("css-variables-".concat(x._themeKey)),{mark:so,prepend:"queue",attachTo:i,priority:-999});E[Ri]=o,E.setAttribute(ss,x._themeKey)}});return b}var PH=function(t,n,r){var o=Y(t,5),i=o[2],a=o[3],s=o[4],l=r||{},c=l.plain;if(!a)return null;var u=i._tokenKey,d=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},h=yd(a,s,u,f,c);return[d,u,h]},AH={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},_1="comm",D1="rule",L1="decl",RH="@import",_H="@namespace",DH="@keyframes",LH="@layer",jH=Math.abs,zl=String.fromCharCode;function j1(e){return e.trim()}function tg(e,t,n){return e.replace(t,n)}function cs(e,t){return e.charCodeAt(t)|0}function us(e,t,n){return e.slice(t,n)}function No(e){return e.length}function zH(e){return e.length}function xd(e,t){return t.push(e),e}var wd=1,ds=1,z1=0,Br=0,In=0,fs="";function ng(e,t,n,r,o,i,a,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:wd,column:ds,length:a,return:"",siblings:s}}function BH(){return In}function FH(){return In=Br>0?cs(fs,--Br):0,ds--,In===10&&(ds=1,wd--),In}function lo(){return In=Br<z1?cs(fs,Br++):0,ds++,In===10&&(ds=1,wd++),In}function _i(){return cs(fs,Br)}function Ed(){return Br}function $d(e,t){return us(fs,e,t)}function Bl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HH(e){return wd=ds=1,z1=No(fs=e),Br=0,[]}function VH(e){return fs="",e}function rg(e){return j1($d(Br-1,og(e===91?e+2:e===40?e+1:e)))}function WH(e){for(;(In=_i())&&In<33;)lo();return Bl(e)>2||Bl(In)>3?"":" "}function UH(e,t){for(;--t&&lo()&&!(In<48||In>102||In>57&&In<65||In>70&&In<97););return $d(e,Ed()+(t<6&&_i()==32&&lo()==32))}function og(e){for(;lo();)switch(In){case e:return Br;case 34:case 39:e!==34&&e!==39&&og(In);break;case 40:e===41&&og(e);break;case 92:lo();break}return Br}function qH(e,t){for(;lo()&&e+In!==57;)if(e+In===84&&_i()===47)break;return"/*"+$d(t,Br-1)+"*"+zl(e===47?e:lo())}function KH(e){for(;!Bl(_i());)lo();return $d(e,Br)}function GH(e){return VH(Od("",null,null,null,[""],e=HH(e),0,[0],e))}function Od(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,f=0,h=0,p=0,v=1,m=1,b=1,y=0,C=0,x="",S=o,E=i,$=r,O=x;m;)switch(p=C,C=lo()){case 40:p!=108&&cs(O,d-1)==58?(y++,O+="("):O+=rg(C);break;case 41:y--,O+=")";break;case 34:case 39:case 91:O+=rg(C);break;case 9:case 10:case 13:case 32:if(y>0){O+=zl(C);break}O+=WH(p);break;case 92:O+=UH(Ed()-1,7);continue;case 47:switch(_i()){case 42:case 47:xd(XH(qH(lo(),Ed()),t,n,l),l),(Bl(p||1)==5||Bl(_i()||1)==5)&&No(O)&&us(O,-1,void 0)!==" "&&(O+=" ");break;default:O+="/"}break;case 123*v:s[c++]=No(O)*b;case 125*v:case 59:case 0:if(y>0&&C){O+=zl(C);break}switch(C){case 0:case 125:m=0;case 59+u:b==-1&&(O=tg(O,/\f/g,"")),h>0&&(No(O)-d||v===0)&&xd(h>32?F1(O+";",r,n,d-1,l):F1(tg(O," ","")+";",r,n,d-2,l),l);break;case 59:O+=";";default:if(xd($=B1(O,t,n,c,u,o,s,x,S=[],E=[],d,i),i),C===123)if(u===0)Od(O,t,$,$,S,i,d,s,E);else{switch(f){case 99:if(cs(O,3)===110)break;case 108:if(cs(O,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Od(e,$,$,r&&xd(B1(e,$,$,0,0,o,s,x,o,S=[],d,E),E),o,E,d,s,r?S:E):Od(O,$,$,$,[""],E,0,s,E)}}c=u=h=0,v=b=1,x=O="",d=a;break;case 58:d=1+No(O),h=p;default:if(v<1){if(C==123)--v;else if(C==125&&v++==0&&FH()==125)continue}switch(O+=zl(C),C*v){case 38:b=u>0?1:(O+="\f",-1);break;case 44:if(y>0)break;s[c++]=(No(O)-1)*b,b=1;break;case 64:_i()===45&&(O+=rg(lo())),f=_i(),u=d=No(x=O+=KH(Ed())),C++;break;case 45:p===45&&No(O)==2&&(v=0)}}return i}function B1(e,t,n,r,o,i,a,s,l,c,u,d){for(var f=o-1,h=o===0?i:[""],p=zH(h),v=0,m=0,b=0;v<r;++v)for(var y=0,C=us(e,f+1,f=jH(m=a[v])),x=e;y<p;++y)(x=j1(m>0?h[y]+" "+C:tg(C,/&\f/g,h[y])))&&(l[b++]=x);return ng(e,t,n,o===0?D1:s,l,c,u,d)}function XH(e,t,n,r){return ng(e,t,n,_1,zl(BH()),us(e,2,-2),0,r)}function F1(e,t,n,r,o){return ng(e,t,n,L1,us(e,0,r),us(e,r+1,-1),r,o)}function ig(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function YH(e,t,n,r){switch(e.type){case LH:if(e.children.length)break;case RH:case _H:case L1:return e.return=e.return||e.value;case _1:return"";case DH:return e.return=e.value+"{"+ig(e.children,r)+"}";case D1:if(!No(e.value=e.props.join(",")))return""}return No(n=ig(e.children,r))?e.return=e.value+"{"+n+"}":""}function H1(e,t){var n=t.path,r=t.parentSelectors;ft(!1,"[Ant Design CSS-in-JS] ".concat(n?"Error in ".concat(n,": "):"").concat(e).concat(r.length?" Selector: ".concat(r.join(" | ")):""))}var JH=function(t,n,r){if(t==="content"){var o=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,i=["normal","none","initial","inherit","unset"];(typeof n!="string"||i.indexOf(n)===-1&&!o.test(n)&&(n.charAt(0)!==n.charAt(n.length-1)||n.charAt(0)!=='"'&&n.charAt(0)!=="'"))&&H1("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(n,"\"'`."),r)}},QH=function(t,n,r){t==="animation"&&r.hashId&&n!=="none"&&H1("You seem to be using hashed animation '".concat(n,"', in which case 'animationName' with Keyframe as value is recommended."),r)},V1="data-ant-cssinjs-cache-path",W1="_FILE_STYLE__",ga,U1=!0;function ZH(){if(!ga&&(ga={},Gn())){var e=document.createElement("div");e.className=V1,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);var t=getComputedStyle(e).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(function(o){var i=o.split(":"),a=Y(i,2),s=a[0],l=a[1];ga[s]=l});var n=document.querySelector("style[".concat(V1,"]"));if(n){var r;U1=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(e)}}function e3(e){return ZH(),!!ga[e]}function t3(e){var t=ga[e],n=null;if(t&&Gn())if(U1)n=W1;else{var r=document.querySelector("style[".concat(so,'="').concat(ga[e],'"]'));r?n=r.innerHTML:delete ga[e]}return[n,t]}var ag={},q1="_skip_check_",K1="_multi_value_";function kd(e){var t=ig(GH(e),YH);return t.replace(/\{%%%\:[^;];}/g,";")}function n3(e){return Ue(e)==="object"&&e&&(q1 in e||K1 in e)}function G1(e,t,n){if(!t)return e;var r=".".concat(t),o=n==="low"?":where(".concat(r,")"):r,i=e.split(",").map(function(a){var s,l=a.trim().split(/\s+/),c=l[0]||"",u=((s=c.match(/^\w+/))===null||s===void 0?void 0:s[0])||"";return c="".concat(u).concat(o).concat(c.slice(u.length)),[c].concat(de(l.slice(1))).join(" ")});return i.join(",")}var r3=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},o=r.root,i=r.injectHash,a=r.parentSelectors,s=n.hashId,l=n.layer,c=n.path,u=n.hashPriority,d=n.transformers,f=d===void 0?[]:d,h=n.linters,p=h===void 0?[]:h,v="",m={};function b(x){var S=x.getName(s);if(!m[S]){var E=e(x.style,n,{root:!1,parentSelectors:a}),$=Y(E,1),O=$[0];m[S]="@keyframes ".concat(x.getName(s)).concat(O)}}function y(x){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return x.forEach(function(E){Array.isArray(E)?y(E,S):E&&S.push(E)}),S}var C=y(Array.isArray(t)?t:[t]);return C.forEach(function(x){var S=typeof x=="string"&&!o?{}:x;if(typeof S=="string")v+="".concat(S,`
|
|
217
|
+
`);else if(S._keyframe)b(S);else{var E=f.reduce(function($,O){var k;return(O==null||(k=O.visit)===null||k===void 0?void 0:k.call(O,$))||$},S);Object.keys(E).forEach(function($){var O=E[$];if(Ue(O)==="object"&&O&&($!=="animationName"||!O._keyframe)&&!n3(O)){var k=!1,M=$.trim(),T=!1;(o||i)&&s?M.startsWith("@")?k=!0:M==="&"?M=G1("",s,u):M=G1($,s,u):o&&!s&&(M==="&"||M==="")&&(M="",T=!0);var I=e(O,n,{root:T,injectHash:k,parentSelectors:[].concat(de(a),[M])}),R=Y(I,2),N=R[0],P=R[1];m=V(V({},m),P),v+="".concat(M).concat(N)}else{let B=function(F,U){ag.NODE_ENV!=="production"&&(Ue(O)!=="object"||!(O!=null&&O[q1]))&&[JH,QH].concat(de(p)).forEach(function(D){return D(F,U,{path:c,hashId:s,parentSelectors:a})});var K=F.replace(/[A-Z]/g,function(D){return"-".concat(D.toLowerCase())}),j=U;!AH[F]&&typeof j=="number"&&j!==0&&(j="".concat(j,"px")),F==="animationName"&&U!==null&&U!==void 0&&U._keyframe&&(b(U),j=U.getName(s)),v+="".concat(K,":").concat(j,";")};var A,_=(A=O==null?void 0:O.value)!==null&&A!==void 0?A:O;Ue(O)==="object"&&O!==null&&O!==void 0&&O[K1]&&Array.isArray(_)?_.forEach(function(F){B($,F)}):B($,_)}})}}),o?l&&(v&&(v="@layer ".concat(l.name," {").concat(v,"}")),l.dependencies&&(m["@layer ".concat(l.name)]=l.dependencies.map(function(x){return"@layer ".concat(x,", ").concat(l.name,";")}).join(`
|
|
218
|
+
`))):v="{".concat(v,"}"),[v,m]};function X1(e,t){return _l("".concat(e.join("%")).concat(t))}function o3(){return null}var Y1="style";function sg(e,t){var n=e.token,r=e.path,o=e.hashId,i=e.layer,a=e.nonce,s=e.clientOnly,l=e.order,c=l===void 0?0:l,u=g.useContext(Ll),d=u.autoClear,f=u.mock,h=u.defaultCache,p=u.hashPriority,v=u.container,m=u.ssrInline,b=u.transformers,y=u.linters,C=u.cache,x=u.layer,S=n._tokenKey,E=[S];x&&E.push("layer"),E.push.apply(E,de(r));var $=Qm;ag.NODE_ENV!=="production"&&f!==void 0&&($=f==="client");var O=eg(Y1,E,function(){var R=E.join("|");if(e3(R)){var N=t3(R),P=Y(N,2),A=P[0],_=P[1];if(A)return[A,S,_,{},s,c]}var B=t(),F=r3(B,{hashId:o,hashPriority:p,layer:x?i:void 0,path:r.join("-"),transformers:b,linters:y}),U=Y(F,2),K=U[0],j=U[1],D=kd(K),H=X1(E,D);return[D,S,H,j,s,c]},function(R,N){var P=Y(R,3),A=P[2];(N||d)&&Qm&&Dl(A,{mark:so,attachTo:v})},function(R){var N=Y(R,4),P=N[0];N[1];var A=N[2],_=N[3];if($&&P!==W1){var B={mark:so,prepend:x?!1:"queue",attachTo:v,priority:c},F=typeof a=="function"?a():a;F&&(B.csp={nonce:F});var U=[],K=[];Object.keys(_).forEach(function(D){D.startsWith("@layer")?U.push(D):K.push(D)}),U.forEach(function(D){ti(kd(_[D]),"_layer-".concat(D),V(V({},B),{},{prepend:!0}))});var j=ti(P,A,B);j[Ri]=C.instanceId,j.setAttribute(ss,S),ag.NODE_ENV!=="production"&&j.setAttribute(rH,E.join("|")),K.forEach(function(D){ti(kd(_[D]),"_effect-".concat(D),B)})}}),k=Y(O,3),M=k[0],T=k[1],I=k[2];return function(R){var N;return!m||$||!h?N=g.createElement(o3,null):N=g.createElement("style",he({},z(z({},ss,T),so,I),{dangerouslySetInnerHTML:{__html:M}})),g.createElement(g.Fragment,null,N,R)}}var i3=function(t,n,r){var o=Y(t,6),i=o[0],a=o[1],s=o[2],l=o[3],c=o[4],u=o[5],d=r||{},f=d.plain;if(c)return null;var h=i,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return h=yd(i,a,s,p,f),l&&Object.keys(l).forEach(function(v){if(!n[v]){n[v]=!0;var m=kd(l[v]),b=yd(m,a,"_effect-".concat(v),p,f);v.startsWith("@layer")?h=b+h:h+=b}}),[u,s,h]},J1="cssVar",a3=function(t,n){var r=t.key,o=t.prefix,i=t.unitless,a=t.ignore,s=t.token,l=t.scope,c=l===void 0?"":l,u=w.useContext(Ll),d=u.cache.instanceId,f=u.container,h=s._tokenKey,p=[].concat(de(t.path),[r,c,h]),v=eg(J1,p,function(){var m=n(),b=N1(m,r,{prefix:o,unitless:i,ignore:a,scope:c}),y=Y(b,2),C=y[0],x=y[1],S=X1(p,x);return[C,x,S,r]},function(m){var b=Y(m,3),y=b[2];Qm&&Dl(y,{mark:so,attachTo:f})},function(m){var b=Y(m,3),y=b[1],C=b[2];if(y){var x=ti(y,C,{mark:so,prepend:"queue",attachTo:f,priority:-999});x[Ri]=d,x.setAttribute(ss,r)}});return v},s3=function(t,n,r){var o=Y(t,4),i=o[1],a=o[2],s=o[3],l=r||{},c=l.plain;if(!i)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=yd(i,s,a,d,c);return[u,a,f]};z(z(z({},Y1,i3),R1,PH),J1,s3);var It=(function(){function e(t,n){dn(this,e),z(this,"name",void 0),z(this,"style",void 0),z(this,"_keyframe",!0),this.name=t,this.style=n}return fn(e,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),e})();function hs(e){return e.notSplit=!0,e}hs(["borderTop","borderBottom"]),hs(["borderTop"]),hs(["borderBottom"]),hs(["borderLeft","borderRight"]),hs(["borderLeft"]),hs(["borderRight"]);var lg=w.createContext({});function Q1(e){return b1(e)||h1(e)||Vm(e)||y1()}function To(e,t){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function Z1(e,t,n,r){if(!t.length)return n;var o=Q1(t),i=o[0],a=o.slice(1),s;return!e&&typeof i=="number"?s=[]:Array.isArray(e)?s=de(e):s=V({},e),r&&n===void 0&&a.length===1?delete s[i][a[0]]:s[i]=Z1(s[i],a,n,r),s}function co(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!To(e,t.slice(0,-1))?e:Z1(e,t,n,r)}function l3(e){return Ue(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function eE(e){return Array.isArray(e)?[]:{}}var c3=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function ps(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=eE(t[0]);return t.forEach(function(o){function i(a,s){var l=new Set(s),c=To(o,a),u=Array.isArray(c);if(u||l3(c)){if(!l.has(c)){l.add(c);var d=To(r,a);u?r=co(r,a,[]):(!d||Ue(d)!=="object")&&(r=co(r,a,eE(c))),c3(c).forEach(function(f){i([].concat(de(a),[f]),l)})}}else r=co(r,a,c)}i([])}),r}var Md={};function tE(){}let ni=null;function u3(){ni=null,Xw()}let nE=tE;Md.NODE_ENV!=="production"&&(nE=(e,t,n)=>{ft(e,`[antd: ${t}] ${n}`),Md.NODE_ENV==="test"&&u3()});const Di=nE,rE=g.createContext({}),Wt=Md.NODE_ENV!=="production"?e=>{const{strict:t}=g.useContext(rE),n=(r,o,i)=>{if(!r)if(t===!1&&o==="deprecated"){const a=ni;ni||(ni={}),ni[e]=ni[e]||[],ni[e].includes(i||"")||ni[e].push(i||""),a||console.warn("[antd] There exists deprecated usage in your code:",ni)}else Md.NODE_ENV!=="production"&&Di(r,e,i)};return n.deprecated=(r,o,i,a)=>{n(r,"deprecated",`\`${o}\` is deprecated. Please use \`${i}\` instead.${a?` ${a}`:""}`)},n}:()=>{const e=()=>{};return e.deprecated=tE,e},d3=w.createContext(void 0);var f3={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},h3={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},p3=V(V({},h3),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const oE={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},iE={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},p3),timePickerLocale:Object.assign({},oE)},Sr="${label} is not a valid ${type}",ri={locale:"en",Pagination:f3,DatePicker:iE,TimePicker:oE,Calendar:iE,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:Sr,method:Sr,array:Sr,object:Sr,number:Sr,date:Sr,boolean:Sr,integer:Sr,float:Sr,regexp:Sr,email:Sr,url:Sr,hex:Sr},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let Nd=Object.assign({},ri.Modal),Td=[];const aE=()=>Td.reduce((e,t)=>Object.assign(Object.assign({},e),t),ri.Modal);function m3(e){if(e){const t=Object.assign({},e);return Td.push(t),Nd=aE(),()=>{Td=Td.filter(n=>n!==t),Nd=aE()}}Nd=Object.assign({},ri.Modal)}function sE(){return Nd}const cg=w.createContext(void 0),uo=(e,t)=>{const n=g.useContext(cg),r=g.useMemo(()=>{var i;const a=t||ri[e],s=(i=n==null?void 0:n[e])!==null&&i!==void 0?i:{};return Object.assign(Object.assign({},typeof a=="function"?a():a),s||{})},[e,t,n]),o=g.useMemo(()=>{const i=n==null?void 0:n.locale;return n!=null&&n.exist&&!i?ri.locale:i},[n]);return[r,o]};var ug={};const lE="internalMark",cE=e=>{const{locale:t={},children:n,_ANT_MARK__:r}=e;if(ug.NODE_ENV!=="production"){const i=Wt("LocaleProvider");ug.NODE_ENV!=="production"&&i(r===lE,"deprecated","`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale")}g.useEffect(()=>m3(t==null?void 0:t.Modal),[t]);const o=g.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return g.createElement(cg.Provider,{value:o},n)};ug.NODE_ENV!=="production"&&(cE.displayName="LocaleProvider");const uE={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Fl=Object.assign(Object.assign({},uE),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
219
|
+
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
220
|
+
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),Bn=Math.round;function dg(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(o=>parseFloat(o));for(let o=0;o<3;o+=1)r[o]=t(r[o]||0,n[o]||"",o);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const dE=(e,t,n)=>n===0?e:e/100;function Hl(e,t){const n=t||255;return e>n?n:e<0?0:e}class Ut{constructor(t){z(this,"isValid",!0),z(this,"r",0),z(this,"g",0),z(this,"b",0),z(this,"a",1),z(this,"_h",void 0),z(this,"_s",void 0),z(this,"_l",void 0),z(this,"_v",void 0),z(this,"_max",void 0),z(this,"_min",void 0),z(this,"_brightness",void 0);function n(r){return r[0]in t&&r[1]in t&&r[2]in t}if(t)if(typeof t=="string"){let o=function(i){return r.startsWith(i)};const r=t.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):o("rgb")?this.fromRgbString(r):o("hsl")?this.fromHslString(r):(o("hsv")||o("hsb"))&&this.fromHsvString(r)}else if(t instanceof Ut)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=Hl(t.r),this.g=Hl(t.g),this.b=Hl(t.b),this.a=typeof t.a=="number"?Hl(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(i){const a=i/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}const n=t(this.r),r=t(this.g),o=t(this.b);return .2126*n+.7152*r+.0722*o}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Bn(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),r=this.getSaturation();let o=this.getLightness()-t/100;return o<0&&(o=0),this._c({h:n,s:r,l:o,a:this.a})}lighten(t=10){const n=this.getHue(),r=this.getSaturation();let o=this.getLightness()+t/100;return o>1&&(o=1),this._c({h:n,s:r,l:o,a:this.a})}mix(t,n=50){const r=this._c(t),o=n/100,i=s=>(r[s]-this[s])*o+this[s],a={r:Bn(i("r")),g:Bn(i("g")),b:Bn(i("b")),a:Bn(i("a")*100)/100};return this._c(a)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),r=this.a+n.a*(1-this.a),o=i=>Bn((this[i]*this.a+n[i]*n.a*(1-this.a))/r);return this._c({r:o("r"),g:o("g"),b:o("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);t+=r.length===2?r:"0"+r;const o=(this.b||0).toString(16);if(t+=o.length===2?o:"0"+o,typeof this.a=="number"&&this.a>=0&&this.a<1){const i=Bn(this.a*255).toString(16);t+=i.length===2?i:"0"+i}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Bn(this.getSaturation()*100),r=Bn(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${r}%,${this.a})`:`hsl(${t},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,r){const o=this.clone();return o[t]=Hl(n,r),o}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function r(o,i){return parseInt(n[o]+n[i||o],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:t,s:n,l:r,a:o}){if(this._h=t%360,this._s=n,this._l=r,this.a=typeof o=="number"?o:1,n<=0){const f=Bn(r*255);this.r=f,this.g=f,this.b=f}let i=0,a=0,s=0;const l=t/60,c=(1-Math.abs(2*r-1))*n,u=c*(1-Math.abs(l%2-1));l>=0&&l<1?(i=c,a=u):l>=1&&l<2?(i=u,a=c):l>=2&&l<3?(a=c,s=u):l>=3&&l<4?(a=u,s=c):l>=4&&l<5?(i=u,s=c):l>=5&&l<6&&(i=c,s=u);const d=r-c/2;this.r=Bn((i+d)*255),this.g=Bn((a+d)*255),this.b=Bn((s+d)*255)}fromHsv({h:t,s:n,v:r,a:o}){this._h=t%360,this._s=n,this._v=r,this.a=typeof o=="number"?o:1;const i=Bn(r*255);if(this.r=i,this.g=i,this.b=i,n<=0)return;const a=t/60,s=Math.floor(a),l=a-s,c=Bn(r*(1-n)*255),u=Bn(r*(1-n*l)*255),d=Bn(r*(1-n*(1-l))*255);switch(s){case 0:this.g=d,this.b=c;break;case 1:this.r=u,this.b=c;break;case 2:this.r=c,this.b=d;break;case 3:this.r=c,this.g=u;break;case 4:this.r=d,this.g=c;break;case 5:default:this.g=c,this.b=u;break}}fromHsvString(t){const n=dg(t,dE);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=dg(t,dE);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=dg(t,(r,o)=>o.includes("%")?Bn(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var Id=2,fE=.16,g3=.05,v3=.05,b3=.15,hE=5,pE=4,y3=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function mE(e,t,n){var r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-Id*t:Math.round(e.h)+Id*t:r=n?Math.round(e.h)+Id*t:Math.round(e.h)-Id*t,r<0?r+=360:r>=360&&(r-=360),r}function gE(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-fE*t:t===pE?r=e.s+fE:r=e.s+g3*t,r>1&&(r=1),n&&t===hE&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function vE(e,t,n){var r;return n?r=e.v+v3*t:r=e.v-b3*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Vl(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new Ut(e),o=r.toHsv(),i=hE;i>0;i-=1){var a=new Ut({h:mE(o,i,!0),s:gE(o,i,!0),v:vE(o,i,!0)});n.push(a)}n.push(r);for(var s=1;s<=pE;s+=1){var l=new Ut({h:mE(o,s),s:gE(o,s),v:vE(o,s)});n.push(l)}return t.theme==="dark"?y3.map(function(c){var u=c.index,d=c.amount;return new Ut(t.backgroundColor||"#141414").mix(n[u],d).toHexString()}):n.map(function(c){return c.toHexString()})}var ms={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},fg=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];fg.primary=fg[5];var hg=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];hg.primary=hg[5];var pg=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];pg.primary=pg[5];var mg=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];mg.primary=mg[5];var gg=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];gg.primary=gg[5];var vg=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];vg.primary=vg[5];var bg=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];bg.primary=bg[5];var yg=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];yg.primary=yg[5];var gs=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];gs.primary=gs[5];var Cg=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];Cg.primary=Cg[5];var Sg=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Sg.primary=Sg[5];var xg=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];xg.primary=xg[5];var wg=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];wg.primary=wg[5];var Eg={red:fg,volcano:hg,orange:pg,gold:mg,yellow:gg,lime:vg,green:bg,cyan:yg,blue:gs,geekblue:Cg,purple:Sg,magenta:xg,grey:wg};function C3(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:o,colorError:i,colorInfo:a,colorPrimary:s,colorBgBase:l,colorTextBase:c}=e,u=t(s),d=t(r),f=t(o),h=t(i),p=t(a),v=n(l,c),m=e.colorLink||e.colorInfo,b=t(m),y=new Ut(h[1]).mix(new Ut(h[3]),50).toHexString();return Object.assign(Object.assign({},v),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:d[1],colorSuccessBgHover:d[2],colorSuccessBorder:d[3],colorSuccessBorderHover:d[4],colorSuccessHover:d[4],colorSuccess:d[6],colorSuccessActive:d[7],colorSuccessTextHover:d[8],colorSuccessText:d[9],colorSuccessTextActive:d[10],colorErrorBg:h[1],colorErrorBgHover:h[2],colorErrorBgFilledHover:y,colorErrorBgActive:h[3],colorErrorBorder:h[3],colorErrorBorderHover:h[4],colorErrorHover:h[5],colorError:h[6],colorErrorActive:h[7],colorErrorTextHover:h[8],colorErrorText:h[9],colorErrorTextActive:h[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new Ut("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const S3=e=>{let t=e,n=e,r=e,o=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?o=4:e>=8&&(o=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:o}};function x3(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:o}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:o+1},S3(r))}const w3=e=>{const{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}};function Pd(e){return(e+8)/e}function E3(e){const t=Array.from({length:10}).map((n,r)=>{const o=r-1,i=e*Math.pow(Math.E,o/5),a=r>1?Math.floor(i):Math.ceil(i);return Math.floor(a/2)*2});return t[1]=e,t.map(n=>({size:n,lineHeight:Pd(n)}))}const $3=e=>{const t=E3(e),n=t.map(u=>u.size),r=t.map(u=>u.lineHeight),o=n[1],i=n[0],a=n[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:i,fontSize:o,fontSizeLG:a,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*o),fontHeightLG:Math.round(c*a),fontHeightSM:Math.round(l*i),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function O3(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}const Fr=(e,t)=>new Ut(e).setA(t).toRgbString(),Wl=(e,t)=>new Ut(e).darken(t).toHexString(),k3=e=>{const t=Vl(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},M3=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Fr(r,.88),colorTextSecondary:Fr(r,.65),colorTextTertiary:Fr(r,.45),colorTextQuaternary:Fr(r,.25),colorFill:Fr(r,.15),colorFillSecondary:Fr(r,.06),colorFillTertiary:Fr(r,.04),colorFillQuaternary:Fr(r,.02),colorBgSolid:Fr(r,1),colorBgSolidHover:Fr(r,.75),colorBgSolidActive:Fr(r,.95),colorBgLayout:Wl(n,4),colorBgContainer:Wl(n,0),colorBgElevated:Wl(n,0),colorBgSpotlight:Fr(r,.85),colorBgBlur:"transparent",colorBorder:Wl(n,15),colorBorderSecondary:Wl(n,6)}};function N3(e){ms.pink=ms.magenta,Eg.pink=Eg.magenta;const t=Object.keys(uE).map(n=>{const r=e[n]===ms[n]?Eg[n]:Vl(e[n]);return Array.from({length:10},()=>1).reduce((o,i,a)=>(o[`${n}-${a+1}`]=r[a],o[`${n}${a+1}`]=r[a],o),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),C3(e,{generateColorPalettes:k3,generateNeutralColorPalettes:M3})),$3(e.fontSize)),O3(e)),w3(e)),x3(e))}const bE=Ym(N3),$g={token:Fl,override:{override:Fl},hashed:!0},yE=w.createContext($g),Ul="ant",Ad="anticon",T3=["outlined","borderless","filled","underlined"],I3=(e,t)=>t||(e?`${Ul}-${e}`:Ul),wt=g.createContext({getPrefixCls:I3,iconPrefixCls:Ad}),{Consumer:aee}=wt,CE={};function xr(e){const t=g.useContext(wt),{getPrefixCls:n,direction:r,getPopupContainer:o}=t,i=t[e];return Object.assign(Object.assign({classNames:CE,styles:CE},i),{getPrefixCls:n,direction:r,getPopupContainer:o})}var P3={};const A3=`-ant-${Date.now()}-${Math.random()}`;function R3(e,t){const n={},r=(a,s)=>{let l=a.clone();return l=(s==null?void 0:s(l))||l,l.toRgbString()},o=(a,s)=>{const l=new Ut(a),c=Vl(l.toRgbString());n[`${s}-color`]=r(l),n[`${s}-color-disabled`]=c[1],n[`${s}-color-hover`]=c[4],n[`${s}-color-active`]=c[6],n[`${s}-color-outline`]=l.clone().setA(.2).toRgbString(),n[`${s}-color-deprecated-bg`]=c[0],n[`${s}-color-deprecated-border`]=c[2]};if(t.primaryColor){o(t.primaryColor,"primary");const a=new Ut(t.primaryColor),s=Vl(a.toRgbString());s.forEach((c,u)=>{n[`primary-${u+1}`]=c}),n["primary-color-deprecated-l-35"]=r(a,c=>c.lighten(35)),n["primary-color-deprecated-l-20"]=r(a,c=>c.lighten(20)),n["primary-color-deprecated-t-20"]=r(a,c=>c.tint(20)),n["primary-color-deprecated-t-50"]=r(a,c=>c.tint(50)),n["primary-color-deprecated-f-12"]=r(a,c=>c.setA(c.a*.12));const l=new Ut(s[0]);n["primary-color-active-deprecated-f-30"]=r(l,c=>c.setA(c.a*.3)),n["primary-color-active-deprecated-d-02"]=r(l,c=>c.darken(2))}return t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info"),`
|
|
221
|
+
:root {
|
|
222
|
+
${Object.keys(n).map(a=>`--${e}-${a}: ${n[a]};`).join(`
|
|
223
|
+
`)}
|
|
224
|
+
}
|
|
225
|
+
`.trim()}function _3(e,t){const n=R3(e,t);Gn()?ti(n,`${A3}-dynamic-theme`):P3.NODE_ENV!=="production"&&Di(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}const Hr=g.createContext(!1),SE=({children:e,disabled:t})=>{const n=g.useContext(Hr);return g.createElement(Hr.Provider,{value:t??n},e)},vs=g.createContext(void 0),D3=({children:e,size:t})=>{const n=g.useContext(vs);return g.createElement(vs.Provider,{value:t||n},e)};function L3(){const e=w.useContext(Hr),t=w.useContext(vs);return{componentDisabled:e,componentSize:t}}var xE=fn(function e(){dn(this,e)}),wE="CALC_UNIT",j3=new RegExp(wE,"g");function Og(e){return typeof e=="number"?"".concat(e).concat(wE):e}var z3=(function(e){io(n,e);var t=ao(n);function n(r,o){var i;dn(this,n),i=t.call(this),z(ct(i),"result",""),z(ct(i),"unitlessCssVar",void 0),z(ct(i),"lowPriority",void 0);var a=Ue(r);return i.unitlessCssVar=o,r instanceof n?i.result="(".concat(r.result,")"):a==="number"?i.result=Og(r):a==="string"&&(i.result=r),i}return fn(n,[{key:"add",value:function(o){return o instanceof n?this.result="".concat(this.result," + ").concat(o.getResult()):(typeof o=="number"||typeof o=="string")&&(this.result="".concat(this.result," + ").concat(Og(o))),this.lowPriority=!0,this}},{key:"sub",value:function(o){return o instanceof n?this.result="".concat(this.result," - ").concat(o.getResult()):(typeof o=="number"||typeof o=="string")&&(this.result="".concat(this.result," - ").concat(Og(o))),this.lowPriority=!0,this}},{key:"mul",value:function(o){return this.lowPriority&&(this.result="(".concat(this.result,")")),o instanceof n?this.result="".concat(this.result," * ").concat(o.getResult(!0)):(typeof o=="number"||typeof o=="string")&&(this.result="".concat(this.result," * ").concat(o)),this.lowPriority=!1,this}},{key:"div",value:function(o){return this.lowPriority&&(this.result="(".concat(this.result,")")),o instanceof n?this.result="".concat(this.result," / ").concat(o.getResult(!0)):(typeof o=="number"||typeof o=="string")&&(this.result="".concat(this.result," / ").concat(o)),this.lowPriority=!1,this}},{key:"getResult",value:function(o){return this.lowPriority||o?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(o){var i=this,a=o||{},s=a.unit,l=!0;return typeof s=="boolean"?l=s:Array.from(this.unitlessCssVar).some(function(c){return i.result.includes(c)})&&(l=!1),this.result=this.result.replace(j3,l?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n})(xE),B3=(function(e){io(n,e);var t=ao(n);function n(r){var o;return dn(this,n),o=t.call(this),z(ct(o),"result",0),r instanceof n?o.result=r.result:typeof r=="number"&&(o.result=r),o}return fn(n,[{key:"add",value:function(o){return o instanceof n?this.result+=o.result:typeof o=="number"&&(this.result+=o),this}},{key:"sub",value:function(o){return o instanceof n?this.result-=o.result:typeof o=="number"&&(this.result-=o),this}},{key:"mul",value:function(o){return o instanceof n?this.result*=o.result:typeof o=="number"&&(this.result*=o),this}},{key:"div",value:function(o){return o instanceof n?this.result/=o.result:typeof o=="number"&&(this.result/=o),this}},{key:"equal",value:function(){return this.result}}]),n})(xE),F3=function(t,n){var r=t==="css"?z3:B3;return function(o){return new r(o,n)}},EE=function(t,n){return"".concat([n,t.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function qt(e){var t=g.useRef();t.current=e;var n=g.useCallback(function(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(i))},[]);return n}function bs(e){var t=g.useRef(!1),n=g.useState(e),r=Y(n,2),o=r[0],i=r[1];g.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(s,l){l&&t.current||i(s)}return[o,a]}function kg(e){return e!==void 0}function cn(e,t){var n=t||{},r=n.defaultValue,o=n.value,i=n.onChange,a=n.postState,s=bs(function(){return kg(o)?o:kg(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),l=Y(s,2),c=l[0],u=l[1],d=o!==void 0?o:c,f=a?a(d):d,h=qt(i),p=bs([d]),v=Y(p,2),m=v[0],b=v[1];ls(function(){var C=m[0];c!==C&&h(c,C)},[m]),ls(function(){kg(o)||u(o)},[o]);var y=qt(function(C,x){u(C,x),b([d],x)});return[f,y]}var H3={};function $E(e,t,n,r){var o=V({},t[e]);if(r!=null&&r.deprecatedTokens){var i=r.deprecatedTokens;i.forEach(function(s){var l=Y(s,2),c=l[0],u=l[1];if(H3.NODE_ENV!=="production"&&ft(!(o!=null&&o[c]),"Component Token `".concat(String(c),"` of ").concat(String(e)," is deprecated. Please use `").concat(String(u),"` instead.")),o!=null&&o[c]||o!=null&&o[u]){var d;(d=o[u])!==null&&d!==void 0||(o[u]=o==null?void 0:o[c])}})}var a=V(V({},n),o);return Object.keys(a).forEach(function(s){a[s]===t[s]&&delete a[s]}),a}var V3={},OE=V3.NODE_ENV!=="production"||typeof CSSINJS_STATISTIC<"u",Mg=!0;function Dt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!OE)return Object.assign.apply(Object,[{}].concat(t));Mg=!1;var r={};return t.forEach(function(o){if(Ue(o)==="object"){var i=Object.keys(o);i.forEach(function(a){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){return o[a]}})})}}),Mg=!0,r}var kE={};function W3(){}var U3=function(t){var n,r=t,o=W3;return OE&&typeof Proxy<"u"&&(n=new Set,r=new Proxy(t,{get:function(a,s){if(Mg){var l;(l=n)===null||l===void 0||l.add(s)}return a[s]}}),o=function(a,s){var l;kE[a]={global:Array.from(n),component:V(V({},(l=kE[a])===null||l===void 0?void 0:l.component),s)}}),{token:r,keys:n,flush:o}};function ME(e,t,n){if(typeof n=="function"){var r;return n(Dt(t,(r=t[e])!==null&&r!==void 0?r:{}))}return n??{}}function q3(e){return e==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return"max(".concat(r.map(function(i){return Q(i)}).join(","),")")},min:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return"min(".concat(r.map(function(i){return Q(i)}).join(","),")")}}}var K3=1e3*60*10,G3=(function(){function e(){dn(this,e),z(this,"map",new Map),z(this,"objectIDMap",new WeakMap),z(this,"nextID",0),z(this,"lastAccessBeat",new Map),z(this,"accessBeat",0)}return fn(e,[{key:"set",value:function(n,r){this.clear();var o=this.getCompositeKey(n);this.map.set(o,r),this.lastAccessBeat.set(o,Date.now())}},{key:"get",value:function(n){var r=this.getCompositeKey(n),o=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,o}},{key:"getCompositeKey",value:function(n){var r=this,o=n.map(function(i){return i&&Ue(i)==="object"?"obj_".concat(r.getObjectID(i)):"".concat(Ue(i),"_").concat(i)});return o.join("|")}},{key:"getObjectID",value:function(n){if(this.objectIDMap.has(n))return this.objectIDMap.get(n);var r=this.nextID;return this.objectIDMap.set(n,r),this.nextID+=1,r}},{key:"clear",value:function(){var n=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(o,i){r-o>K3&&(n.map.delete(i),n.lastAccessBeat.delete(i))}),this.accessBeat=0}}}]),e})(),NE=new G3;function X3(e,t){return w.useMemo(function(){var n=NE.get(t);if(n)return n;var r=e();return NE.set(t,r),r},t)}var Y3=function(){return{}},J3={};function Q3(e){var t=e.useCSP,n=t===void 0?Y3:t,r=e.useToken,o=e.usePrefix,i=e.getResetStyles,a=e.getCommonStyle,s=e.getCompUnitless;function l(f,h,p,v){var m=Array.isArray(f)?f[0]:f;function b(O){return"".concat(String(m)).concat(O.slice(0,1).toUpperCase()).concat(O.slice(1))}var y=(v==null?void 0:v.unitless)||{},C=typeof s=="function"?s(f):{},x=V(V({},C),{},z({},b("zIndexPopup"),!0));Object.keys(y).forEach(function(O){x[b(O)]=y[O]});var S=V(V({},v),{},{unitless:x,prefixToken:b}),E=u(f,h,p,S),$=c(m,p,S);return function(O){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O,M=E(O,k),T=Y(M,2),I=T[1],R=$(k),N=Y(R,2),P=N[0],A=N[1];return[P,I,A]}}function c(f,h,p){var v=p.unitless,m=p.injectStyle,b=m===void 0?!0:m,y=p.prefixToken,C=p.ignore,x=function($){var O=$.rootCls,k=$.cssVar,M=k===void 0?{}:k,T=r(),I=T.realToken;return a3({path:[f],prefix:M.prefix,key:M.key,unitless:v,ignore:C,token:I,scope:O},function(){var R=ME(f,I,h),N=$E(f,I,R,{deprecatedTokens:p==null?void 0:p.deprecatedTokens});return Object.keys(R).forEach(function(P){N[y(P)]=N[P],delete N[P]}),N}),null},S=function($){var O=r(),k=O.cssVar;return[function(M){return b&&k?w.createElement(w.Fragment,null,w.createElement(x,{rootCls:$,cssVar:k,component:f}),M):M},k==null?void 0:k.key]};return S}function u(f,h,p){var v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},m=Array.isArray(f)?f:[f,f],b=Y(m,1),y=b[0],C=m.join("-"),x=e.layer||{name:"antd"};return function(S){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S,$=r(),O=$.theme,k=$.realToken,M=$.hashId,T=$.token,I=$.cssVar,R=o(),N=R.rootPrefixCls,P=R.iconPrefixCls,A=n(),_=I?"css":"js",B=X3(function(){var H=new Set;return I&&Object.keys(v.unitless||{}).forEach(function(W){H.add(Cd(W,I.prefix)),H.add(Cd(W,EE(y,I.prefix)))}),F3(_,H)},[_,y,I==null?void 0:I.prefix]),F=q3(_),U=F.max,K=F.min,j={theme:O,token:T,hashId:M,nonce:function(){return A.nonce},clientOnly:v.clientOnly,layer:x,order:v.order||-999};typeof i=="function"&&sg(V(V({},j),{},{clientOnly:!1,path:["Shared",N]}),function(){return i(T,{prefix:{rootPrefixCls:N,iconPrefixCls:P},csp:A})});var D=sg(V(V({},j),{},{path:[C,S,P]}),function(){if(v.injectStyle===!1)return[];var H=U3(T),W=H.token,q=H.flush,te=ME(y,k,p),G=".".concat(S),re=$E(y,k,te,{deprecatedTokens:v.deprecatedTokens});I&&te&&Ue(te)==="object"&&Object.keys(te).forEach(function(ae){te[ae]="var(".concat(Cd(ae,EE(y,I.prefix)),")")});var oe=Dt(W,{componentCls:G,prefixCls:S,iconCls:".".concat(P),antCls:".".concat(N),calc:B,max:U,min:K},I?te:re),ne=h(oe,{hashId:M,prefixCls:S,rootPrefixCls:N,iconPrefixCls:P});q(y,re);var Z=typeof a=="function"?a(oe,S,E,v.resetFont):null;return[v.resetStyle===!1?null:Z,ne]});return[D,M]}}function d(f,h,p){var v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},m=u(f,h,p,V({resetStyle:!1,order:-998},v)),b=function(C){var x=C.prefixCls,S=C.rootCls,E=S===void 0?x:S;return m(x,E),null};return J3.NODE_ENV!=="production"&&(b.displayName="SubStyle_".concat(String(Array.isArray(f)?f.join("."):f))),b}return{genStyleHooks:l,genSubStyleComponent:d,genComponentStyleHook:u}}const Li=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],Z3="5.29.3";function Ng(e){return e>=0&&e<=255}function ql(e,t){const{r:n,g:r,b:o,a:i}=new Ut(e).toRgb();if(i<1)return e;const{r:a,g:s,b:l}=new Ut(t).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((n-a*(1-c))/c),d=Math.round((r-s*(1-c))/c),f=Math.round((o-l*(1-c))/c);if(Ng(u)&&Ng(d)&&Ng(f))return new Ut({r:u,g:d,b:f,a:Math.round(c*100)/100}).toRgbString()}return new Ut({r:n,g:r,b:o,a:1}).toRgbString()}var eV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function TE(e){const{override:t}=e,n=eV(e,["override"]),r=Object.assign({},t);Object.keys(Fl).forEach(f=>{delete r[f]});const o=Object.assign(Object.assign({},n),r),i=480,a=576,s=768,l=992,c=1200,u=1600;return o.motion===!1&&(o.motionDurationFast="0s",o.motionDurationMid="0s",o.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:ql(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:ql(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:ql(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*3,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:ql(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:`
|
|
226
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
227
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
228
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
229
|
+
`,boxShadowSecondary:`
|
|
230
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
231
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
232
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
233
|
+
`,boxShadowTertiary:`
|
|
234
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
235
|
+
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
236
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.02)
|
|
237
|
+
`,screenXS:i,screenXSMin:i,screenXSMax:a-1,screenSM:a,screenSMMin:a,screenSMMax:s-1,screenMD:s,screenMDMin:s,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
|
|
238
|
+
0 1px 2px -2px ${new Ut("rgba(0, 0, 0, 0.16)").toRgbString()},
|
|
239
|
+
0 3px 6px 0 ${new Ut("rgba(0, 0, 0, 0.12)").toRgbString()},
|
|
240
|
+
0 5px 12px 4px ${new Ut("rgba(0, 0, 0, 0.09)").toRgbString()}
|
|
241
|
+
`,boxShadowDrawerRight:`
|
|
242
|
+
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
243
|
+
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
244
|
+
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
245
|
+
`,boxShadowDrawerLeft:`
|
|
246
|
+
6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
247
|
+
3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
248
|
+
9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
249
|
+
`,boxShadowDrawerUp:`
|
|
250
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
251
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
252
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
253
|
+
`,boxShadowDrawerDown:`
|
|
254
|
+
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
255
|
+
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
256
|
+
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
257
|
+
`,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var IE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const PE={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},tV={motionBase:!0,motionUnit:!0},nV={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},AE=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:o}=t,i=IE(t,["override"]);let a=Object.assign(Object.assign({},r),{override:o});return a=TE(a),i&&Object.entries(i).forEach(([s,l])=>{const{theme:c}=l,u=IE(l,["theme"]);let d=u;c&&(d=AE(Object.assign(Object.assign({},a),u),{override:u},c)),a[s]=d}),a};function wr(){const{token:e,hashed:t,theme:n,override:r,cssVar:o}=w.useContext(yE),i=`${Z3}-${t||""}`,a=n||bE,[s,l,c]=IH(a,[Fl,e],{salt:i,override:r,getComputedToken:AE,formatToken:TE,cssVar:o&&{prefix:o.prefix,key:o.key,unitless:PE,ignore:tV,preserve:nV}});return[a,c,t?l:"",s,o]}const va={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Pn=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),ys=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),Rd=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),rV=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),oV=(e,t,n,r)=>{const o=`[class^="${t}"], [class*=" ${t}"]`,i=n?`.${n}`:o,a={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let s={};return r!==!1&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[i]:Object.assign(Object.assign(Object.assign({},s),a),{[o]:a})}},_d=(e,t)=>({outline:`${Q(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:"outline-offset 0s, outline 0s"}),ba=(e,t)=>({"&:focus-visible":_d(e,t)}),RE=e=>({[`.${e}`]:Object.assign(Object.assign({},ys()),{[`.${e} .${e}-icon`]:{display:"block"}})}),{genStyleHooks:gn,genComponentStyleHook:iV,genSubStyleComponent:_E}=Q3({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=w.useContext(wt);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,o]=wr();return{theme:e,realToken:t,hashId:n,token:r,cssVar:o}},useCSP:()=>{const{csp:e}=w.useContext(wt);return e??{}},getResetStyles:(e,t)=>{var n;const r=rV(e);return[r,{"&":r},RE((n=t==null?void 0:t.prefix.iconPrefixCls)!==null&&n!==void 0?n:Ad)]},getCommonStyle:oV,getCompUnitless:()=>PE});function aV(e,t){return Li.reduce((n,r)=>{const o=e[`${r}1`],i=e[`${r}3`],a=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:o,lightBorderColor:i,darkColor:a,textColor:s}))},{})}const sV=(e,t)=>{const[n,r]=wr();return sg({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>RE(e))},lV=Object.assign({},g),{useId:DE}=lV,cV=typeof DE>"u"?()=>"":DE;var LE={};function uV(e,t,n){var r,o;const i=Wt("ConfigProvider"),a=e||{},s=a.inherit===!1||!t?Object.assign(Object.assign({},$g),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:$g.hashed,cssVar:t==null?void 0:t.cssVar}):t,l=cV();if(LE.NODE_ENV!=="production"){const c=a.cssVar||s.cssVar,u=!!(typeof a.cssVar=="object"&&(!((o=a.cssVar)===null||o===void 0)&&o.key)||l);LE.NODE_ENV!=="production"&&i(!c||u,"breaking","Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.")}return Pl(()=>{var c,u;if(!e)return t;const d=Object.assign({},s.components);Object.keys(e.components||{}).forEach(p=>{d[p]=Object.assign(Object.assign({},d[p]),e.components[p])});const f=`css-var-${l.replace(/:/g,"")}`,h=((c=a.cssVar)!==null&&c!==void 0?c:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof a.cssVar=="object"?a.cssVar:{}),{key:typeof a.cssVar=="object"&&((u=a.cssVar)===null||u===void 0?void 0:u.key)||f});return Object.assign(Object.assign(Object.assign({},s),a),{token:Object.assign(Object.assign({},s.token),a.token),components:d,cssVar:h})},[a,s],(c,u)=>c.some((d,f)=>{const h=u[f];return!as(d,h,!0)}))}var dV=["children"],jE=g.createContext({});function fV(e){var t=e.children,n=st(e,dV);return g.createElement(jE.Provider,{value:n},t)}var hV=(function(e){io(n,e);var t=ao(n);function n(){return dn(this,n),t.apply(this,arguments)}return fn(n,[{key:"render",value:function(){return this.props.children}}]),n})(g.Component);function pV(e){var t=g.useReducer(function(s){return s+1},0),n=Y(t,2),r=n[1],o=g.useRef(e),i=qt(function(){return o.current}),a=qt(function(s){o.current=typeof s=="function"?s(o.current):s,r()});return[i,a]}var ji="none",Dd="appear",Ld="enter",jd="leave",zE="none",fo="prepare",Cs="start",Ss="active",Tg="end",BE="prepared";function FE(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function mV(e,t){var n={animationend:FE("Animation","AnimationEnd"),transitionend:FE("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var gV=mV(Gn(),typeof window<"u"?window:{}),HE={};if(Gn()){var vV=document.createElement("div");HE=vV.style}var zd={};function VE(e){if(zd[e])return zd[e];var t=gV[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in HE)return zd[e]=t[i],zd[e]}return""}var WE=VE("animationend"),UE=VE("transitionend"),qE=!!(WE&&UE),KE=WE||"animationend",GE=UE||"transitionend";function XE(e,t){if(!e)return null;if(Ue(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const bV=(function(e){var t=w.useRef();function n(o){o&&(o.removeEventListener(GE,e),o.removeEventListener(KE,e))}function r(o){t.current&&t.current!==o&&n(t.current),o&&o!==t.current&&(o.addEventListener(GE,e),o.addEventListener(KE,e),t.current=o)}return g.useEffect(function(){return function(){n(t.current)}},[]),[r,n]});var YE=Gn()?w.useLayoutEffect:w.useEffect;const yV=(function(){var e=g.useRef(null);function t(){Nt.cancel(e.current)}function n(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var i=Nt(function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)});e.current=i}return g.useEffect(function(){return function(){t()}},[]),[n,t]});var CV=[fo,Cs,Ss,Tg],SV=[fo,BE],JE=!1,xV=!0;function QE(e){return e===Ss||e===Tg}const wV=(function(e,t,n){var r=bs(zE),o=Y(r,2),i=o[0],a=o[1],s=yV(),l=Y(s,2),c=l[0],u=l[1];function d(){a(fo,!0)}var f=t?SV:CV;return YE(function(){if(i!==zE&&i!==Tg){var h=f.indexOf(i),p=f[h+1],v=n(i);v===JE?a(p,!0):p&&c(function(m){function b(){m.isCanceled()||a(p,!0)}v===!0?b():Promise.resolve(v).then(b)})}},[e,i]),g.useEffect(function(){return function(){u()}},[]),[d,i]});function EV(e,t,n,r){var o=r.motionEnter,i=o===void 0?!0:o,a=r.motionAppear,s=a===void 0?!0:a,l=r.motionLeave,c=l===void 0?!0:l,u=r.motionDeadline,d=r.motionLeaveImmediately,f=r.onAppearPrepare,h=r.onEnterPrepare,p=r.onLeavePrepare,v=r.onAppearStart,m=r.onEnterStart,b=r.onLeaveStart,y=r.onAppearActive,C=r.onEnterActive,x=r.onLeaveActive,S=r.onAppearEnd,E=r.onEnterEnd,$=r.onLeaveEnd,O=r.onVisibleChanged,k=bs(),M=Y(k,2),T=M[0],I=M[1],R=pV(ji),N=Y(R,2),P=N[0],A=N[1],_=bs(null),B=Y(_,2),F=B[0],U=B[1],K=P(),j=w.useRef(!1),D=w.useRef(null);function H(){return n()}var W=w.useRef(!1);function q(){A(ji),U(null,!0)}var te=qt(function(ye){var $e=P();if($e!==ji){var Ce=H();if(!(ye&&!ye.deadline&&ye.target!==Ce)){var se=W.current,Se;$e===Dd&&se?Se=S==null?void 0:S(Ce,ye):$e===Ld&&se?Se=E==null?void 0:E(Ce,ye):$e===jd&&se&&(Se=$==null?void 0:$(Ce,ye)),se&&Se!==!1&&q()}}}),G=bV(te),re=Y(G,1),oe=re[0],ne=function($e){switch($e){case Dd:return z(z(z({},fo,f),Cs,v),Ss,y);case Ld:return z(z(z({},fo,h),Cs,m),Ss,C);case jd:return z(z(z({},fo,p),Cs,b),Ss,x);default:return{}}},Z=g.useMemo(function(){return ne(K)},[K]),ae=wV(K,!e,function(ye){if(ye===fo){var $e=Z[fo];return $e?$e(H()):JE}if(ee in Z){var Ce;U(((Ce=Z[ee])===null||Ce===void 0?void 0:Ce.call(Z,H(),null))||null)}return ee===Ss&&K!==ji&&(oe(H()),u>0&&(clearTimeout(D.current),D.current=setTimeout(function(){te({deadline:!0})},u))),ee===BE&&q(),xV}),ie=Y(ae,2),X=ie[0],ee=ie[1],le=QE(ee);W.current=le;var ce=w.useRef(null);YE(function(){if(!(j.current&&ce.current===t)){I(t);var ye=j.current;j.current=!0;var $e;!ye&&t&&s&&($e=Dd),ye&&t&&i&&($e=Ld),(ye&&!t&&c||!ye&&d&&!t&&c)&&($e=jd);var Ce=ne($e);$e&&(e||Ce[fo])?(A($e),X()):A(ji),ce.current=t}},[t]),w.useEffect(function(){(K===Dd&&!s||K===Ld&&!i||K===jd&&!c)&&A(ji)},[s,i,c]),w.useEffect(function(){return function(){j.current=!1,clearTimeout(D.current)}},[]);var ue=g.useRef(!1);w.useEffect(function(){T&&(ue.current=!0),T!==void 0&&K===ji&&((ue.current||T)&&(O==null||O(T)),ue.current=!0)},[T,K]);var ge=F;return Z[fo]&&ee===Cs&&(ge=V({transition:"none"},ge)),[K,ee,ge,T??t]}function $V(e){var t=e;Ue(e)==="object"&&(t=e.transitionSupport);function n(o,i){return!!(o.motionName&&t&&i!==!1)}var r=g.forwardRef(function(o,i){var a=o.visible,s=a===void 0?!0:a,l=o.removeOnLeave,c=l===void 0?!0:l,u=o.forceRender,d=o.children,f=o.motionName,h=o.leavedClassName,p=o.eventProps,v=g.useContext(jE),m=v.motion,b=n(o,m),y=w.useRef(),C=w.useRef();function x(){try{return y.current instanceof HTMLElement?y.current:fd(C.current)}catch{return null}}var S=EV(b,s,x,o),E=Y(S,4),$=E[0],O=E[1],k=E[2],M=E[3],T=g.useRef(M);M&&(T.current=!0);var I=g.useCallback(function(B){y.current=B,jm(i,B)},[i]),R,N=V(V({},p),{},{visible:s});if(!d)R=null;else if($===ji)M?R=d(V({},N),I):!c&&T.current&&h?R=d(V(V({},N),{},{className:h}),I):u||!c&&!h?R=d(V(V({},N),{},{style:{display:"none"}}),I):R=null;else{var P;O===fo?P="prepare":QE(O)?P="active":O===Cs&&(P="start");var A=XE(f,"".concat($,"-").concat(P));R=d(V(V({},N),{},{className:J(XE(f,$),z(z({},A,A&&P),f,typeof f=="string")),style:k}),I)}if(g.isValidElement(R)&&pa(R)){var _=rs(R);_||(R=g.cloneElement(R,{ref:I}))}return g.createElement(hV,{ref:C},R)});return r.displayName="CSSMotion",r}const Er=$V(qE);var Ig="add",Pg="keep",Ag="remove",Rg="removed";function OV(e){var t;return e&&Ue(e)==="object"&&"key"in e?t=e:t={key:e},V(V({},t),{},{key:String(t.key)})}function _g(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(OV)}function kV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,o=t.length,i=_g(e),a=_g(t);i.forEach(function(c){for(var u=!1,d=r;d<o;d+=1){var f=a[d];if(f.key===c.key){r<d&&(n=n.concat(a.slice(r,d).map(function(h){return V(V({},h),{},{status:Ig})})),r=d),n.push(V(V({},f),{},{status:Pg})),r+=1,u=!0;break}}u||n.push(V(V({},c),{},{status:Ag}))}),r<o&&(n=n.concat(a.slice(r).map(function(c){return V(V({},c),{},{status:Ig})})));var s={};n.forEach(function(c){var u=c.key;s[u]=(s[u]||0)+1});var l=Object.keys(s).filter(function(c){return s[c]>1});return l.forEach(function(c){n=n.filter(function(u){var d=u.key,f=u.status;return d!==c||f!==Ag}),n.forEach(function(u){u.key===c&&(u.status=Pg)})}),n}var MV=["component","children","onVisibleChanged","onAllRemoved"],NV=["status"],TV=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function IV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Er,n=(function(r){io(i,r);var o=ao(i);function i(){var a;dn(this,i);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return a=o.call.apply(o,[this].concat(l)),z(ct(a),"state",{keyEntities:[]}),z(ct(a),"removeKey",function(u){a.setState(function(d){var f=d.keyEntities.map(function(h){return h.key!==u?h:V(V({},h),{},{status:Rg})});return{keyEntities:f}},function(){var d=a.state.keyEntities,f=d.filter(function(h){var p=h.status;return p!==Rg}).length;f===0&&a.props.onAllRemoved&&a.props.onAllRemoved()})}),a}return fn(i,[{key:"render",value:function(){var s=this,l=this.state.keyEntities,c=this.props,u=c.component,d=c.children,f=c.onVisibleChanged;c.onAllRemoved;var h=st(c,MV),p=u||g.Fragment,v={};return TV.forEach(function(m){v[m]=h[m],delete h[m]}),delete h.keys,g.createElement(p,h,l.map(function(m,b){var y=m.status,C=st(m,NV),x=y===Ig||y===Pg;return g.createElement(t,he({},v,{key:C.key,visible:x,eventProps:C,onVisibleChanged:function(E){f==null||f(E,{key:C.key}),E||s.removeKey(C.key)}}),function(S,E){return d(V(V({},S),{},{index:b}),E)})}))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var c=s.keys,u=l.keyEntities,d=_g(c),f=kV(u,d);return{keyEntities:f.filter(function(h){var p=u.find(function(v){var m=v.key;return h.key===m});return!(p&&p.status===Rg&&h.status===Ag)})}}}]),i})(g.Component);return z(n,"defaultProps",{component:"div"}),n}const ZE=IV(qE);var PV={};const Dg=g.createContext(!0);PV.NODE_ENV!=="production"&&(Dg.displayName="MotionCacheContext");function AV(e){const t=g.useContext(Dg),{children:n}=e,[,r]=wr(),{motion:o}=r,i=g.useRef(!1);return i.current||(i.current=t!==o),i.current?g.createElement(Dg.Provider,{value:o},g.createElement(fV,{motion:o},n)):n}var e$={};const t$=g.memo(({dropdownMatchSelectWidth:e})=>(Wt("ConfigProvider").deprecated(e===void 0,"dropdownMatchSelectWidth","popupMatchSelectWidth"),null));e$.NODE_ENV!=="production"&&(t$.displayName="PropWarning");const RV=e$.NODE_ENV!=="production"?t$:()=>null;var ya={},_V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Lg=!1;const n$=ya.NODE_ENV!=="production"?e=>{ya.NODE_ENV!=="production"&&Di(!Lg,e,"Static function can not consume context like dynamic theme. Please use 'App' component instead.")}:null,DV=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let Bd,r$,o$,i$;function Fd(){return Bd||Ul}function LV(){return r$||Ad}function jV(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const zV=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:o}=e;t!==void 0&&(Bd=t),n!==void 0&&(r$=n),"holderRender"in e&&(i$=o),r&&(jV(r)?(ya.NODE_ENV!=="production"&&Di(!1,"ConfigProvider","`config` of css variable theme is not work in v5. Please use new `theme` config instead."),_3(Fd(),r)):o$=r)},jg=()=>({getPrefixCls:(e,t)=>t||(e?`${Fd()}-${e}`:Fd()),getIconPrefixCls:LV,getRootPrefixCls:()=>Bd||Fd(),getTheme:()=>o$,holderRender:i$}),BV=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:o,anchor:i,form:a,locale:s,componentSize:l,direction:c,space:u,splitter:d,virtual:f,dropdownMatchSelectWidth:h,popupMatchSelectWidth:p,popupOverflow:v,legacyLocale:m,parentContext:b,iconPrefixCls:y,theme:C,componentDisabled:x,segmented:S,statistic:E,spin:$,calendar:O,carousel:k,cascader:M,collapse:T,typography:I,checkbox:R,descriptions:N,divider:P,drawer:A,skeleton:_,steps:B,image:F,layout:U,list:K,mentions:j,modal:D,progress:H,result:W,slider:q,breadcrumb:te,menu:G,pagination:re,input:oe,textArea:ne,empty:Z,badge:ae,radio:ie,rate:X,switch:ee,transfer:le,avatar:ce,message:ue,tag:ge,table:ye,card:$e,tabs:Ce,timeline:se,timePicker:Se,upload:ze,notification:Ge,tree:Pe,colorPicker:Oe,datePicker:qe,rangePicker:Ne,flex:Fe,wave:Ae,dropdown:ke,warning:Xe,tour:pe,tooltip:ve,popover:Ve,popconfirm:xe,floatButton:tt,floatButtonGroup:pt,variant:Re,inputNumber:je,treeSelect:Qe}=e,Be=g.useCallback((Ye,yt)=>{const{prefixCls:St}=e;if(yt)return yt;const At=St||b.getPrefixCls("");return Ye?`${At}-${Ye}`:At},[b.getPrefixCls,e.prefixCls]),it=y||b.iconPrefixCls||Ad,$t=n||b.csp;sV(it,$t);const bt=uV(C,b.theme,{prefixCls:Be("")});ya.NODE_ENV!=="production"&&(Lg=Lg||!!bt);const rt={csp:$t,autoInsertSpaceInButton:r,alert:o,anchor:i,locale:s||m,direction:c,space:u,splitter:d,virtual:f,popupMatchSelectWidth:p??h,popupOverflow:v,getPrefixCls:Be,iconPrefixCls:it,theme:bt,segmented:S,statistic:E,spin:$,calendar:O,carousel:k,cascader:M,collapse:T,typography:I,checkbox:R,descriptions:N,divider:P,drawer:A,skeleton:_,steps:B,image:F,input:oe,textArea:ne,layout:U,list:K,mentions:j,modal:D,progress:H,result:W,slider:q,breadcrumb:te,menu:G,pagination:re,empty:Z,badge:ae,radio:ie,rate:X,switch:ee,transfer:le,avatar:ce,message:ue,tag:ge,table:ye,card:$e,tabs:Ce,timeline:se,timePicker:Se,upload:ze,notification:Ge,tree:Pe,colorPicker:Oe,datePicker:qe,rangePicker:Ne,flex:Fe,wave:Ae,dropdown:ke,warning:Xe,tour:pe,tooltip:ve,popover:Ve,popconfirm:xe,floatButton:tt,floatButtonGroup:pt,variant:Re,inputNumber:je,treeSelect:Qe};ya.NODE_ENV!=="production"&&Wt("ConfigProvider")(!("autoInsertSpaceInButton"in e),"deprecated","`autoInsertSpaceInButton` is deprecated. Please use `{ button: { autoInsertSpace: boolean }}` instead.");const dt=Object.assign({},b);Object.keys(rt).forEach(Ye=>{rt[Ye]!==void 0&&(dt[Ye]=rt[Ye])}),DV.forEach(Ye=>{const yt=e[Ye];yt&&(dt[Ye]=yt)}),typeof r<"u"&&(dt.button=Object.assign({autoInsertSpace:r},dt.button));const ut=Pl(()=>dt,dt,(Ye,yt)=>{const St=Object.keys(Ye),At=Object.keys(yt);return St.length!==At.length||St.some(Et=>Ye[Et]!==yt[Et])}),{layer:De}=g.useContext(Ll),me=g.useMemo(()=>({prefixCls:it,csp:$t,layer:De?"antd":void 0}),[it,$t,De]);let fe=g.createElement(g.Fragment,null,g.createElement(RV,{dropdownMatchSelectWidth:h}),t);const we=g.useMemo(()=>{var Ye,yt,St,At;return ps(((Ye=ri.Form)===null||Ye===void 0?void 0:Ye.defaultValidateMessages)||{},((St=(yt=ut.locale)===null||yt===void 0?void 0:yt.Form)===null||St===void 0?void 0:St.defaultValidateMessages)||{},((At=ut.form)===null||At===void 0?void 0:At.validateMessages)||{},(a==null?void 0:a.validateMessages)||{})},[ut,a==null?void 0:a.validateMessages]);Object.keys(we).length>0&&(fe=g.createElement(d3.Provider,{value:we},fe)),s&&(fe=g.createElement(cE,{locale:s,_ANT_MARK__:lE},fe)),fe=g.createElement(lg.Provider,{value:me},fe),l&&(fe=g.createElement(D3,{size:l},fe)),fe=g.createElement(AV,null,fe);const Ze=g.useMemo(()=>{const Ye=bt||{},{algorithm:yt,token:St,components:At,cssVar:Et}=Ye,Bt=_V(Ye,["algorithm","token","components","cssVar"]),jt=yt&&(!Array.isArray(yt)||yt.length>0)?Ym(yt):bE,Zt={};Object.entries(At||{}).forEach(([Ft,Jt])=>{const Me=Object.assign({},Jt);"algorithm"in Me&&(Me.algorithm===!0?Me.theme=jt:(Array.isArray(Me.algorithm)||typeof Me.algorithm=="function")&&(Me.theme=Ym(Me.algorithm)),delete Me.algorithm),Zt[Ft]=Me});const On=Object.assign(Object.assign({},Fl),St);return Object.assign(Object.assign({},Bt),{theme:jt,token:On,components:Zt,override:Object.assign({override:On},Zt),cssVar:Et})},[bt]);return C&&(fe=g.createElement(yE.Provider,{value:Ze},fe)),ut.warning&&(fe=g.createElement(rE.Provider,{value:ut.warning},fe)),x!==void 0&&(fe=g.createElement(SE,{disabled:x},fe)),g.createElement(wt.Provider,{value:ut},fe)},ho=e=>{const t=g.useContext(wt),n=g.useContext(cg);return g.createElement(BV,Object.assign({parentContext:t,legacyLocale:n},e))};ho.ConfigContext=wt,ho.SizeContext=vs,ho.config=zV,ho.useConfig=L3,Object.defineProperty(ho,"SizeContext",{get:()=>(ya.NODE_ENV!=="production"&&Di(!1,"ConfigProvider","ConfigProvider.SizeContext is deprecated. Please use `ConfigProvider.useConfig().componentSize` instead."),vs)}),ya.NODE_ENV!=="production"&&(ho.displayName="ConfigProvider");var FV={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function a$(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}function HV(e){return a$(e)instanceof ShadowRoot}function Hd(e){return HV(e)?a$(e):null}function VV(e){return e.replace(/-(.)/g,function(t,n){return n.toUpperCase()})}function WV(e,t){ft(e,"[@ant-design/icons] ".concat(t))}function s$(e){return Ue(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(Ue(e.icon)==="object"||typeof e.icon=="function")}function l$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:delete t[n],t[VV(n)]=r}return t},{})}function zg(e,t,n){return n?w.createElement(e.tag,V(V({key:t},l$(e.attrs)),n),(e.children||[]).map(function(r,o){return zg(r,"".concat(t,"-").concat(e.tag,"-").concat(o))})):w.createElement(e.tag,V({key:t},l$(e.attrs)),(e.children||[]).map(function(r,o){return zg(r,"".concat(t,"-").concat(e.tag,"-").concat(o))}))}function c$(e){return Vl(e)[0]}function u$(e){return e?Array.isArray(e)?e:[e]:[]}var UV=`
|
|
258
|
+
.anticon {
|
|
259
|
+
display: inline-flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
color: inherit;
|
|
262
|
+
font-style: normal;
|
|
263
|
+
line-height: 0;
|
|
264
|
+
text-align: center;
|
|
265
|
+
text-transform: none;
|
|
266
|
+
vertical-align: -0.125em;
|
|
267
|
+
text-rendering: optimizeLegibility;
|
|
268
|
+
-webkit-font-smoothing: antialiased;
|
|
269
|
+
-moz-osx-font-smoothing: grayscale;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.anticon > * {
|
|
273
|
+
line-height: 1;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.anticon svg {
|
|
277
|
+
display: inline-block;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.anticon::before {
|
|
281
|
+
display: none;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.anticon .anticon-icon {
|
|
285
|
+
display: block;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.anticon[tabindex] {
|
|
289
|
+
cursor: pointer;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.anticon-spin::before,
|
|
293
|
+
.anticon-spin {
|
|
294
|
+
display: inline-block;
|
|
295
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
296
|
+
animation: loadingCircle 1s infinite linear;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@-webkit-keyframes loadingCircle {
|
|
300
|
+
100% {
|
|
301
|
+
-webkit-transform: rotate(360deg);
|
|
302
|
+
transform: rotate(360deg);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@keyframes loadingCircle {
|
|
307
|
+
100% {
|
|
308
|
+
-webkit-transform: rotate(360deg);
|
|
309
|
+
transform: rotate(360deg);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
`,qV=function(t){var n=w.useContext(lg),r=n.csp,o=n.prefixCls,i=n.layer,a=UV;o&&(a=a.replace(/anticon/g,o)),i&&(a="@layer ".concat(i,` {
|
|
313
|
+
`).concat(a,`
|
|
314
|
+
}`)),w.useEffect(function(){var s=t.current,l=Hd(s);ti(a,"@ant-design-icons",{prepend:!i,csp:r,attachTo:l})},[])},KV=["icon","className","onClick","style","primaryColor","secondaryColor"],Kl={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function GV(e){var t=e.primaryColor,n=e.secondaryColor;Kl.primaryColor=t,Kl.secondaryColor=n||c$(t),Kl.calculated=!!n}function XV(){return V({},Kl)}var xs=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,s=t.secondaryColor,l=st(t,KV),c=g.useRef(),u=Kl;if(a&&(u={primaryColor:a,secondaryColor:s||c$(a)}),qV(c),WV(s$(n),"icon should be icon definiton, but got ".concat(n)),!s$(n))return null;var d=n;return d&&typeof d.icon=="function"&&(d=V(V({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),zg(d.icon,"svg-".concat(d.name),V(V({className:r,onClick:o,style:i,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};xs.displayName="IconReact",xs.getTwoToneColors=XV,xs.setTwoToneColors=GV;function d$(e){var t=u$(e),n=Y(t,2),r=n[0],o=n[1];return xs.setTwoToneColors({primaryColor:r,secondaryColor:o})}function YV(){var e=xs.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var JV=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];d$(gs.primary);var vn=g.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,c=st(e,JV),u=g.useContext(lg),d=u.prefixCls,f=d===void 0?"anticon":d,h=u.rootClassName,p=J(h,f,z(z({},"".concat(f,"-").concat(r.name),!!r.name),"".concat(f,"-spin"),!!o||r.name==="loading"),n),v=a;v===void 0&&s&&(v=-1);var m=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,b=u$(l),y=Y(b,2),C=y[0],x=y[1];return g.createElement("span",he({role:"img","aria-label":r.name},c,{ref:t,tabIndex:v,onClick:s,className:p}),g.createElement(xs,{icon:r,primaryColor:C,secondaryColor:x,style:m}))});vn.displayName="AntdIcon",vn.getTwoToneColor=YV,vn.setTwoToneColor=d$;var QV={},ZV=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:FV}))},Vd=g.forwardRef(ZV);QV.NODE_ENV!=="production"&&(Vd.displayName="CheckCircleFilled");var e5={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},t5={},n5=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:e5}))},ws=g.forwardRef(n5);t5.NODE_ENV!=="production"&&(ws.displayName="CloseCircleFilled");var r5={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},o5={},i5=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:r5}))},zi=g.forwardRef(i5);o5.NODE_ENV!=="production"&&(zi.displayName="CloseOutlined");var a5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},s5={},l5=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:a5}))},Bg=g.forwardRef(l5);s5.NODE_ENV!=="production"&&(Bg.displayName="ExclamationCircleFilled");var c5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},u5={},d5=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:c5}))},Fg=g.forwardRef(d5);u5.NODE_ENV!=="production"&&(Fg.displayName="InfoCircleFilled");var f5=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
315
|
+
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
316
|
+
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
317
|
+
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
318
|
+
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
319
|
+
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
320
|
+
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
321
|
+
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
322
|
+
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
323
|
+
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
324
|
+
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
325
|
+
summary tabIndex target title type useMap value width wmode wrap`,h5=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
326
|
+
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
327
|
+
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
328
|
+
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
329
|
+
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
330
|
+
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
331
|
+
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,p5="".concat(f5," ").concat(h5).split(/[\s\n]+/),m5="aria-",g5="data-";function f$(e,t){return e.indexOf(t)===0}function Vr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=V({},t);var r={};return Object.keys(e).forEach(function(o){(n.aria&&(o==="role"||f$(o,m5))||n.data&&f$(o,g5)||n.attr&&p5.includes(o))&&(r[o]=e[o])}),r}function h$(e){return e&&w.isValidElement(e)&&e.type===w.Fragment}const v5=(e,t,n)=>w.isValidElement(e)?w.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t;function Io(e,t){return v5(e,e,t)}const Po=e=>{const[,,,,t]=wr();return t?`${e}-css-var`:""};var Le={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},p$=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,o=e.className,i=e.duration,a=i===void 0?4.5:i,s=e.showProgress,l=e.pauseOnHover,c=l===void 0?!0:l,u=e.eventKey,d=e.content,f=e.closable,h=e.closeIcon,p=h===void 0?"x":h,v=e.props,m=e.onClick,b=e.onNoticeClose,y=e.times,C=e.hovering,x=g.useState(!1),S=Y(x,2),E=S[0],$=S[1],O=g.useState(0),k=Y(O,2),M=k[0],T=k[1],I=g.useState(0),R=Y(I,2),N=R[0],P=R[1],A=C||E,_=a>0&&s,B=function(){b(u)},F=function(W){(W.key==="Enter"||W.code==="Enter"||W.keyCode===Le.ENTER)&&B()};g.useEffect(function(){if(!A&&a>0){var H=Date.now()-N,W=setTimeout(function(){B()},a*1e3-N);return function(){c&&clearTimeout(W),P(Date.now()-H)}}},[a,A,y]),g.useEffect(function(){if(!A&&_&&(c||N===0)){var H=performance.now(),W,q=function te(){cancelAnimationFrame(W),W=requestAnimationFrame(function(G){var re=G+N-H,oe=Math.min(re/(a*1e3),1);T(oe*100),oe<1&&te()})};return q(),function(){c&&cancelAnimationFrame(W)}}},[a,N,A,_,y]);var U=g.useMemo(function(){return Ue(f)==="object"&&f!==null?f:f?{closeIcon:p}:{}},[f,p]),K=Vr(U,!0),j=100-(!M||M<0?0:M>100?100:M),D="".concat(n,"-notice");return g.createElement("div",he({},v,{ref:t,className:J(D,o,z({},"".concat(D,"-closable"),f)),style:r,onMouseEnter:function(W){var q;$(!0),v==null||(q=v.onMouseEnter)===null||q===void 0||q.call(v,W)},onMouseLeave:function(W){var q;$(!1),v==null||(q=v.onMouseLeave)===null||q===void 0||q.call(v,W)},onClick:m}),g.createElement("div",{className:"".concat(D,"-content")},d),f&&g.createElement("a",he({tabIndex:0,className:"".concat(D,"-close"),onKeyDown:F,"aria-label":"Close"},K,{onClick:function(W){W.preventDefault(),W.stopPropagation(),B()}}),U.closeIcon),_&&g.createElement("progress",{className:"".concat(D,"-progress"),max:"100",value:j},j+"%"))}),m$=w.createContext({}),b5=function(t){var n=t.children,r=t.classNames;return w.createElement(m$.Provider,{value:{classNames:r}},n)},g$=8,v$=3,b$=16,y5=function(t){var n={offset:g$,threshold:v$,gap:b$};if(t&&Ue(t)==="object"){var r,o,i;n.offset=(r=t.offset)!==null&&r!==void 0?r:g$,n.threshold=(o=t.threshold)!==null&&o!==void 0?o:v$,n.gap=(i=t.gap)!==null&&i!==void 0?i:b$}return[!!t,n]},C5={},S5=["className","style","classNames","styles"],y$=function(t){var n=t.configList,r=t.placement,o=t.prefixCls,i=t.className,a=t.style,s=t.motion,l=t.onAllNoticeRemoved,c=t.onNoticeClose,u=t.stack,d=w.useContext(m$),f=d.classNames,h=w.useRef({}),p=w.useState(null),v=Y(p,2),m=v[0],b=v[1],y=w.useState([]),C=Y(y,2),x=C[0],S=C[1],E=n.map(function(A){return{config:A,key:String(A.key)}}),$=y5(u),O=Y($,2),k=O[0],M=O[1],T=M.offset,I=M.threshold,R=M.gap,N=k&&(x.length>0||E.length<=I),P=typeof s=="function"?s(r):s;return w.useEffect(function(){k&&x.length>1&&S(function(A){return A.filter(function(_){return E.some(function(B){var F=B.key;return _===F})})})},[x,E,k]),w.useEffect(function(){var A;if(k&&h.current[(A=E[E.length-1])===null||A===void 0?void 0:A.key]){var _;b(h.current[(_=E[E.length-1])===null||_===void 0?void 0:_.key])}},[E,k]),w.createElement(ZE,he({key:r,className:J(o,"".concat(o,"-").concat(r),f==null?void 0:f.list,i,z(z({},"".concat(o,"-stack"),!!k),"".concat(o,"-stack-expanded"),N)),style:a,keys:E,motionAppear:!0},P,{onAllRemoved:function(){l(r)}}),function(A,_){var B=A.config,F=A.className,U=A.style,K=A.index,j=B,D=j.key,H=j.times,W=String(D),q=B,te=q.className,G=q.style,re=q.classNames,oe=q.styles,ne=st(q,S5),Z=E.findIndex(function(se){return se.key===W}),ae={};if(k){var ie=E.length-1-(Z>-1?Z:K-1),X=r==="top"||r==="bottom"?"-50%":"0";if(ie>0){var ee,le,ce;ae.height=N?(ee=h.current[W])===null||ee===void 0?void 0:ee.offsetHeight:m==null?void 0:m.offsetHeight;for(var ue=0,ge=0;ge<ie;ge++){var ye;ue+=((ye=h.current[E[E.length-1-ge].key])===null||ye===void 0?void 0:ye.offsetHeight)+R}var $e=(N?ue:ie*T)*(r.startsWith("top")?1:-1),Ce=!N&&m!==null&&m!==void 0&&m.offsetWidth&&(le=h.current[W])!==null&&le!==void 0&&le.offsetWidth?((m==null?void 0:m.offsetWidth)-T*2*(ie<3?ie:3))/((ce=h.current[W])===null||ce===void 0?void 0:ce.offsetWidth):1;ae.transform="translate3d(".concat(X,", ").concat($e,"px, 0) scaleX(").concat(Ce,")")}else ae.transform="translate3d(".concat(X,", 0, 0)")}return w.createElement("div",{ref:_,className:J("".concat(o,"-notice-wrapper"),F,re==null?void 0:re.wrapper),style:V(V(V({},U),ae),oe==null?void 0:oe.wrapper),onMouseEnter:function(){return S(function(Se){return Se.includes(W)?Se:[].concat(de(Se),[W])})},onMouseLeave:function(){return S(function(Se){return Se.filter(function(ze){return ze!==W})})}},w.createElement(p$,he({},ne,{ref:function(Se){Z>-1?h.current[W]=Se:delete h.current[W]},prefixCls:o,classNames:re,styles:oe,className:J(te,f==null?void 0:f.notice),style:G,times:H,key:D,eventKey:D,onNoticeClose:c,hovering:k&&x.length>0})))})};C5.NODE_ENV!=="production"&&(y$.displayName="NoticeList");var x5={},C$=g.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-notification":n,o=e.container,i=e.motion,a=e.maxCount,s=e.className,l=e.style,c=e.onAllRemoved,u=e.stack,d=e.renderNotifications,f=g.useState([]),h=Y(f,2),p=h[0],v=h[1],m=function(k){var M,T=p.find(function(I){return I.key===k});T==null||(M=T.onClose)===null||M===void 0||M.call(T),v(function(I){return I.filter(function(R){return R.key!==k})})};g.useImperativeHandle(t,function(){return{open:function(k){v(function(M){var T=de(M),I=T.findIndex(function(P){return P.key===k.key}),R=V({},k);if(I>=0){var N;R.times=(((N=M[I])===null||N===void 0?void 0:N.times)||0)+1,T[I]=R}else R.times=0,T.push(R);return a>0&&T.length>a&&(T=T.slice(-a)),T})},close:function(k){m(k)},destroy:function(){v([])}}});var b=g.useState({}),y=Y(b,2),C=y[0],x=y[1];g.useEffect(function(){var O={};p.forEach(function(k){var M=k.placement,T=M===void 0?"topRight":M;T&&(O[T]=O[T]||[],O[T].push(k))}),Object.keys(C).forEach(function(k){O[k]=O[k]||[]}),x(O)},[p]);var S=function(k){x(function(M){var T=V({},M),I=T[k]||[];return I.length||delete T[k],T})},E=g.useRef(!1);if(g.useEffect(function(){Object.keys(C).length>0?E.current=!0:E.current&&(c==null||c(),E.current=!1)},[C]),!o)return null;var $=Object.keys(C);return En.createPortal(g.createElement(g.Fragment,null,$.map(function(O){var k=C[O],M=g.createElement(y$,{key:O,configList:k,placement:O,prefixCls:r,className:s==null?void 0:s(O),style:l==null?void 0:l(O),motion:i,onNoticeClose:m,onAllNoticeRemoved:S,stack:u});return d?d(M,{prefixCls:r,key:O}):M})),o)});x5.NODE_ENV!=="production"&&(C$.displayName="Notifications");var w5=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],E5=function(){return document.body},S$=0;function $5(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(o){o&&Object.keys(o).forEach(function(i){var a=o[i];a!==void 0&&(e[i]=a)})}),e}function O5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getContainer,n=t===void 0?E5:t,r=e.motion,o=e.prefixCls,i=e.maxCount,a=e.className,s=e.style,l=e.onAllRemoved,c=e.stack,u=e.renderNotifications,d=st(e,w5),f=g.useState(),h=Y(f,2),p=h[0],v=h[1],m=g.useRef(),b=g.createElement(C$,{container:p,ref:m,prefixCls:o,motion:r,maxCount:i,className:a,style:s,onAllRemoved:l,stack:c,renderNotifications:u}),y=g.useState([]),C=Y(y,2),x=C[0],S=C[1],E=qt(function(O){var k=$5(d,O);(k.key===null||k.key===void 0)&&(k.key="rc-notification-".concat(S$),S$+=1),S(function(M){return[].concat(de(M),[{type:"open",config:k}])})}),$=g.useMemo(function(){return{open:E,close:function(k){S(function(M){return[].concat(de(M),[{type:"close",key:k}])})},destroy:function(){S(function(k){return[].concat(de(k),[{type:"destroy"}])})}}},[]);return g.useEffect(function(){v(n())}),g.useEffect(function(){if(m.current&&x.length){x.forEach(function(M){switch(M.type){case"open":m.current.open(M.config);break;case"close":m.current.close(M.key);break;case"destroy":m.current.destroy();break}});var O,k;S(function(M){return(O!==M||!k)&&(O=M,k=M.filter(function(T){return!x.includes(T)})),k})}},[x]),[$,b]}var k5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},M5={},N5=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:k5}))},Es=g.forwardRef(N5);M5.NODE_ENV!=="production"&&(Es.displayName="LoadingOutlined");function x$(...e){const t={};return e.forEach(n=>{n&&Object.keys(n).forEach(r=>{n[r]!==void 0&&(t[r]=n[r])})}),t}function w$(e){if(!e)return;const{closable:t,closeIcon:n}=e;return{closable:t,closeIcon:n}}function E$(e){const{closable:t,closeIcon:n}=e||{};return w.useMemo(()=>{if(!t&&(t===!1||n===!1||n===null))return!1;if(t===void 0&&n===void 0)return null;let r={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return t&&typeof t=="object"&&(r=Object.assign(Object.assign({},r),t)),r},[t,n])}const T5={},I5=(e,t,n=T5)=>{const r=E$(e),o=E$(t),[i]=uo("global",ri.global),a=typeof r!="boolean"?!!(r!=null&&r.disabled):!1,s=w.useMemo(()=>Object.assign({closeIcon:w.createElement(zi,null)},n),[n]),l=w.useMemo(()=>r===!1?!1:r?x$(s,o,r):o===!1?!1:o?x$(s,o):s.closable?s:!1,[r,o,s]);return w.useMemo(()=>{var c,u;if(l===!1)return[!1,null,a,{}];const{closeIconRender:d}=s,{closeIcon:f}=l;let h=f;const p=Vr(l,!0);return h!=null&&(d&&(h=d(f)),h=w.isValidElement(h)?w.cloneElement(h,Object.assign(Object.assign(Object.assign({},h.props),{"aria-label":(u=(c=h.props)===null||c===void 0?void 0:c["aria-label"])!==null&&u!==void 0?u:i.close}),p)):w.createElement("span",Object.assign({"aria-label":i.close},p),h)),[!0,h,a,p]},[a,i.close,l,s])},$$=()=>w.useReducer(e=>e+1,0),P5=()=>{const[e,t]=g.useState([]),n=g.useCallback(r=>(t(o=>[].concat(de(o),[r])),()=>{t(o=>o.filter(i=>i!==r))}),[]);return[e,n]};var A5={};const Wd=w.createContext(void 0);A5.NODE_ENV!=="production"&&(Wd.displayName="zIndexContext");var O$={};const oi=100,Hg=oi*10,R5=Hg+oi,k$={Modal:oi,Drawer:oi,Popover:oi,Popconfirm:oi,Tooltip:oi,Tour:oi,FloatButton:oi},_5={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function D5(e){return e in k$}const Vg=(e,t)=>{const[,n]=wr(),r=w.useContext(Wd),o=D5(e);let i;if(t!==void 0)i=[t,t];else{let a=r??0;o?a+=(r?0:n.zIndexPopupBase)+k$[e]:a+=_5[e],i=[r===void 0?t:a,a]}if(O$.NODE_ENV!=="production"){const a=Wt(e),s=n.zIndexPopupBase+R5,l=i[0]||0;O$.NODE_ENV!=="production"&&a(t!==void 0||l<=s,"usage","`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.")}return i},L5=e=>{const{componentCls:t,iconCls:n,boxShadow:r,colorText:o,colorSuccess:i,colorError:a,colorWarning:s,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:h,borderRadiusLG:p,zIndexPopup:v,contentPadding:m,contentBg:b}=e,y=`${t}-notice`,C=new It("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:h,transform:"translateY(0)",opacity:1}}),x=new It("MessageMoveOut",{"0%":{maxHeight:e.height,padding:h,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),S={padding:h,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${n}`]:{marginInlineEnd:f,fontSize:c},[`${y}-content`]:{display:"inline-block",padding:m,background:b,borderRadius:p,boxShadow:r,pointerEvents:"all"},[`${t}-success > ${n}`]:{color:i},[`${t}-error > ${n}`]:{color:a},[`${t}-warning > ${n}`]:{color:s},[`${t}-info > ${n},
|
|
332
|
+
${t}-loading > ${n}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},Pn(e)),{color:o,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:v,[`${t}-move-up`]:{animationFillMode:"forwards"},[`
|
|
333
|
+
${t}-move-up-appear,
|
|
334
|
+
${t}-move-up-enter
|
|
335
|
+
`]:{animationName:C,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`
|
|
336
|
+
${t}-move-up-appear${t}-move-up-appear-active,
|
|
337
|
+
${t}-move-up-enter${t}-move-up-enter-active
|
|
338
|
+
`]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:x,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${y}-wrapper`]:Object.assign({},S)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},S),{padding:0,textAlign:"start"})}]},M$=gn("Message",e=>{const t=Dt(e,{height:150});return L5(t)},e=>({zIndexPopup:e.zIndexPopupBase+Hg+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}));var j5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const z5={info:g.createElement(Fg,null),success:g.createElement(Vd,null),error:g.createElement(ws,null),warning:g.createElement(Bg,null),loading:g.createElement(Es,null)},N$=({prefixCls:e,type:t,icon:n,children:r})=>g.createElement("div",{className:J(`${e}-custom-content`,`${e}-${t}`)},n||z5[t],g.createElement("span",null,r)),B5=e=>{const{prefixCls:t,className:n,type:r,icon:o,content:i}=e,a=j5(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=g.useContext(wt),l=t||s("message"),c=Po(l),[u,d,f]=M$(l,c);return u(g.createElement(p$,Object.assign({},a,{prefixCls:l,className:J(n,d,`${l}-notice-pure-panel`,f,c),eventKey:"pure",duration:null,content:g.createElement(N$,{prefixCls:l,type:r,icon:o},i)})))};function F5(e,t){return{motionName:t??`${e}-move-up`}}function Wg(e){let t;const n=new Promise(o=>{t=e(()=>{o(!0)})}),r=()=>{t==null||t()};return r.then=(o,i)=>n.then(o,i),r.promise=n,r}var H5={},V5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const W5=8,U5=3,q5=({children:e,prefixCls:t})=>{const n=Po(t),[r,o,i]=M$(t,n);return r(g.createElement(b5,{classNames:{list:J(o,i,n)}},e))},K5=(e,{prefixCls:t,key:n})=>g.createElement(q5,{prefixCls:t,key:n},e),G5=g.forwardRef((e,t)=>{const{top:n,prefixCls:r,getContainer:o,maxCount:i,duration:a=U5,rtl:s,transitionName:l,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:d,message:f,direction:h}=g.useContext(wt),p=r||u("message"),v=()=>({left:"50%",transform:"translateX(-50%)",top:n??W5}),m=()=>J({[`${p}-rtl`]:s??h==="rtl"}),b=()=>F5(p,l),y=g.createElement("span",{className:`${p}-close-x`},g.createElement(zi,{className:`${p}-close-icon`})),[C,x]=O5({prefixCls:p,style:v,className:m,motion:b,closable:!1,closeIcon:y,duration:a,getContainer:()=>(o==null?void 0:o())||(d==null?void 0:d())||document.body,maxCount:i,onAllRemoved:c,renderNotifications:K5});return g.useImperativeHandle(t,()=>Object.assign(Object.assign({},C),{prefixCls:p,message:f})),x});let T$=0;function I$(e){const t=g.useRef(null),n=Wt("Message");return[g.useMemo(()=>{const o=c=>{var u;(u=t.current)===null||u===void 0||u.close(c)},i=c=>{if(!t.current){H5.NODE_ENV!=="production"&&n(!1,"usage","You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.");const $=()=>{};return $.then=()=>{},$}const{open:u,prefixCls:d,message:f}=t.current,h=`${d}-notice`,{content:p,icon:v,type:m,key:b,className:y,style:C,onClose:x}=c,S=V5(c,["content","icon","type","key","className","style","onClose"]);let E=b;return E==null&&(T$+=1,E=`antd-message-${T$}`),Wg($=>(u(Object.assign(Object.assign({},S),{key:E,content:g.createElement(N$,{prefixCls:d,type:m,icon:v},p),placement:"top",className:J(m&&`${h}-${m}`,y,f==null?void 0:f.className),style:Object.assign(Object.assign({},f==null?void 0:f.style),C),onClose:()=>{x==null||x(),$()}})),()=>{o(E)}))},s={open:i,destroy:c=>{var u;c!==void 0?o(c):(u=t.current)===null||u===void 0||u.destroy()}};return["info","success","warning","error","loading"].forEach(c=>{const u=(d,f,h)=>{let p;d&&typeof d=="object"&&"content"in d?p=d:p={content:d};let v,m;typeof f=="function"?m=f:(v=f,m=h);const b=Object.assign(Object.assign({onClose:m,duration:v},p),{type:c});return i(b)};s[c]=u}),s},[]),g.createElement(G5,Object.assign({key:"message-holder"},e,{ref:t}))]}function X5(e){return I$(e)}function P$(e,t){this.v=e,this.k=t}function tr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}tr=function(a,s,l,c){function u(d,f){tr(a,d,function(h){return this._invoke(d,f,h)})}s?o?o(a,s,{value:l,enumerable:!c,configurable:!c,writable:!c}):a[s]=l:(u("next",0),u("throw",1),u("return",2))},tr(e,t,n,r)}function Ug(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(h,p,v,m){var b=p&&p.prototype instanceof s?p:s,y=Object.create(b.prototype);return tr(y,"_invoke",(function(C,x,S){var E,$,O,k=0,M=S||[],T=!1,I={p:0,n:0,v:e,a:R,f:R.bind(e,4),d:function(P,A){return E=P,$=0,O=e,I.n=A,a}};function R(N,P){for($=N,O=P,t=0;!T&&k&&!A&&t<M.length;t++){var A,_=M[t],B=I.p,F=_[2];N>3?(A=F===P)&&(O=_[($=_[4])?5:($=3,3)],_[4]=_[5]=e):_[0]<=B&&((A=N<2&&B<_[1])?($=0,I.v=P,I.n=_[1]):B<F&&(A=N<3||_[0]>P||P>F)&&(_[4]=N,_[5]=P,I.n=F,$=0))}if(A||N>1)return a;throw T=!0,P}return function(N,P,A){if(k>1)throw TypeError("Generator is already running");for(T&&P===1&&R(P,A),$=P,O=A;(t=$<2?e:O)||!T;){E||($?$<3?($>1&&(I.n=-1),R($,O)):I.n=O:I.v=O);try{if(k=2,E){if($||(N="next"),t=E[N]){if(!(t=t.call(E,O)))throw TypeError("iterator result is not an object");if(!t.done)return t;O=t.value,$<2&&($=0)}else $===1&&(t=E.return)&&t.call(E),$<2&&(O=TypeError("The iterator does not provide a '"+N+"' method"),$=1);E=e}else if((t=(T=I.n<0)?O:C.call(x,I))!==a)break}catch(_){E=e,$=1,O=_}finally{k=1}}return{value:t,done:T}}})(h,v,m),!0),y}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(tr(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,tr(h,o,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,tr(d,"constructor",c),tr(c,"constructor",l),l.displayName="GeneratorFunction",tr(c,o,"GeneratorFunction"),tr(d),tr(d,o,"Generator"),tr(d,r,function(){return this}),tr(d,"toString",function(){return"[object Generator]"}),(Ug=function(){return{w:i,m:f}})()}function Ud(e,t){function n(o,i,a,s){try{var l=e[o](i),c=l.value;return c instanceof P$?t.resolve(c.v).then(function(u){n("next",u,a,s)},function(u){n("throw",u,a,s)}):t.resolve(c).then(function(u){l.value=u,a(l)},function(u){return n("throw",u,a,s)})}catch(u){s(u)}}var r;this.next||(tr(Ud.prototype),tr(Ud.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),tr(this,"_invoke",function(o,i,a){function s(){return new t(function(l,c){n(o,a,l,c)})}return r=r?r.then(s,s):s()},!0)}function A$(e,t,n,r,o){return new Ud(Ug().w(e,t,n,r),o||Promise)}function Y5(e,t,n,r,o){var i=A$(e,t,n,r,o);return i.next().then(function(a){return a.done?a.value:i.next()})}function J5(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function o(){for(;n.length;)if((r=n.pop())in t)return o.value=r,o.done=!1,o;return o.done=!0,o}}function R$(e){if(e!=null){var t=e[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(Ue(e)+" is not iterable")}function zt(){var e=Ug(),t=e.m(zt),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(a){var s=typeof a=="function"&&a.constructor;return!!s&&(s===n||(s.displayName||s.name)==="GeneratorFunction")}var o={throw:1,return:2,break:3,continue:3};function i(a){var s,l;return function(c){s||(s={stop:function(){return l(c.a,2)},catch:function(){return c.v},abrupt:function(d,f){return l(c.a,o[d],f)},delegateYield:function(d,f,h){return s.resultName=f,l(c.d,R$(d),h)},finish:function(d){return l(c.f,d)}},l=function(d,f,h){c.p=s.prev,c.n=s.next;try{return d(f,h)}finally{s.next=c.n}}),s.resultName&&(s[s.resultName]=c.v,s.resultName=void 0),s.sent=c.v,s.next=c.n;try{return a.call(this,s)}finally{c.p=s.prev,c.n=s.next}}}return(zt=function(){return{wrap:function(l,c,u,d){return e.w(i(l),c,u,d&&d.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(l,c){return new P$(l,c)},AsyncIterator:Ud,async:function(l,c,u,d,f){return(r(c)?A$:Y5)(i(l),c,u,d,f)},keys:J5,values:R$}})()}function _$(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function lr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(l){_$(i,r,o,a,s,"next",l)}function s(l){_$(i,r,o,a,s,"throw",l)}a(void 0)})}}var Gl=V({},p0),Q5=Gl.version,qg=Gl.render,Z5=Gl.unmountComponentAtNode,qd;try{var e4=Number((Q5||"").split(".")[0]);e4>=18&&(qd=Gl.createRoot)}catch{}function D$(e){var t=Gl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&Ue(t)==="object"&&(t.usingClientEntryPoint=e)}var Kd="__rc_react_root__";function t4(e,t){D$(!0);var n=t[Kd]||qd(t);D$(!1),n.render(e),t[Kd]=n}function n4(e,t){qg==null||qg(e,t)}function r4(e,t){if(qd){t4(e,t);return}n4(e,t)}function o4(e){return Kg.apply(this,arguments)}function Kg(){return Kg=lr(zt().mark(function e(t){return zt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var o;(o=t[Kd])===null||o===void 0||o.unmount(),delete t[Kd]}));case 1:case"end":return r.stop()}},e)})),Kg.apply(this,arguments)}function i4(e){Z5(e)}function a4(e){return Gg.apply(this,arguments)}function Gg(){return Gg=lr(zt().mark(function e(t){return zt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(qd===void 0){r.next=2;break}return r.abrupt("return",o4(t));case 2:i4(t);case 3:case"end":return r.stop()}},e)})),Gg.apply(this,arguments)}var L$={};let s4=(e,t)=>{if(L$.NODE_ENV!=="production"){const n=Number.parseInt(g.version.split(".")[0],10),r=Object.keys(p0);L$.NODE_ENV!=="production"&&Di(n<19||r.includes("createRoot"),"compatible","antd v5 support React is 16 ~ 18. see https://u.ant.design/v5-for-19 for compatible.")}return r4(e,t),()=>a4(t)};function Xg(e){return s4}const Yg=()=>({height:0,opacity:0}),j$=e=>{const{scrollHeight:t}=e;return{height:t,opacity:1}},l4=e=>({height:e?e.offsetHeight:0}),Jg=(e,t)=>(t==null?void 0:t.deadline)===!0||t.propertyName==="height",z$=(e=Ul)=>({motionName:`${e}-motion-collapse`,onAppearStart:Yg,onEnterStart:Yg,onAppearActive:j$,onEnterActive:j$,onLeaveStart:l4,onLeaveActive:Yg,onAppearEnd:Jg,onEnterEnd:Jg,onLeaveEnd:Jg,motionDeadline:500}),Bi=(e,t,n)=>n!==void 0?n:`${e}-${t}`;function nr(e,t){var n=Object.assign({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}const Qg=(function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),i=o.width,a=o.height;if(i||a)return!0}}return!1}),c4=iV("Wave",e=>{const{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`,`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")}}}}}),B$=`${Ul}-wave-target`;function u4(e){return e&&e!=="#fff"&&e!=="#ffffff"&&e!=="rgb(255, 255, 255)"&&e!=="rgba(255, 255, 255, 1)"&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&e!=="transparent"&&e!=="canvastext"}function d4(e){var t;const{borderTopColor:n,borderColor:r,backgroundColor:o}=getComputedStyle(e);return(t=[n,r,o].find(u4))!==null&&t!==void 0?t:null}function Zg(e){return Number.isNaN(e)?0:e}const f4=e=>{const{className:t,target:n,component:r,registerUnmount:o}=e,i=g.useRef(null),a=g.useRef(null);g.useEffect(()=>{a.current=o()},[]);const[s,l]=g.useState(null),[c,u]=g.useState([]),[d,f]=g.useState(0),[h,p]=g.useState(0),[v,m]=g.useState(0),[b,y]=g.useState(0),[C,x]=g.useState(!1),S={left:d,top:h,width:v,height:b,borderRadius:c.map(O=>`${O}px`).join(" ")};s&&(S["--wave-color"]=s);function E(){const O=getComputedStyle(n);l(d4(n));const k=O.position==="static",{borderLeftWidth:M,borderTopWidth:T}=O;f(k?n.offsetLeft:Zg(-Number.parseFloat(M))),p(k?n.offsetTop:Zg(-Number.parseFloat(T))),m(n.offsetWidth),y(n.offsetHeight);const{borderTopLeftRadius:I,borderTopRightRadius:R,borderBottomLeftRadius:N,borderBottomRightRadius:P}=O;u([I,R,P,N].map(A=>Zg(Number.parseFloat(A))))}if(g.useEffect(()=>{if(n){const O=Nt(()=>{E(),x(!0)});let k;return typeof ResizeObserver<"u"&&(k=new ResizeObserver(E),k.observe(n)),()=>{Nt.cancel(O),k==null||k.disconnect()}}},[n]),!C)return null;const $=(r==="Checkbox"||r==="Radio")&&(n==null?void 0:n.classList.contains(B$));return g.createElement(Er,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(O,k)=>{var M,T;if(k.deadline||k.propertyName==="opacity"){const I=(M=i.current)===null||M===void 0?void 0:M.parentElement;(T=a.current)===null||T===void 0||T.call(a).then(()=>{I==null||I.remove()})}return!1}},({className:O},k)=>g.createElement("div",{ref:sr(i,k),className:J(t,O,{"wave-quick":$}),style:S}))},h4=(e,t)=>{var n;const{component:r}=t;if(r==="Checkbox"&&!(!((n=e.querySelector("input"))===null||n===void 0)&&n.checked))return;const o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",e==null||e.insertBefore(o,e==null?void 0:e.firstChild);const i=Xg();let a=null;function s(){return a}a=i(g.createElement(f4,Object.assign({},t,{target:e,registerUnmount:s})),o)},p4=(e,t,n)=>{const{wave:r}=g.useContext(wt),[,o,i]=wr(),a=qt(c=>{const u=e.current;if(r!=null&&r.disabled||!u)return;const d=u.querySelector(`.${B$}`)||u,{showEffect:f}=r||{};(f||h4)(d,{className:t,token:o,component:n,event:c,hashId:i})}),s=g.useRef(null);return c=>{Nt.cancel(s.current),s.current=Nt(()=>{a(c)})}};var m4={};const F$=e=>{const{children:t,disabled:n,component:r}=e,{getPrefixCls:o}=w.useContext(wt),i=w.useRef(null),a=o("wave"),[,s]=c4(a),l=p4(i,J(a,s),r);if(w.useEffect(()=>{const u=i.current;if(!u||u.nodeType!==window.Node.ELEMENT_NODE||n)return;const d=f=>{!Qg(f.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")&&!u.className.includes("disabled:")||u.getAttribute("aria-disabled")==="true"||u.className.includes("-leave")||l(f)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[n]),!w.isValidElement(t))return t??null;const c=pa(t)?sr(rs(t),i):i;return Io(t,{ref:c})};m4.NODE_ENV!=="production"&&(F$.displayName="Wave");const Wr=e=>{const t=w.useContext(vs);return w.useMemo(()=>e?typeof e=="string"?e??t:typeof e=="function"?e(t):t:t,[e,t])},H$=g.createContext(null),Ca=(e,t)=>{const n=g.useContext(H$),r=g.useMemo(()=>{if(!n)return"";const{compactDirection:o,isFirstItem:i,isLastItem:a}=n,s=o==="vertical"?"-vertical-":"-";return J(`${e}-compact${s}item`,{[`${e}-compact${s}first-item`]:i,[`${e}-compact${s}last-item`]:a,[`${e}-compact${s}item-rtl`]:t==="rtl"})},[e,t,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},g4=e=>{const{children:t}=e;return g.createElement(H$.Provider,{value:null},t)};var V$={},v4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const W$=g.createContext(void 0),b4=e=>{const{getPrefixCls:t,direction:n}=g.useContext(wt),{prefixCls:r,size:o,className:i}=e,a=v4(e,["prefixCls","size","className"]),s=t("btn-group",r),[,,l]=wr(),c=g.useMemo(()=>{switch(o){case"large":return"lg";case"small":return"sm";default:return""}},[o]);if(V$.NODE_ENV!=="production"){const d=Wt("Button.Group");d.deprecated(!1,"Button.Group","Space.Compact"),V$.NODE_ENV!=="production"&&d(!o||["large","small","middle"].includes(o),"usage","Invalid prop `size`.")}const u=J(s,{[`${s}-${c}`]:c,[`${s}-rtl`]:n==="rtl"},i,l);return g.createElement(W$.Provider,{value:o},g.createElement("div",Object.assign({},a,{className:u})))},U$=/^[\u4E00-\u9FA5]{2}$/,ev=U$.test.bind(U$);function q$(e){return e==="danger"?{danger:!0}:{type:e}}function K$(e){return typeof e=="string"}function Gd(e){return e==="text"||e==="link"}function y4(e,t){if(e==null)return;const n=t?" ":"";return typeof e!="string"&&typeof e!="number"&&K$(e.type)&&ev(e.props.children)?Io(e,{children:e.props.children.split("").join(n)}):K$(e)?ev(e)?w.createElement("span",null,e.split("").join(n)):w.createElement("span",null,e):h$(e)?w.createElement("span",null,e):e}function C4(e,t){let n=!1;const r=[];return w.Children.forEach(e,o=>{const i=typeof o,a=i==="string"||i==="number";if(n&&a){const s=r.length-1,l=r[s];r[s]=`${l}${o}`}else r.push(o);n=a}),w.Children.map(r,o=>y4(o,t))}["default","primary","danger"].concat(de(Li));const G$=w.forwardRef((e,t)=>{const{className:n,style:r,children:o,prefixCls:i}=e,a=J(`${i}-icon`,n);return w.createElement("span",{ref:t,className:a,style:r},o)}),X$=w.forwardRef((e,t)=>{const{prefixCls:n,className:r,style:o,iconClassName:i}=e,a=J(`${n}-loading-icon`,r);return w.createElement(G$,{prefixCls:n,className:a,style:o,ref:t},w.createElement(Es,{className:i}))}),tv=()=>({width:0,opacity:0,transform:"scale(0)"}),nv=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"}),S4=e=>{const{prefixCls:t,loading:n,existIcon:r,className:o,style:i,mount:a}=e,s=!!n;return r?w.createElement(X$,{prefixCls:t,className:o,style:i}):w.createElement(Er,{visible:s,motionName:`${t}-loading-icon-motion`,motionAppear:!a,motionEnter:!a,motionLeave:!a,removeOnLeave:!0,onAppearStart:tv,onAppearActive:nv,onEnterStart:tv,onEnterActive:nv,onLeaveStart:nv,onLeaveActive:tv},({className:l,style:c},u)=>{const d=Object.assign(Object.assign({},i),c);return w.createElement(X$,{prefixCls:t,className:J(o,l),style:d,ref:u})})},Y$=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),x4=e=>{const{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:o,colorErrorHover:i}=e;return{[`${t}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},Y$(`${t}-primary`,o),Y$(`${t}-danger`,i)]}};var w4=["b"],E4=["v"],rv=function(t){return Math.round(Number(t||0))},$4=function(t){if(t instanceof Ut)return t;if(t&&Ue(t)==="object"&&"h"in t&&"b"in t){var n=t,r=n.b,o=st(n,w4);return V(V({},o),{},{v:r})}return typeof t=="string"&&/hsb/.test(t)?t.replace(/hsb/,"hsv"):t},po=(function(e){io(n,e);var t=ao(n);function n(r){return dn(this,n),t.call(this,$4(r))}return fn(n,[{key:"toHsbString",value:function(){var o=this.toHsb(),i=rv(o.s*100),a=rv(o.b*100),s=rv(o.h),l=o.a,c="hsb(".concat(s,", ").concat(i,"%, ").concat(a,"%)"),u="hsba(".concat(s,", ").concat(i,"%, ").concat(a,"%, ").concat(l.toFixed(l===0?0:2),")");return l===1?c:u}},{key:"toHsb",value:function(){var o=this.toHsv(),i=o.v,a=st(o,E4);return V(V({},a),{},{b:i,a:this.a})}}]),n})(Ut),O4="rc-color-picker",$s=function(t){return t instanceof po?t:new po(t)},k4=$s("#1677ff"),J$=function(t){var n=t.offset,r=t.targetRef,o=t.containerRef,i=t.color,a=t.type,s=o.current.getBoundingClientRect(),l=s.width,c=s.height,u=r.current.getBoundingClientRect(),d=u.width,f=u.height,h=d/2,p=f/2,v=(n.x+h)/l,m=1-(n.y+p)/c,b=i.toHsb(),y=v,C=(n.x+h)/l*360;if(a)switch(a){case"hue":return $s(V(V({},b),{},{h:C<=0?0:C}));case"alpha":return $s(V(V({},b),{},{a:y<=0?0:y}))}return $s({h:b.h,s:v<=0?0:v,b:m>=1?1:m,a:b.a})},Q$=function(t,n){var r=t.toHsb();switch(n){case"hue":return{x:r.h/360*100,y:50};case"alpha":return{x:t.a*100,y:50};default:return{x:r.s*100,y:(1-r.b)*100}}},ov=function(t){var n=t.color,r=t.prefixCls,o=t.className,i=t.style,a=t.onClick,s="".concat(r,"-color-block");return w.createElement("div",{className:J(s,o),style:i,onClick:a},w.createElement("div",{className:"".concat(s,"-inner"),style:{background:n}}))};function M4(e){var t="touches"in e?e.touches[0]:e,n=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset,r=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset;return{pageX:t.pageX-n,pageY:t.pageY-r}}function Z$(e){var t=e.targetRef,n=e.containerRef,r=e.direction,o=e.onDragChange,i=e.onDragChangeComplete,a=e.calculate,s=e.color,l=e.disabledDrag,c=w.useState({x:0,y:0}),u=Y(c,2),d=u[0],f=u[1],h=w.useRef(null),p=w.useRef(null);w.useEffect(function(){f(a())},[s]),w.useEffect(function(){return function(){document.removeEventListener("mousemove",h.current),document.removeEventListener("mouseup",p.current),document.removeEventListener("touchmove",h.current),document.removeEventListener("touchend",p.current),h.current=null,p.current=null}},[]);var v=function(x){var S=M4(x),E=S.pageX,$=S.pageY,O=n.current.getBoundingClientRect(),k=O.x,M=O.y,T=O.width,I=O.height,R=t.current.getBoundingClientRect(),N=R.width,P=R.height,A=N/2,_=P/2,B=Math.max(0,Math.min(E-k,T))-A,F=Math.max(0,Math.min($-M,I))-_,U={x:B,y:r==="x"?d.y:F};if(N===0&&P===0||N!==P)return!1;o==null||o(U)},m=function(x){x.preventDefault(),v(x)},b=function(x){x.preventDefault(),document.removeEventListener("mousemove",h.current),document.removeEventListener("mouseup",p.current),document.removeEventListener("touchmove",h.current),document.removeEventListener("touchend",p.current),h.current=null,p.current=null,i==null||i()},y=function(x){document.removeEventListener("mousemove",h.current),document.removeEventListener("mouseup",p.current),!l&&(v(x),document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),document.addEventListener("touchmove",m),document.addEventListener("touchend",b),h.current=m,p.current=b)};return[d,y]}var eO=function(t){var n=t.size,r=n===void 0?"default":n,o=t.color,i=t.prefixCls;return w.createElement("div",{className:J("".concat(i,"-handler"),z({},"".concat(i,"-handler-sm"),r==="small")),style:{backgroundColor:o}})},tO=function(t){var n=t.children,r=t.style,o=t.prefixCls;return w.createElement("div",{className:"".concat(o,"-palette"),style:V({position:"relative"},r)},n)},nO=w.forwardRef(function(e,t){var n=e.children,r=e.x,o=e.y;return w.createElement("div",{ref:t,style:{position:"absolute",left:"".concat(r,"%"),top:"".concat(o,"%"),zIndex:1,transform:"translate(-50%, -50%)"}},n)}),N4=function(t){var n=t.color,r=t.onChange,o=t.prefixCls,i=t.onChangeComplete,a=t.disabled,s=w.useRef(),l=w.useRef(),c=w.useRef(n),u=qt(function(v){var m=J$({offset:v,targetRef:l,containerRef:s,color:n});c.current=m,r(m)}),d=Z$({color:n,containerRef:s,targetRef:l,calculate:function(){return Q$(n)},onDragChange:u,onDragChangeComplete:function(){return i==null?void 0:i(c.current)},disabledDrag:a}),f=Y(d,2),h=f[0],p=f[1];return w.createElement("div",{ref:s,className:"".concat(o,"-select"),onMouseDown:p,onTouchStart:p},w.createElement(tO,{prefixCls:o},w.createElement(nO,{x:h.x,y:h.y,ref:l},w.createElement(eO,{color:n.toRgbString(),prefixCls:o})),w.createElement("div",{className:"".concat(o,"-saturation"),style:{backgroundColor:"hsl(".concat(n.toHsb().h,",100%, 50%)"),backgroundImage:"linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"}})))},T4=function(t,n){var r=cn(t,{value:n}),o=Y(r,2),i=o[0],a=o[1],s=w.useMemo(function(){return $s(i)},[i]);return[s,a]},I4=function(t){var n=t.colors,r=t.children,o=t.direction,i=o===void 0?"to right":o,a=t.type,s=t.prefixCls,l=w.useMemo(function(){return n.map(function(c,u){var d=$s(c);return a==="alpha"&&u===n.length-1&&(d=new po(d.setA(1))),d.toRgbString()}).join(",")},[n,a]);return w.createElement("div",{className:"".concat(s,"-gradient"),style:{position:"absolute",inset:0,background:"linear-gradient(".concat(i,", ").concat(l,")")}},r)},P4=function(t){var n=t.prefixCls,r=t.colors,o=t.disabled,i=t.onChange,a=t.onChangeComplete,s=t.color,l=t.type,c=w.useRef(),u=w.useRef(),d=w.useRef(s),f=function(S){return l==="hue"?S.getHue():S.a*100},h=qt(function(x){var S=J$({offset:x,targetRef:u,containerRef:c,color:s,type:l});d.current=S,i(f(S))}),p=Z$({color:s,targetRef:u,containerRef:c,calculate:function(){return Q$(s,l)},onDragChange:h,onDragChangeComplete:function(){a(f(d.current))},direction:"x",disabledDrag:o}),v=Y(p,2),m=v[0],b=v[1],y=w.useMemo(function(){if(l==="hue"){var x=s.toHsb();x.s=1,x.b=1,x.a=1;var S=new po(x);return S}return s},[s,l]),C=w.useMemo(function(){return r.map(function(x){return"".concat(x.color," ").concat(x.percent,"%")})},[r]);return w.createElement("div",{ref:c,className:J("".concat(n,"-slider"),"".concat(n,"-slider-").concat(l)),onMouseDown:b,onTouchStart:b},w.createElement(tO,{prefixCls:n},w.createElement(nO,{x:m.x,y:m.y,ref:u},w.createElement(eO,{size:"small",color:y.toHexString(),prefixCls:n})),w.createElement(I4,{colors:C,type:l,prefixCls:n})))};function A4(e){return g.useMemo(function(){var t=e||{},n=t.slider;return[n||P4]},[e])}var R4={},_4=[{color:"rgb(255, 0, 0)",percent:0},{color:"rgb(255, 255, 0)",percent:17},{color:"rgb(0, 255, 0)",percent:33},{color:"rgb(0, 255, 255)",percent:50},{color:"rgb(0, 0, 255)",percent:67},{color:"rgb(255, 0, 255)",percent:83},{color:"rgb(255, 0, 0)",percent:100}],rO=w.forwardRef(function(e,t){var n=e.value,r=e.defaultValue,o=e.prefixCls,i=o===void 0?O4:o,a=e.onChange,s=e.onChangeComplete,l=e.className,c=e.style,u=e.panelRender,d=e.disabledAlpha,f=d===void 0?!1:d,h=e.disabled,p=h===void 0?!1:h,v=e.components,m=A4(v),b=Y(m,1),y=b[0],C=T4(r||k4,n),x=Y(C,2),S=x[0],E=x[1],$=w.useMemo(function(){return S.setA(1).toRgbString()},[S]),O=function(F,U){n||E(F),a==null||a(F,U)},k=function(F){return new po(S.setHue(F))},M=function(F){return new po(S.setA(F/100))},T=function(F){O(k(F),{type:"hue",value:F})},I=function(F){O(M(F),{type:"alpha",value:F})},R=function(F){s&&s(k(F))},N=function(F){s&&s(M(F))},P=J("".concat(i,"-panel"),l,z({},"".concat(i,"-panel-disabled"),p)),A={prefixCls:i,disabled:p,color:S},_=w.createElement(w.Fragment,null,w.createElement(N4,he({onChange:O},A,{onChangeComplete:s})),w.createElement("div",{className:"".concat(i,"-slider-container")},w.createElement("div",{className:J("".concat(i,"-slider-group"),z({},"".concat(i,"-slider-group-disabled-alpha"),f))},w.createElement(y,he({},A,{type:"hue",colors:_4,min:0,max:359,value:S.getHue(),onChange:T,onChangeComplete:R})),!f&&w.createElement(y,he({},A,{type:"alpha",colors:[{percent:0,color:"rgba(255, 0, 4, 0)"},{percent:100,color:$}],min:0,max:100,value:S.a*100,onChange:I,onChangeComplete:N}))),w.createElement(ov,{color:S.toRgbString(),prefixCls:i})));return w.createElement("div",{className:P,style:c,ref:t},typeof u=="function"?u(_):_)});R4.NODE_ENV!=="production"&&(rO.displayName="ColorPicker");const Xl=(e,t)=>(e==null?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"",D4=(e,t)=>e?Xl(e,t):"";let $r=(function(){function e(t){dn(this,e);var n;if(this.cleared=!1,t instanceof e){this.metaColor=t.metaColor.clone(),this.colors=(n=t.colors)===null||n===void 0?void 0:n.map(o=>({color:new e(o.color),percent:o.percent})),this.cleared=t.cleared;return}const r=Array.isArray(t);r&&t.length?(this.colors=t.map(({color:o,percent:i})=>({color:new e(o),percent:i})),this.metaColor=new po(this.colors[0].color.metaColor)):this.metaColor=new po(r?"":t),(!t||r&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)}return fn(e,[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return D4(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:n}=this;return n?`linear-gradient(90deg, ${n.map(o=>`${o.color.toRgbString()} ${o.percent}%`).join(", ")})`:this.metaColor.toRgbString()}},{key:"equals",value:function(n){return!n||this.isGradient()!==n.isGradient()?!1:this.isGradient()?this.colors.length===n.colors.length&&this.colors.every((r,o)=>{const i=n.colors[o];return r.percent===i.percent&&r.color.equals(i.color)}):this.toHexString()===n.toHexString()}}])})();var L4={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},j4={},z4=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:L4}))},oO=g.forwardRef(z4);j4.NODE_ENV!=="production"&&(oO.displayName="RightOutlined");var iO=w.forwardRef(function(e,t){var n=e.prefixCls,r=e.forceRender,o=e.className,i=e.style,a=e.children,s=e.isActive,l=e.role,c=e.classNames,u=e.styles,d=w.useState(s||r),f=Y(d,2),h=f[0],p=f[1];return w.useEffect(function(){(r||s)&&p(!0)},[r,s]),h?w.createElement("div",{ref:t,className:J("".concat(n,"-content"),z(z({},"".concat(n,"-content-active"),s),"".concat(n,"-content-inactive"),!s),o),style:i,role:l},w.createElement("div",{className:J("".concat(n,"-content-box"),c==null?void 0:c.body),style:u==null?void 0:u.body},a)):null});iO.displayName="PanelContent";var B4=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],aO=w.forwardRef(function(e,t){var n=e.showArrow,r=n===void 0?!0:n,o=e.headerClass,i=e.isActive,a=e.onItemClick,s=e.forceRender,l=e.className,c=e.classNames,u=c===void 0?{}:c,d=e.styles,f=d===void 0?{}:d,h=e.prefixCls,p=e.collapsible,v=e.accordion,m=e.panelKey,b=e.extra,y=e.header,C=e.expandIcon,x=e.openMotion,S=e.destroyInactivePanel,E=e.children,$=st(e,B4),O=p==="disabled",k=b!=null&&typeof b!="boolean",M=z(z(z({onClick:function(){a==null||a(m)},onKeyDown:function(_){(_.key==="Enter"||_.keyCode===Le.ENTER||_.which===Le.ENTER)&&(a==null||a(m))},role:v?"tab":"button"},"aria-expanded",i),"aria-disabled",O),"tabIndex",O?-1:0),T=typeof C=="function"?C(e):w.createElement("i",{className:"arrow"}),I=T&&w.createElement("div",he({className:"".concat(h,"-expand-icon")},["header","icon"].includes(p)?M:{}),T),R=J("".concat(h,"-item"),z(z({},"".concat(h,"-item-active"),i),"".concat(h,"-item-disabled"),O),l),N=J(o,"".concat(h,"-header"),z({},"".concat(h,"-collapsible-").concat(p),!!p),u.header),P=V({className:N,style:f.header},["header","icon"].includes(p)?{}:M);return w.createElement("div",he({},$,{ref:t,className:R}),w.createElement("div",P,r&&I,w.createElement("span",he({className:"".concat(h,"-header-text")},p==="header"?M:{}),y),k&&w.createElement("div",{className:"".concat(h,"-extra")},b)),w.createElement(Er,he({visible:i,leavedClassName:"".concat(h,"-content-hidden")},x,{forceRender:s,removeOnLeave:S}),function(A,_){var B=A.className,F=A.style;return w.createElement(iO,{ref:_,prefixCls:h,className:B,classNames:u,style:F,styles:f,isActive:i,forceRender:s,role:v?"tabpanel":void 0},E)}))}),F4=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],H4=function(t,n){var r=n.prefixCls,o=n.accordion,i=n.collapsible,a=n.destroyInactivePanel,s=n.onItemClick,l=n.activeKey,c=n.openMotion,u=n.expandIcon;return t.map(function(d,f){var h=d.children,p=d.label,v=d.key,m=d.collapsible,b=d.onItemClick,y=d.destroyInactivePanel,C=st(d,F4),x=String(v??f),S=m??i,E=y??a,$=function(M){S!=="disabled"&&(s(M),b==null||b(M))},O=!1;return o?O=l[0]===x:O=l.indexOf(x)>-1,w.createElement(aO,he({},C,{prefixCls:r,key:x,panelKey:x,isActive:O,accordion:o,openMotion:c,expandIcon:u,header:p,collapsible:S,onItemClick:$,destroyInactivePanel:E}),h)})},V4=function(t,n,r){if(!t)return null;var o=r.prefixCls,i=r.accordion,a=r.collapsible,s=r.destroyInactivePanel,l=r.onItemClick,c=r.activeKey,u=r.openMotion,d=r.expandIcon,f=t.key||String(n),h=t.props,p=h.header,v=h.headerClass,m=h.destroyInactivePanel,b=h.collapsible,y=h.onItemClick,C=!1;i?C=c[0]===f:C=c.indexOf(f)>-1;var x=b??a,S=function(O){x!=="disabled"&&(l(O),y==null||y(O))},E={key:f,panelKey:f,header:p,headerClass:v,isActive:C,prefixCls:o,destroyInactivePanel:m??s,openMotion:u,accordion:i,children:t.props.children,onItemClick:S,expandIcon:d,collapsible:x};return typeof t.type=="string"?t:(Object.keys(E).forEach(function($){typeof E[$]>"u"&&delete E[$]}),w.cloneElement(t,E))};function W4(e,t,n){return Array.isArray(e)?H4(e,n):oo(t).map(function(r,o){return V4(r,o,n)})}function U4(e){var t=e;if(!Array.isArray(t)){var n=Ue(t);t=n==="number"||n==="string"?[t]:[]}return t.map(function(r){return String(r)})}var q4=w.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-collapse":n,o=e.destroyInactivePanel,i=o===void 0?!1:o,a=e.style,s=e.accordion,l=e.className,c=e.children,u=e.collapsible,d=e.openMotion,f=e.expandIcon,h=e.activeKey,p=e.defaultActiveKey,v=e.onChange,m=e.items,b=J(r,l),y=cn([],{value:h,onChange:function(k){return v==null?void 0:v(k)},defaultValue:p,postState:U4}),C=Y(y,2),x=C[0],S=C[1],E=function(k){return S(function(){if(s)return x[0]===k?[]:[k];var M=x.indexOf(k),T=M>-1;return T?x.filter(function(I){return I!==k}):[].concat(de(x),[k])})};ft(!c,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var $=W4(m,c,{prefixCls:r,accordion:s,openMotion:d,expandIcon:f,collapsible:u,destroyInactivePanel:i,onItemClick:E,activeKey:x});return w.createElement("div",he({ref:t,className:b,style:a,role:s?"tablist":void 0},Vr(e,{aria:!0,data:!0})),$)});const iv=Object.assign(q4,{Panel:aO});iv.Panel;var K4={};const G4=g.forwardRef((e,t)=>{K4.NODE_ENV!=="production"&&Wt("Collapse.Panel").deprecated(!("disabled"in e),"disabled",'collapsible="disabled"');const{getPrefixCls:n}=g.useContext(wt),{prefixCls:r,className:o,showArrow:i=!0}=e,a=n("collapse",r),s=J({[`${a}-no-arrow`]:!i},o);return g.createElement(iv.Panel,Object.assign({ref:t},e,{prefixCls:a,className:s}))}),sO=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
339
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
340
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),X4=e=>({animationDuration:e,animationFillMode:"both"}),Y4=e=>({animationDuration:e,animationFillMode:"both"}),Xd=(e,t,n,r,o=!1)=>{const i=o?"&":"";return{[`
|
|
341
|
+
${i}${e}-enter,
|
|
342
|
+
${i}${e}-appear
|
|
343
|
+
`]:Object.assign(Object.assign({},X4(r)),{animationPlayState:"paused"}),[`${i}${e}-leave`]:Object.assign(Object.assign({},Y4(r)),{animationPlayState:"paused"}),[`
|
|
344
|
+
${i}${e}-enter${e}-enter-active,
|
|
345
|
+
${i}${e}-appear${e}-appear-active
|
|
346
|
+
`]:{animationName:t,animationPlayState:"running"},[`${i}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},J4=new It("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Q4=new It("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),lO=(e,t=!1)=>{const{antCls:n}=e,r=`${n}-fade`,o=t?"&":"";return[Xd(r,J4,Q4,e.motionDurationMid,t),{[`
|
|
347
|
+
${o}${r}-enter,
|
|
348
|
+
${o}${r}-appear
|
|
349
|
+
`]:{opacity:0,animationTimingFunction:"linear"},[`${o}${r}-leave`]:{animationTimingFunction:"linear"}}]},Z4=new It("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),e6=new It("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),t6=new It("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),n6=new It("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),r6=new It("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),o6=new It("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),i6=new It("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),a6=new It("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),s6={"move-up":{inKeyframes:i6,outKeyframes:a6},"move-down":{inKeyframes:Z4,outKeyframes:e6},"move-left":{inKeyframes:t6,outKeyframes:n6},"move-right":{inKeyframes:r6,outKeyframes:o6}},cO=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=s6[t];return[Xd(r,o,i,e.motionDurationMid),{[`
|
|
350
|
+
${r}-enter,
|
|
351
|
+
${r}-appear
|
|
352
|
+
`]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},uO=new It("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),dO=new It("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),fO=new It("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),hO=new It("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),l6=new It("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),c6=new It("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),u6=new It("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),d6=new It("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),f6={"slide-up":{inKeyframes:uO,outKeyframes:dO},"slide-down":{inKeyframes:fO,outKeyframes:hO},"slide-left":{inKeyframes:l6,outKeyframes:c6},"slide-right":{inKeyframes:u6,outKeyframes:d6}},Yd=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=f6[t];return[Xd(r,o,i,e.motionDurationMid),{[`
|
|
353
|
+
${r}-enter,
|
|
354
|
+
${r}-appear
|
|
355
|
+
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},h6=new It("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),p6=new It("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),pO=new It("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),mO=new It("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),m6=new It("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),g6=new It("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),v6=new It("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),b6=new It("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),y6=new It("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),C6=new It("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),S6=new It("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),x6=new It("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),w6={zoom:{inKeyframes:h6,outKeyframes:p6},"zoom-big":{inKeyframes:pO,outKeyframes:mO},"zoom-big-fast":{inKeyframes:pO,outKeyframes:mO},"zoom-left":{inKeyframes:v6,outKeyframes:b6},"zoom-right":{inKeyframes:y6,outKeyframes:C6},"zoom-up":{inKeyframes:m6,outKeyframes:g6},"zoom-down":{inKeyframes:S6,outKeyframes:x6}},av=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=w6[t];return[Xd(r,o,i,t==="zoom-big-fast"?e.motionDurationFast:e.motionDurationMid),{[`
|
|
356
|
+
${r}-enter,
|
|
357
|
+
${r}-appear
|
|
358
|
+
`]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},E6=e=>{const{componentCls:t,contentBg:n,padding:r,headerBg:o,headerPadding:i,collapseHeaderPaddingSM:a,collapseHeaderPaddingLG:s,collapsePanelBorderRadius:l,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:h,colorTextDisabled:p,fontSizeLG:v,lineHeight:m,lineHeightLG:b,marginSM:y,paddingSM:C,paddingLG:x,paddingXS:S,motionDurationSlow:E,fontSizeIcon:$,contentPadding:O,fontHeight:k,fontHeightLG:M}=e,T=`${Q(c)} ${u} ${d}`;return{[t]:Object.assign(Object.assign({},Pn(e)),{backgroundColor:o,border:T,borderRadius:l,"&-rtl":{direction:"rtl"},[`& > ${t}-item`]:{borderBottom:T,"&:first-child":{[`
|
|
359
|
+
&,
|
|
360
|
+
& > ${t}-header`]:{borderRadius:`${Q(l)} ${Q(l)} 0 0`}},"&:last-child":{[`
|
|
361
|
+
&,
|
|
362
|
+
& > ${t}-header`]:{borderRadius:`0 0 ${Q(l)} ${Q(l)}`}},[`> ${t}-header`]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:i,color:h,lineHeight:m,cursor:"pointer",transition:`all ${E}, visibility 0s`},ba(e)),{[`> ${t}-header-text`]:{flex:"auto"},[`${t}-expand-icon`]:{height:k,display:"flex",alignItems:"center",paddingInlineEnd:y},[`${t}-arrow`]:Object.assign(Object.assign({},ys()),{fontSize:$,transition:`transform ${E}`,svg:{transition:`transform ${E}`}}),[`${t}-header-text`]:{marginInlineEnd:"auto"}}),[`${t}-collapsible-header`]:{cursor:"default",[`${t}-header-text`]:{flex:"none",cursor:"pointer"},[`${t}-expand-icon`]:{cursor:"pointer"}},[`${t}-collapsible-icon`]:{cursor:"unset",[`${t}-expand-icon`]:{cursor:"pointer"}}},[`${t}-content`]:{color:f,backgroundColor:n,borderTop:T,[`& > ${t}-content-box`]:{padding:O},"&-hidden":{display:"none"}},"&-small":{[`> ${t}-item`]:{[`> ${t}-header`]:{padding:a,paddingInlineStart:S,[`> ${t}-expand-icon`]:{marginInlineStart:e.calc(C).sub(S).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:C}}},"&-large":{[`> ${t}-item`]:{fontSize:v,lineHeight:b,[`> ${t}-header`]:{padding:s,paddingInlineStart:r,[`> ${t}-expand-icon`]:{height:M,marginInlineStart:e.calc(x).sub(r).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:x}}},[`${t}-item:last-child`]:{borderBottom:0,[`> ${t}-content`]:{borderRadius:`0 0 ${Q(l)} ${Q(l)}`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:p,cursor:"not-allowed"}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},$6=e=>{const{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow`;return{[`${t}-rtl`]:{[n]:{transform:"rotate(180deg)"}}}},O6=e=>{const{componentCls:t,headerBg:n,borderlessContentPadding:r,borderlessContentBg:o,colorBorder:i}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${i}`},[`
|
|
363
|
+
> ${t}-item:last-child,
|
|
364
|
+
> ${t}-item:last-child ${t}-header
|
|
365
|
+
`]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:o,borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{padding:r}}}},k6=e=>{const{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:"transparent",border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:"transparent",border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},M6=gn("Collapse",e=>{const t=Dt(e,{collapseHeaderPaddingSM:`${Q(e.paddingXS)} ${Q(e.paddingSM)}`,collapseHeaderPaddingLG:`${Q(e.padding)} ${Q(e.paddingLG)}`,collapsePanelBorderRadius:e.borderRadiusLG});return[E6(t),O6(t),k6(t),$6(t),sO(t)]},e=>({headerPadding:`${e.paddingSM}px ${e.padding}px`,headerBg:e.colorFillAlter,contentPadding:`${e.padding}px 16px`,contentBg:e.colorBgContainer,borderlessContentPadding:`${e.paddingXXS}px 16px ${e.padding}px`,borderlessContentBg:"transparent"}));var sv={};const gO=g.forwardRef((e,t)=>{const{getPrefixCls:n,direction:r,expandIcon:o,className:i,style:a}=xr("collapse"),{prefixCls:s,className:l,rootClassName:c,style:u,bordered:d=!0,ghost:f,size:h,expandIconPosition:p="start",children:v,destroyInactivePanel:m,destroyOnHidden:b,expandIcon:y}=e,C=Wr(P=>{var A;return(A=h??P)!==null&&A!==void 0?A:"middle"}),x=n("collapse",s),S=n(),[E,$,O]=M6(x);if(sv.NODE_ENV!=="production"){const P=Wt("Collapse");sv.NODE_ENV!=="production"&&P(p!=="left"&&p!=="right","deprecated","`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead."),P.deprecated(!("destroyInactivePanel"in e),"destroyInactivePanel","destroyOnHidden")}const k=g.useMemo(()=>p==="left"?"start":p==="right"?"end":p,[p]),M=y??o,T=g.useCallback((P={})=>{const A=typeof M=="function"?M(P):g.createElement(oO,{rotate:P.isActive?r==="rtl"?-90:90:void 0,"aria-label":P.isActive?"expanded":"collapsed"});return Io(A,()=>{var _;return{className:J((_=A.props)===null||_===void 0?void 0:_.className,`${x}-arrow`)}})},[M,x,r]),I=J(`${x}-icon-position-${k}`,{[`${x}-borderless`]:!d,[`${x}-rtl`]:r==="rtl",[`${x}-ghost`]:!!f,[`${x}-${C}`]:C!=="middle"},i,l,c,$,O),R=g.useMemo(()=>Object.assign(Object.assign({},z$(S)),{motionAppear:!1,leavedClassName:`${x}-content-hidden`}),[S,x]),N=g.useMemo(()=>v?oo(v).map((P,A)=>{var _,B;const F=P.props;if(F!=null&&F.disabled){const U=(_=P.key)!==null&&_!==void 0?_:String(A),K=Object.assign(Object.assign({},nr(P.props,["disabled"])),{key:U,collapsible:(B=F.collapsible)!==null&&B!==void 0?B:"disabled"});return Io(P,K)}return P}):null,[v]);return E(g.createElement(iv,Object.assign({ref:t,openMotion:R},nr(e,["rootClassName"]),{expandIcon:T,prefixCls:x,className:I,style:Object.assign(Object.assign({},a),u),destroyInactivePanel:b??m}),N))});sv.NODE_ENV!=="production"&&(gO.displayName="Collapse");const N6=Object.assign(gO,{Panel:G4}),Xn=e=>e instanceof $r?e:new $r(e),Jd=e=>Math.round(Number(e||0)),lv=e=>Jd(e.toHsb().a*100),Qd=(e,t)=>{const n=e.toRgb();if(!n.r&&!n.g&&!n.b){const r=e.toHsb();return r.a=1,Xn(r)}return n.a=1,Xn(n)},vO=(e,t)=>{const n=[{percent:0,color:e[0].color}].concat(de(e),[{percent:100,color:e[e.length-1].color}]);for(let r=0;r<n.length-1;r+=1){const o=n[r].percent,i=n[r+1].percent,a=n[r].color,s=n[r+1].color;if(o<=t&&t<=i){const l=i-o;if(l===0)return a;const c=(t-o)/l*100,u=new po(a),d=new po(s);return u.mix(d,c).toRgbString()}}return""},cv=e=>e.map(t=>(t.colors=t.colors.map(Xn),t)),bO=(e,t)=>{const{r:n,g:r,b:o,a:i}=e.toRgb(),a=new po(e.toRgbString()).onBackground(t).toHsv();return i<=.5?a.v>.5:n*.299+r*.587+o*.114>192},yO=(e,t)=>{var n;return`panel-${(n=e.key)!==null&&n!==void 0?n:t}`},T6=({prefixCls:e,presets:t,value:n,onChange:r})=>{const[o]=uo("ColorPicker"),[,i]=wr(),[a]=cn(cv(t),{value:cv(t),postState:cv}),s=`${e}-presets`,l=w.useMemo(()=>a.reduce((d,f,h)=>{const{defaultOpen:p=!0}=f;return p&&d.push(yO(f,h)),d},[]),[a]),c=d=>{r==null||r(d)},u=a.map((d,f)=>{var h;return{key:yO(d,f),label:w.createElement("div",{className:`${s}-label`},d==null?void 0:d.label),children:w.createElement("div",{className:`${s}-items`},Array.isArray(d==null?void 0:d.colors)&&((h=d.colors)===null||h===void 0?void 0:h.length)>0?d.colors.map((p,v)=>w.createElement(ov,{key:`preset-${v}-${p.toHexString()}`,color:Xn(p).toRgbString(),prefixCls:e,className:J(`${s}-color`,{[`${s}-color-checked`]:p.toHexString()===(n==null?void 0:n.toHexString()),[`${s}-color-bright`]:bO(p,i.colorBgElevated)}),onClick:()=>c(p)})):w.createElement("span",{className:`${s}-empty`},o.presetEmpty))}});return w.createElement("div",{className:s},w.createElement(N6,{defaultActiveKey:l,ghost:!0,items:u}))},CO=e=>{const{paddingInline:t,onlyIconSize:n}=e;return Dt(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},SO=e=>{var t,n,r,o,i,a;const s=(t=e.contentFontSize)!==null&&t!==void 0?t:e.fontSize,l=(n=e.contentFontSizeSM)!==null&&n!==void 0?n:e.fontSize,c=(r=e.contentFontSizeLG)!==null&&r!==void 0?r:e.fontSizeLG,u=(o=e.contentLineHeight)!==null&&o!==void 0?o:Pd(s),d=(i=e.contentLineHeightSM)!==null&&i!==void 0?i:Pd(l),f=(a=e.contentLineHeightLG)!==null&&a!==void 0?a:Pd(c),h=bO(new $r(e.colorBgSolid),"#fff")?"#000":"#fff",p=Li.reduce((v,m)=>Object.assign(Object.assign({},v),{[`${m}ShadowColor`]:`0 ${Q(e.controlOutlineWidth)} 0 ${ql(e[`${m}1`],e.colorBgContainer)}`}),{});return Object.assign(Object.assign({},p),{fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:h,contentFontSize:s,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((e.controlHeight-s*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*d)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-c*f)/2-e.lineWidth,0)})},I6=e=>{const{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:o,motionDurationSlow:i,motionEaseInOut:a,iconGap:s,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:s,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Q(e.lineWidth)} ${e.lineType} transparent`,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},[`${t}-icon > svg`]:ys(),"> a":{color:"currentColor"},"&:not(:disabled)":ba(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:"none"}},[`&${t}-loading`]:{opacity:o,cursor:"default"},[`${t}-loading-icon`]:{transition:["width","opacity","margin"].map(c=>`${c} ${i} ${a}`).join(",")},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(s).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(s).mul(-1).equal()}}}}}},xO=(e,t,n)=>({[`&:not(:disabled):not(${e}-disabled)`]:{"&:hover":t,"&:active":n}}),P6=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),A6=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),Zd=(e,t,n,r,o,i,a,s)=>({[`&${e}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},xO(e,Object.assign({background:t},a),Object.assign({background:t},s))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:i||void 0}})}),R6=e=>({[`&:disabled, &${e.componentCls}-disabled`]:Object.assign({},A6(e))}),_6=e=>({[`&:disabled, &${e.componentCls}-disabled`]:{cursor:"not-allowed",color:e.colorTextDisabled}}),ef=(e,t,n,r)=>{const i=r&&["link","text"].includes(r)?_6:R6;return Object.assign(Object.assign({},i(e)),xO(e.componentCls,t,n))},tf=(e,t,n,r,o)=>({[`&${e.componentCls}-variant-solid`]:Object.assign({color:t,background:n},ef(e,r,o))}),nf=(e,t,n,r,o)=>({[`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]:Object.assign({borderColor:t,background:n},ef(e,r,o))}),rf=e=>({[`&${e.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),of=(e,t,n,r)=>({[`&${e.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:t},ef(e,n,r))}),Ao=(e,t,n,r,o)=>({[`&${e.componentCls}-variant-${n}`]:Object.assign({color:t,boxShadow:"none"},ef(e,r,o,n))}),D6=e=>{const{componentCls:t}=e;return Li.reduce((n,r)=>{const o=e[`${r}6`],i=e[`${r}1`],a=e[`${r}5`],s=e[`${r}2`],l=e[`${r}3`],c=e[`${r}7`];return Object.assign(Object.assign({},n),{[`&${t}-color-${r}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:o,boxShadow:e[`${r}ShadowColor`]},tf(e,e.colorTextLightSolid,o,{background:a},{background:c})),nf(e,o,e.colorBgContainer,{color:a,borderColor:a,background:e.colorBgContainer},{color:c,borderColor:c,background:e.colorBgContainer})),rf(e)),of(e,i,{color:o,background:s},{color:o,background:l})),Ao(e,o,"link",{color:a},{color:c})),Ao(e,o,"text",{color:a,background:i},{color:c,background:l}))})},{})},L6=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},tf(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),rf(e)),of(e,e.colorFillTertiary,{color:e.defaultColor,background:e.colorFillSecondary},{color:e.defaultColor,background:e.colorFill})),Zd(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),Ao(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),j6=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},nf(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),rf(e)),of(e,e.colorPrimaryBg,{color:e.colorPrimary,background:e.colorPrimaryBgHover},{color:e.colorPrimary,background:e.colorPrimaryBorder})),Ao(e,e.colorPrimaryText,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),Ao(e,e.colorPrimaryText,"link",{color:e.colorPrimaryTextHover,background:e.linkHoverBg},{color:e.colorPrimaryTextActive})),Zd(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),z6=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},tf(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),nf(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),rf(e)),of(e,e.colorErrorBg,{color:e.colorError,background:e.colorErrorBgFilledHover},{color:e.colorError,background:e.colorErrorBgActive})),Ao(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),Ao(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),Zd(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),B6=e=>Object.assign(Object.assign({},Ao(e,e.colorLink,"link",{color:e.colorLinkHover},{color:e.colorLinkActive})),Zd(e.componentCls,e.ghostBg,e.colorInfo,e.colorInfo,e.colorTextDisabled,e.colorBorder,{color:e.colorInfoHover,borderColor:e.colorInfoHover},{color:e.colorInfoActive,borderColor:e.colorInfoActive})),F6=e=>{const{componentCls:t}=e;return Object.assign({[`${t}-color-default`]:L6(e),[`${t}-color-primary`]:j6(e),[`${t}-color-dangerous`]:z6(e),[`${t}-color-link`]:B6(e)},D6(e))},H6=e=>Object.assign(Object.assign(Object.assign(Object.assign({},nf(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),Ao(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),tf(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),Ao(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),uv=(e,t="")=>{const{componentCls:n,controlHeight:r,fontSize:o,borderRadius:i,buttonPaddingHorizontal:a,iconCls:s,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=e;return[{[t]:{fontSize:o,height:r,padding:`${Q(l)} ${Q(a)}`,borderRadius:i,[`&${n}-icon-only`]:{width:r,[s]:{fontSize:c}}}},{[`${n}${n}-circle${t}`]:P6(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},V6=e=>{const t=Dt(e,{fontSize:e.contentFontSize});return uv(t,e.componentCls)},W6=e=>{const t=Dt(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM});return uv(t,`${e.componentCls}-sm`)},U6=e=>{const t=Dt(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG});return uv(t,`${e.componentCls}-lg`)},q6=e=>{const{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:"100%"}}}},K6=gn("Button",e=>{const t=CO(e);return[I6(t),V6(t),W6(t),U6(t),q6(t),F6(t),H6(t),x4(t)]},SO,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function G6(e,t,n,r){const{focusElCls:o,focus:i,borderElCls:a}=n,s=a?"> *":"",l=["hover",i?"focus":null,"active"].filter(Boolean).map(c=>`&:${c} ${s}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${r}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},o?{[`&${o}`]:{zIndex:3}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function X6(e,t,n){const{borderElCls:r}=n,o=r?`> ${r}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${o}, &${e}-sm ${o}, &${e}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${o}, &${e}-sm ${o}, &${e}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function Yl(e,t={focus:!0}){const{componentCls:n}=e,{componentCls:r}=t,o=r||n,i=`${o}-compact`;return{[i]:Object.assign(Object.assign({},G6(e,i,t,o)),X6(o,i,t))}}function Y6(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}}}function J6(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function Q6(e){const t=`${e.componentCls}-compact-vertical`;return{[t]:Object.assign(Object.assign({},Y6(e,t,e.componentCls)),J6(e.componentCls,t))}}const Z6=e=>{const{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:o}=e,i=o(r).mul(-1).equal(),a=s=>{const l=`${t}-compact${s?"-vertical":""}-item${t}-primary:not([disabled])`;return{[`${l} + ${l}::before`]:{position:"absolute",top:s?i:0,insetInlineStart:s?0:i,backgroundColor:n,content:'""',width:s?"100%":r,height:s?r:"100%"}}};return Object.assign(Object.assign({},a()),a(!0))},eW=_E(["Button","compact"],e=>{const t=CO(e);return[Yl(t),Q6(t),Z6(t)]},SO);var af={},tW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function nW(e){if(typeof e=="object"&&e){let t=e==null?void 0:e.delay;return t=!Number.isNaN(t)&&typeof t=="number"?t:0,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}const rW={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},mo=w.forwardRef((e,t)=>{var n,r;const{loading:o=!1,prefixCls:i,color:a,variant:s,type:l,danger:c=!1,shape:u,size:d,styles:f,disabled:h,className:p,rootClassName:v,children:m,icon:b,iconPosition:y="start",ghost:C=!1,block:x=!1,htmlType:S="button",classNames:E,style:$={},autoInsertSpace:O,autoFocus:k}=e,M=tW(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),T=l||"default",{button:I}=w.useContext(wt),R=u||(I==null?void 0:I.shape)||"default",[N,P]=w.useMemo(()=>{if(a&&s)return[a,s];if(l||c){const xe=rW[T]||[];return c?["danger",xe[1]]:xe}return I!=null&&I.color&&(I!=null&&I.variant)?[I.color,I.variant]:["default","outlined"]},[a,s,l,c,I==null?void 0:I.color,I==null?void 0:I.variant,T]),_=N==="danger"?"dangerous":N,{getPrefixCls:B,direction:F,autoInsertSpace:U,className:K,style:j,classNames:D,styles:H}=xr("button"),W=(n=O??U)!==null&&n!==void 0?n:!0,q=B("btn",i),[te,G,re]=K6(q),oe=w.useContext(Hr),ne=h??oe,Z=w.useContext(W$),ae=w.useMemo(()=>nW(o),[o]),[ie,X]=w.useState(ae.loading),[ee,le]=w.useState(!1),ce=w.useRef(null),ue=Pi(t,ce),ge=w.Children.count(m)===1&&!b&&!Gd(P),ye=w.useRef(!0);w.useEffect(()=>(ye.current=!1,()=>{ye.current=!0}),[]),Yt(()=>{let xe=null;ae.delay>0?xe=setTimeout(()=>{xe=null,X(!0)},ae.delay):X(ae.loading);function tt(){xe&&(clearTimeout(xe),xe=null)}return tt},[ae.delay,ae.loading]),w.useEffect(()=>{if(!ce.current||!W)return;const xe=ce.current.textContent||"";ge&&ev(xe)?ee||le(!0):ee&&le(!1)}),w.useEffect(()=>{k&&ce.current&&ce.current.focus()},[]);const $e=w.useCallback(xe=>{var tt;if(ie||ne){xe.preventDefault();return}(tt=e.onClick)===null||tt===void 0||tt.call(e,("href"in e,xe))},[e.onClick,ie,ne]);if(af.NODE_ENV!=="production"){const xe=Wt("Button");af.NODE_ENV!=="production"&&xe(!(typeof b=="string"&&b.length>2),"breaking",`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${b}\` at https://ant.design/components/icon`),af.NODE_ENV!=="production"&&xe(!(C&&Gd(P)),"usage","`link` or `text` button can't be a `ghost` button.")}const{compactSize:Ce,compactItemClassnames:se}=Ca(q,F),Se={large:"lg",small:"sm",middle:void 0},ze=Wr(xe=>{var tt,pt;return(pt=(tt=d??Ce)!==null&&tt!==void 0?tt:Z)!==null&&pt!==void 0?pt:xe}),Ge=ze&&(r=Se[ze])!==null&&r!==void 0?r:"",Pe=ie?"loading":b,Oe=nr(M,["navigate"]),qe=J(q,G,re,{[`${q}-${R}`]:R!=="default"&&R,[`${q}-${T}`]:T,[`${q}-dangerous`]:c,[`${q}-color-${_}`]:_,[`${q}-variant-${P}`]:P,[`${q}-${Ge}`]:Ge,[`${q}-icon-only`]:!m&&m!==0&&!!Pe,[`${q}-background-ghost`]:C&&!Gd(P),[`${q}-loading`]:ie,[`${q}-two-chinese-chars`]:ee&&W&&!ie,[`${q}-block`]:x,[`${q}-rtl`]:F==="rtl",[`${q}-icon-end`]:y==="end"},se,p,v,K),Ne=Object.assign(Object.assign({},j),$),Fe=J(E==null?void 0:E.icon,D.icon),Ae=Object.assign(Object.assign({},(f==null?void 0:f.icon)||{}),H.icon||{}),ke=xe=>w.createElement(G$,{prefixCls:q,className:Fe,style:Ae},xe),Xe=()=>w.createElement(S4,{existIcon:!!b,prefixCls:q,loading:ie,mount:ye.current});let pe;b&&!ie?pe=ke(b):o&&typeof o=="object"&&o.icon?pe=ke(o.icon):pe=Xe();const ve=m||m===0?C4(m,ge&&W):null;if(Oe.href!==void 0)return te(w.createElement("a",Object.assign({},Oe,{className:J(qe,{[`${q}-disabled`]:ne}),href:ne?void 0:Oe.href,style:Ne,onClick:$e,ref:ue,tabIndex:ne?-1:0,"aria-disabled":ne}),pe,ve));let Ve=w.createElement("button",Object.assign({},M,{type:S,className:qe,style:Ne,onClick:$e,disabled:ne,ref:ue}),pe,ve,se&&w.createElement(eW,{prefixCls:q}));return Gd(P)||(Ve=w.createElement(F$,{component:"Button",disabled:ie},Ve)),te(Ve)});mo.Group=b4,mo.__ANT_BUTTON=!0,af.NODE_ENV!=="production"&&(mo.displayName="Button");const dv=e=>typeof(e==null?void 0:e.then)=="function",wO=e=>{const{type:t,children:n,prefixCls:r,buttonProps:o,close:i,autoFocus:a,emitEvent:s,isSilent:l,quitOnNullishReturnValue:c,actionFn:u}=e,d=g.useRef(!1),f=g.useRef(null),[h,p]=bs(!1),v=(...y)=>{i==null||i.apply(void 0,y)};g.useEffect(()=>{let y=null;return a&&(y=setTimeout(()=>{var C;(C=f.current)===null||C===void 0||C.focus({preventScroll:!0})})),()=>{y&&clearTimeout(y)}},[a]);const m=y=>{dv(y)&&(p(!0),y.then((...C)=>{p(!1,!0),v.apply(void 0,C),d.current=!1},C=>{if(p(!1,!0),d.current=!1,!(l!=null&&l()))return Promise.reject(C)}))},b=y=>{if(d.current)return;if(d.current=!0,!u){v();return}let C;if(s){if(C=u(y),c&&!dv(C)){d.current=!1,v(y);return}}else if(u.length)C=u(i),d.current=!1;else if(C=u(),!dv(C)){v();return}m(C)};return g.createElement(mo,Object.assign({},q$(t),{onClick:b,loading:h,prefixCls:r},o,{ref:f}),n)},Jl=w.createContext({}),{Provider:EO}=Jl,$O=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:n,isSilent:r,mergedOkCancel:o,rootPrefixCls:i,close:a,onCancel:s,onConfirm:l}=w.useContext(Jl);return o?w.createElement(wO,{isSilent:r,actionFn:s,close:(...c)=>{a==null||a.apply(void 0,c),l==null||l(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${i}-btn`},n):null},OO=()=>{const{autoFocusButton:e,close:t,isSilent:n,okButtonProps:r,rootPrefixCls:o,okTextLocale:i,okType:a,onConfirm:s,onOk:l}=w.useContext(Jl);return w.createElement(wO,{isSilent:n,type:a||"primary",actionFn:l,close:(...c)=>{t==null||t.apply(void 0,c),s==null||s(!0)},autoFocus:e==="ok",buttonProps:r,prefixCls:`${o}-btn`},i)};var kO=g.createContext(null),oW={},MO=[];function iW(e,t){var n=g.useState(function(){if(!Gn())return null;var p=document.createElement("div");return oW.NODE_ENV!=="production"&&t&&p.setAttribute("data-debug",t),p}),r=Y(n,1),o=r[0],i=g.useRef(!1),a=g.useContext(kO),s=g.useState(MO),l=Y(s,2),c=l[0],u=l[1],d=a||(i.current?void 0:function(p){u(function(v){var m=[p].concat(de(v));return m})});function f(){o.parentElement||document.body.appendChild(o),i.current=!0}function h(){var p;(p=o.parentElement)===null||p===void 0||p.removeChild(o),i.current=!1}return Yt(function(){return e?a?a(f):f():h(),h},[e]),Yt(function(){c.length&&(c.forEach(function(p){return p()}),u(MO))},[c]),[o,d]}function aW(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var o,i;if(e){var a=getComputedStyle(e);r.scrollbarColor=a.scrollbarColor,r.scrollbarWidth=a.scrollbarWidth;var s=getComputedStyle(e,"::-webkit-scrollbar"),l=parseInt(s.width,10),c=parseInt(s.height,10);try{var u=l?"width: ".concat(s.width,";"):"",d=c?"height: ".concat(s.height,";"):"";ti(`
|
|
366
|
+
#`.concat(t,`::-webkit-scrollbar {
|
|
367
|
+
`).concat(u,`
|
|
368
|
+
`).concat(d,`
|
|
369
|
+
}`),t)}catch(p){console.error(p),o=l,i=c}}document.body.appendChild(n);var f=e&&o&&!isNaN(o)?o:n.offsetWidth-n.clientWidth,h=e&&i&&!isNaN(i)?i:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),Dl(t),{width:f,height:h}}function sW(e){return typeof document>"u"||!e||!(e instanceof Element)?{width:0,height:0}:aW(e)}function lW(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var cW="rc-util-locker-".concat(Date.now()),NO=0;function uW(e){var t=!!e,n=g.useState(function(){return NO+=1,"".concat(cW,"_").concat(NO)}),r=Y(n,1),o=r[0];Yt(function(){if(t){var i=sW(document.body).width,a=lW();ti(`
|
|
370
|
+
html body {
|
|
371
|
+
overflow-y: hidden;
|
|
372
|
+
`.concat(a?"width: calc(100% - ".concat(i,"px);"):"",`
|
|
373
|
+
}`),o)}else Dl(o);return function(){Dl(o)}},[t,o])}var dW=!1;function fW(e){return dW}var TO={},IO=function(t){return t===!1?!1:!Gn()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},sf=g.forwardRef(function(e,t){var n=e.open,r=e.autoLock,o=e.getContainer,i=e.debug,a=e.autoDestroy,s=a===void 0?!0:a,l=e.children,c=g.useState(n),u=Y(c,2),d=u[0],f=u[1],h=d||n;TO.NODE_ENV!=="production"&&ft(Gn()||!n,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),g.useEffect(function(){(s||n)&&f(n)},[n,s]);var p=g.useState(function(){return IO(o)}),v=Y(p,2),m=v[0],b=v[1];g.useEffect(function(){var I=IO(o);b(I??null)});var y=iW(h&&!m,i),C=Y(y,2),x=C[0],S=C[1],E=m??x;uW(r&&n&&Gn()&&(E===x||E===document.body));var $=null;if(l&&pa(l)&&t){var O=l;$=O.ref}var k=Pi($,t);if(!h||!Gn()||m===void 0)return null;var M=E===!1||fW(),T=l;return t&&(T=g.cloneElement(l,{ref:k})),g.createElement(kO.Provider,{value:S},M?T:En.createPortal(T,E))});TO.NODE_ENV!=="production"&&(sf.displayName="Portal");var PO=g.createContext({}),AO={};function hW(){var e=V({},g);return e.useId}var RO=0,_O=hW();const lf=_O?(function(t){var n=_O();return t||(AO.NODE_ENV==="test"?"test-id":n)}):(function(t){var n=g.useState("ssr-id"),r=Y(n,2),o=r[0],i=r[1];return g.useEffect(function(){var a=RO;RO+=1,i("rc_unique_".concat(a))},[]),t||(AO.NODE_ENV==="test"?"test-id":o)});function DO(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function LO(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if(typeof n!="number"){var o=e.document;n=o.documentElement[r],typeof n!="number"&&(n=o.body[r])}return n}function pW(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,o=r.defaultView||r.parentWindow;return n.left+=LO(o),n.top+=LO(o,!0),n}const mW=g.memo(function(e){var t=e.children;return t},function(e,t){var n=t.shouldUpdate;return!n});var gW={},vW={width:0,height:0,overflow:"hidden",outline:"none"},bW={outline:"none"},fv=w.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,o=e.style,i=e.title,a=e.ariaId,s=e.footer,l=e.closable,c=e.closeIcon,u=e.onClose,d=e.children,f=e.bodyStyle,h=e.bodyProps,p=e.modalRender,v=e.onMouseDown,m=e.onMouseUp,b=e.holderRef,y=e.visible,C=e.forceRender,x=e.width,S=e.height,E=e.classNames,$=e.styles,O=w.useContext(PO),k=O.panel,M=Pi(b,k),T=w.useRef(),I=w.useRef();w.useImperativeHandle(t,function(){return{focus:function(){var j;(j=T.current)===null||j===void 0||j.focus({preventScroll:!0})},changeActive:function(j){var D=document,H=D.activeElement;j&&H===I.current?T.current.focus({preventScroll:!0}):!j&&H===T.current&&I.current.focus({preventScroll:!0})}}});var R={};x!==void 0&&(R.width=x),S!==void 0&&(R.height=S);var N=s?w.createElement("div",{className:J("".concat(n,"-footer"),E==null?void 0:E.footer),style:V({},$==null?void 0:$.footer)},s):null,P=i?w.createElement("div",{className:J("".concat(n,"-header"),E==null?void 0:E.header),style:V({},$==null?void 0:$.header)},w.createElement("div",{className:"".concat(n,"-title"),id:a},i)):null,A=w.useMemo(function(){return Ue(l)==="object"&&l!==null?l:l?{closeIcon:c??w.createElement("span",{className:"".concat(n,"-close-x")})}:{}},[l,c,n]),_=Vr(A,!0),B=Ue(l)==="object"&&l.disabled,F=l?w.createElement("button",he({type:"button",onClick:u,"aria-label":"Close"},_,{className:"".concat(n,"-close"),disabled:B}),A.closeIcon):null,U=w.createElement("div",{className:J("".concat(n,"-content"),E==null?void 0:E.content),style:$==null?void 0:$.content},F,P,w.createElement("div",he({className:J("".concat(n,"-body"),E==null?void 0:E.body),style:V(V({},f),$==null?void 0:$.body)},h),d),N);return w.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":i?a:null,"aria-modal":"true",ref:M,style:V(V({},o),R),className:J(n,r),onMouseDown:v,onMouseUp:m},w.createElement("div",{ref:T,tabIndex:0,style:bW},w.createElement(mW,{shouldUpdate:y||C},p?p(U):U)),w.createElement("div",{tabIndex:0,ref:I,style:vW}))});gW.NODE_ENV!=="production"&&(fv.displayName="Panel");var jO=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,o=e.style,i=e.className,a=e.visible,s=e.forceRender,l=e.destroyOnClose,c=e.motionName,u=e.ariaId,d=e.onVisibleChanged,f=e.mousePosition,h=w.useRef(),p=g.useState(),v=Y(p,2),m=v[0],b=v[1],y={};m&&(y.transformOrigin=m);function C(){var x=pW(h.current);b(f&&(f.x||f.y)?"".concat(f.x-x.left,"px ").concat(f.y-x.top,"px"):"")}return g.createElement(Er,{visible:a,onVisibleChanged:d,onAppearPrepare:C,onEnterPrepare:C,forceRender:s,motionName:c,removeOnLeave:l,ref:h},function(x,S){var E=x.className,$=x.style;return g.createElement(fv,he({},e,{ref:t,title:r,ariaId:u,prefixCls:n,holderRef:S,style:V(V(V({},$),o),y),className:J(i,E)}))})});jO.displayName="Content";var yW=function(t){var n=t.prefixCls,r=t.style,o=t.visible,i=t.maskProps,a=t.motionName,s=t.className;return g.createElement(Er,{key:"mask",visible:o,motionName:a,leavedClassName:"".concat(n,"-mask-hidden")},function(l,c){var u=l.className,d=l.style;return g.createElement("div",he({ref:c,style:V(V({},d),r),className:J("".concat(n,"-mask"),u,s)},i))})},CW={},SW=function(t){var n=t.prefixCls,r=n===void 0?"rc-dialog":n,o=t.zIndex,i=t.visible,a=i===void 0?!1:i,s=t.keyboard,l=s===void 0?!0:s,c=t.focusTriggerAfterClose,u=c===void 0?!0:c,d=t.wrapStyle,f=t.wrapClassName,h=t.wrapProps,p=t.onClose,v=t.afterOpenChange,m=t.afterClose,b=t.transitionName,y=t.animation,C=t.closable,x=C===void 0?!0:C,S=t.mask,E=S===void 0?!0:S,$=t.maskTransitionName,O=t.maskAnimation,k=t.maskClosable,M=k===void 0?!0:k,T=t.maskStyle,I=t.maskProps,R=t.rootClassName,N=t.classNames,P=t.styles;CW.NODE_ENV!=="production"&&(["wrapStyle","bodyStyle","maskStyle"].forEach(function(X){Mo(!(X in t),"".concat(X," is deprecated, please use styles instead."))}),"wrapClassName"in t&&Mo(!1,"wrapClassName is deprecated, please use classNames instead."));var A=w.useRef(),_=w.useRef(),B=w.useRef(),F=g.useState(a),U=Y(F,2),K=U[0],j=U[1],D=lf();function H(){Wm(_.current,document.activeElement)||(A.current=document.activeElement)}function W(){if(!Wm(_.current,document.activeElement)){var X;(X=B.current)===null||X===void 0||X.focus()}}function q(X){if(X)W();else{if(j(!1),E&&A.current&&u){try{A.current.focus({preventScroll:!0})}catch{}A.current=null}K&&(m==null||m())}v==null||v(X)}function te(X){p==null||p(X)}var G=w.useRef(!1),re=w.useRef(),oe=function(){clearTimeout(re.current),G.current=!0},ne=function(){re.current=setTimeout(function(){G.current=!1})},Z=null;M&&(Z=function(ee){G.current?G.current=!1:_.current===ee.target&&te(ee)});function ae(X){if(l&&X.keyCode===Le.ESC){X.stopPropagation(),te(X);return}a&&X.keyCode===Le.TAB&&B.current.changeActive(!X.shiftKey)}w.useEffect(function(){a&&(j(!0),H())},[a]),w.useEffect(function(){return function(){clearTimeout(re.current)}},[]);var ie=V(V(V({zIndex:o},d),P==null?void 0:P.wrapper),{},{display:K?null:"none"});return g.createElement("div",he({className:J("".concat(r,"-root"),R)},Vr(t,{data:!0})),g.createElement(yW,{prefixCls:r,visible:E&&a,motionName:DO(r,$,O),style:V(V({zIndex:o},T),P==null?void 0:P.mask),maskProps:I,className:N==null?void 0:N.mask}),g.createElement("div",he({tabIndex:-1,onKeyDown:ae,className:J("".concat(r,"-wrap"),f,N==null?void 0:N.wrapper),ref:_,onClick:Z,style:ie},h),g.createElement(jO,he({},t,{onMouseDown:oe,onMouseUp:ne,ref:B,closable:x,ariaId:D,prefixCls:r,visible:a&&K,onClose:te,onVisibleChanged:q,motionName:DO(r,b,y)}))))},zO=function(t){var n=t.visible,r=t.getContainer,o=t.forceRender,i=t.destroyOnClose,a=i===void 0?!1:i,s=t.afterClose,l=t.panelRef,c=g.useState(n),u=Y(c,2),d=u[0],f=u[1],h=g.useMemo(function(){return{panel:l}},[l]);return g.useEffect(function(){n&&f(!0)},[n]),!o&&a&&!d?null:g.createElement(PO.Provider,{value:h},g.createElement(sf,{open:n||o||d,autoDestroy:!1,getContainer:r,autoLock:n||d},g.createElement(SW,he({},t,{destroyOnClose:a,afterClose:function(){s==null||s(),f(!1)}}))))};zO.displayName="Dialog";var Sa="RC_FORM_INTERNAL_HOOKS",tn=function(){ft(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Os=g.createContext({getFieldValue:tn,getFieldsValue:tn,getFieldError:tn,getFieldWarning:tn,getFieldsError:tn,isFieldsTouched:tn,isFieldTouched:tn,isFieldValidating:tn,isFieldsValidating:tn,resetFields:tn,setFields:tn,setFieldValue:tn,setFieldsValue:tn,validateFields:tn,submit:tn,getInternalHooks:function(){return tn(),{dispatch:tn,initEntityValue:tn,registerField:tn,useSubscribe:tn,setInitialValues:tn,destroyForm:tn,setCallbacks:tn,registerWatch:tn,getFields:tn,setValidateMessages:tn,setPreserve:tn,getInitialValue:tn}}}),cf=g.createContext(null);function hv(e){return e==null?[]:Array.isArray(e)?e:[e]}function xW(e){return e&&!!e._init}function pv(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var mv=pv();function wW(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function EW(e,t,n){if(Fm())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Al(o,n.prototype),o}function gv(e){var t=typeof Map=="function"?new Map:void 0;return gv=function(r){if(r===null||!wW(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,o)}function o(){return EW(r,arguments,Rl(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Al(o,r)},gv(e)}var BO={},$W=/%[sdj%]/g,FO=function(){};typeof process<"u"&&BO&&BO.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(FO=function(t,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function vv(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Or(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var a=e.replace($W,function(s){if(s==="%%")return"%";if(o>=i)return s;switch(s){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch{return"[Circular]"}break;default:return s}});return a}return e}function OW(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function Rn(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||OW(t)&&typeof e=="string"&&!e)}function kW(e,t,n){var r=[],o=0,i=e.length;function a(s){r.push.apply(r,de(s||[])),o++,o===i&&n(r)}e.forEach(function(s){t(s,a)})}function HO(e,t,n){var r=0,o=e.length;function i(a){if(a&&a.length){n(a);return}var s=r;r=r+1,s<o?t(e[s],i):n([])}i([])}function MW(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,de(e[n]||[]))}),t}var VO=(function(e){io(n,e);var t=ao(n);function n(r,o){var i;return dn(this,n),i=t.call(this,"Async Validation Error"),z(ct(i),"errors",void 0),z(ct(i),"fields",void 0),i.errors=r,i.fields=o,i}return fn(n)})(gv(Error));function NW(e,t,n,r,o){if(t.first){var i=new Promise(function(f,h){var p=function(b){return r(b),b.length?h(new VO(b,vv(b))):f(o)},v=MW(e);HO(v,n,p)});return i.catch(function(f){return f}),i}var a=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),l=s.length,c=0,u=[],d=new Promise(function(f,h){var p=function(m){if(u.push.apply(u,m),c++,c===l)return r(u),u.length?h(new VO(u,vv(u))):f(o)};s.length||(r(u),f(o)),s.forEach(function(v){var m=e[v];a.indexOf(v)!==-1?HO(m,n,p):kW(m,n,p)})});return d.catch(function(f){return f}),d}function TW(e){return!!(e&&e.message!==void 0)}function IW(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function WO(e,t){return function(n){var r;return e.fullFields?r=IW(t,e.fullFields):r=t[n.field||e.fullField],TW(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function UO(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];Ue(r)==="object"&&Ue(e[n])==="object"?e[n]=V(V({},e[n]),r):e[n]=r}}return e}var ks="enum",PW=function(t,n,r,o,i){t[ks]=Array.isArray(t[ks])?t[ks]:[],t[ks].indexOf(n)===-1&&o.push(Or(i.messages[ks],t.fullField,t[ks].join(", ")))},AW=function(t,n,r,o,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||o.push(Or(i.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(n)||o.push(Or(i.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},RW=function(t,n,r,o,i){var a=typeof t.len=="number",s=typeof t.min=="number",l=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=n,d=null,f=typeof n=="number",h=typeof n=="string",p=Array.isArray(n);if(f?d="number":h?d="string":p&&(d="array"),!d)return!1;p&&(u=n.length),h&&(u=n.replace(c,"_").length),a?u!==t.len&&o.push(Or(i.messages[d].len,t.fullField,t.len)):s&&!l&&u<t.min?o.push(Or(i.messages[d].min,t.fullField,t.min)):l&&!s&&u>t.max?o.push(Or(i.messages[d].max,t.fullField,t.max)):s&&l&&(u<t.min||u>t.max)&&o.push(Or(i.messages[d].range,t.fullField,t.min,t.max))},qO=function(t,n,r,o,i,a){t.required&&(!r.hasOwnProperty(t.field)||Rn(n,a||t.type))&&o.push(Or(i.messages.required,t.fullField))},uf;const _W=(function(){if(uf)return uf;var e="[a-fA-F\\d:]",t=function(E){return E&&E.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],i="(?:%[0-9a-zA-Z]{1,})?",a="(?:".concat(o.join("|"),")").concat(i),s=new RegExp("(?:^".concat(n,"$)|(?:^").concat(a,"$)")),l=new RegExp("^".concat(n,"$")),c=new RegExp("^".concat(a,"$")),u=function(E){return E&&E.exact?s:new RegExp("(?:".concat(t(E)).concat(n).concat(t(E),")|(?:").concat(t(E)).concat(a).concat(t(E),")"),"g")};u.v4=function(S){return S&&S.exact?l:new RegExp("".concat(t(S)).concat(n).concat(t(S)),"g")},u.v6=function(S){return S&&S.exact?c:new RegExp("".concat(t(S)).concat(a).concat(t(S)),"g")};var d="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",h=u.v4().source,p=u.v6().source,v="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",m="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",b="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',x="(?:".concat(d,"|www\\.)").concat(f,"(?:localhost|").concat(h,"|").concat(p,"|").concat(v).concat(m).concat(b,")").concat(y).concat(C);return uf=new RegExp("(?:^".concat(x,"$)"),"i"),uf});var bv={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ql={integer:function(t){return Ql.number(t)&&parseInt(t,10)===t},float:function(t){return Ql.number(t)&&!Ql.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return Ue(t)==="object"&&!Ql.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(bv.email)},tel:function(t){return typeof t=="string"&&t.length<=32&&!!t.match(bv.tel)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(_W())},hex:function(t){return typeof t=="string"&&!!t.match(bv.hex)}},DW=function(t,n,r,o,i){if(t.required&&n===void 0){qO(t,n,r,o,i);return}var a=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],s=t.type;a.indexOf(s)>-1?Ql[s](n)||o.push(Or(i.messages.types[s],t.fullField,t.type)):s&&Ue(n)!==t.type&&o.push(Or(i.messages.types[s],t.fullField,t.type))},LW=function(t,n,r,o,i){(/^\s+$/.test(n)||n==="")&&o.push(Or(i.messages.whitespace,t.fullField))};const Pt={required:qO,whitespace:LW,type:DW,range:RW,enum:PW,pattern:AW};var jW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i)}r(a)},zW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(n==null&&!t.required)return r();Pt.required(t,n,o,a,i,"array"),n!=null&&(Pt.type(t,n,o,a,i),Pt.range(t,n,o,a,i))}r(a)},BW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&Pt.type(t,n,o,a,i)}r(a)},FW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n,"date")&&!t.required)return r();if(Pt.required(t,n,o,a,i),!Rn(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),Pt.type(t,l,o,a,i),l&&Pt.range(t,l.getTime(),o,a,i)}}r(a)},HW="enum",VW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&Pt[HW](t,n,o,a,i)}r(a)},WW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&(Pt.type(t,n,o,a,i),Pt.range(t,n,o,a,i))}r(a)},UW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&(Pt.type(t,n,o,a,i),Pt.range(t,n,o,a,i))}r(a)},qW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&Pt.type(t,n,o,a,i)}r(a)},KW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(n===""&&(n=void 0),Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&(Pt.type(t,n,o,a,i),Pt.range(t,n,o,a,i))}r(a)},GW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),n!==void 0&&Pt.type(t,n,o,a,i)}r(a)},XW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n,"string")&&!t.required)return r();Pt.required(t,n,o,a,i),Rn(n,"string")||Pt.pattern(t,n,o,a,i)}r(a)},YW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n)&&!t.required)return r();Pt.required(t,n,o,a,i),Rn(n)||Pt.type(t,n,o,a,i)}r(a)},JW=function(t,n,r,o,i){var a=[],s=Array.isArray(n)?"array":Ue(n);Pt.required(t,n,o,a,i,s),r(a)},QW=function(t,n,r,o,i){var a=[],s=t.required||!t.required&&o.hasOwnProperty(t.field);if(s){if(Rn(n,"string")&&!t.required)return r();Pt.required(t,n,o,a,i,"string"),Rn(n,"string")||(Pt.type(t,n,o,a,i),Pt.range(t,n,o,a,i),Pt.pattern(t,n,o,a,i),t.whitespace===!0&&Pt.whitespace(t,n,o,a,i))}r(a)},df=function(t,n,r,o,i){var a=t.type,s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Rn(n,a)&&!t.required)return r();Pt.required(t,n,o,s,i,a),Rn(n,a)||Pt.type(t,n,o,s,i)}r(s)};const Zl={string:QW,method:qW,number:KW,boolean:BW,regexp:YW,integer:UW,float:WW,array:zW,object:GW,enum:VW,pattern:XW,date:FW,url:df,hex:df,email:df,tel:df,required:JW,any:jW};var ec=(function(){function e(t){dn(this,e),z(this,"rules",null),z(this,"_messages",mv),this.define(t)}return fn(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(Ue(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var i=n[o];r.rules[o]=Array.isArray(i)?i:[i]})}},{key:"messages",value:function(n){return n&&(this._messages=UO(pv(),n)),this._messages}},{key:"validate",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},a=n,s=o,l=i;if(typeof s=="function"&&(l=s,s={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,a),Promise.resolve(a);function c(p){var v=[],m={};function b(C){if(Array.isArray(C)){var x;v=(x=v).concat.apply(x,de(C))}else v.push(C)}for(var y=0;y<p.length;y++)b(p[y]);v.length?(m=vv(v),l(v,m)):l(null,a)}if(s.messages){var u=this.messages();u===mv&&(u=pv()),UO(u,s.messages),s.messages=u}else s.messages=this.messages();var d={},f=s.keys||Object.keys(this.rules);f.forEach(function(p){var v=r.rules[p],m=a[p];v.forEach(function(b){var y=b;typeof y.transform=="function"&&(a===n&&(a=V({},a)),m=a[p]=y.transform(m),m!=null&&(y.type=y.type||(Array.isArray(m)?"array":Ue(m)))),typeof y=="function"?y={validator:y}:y=V({},y),y.validator=r.getValidationMethod(y),y.validator&&(y.field=p,y.fullField=y.fullField||p,y.type=r.getType(y),d[p]=d[p]||[],d[p].push({rule:y,value:m,source:a,field:p}))})});var h={};return NW(d,s,function(p,v){var m=p.rule,b=(m.type==="object"||m.type==="array")&&(Ue(m.fields)==="object"||Ue(m.defaultField)==="object");b=b&&(m.required||!m.required&&p.value),m.field=p.field;function y($,O){return V(V({},O),{},{fullField:"".concat(m.fullField,".").concat($),fullFields:m.fullFields?[].concat(de(m.fullFields),[$]):[$]})}function C(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],O=Array.isArray($)?$:[$];!s.suppressWarning&&O.length&&e.warning("async-validator:",O),O.length&&m.message!==void 0&&m.message!==null&&(O=[].concat(m.message));var k=O.map(WO(m,a));if(s.first&&k.length)return h[m.field]=1,v(k);if(!b)v(k);else{if(m.required&&!p.value)return m.message!==void 0?k=[].concat(m.message).map(WO(m,a)):s.error&&(k=[s.error(m,Or(s.messages.required,m.field))]),v(k);var M={};m.defaultField&&Object.keys(p.value).map(function(R){M[R]=m.defaultField}),M=V(V({},M),p.rule.fields);var T={};Object.keys(M).forEach(function(R){var N=M[R],P=Array.isArray(N)?N:[N];T[R]=P.map(y.bind(null,R))});var I=new e(T);I.messages(s.messages),p.rule.options&&(p.rule.options.messages=s.messages,p.rule.options.error=s.error),I.validate(p.value,p.rule.options||s,function(R){var N=[];k&&k.length&&N.push.apply(N,de(k)),R&&R.length&&N.push.apply(N,de(R)),v(N.length?N:null)})}}var x;if(m.asyncValidator)x=m.asyncValidator(m,p.value,C,p.source,s);else if(m.validator){try{x=m.validator(m,p.value,C,p.source,s)}catch($){var S,E;(S=(E=console).error)===null||S===void 0||S.call(E,$),s.suppressValidatorError||setTimeout(function(){throw $},0),C($.message)}x===!0?C():x===!1?C(typeof m.message=="function"?m.message(m.fullField||m.field):m.message||"".concat(m.fullField||m.field," fails")):x instanceof Array?C(x):x instanceof Error&&C(x.message)}x&&x.then&&x.then(function(){return C()},function($){return C($)})},function(p){c(p)},a)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Zl.hasOwnProperty(n.type))throw new Error(Or("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),o=r.indexOf("message");return o!==-1&&r.splice(o,1),r.length===1&&r[0]==="required"?Zl.required:Zl[this.getType(n)]||void 0}}]),e})();z(ec,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Zl[t]=n}),z(ec,"warning",FO),z(ec,"messages",mv),z(ec,"validators",Zl);var kr="'${name}' is not a valid ${type}",KO={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:kr,method:kr,array:kr,object:kr,number:kr,date:kr,boolean:kr,integer:kr,float:kr,regexp:kr,email:kr,url:kr,hex:kr},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},GO=ec;function ZW(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var XO="CODE_LOGIC_ERROR";function yv(e,t,n,r,o){return Cv.apply(this,arguments)}function Cv(){return Cv=lr(zt().mark(function e(t,n,r,o,i){var a,s,l,c,u,d,f,h,p;return zt().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return a=V({},r),delete a.ruleIndex,GO.warning=function(){},a.validator&&(s=a.validator,a.validator=function(){try{return s.apply(void 0,arguments)}catch(b){return console.error(b),Promise.reject(XO)}}),l=null,a&&a.type==="array"&&a.defaultField&&(l=a.defaultField,delete a.defaultField),c=new GO(z({},t,[a])),u=ps(KO,o.validateMessages),c.messages(u),d=[],m.prev=10,m.next=13,Promise.resolve(c.validate(z({},t,n),V({},o)));case 13:m.next=18;break;case 15:m.prev=15,m.t0=m.catch(10),m.t0.errors&&(d=m.t0.errors.map(function(b,y){var C=b.message,x=C===XO?u.default:C;return g.isValidElement(x)?g.cloneElement(x,{key:"error_".concat(y)}):x}));case 18:if(!(!d.length&&l&&Array.isArray(n)&&n.length>0)){m.next=23;break}return m.next=21,Promise.all(n.map(function(b,y){return yv("".concat(t,".").concat(y),b,l,o,i)}));case 21:return f=m.sent,m.abrupt("return",f.reduce(function(b,y){return[].concat(de(b),de(y))},[]));case 23:return h=V(V({},r),{},{name:t,enum:(r.enum||[]).join(", ")},i),p=d.map(function(b){return typeof b=="string"?ZW(b,h):b}),m.abrupt("return",p);case 26:case"end":return m.stop()}},e,null,[[10,15]])})),Cv.apply(this,arguments)}function e8(e,t,n,r,o,i){var a=e.join("."),s=n.map(function(u,d){var f=u.validator,h=V(V({},u),{},{ruleIndex:d});return f&&(h.validator=function(p,v,m){var b=!1,y=function(){for(var S=arguments.length,E=new Array(S),$=0;$<S;$++)E[$]=arguments[$];Promise.resolve().then(function(){ft(!b,"Your validator function has already return a promise. `callback` will be ignored."),b||m.apply(void 0,E)})},C=f(p,v,y);b=C&&typeof C.then=="function"&&typeof C.catch=="function",ft(b,"`callback` is deprecated. Please return a promise instead."),b&&C.then(function(){m()}).catch(function(x){m(x||" ")})}),h}).sort(function(u,d){var f=u.warningOnly,h=u.ruleIndex,p=d.warningOnly,v=d.ruleIndex;return!!f==!!p?h-v:f?1:-1}),l;if(o===!0)l=new Promise((function(){var u=lr(zt().mark(function d(f,h){var p,v,m;return zt().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:p=0;case 1:if(!(p<s.length)){y.next=12;break}return v=s[p],y.next=5,yv(a,t,v,r,i);case 5:if(m=y.sent,!m.length){y.next=9;break}return h([{errors:m,rule:v}]),y.abrupt("return");case 9:p+=1,y.next=1;break;case 12:f([]);case 13:case"end":return y.stop()}},d)}));return function(d,f){return u.apply(this,arguments)}})());else{var c=s.map(function(u){return yv(a,t,u,r,i).then(function(d){return{errors:d,rule:u}})});l=(o?n8(c):t8(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function t8(e){return Sv.apply(this,arguments)}function Sv(){return Sv=lr(zt().mark(function e(t){return zt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(o){var i,a=(i=[]).concat.apply(i,de(o));return a}));case 1:case"end":return r.stop()}},e)})),Sv.apply(this,arguments)}function n8(e){return xv.apply(this,arguments)}function xv(){return xv=lr(zt().mark(function e(t){var n;return zt().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=0,o.abrupt("return",new Promise(function(i){t.forEach(function(a){a.then(function(s){s.errors.length&&i([s]),n+=1,n===t.length&&i([])})})}));case 2:case"end":return o.stop()}},e)})),xv.apply(this,arguments)}function $n(e){return hv(e)}function YO(e,t){var n={};return t.forEach(function(r){var o=To(e,r);n=co(n,r,o)}),n}function Ms(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return JO(t,r,n)})}function JO(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,o){return e[o]===r})}function r8(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||Ue(e)!=="object"||Ue(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),o=new Set([].concat(n,r));return de(o).every(function(i){var a=e[i],s=t[i];return typeof a=="function"&&typeof s=="function"?!0:a===s})}function o8(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&Ue(t.target)==="object"&&e in t.target?t.target[e]:t}function QO(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var o=e[t],i=t-n;return i>0?[].concat(de(e.slice(0,n)),[o],de(e.slice(n,t)),de(e.slice(t+1,r))):i<0?[].concat(de(e.slice(0,t)),de(e.slice(t+1,n+1)),[o],de(e.slice(n+1,r))):e}var ZO={},i8=["name"],Ur=[];function wv(e,t,n,r,o,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==o}var Ev=(function(e){io(n,e);var t=ao(n);function n(r){var o;if(dn(this,n),o=t.call(this,r),z(ct(o),"state",{resetCount:0}),z(ct(o),"cancelRegisterFunc",null),z(ct(o),"mounted",!1),z(ct(o),"touched",!1),z(ct(o),"dirty",!1),z(ct(o),"validatePromise",void 0),z(ct(o),"prevValidating",void 0),z(ct(o),"errors",Ur),z(ct(o),"warnings",Ur),z(ct(o),"cancelRegister",function(){var l=o.props,c=l.preserve,u=l.isListField,d=l.name;o.cancelRegisterFunc&&o.cancelRegisterFunc(u,c,$n(d)),o.cancelRegisterFunc=null}),z(ct(o),"getNamePath",function(){var l=o.props,c=l.name,u=l.fieldContext,d=u.prefixName,f=d===void 0?[]:d;return c!==void 0?[].concat(de(f),de(c)):[]}),z(ct(o),"getRules",function(){var l=o.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(f){return typeof f=="function"?f(d):f})}),z(ct(o),"refresh",function(){o.mounted&&o.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),z(ct(o),"metaCache",null),z(ct(o),"triggerMetaEvent",function(l){var c=o.props.onMetaChange;if(c){var u=V(V({},o.getMeta()),{},{destroy:l});as(o.metaCache,u)||c(u),o.metaCache=u}else o.metaCache=null}),z(ct(o),"onStoreChange",function(l,c,u){var d=o.props,f=d.shouldUpdate,h=d.dependencies,p=h===void 0?[]:h,v=d.onReset,m=u.store,b=o.getNamePath(),y=o.getValue(l),C=o.getValue(m),x=c&&Ms(c,b);switch(u.type==="valueUpdate"&&u.source==="external"&&!as(y,C)&&(o.touched=!0,o.dirty=!0,o.validatePromise=null,o.errors=Ur,o.warnings=Ur,o.triggerMetaEvent()),u.type){case"reset":if(!c||x){o.touched=!1,o.dirty=!1,o.validatePromise=void 0,o.errors=Ur,o.warnings=Ur,o.triggerMetaEvent(),v==null||v(),o.refresh();return}break;case"remove":{if(f&&wv(f,l,m,y,C,u)){o.reRender();return}break}case"setField":{var S=u.data;if(x){"touched"in S&&(o.touched=S.touched),"validating"in S&&!("originRCField"in S)&&(o.validatePromise=S.validating?Promise.resolve([]):null),"errors"in S&&(o.errors=S.errors||Ur),"warnings"in S&&(o.warnings=S.warnings||Ur),o.dirty=!0,o.triggerMetaEvent(),o.reRender();return}else if("value"in S&&Ms(c,b,!0)){o.reRender();return}if(f&&!b.length&&wv(f,l,m,y,C,u)){o.reRender();return}break}case"dependenciesUpdate":{var E=p.map($n);if(E.some(function($){return Ms(u.relatedFields,$)})){o.reRender();return}break}default:if(x||(!p.length||b.length||f)&&wv(f,l,m,y,C,u)){o.reRender();return}break}f===!0&&o.reRender()}),z(ct(o),"validateRules",function(l){var c=o.getNamePath(),u=o.getValue(),d=l||{},f=d.triggerName,h=d.validateOnly,p=h===void 0?!1:h,v=Promise.resolve().then(lr(zt().mark(function m(){var b,y,C,x,S,E,$;return zt().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(o.mounted){k.next=2;break}return k.abrupt("return",[]);case 2:if(b=o.props,y=b.validateFirst,C=y===void 0?!1:y,x=b.messageVariables,S=b.validateDebounce,E=o.getRules(),f&&(E=E.filter(function(M){return M}).filter(function(M){var T=M.validateTrigger;if(!T)return!0;var I=hv(T);return I.includes(f)})),!(S&&f)){k.next=10;break}return k.next=8,new Promise(function(M){setTimeout(M,S)});case 8:if(o.validatePromise===v){k.next=10;break}return k.abrupt("return",[]);case 10:return $=e8(c,u,E,l,C,x),$.catch(function(M){return M}).then(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ur;if(o.validatePromise===v){var T;o.validatePromise=null;var I=[],R=[];(T=M.forEach)===null||T===void 0||T.call(M,function(N){var P=N.rule.warningOnly,A=N.errors,_=A===void 0?Ur:A;P?R.push.apply(R,de(_)):I.push.apply(I,de(_))}),o.errors=I,o.warnings=R,o.triggerMetaEvent(),o.reRender()}}),k.abrupt("return",$);case 13:case"end":return k.stop()}},m)})));return p||(o.validatePromise=v,o.dirty=!0,o.errors=Ur,o.warnings=Ur,o.triggerMetaEvent(),o.reRender()),v}),z(ct(o),"isFieldValidating",function(){return!!o.validatePromise}),z(ct(o),"isFieldTouched",function(){return o.touched}),z(ct(o),"isFieldDirty",function(){if(o.dirty||o.props.initialValue!==void 0)return!0;var l=o.props.fieldContext,c=l.getInternalHooks(Sa),u=c.getInitialValue;return u(o.getNamePath())!==void 0}),z(ct(o),"getErrors",function(){return o.errors}),z(ct(o),"getWarnings",function(){return o.warnings}),z(ct(o),"isListField",function(){return o.props.isListField}),z(ct(o),"isList",function(){return o.props.isList}),z(ct(o),"isPreserve",function(){return o.props.preserve}),z(ct(o),"getMeta",function(){o.prevValidating=o.isFieldValidating();var l={touched:o.isFieldTouched(),validating:o.prevValidating,errors:o.errors,warnings:o.warnings,name:o.getNamePath(),validated:o.validatePromise===null};return l}),z(ct(o),"getOnlyChild",function(l){if(typeof l=="function"){var c=o.getMeta();return V(V({},o.getOnlyChild(l(o.getControlled(),c,o.props.fieldContext))),{},{isFunction:!0})}var u=oo(l);return u.length!==1||!g.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),z(ct(o),"getValue",function(l){var c=o.props.fieldContext.getFieldsValue,u=o.getNamePath();return To(l||c(!0),u)}),z(ct(o),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=o.props,u=c.name,d=c.trigger,f=c.validateTrigger,h=c.getValueFromEvent,p=c.normalize,v=c.valuePropName,m=c.getValueProps,b=c.fieldContext,y=f!==void 0?f:b.validateTrigger,C=o.getNamePath(),x=b.getInternalHooks,S=b.getFieldsValue,E=x(Sa),$=E.dispatch,O=o.getValue(),k=m||function(N){return z({},v,N)},M=l[d],T=u!==void 0?k(O):{};ZO.NODE_ENV!=="production"&&T&&Object.keys(T).forEach(function(N){ft(typeof T[N]!="function","It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(N,")"))});var I=V(V({},l),T);I[d]=function(){o.touched=!0,o.dirty=!0,o.triggerMetaEvent();for(var N,P=arguments.length,A=new Array(P),_=0;_<P;_++)A[_]=arguments[_];h?N=h.apply(void 0,A):N=o8.apply(void 0,[v].concat(A)),p&&(N=p(N,O,S(!0))),N!==O&&$({type:"updateValue",namePath:C,value:N}),M&&M.apply(void 0,A)};var R=hv(y||[]);return R.forEach(function(N){var P=I[N];I[N]=function(){P&&P.apply(void 0,arguments);var A=o.props.rules;A&&A.length&&$({type:"validateField",namePath:C,triggerName:N})}}),I}),r.fieldContext){var i=r.fieldContext.getInternalHooks,a=i(Sa),s=a.initEntityValue;s(ct(o))}return o}return fn(n,[{key:"componentDidMount",value:function(){var o=this.props,i=o.shouldUpdate,a=o.fieldContext;if(this.mounted=!0,a){var s=a.getInternalHooks,l=s(Sa),c=l.registerField;this.cancelRegisterFunc=c(this)}i===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var o=this.state.resetCount,i=this.props.children,a=this.getOnlyChild(i),s=a.child,l=a.isFunction,c;return l?c=s:g.isValidElement(s)?c=g.cloneElement(s,this.getControlled(s.props)):(ft(!s,"`children` of Field is not validate ReactElement."),c=s),g.createElement(g.Fragment,{key:o},c)}}]),n})(g.Component);z(Ev,"contextType",Os),z(Ev,"defaultProps",{trigger:"onChange",valuePropName:"value"});function ek(e){var t,n=e.name,r=st(e,i8),o=g.useContext(Os),i=g.useContext(cf),a=n!==void 0?$n(n):void 0,s=(t=r.isListField)!==null&&t!==void 0?t:!!i,l="keep";return s||(l="_".concat((a||[]).join("_"))),ZO.NODE_ENV!=="production"&&r.preserve===!1&&s&&a.length<=1&&ft(!1,"`preserve` should not apply on Form.List fields."),g.createElement(Ev,he({key:l,name:a,isListField:s},r,{fieldContext:o}))}var tk={};function a8(e){var t=e.name,n=e.initialValue,r=e.children,o=e.rules,i=e.validateTrigger,a=e.isListField,s=g.useContext(Os),l=g.useContext(cf),c=g.useRef({keys:[],id:0}),u=c.current,d=g.useMemo(function(){var v=$n(s.prefixName)||[];return[].concat(de(v),de($n(t)))},[s.prefixName,t]),f=g.useMemo(function(){return V(V({},s),{},{prefixName:d})},[s,d]),h=g.useMemo(function(){return{getKey:function(m){var b=d.length,y=m[b];return[u.keys[y],m.slice(b+1)]}}},[d]);if(typeof r!="function")return ft(!1,"Form.List only accepts function as children."),null;var p=function(m,b,y){var C=y.source;return C==="internal"?!1:m!==b};return g.createElement(cf.Provider,{value:h},g.createElement(Os.Provider,{value:f},g.createElement(ek,{name:[],shouldUpdate:p,rules:o,validateTrigger:i,initialValue:n,isList:!0,isListField:a??!!l},function(v,m){var b=v.value,y=b===void 0?[]:b,C=v.onChange,x=s.getFieldValue,S=function(){var k=x(d||[]);return k||[]},E={add:function(k,M){var T=S();M>=0&&M<=T.length?(u.keys=[].concat(de(u.keys.slice(0,M)),[u.id],de(u.keys.slice(M))),C([].concat(de(T.slice(0,M)),[k],de(T.slice(M))))):(tk.NODE_ENV!=="production"&&(M<0||M>T.length)&&ft(!1,"The second parameter of the add function should be a valid positive number."),u.keys=[].concat(de(u.keys),[u.id]),C([].concat(de(T),[k]))),u.id+=1},remove:function(k){var M=S(),T=new Set(Array.isArray(k)?k:[k]);T.size<=0||(u.keys=u.keys.filter(function(I,R){return!T.has(R)}),C(M.filter(function(I,R){return!T.has(R)})))},move:function(k,M){if(k!==M){var T=S();k<0||k>=T.length||M<0||M>=T.length||(u.keys=QO(u.keys,k,M),C(QO(T,k,M)))}}},$=y||[];return Array.isArray($)||($=[],tk.NODE_ENV!=="production"&&ft(!1,"Current value of '".concat(d.join(" > "),"' is not an array type."))),r($.map(function(O,k){var M=u.keys[k];return M===void 0&&(u.keys[k]=u.id,M=u.keys[k],u.id+=1),{name:k,key:M,isListField:!0}}),E,m)})))}function s8(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(o,i){e.forEach(function(a,s){a.catch(function(l){return t=!0,l}).then(function(l){n-=1,r[s]=l,!(n>0)&&(t&&i(r),o(r))})})}):Promise.resolve([])}var nk="__@field_split__";function $v(e){return e.map(function(t){return"".concat(Ue(t),":").concat(t)}).join(nk)}var Ns=(function(){function e(){dn(this,e),z(this,"kvs",new Map)}return fn(e,[{key:"set",value:function(n,r){this.kvs.set($v(n),r)}},{key:"get",value:function(n){return this.kvs.get($v(n))}},{key:"update",value:function(n,r){var o=this.get(n),i=r(o);i?this.set(n,i):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete($v(n))}},{key:"map",value:function(n){return de(this.kvs.entries()).map(function(r){var o=Y(r,2),i=o[0],a=o[1],s=i.split(nk);return n({key:s.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Y(c,3),d=u[1],f=u[2];return d==="number"?Number(f):f}),value:a})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var o=r.key,i=r.value;return n[o.join(".")]=i,null}),n}}]),e})(),l8={},c8=["name"],u8=fn(function e(t){var n=this;dn(this,e),z(this,"formHooked",!1),z(this,"forceRootUpdate",void 0),z(this,"subscribable",!0),z(this,"store",{}),z(this,"fieldEntities",[]),z(this,"initialValues",{}),z(this,"callbacks",{}),z(this,"validateMessages",null),z(this,"preserve",null),z(this,"lastValidatePromise",null),z(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),z(this,"getInternalHooks",function(r){return r===Sa?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(ft(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),z(this,"useSubscribe",function(r){n.subscribable=r}),z(this,"prevWithoutPreserves",null),z(this,"setInitialValues",function(r,o){if(n.initialValues=r||{},o){var i,a=ps(r,n.store);(i=n.prevWithoutPreserves)===null||i===void 0||i.map(function(s){var l=s.key;a=co(a,l,To(r,l))}),n.prevWithoutPreserves=null,n.updateStore(a)}}),z(this,"destroyForm",function(r){if(r)n.updateStore({});else{var o=new Ns;n.getFieldEntities(!0).forEach(function(i){n.isMergedPreserve(i.isPreserve())||o.set(i.getNamePath(),!0)}),n.prevWithoutPreserves=o}}),z(this,"getInitialValue",function(r){var o=To(n.initialValues,r);return r.length?ps(o):o}),z(this,"setCallbacks",function(r){n.callbacks=r}),z(this,"setValidateMessages",function(r){n.validateMessages=r}),z(this,"setPreserve",function(r){n.preserve=r}),z(this,"watchList",[]),z(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(o){return o!==r})}}),z(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var o=n.getFieldsValue(),i=n.getFieldsValue(!0);n.watchList.forEach(function(a){a(o,i,r)})}}),z(this,"timeoutId",null),z(this,"warningUnhooked",function(){l8.NODE_ENV!=="production"&&!n.timeoutId&&typeof window<"u"&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.formHooked||ft(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))}),z(this,"updateStore",function(r){n.store=r}),z(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(o){return o.getNamePath().length}):n.fieldEntities}),z(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=new Ns;return n.getFieldEntities(r).forEach(function(i){var a=i.getNamePath();o.set(a,i)}),o}),z(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var o=n.getFieldsMap(!0);return r.map(function(i){var a=$n(i);return o.get(a)||{INVALIDATE_NAME_PATH:$n(i)}})}),z(this,"getFieldsValue",function(r,o){n.warningUnhooked();var i,a,s;if(r===!0||Array.isArray(r)?(i=r,a=o):r&&Ue(r)==="object"&&(s=r.strict,a=r.filter),i===!0&&!a)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(i)?i:null),c=[];return l.forEach(function(u){var d,f,h="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(s){var p,v;if((p=(v=u).isList)!==null&&p!==void 0&&p.call(v))return}else if(!i&&(d=(f=u).isListField)!==null&&d!==void 0&&d.call(f))return;if(!a)c.push(h);else{var m="getMeta"in u?u.getMeta():null;a(m)&&c.push(h)}}),YO(n.store,c.map($n))}),z(this,"getFieldValue",function(r){n.warningUnhooked();var o=$n(r);return To(n.store,o)}),z(this,"getFieldsError",function(r){n.warningUnhooked();var o=n.getFieldEntitiesForNamePathList(r);return o.map(function(i,a){return i&&!("INVALIDATE_NAME_PATH"in i)?{name:i.getNamePath(),errors:i.getErrors(),warnings:i.getWarnings()}:{name:$n(r[a]),errors:[],warnings:[]}})}),z(this,"getFieldError",function(r){n.warningUnhooked();var o=$n(r),i=n.getFieldsError([o])[0];return i.errors}),z(this,"getFieldWarning",function(r){n.warningUnhooked();var o=$n(r),i=n.getFieldsError([o])[0];return i.warnings}),z(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=o[0],s=o[1],l,c=!1;o.length===0?l=null:o.length===1?Array.isArray(a)?(l=a.map($n),c=!1):(l=null,c=a):(l=a.map($n),c=s);var u=n.getFieldEntities(!0),d=function(m){return m.isFieldTouched()};if(!l)return c?u.every(function(v){return d(v)||v.isList()}):u.some(d);var f=new Ns;l.forEach(function(v){f.set(v,[])}),u.forEach(function(v){var m=v.getNamePath();l.forEach(function(b){b.every(function(y,C){return m[C]===y})&&f.update(b,function(y){return[].concat(de(y),[v])})})});var h=function(m){return m.some(d)},p=f.map(function(v){var m=v.value;return m});return c?p.every(h):p.some(h)}),z(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),z(this,"isFieldsValidating",function(r){n.warningUnhooked();var o=n.getFieldEntities();if(!r)return o.some(function(a){return a.isFieldValidating()});var i=r.map($n);return o.some(function(a){var s=a.getNamePath();return Ms(i,s)&&a.isFieldValidating()})}),z(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),z(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=new Ns,i=n.getFieldEntities(!0);i.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=o.get(u)||new Set;d.add({entity:l,value:c}),o.set(u,d)}});var a=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var f=u.getNamePath(),h=n.getInitialValue(f);if(h!==void 0)ft(!1,"Form already set 'initialValues' with path '".concat(f.join("."),"'. Field can not overwrite it."));else{var p=o.get(f);if(p&&p.size>1)ft(!1,"Multiple Field with path '".concat(f.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(p){var v=n.getFieldValue(f),m=u.isListField();!m&&(!r.skipExist||v===void 0)&&n.updateStore(co(n.store,f,de(p)[0].value))}}}})},s;r.entities?s=r.entities:r.namePathList?(s=[],r.namePathList.forEach(function(l){var c=o.get(l);if(c){var u;(u=s).push.apply(u,de(de(c).map(function(d){return d.entity})))}})):s=i,a(s)}),z(this,"resetFields",function(r){n.warningUnhooked();var o=n.store;if(!r){n.updateStore(ps(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(o,null,{type:"reset"}),n.notifyWatch();return}var i=r.map($n);i.forEach(function(a){var s=n.getInitialValue(a);n.updateStore(co(n.store,a,s))}),n.resetWithFieldInitialValue({namePathList:i}),n.notifyObservers(o,i,{type:"reset"}),n.notifyWatch(i)}),z(this,"setFields",function(r){n.warningUnhooked();var o=n.store,i=[];r.forEach(function(a){var s=a.name,l=st(a,c8),c=$n(s);i.push(c),"value"in l&&n.updateStore(co(n.store,c,l.value)),n.notifyObservers(o,[c],{type:"setField",data:a})}),n.notifyWatch(i)}),z(this,"getFields",function(){var r=n.getFieldEntities(!0),o=r.map(function(i){var a=i.getNamePath(),s=i.getMeta(),l=V(V({},s),{},{name:a,value:n.getFieldValue(a)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return o}),z(this,"initEntityValue",function(r){var o=r.props.initialValue;if(o!==void 0){var i=r.getNamePath(),a=To(n.store,i);a===void 0&&n.updateStore(co(n.store,i,o))}}),z(this,"isMergedPreserve",function(r){var o=r!==void 0?r:n.preserve;return o??!0}),z(this,"registerField",function(r){n.fieldEntities.push(r);var o=r.getNamePath();if(n.notifyWatch([o]),r.props.initialValue!==void 0){var i=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(i,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(a,s){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(d){return d!==r}),!n.isMergedPreserve(s)&&(!a||l.length>1)){var c=a?void 0:n.getInitialValue(o);if(o.length&&n.getFieldValue(o)!==c&&n.fieldEntities.every(function(d){return!JO(d.getNamePath(),o)})){var u=n.store;n.updateStore(co(u,o,c,!0)),n.notifyObservers(u,[o],{type:"remove"}),n.triggerDependenciesUpdate(u,o)}}n.notifyWatch([o])}}),z(this,"dispatch",function(r){switch(r.type){case"updateValue":{var o=r.namePath,i=r.value;n.updateValue(o,i);break}case"validateField":{var a=r.namePath,s=r.triggerName;n.validateFields([a],{triggerName:s});break}}}),z(this,"notifyObservers",function(r,o,i){if(n.subscribable){var a=V(V({},i),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(s){var l=s.onStoreChange;l(r,o,a)})}else n.forceRootUpdate()}),z(this,"triggerDependenciesUpdate",function(r,o){var i=n.getDependencyChildrenFields(o);return i.length&&n.validateFields(i),n.notifyObservers(r,i,{type:"dependenciesUpdate",relatedFields:[o].concat(de(i))}),i}),z(this,"updateValue",function(r,o){var i=$n(r),a=n.store;n.updateStore(co(n.store,i,o)),n.notifyObservers(a,[i],{type:"valueUpdate",source:"internal"}),n.notifyWatch([i]);var s=n.triggerDependenciesUpdate(a,i),l=n.callbacks.onValuesChange;if(l){var c=YO(n.store,[i]);l(c,n.getFieldsValue())}n.triggerOnFieldsChange([i].concat(de(s)))}),z(this,"setFieldsValue",function(r){n.warningUnhooked();var o=n.store;if(r){var i=ps(n.store,r);n.updateStore(i)}n.notifyObservers(o,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),z(this,"setFieldValue",function(r,o){n.setFields([{name:r,value:o,errors:[],warnings:[]}])}),z(this,"getDependencyChildrenFields",function(r){var o=new Set,i=[],a=new Ns;n.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=$n(u);a.update(d,function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return f.add(l),f})})});var s=function l(c){var u=a.get(c)||new Set;u.forEach(function(d){if(!o.has(d)){o.add(d);var f=d.getNamePath();d.isFieldDirty()&&f.length&&(i.push(f),l(f))}})};return s(r),i}),z(this,"triggerOnFieldsChange",function(r,o){var i=n.callbacks.onFieldsChange;if(i){var a=n.getFields();if(o){var s=new Ns;o.forEach(function(c){var u=c.name,d=c.errors;s.set(u,d)}),a.forEach(function(c){c.errors=s.get(c.name)||c.errors})}var l=a.filter(function(c){var u=c.name;return Ms(r,u)});l.length&&i(l,a)}}),z(this,"validateFields",function(r,o){n.warningUnhooked();var i,a;Array.isArray(r)||typeof r=="string"||typeof o=="string"?(i=r,a=o):a=r;var s=!!i,l=s?i.map($n):[],c=[],u=String(Date.now()),d=new Set,f=a||{},h=f.recursive,p=f.dirty;n.getFieldEntities(!0).forEach(function(y){if(s||l.push(y.getNamePath()),!(!y.props.rules||!y.props.rules.length)&&!(p&&!y.isFieldDirty())){var C=y.getNamePath();if(d.add(C.join(u)),!s||Ms(l,C,h)){var x=y.validateRules(V({validateMessages:V(V({},KO),n.validateMessages)},a));c.push(x.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(S){var E,$=[],O=[];return(E=S.forEach)===null||E===void 0||E.call(S,function(k){var M=k.rule.warningOnly,T=k.errors;M?O.push.apply(O,de(T)):$.push.apply($,de(T))}),$.length?Promise.reject({name:C,errors:$,warnings:O}):{name:C,errors:$,warnings:O}}))}}});var v=s8(c);n.lastValidatePromise=v,v.catch(function(y){return y}).then(function(y){var C=y.map(function(x){var S=x.name;return S});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,y)});var m=v.then(function(){return n.lastValidatePromise===v?Promise.resolve(n.getFieldsValue(l)):Promise.reject([])}).catch(function(y){var C=y.filter(function(x){return x&&x.errors.length});return Promise.reject({values:n.getFieldsValue(l),errorFields:C,outOfDate:n.lastValidatePromise!==v})});m.catch(function(y){return y});var b=l.filter(function(y){return d.has(y.join(u))});return n.triggerOnFieldsChange(b),m}),z(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var o=n.callbacks.onFinish;if(o)try{o(r)}catch(i){console.error(i)}}).catch(function(r){var o=n.callbacks.onFinishFailed;o&&o(r)})}),this.forceRootUpdate=t});function rk(e){var t=g.useRef(),n=g.useState({}),r=Y(n,2),o=r[1];if(!t.current)if(e)t.current=e;else{var i=function(){o({})},a=new u8(i);t.current=a.getForm()}return[t.current]}var Ov=g.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),d8=function(t){var n=t.validateMessages,r=t.onFormChange,o=t.onFormFinish,i=t.children,a=g.useContext(Ov),s=g.useRef({});return g.createElement(Ov.Provider,{value:V(V({},a),{},{validateMessages:V(V({},a.validateMessages),n),triggerFormChange:function(c,u){r&&r(c,{changedFields:u,forms:s.current}),a.triggerFormChange(c,u)},triggerFormFinish:function(c,u){o&&o(c,{values:u,forms:s.current}),a.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(s.current=V(V({},s.current),{},z({},c,u))),a.registerForm(c,u)},unregisterForm:function(c){var u=V({},s.current);delete u[c],s.current=u,a.unregisterForm(c)}})},i)},f8=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],h8=function(t,n){var r=t.name,o=t.initialValues,i=t.fields,a=t.form,s=t.preserve,l=t.children,c=t.component,u=c===void 0?"form":c,d=t.validateMessages,f=t.validateTrigger,h=f===void 0?"onChange":f,p=t.onValuesChange,v=t.onFieldsChange,m=t.onFinish,b=t.onFinishFailed,y=t.clearOnDestroy,C=st(t,f8),x=g.useRef(null),S=g.useContext(Ov),E=rk(a),$=Y(E,1),O=$[0],k=O.getInternalHooks(Sa),M=k.useSubscribe,T=k.setInitialValues,I=k.setCallbacks,R=k.setValidateMessages,N=k.setPreserve,P=k.destroyForm;g.useImperativeHandle(n,function(){return V(V({},O),{},{nativeElement:x.current})}),g.useEffect(function(){return S.registerForm(r,O),function(){S.unregisterForm(r)}},[S,O,r]),R(V(V({},S.validateMessages),d)),I({onValuesChange:p,onFieldsChange:function(H){if(S.triggerFormChange(r,H),v){for(var W=arguments.length,q=new Array(W>1?W-1:0),te=1;te<W;te++)q[te-1]=arguments[te];v.apply(void 0,[H].concat(q))}},onFinish:function(H){S.triggerFormFinish(r,H),m&&m(H)},onFinishFailed:b}),N(s);var A=g.useRef(null);T(o,!A.current),A.current||(A.current=!0),g.useEffect(function(){return function(){return P(y)}},[]);var _,B=typeof l=="function";if(B){var F=O.getFieldsValue(!0);_=l(F,O)}else _=l;M(!B);var U=g.useRef();g.useEffect(function(){r8(U.current||[],i||[])||O.setFields(i||[]),U.current=i},[i,O]);var K=g.useMemo(function(){return V(V({},O),{},{validateTrigger:h})},[O,h]),j=g.createElement(cf.Provider,{value:null},g.createElement(Os.Provider,{value:K},_));return u===!1?j:g.createElement(u,he({},C,{ref:x,onSubmit:function(H){H.preventDefault(),H.stopPropagation(),O.submit()},onReset:function(H){var W;H.preventDefault(),O.resetFields(),(W=C.onReset)===null||W===void 0||W.call(C,H)}}),j)},ok={};function ik(e){try{return JSON.stringify(e)}catch{return Math.random()}}var p8=ok.NODE_ENV!=="production"?function(e){var t=e.join("__RC_FIELD_FORM_SPLIT__"),n=w.useRef(t);ft(n.current===t,"`useWatch` is not support dynamic `namePath`. Please provide static instead.")}:function(){};function m8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],o=t[1],i=o===void 0?{}:o,a=xW(i)?{form:i}:i,s=a.form,l=w.useState(),c=Y(l,2),u=c[0],d=c[1],f=w.useMemo(function(){return ik(u)},[u]),h=w.useRef(f);h.current=f;var p=w.useContext(Os),v=s||p,m=v&&v._init;ok.NODE_ENV!=="production"&&ft(t.length===2?s?m:!0:m,"useWatch requires a form instance since it can not auto detect from context.");var b=$n(r),y=w.useRef(b);return y.current=b,p8(b),w.useEffect(function(){if(m){var C=v.getFieldsValue,x=v.getInternalHooks,S=x(Sa),E=S.registerWatch,$=function(T,I){var R=a.preserve?I:T;return typeof r=="function"?r(R):To(R,y.current)},O=E(function(M,T){var I=$(M,T),R=ik(I);h.current!==R&&(h.current=R,d(I))}),k=$(C(),C(!0));return u!==k&&d(k),O}},[m]),u}var g8=g.forwardRef(h8),tc=g8;tc.FormProvider=d8,tc.Field=ek,tc.List=a8,tc.useForm=rk,tc.useWatch=m8;var v8={};const qr=g.createContext({});v8.NODE_ENV!=="production"&&(qr.displayName="FormItemInputContext");const b8=({children:e,status:t,override:n})=>{const r=g.useContext(qr),o=g.useMemo(()=>{const i=Object.assign({},r);return n&&delete i.isFormItemInput,t&&(delete i.status,delete i.hasFeedback,delete i.feedbackIcon),i},[t,n,r]);return g.createElement(qr.Provider,{value:o},e)},y8=g.createContext(void 0),Fi=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let o=r;return n&&(o=w.createElement(b8,{override:!0,status:!0},o)),t&&(o=w.createElement(g4,null,o)),o},C8=()=>Gn()&&window.document.documentElement,ff=e=>{const{prefixCls:t,className:n,style:r,size:o,shape:i}=e,a=J({[`${t}-lg`]:o==="large",[`${t}-sm`]:o==="small"}),s=J({[`${t}-circle`]:i==="circle",[`${t}-square`]:i==="square",[`${t}-round`]:i==="round"}),l=g.useMemo(()=>typeof o=="number"?{width:o,height:o,lineHeight:`${o}px`}:{},[o]);return g.createElement("span",{className:J(t,a,s,n),style:Object.assign(Object.assign({},l),r)})},S8=new It("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),hf=e=>({height:e,lineHeight:Q(e)}),Ts=e=>Object.assign({width:e},hf(e)),x8=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:S8,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),kv=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},hf(e)),w8=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:i}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},Ts(r)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Ts(o)),[`${t}${t}-sm`]:Object.assign({},Ts(i))}},E8=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:i,gradientFromColor:a,calc:s}=e;return{[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:a,borderRadius:n},kv(t,s)),[`${r}-lg`]:Object.assign({},kv(o,s)),[`${r}-sm`]:Object.assign({},kv(i,s))}},ak=e=>Object.assign({width:e},hf(e)),$8=e=>{const{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:o,calc:i}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:r,borderRadius:o},ak(i(n).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},ak(n)),{maxWidth:i(n).mul(4).equal(),maxHeight:i(n).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},Mv=(e,t,n)=>{const{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:t}}},Nv=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},hf(e)),O8=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:i,gradientFromColor:a,calc:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:a,borderRadius:t,width:s(r).mul(2).equal(),minWidth:s(r).mul(2).equal()},Nv(r,s))},Mv(e,r,n)),{[`${n}-lg`]:Object.assign({},Nv(o,s))}),Mv(e,o,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},Nv(i,s))}),Mv(e,i,`${n}-sm`))},k8=e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:i,skeletonInputCls:a,skeletonImageCls:s,controlHeight:l,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:f,marginSM:h,borderRadius:p,titleHeight:v,blockRadius:m,paragraphLiHeight:b,controlHeightXS:y,paragraphMarginTop:C}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},Ts(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},Ts(c)),[`${n}-sm`]:Object.assign({},Ts(u))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:v,background:d,borderRadius:m,[`+ ${o}`]:{marginBlockStart:u}},[o]:{padding:0,"> li":{width:"100%",height:b,listStyle:"none",background:d,borderRadius:m,"+ li":{marginBlockStart:y}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${r}, ${o} > li`]:{borderRadius:p}}},[`${t}-with-avatar ${t}-content`]:{[r]:{marginBlockStart:h,[`+ ${o}`]:{marginBlockStart:C}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},O8(e)),w8(e)),E8(e)),$8(e)),[`${t}${t}-block`]:{width:"100%",[i]:{width:"100%"},[a]:{width:"100%"}},[`${t}${t}-active`]:{[`
|
|
374
|
+
${r},
|
|
375
|
+
${o} > li,
|
|
376
|
+
${n},
|
|
377
|
+
${i},
|
|
378
|
+
${a},
|
|
379
|
+
${s}
|
|
380
|
+
`]:Object.assign({},x8(e))}}},Is=gn("Skeleton",e=>{const{componentCls:t,calc:n}=e,r=Dt(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return k8(r)},e=>{const{colorFillContent:t,colorFill:n}=e,r=t,o=n;return{color:r,colorGradientEnd:o,gradientFromColor:r,gradientToColor:o,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),M8=e=>{const{prefixCls:t,className:n,rootClassName:r,active:o,shape:i="circle",size:a="default"}=e,{getPrefixCls:s}=g.useContext(wt),l=s("skeleton",t),[c,u,d]=Is(l),f=nr(e,["prefixCls","className"]),h=J(l,`${l}-element`,{[`${l}-active`]:o},n,r,u,d);return c(g.createElement("div",{className:h},g.createElement(ff,Object.assign({prefixCls:`${l}-avatar`,shape:i,size:a},f))))},N8=e=>{const{prefixCls:t,className:n,rootClassName:r,active:o,block:i=!1,size:a="default"}=e,{getPrefixCls:s}=g.useContext(wt),l=s("skeleton",t),[c,u,d]=Is(l),f=nr(e,["prefixCls"]),h=J(l,`${l}-element`,{[`${l}-active`]:o,[`${l}-block`]:i},n,r,u,d);return c(g.createElement("div",{className:h},g.createElement(ff,Object.assign({prefixCls:`${l}-button`,size:a},f))))},T8="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",I8=e=>{const{prefixCls:t,className:n,rootClassName:r,style:o,active:i}=e,{getPrefixCls:a}=g.useContext(wt),s=a("skeleton",t),[l,c,u]=Is(s),d=J(s,`${s}-element`,{[`${s}-active`]:i},n,r,c,u);return l(g.createElement("div",{className:d},g.createElement("div",{className:J(`${s}-image`,n),style:o},g.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${s}-image-svg`},g.createElement("title",null,"Image placeholder"),g.createElement("path",{d:T8,className:`${s}-image-path`})))))},P8=e=>{const{prefixCls:t,className:n,rootClassName:r,active:o,block:i,size:a="default"}=e,{getPrefixCls:s}=g.useContext(wt),l=s("skeleton",t),[c,u,d]=Is(l),f=nr(e,["prefixCls"]),h=J(l,`${l}-element`,{[`${l}-active`]:o,[`${l}-block`]:i},n,r,u,d);return c(g.createElement("div",{className:h},g.createElement(ff,Object.assign({prefixCls:`${l}-input`,size:a},f))))},A8=e=>{const{prefixCls:t,className:n,rootClassName:r,style:o,active:i,children:a}=e,{getPrefixCls:s}=g.useContext(wt),l=s("skeleton",t),[c,u,d]=Is(l),f=J(l,`${l}-element`,{[`${l}-active`]:i},u,n,r,d);return c(g.createElement("div",{className:f},g.createElement("div",{className:J(`${l}-image`,n),style:o},a)))},R8=(e,t)=>{const{width:n,rows:r=2}=t;if(Array.isArray(n))return n[e];if(r-1===e)return n},_8=e=>{const{prefixCls:t,className:n,style:r,rows:o=0}=e,i=Array.from({length:o}).map((a,s)=>g.createElement("li",{key:s,style:{width:R8(s,e)}}));return g.createElement("ul",{className:J(t,n),style:r},i)},D8=({prefixCls:e,className:t,width:n,style:r})=>g.createElement("h3",{className:J(e,t),style:Object.assign({width:n},r)});var L8={};function Tv(e){return e&&typeof e=="object"?e:{}}function j8(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function z8(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function B8(e,t){const n={};return(!e||!t)&&(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}const xa=e=>{const{prefixCls:t,loading:n,className:r,rootClassName:o,style:i,children:a,avatar:s=!1,title:l=!0,paragraph:c=!0,active:u,round:d}=e,{getPrefixCls:f,direction:h,className:p,style:v}=xr("skeleton"),m=f("skeleton",t),[b,y,C]=Is(m);if(n||!("loading"in e)){const x=!!s,S=!!l,E=!!c;let $;if(x){const M=Object.assign(Object.assign({prefixCls:`${m}-avatar`},j8(S,E)),Tv(s));$=g.createElement("div",{className:`${m}-header`},g.createElement(ff,Object.assign({},M)))}let O;if(S||E){let M;if(S){const I=Object.assign(Object.assign({prefixCls:`${m}-title`},z8(x,E)),Tv(l));M=g.createElement(D8,Object.assign({},I))}let T;if(E){const I=Object.assign(Object.assign({prefixCls:`${m}-paragraph`},B8(x,S)),Tv(c));T=g.createElement(_8,Object.assign({},I))}O=g.createElement("div",{className:`${m}-content`},M,T)}const k=J(m,{[`${m}-with-avatar`]:x,[`${m}-active`]:u,[`${m}-rtl`]:h==="rtl",[`${m}-round`]:d},p,r,o,y,C);return b(g.createElement("div",{className:k,style:Object.assign(Object.assign({},v),i)},$,O))}return a??null};xa.Button=N8,xa.Avatar=M8,xa.Input=P8,xa.Image=I8,xa.Node=A8,L8.NODE_ENV!=="production"&&(xa.displayName="Skeleton");function sk(){}const F8=g.createContext({add:sk,remove:sk});function H8(e){const t=g.useContext(F8),n=g.useRef(null);return qt(o=>{if(o){const i=e?o.querySelector(e):o;i&&(t.add(i),n.current=i)}else t.remove(n.current)})}const lk=()=>{const{cancelButtonProps:e,cancelTextLocale:t,onCancel:n}=w.useContext(Jl);return w.createElement(mo,Object.assign({onClick:n},e),t)},ck=()=>{const{confirmLoading:e,okButtonProps:t,okType:n,okTextLocale:r,onOk:o}=w.useContext(Jl);return w.createElement(mo,Object.assign({},q$(n),{loading:e,onClick:o},t),r)};function uk(e,t){return w.createElement("span",{className:`${e}-close-x`},t||w.createElement(zi,{className:`${e}-close-icon`}))}const dk=e=>{const{okText:t,okType:n="primary",cancelText:r,confirmLoading:o,onOk:i,onCancel:a,okButtonProps:s,cancelButtonProps:l,footer:c}=e,[u]=uo("Modal",sE()),d=t||(u==null?void 0:u.okText),f=r||(u==null?void 0:u.cancelText),h=w.useMemo(()=>({confirmLoading:o,okButtonProps:s,cancelButtonProps:l,okTextLocale:d,cancelTextLocale:f,okType:n,onOk:i,onCancel:a}),[o,s,l,d,f,n,i,a]);let p;return typeof c=="function"||typeof c>"u"?(p=w.createElement(w.Fragment,null,w.createElement(lk,null),w.createElement(ck,null)),typeof c=="function"&&(p=c(p,{OkBtn:ck,CancelBtn:lk})),p=w.createElement(EO,{value:h},p)):p=c,w.createElement(SE,{disabled:!1},p)},V8=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},W8=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},U8=(e,t)=>{const{prefixCls:n,componentCls:r,gridColumns:o}=e,i={};for(let a=o;a>=0;a--)a===0?(i[`${r}${t}-${a}`]={display:"none"},i[`${r}-push-${a}`]={insetInlineStart:"auto"},i[`${r}-pull-${a}`]={insetInlineEnd:"auto"},i[`${r}${t}-push-${a}`]={insetInlineStart:"auto"},i[`${r}${t}-pull-${a}`]={insetInlineEnd:"auto"},i[`${r}${t}-offset-${a}`]={marginInlineStart:0},i[`${r}${t}-order-${a}`]={order:0}):(i[`${r}${t}-${a}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${a/o*100}%`,maxWidth:`${a/o*100}%`}],i[`${r}${t}-push-${a}`]={insetInlineStart:`${a/o*100}%`},i[`${r}${t}-pull-${a}`]={insetInlineEnd:`${a/o*100}%`},i[`${r}${t}-offset-${a}`]={marginInlineStart:`${a/o*100}%`},i[`${r}${t}-order-${a}`]={order:a});return i[`${r}${t}-flex`]={flex:`var(--${n}${t}-flex)`},i},Iv=(e,t)=>U8(e,t),q8=(e,t,n)=>({[`@media (min-width: ${Q(t)})`]:Object.assign({},Iv(e,n))}),K8=()=>({}),G8=()=>({});gn("Grid",V8,K8);const fk=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin});gn("Grid",e=>{const t=Dt(e,{gridColumns:24}),n=fk(t);return delete n.xs,[W8(t),Iv(t,""),Iv(t,"-xs"),Object.keys(n).map(r=>q8(t,n[r],`-${r}`)).reduce((r,o)=>Object.assign(Object.assign({},r),o),{})]},G8);function hk(e){return{position:e,inset:0}}const X8=e=>{const{componentCls:t,antCls:n}=e;return[{[`${t}-root`]:{[`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${n}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},hk("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},hk("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:lO(e)}]},Y8=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${Q(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},Pn(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Q(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:Q(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},ba(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Q(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content,
|
|
381
|
+
${t}-body,
|
|
382
|
+
${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},J8=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},Q8=e=>{const{componentCls:t}=e,n=fk(e),r=Object.assign({},n);delete r.xs;const o=`--${t.replace(".","")}-`,i=Object.keys(r).map(a=>({[`@media (min-width: ${Q(r[a])})`]:{width:`var(${o}${a}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(de(Object.keys(n).map((a,s)=>{const l=Object.keys(n)[s-1];return l?{[`${o}${a}-width`]:`var(${o}${l}-width)`}:null})),[{width:`var(${o}xs-width)`}],de(i))}}},pk=e=>{const t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return Dt(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},mk=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Q(e.paddingMD)} ${Q(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Q(e.padding)} ${Q(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Q(e.paddingXS)} ${Q(e.padding)}`:0,footerBorderTop:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Q(e.padding*2)} ${Q(e.padding*2)} ${Q(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM}),gk=gn("Modal",e=>{const t=pk(e);return[Y8(t),J8(t),X8(t),av(t,"zoom"),Q8(t)]},mk,{unitless:{titleLineHeight:!0}});var Z8={},e7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Pv;const t7=e=>{Pv={x:e.pageX,y:e.pageY},setTimeout(()=>{Pv=null},100)};C8()&&document.documentElement.addEventListener("click",t7,!0);const vk=e=>{const{prefixCls:t,className:n,rootClassName:r,open:o,wrapClassName:i,centered:a,getContainer:s,focusTriggerAfterClose:l=!0,style:c,visible:u,width:d=520,footer:f,classNames:h,styles:p,children:v,loading:m,confirmLoading:b,zIndex:y,mousePosition:C,onOk:x,onCancel:S,destroyOnHidden:E,destroyOnClose:$,panelRef:O=null,modalRender:k}=e,M=e7(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef","modalRender"]),{getPopupContainer:T,getPrefixCls:I,direction:R,modal:N}=g.useContext(wt),P=ce=>{b||S==null||S(ce)},A=ce=>{x==null||x(ce)};if(Z8.NODE_ENV!=="production"){const ce=Wt("Modal");[["visible","open"],["bodyStyle","styles.body"],["maskStyle","styles.mask"],["destroyOnClose","destroyOnHidden"]].forEach(([ue,ge])=>{ce.deprecated(!(ue in e),ue,ge)})}const _=I("modal",t),B=I(),F=Po(_),[U,K,j]=gk(_,F),D=J(i,{[`${_}-centered`]:a??(N==null?void 0:N.centered),[`${_}-wrap-rtl`]:R==="rtl"}),H=f!==null&&!m?g.createElement(dk,Object.assign({},e,{onOk:A,onCancel:P})):null,[W,q,te,G]=I5(w$(e),w$(N),{closable:!0,closeIcon:g.createElement(zi,{className:`${_}-close-icon`}),closeIconRender:ce=>uk(_,ce)}),re=k?ce=>g.createElement("div",{className:`${_}-render`},k(ce)):void 0,oe=`.${_}-${k?"render":"content"}`,ne=H8(oe),Z=sr(O,ne),[ae,ie]=Vg("Modal",y),[X,ee]=g.useMemo(()=>d&&typeof d=="object"?[void 0,d]:[d,void 0],[d]),le=g.useMemo(()=>{const ce={};return ee&&Object.keys(ee).forEach(ue=>{const ge=ee[ue];ge!==void 0&&(ce[`--${_}-${ue}-width`]=typeof ge=="number"?`${ge}px`:ge)}),ce},[_,ee]);return U(g.createElement(Fi,{form:!0,space:!0},g.createElement(Wd.Provider,{value:ie},g.createElement(zO,Object.assign({width:X},M,{zIndex:ae,getContainer:s===void 0?T:s,prefixCls:_,rootClassName:J(K,r,j,F),footer:H,visible:o??u,mousePosition:C??Pv,onClose:P,closable:W&&Object.assign({disabled:te,closeIcon:q},G),closeIcon:q,focusTriggerAfterClose:l,transitionName:Bi(B,"zoom",e.transitionName),maskTransitionName:Bi(B,"fade",e.maskTransitionName),className:J(K,n,N==null?void 0:N.className),style:Object.assign(Object.assign(Object.assign({},N==null?void 0:N.style),c),le),classNames:Object.assign(Object.assign(Object.assign({},N==null?void 0:N.classNames),h),{wrapper:J(D,h==null?void 0:h.wrapper)}),styles:Object.assign(Object.assign({},N==null?void 0:N.styles),p),panelRef:Z,destroyOnClose:E??$,modalRender:re}),m?g.createElement(xa,{active:!0,title:!1,paragraph:{rows:4},className:`${_}-body-skeleton`}):v))))},n7=e=>{const{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:o,fontSize:i,lineHeight:a,modalTitleHeight:s,fontHeight:l,confirmBodyPadding:c}=e,u=`${t}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},Rd()),[`&${t} ${t}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(o).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(s).sub(o).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${Q(e.marginSM)})`},[`${e.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Q(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${u}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},[`${u}-content`]:{color:e.colorText,fontSize:i,lineHeight:a},[`${u}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${u}-error ${u}-body > ${e.iconCls}`]:{color:e.colorError},[`${u}-warning ${u}-body > ${e.iconCls},
|
|
383
|
+
${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},r7=_E(["Modal","confirm"],e=>{const t=pk(e);return n7(t)},mk,{order:-1e3});var pf={},o7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const bk=e=>{const{prefixCls:t,icon:n,okText:r,cancelText:o,confirmPrefixCls:i,type:a,okCancel:s,footer:l,locale:c}=e,u=o7(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);if(pf.NODE_ENV!=="production"){const E=Wt("Modal");pf.NODE_ENV!=="production"&&E(!(typeof n=="string"&&n.length>2),"breaking",`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${n}\` at https://ant.design/components/icon`)}let d=n;if(!n&&n!==null)switch(a){case"info":d=g.createElement(Fg,null);break;case"success":d=g.createElement(Vd,null);break;case"error":d=g.createElement(ws,null);break;default:d=g.createElement(Bg,null)}const f=s??a==="confirm",h=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",[p]=uo("Modal"),v=c||p,m=r||(f?v==null?void 0:v.okText:v==null?void 0:v.justOkText),b=o||(v==null?void 0:v.cancelText),y=g.useMemo(()=>Object.assign({autoFocusButton:h,cancelTextLocale:b,okTextLocale:m,mergedOkCancel:f},u),[h,b,m,f,u]),C=g.createElement(g.Fragment,null,g.createElement($O,null),g.createElement(OO,null)),x=e.title!==void 0&&e.title!==null,S=`${i}-body`;return g.createElement("div",{className:`${i}-body-wrapper`},g.createElement("div",{className:J(S,{[`${S}-has-title`]:x})},d,g.createElement("div",{className:`${i}-paragraph`},x&&g.createElement("span",{className:`${i}-title`},e.title),g.createElement("div",{className:`${i}-content`},e.content))),l===void 0||typeof l=="function"?g.createElement(EO,{value:y},g.createElement("div",{className:`${i}-btns`},typeof l=="function"?l(C,{OkBtn:OO,CancelBtn:$O}):C)):l,g.createElement(r7,{prefixCls:t}))},yk=e=>{const{close:t,zIndex:n,maskStyle:r,direction:o,prefixCls:i,wrapClassName:a,rootPrefixCls:s,bodyStyle:l,closable:c=!1,onConfirm:u,styles:d,title:f}=e;if(pf.NODE_ENV!=="production"){const S=Wt("Modal");[["visible","open"],["bodyStyle","styles.body"],["maskStyle","styles.mask"]].forEach(([E,$])=>{S.deprecated(!(E in e),E,$)})}const h=`${i}-confirm`,p=e.width||416,v=e.style||{},m=e.mask===void 0?!0:e.mask,b=e.maskClosable===void 0?!1:e.maskClosable,y=J(h,`${h}-${e.type}`,{[`${h}-rtl`]:o==="rtl"},e.className),[,C]=wr(),x=g.useMemo(()=>n!==void 0?n:C.zIndexPopupBase+Hg,[n,C]);return g.createElement(vk,Object.assign({},e,{className:y,wrapClassName:J({[`${h}-centered`]:!!e.centered},a),onCancel:()=>{t==null||t({triggerCancel:!0}),u==null||u(!1)},title:f,footer:null,transitionName:Bi(s||"","zoom",e.transitionName),maskTransitionName:Bi(s||"","fade",e.maskTransitionName),mask:m,maskClosable:b,style:v,styles:Object.assign({body:l,mask:r},d),width:p,zIndex:x,closable:c}),g.createElement(bk,Object.assign({},e,{confirmPrefixCls:h})))},Av=e=>{const{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:o}=e;return g.createElement(ho,{prefixCls:t,iconPrefixCls:n,direction:r,theme:o},g.createElement(yk,Object.assign({},e)))};pf.NODE_ENV!=="production"&&(yk.displayName="ConfirmDialog",Av.displayName="ConfirmDialogWrapper");const wa=[];var mf={};let Ck="";function Sk(){return Ck}const i7=e=>{var t,n;const{prefixCls:r,getContainer:o,direction:i}=e,a=sE(),s=w.useContext(wt),l=Sk()||s.getPrefixCls(),c=r||`${l}-modal`;let u=o;return u===!1&&(u=void 0,mf.NODE_ENV!=="production"&&mf.NODE_ENV!=="production"&&Di(!1,"Modal","Static method not support `getContainer` to be `false` since it do not have context env.")),w.createElement(Av,Object.assign({},e,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:s.iconPrefixCls,theme:s.theme,direction:i??s.direction,locale:(n=(t=s.locale)===null||t===void 0?void 0:t.Modal)!==null&&n!==void 0?n:a,getContainer:u}))};function nc(e){const t=jg();mf.NODE_ENV!=="production"&&!t.holderRender&&n$("Modal");const n=document.createDocumentFragment();let r=Object.assign(Object.assign({},e),{close:l,open:!0}),o,i;function a(...u){var d;if(u.some(p=>p==null?void 0:p.triggerCancel)){var h;(d=e.onCancel)===null||d===void 0||(h=d).call.apply(h,[e,()=>{}].concat(de(u.slice(1))))}for(let p=0;p<wa.length;p++)if(wa[p]===l){wa.splice(p,1);break}i()}const s=u=>{clearTimeout(o),o=setTimeout(()=>{const d=t.getPrefixCls(void 0,Sk()),f=t.getIconPrefixCls(),h=t.getTheme(),p=w.createElement(i7,Object.assign({},u));i=Xg()(w.createElement(ho,{prefixCls:d,iconPrefixCls:f,theme:h},typeof t.holderRender=="function"?t.holderRender(p):p),n)})};function l(...u){r=Object.assign(Object.assign({},r),{open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),a.apply(this,u)}}),r.visible&&delete r.visible,s(r)}function c(u){typeof u=="function"?r=u(r):r=Object.assign(Object.assign({},r),u),s(r)}return s(r),wa.push(l),{destroy:l,update:c}}function xk(e){return Object.assign(Object.assign({},e),{type:"warning"})}function wk(e){return Object.assign(Object.assign({},e),{type:"info"})}function Ek(e){return Object.assign(Object.assign({},e),{type:"success"})}function $k(e){return Object.assign(Object.assign({},e),{type:"error"})}function Ok(e){return Object.assign(Object.assign({},e),{type:"confirm"})}function a7({rootPrefixCls:e}){mf.NODE_ENV!=="production"&&Di(!1,"Modal","Modal.config is deprecated. Please use ConfigProvider.config instead."),Ck=e}var s7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const l7=(e,t)=>{var n,{afterClose:r,config:o}=e,i=s7(e,["afterClose","config"]);const[a,s]=g.useState(!0),[l,c]=g.useState(o),{direction:u,getPrefixCls:d}=g.useContext(wt),f=d("modal"),h=d(),p=()=>{var y;r(),(y=l.afterClose)===null||y===void 0||y.call(l)},v=(...y)=>{var C;if(s(!1),y.some(E=>E==null?void 0:E.triggerCancel)){var S;(C=l.onCancel)===null||C===void 0||(S=C).call.apply(S,[l,()=>{}].concat(de(y.slice(1))))}};g.useImperativeHandle(t,()=>({destroy:v,update:y=>{c(C=>{const x=typeof y=="function"?y(C):y;return Object.assign(Object.assign({},C),x)})}}));const m=(n=l.okCancel)!==null&&n!==void 0?n:l.type==="confirm",[b]=uo("Modal",ri.Modal);return g.createElement(Av,Object.assign({prefixCls:f,rootPrefixCls:h},l,{close:v,open:a,afterClose:p,okText:l.okText||(m?b==null?void 0:b.okText:b==null?void 0:b.justOkText),direction:l.direction||u,cancelText:l.cancelText||(b==null?void 0:b.cancelText)},i))},c7=g.forwardRef(l7);let kk=0;const u7=g.memo(g.forwardRef((e,t)=>{const[n,r]=P5();return g.useImperativeHandle(t,()=>({patchElement:r}),[r]),g.createElement(g.Fragment,null,n)}));function d7(){const e=g.useRef(null),[t,n]=g.useState([]);g.useEffect(()=>{t.length&&(de(t).forEach(a=>{a()}),n([]))},[t]);const r=g.useCallback(i=>function(s){var l;kk+=1;const c=g.createRef();let u;const d=new Promise(m=>{u=m});let f=!1,h;const p=g.createElement(c7,{key:`modal-${kk}`,config:i(s),ref:c,afterClose:()=>{h==null||h()},isSilent:()=>f,onConfirm:m=>{u(m)}});return h=(l=e.current)===null||l===void 0?void 0:l.patchElement(p),h&&wa.push(h),{destroy:()=>{function m(){var b;(b=c.current)===null||b===void 0||b.destroy()}c.current?m():n(b=>[].concat(de(b),[m]))},update:m=>{function b(){var y;(y=c.current)===null||y===void 0||y.update(m)}c.current?b():n(y=>[].concat(de(y),[b]))},then:m=>(f=!0,d.then(m))}},[]);return[g.useMemo(()=>({info:r(wk),success:r(Ek),error:r($k),warning:r(xk),confirm:r(Ok)}),[r]),g.createElement(u7,{key:"modal-holder",ref:e})]}const f7=w.createContext({});function Mk(e){return t=>g.createElement(ho,{theme:{token:{motion:!1,zIndexPopupBase:0}}},g.createElement(e,Object.assign({},t)))}const Nk=(e,t,n,r,o)=>Mk(a=>{const{prefixCls:s,style:l}=a,c=g.useRef(null),[u,d]=g.useState(0),[f,h]=g.useState(0),[p,v]=cn(!1,{value:a.open}),{getPrefixCls:m}=g.useContext(wt),b=m(r||"select",s);g.useEffect(()=>{if(v(!0),typeof ResizeObserver<"u"){const x=new ResizeObserver(E=>{const $=E[0].target;d($.offsetHeight+8),h($.offsetWidth)}),S=setInterval(()=>{var E;const $=o?`.${o(b)}`:`.${b}-dropdown`,O=(E=c.current)===null||E===void 0?void 0:E.querySelector($);O&&(clearInterval(S),x.observe(O))},10);return()=>{clearInterval(S),x.disconnect()}}},[b]);let y=Object.assign(Object.assign({},a),{style:Object.assign(Object.assign({},l),{margin:0}),open:p,visible:p,getPopupContainer:()=>c.current});n&&(y=n(y)),t&&Object.assign(y,{[t]:{overflow:{adjustX:!1,adjustY:!1}}});const C={paddingBottom:u,position:"relative",minWidth:f};return g.createElement("div",{ref:c,style:C},g.createElement(e,Object.assign({},y)))}),gf=(function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))});var vf=function(t){var n=t.className,r=t.customizeIcon,o=t.customizeIconProps,i=t.children,a=t.onMouseDown,s=t.onClick,l=typeof r=="function"?r(o):r;return g.createElement("span",{className:n,onMouseDown:function(u){u.preventDefault(),a==null||a(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},l!==void 0?l:g.createElement("span",{className:J(n.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},i))},h7=function(t,n,r,o,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=w.useMemo(function(){if(Ue(o)==="object")return o.clearIcon;if(i)return i},[o,i]),u=w.useMemo(function(){return!!(!a&&o&&(r.length||s)&&!(l==="combobox"&&s===""))},[o,a,r.length,s,l]);return{allowClear:u,clearIcon:w.createElement(vf,{className:"".concat(t,"-clear"),onMouseDown:n,customizeIcon:c},"×")}},Tk=g.createContext(null);function p7(){return g.useContext(Tk)}function m7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=g.useState(!1),n=Y(t,2),r=n[0],o=n[1],i=g.useRef(null),a=function(){window.clearTimeout(i.current)};g.useEffect(function(){return a},[]);var s=function(c,u){a(),i.current=window.setTimeout(function(){o(c),u&&u()},e)};return[r,s,a]}function Ik(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=g.useRef(null),n=g.useRef(null);g.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(o){(o||t.current===null)&&(t.current=o),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},r]}function g7(e,t,n,r){var o=g.useRef(null);o.current={open:t,triggerOpen:n,customizedTrigger:r},g.useEffect(function(){function i(a){var s;if(!((s=o.current)!==null&&s!==void 0&&s.customizedTrigger)){var l=a.target;l.shadowRoot&&a.composed&&(l=a.composedPath()[0]||l),o.current.open&&e().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",i),function(){return window.removeEventListener("mousedown",i)}},[])}function v7(e){return e&&![Le.ESC,Le.SHIFT,Le.BACKSPACE,Le.TAB,Le.WIN_KEY,Le.ALT,Le.META,Le.WIN_KEY_RIGHT,Le.CTRL,Le.SEMICOLON,Le.EQUALS,Le.CAPS_LOCK,Le.CONTEXT_MENU,Le.F1,Le.F2,Le.F3,Le.F4,Le.F5,Le.F6,Le.F7,Le.F8,Le.F9,Le.F10,Le.F11,Le.F12].includes(e)}var b7=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Ps=void 0;function y7(e,t){var n=e.prefixCls,r=e.invalidate,o=e.item,i=e.renderItem,a=e.responsive,s=e.responsiveDisabled,l=e.registerSize,c=e.itemKey,u=e.className,d=e.style,f=e.children,h=e.display,p=e.order,v=e.component,m=v===void 0?"div":v,b=st(e,b7),y=a&&!h;function C(O){l(c,O)}g.useEffect(function(){return function(){C(null)}},[]);var x=i&&o!==Ps?i(o,{index:p}):f,S;r||(S={opacity:y?0:1,height:y?0:Ps,overflowY:y?"hidden":Ps,order:a?p:Ps,pointerEvents:y?"none":Ps,position:y?"absolute":Ps});var E={};y&&(E["aria-hidden"]=!0);var $=g.createElement(m,he({className:J(!r&&n,u),style:V(V({},S),d)},E,b,{ref:t}),x);return a&&($=g.createElement(zr,{onResize:function(k){var M=k.offsetWidth;C(M)},disabled:s},$)),$}var As=g.forwardRef(y7);As.displayName="Item";function C7(e){if(typeof MessageChannel>"u")Nt(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}function S7(){var e=g.useRef(null),t=function(r){e.current||(e.current=[],C7(function(){En.unstable_batchedUpdates(function(){e.current.forEach(function(o){o()}),e.current=null})})),e.current.push(r)};return t}function Rs(e,t){var n=g.useState(t),r=Y(n,2),o=r[0],i=r[1],a=qt(function(s){e(function(){i(s)})});return[o,a]}var bf=w.createContext(null),x7=["component"],w7=["className"],E7=["className"],$7=function(t,n){var r=g.useContext(bf);if(!r){var o=t.component,i=o===void 0?"div":o,a=st(t,x7);return g.createElement(i,he({},a,{ref:n}))}var s=r.className,l=st(r,w7),c=t.className,u=st(t,E7);return g.createElement(bf.Provider,{value:null},g.createElement(As,he({ref:n,className:J(s,c)},l,u)))},Pk=g.forwardRef($7);Pk.displayName="RawItem";var O7=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],Ak="responsive",Rk="invalidate";function k7(e){return"+ ".concat(e.length," ...")}function M7(e,t){var n=e.prefixCls,r=n===void 0?"rc-overflow":n,o=e.data,i=o===void 0?[]:o,a=e.renderItem,s=e.renderRawItem,l=e.itemKey,c=e.itemWidth,u=c===void 0?10:c,d=e.ssr,f=e.style,h=e.className,p=e.maxCount,v=e.renderRest,m=e.renderRawRest,b=e.prefix,y=e.suffix,C=e.component,x=C===void 0?"div":C,S=e.itemComponent,E=e.onVisibleChange,$=st(e,O7),O=d==="full",k=S7(),M=Rs(k,null),T=Y(M,2),I=T[0],R=T[1],N=I||0,P=Rs(k,new Map),A=Y(P,2),_=A[0],B=A[1],F=Rs(k,0),U=Y(F,2),K=U[0],j=U[1],D=Rs(k,0),H=Y(D,2),W=H[0],q=H[1],te=Rs(k,0),G=Y(te,2),re=G[0],oe=G[1],ne=Rs(k,0),Z=Y(ne,2),ae=Z[0],ie=Z[1],X=w.useState(null),ee=Y(X,2),le=ee[0],ce=ee[1],ue=w.useState(null),ge=Y(ue,2),ye=ge[0],$e=ge[1],Ce=g.useMemo(function(){return ye===null&&O?Number.MAX_SAFE_INTEGER:ye||0},[ye,I]),se=w.useState(!1),Se=Y(se,2),ze=Se[0],Ge=Se[1],Pe="".concat(r,"-item"),Oe=Math.max(K,W),qe=p===Ak,Ne=i.length&&qe,Fe=p===Rk,Ae=Ne||typeof p=="number"&&i.length>p,ke=w.useMemo(function(){var me=i;return Ne?I===null&&O?me=i:me=i.slice(0,Math.min(i.length,N/u)):typeof p=="number"&&(me=i.slice(0,p)),me},[i,u,I,p,Ne]),Xe=w.useMemo(function(){return Ne?i.slice(Ce+1):i.slice(ke.length)},[i,ke,Ne,Ce]),pe=w.useCallback(function(me,fe){var we;return typeof l=="function"?l(me):(we=l&&(me==null?void 0:me[l]))!==null&&we!==void 0?we:fe},[l]),ve=w.useCallback(a||function(me){return me},[a]);function Ve(me,fe,we){ye===me&&(fe===void 0||fe===le)||($e(me),we||(Ge(me<i.length-1),E==null||E(me)),fe!==void 0&&ce(fe))}function xe(me,fe){R(fe.clientWidth)}function tt(me,fe){B(function(we){var Ze=new Map(we);return fe===null?Ze.delete(me):Ze.set(me,fe),Ze})}function pt(me,fe){q(fe),j(W)}function Re(me,fe){oe(fe)}function je(me,fe){ie(fe)}function Qe(me){return _.get(pe(ke[me],me))}Yt(function(){if(N&&typeof Oe=="number"&&ke){var me=re+ae,fe=ke.length,we=fe-1;if(!fe){Ve(0,null);return}for(var Ze=0;Ze<fe;Ze+=1){var Ye=Qe(Ze);if(O&&(Ye=Ye||0),Ye===void 0){Ve(Ze-1,void 0,!0);break}if(me+=Ye,we===0&&me<=N||Ze===we-1&&me+Qe(we)<=N){Ve(we,null);break}else if(me+Oe>N){Ve(Ze-1,me-Ye-ae+W);break}}y&&Qe(0)+ae>N&&ce(null)}},[N,_,W,re,ae,pe,ke]);var Be=ze&&!!Xe.length,it={};le!==null&&Ne&&(it={position:"absolute",left:le,top:0});var $t={prefixCls:Pe,responsive:Ne,component:S,invalidate:Fe},bt=s?function(me,fe){var we=pe(me,fe);return g.createElement(bf.Provider,{key:we,value:V(V({},$t),{},{order:fe,item:me,itemKey:we,registerSize:tt,display:fe<=Ce})},s(me,fe))}:function(me,fe){var we=pe(me,fe);return g.createElement(As,he({},$t,{order:fe,key:we,item:me,renderItem:ve,itemKey:we,registerSize:tt,display:fe<=Ce}))},rt={order:Be?Ce:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:pt,display:Be},dt=v||k7,ut=m?g.createElement(bf.Provider,{value:V(V({},$t),rt)},m(Xe)):g.createElement(As,he({},$t,rt),typeof dt=="function"?dt(Xe):dt),De=g.createElement(x,he({className:J(!Fe&&r,h),style:f,ref:t},$),b&&g.createElement(As,he({},$t,{responsive:qe,responsiveDisabled:!Ne,order:-1,className:"".concat(Pe,"-prefix"),registerSize:Re,display:!0}),b),ke.map(bt),Ae?ut:null,y&&g.createElement(As,he({},$t,{responsive:qe,responsiveDisabled:!Ne,order:Ce,className:"".concat(Pe,"-suffix"),registerSize:je,display:!0,style:it}),y));return qe?g.createElement(zr,{onResize:xe,disabled:!Ne},De):De}var Ro=g.forwardRef(M7);Ro.displayName="Overflow",Ro.Item=Pk,Ro.RESPONSIVE=Ak,Ro.INVALIDATE=Rk;function N7(e,t,n){var r=V(V({},e),t);return Object.keys(t).forEach(function(o){var i=t[o];typeof i=="function"&&(r[o]=function(){for(var a,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i.apply(void 0,l),(a=e[o])===null||a===void 0?void 0:a.call.apply(a,[e].concat(l))})}),r}var T7={},I7=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],P7=function(t,n){var r=t.prefixCls,o=t.id,i=t.inputElement,a=t.autoFocus,s=t.autoComplete,l=t.editable,c=t.activeDescendantId,u=t.value,d=t.open,f=t.attrs,h=st(t,I7),p=i||g.createElement("input",null),v=p,m=v.ref,b=v.props;return Mo(!("maxLength"in p.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),p=g.cloneElement(p,V(V(V({type:"search"},N7(h,b)),{},{id:o,ref:sr(n,m),autoComplete:s||"off",autoFocus:a,className:J("".concat(r,"-selection-search-input"),b==null?void 0:b.className),role:"combobox","aria-expanded":d||!1,"aria-haspopup":"listbox","aria-owns":"".concat(o,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(o,"_list"),"aria-activedescendant":d?c:void 0},f),{},{value:l?u:"",readOnly:!l,unselectable:l?null:"on",style:V(V({},b.style),{},{opacity:l?null:0})})),p},Rv=g.forwardRef(P7);T7.NODE_ENV!=="production"&&(Rv.displayName="Input");var A7={};function _v(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var R7=typeof window<"u"&&window.document&&window.document.documentElement,_7=A7.NODE_ENV!=="test"&&R7;function D7(e){return e!=null}function L7(e){return!e&&e!==0}function _k(e){return["string","number"].includes(Ue(e))}function Dk(e){var t=void 0;return e&&(_k(e.title)?t=e.title.toString():_k(e.label)&&(t=e.label.toString())),t}function j7(e,t){_7?g.useLayoutEffect(e,t):g.useEffect(e,t)}function z7(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var Lk=function(t){t.preventDefault(),t.stopPropagation()},B7=function(t){var n=t.id,r=t.prefixCls,o=t.values,i=t.open,a=t.searchValue,s=t.autoClearSearchValue,l=t.inputRef,c=t.placeholder,u=t.disabled,d=t.mode,f=t.showSearch,h=t.autoFocus,p=t.autoComplete,v=t.activeDescendantId,m=t.tabIndex,b=t.removeIcon,y=t.maxTagCount,C=t.maxTagTextLength,x=t.maxTagPlaceholder,S=x===void 0?function(ie){return"+ ".concat(ie.length," ...")}:x,E=t.tagRender,$=t.onToggleOpen,O=t.onRemove,k=t.onInputChange,M=t.onInputPaste,T=t.onInputKeyDown,I=t.onInputMouseDown,R=t.onInputCompositionStart,N=t.onInputCompositionEnd,P=t.onInputBlur,A=g.useRef(null),_=w.useState(0),B=Y(_,2),F=B[0],U=B[1],K=w.useState(!1),j=Y(K,2),D=j[0],H=j[1],W="".concat(r,"-selection"),q=i||d==="multiple"&&s===!1||d==="tags"?a:"",te=d==="tags"||d==="multiple"&&s===!1||f&&(i||D);j7(function(){U(A.current.scrollWidth)},[q]);var G=function(X,ee,le,ce,ue){return g.createElement("span",{title:Dk(X),className:J("".concat(W,"-item"),z({},"".concat(W,"-item-disabled"),le))},g.createElement("span",{className:"".concat(W,"-item-content")},ee),ce&&g.createElement(vf,{className:"".concat(W,"-item-remove"),onMouseDown:Lk,onClick:ue,customizeIcon:b},"×"))},re=function(X,ee,le,ce,ue,ge){var ye=function(Ce){Lk(Ce),$(!i)};return g.createElement("span",{onMouseDown:ye},E({label:ee,value:X,disabled:le,closable:ce,onClose:ue,isMaxTag:!!ge}))},oe=function(X){var ee=X.disabled,le=X.label,ce=X.value,ue=!u&&!ee,ge=le;if(typeof C=="number"&&(typeof le=="string"||typeof le=="number")){var ye=String(ge);ye.length>C&&(ge="".concat(ye.slice(0,C),"..."))}var $e=function(se){se&&se.stopPropagation(),O(X)};return typeof E=="function"?re(ce,ge,ee,ue,$e):G(X,ge,ee,ue,$e)},ne=function(X){if(!o.length)return null;var ee=typeof S=="function"?S(X):S;return typeof E=="function"?re(void 0,ee,!1,!1,void 0,!0):G({title:ee},ee,!1)},Z=g.createElement("div",{className:"".concat(W,"-search"),style:{width:F},onFocus:function(){H(!0)},onBlur:function(){H(!1)}},g.createElement(Rv,{ref:l,open:i,prefixCls:r,id:n,inputElement:null,disabled:u,autoFocus:h,autoComplete:p,editable:te,activeDescendantId:v,value:q,onKeyDown:T,onMouseDown:I,onChange:k,onPaste:M,onCompositionStart:R,onCompositionEnd:N,onBlur:P,tabIndex:m,attrs:Vr(t,!0)}),g.createElement("span",{ref:A,className:"".concat(W,"-search-mirror"),"aria-hidden":!0},q," ")),ae=g.createElement(Ro,{prefixCls:"".concat(W,"-overflow"),data:o,renderItem:oe,renderRest:ne,suffix:Z,itemKey:z7,maxCount:y});return g.createElement("span",{className:"".concat(W,"-wrap")},ae,!o.length&&!q&&g.createElement("span",{className:"".concat(W,"-placeholder")},c))},F7=function(t){var n=t.inputElement,r=t.prefixCls,o=t.id,i=t.inputRef,a=t.disabled,s=t.autoFocus,l=t.autoComplete,c=t.activeDescendantId,u=t.mode,d=t.open,f=t.values,h=t.placeholder,p=t.tabIndex,v=t.showSearch,m=t.searchValue,b=t.activeValue,y=t.maxLength,C=t.onInputKeyDown,x=t.onInputMouseDown,S=t.onInputChange,E=t.onInputPaste,$=t.onInputCompositionStart,O=t.onInputCompositionEnd,k=t.onInputBlur,M=t.title,T=g.useState(!1),I=Y(T,2),R=I[0],N=I[1],P=u==="combobox",A=P||v,_=f[0],B=m||"";P&&b&&!R&&(B=b),g.useEffect(function(){P&&N(!1)},[P,b]);var F=u!=="combobox"&&!d&&!v?!1:!!B,U=M===void 0?Dk(_):M,K=g.useMemo(function(){return _?null:g.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},h)},[_,F,h,r]);return g.createElement("span",{className:"".concat(r,"-selection-wrap")},g.createElement("span",{className:"".concat(r,"-selection-search")},g.createElement(Rv,{ref:i,prefixCls:r,id:o,open:d,inputElement:n,disabled:a,autoFocus:s,autoComplete:l,editable:A,activeDescendantId:c,value:B,onKeyDown:C,onMouseDown:x,onChange:function(D){N(!0),S(D)},onPaste:E,onCompositionStart:$,onCompositionEnd:O,onBlur:k,tabIndex:p,attrs:Vr(t,!0),maxLength:P?y:void 0})),!P&&_?g.createElement("span",{className:"".concat(r,"-selection-item"),title:U,style:F?{visibility:"hidden"}:void 0},_.label):null,K)},H7={},V7=function(t,n){var r=w.useRef(null),o=w.useRef(!1),i=t.prefixCls,a=t.open,s=t.mode,l=t.showSearch,c=t.tokenWithEnter,u=t.disabled,d=t.prefix,f=t.autoClearSearchValue,h=t.onSearch,p=t.onSearchSubmit,v=t.onToggleOpen,m=t.onInputKeyDown,b=t.onInputBlur,y=t.domRef;g.useImperativeHandle(n,function(){return{focus:function(U){r.current.focus(U)},blur:function(){r.current.blur()}}});var C=Ik(0),x=Y(C,2),S=x[0],E=x[1],$=function(U){var K=U.which,j=r.current instanceof HTMLTextAreaElement;!j&&a&&(K===Le.UP||K===Le.DOWN)&&U.preventDefault(),m&&m(U),K===Le.ENTER&&s==="tags"&&!o.current&&!a&&(p==null||p(U.target.value)),!(j&&!a&&~[Le.UP,Le.DOWN,Le.LEFT,Le.RIGHT].indexOf(K))&&v7(K)&&v(!0)},O=function(){E(!0)},k=w.useRef(null),M=function(U){h(U,!0,o.current)!==!1&&v(!0)},T=function(){o.current=!0},I=function(U){o.current=!1,s!=="combobox"&&M(U.target.value)},R=function(U){var K=U.target.value;if(c&&k.current&&/[\r\n]/.test(k.current)){var j=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");K=K.replace(j,k.current)}k.current=null,M(K)},N=function(U){var K=U.clipboardData,j=K==null?void 0:K.getData("text");k.current=j||""},P=function(U){var K=U.target;if(K!==r.current){var j=document.body.style.msTouchAction!==void 0;j?setTimeout(function(){r.current.focus()}):r.current.focus()}},A=function(U){var K=S();U.target!==r.current&&!K&&!(s==="combobox"&&u)&&U.preventDefault(),(s!=="combobox"&&(!l||!K)||!a)&&(a&&f!==!1&&h("",!0,!1),v())},_={inputRef:r,onInputKeyDown:$,onInputMouseDown:O,onInputChange:R,onInputPaste:N,onInputCompositionStart:T,onInputCompositionEnd:I,onInputBlur:b},B=s==="multiple"||s==="tags"?g.createElement(B7,he({},t,_)):g.createElement(F7,he({},t,_));return g.createElement("div",{ref:y,className:"".concat(i,"-selector"),onClick:P,onMouseDown:A},d&&g.createElement("div",{className:"".concat(i,"-prefix")},d),B)},jk=g.forwardRef(V7);H7.NODE_ENV!=="production"&&(jk.displayName="Selector");function W7(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,i=r||{},a=i.className,s=i.content,l=o.x,c=l===void 0?0:l,u=o.y,d=u===void 0?0:u,f=g.useRef();if(!n||!n.points)return null;var h={position:"absolute"};if(n.autoArrow!==!1){var p=n.points[0],v=n.points[1],m=p[0],b=p[1],y=v[0],C=v[1];m===y||!["t","b"].includes(m)?h.top=d:m==="t"?h.top=0:h.bottom=0,b===C||!["l","r"].includes(b)?h.left=c:b==="l"?h.left=0:h.right=0}return g.createElement("div",{ref:f,className:J("".concat(t,"-arrow"),a),style:h},s)}function U7(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,i=e.motion;return o?g.createElement(Er,he({},i,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(a){var s=a.className;return g.createElement("div",{style:{zIndex:r},className:J("".concat(t,"-mask"),s)})}):null}var q7={},zk=g.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});q7.NODE_ENV!=="production"&&(zk.displayName="PopupContent");var K7={},Bk=g.forwardRef(function(e,t){var n=e.popup,r=e.className,o=e.prefixCls,i=e.style,a=e.target,s=e.onVisibleChanged,l=e.open,c=e.keepDom,u=e.fresh,d=e.onClick,f=e.mask,h=e.arrow,p=e.arrowPos,v=e.align,m=e.motion,b=e.maskMotion,y=e.forceRender,C=e.getPopupContainer,x=e.autoDestroy,S=e.portal,E=e.zIndex,$=e.onMouseEnter,O=e.onMouseLeave,k=e.onPointerEnter,M=e.onPointerDownCapture,T=e.ready,I=e.offsetX,R=e.offsetY,N=e.offsetR,P=e.offsetB,A=e.onAlign,_=e.onPrepare,B=e.stretch,F=e.targetWidth,U=e.targetHeight,K=typeof n=="function"?n():n,j=l||c,D=(C==null?void 0:C.length)>0,H=g.useState(!C||!D),W=Y(H,2),q=W[0],te=W[1];if(Yt(function(){!q&&D&&a&&te(!0)},[q,D,a]),!q)return null;var G="auto",re={left:"-1000vw",top:"-1000vh",right:G,bottom:G};if(T||!l){var oe,ne=v.points,Z=v.dynamicInset||((oe=v._experimental)===null||oe===void 0?void 0:oe.dynamicInset),ae=Z&&ne[0][1]==="r",ie=Z&&ne[0][0]==="b";ae?(re.right=N,re.left=G):(re.left=I,re.right=G),ie?(re.bottom=P,re.top=G):(re.top=R,re.bottom=G)}var X={};return B&&(B.includes("height")&&U?X.height=U:B.includes("minHeight")&&U&&(X.minHeight=U),B.includes("width")&&F?X.width=F:B.includes("minWidth")&&F&&(X.minWidth=F)),l||(X.pointerEvents="none"),g.createElement(S,{open:y||j,getContainer:C&&function(){return C(a)},autoDestroy:x},g.createElement(U7,{prefixCls:o,open:l,zIndex:E,mask:f,motion:b}),g.createElement(zr,{onResize:A,disabled:!l},function(ee){return g.createElement(Er,he({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:y,leavedClassName:"".concat(o,"-hidden")},m,{onAppearPrepare:_,onEnterPrepare:_,visible:l,onVisibleChanged:function(ce){var ue;m==null||(ue=m.onVisibleChanged)===null||ue===void 0||ue.call(m,ce),s(ce)}}),function(le,ce){var ue=le.className,ge=le.style,ye=J(o,ue,r);return g.createElement("div",{ref:sr(ee,t,ce),className:ye,style:V(V(V(V({"--arrow-x":"".concat(p.x||0,"px"),"--arrow-y":"".concat(p.y||0,"px")},re),X),ge),{},{boxSizing:"border-box",zIndex:E},i),onMouseEnter:$,onMouseLeave:O,onPointerEnter:k,onClick:d,onPointerDownCapture:M},h&&g.createElement(W7,{prefixCls:o,arrow:h,arrowPos:p,align:v}),g.createElement(zk,{cache:!l&&!u},K))})}))});K7.NODE_ENV!=="production"&&(Bk.displayName="Popup");var G7={},Fk=g.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=pa(n),i=g.useCallback(function(s){jm(t,r?r(s):s)},[r]),a=Pi(i,rs(n));return o?g.cloneElement(n,{ref:a}):n});G7.NODE_ENV!=="production"&&(Fk.displayName="TriggerWrapper");var Hk=g.createContext(null);function Vk(e){return e?Array.isArray(e)?e:[e]:[]}function X7(e,t,n,r){return g.useMemo(function(){var o=Vk(n??t),i=Vk(r??t),a=new Set(o),s=new Set(i);return e&&(a.has("hover")&&(a.delete("hover"),a.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[a,s]},[e,t,n,r])}function Y7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function J7(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a<i.length;a+=1){var s,l=i[a];if(Y7((s=e[l])===null||s===void 0?void 0:s.points,o,r))return"".concat(t,"-placement-").concat(l)}return""}function Wk(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function rc(e){return e.ownerDocument.defaultView}function Dv(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=rc(n).getComputedStyle(n),i=o.overflowX,a=o.overflowY,s=o.overflow;[i,a,s].some(function(l){return r.includes(l)})&&t.push(n),n=n.parentElement}return t}function oc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function ic(e){return oc(parseFloat(e),0)}function Uk(e,t){var n=V({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var o=rc(r).getComputedStyle(r),i=o.overflow,a=o.overflowClipMargin,s=o.borderTopWidth,l=o.borderBottomWidth,c=o.borderLeftWidth,u=o.borderRightWidth,d=r.getBoundingClientRect(),f=r.offsetHeight,h=r.clientHeight,p=r.offsetWidth,v=r.clientWidth,m=ic(s),b=ic(l),y=ic(c),C=ic(u),x=oc(Math.round(d.width/p*1e3)/1e3),S=oc(Math.round(d.height/f*1e3)/1e3),E=(p-v-y-C)*x,$=(f-h-m-b)*S,O=m*S,k=b*S,M=y*x,T=C*x,I=0,R=0;if(i==="clip"){var N=ic(a);I=N*x,R=N*S}var P=d.x+M-I,A=d.y+O-R,_=P+d.width+2*I-M-T-E,B=A+d.height+2*R-O-k-$;n.left=Math.max(n.left,P),n.top=Math.max(n.top,A),n.right=Math.min(n.right,_),n.bottom=Math.min(n.bottom,B)}}),n}function qk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function Kk(e,t){var n=t||[],r=Y(n,2),o=r[0],i=r[1];return[qk(e.width,o),qk(e.height,i)]}function Gk(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function _s(e,t){var n=t[0],r=t[1],o,i;return n==="t"?i=e.y:n==="b"?i=e.y+e.height:i=e.y+e.height/2,r==="l"?o=e.x:r==="r"?o=e.x+e.width:o=e.x+e.width/2,{x:o,y:i}}function Hi(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,o){return o===t?n[r]||"c":r}).join("")}function Q7(e,t,n,r,o,i,a){var s=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[r]||{}}),l=Y(s,2),c=l[0],u=l[1],d=g.useRef(0),f=g.useMemo(function(){return t?Dv(t):[]},[t]),h=g.useRef({}),p=function(){h.current={}};e||p();var v=qt(function(){if(t&&n&&e){let Yr=function($c,ai){var Ki=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Se,Oc=j.x+$c,ch=j.y+ai,i0=Oc+ie,a0=ch+ae,s0=Math.max(Oc,Ki.left),ot=Math.max(ch,Ki.top),vt=Math.min(i0,Ki.right),mn=Math.min(a0,Ki.bottom);return Math.max(0,(vt-s0)*(mn-ot))},Ws=function(){jt=j.y+dt,Zt=jt+ae,On=j.x+rt,Ft=On+ie};var y,C,x,S,E=t,$=E.ownerDocument,O=rc(E),k=O.getComputedStyle(E),M=k.position,T=E.style.left,I=E.style.top,R=E.style.right,N=E.style.bottom,P=E.style.overflow,A=V(V({},o[r]),i),_=$.createElement("div");(y=E.parentElement)===null||y===void 0||y.appendChild(_),_.style.left="".concat(E.offsetLeft,"px"),_.style.top="".concat(E.offsetTop,"px"),_.style.position=M,_.style.height="".concat(E.offsetHeight,"px"),_.style.width="".concat(E.offsetWidth,"px"),E.style.left="0",E.style.top="0",E.style.right="auto",E.style.bottom="auto",E.style.overflow="hidden";var B;if(Array.isArray(n))B={x:n[0],y:n[1],width:0,height:0};else{var F,U,K=n.getBoundingClientRect();K.x=(F=K.x)!==null&&F!==void 0?F:K.left,K.y=(U=K.y)!==null&&U!==void 0?U:K.top,B={x:K.x,y:K.y,width:K.width,height:K.height}}var j=E.getBoundingClientRect(),D=O.getComputedStyle(E),H=D.height,W=D.width;j.x=(C=j.x)!==null&&C!==void 0?C:j.left,j.y=(x=j.y)!==null&&x!==void 0?x:j.top;var q=$.documentElement,te=q.clientWidth,G=q.clientHeight,re=q.scrollWidth,oe=q.scrollHeight,ne=q.scrollTop,Z=q.scrollLeft,ae=j.height,ie=j.width,X=B.height,ee=B.width,le={left:0,top:0,right:te,bottom:G},ce={left:-Z,top:-ne,right:re-Z,bottom:oe-ne},ue=A.htmlRegion,ge="visible",ye="visibleFirst";ue!=="scroll"&&ue!==ye&&(ue=ge);var $e=ue===ye,Ce=Uk(ce,f),se=Uk(le,f),Se=ue===ge?se:Ce,ze=$e?se:Se;E.style.left="auto",E.style.top="auto",E.style.right="0",E.style.bottom="0";var Ge=E.getBoundingClientRect();E.style.left=T,E.style.top=I,E.style.right=R,E.style.bottom=N,E.style.overflow=P,(S=E.parentElement)===null||S===void 0||S.removeChild(_);var Pe=oc(Math.round(ie/parseFloat(W)*1e3)/1e3),Oe=oc(Math.round(ae/parseFloat(H)*1e3)/1e3);if(Pe===0||Oe===0||Il(n)&&!Qg(n))return;var qe=A.offset,Ne=A.targetOffset,Fe=Kk(j,qe),Ae=Y(Fe,2),ke=Ae[0],Xe=Ae[1],pe=Kk(B,Ne),ve=Y(pe,2),Ve=ve[0],xe=ve[1];B.x-=Ve,B.y-=xe;var tt=A.points||[],pt=Y(tt,2),Re=pt[0],je=pt[1],Qe=Gk(je),Be=Gk(Re),it=_s(B,Qe),$t=_s(j,Be),bt=V({},A),rt=it.x-$t.x+ke,dt=it.y-$t.y+Xe,ut=Yr(rt,dt),De=Yr(rt,dt,se),me=_s(B,["t","l"]),fe=_s(j,["t","l"]),we=_s(B,["b","r"]),Ze=_s(j,["b","r"]),Ye=A.overflow||{},yt=Ye.adjustX,St=Ye.adjustY,At=Ye.shiftX,Et=Ye.shiftY,Bt=function(ai){return typeof ai=="boolean"?ai:ai>=0},jt,Zt,On,Ft;Ws();var Jt=Bt(St),Me=Be[0]===Qe[0];if(Jt&&Be[0]==="t"&&(Zt>ze.bottom||h.current.bt)){var Ke=dt;Me?Ke-=ae-X:Ke=me.y-Ze.y-Xe;var We=Yr(rt,Ke),Te=Yr(rt,Ke,se);We>ut||We===ut&&(!$e||Te>=De)?(h.current.bt=!0,dt=Ke,Xe=-Xe,bt.points=[Hi(Be,0),Hi(Qe,0)]):h.current.bt=!1}if(Jt&&Be[0]==="b"&&(jt<ze.top||h.current.tb)){var _e=dt;Me?_e+=ae-X:_e=we.y-fe.y-Xe;var Ie=Yr(rt,_e),Je=Yr(rt,_e,se);Ie>ut||Ie===ut&&(!$e||Je>=De)?(h.current.tb=!0,dt=_e,Xe=-Xe,bt.points=[Hi(Be,0),Hi(Qe,0)]):h.current.tb=!1}var mt=Bt(yt),Ct=Be[1]===Qe[1];if(mt&&Be[1]==="l"&&(Ft>ze.right||h.current.rl)){var Mt=rt;Ct?Mt-=ie-ee:Mt=me.x-Ze.x-ke;var Ht=Yr(Mt,dt),xn=Yr(Mt,dt,se);Ht>ut||Ht===ut&&(!$e||xn>=De)?(h.current.rl=!0,rt=Mt,ke=-ke,bt.points=[Hi(Be,1),Hi(Qe,1)]):h.current.rl=!1}if(mt&&Be[1]==="r"&&(On<ze.left||h.current.lr)){var pn=rt;Ct?pn+=ie-ee:pn=we.x-fe.x-ke;var bn=Yr(pn,dt),Fn=Yr(pn,dt,se);bn>ut||bn===ut&&(!$e||Fn>=De)?(h.current.lr=!0,rt=pn,ke=-ke,bt.points=[Hi(Be,1),Hi(Qe,1)]):h.current.lr=!1}Ws();var An=At===!0?0:At;typeof An=="number"&&(On<se.left&&(rt-=On-se.left-ke,B.x+ee<se.left+An&&(rt+=B.x-se.left+ee-An)),Ft>se.right&&(rt-=Ft-se.right-ke,B.x>se.right-An&&(rt+=B.x-se.right+An)));var ur=Et===!0?0:Et;typeof ur=="number"&&(jt<se.top&&(dt-=jt-se.top-Xe,B.y+X<se.top+ur&&(dt+=B.y-se.top+X-ur)),Zt>se.bottom&&(dt-=Zt-se.bottom-Xe,B.y>se.bottom-ur&&(dt+=B.y-se.bottom+ur)));var hr=j.x+rt,Xr=hr+ie,zo=j.y+dt,ii=zo+ae,Ot=B.x,et=Ot+ee,gt=B.y,xt=gt+X,Tt=Math.max(hr,Ot),Rt=Math.min(Xr,et),Hn=(Tt+Rt)/2,Vn=Hn-hr,pr=Math.max(zo,gt),Ir=Math.min(ii,xt),mr=(pr+Ir)/2,gr=mr-zo;a==null||a(t,bt);var _n=Ge.right-j.x-(rt+j.width),Da=Ge.bottom-j.y-(dt+j.height);Pe===1&&(rt=Math.floor(rt),_n=Math.floor(_n)),Oe===1&&(dt=Math.floor(dt),Da=Math.floor(Da));var o0={ready:!0,offsetX:rt/Pe,offsetY:dt/Oe,offsetR:_n/Pe,offsetB:Da/Oe,arrowX:Vn/Pe,arrowY:gr/Oe,scaleX:Pe,scaleY:Oe,align:bt};u(o0)}}),m=function(){d.current+=1;var C=d.current;Promise.resolve().then(function(){d.current===C&&v()})},b=function(){u(function(C){return V(V({},C),{},{ready:!1})})};return Yt(b,[r]),Yt(function(){e||b()},[e]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,m]}function Z7(e,t,n,r,o){Yt(function(){if(e&&t&&n){let d=function(){r(),o()};var i=t,a=n,s=Dv(i),l=Dv(a),c=rc(a),u=new Set([c].concat(de(s),de(l)));return u.forEach(function(f){f.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),r(),function(){u.forEach(function(f){f.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[e,t,n])}var e9={};function t9(e,t,n,r,o,i,a,s){var l=g.useRef(e);l.current=e;var c=g.useRef(!1);g.useEffect(function(){if(t&&r&&(!o||i)){var d=function(){c.current=!1},f=function(x){var S;l.current&&!a(((S=x.composedPath)===null||S===void 0||(S=S.call(x))===null||S===void 0?void 0:S[0])||x.target)&&!c.current&&s(!1)},h=rc(r);h.addEventListener("pointerdown",d,!0),h.addEventListener("mousedown",f,!0),h.addEventListener("contextmenu",f,!0);var p=Hd(n);if(p&&(p.addEventListener("mousedown",f,!0),p.addEventListener("contextmenu",f,!0)),e9.NODE_ENV!=="production"){var v,m,b=n==null||(v=n.getRootNode)===null||v===void 0?void 0:v.call(n),y=(m=r.getRootNode)===null||m===void 0?void 0:m.call(r);Mo(b===y,"trigger element and popup element should in same shadow root.")}return function(){h.removeEventListener("pointerdown",d,!0),h.removeEventListener("mousedown",f,!0),h.removeEventListener("contextmenu",f,!0),p&&(p.removeEventListener("mousedown",f,!0),p.removeEventListener("contextmenu",f,!0))}}},[t,n,r,o,i]);function u(){c.current=!0}return u}var n9={},r9=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function o9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sf,t=g.forwardRef(function(n,r){var o=n.prefixCls,i=o===void 0?"rc-trigger-popup":o,a=n.children,s=n.action,l=s===void 0?"hover":s,c=n.showAction,u=n.hideAction,d=n.popupVisible,f=n.defaultPopupVisible,h=n.onPopupVisibleChange,p=n.afterPopupVisibleChange,v=n.mouseEnterDelay,m=n.mouseLeaveDelay,b=m===void 0?.1:m,y=n.focusDelay,C=n.blurDelay,x=n.mask,S=n.maskClosable,E=S===void 0?!0:S,$=n.getPopupContainer,O=n.forceRender,k=n.autoDestroy,M=n.destroyPopupOnHide,T=n.popup,I=n.popupClassName,R=n.popupStyle,N=n.popupPlacement,P=n.builtinPlacements,A=P===void 0?{}:P,_=n.popupAlign,B=n.zIndex,F=n.stretch,U=n.getPopupClassNameFromAlign,K=n.fresh,j=n.alignPoint,D=n.onPopupClick,H=n.onPopupAlign,W=n.arrow,q=n.popupMotion,te=n.maskMotion,G=n.popupTransitionName,re=n.popupAnimation,oe=n.maskTransitionName,ne=n.maskAnimation,Z=n.className,ae=n.getTriggerDOMNode,ie=st(n,r9),X=k||M||!1,ee=g.useState(!1),le=Y(ee,2),ce=le[0],ue=le[1];Yt(function(){ue(gf())},[]);var ge=g.useRef({}),ye=g.useContext(Hk),$e=g.useMemo(function(){return{registerSubPopup:function(vt,mn){ge.current[vt]=mn,ye==null||ye.registerSubPopup(vt,mn)}}},[ye]),Ce=lf(),se=g.useState(null),Se=Y(se,2),ze=Se[0],Ge=Se[1],Pe=g.useRef(null),Oe=qt(function(ot){Pe.current=ot,Il(ot)&&ze!==ot&&Ge(ot),ye==null||ye.registerSubPopup(Ce,ot)}),qe=g.useState(null),Ne=Y(qe,2),Fe=Ne[0],Ae=Ne[1],ke=g.useRef(null),Xe=qt(function(ot){Il(ot)&&Fe!==ot&&(Ae(ot),ke.current=ot)}),pe=g.Children.only(a),ve=(pe==null?void 0:pe.props)||{},Ve={},xe=qt(function(ot){var vt,mn,Dn=Fe;return(Dn==null?void 0:Dn.contains(ot))||((vt=Hd(Dn))===null||vt===void 0?void 0:vt.host)===ot||ot===Dn||(ze==null?void 0:ze.contains(ot))||((mn=Hd(ze))===null||mn===void 0?void 0:mn.host)===ot||ot===ze||Object.values(ge.current).some(function(wn){return(wn==null?void 0:wn.contains(ot))||ot===wn})}),tt=Wk(i,q,re,G),pt=Wk(i,te,ne,oe),Re=g.useState(f||!1),je=Y(Re,2),Qe=je[0],Be=je[1],it=d??Qe,$t=qt(function(ot){d===void 0&&Be(ot)});Yt(function(){Be(d||!1)},[d]);var bt=g.useRef(it);bt.current=it;var rt=g.useRef([]);rt.current=[];var dt=qt(function(ot){var vt;$t(ot),((vt=rt.current[rt.current.length-1])!==null&&vt!==void 0?vt:it)!==ot&&(rt.current.push(ot),h==null||h(ot))}),ut=g.useRef(),De=function(){clearTimeout(ut.current)},me=function(vt){var mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;De(),mn===0?dt(vt):ut.current=setTimeout(function(){dt(vt)},mn*1e3)};g.useEffect(function(){return De},[]);var fe=g.useState(!1),we=Y(fe,2),Ze=we[0],Ye=we[1];Yt(function(ot){(!ot||it)&&Ye(!0)},[it]);var yt=g.useState(null),St=Y(yt,2),At=St[0],Et=St[1],Bt=g.useState(null),jt=Y(Bt,2),Zt=jt[0],On=jt[1],Ft=function(vt){On([vt.clientX,vt.clientY])},Jt=Q7(it,ze,j&&Zt!==null?Zt:Fe,N,A,_,H),Me=Y(Jt,11),Ke=Me[0],We=Me[1],Te=Me[2],_e=Me[3],Ie=Me[4],Je=Me[5],mt=Me[6],Ct=Me[7],Mt=Me[8],Ht=Me[9],xn=Me[10],pn=X7(ce,l,c,u),bn=Y(pn,2),Fn=bn[0],An=bn[1],ur=Fn.has("click"),hr=An.has("click")||An.has("contextMenu"),Xr=qt(function(){Ze||xn()}),zo=function(){bt.current&&j&&hr&&me(!1)};Z7(it,Fe,ze,Xr,zo),Yt(function(){Xr()},[Zt,N]),Yt(function(){it&&!(A!=null&&A[N])&&Xr()},[JSON.stringify(_)]);var ii=g.useMemo(function(){var ot=J7(A,i,Ht,j);return J(ot,U==null?void 0:U(Ht))},[Ht,U,A,i,j]);g.useImperativeHandle(r,function(){return{nativeElement:ke.current,popupElement:Pe.current,forceAlign:Xr}});var Ot=g.useState(0),et=Y(Ot,2),gt=et[0],xt=et[1],Tt=g.useState(0),Rt=Y(Tt,2),Hn=Rt[0],Vn=Rt[1],pr=function(){if(F&&Fe){var vt=Fe.getBoundingClientRect();xt(vt.width),Vn(vt.height)}},Ir=function(){pr(),Xr()},mr=function(vt){Ye(!1),xn(),p==null||p(vt)},gr=function(){return new Promise(function(vt){pr(),Et(function(){return vt})})};Yt(function(){At&&(xn(),At(),Et(null))},[At]);function _n(ot,vt,mn,Dn){Ve[ot]=function(wn){var uh;Dn==null||Dn(wn),me(vt,mn);for(var l0=arguments.length,MI=new Array(l0>1?l0-1:0),dh=1;dh<l0;dh++)MI[dh-1]=arguments[dh];(uh=ve[ot])===null||uh===void 0||uh.call.apply(uh,[ve,wn].concat(MI))}}(ur||hr)&&(Ve.onClick=function(ot){var vt;bt.current&&hr?me(!1):!bt.current&&ur&&(Ft(ot),me(!0));for(var mn=arguments.length,Dn=new Array(mn>1?mn-1:0),wn=1;wn<mn;wn++)Dn[wn-1]=arguments[wn];(vt=ve.onClick)===null||vt===void 0||vt.call.apply(vt,[ve,ot].concat(Dn))});var Da=t9(it,hr,Fe,ze,x,E,xe,me),o0=Fn.has("hover"),Yr=An.has("hover"),Ws,$c;o0&&(_n("onMouseEnter",!0,v,function(ot){Ft(ot)}),_n("onPointerEnter",!0,v,function(ot){Ft(ot)}),Ws=function(vt){(it||Ze)&&ze!==null&&ze!==void 0&&ze.contains(vt.target)&&me(!0,v)},j&&(Ve.onMouseMove=function(ot){var vt;(vt=ve.onMouseMove)===null||vt===void 0||vt.call(ve,ot)})),Yr&&(_n("onMouseLeave",!1,b),_n("onPointerLeave",!1,b),$c=function(){me(!1,b)}),Fn.has("focus")&&_n("onFocus",!0,y),An.has("focus")&&_n("onBlur",!1,C),Fn.has("contextMenu")&&(Ve.onContextMenu=function(ot){var vt;bt.current&&An.has("contextMenu")?me(!1):(Ft(ot),me(!0)),ot.preventDefault();for(var mn=arguments.length,Dn=new Array(mn>1?mn-1:0),wn=1;wn<mn;wn++)Dn[wn-1]=arguments[wn];(vt=ve.onContextMenu)===null||vt===void 0||vt.call.apply(vt,[ve,ot].concat(Dn))}),Z&&(Ve.className=J(ve.className,Z));var ai=g.useRef(!1);ai.current||(ai.current=O||it||Ze);var Ki=V(V({},ve),Ve),Oc={},ch=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];ch.forEach(function(ot){ie[ot]&&(Oc[ot]=function(){for(var vt,mn=arguments.length,Dn=new Array(mn),wn=0;wn<mn;wn++)Dn[wn]=arguments[wn];(vt=Ki[ot])===null||vt===void 0||vt.call.apply(vt,[Ki].concat(Dn)),ie[ot].apply(ie,Dn)})});var i0=g.cloneElement(pe,V(V({},Ki),Oc)),a0={x:Je,y:mt},s0=W?V({},W!==!0?W:{}):null;return g.createElement(g.Fragment,null,g.createElement(zr,{disabled:!it,ref:Xe,onResize:Ir},g.createElement(Fk,{getTriggerDOMNode:ae},i0)),ai.current&&g.createElement(Hk.Provider,{value:$e},g.createElement(Bk,{portal:e,ref:Oe,prefixCls:i,popup:T,className:J(I,ii),style:R,target:Fe,onMouseEnter:Ws,onMouseLeave:$c,onPointerEnter:Ws,zIndex:B,open:it,keepDom:Ze,fresh:K,onClick:D,onPointerDownCapture:Da,mask:x,motion:tt,maskMotion:pt,onVisibleChanged:mr,onPrepare:gr,forceRender:O,autoDestroy:X,getPopupContainer:$,align:Ht,arrow:s0,arrowPos:a0,ready:Ke,offsetX:We,offsetY:Te,offsetR:_e,offsetB:Ie,onAlign:Xr,stretch:F,targetWidth:gt/Ct,targetHeight:Hn/Mt})))});return n9.NODE_ENV!=="production"&&(t.displayName="Trigger"),t}const yf=o9(sf);var i9={},a9=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],s9=function(t){var n=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"}}},l9=function(t,n){var r=t.prefixCls;t.disabled;var o=t.visible,i=t.children,a=t.popupElement,s=t.animation,l=t.transitionName,c=t.dropdownStyle,u=t.dropdownClassName,d=t.direction,f=d===void 0?"ltr":d,h=t.placement,p=t.builtinPlacements,v=t.dropdownMatchSelectWidth,m=t.dropdownRender,b=t.dropdownAlign,y=t.getPopupContainer,C=t.empty,x=t.getTriggerDOMNode,S=t.onPopupVisibleChange,E=t.onPopupMouseEnter,$=st(t,a9),O="".concat(r,"-dropdown"),k=a;m&&(k=m(a));var M=g.useMemo(function(){return p||s9(v)},[p,v]),T=s?"".concat(O,"-").concat(s):l,I=typeof v=="number",R=g.useMemo(function(){return I?null:v===!1?"minWidth":"width"},[v,I]),N=c;I&&(N=V(V({},N),{},{width:v}));var P=g.useRef(null);return g.useImperativeHandle(n,function(){return{getPopupElement:function(){var _;return(_=P.current)===null||_===void 0?void 0:_.popupElement}}}),g.createElement(yf,he({},$,{showAction:S?["click"]:[],hideAction:S?["click"]:[],popupPlacement:h||(f==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:M,prefixCls:O,popupTransitionName:T,popup:g.createElement("div",{onMouseEnter:E},k),ref:P,stretch:R,popupAlign:b,popupVisible:o,getPopupContainer:y,popupClassName:J(u,z({},"".concat(O,"-empty"),C)),popupStyle:N,getTriggerDOMNode:x,onPopupVisibleChange:S}),i)},Xk=g.forwardRef(l9);i9.NODE_ENV!=="production"&&(Xk.displayName="SelectTrigger");function Yk(e,t){var n=e.key,r;return"value"in e&&(r=e.value),n??(r!==void 0?r:"rc-index-key-".concat(t))}function Lv(e){return typeof e<"u"&&!Number.isNaN(e)}function Jk(e,t){var n=e||{},r=n.label,o=n.value,i=n.options,a=n.groupLabel,s=r||(t?"children":"label");return{label:s,value:o||"value",options:i||"options",groupLabel:a||s}}function c9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],i=Jk(n,!1),a=i.label,s=i.value,l=i.options,c=i.groupLabel;function u(d,f){Array.isArray(d)&&d.forEach(function(h){if(f||!(l in h)){var p=h[s];o.push({key:Yk(h,o.length),groupOption:f,data:h,label:h[a],value:p})}else{var v=h[c];v===void 0&&r&&(v=h.label),o.push({key:Yk(h,o.length),group:!0,data:h,label:v}),u(h[l],!0)}})}return u(e,!1),o}function jv(e){var t=V({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return ft(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var u9=function(t,n,r){if(!n||!n.length)return null;var o=!1,i=function s(l,c){var u=Q1(c),d=u[0],f=u.slice(1);if(!d)return[l];var h=l.split(d);return o=o||h.length>1,h.reduce(function(p,v){return[].concat(de(p),de(s(v,f)))},[]).filter(Boolean)},a=i(t,n);return o?typeof r<"u"?a.slice(0,r):a:null},zv=g.createContext(null);function d9(e){var t=e.visible,n=e.values;if(!t)return null;var r=50;return g.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(o){var i=o.label,a=o.value;return["number","string"].includes(Ue(i))?i:a}).join(", ")),n.length>r?", ...":null)}var f9={},h9=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],p9=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Cf=function(t){return t==="tags"||t==="multiple"},Qk=g.forwardRef(function(e,t){var n,r=e.id,o=e.prefixCls,i=e.className,a=e.showSearch,s=e.tagRender,l=e.direction,c=e.omitDomProps,u=e.displayValues,d=e.onDisplayValuesChange,f=e.emptyOptions,h=e.notFoundContent,p=h===void 0?"Not Found":h,v=e.onClear,m=e.mode,b=e.disabled,y=e.loading,C=e.getInputElement,x=e.getRawInputElement,S=e.open,E=e.defaultOpen,$=e.onDropdownVisibleChange,O=e.activeValue,k=e.onActiveValueChange,M=e.activeDescendantId,T=e.searchValue,I=e.autoClearSearchValue,R=e.onSearch,N=e.onSearchSplit,P=e.tokenSeparators,A=e.allowClear,_=e.prefix,B=e.suffixIcon,F=e.clearIcon,U=e.OptionList,K=e.animation,j=e.transitionName,D=e.dropdownStyle,H=e.dropdownClassName,W=e.dropdownMatchSelectWidth,q=e.dropdownRender,te=e.dropdownAlign,G=e.placement,re=e.builtinPlacements,oe=e.getPopupContainer,ne=e.showAction,Z=ne===void 0?[]:ne,ae=e.onFocus,ie=e.onBlur,X=e.onKeyUp,ee=e.onKeyDown,le=e.onMouseDown,ce=st(e,h9),ue=Cf(m),ge=(a!==void 0?a:ue)||m==="combobox",ye=V({},ce);p9.forEach(function(Ot){delete ye[Ot]}),c==null||c.forEach(function(Ot){delete ye[Ot]});var $e=g.useState(!1),Ce=Y($e,2),se=Ce[0],Se=Ce[1];g.useEffect(function(){Se(gf())},[]);var ze=g.useRef(null),Ge=g.useRef(null),Pe=g.useRef(null),Oe=g.useRef(null),qe=g.useRef(null),Ne=g.useRef(!1),Fe=m7(),Ae=Y(Fe,3),ke=Ae[0],Xe=Ae[1],pe=Ae[2];g.useImperativeHandle(t,function(){var Ot,et;return{focus:(Ot=Oe.current)===null||Ot===void 0?void 0:Ot.focus,blur:(et=Oe.current)===null||et===void 0?void 0:et.blur,scrollTo:function(xt){var Tt;return(Tt=qe.current)===null||Tt===void 0?void 0:Tt.scrollTo(xt)},nativeElement:ze.current||Ge.current}});var ve=g.useMemo(function(){var Ot;if(m!=="combobox")return T;var et=(Ot=u[0])===null||Ot===void 0?void 0:Ot.value;return typeof et=="string"||typeof et=="number"?String(et):""},[T,m,u]),Ve=m==="combobox"&&typeof C=="function"&&C()||null,xe=typeof x=="function"&&x(),tt=Pi(Ge,xe==null||(n=xe.props)===null||n===void 0?void 0:n.ref),pt=g.useState(!1),Re=Y(pt,2),je=Re[0],Qe=Re[1];Yt(function(){Qe(!0)},[]);var Be=cn(!1,{defaultValue:E,value:S}),it=Y(Be,2),$t=it[0],bt=it[1],rt=je?$t:!1,dt=!p&&f;(b||dt&&rt&&m==="combobox")&&(rt=!1);var ut=dt?!1:rt,De=g.useCallback(function(Ot){var et=Ot!==void 0?Ot:!rt;b||(bt(et),rt!==et&&($==null||$(et)))},[b,rt,bt,$]),me=g.useMemo(function(){return(P||[]).some(function(Ot){return[`
|
|
384
|
+
`,`\r
|
|
385
|
+
`].includes(Ot)})},[P]),fe=g.useContext(zv)||{},we=fe.maxCount,Ze=fe.rawValues,Ye=function(et,gt,xt){if(!(ue&&Lv(we)&&(Ze==null?void 0:Ze.size)>=we)){var Tt=!0,Rt=et;k==null||k(null);var Hn=u9(et,P,Lv(we)?we-Ze.size:void 0),Vn=xt?null:Hn;return m!=="combobox"&&Vn&&(Rt="",N==null||N(Vn),De(!1),Tt=!1),R&&ve!==Rt&&R(Rt,{source:gt?"typing":"effect"}),Tt}},yt=function(et){!et||!et.trim()||R(et,{source:"submit"})};g.useEffect(function(){!rt&&!ue&&m!=="combobox"&&Ye("",!1,!1)},[rt]),g.useEffect(function(){$t&&b&&bt(!1),b&&!Ne.current&&Xe(!1)},[b]);var St=Ik(),At=Y(St,2),Et=At[0],Bt=At[1],jt=g.useRef(!1),Zt=function(et){var gt=Et(),xt=et.key,Tt=xt==="Enter";if(Tt&&(m!=="combobox"&&et.preventDefault(),rt||De(!0)),Bt(!!ve),xt==="Backspace"&&!gt&&ue&&!ve&&u.length){for(var Rt=de(u),Hn=null,Vn=Rt.length-1;Vn>=0;Vn-=1){var pr=Rt[Vn];if(!pr.disabled){Rt.splice(Vn,1),Hn=pr;break}}Hn&&d(Rt,{type:"remove",values:[Hn]})}for(var Ir=arguments.length,mr=new Array(Ir>1?Ir-1:0),gr=1;gr<Ir;gr++)mr[gr-1]=arguments[gr];if(rt&&(!Tt||!jt.current)){var _n;Tt&&(jt.current=!0),(_n=qe.current)===null||_n===void 0||_n.onKeyDown.apply(_n,[et].concat(mr))}ee==null||ee.apply(void 0,[et].concat(mr))},On=function(et){for(var gt=arguments.length,xt=new Array(gt>1?gt-1:0),Tt=1;Tt<gt;Tt++)xt[Tt-1]=arguments[Tt];if(rt){var Rt;(Rt=qe.current)===null||Rt===void 0||Rt.onKeyUp.apply(Rt,[et].concat(xt))}et.key==="Enter"&&(jt.current=!1),X==null||X.apply(void 0,[et].concat(xt))},Ft=function(et){var gt=u.filter(function(xt){return xt!==et});d(gt,{type:"remove",values:[et]})},Jt=function(){jt.current=!1},Me=g.useRef(!1),Ke=function(){Xe(!0),b||(ae&&!Me.current&&ae.apply(void 0,arguments),Z.includes("focus")&&De(!0)),Me.current=!0},We=function(){Ne.current=!0,Xe(!1,function(){Me.current=!1,Ne.current=!1,De(!1)}),!b&&(ve&&(m==="tags"?R(ve,{source:"submit"}):m==="multiple"&&R("",{source:"blur"})),ie&&ie.apply(void 0,arguments))},Te=[];g.useEffect(function(){return function(){Te.forEach(function(Ot){return clearTimeout(Ot)}),Te.splice(0,Te.length)}},[]);var _e=function(et){var gt,xt=et.target,Tt=(gt=Pe.current)===null||gt===void 0?void 0:gt.getPopupElement();if(Tt&&Tt.contains(xt)){var Rt=setTimeout(function(){var Ir=Te.indexOf(Rt);if(Ir!==-1&&Te.splice(Ir,1),pe(),!se&&!Tt.contains(document.activeElement)){var mr;(mr=Oe.current)===null||mr===void 0||mr.focus()}});Te.push(Rt)}for(var Hn=arguments.length,Vn=new Array(Hn>1?Hn-1:0),pr=1;pr<Hn;pr++)Vn[pr-1]=arguments[pr];le==null||le.apply(void 0,[et].concat(Vn))},Ie=g.useState({}),Je=Y(Ie,2),mt=Je[1];function Ct(){mt({})}var Mt;xe&&(Mt=function(et){De(et)}),g7(function(){var Ot;return[ze.current,(Ot=Pe.current)===null||Ot===void 0?void 0:Ot.getPopupElement()]},ut,De,!!xe);var Ht=g.useMemo(function(){return V(V({},e),{},{notFoundContent:p,open:rt,triggerOpen:ut,id:r,showSearch:ge,multiple:ue,toggleOpen:De})},[e,p,ut,rt,r,ge,ue,De]),xn=!!B||y,pn;xn&&(pn=g.createElement(vf,{className:J("".concat(o,"-arrow"),z({},"".concat(o,"-arrow-loading"),y)),customizeIcon:B,customizeIconProps:{loading:y,searchValue:ve,open:rt,focused:ke,showSearch:ge}}));var bn=function(){var et;v==null||v(),(et=Oe.current)===null||et===void 0||et.focus(),d([],{type:"clear",values:u}),Ye("",!1,!1)},Fn=h7(o,bn,u,A,F,b,ve,m),An=Fn.allowClear,ur=Fn.clearIcon,hr=g.createElement(U,{ref:qe}),Xr=J(o,i,z(z(z(z(z(z(z(z(z(z({},"".concat(o,"-focused"),ke),"".concat(o,"-multiple"),ue),"".concat(o,"-single"),!ue),"".concat(o,"-allow-clear"),A),"".concat(o,"-show-arrow"),xn),"".concat(o,"-disabled"),b),"".concat(o,"-loading"),y),"".concat(o,"-open"),rt),"".concat(o,"-customize-input"),Ve),"".concat(o,"-show-search"),ge)),zo=g.createElement(Xk,{ref:Pe,disabled:b,prefixCls:o,visible:ut,popupElement:hr,animation:K,transitionName:j,dropdownStyle:D,dropdownClassName:H,direction:l,dropdownMatchSelectWidth:W,dropdownRender:q,dropdownAlign:te,placement:G,builtinPlacements:re,getPopupContainer:oe,empty:f,getTriggerDOMNode:function(et){return Ge.current||et},onPopupVisibleChange:Mt,onPopupMouseEnter:Ct},xe?g.cloneElement(xe,{ref:tt}):g.createElement(jk,he({},e,{domRef:Ge,prefixCls:o,inputElement:Ve,ref:Oe,id:r,prefix:_,showSearch:ge,autoClearSearchValue:I,mode:m,activeDescendantId:M,tagRender:s,values:u,open:rt,onToggleOpen:De,activeValue:O,searchValue:ve,onSearch:Ye,onSearchSubmit:yt,onRemove:Ft,tokenWithEnter:me,onInputBlur:Jt}))),ii;return xe?ii=zo:ii=g.createElement("div",he({className:Xr},ye,{ref:ze,onMouseDown:_e,onKeyDown:Zt,onKeyUp:On,onFocus:Ke,onBlur:We}),g.createElement(d9,{visible:ke&&!rt,values:u}),zo,pn,An&&ur),g.createElement(Tk.Provider,{value:Ht},ii)});f9.NODE_ENV!=="production"&&(Qk.displayName="BaseSelect");var Bv=function(){return null};Bv.isSelectOptGroup=!0;var Fv=function(){return null};Fv.isSelectOption=!0;var Zk=g.forwardRef(function(e,t){var n=e.height,r=e.offsetY,o=e.offsetX,i=e.children,a=e.prefixCls,s=e.onInnerResize,l=e.innerProps,c=e.rtl,u=e.extra,d={},f={display:"flex",flexDirection:"column"};return r!==void 0&&(d={height:n,position:"relative",overflow:"hidden"},f=V(V({},f),{},z(z(z(z(z({transform:"translateY(".concat(r,"px)")},c?"marginRight":"marginLeft",-o),"position","absolute"),"left",0),"right",0),"top",0))),g.createElement("div",{style:d},g.createElement(zr,{onResize:function(p){var v=p.offsetHeight;v&&s&&s()}},g.createElement("div",he({style:f,className:J(z({},"".concat(a,"-holder-inner"),a)),ref:t},l),i,u)))});Zk.displayName="Filler";function m9(e){var t=e.children,n=e.setRef,r=g.useCallback(function(o){n(o)},[]);return g.cloneElement(t,{ref:r})}function g9(e,t,n,r,o,i,a,s){var l=s.getKey;return e.slice(t,n+1).map(function(c,u){var d=t+u,f=a(c,d,{style:{width:r},offsetX:o}),h=l(c);return g.createElement(m9,{key:h,setRef:function(v){return i(c,v)}},f)})}function v9(e,t,n){var r=e.length,o=t.length,i,a;if(r===0&&o===0)return null;r<o?(i=e,a=t):(i=t,a=e);var s={__EMPTY_ITEM__:!0};function l(p){return p!==void 0?n(p):s}for(var c=null,u=Math.abs(r-o)!==1,d=0;d<a.length;d+=1){var f=l(i[d]),h=l(a[d]);if(f!==h){c=d,u=u||f!==l(a[d+1]);break}}return c===null?null:{index:c,multiple:u}}function b9(e,t,n){var r=g.useState(e),o=Y(r,2),i=o[0],a=o[1],s=g.useState(null),l=Y(s,2),c=l[0],u=l[1];return g.useEffect(function(){var d=v9(i||[],e||[],t);(d==null?void 0:d.index)!==void 0&&u(e[d.index]),a(e)},[e]),[c]}var eM=(typeof navigator>"u"?"undefined":Ue(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const tM=(function(e,t,n,r){var o=w.useRef(!1),i=w.useRef(null);function a(){clearTimeout(i.current),o.current=!0,i.current=setTimeout(function(){o.current=!1},50)}var s=w.useRef({top:e,bottom:t,left:n,right:r});return s.current.top=e,s.current.bottom=t,s.current.left=n,s.current.right=r,function(l,c){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=l?c<0&&s.current.left||c>0&&s.current.right:c<0&&s.current.top||c>0&&s.current.bottom;return u&&d?(clearTimeout(i.current),o.current=!1):(!d||o.current)&&a(),!o.current&&d}});function y9(e,t,n,r,o,i,a){var s=w.useRef(0),l=w.useRef(null),c=w.useRef(null),u=w.useRef(!1),d=tM(t,n,r,o);function f(y,C){if(Nt.cancel(l.current),!d(!1,C)){var x=y;if(!x._virtualHandled)x._virtualHandled=!0;else return;s.current+=C,c.current=C,eM||x.preventDefault(),l.current=Nt(function(){var S=u.current?10:1;a(s.current*S,!1),s.current=0})}}function h(y,C){a(C,!0),eM||y.preventDefault()}var p=w.useRef(null),v=w.useRef(null);function m(y){if(e){Nt.cancel(v.current),v.current=Nt(function(){p.current=null},2);var C=y.deltaX,x=y.deltaY,S=y.shiftKey,E=C,$=x;(p.current==="sx"||!p.current&&S&&x&&!C)&&(E=x,$=0,p.current="sx");var O=Math.abs(E),k=Math.abs($);p.current===null&&(p.current=i&&O>k?"x":"y"),p.current==="y"?f(y,$):h(y,E)}}function b(y){e&&(u.current=y.detail===c.current)}return[m,b]}function C9(e,t,n,r){var o=g.useMemo(function(){return[new Map,[]]},[e,n.id,r]),i=Y(o,2),a=i[0],s=i[1],l=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,f=a.get(u),h=a.get(d);if(f===void 0||h===void 0)for(var p=e.length,v=s.length;v<p;v+=1){var m,b=e[v],y=t(b);a.set(y,v);var C=(m=n.get(y))!==null&&m!==void 0?m:r;if(s[v]=(s[v-1]||0)+C,y===u&&(f=v),y===d&&(h=v),f!==void 0&&h!==void 0)break}return{top:s[f-1]||0,bottom:s[h]}};return l}var S9=(function(){function e(){dn(this,e),z(this,"maps",void 0),z(this,"id",0),z(this,"diffRecords",new Map),this.maps=Object.create(null)}return fn(e,[{key:"set",value:function(n,r){this.diffRecords.set(n,this.maps[n]),this.maps[n]=r,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e})();function nM(e){var t=parseFloat(e);return isNaN(t)?0:t}function x9(e,t,n){var r=g.useState(0),o=Y(r,2),i=o[0],a=o[1],s=w.useRef(new Map),l=w.useRef(new S9),c=w.useRef(0);function u(){c.current+=1}function d(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u();var p=function(){var b=!1;s.current.forEach(function(y,C){if(y&&y.offsetParent){var x=y.offsetHeight,S=getComputedStyle(y),E=S.marginTop,$=S.marginBottom,O=nM(E),k=nM($),M=x+O+k;l.current.get(C)!==M&&(l.current.set(C,M),b=!0)}}),b&&a(function(y){return y+1})};if(h)p();else{c.current+=1;var v=c.current;Promise.resolve().then(function(){v===c.current&&p()})}}function f(h,p){var v=e(h);s.current.get(v),p?(s.current.set(v,p),d()):s.current.delete(v)}return w.useEffect(function(){return u},[]),[f,d,l.current,i]}var rM=14/15;function w9(e,t,n){var r=w.useRef(!1),o=w.useRef(0),i=w.useRef(0),a=w.useRef(null),s=w.useRef(null),l,c=function(h){if(r.current){var p=Math.ceil(h.touches[0].pageX),v=Math.ceil(h.touches[0].pageY),m=o.current-p,b=i.current-v,y=Math.abs(m)>Math.abs(b);y?o.current=p:i.current=v;var C=n(y,y?m:b,!1,h);C&&h.preventDefault(),clearInterval(s.current),C&&(s.current=setInterval(function(){y?m*=rM:b*=rM;var x=Math.floor(y?m:b);(!n(y,x,!0)||Math.abs(x)<=.1)&&clearInterval(s.current)},16))}},u=function(){r.current=!1,l()},d=function(h){l(),h.touches.length===1&&!r.current&&(r.current=!0,o.current=Math.ceil(h.touches[0].pageX),i.current=Math.ceil(h.touches[0].pageY),a.current=h.target,a.current.addEventListener("touchmove",c,{passive:!1}),a.current.addEventListener("touchend",u,{passive:!0}))};l=function(){a.current&&(a.current.removeEventListener("touchmove",c),a.current.removeEventListener("touchend",u))},Yt(function(){return e&&t.current.addEventListener("touchstart",d,{passive:!0}),function(){var f;(f=t.current)===null||f===void 0||f.removeEventListener("touchstart",d),l(),clearInterval(s.current)}},[e])}function oM(e){return Math.floor(Math.pow(e,.5))}function Hv(e,t){var n="touches"in e?e.touches[0]:e;return n[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}function E9(e,t,n){g.useEffect(function(){var r=t.current;if(e&&r){var o=!1,i,a,s=function(){Nt.cancel(i)},l=function f(){s(),i=Nt(function(){n(a),f()})},c=function(){o=!1,s()},u=function(h){if(!(h.target.draggable||h.button!==0)){var p=h;p._virtualHandled||(p._virtualHandled=!0,o=!0)}},d=function(h){if(o){var p=Hv(h,!1),v=r.getBoundingClientRect(),m=v.top,b=v.bottom;if(p<=m){var y=m-p;a=-oM(y),l()}else if(p>=b){var C=p-b;a=oM(C),l()}else s()}};return r.addEventListener("mousedown",u),r.ownerDocument.addEventListener("mouseup",c),r.ownerDocument.addEventListener("mousemove",d),r.ownerDocument.addEventListener("dragend",c),function(){r.removeEventListener("mousedown",u),r.ownerDocument.removeEventListener("mouseup",c),r.ownerDocument.removeEventListener("mousemove",d),r.ownerDocument.removeEventListener("dragend",c),s()}}},[e])}var $9={},iM=10;function O9(e,t,n,r,o,i,a,s){var l=g.useRef(),c=g.useState(null),u=Y(c,2),d=u[0],f=u[1];return Yt(function(){if(d&&d.times<iM){if(!e.current){f(function(F){return V({},F)});return}i();var h=d.targetAlign,p=d.originAlign,v=d.index,m=d.offset,b=e.current.clientHeight,y=!1,C=h,x=null;if(b){for(var S=h||p,E=0,$=0,O=0,k=Math.min(t.length-1,v),M=0;M<=k;M+=1){var T=o(t[M]);$=E;var I=n.get(T);O=$+(I===void 0?r:I),E=O}for(var R=S==="top"?m:b-m,N=k;N>=0;N-=1){var P=o(t[N]),A=n.get(P);if(A===void 0){y=!0;break}if(R-=A,R<=0)break}switch(S){case"top":x=$-m;break;case"bottom":x=O-b+m;break;default:{var _=e.current.scrollTop,B=_+b;$<_?C="top":O>B&&(C="bottom")}}x!==null&&a(x),x!==d.lastTop&&(y=!0)}y&&f(V(V({},d),{},{times:d.times+1,targetAlign:C,lastTop:x}))}else $9.NODE_ENV!=="production"&&(d==null?void 0:d.times)===iM&&ft(!1,"Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.")},[d,e.current]),function(h){if(h==null){s();return}if(Nt.cancel(l.current),typeof h=="number")a(h);else if(h&&Ue(h)==="object"){var p,v=h.align;"index"in h?p=h.index:p=t.findIndex(function(y){return o(y)===h.key});var m=h.offset,b=m===void 0?0:m;f({times:0,index:p,offset:b,originAlign:v})}}}var k9={},Vv=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.rtl,o=e.scrollOffset,i=e.scrollRange,a=e.onStartMove,s=e.onStopMove,l=e.onScroll,c=e.horizontal,u=e.spinSize,d=e.containerSize,f=e.style,h=e.thumbStyle,p=e.showScrollBar,v=g.useState(!1),m=Y(v,2),b=m[0],y=m[1],C=g.useState(null),x=Y(C,2),S=x[0],E=x[1],$=g.useState(null),O=Y($,2),k=O[0],M=O[1],T=!r,I=g.useRef(),R=g.useRef(),N=g.useState(p),P=Y(N,2),A=P[0],_=P[1],B=g.useRef(),F=function(){p===!0||p===!1||(clearTimeout(B.current),_(!0),B.current=setTimeout(function(){_(!1)},3e3))},U=i-d||0,K=d-u||0,j=g.useMemo(function(){if(o===0||U===0)return 0;var ne=o/U;return ne*K},[o,U,K]),D=function(Z){Z.stopPropagation(),Z.preventDefault()},H=g.useRef({top:j,dragging:b,pageY:S,startTop:k});H.current={top:j,dragging:b,pageY:S,startTop:k};var W=function(Z){y(!0),E(Hv(Z,c)),M(H.current.top),a(),Z.stopPropagation(),Z.preventDefault()};g.useEffect(function(){var ne=function(X){X.preventDefault()},Z=I.current,ae=R.current;return Z.addEventListener("touchstart",ne,{passive:!1}),ae.addEventListener("touchstart",W,{passive:!1}),function(){Z.removeEventListener("touchstart",ne),ae.removeEventListener("touchstart",W)}},[]);var q=g.useRef();q.current=U;var te=g.useRef();te.current=K,g.useEffect(function(){if(b){var ne,Z=function(X){var ee=H.current,le=ee.dragging,ce=ee.pageY,ue=ee.startTop;Nt.cancel(ne);var ge=I.current.getBoundingClientRect(),ye=d/(c?ge.width:ge.height);if(le){var $e=(Hv(X,c)-ce)*ye,Ce=ue;!T&&c?Ce-=$e:Ce+=$e;var se=q.current,Se=te.current,ze=Se?Ce/Se:0,Ge=Math.ceil(ze*se);Ge=Math.max(Ge,0),Ge=Math.min(Ge,se),ne=Nt(function(){l(Ge,c)})}},ae=function(){y(!1),s()};return window.addEventListener("mousemove",Z,{passive:!0}),window.addEventListener("touchmove",Z,{passive:!0}),window.addEventListener("mouseup",ae,{passive:!0}),window.addEventListener("touchend",ae,{passive:!0}),function(){window.removeEventListener("mousemove",Z),window.removeEventListener("touchmove",Z),window.removeEventListener("mouseup",ae),window.removeEventListener("touchend",ae),Nt.cancel(ne)}}},[b]),g.useEffect(function(){return F(),function(){clearTimeout(B.current)}},[o]),g.useImperativeHandle(t,function(){return{delayHidden:F}});var G="".concat(n,"-scrollbar"),re={position:"absolute",visibility:A?null:"hidden"},oe={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return c?(Object.assign(re,{height:8,left:0,right:0,bottom:0}),Object.assign(oe,z({height:"100%",width:u},T?"left":"right",j))):(Object.assign(re,z({width:8,top:0,bottom:0},T?"right":"left",0)),Object.assign(oe,{width:"100%",height:u,top:j})),g.createElement("div",{ref:I,className:J(G,z(z(z({},"".concat(G,"-horizontal"),c),"".concat(G,"-vertical"),!c),"".concat(G,"-visible"),A)),style:V(V({},re),f),onMouseDown:D,onMouseMove:F},g.createElement("div",{ref:R,className:J("".concat(G,"-thumb"),z({},"".concat(G,"-thumb-moving"),b)),style:V(V({},oe),h),onMouseDown:W}))});k9.NODE_ENV!=="production"&&(Vv.displayName="ScrollBar");var M9=20;function aM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,M9),Math.floor(n)}var N9=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],T9=[],I9={overflowY:"auto",overflowAnchor:"none"};function P9(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,o=e.className,i=e.height,a=e.itemHeight,s=e.fullHeight,l=s===void 0?!0:s,c=e.style,u=e.data,d=e.children,f=e.itemKey,h=e.virtual,p=e.direction,v=e.scrollWidth,m=e.component,b=m===void 0?"div":m,y=e.onScroll,C=e.onVirtualScroll,x=e.onVisibleChange,S=e.innerProps,E=e.extraRender,$=e.styles,O=e.showScrollBar,k=O===void 0?"optional":O,M=st(e,N9),T=g.useCallback(function(Me){return typeof f=="function"?f(Me):Me==null?void 0:Me[f]},[f]),I=x9(T),R=Y(I,4),N=R[0],P=R[1],A=R[2],_=R[3],B=!!(h!==!1&&i&&a),F=g.useMemo(function(){return Object.values(A.maps).reduce(function(Me,Ke){return Me+Ke},0)},[A.id,A.maps]),U=B&&u&&(Math.max(a*u.length,F)>i||!!v),K=p==="rtl",j=J(r,z({},"".concat(r,"-rtl"),K),o),D=u||T9,H=w.useRef(),W=w.useRef(),q=w.useRef(),te=w.useState(0),G=Y(te,2),re=G[0],oe=G[1],ne=w.useState(0),Z=Y(ne,2),ae=Z[0],ie=Z[1],X=w.useState(!1),ee=Y(X,2),le=ee[0],ce=ee[1],ue=function(){ce(!0)},ge=function(){ce(!1)},ye={getKey:T};function $e(Me){oe(function(Ke){var We;typeof Me=="function"?We=Me(Ke):We=Me;var Te=Qe(We);return H.current.scrollTop=Te,Te})}var Ce=w.useRef({start:0,end:D.length}),se=w.useRef(),Se=b9(D,T),ze=Y(Se,1),Ge=ze[0];se.current=Ge;var Pe=g.useMemo(function(){if(!B)return{scrollHeight:void 0,start:0,end:D.length-1,offset:void 0};if(!U){var Me;return{scrollHeight:((Me=W.current)===null||Me===void 0?void 0:Me.offsetHeight)||0,start:0,end:D.length-1,offset:void 0}}for(var Ke=0,We,Te,_e,Ie=D.length,Je=0;Je<Ie;Je+=1){var mt=D[Je],Ct=T(mt),Mt=A.get(Ct),Ht=Ke+(Mt===void 0?a:Mt);Ht>=re&&We===void 0&&(We=Je,Te=Ke),Ht>re+i&&_e===void 0&&(_e=Je),Ke=Ht}return We===void 0&&(We=0,Te=0,_e=Math.ceil(i/a)),_e===void 0&&(_e=D.length-1),_e=Math.min(_e+1,D.length-1),{scrollHeight:Ke,start:We,end:_e,offset:Te}},[U,B,re,D,_,i]),Oe=Pe.scrollHeight,qe=Pe.start,Ne=Pe.end,Fe=Pe.offset;Ce.current.start=qe,Ce.current.end=Ne,g.useLayoutEffect(function(){var Me=A.getRecord();if(Me.size===1){var Ke=Array.from(Me.keys())[0],We=Me.get(Ke),Te=D[qe];if(Te&&We===void 0){var _e=T(Te);if(_e===Ke){var Ie=A.get(Ke),Je=Ie-a;$e(function(mt){return mt+Je})}}}A.resetRecord()},[Oe]);var Ae=g.useState({width:0,height:i}),ke=Y(Ae,2),Xe=ke[0],pe=ke[1],ve=function(Ke){pe({width:Ke.offsetWidth,height:Ke.offsetHeight})},Ve=w.useRef(),xe=w.useRef(),tt=g.useMemo(function(){return aM(Xe.width,v)},[Xe.width,v]),pt=g.useMemo(function(){return aM(Xe.height,Oe)},[Xe.height,Oe]),Re=Oe-i,je=w.useRef(Re);je.current=Re;function Qe(Me){var Ke=Me;return Number.isNaN(je.current)||(Ke=Math.min(Ke,je.current)),Ke=Math.max(Ke,0),Ke}var Be=re<=0,it=re>=Re,$t=ae<=0,bt=ae>=v,rt=tM(Be,it,$t,bt),dt=function(){return{x:K?-ae:ae,y:re}},ut=w.useRef(dt()),De=qt(function(Me){if(C){var Ke=V(V({},dt()),Me);(ut.current.x!==Ke.x||ut.current.y!==Ke.y)&&(C(Ke),ut.current=Ke)}});function me(Me,Ke){var We=Me;Ke?(En.flushSync(function(){ie(We)}),De()):$e(We)}function fe(Me){var Ke=Me.currentTarget.scrollTop;Ke!==re&&$e(Ke),y==null||y(Me),De()}var we=function(Ke){var We=Ke,Te=v?v-Xe.width:0;return We=Math.max(We,0),We=Math.min(We,Te),We},Ze=qt(function(Me,Ke){Ke?(En.flushSync(function(){ie(function(We){var Te=We+(K?-Me:Me);return we(Te)})}),De()):$e(function(We){var Te=We+Me;return Te})}),Ye=y9(B,Be,it,$t,bt,!!v,Ze),yt=Y(Ye,2),St=yt[0],At=yt[1];w9(B,H,function(Me,Ke,We,Te){var _e=Te;return rt(Me,Ke,We)?!1:!_e||!_e._virtualHandled?(_e&&(_e._virtualHandled=!0),St({preventDefault:function(){},deltaX:Me?Ke:0,deltaY:Me?0:Ke}),!0):!1}),E9(U,H,function(Me){$e(function(Ke){return Ke+Me})}),Yt(function(){function Me(We){var Te=Be&&We.detail<0,_e=it&&We.detail>0;B&&!Te&&!_e&&We.preventDefault()}var Ke=H.current;return Ke.addEventListener("wheel",St,{passive:!1}),Ke.addEventListener("DOMMouseScroll",At,{passive:!0}),Ke.addEventListener("MozMousePixelScroll",Me,{passive:!1}),function(){Ke.removeEventListener("wheel",St),Ke.removeEventListener("DOMMouseScroll",At),Ke.removeEventListener("MozMousePixelScroll",Me)}},[B,Be,it]),Yt(function(){if(v){var Me=we(ae);ie(Me),De({x:Me})}},[Xe.width,v]);var Et=function(){var Ke,We;(Ke=Ve.current)===null||Ke===void 0||Ke.delayHidden(),(We=xe.current)===null||We===void 0||We.delayHidden()},Bt=O9(H,D,A,a,T,function(){return P(!0)},$e,Et);g.useImperativeHandle(t,function(){return{nativeElement:q.current,getScrollInfo:dt,scrollTo:function(Ke){function We(Te){return Te&&Ue(Te)==="object"&&("left"in Te||"top"in Te)}We(Ke)?(Ke.left!==void 0&&ie(we(Ke.left)),Bt(Ke.top)):Bt(Ke)}}}),Yt(function(){if(x){var Me=D.slice(qe,Ne+1);x(Me,D)}},[qe,Ne,D]);var jt=C9(D,T,A,a),Zt=E==null?void 0:E({start:qe,end:Ne,virtual:U,offsetX:ae,offsetY:Fe,rtl:K,getSize:jt}),On=g9(D,qe,Ne,v,ae,N,d,ye),Ft=null;i&&(Ft=V(z({},l?"height":"maxHeight",i),I9),B&&(Ft.overflowY="hidden",v&&(Ft.overflowX="hidden"),le&&(Ft.pointerEvents="none")));var Jt={};return K&&(Jt.dir="rtl"),g.createElement("div",he({ref:q,style:V(V({},c),{},{position:"relative"}),className:j},Jt,M),g.createElement(zr,{onResize:ve},g.createElement(b,{className:"".concat(r,"-holder"),style:Ft,ref:H,onScroll:fe,onMouseEnter:Et},g.createElement(Zk,{prefixCls:r,height:Oe,offsetX:ae,offsetY:Fe,scrollWidth:v,onInnerResize:P,ref:W,innerProps:S,rtl:K,extra:Zt},On))),U&&Oe>i&&g.createElement(Vv,{ref:Ve,prefixCls:r,scrollOffset:re,scrollRange:Oe,rtl:K,onScroll:me,onStartMove:ue,onStopMove:ge,spinSize:pt,containerSize:Xe.height,style:$==null?void 0:$.verticalScrollBar,thumbStyle:$==null?void 0:$.verticalScrollBarThumb,showScrollBar:k}),U&&v>Xe.width&&g.createElement(Vv,{ref:xe,prefixCls:r,scrollOffset:ae,scrollRange:v,rtl:K,onScroll:me,onStartMove:ue,onStopMove:ge,spinSize:tt,containerSize:Xe.width,horizontal:!0,style:$==null?void 0:$.horizontalScrollBar,thumbStyle:$==null?void 0:$.horizontalScrollBarThumb,showScrollBar:k}))}var sM=g.forwardRef(P9);sM.displayName="List";function A9(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var R9={},_9=["disabled","title","children","style","className"];function lM(e){return typeof e=="string"||typeof e=="number"}var D9=function(t,n){var r=p7(),o=r.prefixCls,i=r.id,a=r.open,s=r.multiple,l=r.mode,c=r.searchValue,u=r.toggleOpen,d=r.notFoundContent,f=r.onPopupScroll,h=g.useContext(zv),p=h.maxCount,v=h.flattenOptions,m=h.onActiveValue,b=h.defaultActiveFirstOption,y=h.onSelect,C=h.menuItemSelectedIcon,x=h.rawValues,S=h.fieldNames,E=h.virtual,$=h.direction,O=h.listHeight,k=h.listItemHeight,M=h.optionRender,T="".concat(o,"-item"),I=Pl(function(){return v},[a,v],function(ne,Z){return Z[0]&&ne[1]!==Z[1]}),R=g.useRef(null),N=g.useMemo(function(){return s&&Lv(p)&&(x==null?void 0:x.size)>=p},[s,p,x==null?void 0:x.size]),P=function(Z){Z.preventDefault()},A=function(Z){var ae;(ae=R.current)===null||ae===void 0||ae.scrollTo(typeof Z=="number"?{index:Z}:Z)},_=g.useCallback(function(ne){return l==="combobox"?!1:x.has(ne)},[l,de(x).toString(),x.size]),B=function(Z){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=I.length,X=0;X<ie;X+=1){var ee=(Z+X*ae+ie)%ie,le=I[ee]||{},ce=le.group,ue=le.data;if(!ce&&!(ue!=null&&ue.disabled)&&(_(ue.value)||!N))return ee}return-1},F=g.useState(function(){return B(0)}),U=Y(F,2),K=U[0],j=U[1],D=function(Z){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;j(Z);var ie={source:ae?"keyboard":"mouse"},X=I[Z];if(!X){m(null,-1,ie);return}m(X.value,Z,ie)};w.useEffect(function(){D(b!==!1?B(0):-1)},[I.length,c]);var H=g.useCallback(function(ne){return l==="combobox"?String(ne).toLowerCase()===c.toLowerCase():x.has(ne)},[l,c,de(x).toString(),x.size]);w.useEffect(function(){var ne=setTimeout(function(){if(!s&&a&&x.size===1){var ae=Array.from(x)[0],ie=I.findIndex(function(X){var ee=X.data;return c?String(ee.value).startsWith(c):ee.value===ae});ie!==-1&&(D(ie),A(ie))}});if(a){var Z;(Z=R.current)===null||Z===void 0||Z.scrollTo(void 0)}return function(){return clearTimeout(ne)}},[a,c]);var W=function(Z){Z!==void 0&&y(Z,{selected:!x.has(Z)}),s||u(!1)};if(g.useImperativeHandle(n,function(){return{onKeyDown:function(Z){var ae=Z.which,ie=Z.ctrlKey;switch(ae){case Le.N:case Le.P:case Le.UP:case Le.DOWN:{var X=0;if(ae===Le.UP?X=-1:ae===Le.DOWN?X=1:A9()&&ie&&(ae===Le.N?X=1:ae===Le.P&&(X=-1)),X!==0){var ee=B(K+X,X);A(ee),D(ee,!0)}break}case Le.TAB:case Le.ENTER:{var le,ce=I[K];ce&&!(ce!=null&&(le=ce.data)!==null&&le!==void 0&&le.disabled)&&!N?W(ce.value):W(void 0),a&&Z.preventDefault();break}case Le.ESC:u(!1),a&&Z.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Z){A(Z)}}}),I.length===0)return g.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(T,"-empty"),onMouseDown:P},d);var q=Object.keys(S).map(function(ne){return S[ne]}),te=function(Z){return Z.label};function G(ne,Z){var ae=ne.group;return{role:ae?"presentation":"option",id:"".concat(i,"_list_").concat(Z)}}var re=function(Z){var ae=I[Z];if(!ae)return null;var ie=ae.data||{},X=ie.value,ee=ae.group,le=Vr(ie,!0),ce=te(ae);return ae?g.createElement("div",he({"aria-label":typeof ce=="string"&&!ee?ce:null},le,{key:Z},G(ae,Z),{"aria-selected":H(X)}),X):null},oe={role:"listbox",id:"".concat(i,"_list")};return g.createElement(g.Fragment,null,E&&g.createElement("div",he({},oe,{style:{height:0,width:0,overflow:"hidden"}}),re(K-1),re(K),re(K+1)),g.createElement(sM,{itemKey:"key",ref:R,data:I,height:O,itemHeight:k,fullHeight:!1,onMouseDown:P,onScroll:f,virtual:E,direction:$,innerProps:E?null:oe},function(ne,Z){var ae=ne.group,ie=ne.groupOption,X=ne.data,ee=ne.label,le=ne.value,ce=X.key;if(ae){var ue,ge=(ue=X.title)!==null&&ue!==void 0?ue:lM(ee)?ee.toString():void 0;return g.createElement("div",{className:J(T,"".concat(T,"-group"),X.className),title:ge},ee!==void 0?ee:ce)}var ye=X.disabled,$e=X.title;X.children;var Ce=X.style,se=X.className,Se=st(X,_9),ze=nr(Se,q),Ge=_(le),Pe=ye||!Ge&&N,Oe="".concat(T,"-option"),qe=J(T,Oe,se,z(z(z(z({},"".concat(Oe,"-grouped"),ie),"".concat(Oe,"-active"),K===Z&&!Pe),"".concat(Oe,"-disabled"),Pe),"".concat(Oe,"-selected"),Ge)),Ne=te(ne),Fe=!C||typeof C=="function"||Ge,Ae=typeof Ne=="number"?Ne:Ne||le,ke=lM(Ae)?Ae.toString():void 0;return $e!==void 0&&(ke=$e),g.createElement("div",he({},Vr(ze),E?{}:G(ne,Z),{"aria-selected":H(le),className:qe,title:ke,onMouseMove:function(){K===Z||Pe||D(Z)},onClick:function(){Pe||W(le)},style:Ce}),g.createElement("div",{className:"".concat(Oe,"-content")},typeof M=="function"?M(ne,{index:Z}):Ae),g.isValidElement(C)||Ge,Fe&&g.createElement(vf,{className:"".concat(T,"-option-state"),customizeIcon:C,customizeIconProps:{value:le,disabled:Pe,isSelected:Ge}},Ge?"✓":null))}))},cM=g.forwardRef(D9);R9.NODE_ENV!=="production"&&(cM.displayName="OptionList");const L9=(function(e,t){var n=g.useRef({values:new Map,options:new Map}),r=g.useMemo(function(){var i=n.current,a=i.values,s=i.options,l=e.map(function(d){if(d.label===void 0){var f;return V(V({},d),{},{label:(f=a.get(d.value))===null||f===void 0?void 0:f.label})}return d}),c=new Map,u=new Map;return l.forEach(function(d){c.set(d.value,d),u.set(d.value,t.get(d.value)||s.get(d.value))}),n.current.values=c,n.current.options=u,l},[e,t]),o=g.useCallback(function(i){return t.get(i)||n.current.options.get(i)},[t]);return[r,o]});function Wv(e,t){return _v(e).join("").toUpperCase().includes(t)}const j9=(function(e,t,n,r,o){return g.useMemo(function(){if(!n||r===!1)return e;var i=t.options,a=t.label,s=t.value,l=[],c=typeof r=="function",u=n.toUpperCase(),d=c?r:function(h,p){return o?Wv(p[o],u):p[i]?Wv(p[a!=="children"?a:"label"],u):Wv(p[s],u)},f=c?function(h){return jv(h)}:function(h){return h};return e.forEach(function(h){if(h[i]){var p=d(n,f(h));if(p)l.push(h);else{var v=h[i].filter(function(m){return d(n,f(m))});v.length&&l.push(V(V({},h),{},z({},i,v)))}return}d(n,f(h))&&l.push(h)}),l},[e,r,o,n,t])});var z9={},uM=0,B9=z9.NODE_ENV!=="test"&&Gn();function F9(){var e;return B9?(e=uM,uM+=1):e="TEST_OR_SSR",e}function H9(e){var t=g.useState(),n=Y(t,2),r=n[0],o=n[1];return g.useEffect(function(){o("rc_select_".concat(F9()))},[]),e||r}var V9=["children","value"],W9=["children"];function U9(e){var t=e,n=t.key,r=t.props,o=r.children,i=r.value,a=st(r,V9);return V({key:n,value:i!==void 0?i:n,children:o},a)}function Uv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return oo(e).map(function(n,r){if(!g.isValidElement(n)||!n.type)return null;var o=n,i=o.type.isSelectOptGroup,a=o.key,s=o.props,l=s.children,c=st(s,W9);return t||!i?U9(n):V(V({key:"__RC_SELECT_GRP__".concat(a===null?r:a,"__"),label:a},c),{},{options:Uv(l)})}).filter(function(n){return n})}var q9=function(t,n,r,o,i){return g.useMemo(function(){var a=t,s=!t;s&&(a=Uv(n));var l=new Map,c=new Map,u=function(h,p,v){v&&typeof v=="string"&&h.set(p[v],p)},d=function f(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=0;v<h.length;v+=1){var m=h[v];!m[r.options]||p?(l.set(m[r.value],m),u(c,m,r.label),u(c,m,o),u(c,m,i)):f(m[r.options],!0)}};return d(a),{options:a,valueOptions:l,labelOptions:c}},[t,n,r,o,i])};function dM(e){var t=g.useRef();t.current=e;var n=g.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}function K9(e){var t=e.mode,n=e.options,r=e.children,o=e.backfill,i=e.allowClear,a=e.placeholder,s=e.getInputElement,l=e.showSearch,c=e.onSearch,u=e.defaultOpen,d=e.autoFocus,f=e.labelInValue,h=e.value,p=e.inputValue,v=e.optionLabelProp,m=Cf(t),b=l!==void 0?l:m||t==="combobox",y=n||Uv(r);if(ft(t!=="tags"||y.every(function(E){return!E.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),t==="tags"||t==="combobox"){var C=y.some(function(E){return E.options?E.options.some(function($){return typeof("value"in $?$.value:$.key)=="number"}):typeof("value"in E?E.value:E.key)=="number"});ft(!C,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(ft(t!=="combobox"||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),ft(t==="combobox"||!o,"`backfill` only works with `combobox` mode."),ft(t==="combobox"||!s,"`getInputElement` only work with `combobox` mode."),Dm(t!=="combobox"||!s||!i||!a,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),c&&!b&&t!=="combobox"&&t!=="tags"&&ft(!1,"`onSearch` should work with `showSearch` instead of use alone."),Dm(!u||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),h!=null){var x=_v(h);ft(!f||x.every(function(E){return Ue(E)==="object"&&("key"in E||"value"in E)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),ft(!m||Array.isArray(h),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var S=null;oo(r).some(function(E){if(!g.isValidElement(E)||!E.type)return!1;var $=E,O=$.type;if(O.isSelectOption)return!1;if(O.isSelectOptGroup){var k=oo(E.props.children).every(function(M){return!g.isValidElement(M)||!E.type||M.type.isSelectOption?!0:(S=M.type,!1)});return!k}return S=O,!0}),S&&ft(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(S.displayName||S.name||S,"`.")),ft(p===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function G9(e,t){if(e){var n=function r(o){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=0;a<o.length;a++){var s=o[a];if(s[t==null?void 0:t.value]===null)return ft(!1,"`value` in Select options should not be `null`."),!0;if(!i&&Array.isArray(s[t==null?void 0:t.options])&&r(s[t==null?void 0:t.options],!0))break}};n(e)}}var qv={},X9=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Y9=["inputValue"];function J9(e){return!e||Ue(e)!=="object"}var fM=g.forwardRef(function(e,t){var n=e.id,r=e.mode,o=e.prefixCls,i=o===void 0?"rc-select":o,a=e.backfill,s=e.fieldNames,l=e.inputValue,c=e.searchValue,u=e.onSearch,d=e.autoClearSearchValue,f=d===void 0?!0:d,h=e.onSelect,p=e.onDeselect,v=e.dropdownMatchSelectWidth,m=v===void 0?!0:v,b=e.filterOption,y=e.filterSort,C=e.optionFilterProp,x=e.optionLabelProp,S=e.options,E=e.optionRender,$=e.children,O=e.defaultActiveFirstOption,k=e.menuItemSelectedIcon,M=e.virtual,T=e.direction,I=e.listHeight,R=I===void 0?200:I,N=e.listItemHeight,P=N===void 0?20:N,A=e.labelRender,_=e.value,B=e.defaultValue,F=e.labelInValue,U=e.onChange,K=e.maxCount,j=st(e,X9),D=H9(n),H=Cf(r),W=!!(!S&&$),q=g.useMemo(function(){return b===void 0&&r==="combobox"?!1:b},[b,r]),te=g.useMemo(function(){return Jk(s,W)},[JSON.stringify(s),W]),G=cn("",{value:c!==void 0?c:l,postState:function(me){return me||""}}),re=Y(G,2),oe=re[0],ne=re[1],Z=q9(S,$,te,C,x),ae=Z.valueOptions,ie=Z.labelOptions,X=Z.options,ee=g.useCallback(function(De){var me=_v(De);return me.map(function(fe){var we,Ze,Ye,yt,St;if(J9(fe))we=fe;else{var At;Ye=fe.key,Ze=fe.label,we=(At=fe.value)!==null&&At!==void 0?At:Ye}var Et=ae.get(we);if(Et){var Bt;if(Ze===void 0&&(Ze=Et==null?void 0:Et[x||te.label]),Ye===void 0&&(Ye=(Bt=Et==null?void 0:Et.key)!==null&&Bt!==void 0?Bt:we),yt=Et==null?void 0:Et.disabled,St=Et==null?void 0:Et.title,qv.NODE_ENV!=="production"&&!x){var jt=Et==null?void 0:Et[te.label];jt!==void 0&&!g.isValidElement(jt)&&!g.isValidElement(Ze)&&jt!==Ze&&ft(!1,"`label` of `value` is not same as `label` in Select options.")}}return{label:Ze,value:we,key:Ye,disabled:yt,title:St}})},[te,x,ae]),le=cn(B,{value:_}),ce=Y(le,2),ue=ce[0],ge=ce[1],ye=g.useMemo(function(){var De,me=H&&ue===null?[]:ue,fe=ee(me);return r==="combobox"&&L7((De=fe[0])===null||De===void 0?void 0:De.value)?[]:fe},[ue,ee,r,H]),$e=L9(ye,ae),Ce=Y($e,2),se=Ce[0],Se=Ce[1],ze=g.useMemo(function(){if(!r&&se.length===1){var De=se[0];if(De.value===null&&(De.label===null||De.label===void 0))return[]}return se.map(function(me){var fe;return V(V({},me),{},{label:(fe=typeof A=="function"?A(me):me.label)!==null&&fe!==void 0?fe:me.value})})},[r,se,A]),Ge=g.useMemo(function(){return new Set(se.map(function(De){return De.value}))},[se]);g.useEffect(function(){if(r==="combobox"){var De,me=(De=se[0])===null||De===void 0?void 0:De.value;ne(D7(me)?String(me):"")}},[se]);var Pe=dM(function(De,me){var fe=me??De;return z(z({},te.value,De),te.label,fe)}),Oe=g.useMemo(function(){if(r!=="tags")return X;var De=de(X),me=function(we){return ae.has(we)};return de(se).sort(function(fe,we){return fe.value<we.value?-1:1}).forEach(function(fe){var we=fe.value;me(we)||De.push(Pe(we,fe.label))}),De},[Pe,X,ae,se,r]),qe=j9(Oe,te,oe,q,C),Ne=g.useMemo(function(){return r!=="tags"||!oe||qe.some(function(De){return De[C||"value"]===oe})||qe.some(function(De){return De[te.value]===oe})?qe:[Pe(oe)].concat(de(qe))},[Pe,C,r,qe,oe,te]),Fe=function De(me){var fe=de(me).sort(function(we,Ze){return y(we,Ze,{searchValue:oe})});return fe.map(function(we){return Array.isArray(we.options)?V(V({},we),{},{options:we.options.length>0?De(we.options):we.options}):we})},Ae=g.useMemo(function(){return y?Fe(Ne):Ne},[Ne,y,oe]),ke=g.useMemo(function(){return c9(Ae,{fieldNames:te,childrenAsData:W})},[Ae,te,W]),Xe=function(me){var fe=ee(me);if(ge(fe),U&&(fe.length!==se.length||fe.some(function(Ye,yt){var St;return((St=se[yt])===null||St===void 0?void 0:St.value)!==(Ye==null?void 0:Ye.value)}))){var we=F?fe:fe.map(function(Ye){return Ye.value}),Ze=fe.map(function(Ye){return jv(Se(Ye.value))});U(H?we:we[0],H?Ze:Ze[0])}},pe=g.useState(null),ve=Y(pe,2),Ve=ve[0],xe=ve[1],tt=g.useState(0),pt=Y(tt,2),Re=pt[0],je=pt[1],Qe=O!==void 0?O:r!=="combobox",Be=g.useCallback(function(De,me){var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},we=fe.source,Ze=we===void 0?"keyboard":we;je(me),a&&r==="combobox"&&De!==null&&Ze==="keyboard"&&xe(String(De))},[a,r]),it=function(me,fe,we){var Ze=function(){var Ft,Jt=Se(me);return[F?{label:Jt==null?void 0:Jt[te.label],value:me,key:(Ft=Jt==null?void 0:Jt.key)!==null&&Ft!==void 0?Ft:me}:me,jv(Jt)]};if(fe&&h){var Ye=Ze(),yt=Y(Ye,2),St=yt[0],At=yt[1];h(St,At)}else if(!fe&&p&&we!=="clear"){var Et=Ze(),Bt=Y(Et,2),jt=Bt[0],Zt=Bt[1];p(jt,Zt)}},$t=dM(function(De,me){var fe,we=H?me.selected:!0;we?fe=H?[].concat(de(se),[De]):[De]:fe=se.filter(function(Ze){return Ze.value!==De}),Xe(fe),it(De,we),r==="combobox"?xe(""):(!Cf||f)&&(ne(""),xe(""))}),bt=function(me,fe){Xe(me);var we=fe.type,Ze=fe.values;(we==="remove"||we==="clear")&&Ze.forEach(function(Ye){it(Ye.value,!1,we)})},rt=function(me,fe){if(ne(me),xe(null),fe.source==="submit"){var we=(me||"").trim();if(we){var Ze=Array.from(new Set([].concat(de(Ge),[we])));Xe(Ze),it(we,!0),ne("")}return}fe.source!=="blur"&&(r==="combobox"&&Xe(me),u==null||u(me))},dt=function(me){var fe=me;r!=="tags"&&(fe=me.map(function(Ze){var Ye=ie.get(Ze);return Ye==null?void 0:Ye.value}).filter(function(Ze){return Ze!==void 0}));var we=Array.from(new Set([].concat(de(Ge),de(fe))));Xe(we),we.forEach(function(Ze){it(Ze,!0)})},ut=g.useMemo(function(){var De=M!==!1&&m!==!1;return V(V({},Z),{},{flattenOptions:ke,onActiveValue:Be,defaultActiveFirstOption:Qe,onSelect:$t,menuItemSelectedIcon:k,rawValues:Ge,fieldNames:te,virtual:De,direction:T,listHeight:R,listItemHeight:P,childrenAsData:W,maxCount:K,optionRender:E})},[K,Z,ke,Be,Qe,$t,k,Ge,te,M,m,T,R,P,W,E]);return qv.NODE_ENV!=="production"&&(K9(e),G9(X,te)),g.createElement(zv.Provider,{value:ut},g.createElement(Qk,he({},j,{id:D,prefixCls:i,ref:t,omitDomProps:Y9,mode:r,displayValues:ze,onDisplayValuesChange:bt,direction:T,searchValue:oe,onSearch:rt,autoClearSearchValue:f,onSearchSplit:dt,dropdownMatchSelectWidth:m,OptionList:cM,emptyOptions:!ke.length,activeValue:Ve,activeDescendantId:"".concat(D,"_list_").concat(Re)})))});qv.NODE_ENV!=="production"&&(fM.displayName="Select");var Kv=fM;Kv.Option=Fv,Kv.OptGroup=Bv;function Ea(e,t,n){return J({[`${e}-status-success`]:t==="success",[`${e}-status-warning`]:t==="warning",[`${e}-status-error`]:t==="error",[`${e}-status-validating`]:t==="validating",[`${e}-has-feedback`]:n})}const ac=(e,t)=>t||e;var Q9={};const hM=()=>{const[,e]=wr(),[t]=uo("Empty"),r=new Ut(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return g.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},g.createElement("title",null,(t==null?void 0:t.description)||"Empty"),g.createElement("g",{fill:"none",fillRule:"evenodd"},g.createElement("g",{transform:"translate(24 31.67)"},g.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),g.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),g.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),g.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),g.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),g.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),g.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},g.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),g.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};Q9.NODE_ENV!=="production"&&(hM.displayName="EmptyImage");var Z9={};const pM=()=>{const[,e]=wr(),[t]=uo("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:o,colorBgContainer:i}=e,{borderColor:a,shadowColor:s,contentColor:l}=w.useMemo(()=>({borderColor:new Ut(n).onBackground(i).toHexString(),shadowColor:new Ut(r).onBackground(i).toHexString(),contentColor:new Ut(o).onBackground(i).toHexString()}),[n,r,o,i]);return g.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},g.createElement("title",null,(t==null?void 0:t.description)||"Empty"),g.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},g.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),g.createElement("g",{fillRule:"nonzero",stroke:a},g.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),g.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:l}))))};Z9.NODE_ENV!=="production"&&(pM.displayName="SimpleImage");const eU=e=>{const{componentCls:t,margin:n,marginXS:r,marginXL:o,fontSize:i,lineHeight:a}=e;return{[t]:{marginInline:r,fontSize:i,lineHeight:a,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:o,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}},tU=gn("Empty",e=>{const{componentCls:t,controlHeightLG:n,calc:r}=e,o=Dt(e,{emptyImgCls:`${t}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return eU(o)});var mM={},nU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const gM=g.createElement(hM,null),vM=g.createElement(pM,null),Vi=e=>{var t;const{className:n,rootClassName:r,prefixCls:o,image:i,description:a,children:s,imageStyle:l,style:c,classNames:u,styles:d}=e,f=nU(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:h,direction:p,className:v,style:m,classNames:b,styles:y,image:C}=xr("empty"),x=h("empty",o),[S,E,$]=tU(x),[O]=uo("Empty"),k=typeof a<"u"?a:O==null?void 0:O.description,M=typeof k=="string"?k:"empty",T=(t=i??C)!==null&&t!==void 0?t:gM;let I=null;if(typeof T=="string"?I=g.createElement("img",{draggable:!1,alt:M,src:T}):I=T,mM.NODE_ENV!=="production"){const R=Wt("Empty");[["imageStyle","styles: { image: {} }"]].forEach(([N,P])=>{R.deprecated(!(N in e),N,P)})}return S(g.createElement("div",Object.assign({className:J(E,$,x,v,{[`${x}-normal`]:T===vM,[`${x}-rtl`]:p==="rtl"},n,r,b.root,u==null?void 0:u.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},y.root),m),d==null?void 0:d.root),c)},f),g.createElement("div",{className:J(`${x}-image`,b.image,u==null?void 0:u.image),style:Object.assign(Object.assign(Object.assign({},l),y.image),d==null?void 0:d.image)},I),k&&g.createElement("div",{className:J(`${x}-description`,b.description,u==null?void 0:u.description),style:Object.assign(Object.assign({},y.description),d==null?void 0:d.description)},k),s&&g.createElement("div",{className:J(`${x}-footer`,b.footer,u==null?void 0:u.footer),style:Object.assign(Object.assign({},y.footer),d==null?void 0:d.footer)},s)))};Vi.PRESENTED_IMAGE_DEFAULT=gM,Vi.PRESENTED_IMAGE_SIMPLE=vM,mM.NODE_ENV!=="production"&&(Vi.displayName="Empty");const rU=e=>{const{componentName:t}=e,{getPrefixCls:n}=w.useContext(wt),r=n("empty");switch(t){case"Table":case"List":return w.createElement(Vi,{image:Vi.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return w.createElement(Vi,{image:Vi.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return w.createElement(Vi,null)}},Sf=(e,t,n)=>{var r,o;const{variant:i,[e]:a}=g.useContext(wt),s=g.useContext(y8),l=a==null?void 0:a.variant;let c;typeof t<"u"?c=t:n===!1?c="borderless":c=(o=(r=s??l)!==null&&r!==void 0?r:i)!==null&&o!==void 0?o:"outlined";const u=T3.includes(c);return[c,u]},oU=e=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:e==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function iU(e,t){return e||oU(t)}const bM=e=>{const{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},aU=e=>{const{antCls:t,componentCls:n}=e,r=`${n}-item`,o=`&${t}-slide-up-enter${t}-slide-up-enter-active`,i=`&${t}-slide-up-appear${t}-slide-up-appear-active`,a=`&${t}-slide-up-leave${t}-slide-up-leave-active`,s=`${n}-dropdown-placement-`,l=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},Pn(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[`
|
|
386
|
+
${o}${s}bottomLeft,
|
|
387
|
+
${i}${s}bottomLeft
|
|
388
|
+
`]:{animationName:uO},[`
|
|
389
|
+
${o}${s}topLeft,
|
|
390
|
+
${i}${s}topLeft,
|
|
391
|
+
${o}${s}topRight,
|
|
392
|
+
${i}${s}topRight
|
|
393
|
+
`]:{animationName:fO},[`${a}${s}bottomLeft`]:{animationName:dO},[`
|
|
394
|
+
${a}${s}topLeft,
|
|
395
|
+
${a}${s}topRight
|
|
396
|
+
`]:{animationName:hO},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},bM(e)),{cursor:"pointer",transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},va),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},bM(e)),{color:e.colorTextDisabled})}),[`${l}:has(+ ${l})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${l}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},Yd(e,"slide-up"),Yd(e,"slide-down"),cO(e,"move-up"),cO(e,"move-down")]},sU=e=>{const{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:o}=e,i=e.max(e.calc(n).sub(r).equal(),0),a=e.max(e.calc(i).sub(o).equal(),0);return{basePadding:i,containerPadding:a,itemHeight:Q(t),itemLineHeight:Q(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},lU=e=>{const{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},cU=e=>{const{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:o,paddingXS:i,multipleItemColorDisabled:a,multipleItemBorderColorDisabled:s,colorIcon:l,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{[`${t}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:r,cursor:"default",transition:`font-size ${o}, line-height ${o}, height ${o}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:i,paddingInlineEnd:e.calc(i).div(2).equal(),[`${t}-disabled&`]:{color:a,borderColor:s,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(i).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},ys()),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},uU=(e,t)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,o=`${n}-selection-overflow`,i=e.multipleSelectItemHeight,a=lU(e),s=t?`${n}-${t}`:"",l=sU(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},cU(e)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Q(r)} 0`,lineHeight:Q(i),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:l.itemHeight,lineHeight:Q(l.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Q(i),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal()},[`${o}-item + ${o}-item,
|
|
397
|
+
${n}-prefix + ${n}-selection-wrap
|
|
398
|
+
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${o}-item-suffix`]:{minHeight:l.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(a).equal(),"\n &-input,\n &-mirror\n ":{height:i,fontFamily:e.fontFamily,lineHeight:Q(i),transition:`all ${e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${e.motionDurationSlow}`}})}};function Gv(e,t){const{componentCls:n}=e,r=t?`${n}-${t}`:"",o={[`${n}-multiple${r}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`
|
|
399
|
+
&${n}-show-arrow ${n}-selector,
|
|
400
|
+
&${n}-allow-clear ${n}-selector
|
|
401
|
+
`]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[uU(e,t),o]}const dU=e=>{const{componentCls:t}=e,n=Dt(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=Dt(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[Gv(e),Gv(n,"sm"),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},Gv(r,"lg")]};function Xv(e,t){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:o}=e,i=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),a=t?`${n}-${t}`:"";return{[`${n}-single${a}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},Pn(e,!0)),{display:"flex",borderRadius:o,flex:"1 1 auto",[`${n}-selection-wrap:after`]:{lineHeight:Q(i)},[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`
|
|
402
|
+
${n}-selection-item,
|
|
403
|
+
${n}-selection-placeholder
|
|
404
|
+
`]:{display:"block",padding:0,lineHeight:Q(i),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
405
|
+
&${n}-show-arrow ${n}-selection-item,
|
|
406
|
+
&${n}-show-arrow ${n}-selection-search,
|
|
407
|
+
&${n}-show-arrow ${n}-selection-placeholder
|
|
408
|
+
`]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Q(r)}`,[`${n}-selection-search-input`]:{height:i,fontSize:e.fontSize},"&:after":{lineHeight:Q(i)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Q(r)}`,"&:after":{display:"none"}}}}}}}function fU(e){const{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[Xv(e),Xv(Dt(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${Q(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`
|
|
409
|
+
&${t}-show-arrow ${t}-selection-item,
|
|
410
|
+
&${t}-show-arrow ${t}-selection-placeholder
|
|
411
|
+
`]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},Xv(Dt(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}const hU=e=>{const{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:o,controlHeightSM:i,controlHeightLG:a,paddingXXS:s,controlPaddingHorizontal:l,zIndexPopupBase:c,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:h,colorBgContainer:p,colorFillSecondary:v,colorBgContainerDisabled:m,colorTextDisabled:b,colorPrimaryHover:y,colorPrimary:C,controlOutline:x}=e,S=s*2,E=r*2,$=Math.min(o-S,o-E),O=Math.min(i-S,i-E),k=Math.min(a-S,a-E);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:h,optionPadding:`${(o-t*n)/2}px ${l}px`,optionFontSize:t,optionLineHeight:n,optionHeight:o,selectorBg:p,clearBg:p,singleItemHeightLG:a,multipleItemBg:v,multipleItemBorderColor:"transparent",multipleItemHeight:$,multipleItemHeightSM:O,multipleItemHeightLG:k,multipleSelectorBgDisabled:m,multipleItemColorDisabled:b,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:y,activeBorderColor:C,activeOutlineColor:x,selectAffixPadding:s}},yM=(e,t)=>{const{componentCls:n,antCls:r,controlOutlineWidth:o}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Q(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${Q(o)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},CM=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},yM(e,t))}),pU=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},yM(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),CM(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),CM(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),SM=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},xM=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},SM(e,t))}),mU=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},SM(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),xM(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),xM(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),gU=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:"transparent",border:`${Q(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),wM=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`${Q(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,background:e.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:`transparent transparent ${t.hoverBorderHover} transparent`},[`${n}-focused& ${n}-selector`]:{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0},[`${n}-prefix`]:{color:t.color}}}},EM=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},wM(e,t))}),vU=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},wM(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),EM(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),EM(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),bU=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},pU(e)),mU(e)),gU(e)),vU(e))}),yU=e=>{const{componentCls:t}=e;return{position:"relative",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:"pointer"},[`${t}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${t}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},CU=e=>{const{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},SU=e=>{const{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:o}=e,i={[`${n}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},Pn(e)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},yU(e)),CU(e)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},va),{[`> ${t}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},va),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},ys()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${e.motionDurationSlow} ease`,[o]:{verticalAlign:"top",transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:e.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":i,"&:hover":i}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},xU=e=>{const{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:"100%"}}},SU(e),fU(e),dU(e),aU(e),{[`${t}-rtl`]:{direction:"rtl"}},Yl(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]},wU=gn("Select",(e,{rootPrefixCls:t})=>{const n=Dt(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[xU(n),bU(n)]},hU,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var EU={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},$U={},OU=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:EU}))},Yv=g.forwardRef(OU);$U.NODE_ENV!=="production"&&(Yv.displayName="CheckOutlined");var kU={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},MU={},NU=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:kU}))},Jv=g.forwardRef(NU);MU.NODE_ENV!=="production"&&(Jv.displayName="DownOutlined");var TU={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},IU={},PU=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:TU}))},Qv=g.forwardRef(PU);IU.NODE_ENV!=="production"&&(Qv.displayName="SearchOutlined");var AU={};function RU({suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:i,hasFeedback:a,prefixCls:s,showSuffixIcon:l,feedbackIcon:c,showArrow:u,componentName:d}){AU.NODE_ENV!=="production"&&Wt(d).deprecated(!t,"clearIcon","allowClear={{ clearIcon: React.ReactNode }}");const f=t??g.createElement(ws,null),h=b=>e===null&&!a&&!u?null:g.createElement(g.Fragment,null,l!==!1&&b,a&&c);let p=null;if(e!==void 0)p=h(e);else if(o)p=h(g.createElement(Es,{spin:!0}));else{const b=`${s}-suffix`;p=({open:y,showSearch:C})=>h(y&&C?g.createElement(Qv,{className:b}):g.createElement(Jv,{className:b}))}let v=null;n!==void 0?v=n:i?v=g.createElement(Yv,null):v=null;let m=null;return r!==void 0?m=r:m=g.createElement(zi,null),{clearIcon:f,suffixIcon:p,itemIcon:v,removeIcon:m}}function _U(e){return w.useMemo(()=>{if(e)return(...t)=>w.createElement(Fi,{space:!0},e.apply(void 0,t))},[e])}function DU(e,t){return t!==void 0?t:e!==null}var sc={},LU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const $M="SECRET_COMBOBOX_MODE_DO_NOT_USE",OM=(e,t)=>{var n,r,o,i,a;const{prefixCls:s,bordered:l,className:c,rootClassName:u,getPopupContainer:d,popupClassName:f,dropdownClassName:h,listHeight:p=256,placement:v,listItemHeight:m,size:b,disabled:y,notFoundContent:C,status:x,builtinPlacements:S,dropdownMatchSelectWidth:E,popupMatchSelectWidth:$,direction:O,style:k,allowClear:M,variant:T,dropdownStyle:I,transitionName:R,tagRender:N,maxCount:P,prefix:A,dropdownRender:_,popupRender:B,onDropdownVisibleChange:F,onOpenChange:U,styles:K,classNames:j}=e,D=LU(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:H,getPrefixCls:W,renderEmpty:q,direction:te,virtual:G,popupMatchSelectWidth:re,popupOverflow:oe}=g.useContext(wt),{showSearch:ne,style:Z,styles:ae,className:ie,classNames:X}=xr("select"),[,ee]=wr(),le=m??(ee==null?void 0:ee.controlHeight),ce=W("select",s),ue=W(),ge=O??te,{compactSize:ye,compactItemClassnames:$e}=Ca(ce,ge),[Ce,se]=Sf("select",T,l),Se=Po(ce),[ze,Ge,Pe]=wU(ce,Se),Oe=g.useMemo(()=>{const{mode:we}=e;if(we!=="combobox")return we===$M?"combobox":we},[e.mode]),qe=Oe==="multiple"||Oe==="tags",Ne=DU(e.suffixIcon,e.showArrow),Fe=(n=$??E)!==null&&n!==void 0?n:re,Ae=((r=K==null?void 0:K.popup)===null||r===void 0?void 0:r.root)||((o=ae.popup)===null||o===void 0?void 0:o.root)||I,ke=_U(B||_),Xe=U||F,{status:pe,hasFeedback:ve,isFormItemInput:Ve,feedbackIcon:xe}=g.useContext(qr),tt=ac(pe,x);let pt;C!==void 0?pt=C:Oe==="combobox"?pt=null:pt=(q==null?void 0:q("Select"))||g.createElement(rU,{componentName:"Select"});const{suffixIcon:Re,itemIcon:je,removeIcon:Qe,clearIcon:Be}=RU(Object.assign(Object.assign({},D),{multiple:qe,hasFeedback:ve,feedbackIcon:xe,showSuffixIcon:Ne,prefixCls:ce,componentName:"Select"})),it=M===!0?{clearIcon:Be}:M,$t=nr(D,["suffixIcon","itemIcon"]),bt=J(((i=j==null?void 0:j.popup)===null||i===void 0?void 0:i.root)||((a=X==null?void 0:X.popup)===null||a===void 0?void 0:a.root)||f||h,{[`${ce}-dropdown-${ge}`]:ge==="rtl"},u,X.root,j==null?void 0:j.root,Pe,Se,Ge),rt=Wr(we=>{var Ze;return(Ze=b??ye)!==null&&Ze!==void 0?Ze:we}),dt=g.useContext(Hr),ut=y??dt,De=J({[`${ce}-lg`]:rt==="large",[`${ce}-sm`]:rt==="small",[`${ce}-rtl`]:ge==="rtl",[`${ce}-${Ce}`]:se,[`${ce}-in-form-item`]:Ve},Ea(ce,tt,ve),$e,ie,c,X.root,j==null?void 0:j.root,u,Pe,Se,Ge),me=g.useMemo(()=>v!==void 0?v:ge==="rtl"?"bottomRight":"bottomLeft",[v,ge]);if(sc.NODE_ENV!=="production"){const we=Wt("Select");Object.entries({dropdownMatchSelectWidth:"popupMatchSelectWidth",dropdownStyle:"styles.popup.root",dropdownClassName:"classNames.popup.root",popupClassName:"classNames.popup.root",dropdownRender:"popupRender",onDropdownVisibleChange:"onOpenChange",bordered:"variant"}).forEach(([Ye,yt])=>{we.deprecated(!(Ye in e),Ye,yt)}),sc.NODE_ENV!=="production"&&we(!("showArrow"in e),"deprecated","`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."),sc.NODE_ENV!=="production"&&we(!(typeof P<"u"&&!qe),"usage","`maxCount` only works with mode `multiple` or `tags`")}const[fe]=Vg("SelectLike",Ae==null?void 0:Ae.zIndex);return ze(g.createElement(Kv,Object.assign({ref:t,virtual:G,showSearch:ne},$t,{style:Object.assign(Object.assign(Object.assign(Object.assign({},ae.root),K==null?void 0:K.root),Z),k),dropdownMatchSelectWidth:Fe,transitionName:Bi(ue,"slide-up",R),builtinPlacements:iU(S,oe),listHeight:p,listItemHeight:le,mode:Oe,prefixCls:ce,placement:me,direction:ge,prefix:A,suffixIcon:Re,menuItemSelectedIcon:je,removeIcon:Qe,allowClear:it,notFoundContent:pt,className:De,getPopupContainer:d||H,dropdownClassName:bt,disabled:ut,dropdownStyle:Object.assign(Object.assign({},Ae),{zIndex:fe}),maxCount:qe?P:void 0,tagRender:qe?N:void 0,dropdownRender:ke,onDropdownVisibleChange:Xe})))};sc.NODE_ENV!=="production"&&(OM.displayName="Select");const $a=g.forwardRef(OM),jU=Nk($a,"dropdownAlign");$a.SECRET_COMBOBOX_MODE_DO_NOT_USE=$M,$a.Option=Fv,$a.OptGroup=Bv,$a._InternalPanelDoNotUseOrYouWillBeFired=jU,sc.NODE_ENV!=="production"&&($a.displayName="Select");const xf=e=>e?typeof e=="function"?e():e:null;function Zv(e){var t=e.children,n=e.prefixCls,r=e.id,o=e.overlayInnerStyle,i=e.bodyClassName,a=e.className,s=e.style;return g.createElement("div",{className:J("".concat(n,"-content"),a),style:s},g.createElement("div",{className:J("".concat(n,"-inner"),i),id:r,role:"tooltip",style:o},typeof t=="function"?t():t))}var Ds={shiftX:64,adjustY:1},Ls={adjustX:1,shiftY:!0},Kr=[0,0],zU={left:{points:["cr","cl"],overflow:Ls,offset:[-4,0],targetOffset:Kr},right:{points:["cl","cr"],overflow:Ls,offset:[4,0],targetOffset:Kr},top:{points:["bc","tc"],overflow:Ds,offset:[0,-4],targetOffset:Kr},bottom:{points:["tc","bc"],overflow:Ds,offset:[0,4],targetOffset:Kr},topLeft:{points:["bl","tl"],overflow:Ds,offset:[0,-4],targetOffset:Kr},leftTop:{points:["tr","tl"],overflow:Ls,offset:[-4,0],targetOffset:Kr},topRight:{points:["br","tr"],overflow:Ds,offset:[0,-4],targetOffset:Kr},rightTop:{points:["tl","tr"],overflow:Ls,offset:[4,0],targetOffset:Kr},bottomRight:{points:["tr","br"],overflow:Ds,offset:[0,4],targetOffset:Kr},rightBottom:{points:["bl","br"],overflow:Ls,offset:[4,0],targetOffset:Kr},bottomLeft:{points:["tl","bl"],overflow:Ds,offset:[0,4],targetOffset:Kr},leftBottom:{points:["br","bl"],overflow:Ls,offset:[-4,0],targetOffset:Kr}},BU=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],FU=function(t,n){var r=t.overlayClassName,o=t.trigger,i=o===void 0?["hover"]:o,a=t.mouseEnterDelay,s=a===void 0?0:a,l=t.mouseLeaveDelay,c=l===void 0?.1:l,u=t.overlayStyle,d=t.prefixCls,f=d===void 0?"rc-tooltip":d,h=t.children,p=t.onVisibleChange,v=t.afterVisibleChange,m=t.transitionName,b=t.animation,y=t.motion,C=t.placement,x=C===void 0?"right":C,S=t.align,E=S===void 0?{}:S,$=t.destroyTooltipOnHide,O=$===void 0?!1:$,k=t.defaultVisible,M=t.getTooltipContainer,T=t.overlayInnerStyle;t.arrowContent;var I=t.overlay,R=t.id,N=t.showArrow,P=N===void 0?!0:N,A=t.classNames,_=t.styles,B=st(t,BU),F=lf(R),U=w.useRef(null);w.useImperativeHandle(n,function(){return U.current});var K=V({},B);"visible"in t&&(K.popupVisible=t.visible);var j=function(){return g.createElement(Zv,{key:"content",prefixCls:f,id:F,bodyClassName:A==null?void 0:A.body,overlayInnerStyle:V(V({},T),_==null?void 0:_.body)},I)},D=function(){var W=g.Children.only(h),q=(W==null?void 0:W.props)||{},te=V(V({},q),{},{"aria-describedby":I?F:null});return g.cloneElement(h,te)};return g.createElement(yf,he({popupClassName:J(r,A==null?void 0:A.root),prefixCls:f,popup:j,action:i,builtinPlacements:zU,popupPlacement:x,ref:U,popupAlign:E,getPopupContainer:M,onPopupVisibleChange:p,afterPopupVisibleChange:v,popupTransitionName:m,popupAnimation:b,popupMotion:y,defaultPopupVisible:k,autoDestroy:O,mouseLeaveDelay:c,popupStyle:V(V({},u),_==null?void 0:_.root),mouseEnterDelay:s,arrow:P},K),D())};const HU=w.forwardRef(FU);function kM(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,o=t/2,i=0,a=o,s=r*1/Math.sqrt(2),l=o-r*(1-1/Math.sqrt(2)),c=o-n*(1/Math.sqrt(2)),u=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),d=2*o-c,f=u,h=2*o-s,p=l,v=2*o-i,m=a,b=o*Math.sqrt(2)+r*(Math.sqrt(2)-2),y=r*(Math.sqrt(2)-1),C=`polygon(${y}px 100%, 50% ${y}px, ${2*o-y}px 100%, ${y}px 100%)`,x=`path('M ${i} ${a} A ${r} ${r} 0 0 0 ${s} ${l} L ${c} ${u} A ${n} ${n} 0 0 1 ${d} ${f} L ${h} ${p} A ${r} ${r} 0 0 0 ${v} ${m} Z')`;return{arrowShadowWidth:b,arrowPath:x,arrowPolygon:C}}const VU=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:o,arrowPath:i,arrowShadowWidth:a,borderRadiusXS:s,calc:l}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:l(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[o,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:a,height:a,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Q(s)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},MM=8;function eb(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?MM:r}}function wf(e,t){return e?t:{}}function NM(e,t,n){const{componentCls:r,boxShadowPopoverArrow:o,arrowOffsetVertical:i,arrowOffsetHorizontal:a}=e,{arrowDistance:s=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},VU(e,t,o)),{"&:before":{background:t}})]},wf(!!l.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:s,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":a,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:a}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Q(a)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:a}}}})),wf(!!l.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:s,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":a,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:a}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Q(a)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:a}}}})),wf(!!l.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:s},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:i},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:i}})),wf(!!l.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:s},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:i},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:i}}))}}function WU(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const o=r&&typeof r=="object"?r:{},i={};switch(e){case"top":case"bottom":i.shiftX=t.arrowOffsetHorizontal*2+n,i.shiftY=!0,i.adjustY=!0;break;case"left":case"right":i.shiftY=t.arrowOffsetVertical*2+n,i.shiftX=!0,i.adjustX=!0;break}const a=Object.assign(Object.assign({},i),o);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}const TM={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},UU={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},qU=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function KU(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:o,borderRadius:i}=e,a=t/2,s={},l=eb({contentRadius:i,limitVerticalRadius:!0});return Object.keys(TM).forEach(c=>{const u=r&&UU[c]||TM[c],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(s[c]=d,qU.has(c)&&(d.autoArrow=!1),c){case"top":case"topLeft":case"topRight":d.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=a+o;break}if(r)switch(c){case"topLeft":case"bottomLeft":d.offset[0]=-l.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":d.offset[0]=l.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":d.offset[1]=-l.arrowOffsetHorizontal*2+a;break;case"leftBottom":case"rightBottom":d.offset[1]=l.arrowOffsetHorizontal*2-a;break}d.overflow=WU(c,l,t,n),d.htmlRegion="visibleFirst"}),s}const GU=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:o,tooltipBg:i,tooltipBorderRadius:a,zIndexPopup:s,controlHeight:l,boxShadowSecondary:c,paddingSM:u,paddingXS:d,arrowOffsetHorizontal:f,sizePopupArrow:h}=e,p=t(a).add(h).add(f).equal(),v=t(a).mul(2).add(h).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":i,[`${n}-inner`]:{minWidth:v,minHeight:l,padding:`${Q(e.calc(u).div(2).equal())} ${Q(d)}`,color:`var(--ant-tooltip-color, ${o})`,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:i,borderRadius:a,boxShadow:c,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:p},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(a,MM)}},[`${n}-content`]:{position:"relative"}}),aV(e,(m,{darkColor:b})=>({[`&${n}-${m}`]:{[`${n}-inner`]:{backgroundColor:b},[`${n}-arrow`]:{"--antd-arrow-background-color":b}}}))),{"&-rtl":{direction:"rtl"}})},NM(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},XU=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},eb({contentRadius:e.borderRadius,limitVerticalRadius:!0})),kM(Dt(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))),IM=(e,t=!0)=>gn("Tooltip",r=>{const{borderRadius:o,colorTextLightSolid:i,colorBgSpotlight:a}=r,s=Dt(r,{tooltipMaxWidth:250,tooltipColor:i,tooltipBorderRadius:o,tooltipBg:a});return[GU(s),av(r,"zoom-big-fast")]},XU,{resetStyle:!1,injectStyle:t})(e),YU=Li.map(e=>`${e}-inverse`);function JU(e,t=!0){return t?[].concat(de(YU),de(Li)).includes(e):Li.includes(e)}function PM(e,t){const n=JU(t),r=J({[`${e}-${t}`]:t&&n}),o={},i={},a=Xn(t).toRgb(),l=(.299*a.r+.587*a.g+.114*a.b)/255<.5?"#FFF":"#000";return t&&!n&&(o.background=t,o["--ant-tooltip-color"]=l,i["--antd-arrow-background-color"]=t),{className:r,overlayStyle:o,arrowStyle:i}}const QU=e=>{const{prefixCls:t,className:n,placement:r="top",title:o,color:i,overlayInnerStyle:a}=e,{getPrefixCls:s}=g.useContext(wt),l=s("tooltip",t),[c,u,d]=IM(l),f=PM(l,i),h=f.arrowStyle,p=Object.assign(Object.assign({},a),f.overlayStyle),v=J(u,d,l,`${l}-pure`,`${l}-placement-${r}`,n,f.className);return c(g.createElement("div",{className:v,style:h},g.createElement("div",{className:`${l}-arrow`}),g.createElement(Zv,Object.assign({},e,{className:u,prefixCls:l,overlayInnerStyle:p}),o)))};var Ef={},ZU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const hn=g.forwardRef((e,t)=>{var n,r;const{prefixCls:o,openClassName:i,getTooltipContainer:a,color:s,overlayInnerStyle:l,children:c,afterOpenChange:u,afterVisibleChange:d,destroyTooltipOnHide:f,destroyOnHidden:h,arrow:p=!0,title:v,overlay:m,builtinPlacements:b,arrowPointAtCenter:y=!1,autoAdjustOverflow:C=!0,motion:x,getPopupContainer:S,placement:E="top",mouseEnterDelay:$=.1,mouseLeaveDelay:O=.1,overlayStyle:k,rootClassName:M,overlayClassName:T,styles:I,classNames:R}=e,N=ZU(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),P=!!p,[,A]=wr(),{getPopupContainer:_,getPrefixCls:B,direction:F,className:U,style:K,classNames:j,styles:D}=xr("tooltip"),H=Wt("Tooltip"),W=g.useRef(null),q=()=>{var Ne;(Ne=W.current)===null||Ne===void 0||Ne.forceAlign()};g.useImperativeHandle(t,()=>{var Ne,Fe;return{forceAlign:q,forcePopupAlign:()=>{H.deprecated(!1,"forcePopupAlign","forceAlign"),q()},nativeElement:(Ne=W.current)===null||Ne===void 0?void 0:Ne.nativeElement,popupElement:(Fe=W.current)===null||Fe===void 0?void 0:Fe.popupElement}}),Ef.NODE_ENV!=="production"&&([["visible","open"],["defaultVisible","defaultOpen"],["onVisibleChange","onOpenChange"],["afterVisibleChange","afterOpenChange"],["destroyTooltipOnHide","destroyOnHidden"],["arrowPointAtCenter","arrow={{ pointAtCenter: true }}"],["overlayStyle","styles={{ root: {} }}"],["overlayInnerStyle","styles={{ body: {} }}"],["overlayClassName",'classNames={{ root: "" }}']].forEach(([Ne,Fe])=>{H.deprecated(!(Ne in e),Ne,Fe)}),Ef.NODE_ENV!=="production"&&H(!f||typeof f=="boolean","usage","`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly."),Ef.NODE_ENV!=="production"&&H(!p||typeof p=="boolean"||!("arrowPointAtCenter"in p),"deprecated","`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead."));const[te,G]=cn(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),re=!v&&!m&&v!==0,oe=Ne=>{var Fe,Ae;G(re?!1:Ne),re||((Fe=e.onOpenChange)===null||Fe===void 0||Fe.call(e,Ne),(Ae=e.onVisibleChange)===null||Ae===void 0||Ae.call(e,Ne))},ne=g.useMemo(()=>{var Ne,Fe;let Ae=y;return typeof p=="object"&&(Ae=(Fe=(Ne=p.pointAtCenter)!==null&&Ne!==void 0?Ne:p.arrowPointAtCenter)!==null&&Fe!==void 0?Fe:y),b||KU({arrowPointAtCenter:Ae,autoAdjustOverflow:C,arrowWidth:P?A.sizePopupArrow:0,borderRadius:A.borderRadius,offset:A.marginXXS})},[y,p,b,A]),Z=g.useMemo(()=>v===0?v:m||v||"",[m,v]),ae=g.createElement(Fi,{space:!0},typeof Z=="function"?Z():Z),ie=B("tooltip",o),X=B(),ee=e["data-popover-inject"];let le=te;!("open"in e)&&!("visible"in e)&&re&&(le=!1);const ce=g.isValidElement(c)&&!h$(c)?c:g.createElement("span",null,c),ue=ce.props,ge=!ue.className||typeof ue.className=="string"?J(ue.className,i||`${ie}-open`):ue.className,[ye,$e,Ce]=IM(ie,!ee),se=PM(ie,s),Se=se.arrowStyle,ze=J(T,{[`${ie}-rtl`]:F==="rtl"},se.className,M,$e,Ce,U,j.root,R==null?void 0:R.root),Ge=J(j.body,R==null?void 0:R.body),[Pe,Oe]=Vg("Tooltip",N.zIndex),qe=g.createElement(HU,Object.assign({},N,{zIndex:Pe,showArrow:P,placement:E,mouseEnterDelay:$,mouseLeaveDelay:O,prefixCls:ie,classNames:{root:ze,body:Ge},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Se),D.root),K),k),I==null?void 0:I.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},D.body),l),I==null?void 0:I.body),se.overlayStyle)},getTooltipContainer:S||a||_,ref:W,builtinPlacements:ne,overlay:ae,visible:le,onVisibleChange:oe,afterVisibleChange:u??d,arrowContent:g.createElement("span",{className:`${ie}-arrow-content`}),motion:{motionName:Bi(X,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:h??!!f}),le?Io(ce,{className:ge}):ce);return ye(g.createElement(Wd.Provider,{value:Oe},qe))});Ef.NODE_ENV!=="production"&&(hn.displayName="Tooltip"),hn._InternalPanelDoNotUseOrYouWillBeFired=QU;const eq=e=>{const{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:i,boxShadowSecondary:a,colorTextHeading:s,borderRadiusLG:l,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:d,popoverBg:f,titleBorderBottom:h,innerContentPadding:p,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},Pn(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"--antd-arrow-background-color":d,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:l,boxShadow:a,padding:i},[`${t}-title`]:{minWidth:r,marginBottom:u,color:s,fontWeight:o,borderBottom:h,padding:v},[`${t}-inner-content`]:{color:n,padding:p}})},NM(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},tq=e=>{const{componentCls:t}=e;return{[t]:Li.map(n=>{const r=e[`${n}6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:"transparent"}}}})}},AM=gn("Popover",e=>{const{colorBgElevated:t,colorText:n}=e,r=Dt(e,{popoverBg:t,popoverColor:n});return[eq(r),tq(r),av(r,"zoom-big")]},e=>{const{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:i,zIndexPopupBase:a,borderRadiusLG:s,marginXS:l,lineType:c,colorSplit:u,paddingSM:d}=e,f=n-r,h=f/2,p=f/2-t,v=o;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:a+30},kM(e)),eb({contentRadius:s,limitVerticalRadius:!0})),{innerPadding:i?0:12,titleMarginBottom:i?0:l,titlePadding:i?`${h}px ${v}px ${p}px`:0,titleBorderBottom:i?`${t}px ${c} ${u}`:"none",innerContentPadding:i?`${d}px ${v}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var nq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const RM=({title:e,content:t,prefixCls:n})=>!e&&!t?null:g.createElement(g.Fragment,null,e&&g.createElement("div",{className:`${n}-title`},e),t&&g.createElement("div",{className:`${n}-inner-content`},t)),rq=e=>{const{hashId:t,prefixCls:n,className:r,style:o,placement:i="top",title:a,content:s,children:l}=e,c=xf(a),u=xf(s),d=J(t,n,`${n}-pure`,`${n}-placement-${i}`,r);return g.createElement("div",{className:d,style:o},g.createElement("div",{className:`${n}-arrow`}),g.createElement(Zv,Object.assign({},e,{className:t,prefixCls:n}),l||g.createElement(RM,{prefixCls:n,title:c,content:u})))},oq=e=>{const{prefixCls:t,className:n}=e,r=nq(e,["prefixCls","className"]),{getPrefixCls:o}=g.useContext(wt),i=o("popover",t),[a,s,l]=AM(i);return a(g.createElement(rq,Object.assign({},r,{prefixCls:i,hashId:s,className:J(n,l)})))};var iq={},aq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Wi=g.forwardRef((e,t)=>{var n,r;const{prefixCls:o,title:i,content:a,overlayClassName:s,placement:l="top",trigger:c="hover",children:u,mouseEnterDelay:d=.1,mouseLeaveDelay:f=.1,onOpenChange:h,overlayStyle:p={},styles:v,classNames:m}=e,b=aq(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:y,className:C,style:x,classNames:S,styles:E}=xr("popover"),$=y("popover",o),[O,k,M]=AM($),T=y(),I=J(s,k,M,C,S.root,m==null?void 0:m.root),R=J(S.body,m==null?void 0:m.body),[N,P]=cn(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),A=(K,j)=>{P(K,!0),h==null||h(K,j)},_=K=>{K.keyCode===Le.ESC&&A(!1,K)},B=K=>{A(K)},F=xf(i),U=xf(a);return O(g.createElement(hn,Object.assign({placement:l,trigger:c,mouseEnterDelay:d,mouseLeaveDelay:f},b,{prefixCls:$,classNames:{root:I,body:R},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},E.root),x),p),v==null?void 0:v.root),body:Object.assign(Object.assign({},E.body),v==null?void 0:v.body)},ref:t,open:N,onOpenChange:B,overlay:F||U?g.createElement(RM,{prefixCls:$,title:F,content:U}):null,transitionName:Bi(T,"zoom-big",b.transitionName),"data-popover-inject":!0}),Io(u,{onKeyDown:K=>{var j,D;w.isValidElement(u)&&((D=u==null?void 0:(j=u.props).onKeyDown)===null||D===void 0||D.call(j,K)),_(K)}})))});Wi._InternalPanelDoNotUseOrYouWillBeFired=oq,iq.NODE_ENV!=="production"&&(Wi.displayName="Popover");var sq=Le.ESC,lq=Le.TAB;function cq(e){var t=e.visible,n=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,i=e.overlayRef,a=g.useRef(!1),s=function(){if(t){var d,f;(d=n.current)===null||d===void 0||(f=d.focus)===null||f===void 0||f.call(d),r==null||r(!1)}},l=function(){var d;return(d=i.current)!==null&&d!==void 0&&d.focus?(i.current.focus(),a.current=!0,!0):!1},c=function(d){switch(d.keyCode){case sq:s();break;case lq:{var f=!1;a.current||(f=l()),f?d.preventDefault():s();break}}};g.useEffect(function(){return t?(window.addEventListener("keydown",c),o&&Nt(l,3),function(){window.removeEventListener("keydown",c),a.current=!1}):function(){a.current=!1}},[t])}var uq=w.forwardRef(function(e,t){var n=e.overlay,r=e.arrow,o=e.prefixCls,i=w.useMemo(function(){var s;return typeof n=="function"?s=n():s=n,s},[n]),a=sr(t,rs(i));return w.createElement(w.Fragment,null,r&&w.createElement("div",{className:"".concat(o,"-arrow")}),w.cloneElement(i,{ref:pa(i)?a:void 0}))}),js={adjustX:1,adjustY:1},zs=[0,0],dq={topLeft:{points:["bl","tl"],overflow:js,offset:[0,-4],targetOffset:zs},top:{points:["bc","tc"],overflow:js,offset:[0,-4],targetOffset:zs},topRight:{points:["br","tr"],overflow:js,offset:[0,-4],targetOffset:zs},bottomLeft:{points:["tl","bl"],overflow:js,offset:[0,4],targetOffset:zs},bottom:{points:["tc","bc"],overflow:js,offset:[0,4],targetOffset:zs},bottomRight:{points:["tr","br"],overflow:js,offset:[0,4],targetOffset:zs}},fq=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function hq(e,t){var n,r=e.arrow,o=r===void 0?!1:r,i=e.prefixCls,a=i===void 0?"rc-dropdown":i,s=e.transitionName,l=e.animation,c=e.align,u=e.placement,d=u===void 0?"bottomLeft":u,f=e.placements,h=f===void 0?dq:f,p=e.getPopupContainer,v=e.showAction,m=e.hideAction,b=e.overlayClassName,y=e.overlayStyle,C=e.visible,x=e.trigger,S=x===void 0?["hover"]:x,E=e.autoFocus,$=e.overlay,O=e.children,k=e.onVisibleChange,M=st(e,fq),T=w.useState(),I=Y(T,2),R=I[0],N=I[1],P="visible"in e?C:R,A=w.useRef(null),_=w.useRef(null),B=w.useRef(null);w.useImperativeHandle(t,function(){return A.current});var F=function(G){N(G),k==null||k(G)};cq({visible:P,triggerRef:B,onVisibleChange:F,autoFocus:E,overlayRef:_});var U=function(G){var re=e.onOverlayClick;N(!1),re&&re(G)},K=function(){return w.createElement(uq,{ref:_,overlay:$,prefixCls:a,arrow:o})},j=function(){return typeof $=="function"?K:K()},D=function(){var G=e.minOverlayWidthMatchTrigger,re=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?G:!re},H=function(){var G=e.openClassName;return G!==void 0?G:"".concat(a,"-open")},W=w.cloneElement(O,{className:J((n=O.props)===null||n===void 0?void 0:n.className,P&&H()),ref:pa(O)?sr(B,rs(O)):void 0}),q=m;return!q&&S.indexOf("contextMenu")!==-1&&(q=["click"]),w.createElement(yf,he({builtinPlacements:h},M,{prefixCls:a,ref:A,popupClassName:J(b,z({},"".concat(a,"-show-arrow"),o)),popupStyle:y,action:S,showAction:v,hideAction:q,popupPlacement:d,popupAlign:c,popupTransitionName:s,popupAnimation:l,popupVisible:P,stretch:D()?"minWidth":"",popup:j(),onPopupVisibleChange:F,onPopupClick:U,getPopupContainer:p}),W)}const pq=w.forwardRef(hq);var _M=g.createContext(null);function DM(e,t){return e===void 0?null:"".concat(e,"-").concat(t)}function LM(e){var t=g.useContext(_M);return DM(t,e)}var mq=["children","locked"],go=g.createContext(null);function gq(e,t){var n=V({},e);return Object.keys(t).forEach(function(r){var o=t[r];o!==void 0&&(n[r]=o)}),n}function lc(e){var t=e.children,n=e.locked,r=st(e,mq),o=g.useContext(go),i=Pl(function(){return gq(o,r)},[o,r],function(a,s){return!n&&(a[0]!==s[0]||!as(a[1],s[1],!0))});return g.createElement(go.Provider,{value:i},t)}var vq=[],jM=g.createContext(null);function $f(){return g.useContext(jM)}var zM=g.createContext(vq);function cc(e){var t=g.useContext(zM);return g.useMemo(function(){return e!==void 0?[].concat(de(t),[e]):t},[t,e])}var BM=g.createContext(null),tb=g.createContext({});function FM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Qg(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),a=null;return o&&!Number.isNaN(i)?a=i:r&&a===null&&(a=0),r&&e.disabled&&(a=null),a!==null&&(a>=0||t&&a<0)}return!1}function bq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=de(e.querySelectorAll("*")).filter(function(r){return FM(r,t)});return FM(e,t)&&n.unshift(e),n}var nb=Le.LEFT,rb=Le.RIGHT,ob=Le.UP,Of=Le.DOWN,kf=Le.ENTER,HM=Le.ESC,uc=Le.HOME,dc=Le.END,VM=[ob,Of,nb,rb];function yq(e,t,n,r){var o,i="prev",a="next",s="children",l="parent";if(e==="inline"&&r===kf)return{inlineTrigger:!0};var c=z(z({},ob,i),Of,a),u=z(z(z(z({},nb,n?a:i),rb,n?i:a),Of,s),kf,s),d=z(z(z(z(z(z({},ob,i),Of,a),kf,s),HM,l),nb,n?s:l),rb,n?l:s),f={inline:c,horizontal:u,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d},h=(o=f["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[r];switch(h){case i:return{offset:-1,sibling:!0};case a:return{offset:1,sibling:!0};case l:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function Cq(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function Sq(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function ib(e,t){var n=bq(e,!0);return n.filter(function(r){return t.has(r)})}function WM(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=ib(e,t),i=o.length,a=o.findIndex(function(s){return n===s});return r<0?a===-1?a=i-1:a-=1:r>0&&(a+=1),a=(a+i)%i,o[a]}var ab=function(t,n){var r=new Set,o=new Map,i=new Map;return t.forEach(function(a){var s=document.querySelector("[data-menu-id='".concat(DM(n,a),"']"));s&&(r.add(s),i.set(s,a),o.set(a,s))}),{elements:r,key2element:o,element2key:i}};function xq(e,t,n,r,o,i,a,s,l,c){var u=g.useRef(),d=g.useRef();d.current=t;var f=function(){Nt.cancel(u.current)};return g.useEffect(function(){return function(){f()}},[]),function(h){var p=h.which;if([].concat(VM,[kf,HM,uc,dc]).includes(p)){var v=i(),m=ab(v,r),b=m,y=b.elements,C=b.key2element,x=b.element2key,S=C.get(t),E=Sq(S,y),$=x.get(E),O=yq(e,a($,!0).length===1,n,p);if(!O&&p!==uc&&p!==dc)return;(VM.includes(p)||[uc,dc].includes(p))&&h.preventDefault();var k=function(_){if(_){var B=_,F=_.querySelector("a");F!=null&&F.getAttribute("href")&&(B=F);var U=x.get(_);s(U),f(),u.current=Nt(function(){d.current===U&&B.focus()})}};if([uc,dc].includes(p)||O.sibling||!E){var M;!E||e==="inline"?M=o.current:M=Cq(E);var T,I=ib(M,y);p===uc?T=I[0]:p===dc?T=I[I.length-1]:T=WM(M,y,E,O.offset),k(T)}else if(O.inlineTrigger)l($);else if(O.offset>0)l($,!0),f(),u.current=Nt(function(){m=ab(v,r);var A=E.getAttribute("aria-controls"),_=document.getElementById(A),B=WM(_,m.elements);k(B)},5);else if(O.offset<0){var R=a($,!0),N=R[R.length-2],P=C.get(N);l(N,!1),k(P)}}c==null||c(h)}}function wq(e){Promise.resolve().then(e)}var Eq={},sb="__RC_UTIL_PATH_SPLIT__",UM=function(t){return t.join(sb)},$q=function(t){return t.split(sb)},lb="rc-menu-more";function Oq(){var e=g.useState({}),t=Y(e,2),n=t[1],r=w.useRef(new Map),o=w.useRef(new Map),i=g.useState([]),a=Y(i,2),s=a[0],l=a[1],c=w.useRef(0),u=w.useRef(!1),d=function(){u.current||n({})},f=w.useCallback(function(C,x){Eq.NODE_ENV!=="production"&&ft(!r.current.has(C),"Duplicated key '".concat(C,"' used in Menu by path [").concat(x.join(" > "),"]"));var S=UM(x);o.current.set(S,C),r.current.set(C,S),c.current+=1;var E=c.current;wq(function(){E===c.current&&d()})},[]),h=w.useCallback(function(C,x){var S=UM(x);o.current.delete(S),r.current.delete(C)},[]),p=w.useCallback(function(C){l(C)},[]),v=w.useCallback(function(C,x){var S=r.current.get(C)||"",E=$q(S);return x&&s.includes(E[0])&&E.unshift(lb),E},[s]),m=w.useCallback(function(C,x){return C.filter(function(S){return S!==void 0}).some(function(S){var E=v(S,!0);return E.includes(x)})},[v]),b=function(){var x=de(r.current.keys());return s.length&&x.push(lb),x},y=w.useCallback(function(C){var x="".concat(r.current.get(C)).concat(sb),S=new Set;return de(o.current.keys()).forEach(function(E){E.startsWith(x)&&S.add(o.current.get(E))}),S},[]);return g.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:f,unregisterPath:h,refreshOverflowKeys:p,isSubPathKey:m,getKeyPath:v,getKeys:b,getSubPathKeys:y}}function fc(e){var t=g.useRef(e);t.current=e;var n=g.useCallback(function(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(i))},[]);return e?n:void 0}var kq={},Mq=Math.random().toFixed(5).toString().slice(2),qM=0;function Nq(e){var t=cn(e,{value:e}),n=Y(t,2),r=n[0],o=n[1];return g.useEffect(function(){qM+=1;var i=kq.NODE_ENV==="test"?"test":"".concat(Mq,"-").concat(qM);o("rc-menu-uuid-".concat(i))},[]),r}function KM(e,t,n,r){var o=g.useContext(go),i=o.activeKey,a=o.onActive,s=o.onInactive,l={active:i===e};return t||(l.onMouseEnter=function(c){n==null||n({key:e,domEvent:c}),a(e)},l.onMouseLeave=function(c){r==null||r({key:e,domEvent:c}),s(e)}),l}function GM(e){var t=g.useContext(go),n=t.mode,r=t.rtl,o=t.inlineIndent;if(n!=="inline")return null;var i=e;return r?{paddingRight:i*o}:{paddingLeft:i*o}}function XM(e){var t=e.icon,n=e.props,r=e.children,o;return t===null||t===!1?null:(typeof t=="function"?o=g.createElement(t,V({},n)):typeof t!="boolean"&&(o=t),o||r||null)}var Tq=["item"];function Mf(e){var t=e.item,n=st(e,Tq);return Object.defineProperty(n,"item",{get:function(){return ft(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}var Iq={},Pq=["title","attribute","elementRef"],Aq=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Rq=["active"],_q=(function(e){io(n,e);var t=ao(n);function n(){return dn(this,n),t.apply(this,arguments)}return fn(n,[{key:"render",value:function(){var o=this.props,i=o.title,a=o.attribute,s=o.elementRef,l=st(o,Pq),c=nr(l,["eventKey","popupClassName","popupOffset","onTitleClick"]);return ft(!a,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),g.createElement(Ro.Item,he({},a,{title:typeof i=="string"?i:void 0},c,{ref:s}))}}]),n})(g.Component),Dq=g.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.eventKey,i=e.warnKey,a=e.disabled,s=e.itemIcon,l=e.children,c=e.role,u=e.onMouseEnter,d=e.onMouseLeave,f=e.onClick,h=e.onKeyDown,p=e.onFocus,v=st(e,Aq),m=LM(o),b=g.useContext(go),y=b.prefixCls,C=b.onItemClick,x=b.disabled,S=b.overflowDisabled,E=b.itemIcon,$=b.selectedKeys,O=b.onActive,k=g.useContext(tb),M=k._internalRenderMenuItem,T="".concat(y,"-item"),I=g.useRef(),R=g.useRef(),N=x||a,P=Pi(t,R),A=cc(o);Iq.NODE_ENV!=="production"&&i&&ft(!1,"MenuItem should not leave undefined `key`.");var _=function(oe){return{key:o,keyPath:de(A).reverse(),item:I.current,domEvent:oe}},B=s||E,F=KM(o,N,u,d),U=F.active,K=st(F,Rq),j=$.includes(o),D=GM(A.length),H=function(oe){if(!N){var ne=_(oe);f==null||f(Mf(ne)),C(ne)}},W=function(oe){if(h==null||h(oe),oe.which===Le.ENTER){var ne=_(oe);f==null||f(Mf(ne)),C(ne)}},q=function(oe){O(o),p==null||p(oe)},te={};e.role==="option"&&(te["aria-selected"]=j);var G=g.createElement(_q,he({ref:I,elementRef:P,role:c===null?"none":c||"menuitem",tabIndex:a?null:-1,"data-menu-id":S&&m?null:m},nr(v,["extra"]),K,te,{component:"li","aria-disabled":a,style:V(V({},D),n),className:J(T,z(z(z({},"".concat(T,"-active"),U),"".concat(T,"-selected"),j),"".concat(T,"-disabled"),N),r),onClick:H,onKeyDown:W,onFocus:q}),l,g.createElement(XM,{props:V(V({},e),{},{isSelected:j}),icon:B}));return M&&(G=M(G,e,{selected:j})),G});function Lq(e,t){var n=e.eventKey,r=$f(),o=cc(n);return g.useEffect(function(){if(r)return r.registerPath(n,o),function(){r.unregisterPath(n,o)}},[o]),r?null:g.createElement(Dq,he({},e,{ref:t}))}const Nf=g.forwardRef(Lq);var jq=["className","children"],zq=function(t,n){var r=t.className,o=t.children,i=st(t,jq),a=g.useContext(go),s=a.prefixCls,l=a.mode,c=a.rtl;return g.createElement("ul",he({className:J(s,c&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(l==="inline"?"inline":"vertical"),r),role:"menu"},i,{"data-menu-list":!0,ref:n}),o)},cb=g.forwardRef(zq);cb.displayName="SubMenuList";var Bq={};function ub(e,t){return oo(e).map(function(n,r){if(g.isValidElement(n)){var o,i,a=n.key,s=(o=(i=n.props)===null||i===void 0?void 0:i.eventKey)!==null&&o!==void 0?o:a,l=s==null;l&&(s="tmp_key-".concat([].concat(de(t),[r]).join("-")));var c={key:s,eventKey:s};return Bq.NODE_ENV!=="production"&&l&&(c.warnKey=!0),g.cloneElement(n,c)}return n})}var rr={adjustX:1,adjustY:1},Fq={topLeft:{points:["bl","tl"],overflow:rr},topRight:{points:["br","tr"],overflow:rr},bottomLeft:{points:["tl","bl"],overflow:rr},bottomRight:{points:["tr","br"],overflow:rr},leftTop:{points:["tr","tl"],overflow:rr},leftBottom:{points:["br","bl"],overflow:rr},rightTop:{points:["tl","tr"],overflow:rr},rightBottom:{points:["bl","br"],overflow:rr}},Hq={topLeft:{points:["bl","tl"],overflow:rr},topRight:{points:["br","tr"],overflow:rr},bottomLeft:{points:["tl","bl"],overflow:rr},bottomRight:{points:["tr","br"],overflow:rr},rightTop:{points:["tr","tl"],overflow:rr},rightBottom:{points:["br","bl"],overflow:rr},leftTop:{points:["tl","tr"],overflow:rr},leftBottom:{points:["bl","br"],overflow:rr}};function YM(e,t,n){if(t)return t;if(n)return n[e]||n.other}var Vq={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Wq(e){var t=e.prefixCls,n=e.visible,r=e.children,o=e.popup,i=e.popupStyle,a=e.popupClassName,s=e.popupOffset,l=e.disabled,c=e.mode,u=e.onVisibleChange,d=g.useContext(go),f=d.getPopupContainer,h=d.rtl,p=d.subMenuOpenDelay,v=d.subMenuCloseDelay,m=d.builtinPlacements,b=d.triggerSubMenuAction,y=d.forceSubMenuRender,C=d.rootClassName,x=d.motion,S=d.defaultMotions,E=g.useState(!1),$=Y(E,2),O=$[0],k=$[1],M=V(h?V({},Hq):V({},Fq),m),T=Vq[c],I=YM(c,x,S),R=g.useRef(I);c!=="inline"&&(R.current=I);var N=V(V({},R.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),P=g.useRef();return g.useEffect(function(){return P.current=Nt(function(){k(n)}),function(){Nt.cancel(P.current)}},[n]),g.createElement(yf,{prefixCls:t,popupClassName:J("".concat(t,"-popup"),z({},"".concat(t,"-rtl"),h),a,C),stretch:c==="horizontal"?"minWidth":null,getPopupContainer:f,builtinPlacements:M,popupPlacement:T,popupVisible:O,popup:o,popupStyle:i,popupAlign:s&&{offset:s},action:l?[]:[b],mouseEnterDelay:p,mouseLeaveDelay:v,onPopupVisibleChange:u,forceRender:y,popupMotion:N,fresh:!0},r)}function Uq(e){var t=e.id,n=e.open,r=e.keyPath,o=e.children,i="inline",a=g.useContext(go),s=a.prefixCls,l=a.forceSubMenuRender,c=a.motion,u=a.defaultMotions,d=a.mode,f=g.useRef(!1);f.current=d===i;var h=g.useState(!f.current),p=Y(h,2),v=p[0],m=p[1],b=f.current?n:!1;g.useEffect(function(){f.current&&m(!1)},[d]);var y=V({},YM(i,c,u));r.length>1&&(y.motionAppear=!1);var C=y.onVisibleChanged;return y.onVisibleChanged=function(x){return!f.current&&!x&&m(!0),C==null?void 0:C(x)},v?null:g.createElement(lc,{mode:i,locked:!f.current},g.createElement(Er,he({visible:b},y,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(x){var S=x.className,E=x.style;return g.createElement(cb,{id:t,className:S,style:E},o)}))}var JM={},qq=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Kq=["active"],Gq=g.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.title,i=e.eventKey,a=e.warnKey,s=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,f=e.popupClassName,h=e.popupOffset,p=e.popupStyle,v=e.onClick,m=e.onMouseEnter,b=e.onMouseLeave,y=e.onTitleClick,C=e.onTitleMouseEnter,x=e.onTitleMouseLeave,S=st(e,qq),E=LM(i),$=g.useContext(go),O=$.prefixCls,k=$.mode,M=$.openKeys,T=$.disabled,I=$.overflowDisabled,R=$.activeKey,N=$.selectedKeys,P=$.itemIcon,A=$.expandIcon,_=$.onItemClick,B=$.onOpenChange,F=$.onActive,U=g.useContext(tb),K=U._internalRenderSubMenuItem,j=g.useContext(BM),D=j.isSubPathKey,H=cc(),W="".concat(O,"-submenu"),q=T||s,te=g.useRef(),G=g.useRef();JM.NODE_ENV!=="production"&&a&&ft(!1,"SubMenu should not leave undefined `key`.");var re=u??P,oe=d??A,ne=M.includes(i),Z=!I&&ne,ae=D(N,i),ie=KM(i,q,C,x),X=ie.active,ee=st(ie,Kq),le=g.useState(!1),ce=Y(le,2),ue=ce[0],ge=ce[1],ye=function(ve){q||ge(ve)},$e=function(ve){ye(!0),m==null||m({key:i,domEvent:ve})},Ce=function(ve){ye(!1),b==null||b({key:i,domEvent:ve})},se=g.useMemo(function(){return X||(k!=="inline"?ue||D([R],i):!1)},[k,X,R,ue,i,D]),Se=GM(H.length),ze=function(ve){q||(y==null||y({key:i,domEvent:ve}),k==="inline"&&B(i,!ne))},Ge=fc(function(pe){v==null||v(Mf(pe)),_(pe)}),Pe=function(ve){k!=="inline"&&B(i,ve)},Oe=function(){F(i)},qe=E&&"".concat(E,"-popup"),Ne=g.useMemo(function(){return g.createElement(XM,{icon:k!=="horizontal"?oe:void 0,props:V(V({},e),{},{isOpen:Z,isSubMenu:!0})},g.createElement("i",{className:"".concat(W,"-arrow")}))},[k,oe,e,Z,W]),Fe=g.createElement("div",he({role:"menuitem",style:Se,className:"".concat(W,"-title"),tabIndex:q?null:-1,ref:te,title:typeof o=="string"?o:null,"data-menu-id":I&&E?null:E,"aria-expanded":Z,"aria-haspopup":!0,"aria-controls":qe,"aria-disabled":q,onClick:ze,onFocus:Oe},ee),o,Ne),Ae=g.useRef(k);if(k!=="inline"&&H.length>1?Ae.current="vertical":Ae.current=k,!I){var ke=Ae.current;Fe=g.createElement(Wq,{mode:ke,prefixCls:W,visible:!l&&Z&&k!=="inline",popupClassName:f,popupOffset:h,popupStyle:p,popup:g.createElement(lc,{mode:ke==="horizontal"?"vertical":ke},g.createElement(cb,{id:qe,ref:G},c)),disabled:q,onVisibleChange:Pe},Fe)}var Xe=g.createElement(Ro.Item,he({ref:t,role:"none"},S,{component:"li",style:n,className:J(W,"".concat(W,"-").concat(k),r,z(z(z(z({},"".concat(W,"-open"),Z),"".concat(W,"-active"),se),"".concat(W,"-selected"),ae),"".concat(W,"-disabled"),q)),onMouseEnter:$e,onMouseLeave:Ce}),Fe,!I&&g.createElement(Uq,{id:qe,open:Z,keyPath:H},c));return K&&(Xe=K(Xe,e,{selected:ae,active:se,open:Z,disabled:q})),g.createElement(lc,{onItemClick:Ge,mode:k==="horizontal"?"vertical":k,itemIcon:re,expandIcon:oe},Xe)}),Tf=g.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=cc(n),i=ub(r,o),a=$f();g.useEffect(function(){if(a)return a.registerPath(n,o),function(){a.unregisterPath(n,o)}},[o]);var s;return a?s=i:s=g.createElement(Gq,he({ref:t},e),i),g.createElement(zM.Provider,{value:o},s)});JM.NODE_ENV!=="production"&&(Tf.displayName="SubMenu");function QM(e){var t=e.className,n=e.style,r=g.useContext(go),o=r.prefixCls,i=$f();return i?null:g.createElement("li",{role:"separator",className:J("".concat(o,"-item-divider"),t),style:n})}var Xq={},Yq=["className","title","eventKey","children"],Jq=g.forwardRef(function(e,t){var n=e.className,r=e.title;e.eventKey;var o=e.children,i=st(e,Yq),a=g.useContext(go),s=a.prefixCls,l="".concat(s,"-item-group");return g.createElement("li",he({ref:t,role:"presentation"},i,{onClick:function(u){return u.stopPropagation()},className:J(l,n)}),g.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof r=="string"?r:void 0},r),g.createElement("ul",{role:"group",className:"".concat(l,"-list")},o))}),db=g.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=cc(n),i=ub(r,o),a=$f();return a?i:g.createElement(Jq,he({ref:t},nr(e,["warnKey"])),i)});Xq.NODE_ENV!=="production"&&(db.displayName="MenuItemGroup");var Qq=["label","children","key","type","extra"];function fb(e,t,n){var r=t.item,o=t.group,i=t.submenu,a=t.divider;return(e||[]).map(function(s,l){if(s&&Ue(s)==="object"){var c=s,u=c.label,d=c.children,f=c.key,h=c.type,p=c.extra,v=st(c,Qq),m=f??"tmp-".concat(l);return d||h==="group"?h==="group"?g.createElement(o,he({key:m},v,{title:u}),fb(d,t,n)):g.createElement(i,he({key:m},v,{title:u}),fb(d,t,n)):h==="divider"?g.createElement(a,he({key:m},v)):g.createElement(r,he({key:m},v,{extra:p}),u,(!!p||p===0)&&g.createElement("span",{className:"".concat(n,"-item-extra")},p))}return null}).filter(function(s){return s})}function ZM(e,t,n,r,o){var i=e,a=V({divider:QM,item:Nf,group:db,submenu:Tf},r);return t&&(i=fb(t,a,o)),ub(i,n)}var Zq={},eK=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Oa=[],tK=g.forwardRef(function(e,t){var n,r=e,o=r.prefixCls,i=o===void 0?"rc-menu":o,a=r.rootClassName,s=r.style,l=r.className,c=r.tabIndex,u=c===void 0?0:c,d=r.items,f=r.children,h=r.direction,p=r.id,v=r.mode,m=v===void 0?"vertical":v,b=r.inlineCollapsed,y=r.disabled,C=r.disabledOverflow,x=r.subMenuOpenDelay,S=x===void 0?.1:x,E=r.subMenuCloseDelay,$=E===void 0?.1:E,O=r.forceSubMenuRender,k=r.defaultOpenKeys,M=r.openKeys,T=r.activeKey,I=r.defaultActiveFirst,R=r.selectable,N=R===void 0?!0:R,P=r.multiple,A=P===void 0?!1:P,_=r.defaultSelectedKeys,B=r.selectedKeys,F=r.onSelect,U=r.onDeselect,K=r.inlineIndent,j=K===void 0?24:K,D=r.motion,H=r.defaultMotions,W=r.triggerSubMenuAction,q=W===void 0?"hover":W,te=r.builtinPlacements,G=r.itemIcon,re=r.expandIcon,oe=r.overflowedIndicator,ne=oe===void 0?"...":oe,Z=r.overflowedIndicatorPopupClassName,ae=r.getPopupContainer,ie=r.onClick,X=r.onOpenChange,ee=r.onKeyDown,le=r.openAnimation,ce=r.openTransitionName,ue=r._internalRenderMenuItem,ge=r._internalRenderSubMenuItem,ye=r._internalComponents,$e=st(r,eK),Ce=g.useMemo(function(){return[ZM(f,d,Oa,ye,i),ZM(f,d,Oa,{},i)]},[f,d,ye]),se=Y(Ce,2),Se=se[0],ze=se[1],Ge=g.useState(!1),Pe=Y(Ge,2),Oe=Pe[0],qe=Pe[1],Ne=g.useRef(),Fe=Nq(p),Ae=h==="rtl";Zq.NODE_ENV!=="production"&&ft(!le&&!ce,"`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.");var ke=cn(k,{value:M,postState:function(gt){return gt||Oa}}),Xe=Y(ke,2),pe=Xe[0],ve=Xe[1],Ve=function(gt){var xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tt(){ve(gt),X==null||X(gt)}xt?En.flushSync(Tt):Tt()},xe=g.useState(pe),tt=Y(xe,2),pt=tt[0],Re=tt[1],je=g.useRef(!1),Qe=g.useMemo(function(){return(m==="inline"||m==="vertical")&&b?["vertical",b]:[m,!1]},[m,b]),Be=Y(Qe,2),it=Be[0],$t=Be[1],bt=it==="inline",rt=g.useState(it),dt=Y(rt,2),ut=dt[0],De=dt[1],me=g.useState($t),fe=Y(me,2),we=fe[0],Ze=fe[1];g.useEffect(function(){De(it),Ze($t),je.current&&(bt?ve(pt):Ve(Oa))},[it,$t]);var Ye=g.useState(0),yt=Y(Ye,2),St=yt[0],At=yt[1],Et=St>=Se.length-1||ut!=="horizontal"||C;g.useEffect(function(){bt&&Re(pe)},[pe]),g.useEffect(function(){return je.current=!0,function(){je.current=!1}},[]);var Bt=Oq(),jt=Bt.registerPath,Zt=Bt.unregisterPath,On=Bt.refreshOverflowKeys,Ft=Bt.isSubPathKey,Jt=Bt.getKeyPath,Me=Bt.getKeys,Ke=Bt.getSubPathKeys,We=g.useMemo(function(){return{registerPath:jt,unregisterPath:Zt}},[jt,Zt]),Te=g.useMemo(function(){return{isSubPathKey:Ft}},[Ft]);g.useEffect(function(){On(Et?Oa:Se.slice(St+1).map(function(et){return et.key}))},[St,Et]);var _e=cn(T||I&&((n=Se[0])===null||n===void 0?void 0:n.key),{value:T}),Ie=Y(_e,2),Je=Ie[0],mt=Ie[1],Ct=fc(function(et){mt(et)}),Mt=fc(function(){mt(void 0)});w.useImperativeHandle(t,function(){return{list:Ne.current,focus:function(gt){var xt,Tt=Me(),Rt=ab(Tt,Fe),Hn=Rt.elements,Vn=Rt.key2element,pr=Rt.element2key,Ir=ib(Ne.current,Hn),mr=Je??(Ir[0]?pr.get(Ir[0]):(xt=Se.find(function(Da){return!Da.props.disabled}))===null||xt===void 0?void 0:xt.key),gr=Vn.get(mr);if(mr&&gr){var _n;gr==null||(_n=gr.focus)===null||_n===void 0||_n.call(gr,gt)}}}});var Ht=cn(_||[],{value:B,postState:function(gt){return Array.isArray(gt)?gt:gt==null?Oa:[gt]}}),xn=Y(Ht,2),pn=xn[0],bn=xn[1],Fn=function(gt){if(N){var xt=gt.key,Tt=pn.includes(xt),Rt;A?Tt?Rt=pn.filter(function(Vn){return Vn!==xt}):Rt=[].concat(de(pn),[xt]):Rt=[xt],bn(Rt);var Hn=V(V({},gt),{},{selectedKeys:Rt});Tt?U==null||U(Hn):F==null||F(Hn)}!A&&pe.length&&ut!=="inline"&&Ve(Oa)},An=fc(function(et){ie==null||ie(Mf(et)),Fn(et)}),ur=fc(function(et,gt){var xt=pe.filter(function(Rt){return Rt!==et});if(gt)xt.push(et);else if(ut!=="inline"){var Tt=Ke(et);xt=xt.filter(function(Rt){return!Tt.has(Rt)})}as(pe,xt,!0)||Ve(xt,!0)}),hr=function(gt,xt){var Tt=xt??!pe.includes(gt);ur(gt,Tt)},Xr=xq(ut,Je,Ae,Fe,Ne,Me,Jt,mt,hr,ee);g.useEffect(function(){qe(!0)},[]);var zo=g.useMemo(function(){return{_internalRenderMenuItem:ue,_internalRenderSubMenuItem:ge}},[ue,ge]),ii=ut!=="horizontal"||C?Se:Se.map(function(et,gt){return g.createElement(lc,{key:et.key,overflowDisabled:gt>St},et)}),Ot=g.createElement(Ro,he({id:p,ref:Ne,prefixCls:"".concat(i,"-overflow"),component:"ul",itemComponent:Nf,className:J(i,"".concat(i,"-root"),"".concat(i,"-").concat(ut),l,z(z({},"".concat(i,"-inline-collapsed"),we),"".concat(i,"-rtl"),Ae),a),dir:h,style:s,role:"menu",tabIndex:u,data:ii,renderRawItem:function(gt){return gt},renderRawRest:function(gt){var xt=gt.length,Tt=xt?Se.slice(-xt):null;return g.createElement(Tf,{eventKey:lb,title:ne,disabled:Et,internalPopupClose:xt===0,popupClassName:Z},Tt)},maxCount:ut!=="horizontal"||C?Ro.INVALIDATE:Ro.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gt){At(gt)},onKeyDown:Xr},$e));return g.createElement(tb.Provider,{value:zo},g.createElement(_M.Provider,{value:Fe},g.createElement(lc,{prefixCls:i,rootClassName:a,mode:ut,openKeys:pe,rtl:Ae,disabled:y,motion:Oe?D:null,defaultMotions:Oe?H:null,activeKey:Je,onActive:Ct,onInactive:Mt,selectedKeys:pn,inlineIndent:j,subMenuOpenDelay:S,subMenuCloseDelay:$,forceSubMenuRender:O,builtinPlacements:te,triggerSubMenuAction:q,getPopupContainer:ae,itemIcon:G,expandIcon:re,onItemClick:An,onOpenChange:ur},g.createElement(BM.Provider,{value:Te},Ot),g.createElement("div",{style:{display:"none"},"aria-hidden":!0},g.createElement(jM.Provider,{value:We},ze)))))}),hc=tK;hc.Item=Nf,hc.SubMenu=Tf,hc.ItemGroup=db,hc.Divider=QM;var nK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},rK={},oK=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:nK}))},eN=g.forwardRef(oK);rK.NODE_ENV!=="production"&&(eN.displayName="EllipsisOutlined");function pc(e){return Dt(e,{inputAffixPadding:e.paddingXXS})}const mc=e=>{const{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:i,controlHeightLG:a,fontSizeLG:s,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:h,colorPrimary:p,controlOutlineWidth:v,controlOutline:m,colorErrorOutline:b,colorWarningOutline:y,colorBgContainer:C,inputFontSize:x,inputFontSizeLG:S,inputFontSizeSM:E}=e,$=x||n,O=E||$,k=S||s,M=Math.round((t-$*r)/2*10)/10-o,T=Math.round((i-O*r)/2*10)/10-o,I=Math.ceil((a-k*l)/2*10)/10-o;return{paddingBlock:Math.max(M,0),paddingBlockSM:Math.max(T,0),paddingBlockLG:Math.max(I,0),paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:p,hoverBorderColor:h,activeShadow:`0 0 0 ${v}px ${m}`,errorActiveShadow:`0 0 0 ${v}px ${b}`,warningActiveShadow:`0 0 0 ${v}px ${y}`,hoverBg:C,activeBg:C,inputFontSize:$,inputFontSizeLG:k,inputFontSizeSM:O}},iK=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),hb=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},iK(Dt(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),tN=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),nN=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},tN(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),rN=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},tN(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},hb(e))}),nN(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),nN(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),oN=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),iN=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},oN(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),oN(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:Object.assign({},hb(e))}})}),aN=(e,t)=>{const{componentCls:n}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${n}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${n}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},sN=(e,t)=>{var n;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(n=t==null?void 0:t.inputColor)!==null&&n!==void 0?n:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},lN=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},sN(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}})}),cN=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},sN(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},hb(e))}),lN(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),lN(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),uN=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),dN=e=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},uN(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),uN(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}})}),fN=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Q(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.hoverBorderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),hN=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},fN(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),pN=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},fN(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),hN(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),hN(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),mN=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),gN=e=>{const{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:r,paddingInlineLG:o}=e;return{padding:`${Q(t)} ${Q(o)}`,fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:r}},vN=e=>({padding:`${Q(e.paddingBlockSM)} ${Q(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),If=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Q(e.paddingBlock)} ${Q(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},mN(e.colorTextPlaceholder)),{"&-lg":Object.assign({},gN(e)),"&-sm":Object.assign({},vN(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),bN=e=>{const{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Object.assign({},gN(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Object.assign({},vN(e)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Q(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Q(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Q(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Q(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}}},[`${n}-cascader-picker`]:{margin:`-9px ${Q(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Object.assign(Object.assign({display:"block"},Rd()),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
412
|
+
& > ${t}-affix-wrapper,
|
|
413
|
+
& > ${t}-number-affix-wrapper,
|
|
414
|
+
& > ${n}-picker-range
|
|
415
|
+
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},[`& > ${n}-select > ${n}-select-selector,
|
|
416
|
+
& > ${n}-select-auto-complete ${t},
|
|
417
|
+
& > ${n}-cascader-picker ${t},
|
|
418
|
+
& > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
419
|
+
& > ${n}-select:first-child > ${n}-select-selector,
|
|
420
|
+
& > ${n}-select-auto-complete:first-child ${t},
|
|
421
|
+
& > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,
|
|
422
|
+
& > ${n}-select:last-child > ${n}-select-selector,
|
|
423
|
+
& > ${n}-cascader-picker:last-child ${t},
|
|
424
|
+
& > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:"top"},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},aK=e=>{const{componentCls:t,controlHeightSM:n,lineWidth:r,calc:o}=e,a=o(n).sub(o(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),If(e)),rN(e)),cN(e)),aN(e)),pN(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},sK=e=>{const{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${e.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Q(e.inputAffixPadding)}`}}}},lK=e=>{const{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:i,colorIconHover:a,iconCls:s}=e,l=`${t}-affix-wrapper`,c=`${t}-affix-wrapper-disabled`;return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},If(e)),{display:"inline-flex",[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),sK(e)),{[`${s}${t}-password-icon`]:{color:i,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:a}}}),[`${t}-underlined`]:{borderRadius:0},[c]:{[`${s}${t}-password-icon`]:{color:i,cursor:"not-allowed","&:hover":{color:i}}}}},cK=e=>{const{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},Pn(e)),bN(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},iN(e)),dN(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},uK=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${t}-compact-item`]:{[`&:not(${t}-compact-last-item)`]:{[`${t}-group-addon`]:{[`${t}-search-button`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${t}-compact-first-item)`]:{[`${t},${t}-affix-wrapper`]:{borderRadius:0}},[`> ${t}-group-addon ${t}-search-button,
|
|
425
|
+
> ${t},
|
|
426
|
+
${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},dK=e=>{const{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},yN=gn(["Input","Shared"],e=>{const t=Dt(e,pc(e));return[aK(t),lK(t)]},mc,{resetFont:!1}),CN=gn(["Input","Component"],e=>{const t=Dt(e,pc(e));return[cK(t),uK(t),dK(t),Yl(t)]},mc,{resetFont:!1});var fK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},hK={},pK=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:fK}))},SN=g.forwardRef(pK);hK.NODE_ENV!=="production"&&(SN.displayName="PlusOutlined");const Pf=w.createContext(null);var mK=function(t){var n=t.activeTabOffset,r=t.horizontal,o=t.rtl,i=t.indicator,a=i===void 0?{}:i,s=a.size,l=a.align,c=l===void 0?"center":l,u=w.useState(),d=Y(u,2),f=d[0],h=d[1],p=w.useRef(),v=w.useCallback(function(b){return typeof s=="function"?s(b):typeof s=="number"?s:b},[s]);function m(){Nt.cancel(p.current)}return w.useEffect(function(){var b={};if(n)if(r){b.width=v(n.width);var y=o?"right":"left";c==="start"&&(b[y]=n[y]),c==="center"&&(b[y]=n[y]+n.width/2,b.transform=o?"translateX(50%)":"translateX(-50%)"),c==="end"&&(b[y]=n[y]+n.width,b.transform="translateX(-100%)")}else b.height=v(n.height),c==="start"&&(b.top=n.top),c==="center"&&(b.top=n.top+n.height/2,b.transform="translateY(-50%)"),c==="end"&&(b.top=n.top+n.height,b.transform="translateY(-100%)");return m(),p.current=Nt(function(){var C=f&&b&&Object.keys(b).every(function(x){var S=b[x],E=f[x];return typeof S=="number"&&typeof E=="number"?Math.round(S)===Math.round(E):S===E});C||h(b)}),m},[JSON.stringify(n),r,o,c,v]),{style:f}},xN={width:0,height:0,left:0,top:0};function gK(e,t,n){return w.useMemo(function(){for(var r,o=new Map,i=t.get((r=e[0])===null||r===void 0?void 0:r.key)||xN,a=i.left+i.width,s=0;s<e.length;s+=1){var l=e[s].key,c=t.get(l);if(!c){var u;c=t.get((u=e[s-1])===null||u===void 0?void 0:u.key)||xN}var d=o.get(l)||V({},c);d.right=a-d.left-d.width,o.set(l,d)}return o},[e.map(function(r){return r.key}).join("_"),t,n])}function wN(e,t){var n=g.useRef(e),r=g.useState({}),o=Y(r,2),i=o[1];function a(s){var l=typeof s=="function"?s(n.current):s;l!==n.current&&t(l,n.current),n.current=l,i({})}return[n.current,a]}var vK=.1,EN=.01,Af=20,$N=Math.pow(.995,Af);function bK(e,t){var n=w.useState(),r=Y(n,2),o=r[0],i=r[1],a=w.useState(0),s=Y(a,2),l=s[0],c=s[1],u=w.useState(0),d=Y(u,2),f=d[0],h=d[1],p=w.useState(),v=Y(p,2),m=v[0],b=v[1],y=w.useRef();function C(k){var M=k.touches[0],T=M.screenX,I=M.screenY;i({x:T,y:I}),window.clearInterval(y.current)}function x(k){if(o){var M=k.touches[0],T=M.screenX,I=M.screenY;i({x:T,y:I});var R=T-o.x,N=I-o.y;t(R,N);var P=Date.now();c(P),h(P-l),b({x:R,y:N})}}function S(){if(o&&(i(null),b(null),m)){var k=m.x/f,M=m.y/f,T=Math.abs(k),I=Math.abs(M);if(Math.max(T,I)<vK)return;var R=k,N=M;y.current=window.setInterval(function(){if(Math.abs(R)<EN&&Math.abs(N)<EN){window.clearInterval(y.current);return}R*=$N,N*=$N,t(R*Af,N*Af)},Af)}}var E=w.useRef();function $(k){var M=k.deltaX,T=k.deltaY,I=0,R=Math.abs(M),N=Math.abs(T);R===N?I=E.current==="x"?M:T:R>N?(I=M,E.current="x"):(I=T,E.current="y"),t(-I,-I)&&k.preventDefault()}var O=w.useRef(null);O.current={onTouchStart:C,onTouchMove:x,onTouchEnd:S,onWheel:$},g.useEffect(function(){function k(R){O.current.onTouchStart(R)}function M(R){O.current.onTouchMove(R)}function T(R){O.current.onTouchEnd(R)}function I(R){O.current.onWheel(R)}return document.addEventListener("touchmove",M,{passive:!1}),document.addEventListener("touchend",T,{passive:!0}),e.current.addEventListener("touchstart",k,{passive:!0}),e.current.addEventListener("wheel",I,{passive:!1}),function(){document.removeEventListener("touchmove",M),document.removeEventListener("touchend",T)}},[])}function ON(e){var t=w.useState(0),n=Y(t,2),r=n[0],o=n[1],i=w.useRef(0),a=w.useRef();return a.current=e,ls(function(){var s;(s=a.current)===null||s===void 0||s.call(a)},[r]),function(){i.current===r&&(i.current+=1,o(i.current))}}function yK(e){var t=w.useRef([]),n=w.useState({}),r=Y(n,2),o=r[1],i=w.useRef(typeof e=="function"?e():e),a=ON(function(){var l=i.current;t.current.forEach(function(c){l=c(l)}),t.current=[],i.current=l,o({})});function s(l){t.current.push(l),a()}return[i.current,s]}var kN={width:0,height:0,left:0,top:0,right:0};function CK(e,t,n,r,o,i,a){var s=a.tabs,l=a.tabPosition,c=a.rtl,u,d,f;return["top","bottom"].includes(l)?(u="width",d=c?"right":"left",f=Math.abs(n)):(u="height",d="top",f=-n),w.useMemo(function(){if(!s.length)return[0,0];for(var h=s.length,p=h,v=0;v<h;v+=1){var m=e.get(s[v].key)||kN;if(Math.floor(m[d]+m[u])>Math.floor(f+t)){p=v-1;break}}for(var b=0,y=h-1;y>=0;y-=1){var C=e.get(s[y].key)||kN;if(C[d]<f){b=y+1;break}}return b>p?[0,-1]:[b,p]},[e,t,r,o,i,f,l,s.map(function(h){return h.key}).join("_"),c])}function MN(e){var t;return e instanceof Map?(t={},e.forEach(function(n,r){t[r]=n})):t=e,JSON.stringify(t)}var SK="TABS_DQ";function NN(e){return String(e).replace(/"/g,SK)}function pb(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}var TN=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.editable,o=e.locale,i=e.style;return!r||r.showAdd===!1?null:g.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:function(s){r.onEdit("add",{event:s})}},r.addIcon||"+")}),xK={},mb=g.forwardRef(function(e,t){var n=e.position,r=e.prefixCls,o=e.extra;if(!o)return null;var i,a={};return Ue(o)==="object"&&!g.isValidElement(o)?a=o:a.right=o,n==="right"&&(i=a.right),n==="left"&&(i=a.left),i?g.createElement("div",{className:"".concat(r,"-extra-content"),ref:t},i):null});xK.NODE_ENV!=="production"&&(mb.displayName="ExtraContent");var wK=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.id,o=e.tabs,i=e.locale,a=e.mobile,s=e.more,l=s===void 0?{}:s,c=e.style,u=e.className,d=e.editable,f=e.tabBarGutter,h=e.rtl,p=e.removeAriaLabel,v=e.onTabClick,m=e.getPopupContainer,b=e.popupClassName,y=w.useState(!1),C=Y(y,2),x=C[0],S=C[1],E=w.useState(null),$=Y(E,2),O=$[0],k=$[1],M=l.icon,T=M===void 0?"More":M,I="".concat(r,"-more-popup"),R="".concat(n,"-dropdown"),N=O!==null?"".concat(I,"-").concat(O):null,P=i==null?void 0:i.dropdownAriaLabel;function A(D,H){D.preventDefault(),D.stopPropagation(),d.onEdit("remove",{key:H,event:D})}var _=g.createElement(hc,{onClick:function(H){var W=H.key,q=H.domEvent;v(W,q),S(!1)},prefixCls:"".concat(R,"-menu"),id:I,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[O],"aria-label":P!==void 0?P:"expanded dropdown"},o.map(function(D){var H=D.closable,W=D.disabled,q=D.closeIcon,te=D.key,G=D.label,re=pb(H,q,d,W);return g.createElement(Nf,{key:te,id:"".concat(I,"-").concat(te),role:"option","aria-controls":r&&"".concat(r,"-panel-").concat(te),disabled:W},g.createElement("span",null,G),re&&g.createElement("button",{type:"button","aria-label":p||"remove",tabIndex:0,className:"".concat(R,"-menu-item-remove"),onClick:function(ne){ne.stopPropagation(),A(ne,te)}},q||d.removeIcon||"×"))}));function B(D){for(var H=o.filter(function(re){return!re.disabled}),W=H.findIndex(function(re){return re.key===O})||0,q=H.length,te=0;te<q;te+=1){W=(W+D+q)%q;var G=H[W];if(!G.disabled){k(G.key);return}}}function F(D){var H=D.which;if(!x){[Le.DOWN,Le.SPACE,Le.ENTER].includes(H)&&(S(!0),D.preventDefault());return}switch(H){case Le.UP:B(-1),D.preventDefault();break;case Le.DOWN:B(1),D.preventDefault();break;case Le.ESC:S(!1);break;case Le.SPACE:case Le.ENTER:O!==null&&v(O,D);break}}w.useEffect(function(){var D=document.getElementById(N);D&&D.scrollIntoView&&D.scrollIntoView(!1)},[O]),w.useEffect(function(){x||k(null)},[x]);var U=z({},h?"marginRight":"marginLeft",f);o.length||(U.visibility="hidden",U.order=1);var K=J(z({},"".concat(R,"-rtl"),h)),j=a?null:g.createElement(pq,he({prefixCls:R,overlay:_,visible:o.length?x:!1,onVisibleChange:S,overlayClassName:J(K,b),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:m},l),g.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:U,"aria-haspopup":"listbox","aria-controls":I,id:"".concat(r,"-more"),"aria-expanded":x,onKeyDown:F},T));return g.createElement("div",{className:J("".concat(n,"-nav-operations"),u),style:c,ref:t},j,g.createElement(TN,{prefixCls:n,locale:i,editable:d}))});const EK=g.memo(wK,function(e,t){return t.tabMoving});var $K=function(t){var n=t.prefixCls,r=t.id,o=t.active,i=t.focus,a=t.tab,s=a.key,l=a.label,c=a.disabled,u=a.closeIcon,d=a.icon,f=t.closable,h=t.renderWrapper,p=t.removeAriaLabel,v=t.editable,m=t.onClick,b=t.onFocus,y=t.onBlur,C=t.onKeyDown,x=t.onMouseDown,S=t.onMouseUp,E=t.style,$=t.tabCount,O=t.currentPosition,k="".concat(n,"-tab"),M=pb(f,u,v,c);function T(A){c||m(A)}function I(A){A.preventDefault(),A.stopPropagation(),v.onEdit("remove",{key:s,event:A})}var R=g.useMemo(function(){return d&&typeof l=="string"?g.createElement("span",null,l):l},[l,d]),N=g.useRef(null);g.useEffect(function(){i&&N.current&&N.current.focus()},[i]);var P=g.createElement("div",{key:s,"data-node-key":NN(s),className:J(k,z(z(z(z({},"".concat(k,"-with-remove"),M),"".concat(k,"-active"),o),"".concat(k,"-disabled"),c),"".concat(k,"-focus"),i)),style:E,onClick:T},g.createElement("div",{ref:N,role:"tab","aria-selected":o,id:r&&"".concat(r,"-tab-").concat(s),className:"".concat(k,"-btn"),"aria-controls":r&&"".concat(r,"-panel-").concat(s),"aria-disabled":c,tabIndex:c?null:o?0:-1,onClick:function(_){_.stopPropagation(),T(_)},onKeyDown:C,onMouseDown:x,onMouseUp:S,onFocus:b,onBlur:y},i&&g.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(O," of ").concat($)),d&&g.createElement("span",{className:"".concat(k,"-icon")},d),l&&R),M&&g.createElement("button",{type:"button",role:"tab","aria-label":p||"remove",tabIndex:o?0:-1,className:"".concat(k,"-remove"),onClick:function(_){_.stopPropagation(),I(_)}},u||v.removeIcon||"×"));return h?h(P):P},OK=function(t,n){var r=t.offsetWidth,o=t.offsetHeight,i=t.offsetTop,a=t.offsetLeft,s=t.getBoundingClientRect(),l=s.width,c=s.height,u=s.left,d=s.top;return Math.abs(l-r)<1?[l,c,u-n.left,d-n.top]:[r,o,a,i]},Bs=function(t){var n=t.current||{},r=n.offsetWidth,o=r===void 0?0:r,i=n.offsetHeight,a=i===void 0?0:i;if(t.current){var s=t.current.getBoundingClientRect(),l=s.width,c=s.height;if(Math.abs(l-o)<1)return[l,c]}return[o,a]},Rf=function(t,n){return t[n?0:1]},IN=g.forwardRef(function(e,t){var n=e.className,r=e.style,o=e.id,i=e.animated,a=e.activeKey,s=e.rtl,l=e.extra,c=e.editable,u=e.locale,d=e.tabPosition,f=e.tabBarGutter,h=e.children,p=e.onTabClick,v=e.onTabScroll,m=e.indicator,b=g.useContext(Pf),y=b.prefixCls,C=b.tabs,x=w.useRef(null),S=w.useRef(null),E=w.useRef(null),$=w.useRef(null),O=w.useRef(null),k=w.useRef(null),M=w.useRef(null),T=d==="top"||d==="bottom",I=wN(0,function(_e,Ie){T&&v&&v({direction:_e>Ie?"left":"right"})}),R=Y(I,2),N=R[0],P=R[1],A=wN(0,function(_e,Ie){!T&&v&&v({direction:_e>Ie?"top":"bottom"})}),_=Y(A,2),B=_[0],F=_[1],U=w.useState([0,0]),K=Y(U,2),j=K[0],D=K[1],H=w.useState([0,0]),W=Y(H,2),q=W[0],te=W[1],G=w.useState([0,0]),re=Y(G,2),oe=re[0],ne=re[1],Z=w.useState([0,0]),ae=Y(Z,2),ie=ae[0],X=ae[1],ee=yK(new Map),le=Y(ee,2),ce=le[0],ue=le[1],ge=gK(C,ce,q[0]),ye=Rf(j,T),$e=Rf(q,T),Ce=Rf(oe,T),se=Rf(ie,T),Se=Math.floor(ye)<Math.floor($e+Ce),ze=Se?ye-se:ye-Ce,Ge="".concat(y,"-nav-operations-hidden"),Pe=0,Oe=0;T&&s?(Pe=0,Oe=Math.max(0,$e-ze)):(Pe=Math.min(0,ze-$e),Oe=0);function qe(_e){return _e<Pe?Pe:_e>Oe?Oe:_e}var Ne=w.useRef(null),Fe=w.useState(),Ae=Y(Fe,2),ke=Ae[0],Xe=Ae[1];function pe(){Xe(Date.now())}function ve(){Ne.current&&clearTimeout(Ne.current)}bK($,function(_e,Ie){function Je(mt,Ct){mt(function(Mt){var Ht=qe(Mt+Ct);return Ht})}return Se?(T?Je(P,_e):Je(F,Ie),ve(),pe(),!0):!1}),w.useEffect(function(){return ve(),ke&&(Ne.current=setTimeout(function(){Xe(0)},100)),ve},[ke]);var Ve=CK(ge,ze,T?N:B,$e,Ce,se,V(V({},e),{},{tabs:C})),xe=Y(Ve,2),tt=xe[0],pt=xe[1],Re=qt(function(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,Ie=ge.get(_e)||{width:0,height:0,left:0,right:0,top:0};if(T){var Je=N;s?Ie.right<N?Je=Ie.right:Ie.right+Ie.width>N+ze&&(Je=Ie.right+Ie.width-ze):Ie.left<-N?Je=-Ie.left:Ie.left+Ie.width>-N+ze&&(Je=-(Ie.left+Ie.width-ze)),F(0),P(qe(Je))}else{var mt=B;Ie.top<-B?mt=-Ie.top:Ie.top+Ie.height>-B+ze&&(mt=-(Ie.top+Ie.height-ze)),P(0),F(qe(mt))}}),je=w.useState(),Qe=Y(je,2),Be=Qe[0],it=Qe[1],$t=w.useState(!1),bt=Y($t,2),rt=bt[0],dt=bt[1],ut=C.filter(function(_e){return!_e.disabled}).map(function(_e){return _e.key}),De=function(Ie){var Je=ut.indexOf(Be||a),mt=ut.length,Ct=(Je+Ie+mt)%mt,Mt=ut[Ct];it(Mt)},me=function(Ie,Je){var mt=ut.indexOf(Ie),Ct=C.find(function(Ht){return Ht.key===Ie}),Mt=pb(Ct==null?void 0:Ct.closable,Ct==null?void 0:Ct.closeIcon,c,Ct==null?void 0:Ct.disabled);Mt&&(Je.preventDefault(),Je.stopPropagation(),c.onEdit("remove",{key:Ie,event:Je}),mt===ut.length-1?De(-1):De(1))},fe=function(Ie,Je){dt(!0),Je.button===1&&me(Ie,Je)},we=function(Ie){var Je=Ie.code,mt=s&&T,Ct=ut[0],Mt=ut[ut.length-1];switch(Je){case"ArrowLeft":{T&&De(mt?1:-1);break}case"ArrowRight":{T&&De(mt?-1:1);break}case"ArrowUp":{Ie.preventDefault(),T||De(-1);break}case"ArrowDown":{Ie.preventDefault(),T||De(1);break}case"Home":{Ie.preventDefault(),it(Ct);break}case"End":{Ie.preventDefault(),it(Mt);break}case"Enter":case"Space":{Ie.preventDefault(),p(Be??a,Ie);break}case"Backspace":case"Delete":{me(Be,Ie);break}}},Ze={};T?Ze[s?"marginRight":"marginLeft"]=f:Ze.marginTop=f;var Ye=C.map(function(_e,Ie){var Je=_e.key;return g.createElement($K,{id:o,prefixCls:y,key:Je,tab:_e,style:Ie===0?void 0:Ze,closable:_e.closable,editable:c,active:Je===a,focus:Je===Be,renderWrapper:h,removeAriaLabel:u==null?void 0:u.removeAriaLabel,tabCount:ut.length,currentPosition:Ie+1,onClick:function(Ct){p(Je,Ct)},onKeyDown:we,onFocus:function(){rt||it(Je),Re(Je),pe(),$.current&&(s||($.current.scrollLeft=0),$.current.scrollTop=0)},onBlur:function(){it(void 0)},onMouseDown:function(Ct){return fe(Je,Ct)},onMouseUp:function(){dt(!1)}})}),yt=function(){return ue(function(){var Ie,Je=new Map,mt=(Ie=O.current)===null||Ie===void 0?void 0:Ie.getBoundingClientRect();return C.forEach(function(Ct){var Mt,Ht=Ct.key,xn=(Mt=O.current)===null||Mt===void 0?void 0:Mt.querySelector('[data-node-key="'.concat(NN(Ht),'"]'));if(xn){var pn=OK(xn,mt),bn=Y(pn,4),Fn=bn[0],An=bn[1],ur=bn[2],hr=bn[3];Je.set(Ht,{width:Fn,height:An,left:ur,top:hr})}}),Je})};w.useEffect(function(){yt()},[C.map(function(_e){return _e.key}).join("_")]);var St=ON(function(){var _e=Bs(x),Ie=Bs(S),Je=Bs(E);D([_e[0]-Ie[0]-Je[0],_e[1]-Ie[1]-Je[1]]);var mt=Bs(M);ne(mt);var Ct=Bs(k);X(Ct);var Mt=Bs(O);te([Mt[0]-mt[0],Mt[1]-mt[1]]),yt()}),At=C.slice(0,tt),Et=C.slice(pt+1),Bt=[].concat(de(At),de(Et)),jt=ge.get(a),Zt=mK({activeTabOffset:jt,horizontal:T,indicator:m,rtl:s}),On=Zt.style;w.useEffect(function(){Re()},[a,Pe,Oe,MN(jt),MN(ge),T]),w.useEffect(function(){St()},[s]);var Ft=!!Bt.length,Jt="".concat(y,"-nav-wrap"),Me,Ke,We,Te;return T?s?(Ke=N>0,Me=N!==Oe):(Me=N<0,Ke=N!==Pe):(We=B<0,Te=B!==Pe),g.createElement(zr,{onResize:St},g.createElement("div",{ref:Pi(t,x),role:"tablist","aria-orientation":T?"horizontal":"vertical",className:J("".concat(y,"-nav"),n),style:r,onKeyDown:function(){pe()}},g.createElement(mb,{ref:S,position:"left",extra:l,prefixCls:y}),g.createElement(zr,{onResize:St},g.createElement("div",{className:J(Jt,z(z(z(z({},"".concat(Jt,"-ping-left"),Me),"".concat(Jt,"-ping-right"),Ke),"".concat(Jt,"-ping-top"),We),"".concat(Jt,"-ping-bottom"),Te)),ref:$},g.createElement(zr,{onResize:St},g.createElement("div",{ref:O,className:"".concat(y,"-nav-list"),style:{transform:"translate(".concat(N,"px, ").concat(B,"px)"),transition:ke?"none":void 0}},Ye,g.createElement(TN,{ref:M,prefixCls:y,locale:u,editable:c,style:V(V({},Ye.length===0?void 0:Ze),{},{visibility:Ft?"hidden":null})}),g.createElement("div",{className:J("".concat(y,"-ink-bar"),z({},"".concat(y,"-ink-bar-animated"),i.inkBar)),style:On}))))),g.createElement(EK,he({},e,{removeAriaLabel:u==null?void 0:u.removeAriaLabel,ref:k,prefixCls:y,tabs:Bt,className:!Ft&&Ge,tabMoving:!!ke})),g.createElement(mb,{ref:E,position:"right",extra:l,prefixCls:y})))}),kK={},gb=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,o=e.style,i=e.id,a=e.active,s=e.tabKey,l=e.children;return g.createElement("div",{id:i&&"".concat(i,"-panel-").concat(s),role:"tabpanel",tabIndex:a?0:-1,"aria-labelledby":i&&"".concat(i,"-tab-").concat(s),"aria-hidden":!a,style:o,className:J(n,a&&"".concat(n,"-active"),r),ref:t},l)});kK.NODE_ENV!=="production"&&(gb.displayName="TabPane");var MK={},NK=["renderTabBar"],TK=["label","key"],PN=function(t){var n=t.renderTabBar,r=st(t,NK),o=g.useContext(Pf),i=o.tabs;if(n){var a=V(V({},r),{},{panes:i.map(function(s){var l=s.label,c=s.key,u=st(s,TK);return g.createElement(gb,he({tab:l,key:c,tabKey:c},u))})});return n(a,IN)}return g.createElement(IN,r)};MK.NODE_ENV!=="production"&&(PN.displayName="TabNavListWrapper");var IK=["key","forceRender","style","className","destroyInactiveTabPane"],PK=function(t){var n=t.id,r=t.activeKey,o=t.animated,i=t.tabPosition,a=t.destroyInactiveTabPane,s=g.useContext(Pf),l=s.prefixCls,c=s.tabs,u=o.tabPane,d="".concat(l,"-tabpane");return g.createElement("div",{className:J("".concat(l,"-content-holder"))},g.createElement("div",{className:J("".concat(l,"-content"),"".concat(l,"-content-").concat(i),z({},"".concat(l,"-content-animated"),u))},c.map(function(f){var h=f.key,p=f.forceRender,v=f.style,m=f.className,b=f.destroyInactiveTabPane,y=st(f,IK),C=h===r;return g.createElement(Er,he({key:h,visible:C,forceRender:p,removeOnLeave:!!(a||b),leavedClassName:"".concat(d,"-hidden")},o.tabPaneMotion),function(x,S){var E=x.style,$=x.className;return g.createElement(gb,he({},y,{prefixCls:d,id:n,tabKey:h,animated:u,active:C,style:V(V({},v),E),className:J(m,$),ref:S}))})})))},AK={};function RK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!1}:t=V({inkBar:!0},Ue(e)==="object"?e:{}),t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(AK.NODE_ENV!=="production"&&ft(!1,"`animated.tabPane` is true but `animated.tabPaneMotion` is not provided. Motion will not work."),t.tabPane=!1),t}var AN={},_K=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],RN=0,_N=g.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,o=r===void 0?"rc-tabs":r,i=e.className,a=e.items,s=e.direction,l=e.activeKey,c=e.defaultActiveKey,u=e.editable,d=e.animated,f=e.tabPosition,h=f===void 0?"top":f,p=e.tabBarGutter,v=e.tabBarStyle,m=e.tabBarExtraContent,b=e.locale,y=e.more,C=e.destroyInactiveTabPane,x=e.renderTabBar,S=e.onChange,E=e.onTabClick,$=e.onTabScroll,O=e.getPopupContainer,k=e.popupClassName,M=e.indicator,T=st(e,_K),I=g.useMemo(function(){return(a||[]).filter(function(ie){return ie&&Ue(ie)==="object"&&"key"in ie})},[a]),R=s==="rtl",N=RK(d),P=w.useState(!1),A=Y(P,2),_=A[0],B=A[1];w.useEffect(function(){B(gf())},[]);var F=cn(function(){var ie;return(ie=I[0])===null||ie===void 0?void 0:ie.key},{value:l,defaultValue:c}),U=Y(F,2),K=U[0],j=U[1],D=w.useState(function(){return I.findIndex(function(ie){return ie.key===K})}),H=Y(D,2),W=H[0],q=H[1];w.useEffect(function(){var ie=I.findIndex(function(ee){return ee.key===K});if(ie===-1){var X;ie=Math.max(0,Math.min(W,I.length-1)),j((X=I[ie])===null||X===void 0?void 0:X.key)}q(ie)},[I.map(function(ie){return ie.key}).join("_"),K,W]);var te=cn(null,{value:n}),G=Y(te,2),re=G[0],oe=G[1];w.useEffect(function(){n||(oe("rc-tabs-".concat(AN.NODE_ENV==="test"?"test":RN)),RN+=1)},[]);function ne(ie,X){E==null||E(ie,X);var ee=ie!==K;j(ie),ee&&(S==null||S(ie))}var Z={id:re,activeKey:K,animated:N,tabPosition:h,rtl:R,mobile:_},ae=V(V({},Z),{},{editable:u,locale:b,more:y,tabBarGutter:p,onTabClick:ne,onTabScroll:$,extra:m,style:v,panes:null,getPopupContainer:O,popupClassName:k,indicator:M});return g.createElement(Pf.Provider,{value:{tabs:I,prefixCls:o}},g.createElement("div",he({ref:t,id:n,className:J(o,"".concat(o,"-").concat(h),z(z(z({},"".concat(o,"-mobile"),_),"".concat(o,"-editable"),u),"".concat(o,"-rtl"),R),i)},T),g.createElement(PN,he({},ae,{renderTabBar:x})),g.createElement(PK,he({destroyInactiveTabPane:C},Z,{animated:N}))))});AN.NODE_ENV!=="production"&&(_N.displayName="Tabs");const DK={motionAppear:!1,motionEnter:!0,motionLeave:!0};function LK(e,t={inkBar:!0,tabPane:!1}){let n;return t===!1?n={inkBar:!1,tabPane:!1}:t===!0?n={inkBar:!0,tabPane:!0}:n=Object.assign({inkBar:!0},typeof t=="object"?t:{}),n.tabPane&&(n.tabPaneMotion=Object.assign(Object.assign({},DK),{motionName:Bi(e,"switch")})),n}var jK={},zK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function BK(e){return e.filter(t=>t)}function FK(e,t){if(jK.NODE_ENV!=="production"&&Wt("Tabs").deprecated(!t,"Tabs.TabPane","items"),e)return e.map(r=>{var o;const i=(o=r.destroyOnHidden)!==null&&o!==void 0?o:r.destroyInactiveTabPane;return Object.assign(Object.assign({},r),{destroyInactiveTabPane:i})});const n=oo(t).map(r=>{if(g.isValidElement(r)){const{key:o,props:i}=r,a=i||{},{tab:s}=a,l=zK(a,["tab"]);return Object.assign(Object.assign({key:String(o)},l),{label:s})}return null});return BK(n)}const HK=e=>{const{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[Yd(e,"slide-up"),Yd(e,"slide-down")]]},VK=e=>{const{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:i,itemSelectedColor:a}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${Q(e.lineWidth)} ${e.lineType} ${i}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:a,background:e.colorBgContainer},[`${t}-tab-focus:has(${t}-tab-btn:focus-visible)`]:_d(e,-3),[`& ${t}-tab${t}-tab-focus ${t}-tab-btn:focus-visible`]:{outline:"none"},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:Q(o)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:Q(o)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Q(e.borderRadiusLG)} 0 0 ${Q(e.borderRadiusLG)}`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},WK=e=>{const{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{[`${t}-dropdown`]:Object.assign(Object.assign({},Pn(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${Q(r)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},va),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${Q(e.paddingXXS)} ${Q(e.paddingSM)}`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},UK=e=>{const{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:i,verticalItemMargin:a,calc:s}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Q(e.lineWidth)} ${e.lineType} ${r}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
|
|
427
|
+
right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
|
|
428
|
+
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:s(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:i,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:a},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:Q(s(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:s(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},qK=e=>{const{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,cardHeightSM:o,cardHeightLG:i,horizontalItemPaddingSM:a,horizontalItemPaddingLG:s}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:a,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:s,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:o,minHeight:o}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${Q(e.borderRadius)} ${Q(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${Q(e.borderRadius)} ${Q(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Q(e.borderRadius)} ${Q(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Q(e.borderRadius)} 0 0 ${Q(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:i,minHeight:i}}}}}},KK=e=>{const{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:i,horizontalItemPadding:a,itemSelectedColor:s,itemColor:l}=e,c=`${t}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:a,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:"none",transition:`all ${e.motionDurationSlow}`,[`${c}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM}},"&-remove":Object.assign({flex:"none",lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},ba(e)),"&:hover":{color:r},[`&${c}-active ${c}-btn`]:{color:s,textShadow:e.tabsActiveTextShadow},[`&${c}-focus ${c}-btn:focus-visible`]:_d(e),[`&${c}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${c}-remove ${o}`]:{margin:0,verticalAlign:"middle"},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:i}}}},GK=e=>{const{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:i}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Q(e.marginSM)}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Q(e.marginXS)},marginLeft:{_skip_check_:!0,value:Q(i(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},XK=e=>{const{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:i,itemActiveColor:a,colorBorderSecondary:s}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),{display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:Object.assign({minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},background:"transparent",border:`${Q(e.lineWidth)} ${e.lineType} ${s}`,borderRadius:`${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:i},"&:active, &:focus:not(:focus-visible)":{color:a}},ba(e,-3))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),KK(e)),{[`${t}-content`]:{position:"relative",width:"100%"},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:Object.assign(Object.assign({},ba(e)),{"&-hidden":{display:"none"}})}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping']) > ${t}-nav-list`]:{margin:"auto"}}}}}},YK=gn("Tabs",e=>{const t=Dt(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Q(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${Q(e.horizontalItemGutter)}`});return[qK(t),GK(t),UK(t),WK(t),VK(t),XK(t),HK(t)]},e=>{const{cardHeight:t,cardHeightSM:n,cardHeightLG:r,controlHeight:o,controlHeightLG:i}=e,a=t||i,s=n||o,l=r||i+8;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:a,cardHeightSM:s,cardHeightLG:l,cardPadding:`${(a-e.fontHeight)/2-e.lineWidth}px ${e.padding}px`,cardPaddingSM:`${(s-e.fontHeight)/2-e.lineWidth}px ${e.paddingXS}px`,cardPaddingLG:`${(l-e.fontHeightLG)/2-e.lineWidth}px ${e.padding}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}});var JK={};const DN=()=>null;JK.NODE_ENV!=="production"&&(DN.displayName="DeprecatedTabPane");var _f={},QK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Df=g.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c,u,d,f;const{type:h,className:p,rootClassName:v,size:m,onEdit:b,hideAdd:y,centered:C,addIcon:x,removeIcon:S,moreIcon:E,more:$,popupClassName:O,children:k,items:M,animated:T,style:I,indicatorSize:R,indicator:N,destroyInactiveTabPane:P,destroyOnHidden:A}=e,_=QK(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator","destroyInactiveTabPane","destroyOnHidden"]),{prefixCls:B}=_,{direction:F,tabs:U,getPrefixCls:K,getPopupContainer:j}=g.useContext(wt),D=K("tabs",B),H=Po(D),[W,q,te]=YK(D,H),G=g.useRef(null);g.useImperativeHandle(t,()=>({nativeElement:G.current}));let re;h==="editable-card"&&(re={onEdit:(ee,{key:le,event:ce})=>{b==null||b(ee==="add"?ce:le,ee)},removeIcon:(n=S??(U==null?void 0:U.removeIcon))!==null&&n!==void 0?n:g.createElement(zi,null),addIcon:(x??(U==null?void 0:U.addIcon))||g.createElement(SN,null),showAdd:y!==!0});const oe=K();if(_f.NODE_ENV!=="production"){const ee=Wt("Tabs");_f.NODE_ENV!=="production"&&ee(!("onPrevClick"in e)&&!("onNextClick"in e),"breaking","`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead."),_f.NODE_ENV!=="production"&&ee(!(R||U!=null&&U.indicatorSize),"deprecated","`indicatorSize` has been deprecated. Please use `indicator={{ size: ... }}` instead."),ee.deprecated(!("destroyInactiveTabPane"in e||M!=null&&M.some(le=>"destroyInactiveTabPane"in le)),"destroyInactiveTabPane","destroyOnHidden")}const ne=Wr(m),Z=FK(M,k),ae=LK(D,T),ie=Object.assign(Object.assign({},U==null?void 0:U.style),I),X={align:(r=N==null?void 0:N.align)!==null&&r!==void 0?r:(o=U==null?void 0:U.indicator)===null||o===void 0?void 0:o.align,size:(l=(a=(i=N==null?void 0:N.size)!==null&&i!==void 0?i:R)!==null&&a!==void 0?a:(s=U==null?void 0:U.indicator)===null||s===void 0?void 0:s.size)!==null&&l!==void 0?l:U==null?void 0:U.indicatorSize};return W(g.createElement(_N,Object.assign({ref:G,direction:F,getPopupContainer:j},_,{items:Z,className:J({[`${D}-${ne}`]:ne,[`${D}-card`]:["card","editable-card"].includes(h),[`${D}-editable-card`]:h==="editable-card",[`${D}-centered`]:C},U==null?void 0:U.className,p,v,q,te,H),popupClassName:J(O,q,te,H),style:ie,editable:re,more:Object.assign({icon:(f=(d=(u=(c=U==null?void 0:U.more)===null||c===void 0?void 0:c.icon)!==null&&u!==void 0?u:U==null?void 0:U.moreIcon)!==null&&d!==void 0?d:E)!==null&&f!==void 0?f:g.createElement(eN,null),transitionName:`${oe}-slide-up`},$),prefixCls:D,animated:ae,indicator:X,destroyInactiveTabPane:A??P})))});Df.TabPane=DN,_f.NODE_ENV!=="production"&&(Df.displayName="Tabs");const ZK=e=>{const{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},eG=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:i,orientationMargin:a,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},Pn(e)),{borderBlockStart:`${Q(o)} solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Q(o)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Q(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${Q(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${Q(o)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-start`]:{"&::before":{width:`calc(${a} * 100%)`},"&::after":{width:`calc(100% - ${a} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{"&::before":{width:`calc(100% - ${a} * 100%)`},"&::after":{width:`calc(${a} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${Q(o)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:r,borderStyle:"dotted",borderWidth:`${Q(o)} 0 0`},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}},tG=gn("Divider",e=>{const t=Dt(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[eG(t),ZK(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}});var vb={},nG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const rG={small:"sm",middle:"md"},LN=e=>{const{getPrefixCls:t,direction:n,className:r,style:o}=xr("divider"),{prefixCls:i,type:a="horizontal",orientation:s="center",orientationMargin:l,className:c,rootClassName:u,children:d,dashed:f,variant:h="solid",plain:p,style:v,size:m}=e,b=nG(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),y=t("divider",i),[C,x,S]=tG(y),E=Wr(m),$=rG[E],O=!!d,k=g.useMemo(()=>s==="left"?n==="rtl"?"end":"start":s==="right"?n==="rtl"?"start":"end":s,[n,s]),M=k==="start"&&l!=null,T=k==="end"&&l!=null,I=J(y,r,x,S,`${y}-${a}`,{[`${y}-with-text`]:O,[`${y}-with-text-${k}`]:O,[`${y}-dashed`]:!!f,[`${y}-${h}`]:h!=="solid",[`${y}-plain`]:!!p,[`${y}-rtl`]:n==="rtl",[`${y}-no-default-orientation-margin-start`]:M,[`${y}-no-default-orientation-margin-end`]:T,[`${y}-${$}`]:!!$},c,u),R=g.useMemo(()=>typeof l=="number"?l:/^\d+$/.test(l)?Number(l):l,[l]),N={marginInlineStart:M?R:void 0,marginInlineEnd:T?R:void 0};if(vb.NODE_ENV!=="production"){const P=Wt("Divider");vb.NODE_ENV!=="production"&&P(!d||a!=="vertical","usage","`children` not working in `vertical` mode.")}return C(g.createElement("div",Object.assign({className:I,style:Object.assign(Object.assign({},o),v)},b,{role:"separator"}),d&&a!=="vertical"&&g.createElement("span",{className:`${y}-inner-text`,style:N},d)))};vb.NODE_ENV!=="production"&&(LN.displayName="Divider");var oG={},jN=function(t,n){if(!t)return null;var r={left:t.offsetLeft,right:t.parentElement.clientWidth-t.clientWidth-t.offsetLeft,width:t.clientWidth,top:t.offsetTop,bottom:t.parentElement.clientHeight-t.clientHeight-t.offsetTop,height:t.clientHeight};return n?{left:0,right:0,width:0,top:r.top,bottom:r.bottom,height:r.height}:{left:r.left,right:r.right,width:r.width,top:0,bottom:0,height:0}},_o=function(t){return t!==void 0?"".concat(t,"px"):void 0};function iG(e){var t=e.prefixCls,n=e.containerRef,r=e.value,o=e.getValueIndex,i=e.motionName,a=e.onMotionStart,s=e.onMotionEnd,l=e.direction,c=e.vertical,u=c===void 0?!1:c,d=g.useRef(null),f=g.useState(r),h=Y(f,2),p=h[0],v=h[1],m=function(P){var A,_=o(P),B=(A=n.current)===null||A===void 0?void 0:A.querySelectorAll(".".concat(t,"-item"))[_];return(B==null?void 0:B.offsetParent)&&B},b=g.useState(null),y=Y(b,2),C=y[0],x=y[1],S=g.useState(null),E=Y(S,2),$=E[0],O=E[1];Yt(function(){if(p!==r){var N=m(p),P=m(r),A=jN(N,u),_=jN(P,u);v(r),x(A),O(_),N&&P?a():s()}},[r]);var k=g.useMemo(function(){if(u){var N;return _o((N=C==null?void 0:C.top)!==null&&N!==void 0?N:0)}return _o(l==="rtl"?-(C==null?void 0:C.right):C==null?void 0:C.left)},[u,l,C]),M=g.useMemo(function(){if(u){var N;return _o((N=$==null?void 0:$.top)!==null&&N!==void 0?N:0)}return _o(l==="rtl"?-($==null?void 0:$.right):$==null?void 0:$.left)},[u,l,$]),T=function(){return u?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},I=function(){return u?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},R=function(){x(null),O(null),s()};return!C||!$?null:g.createElement(Er,{visible:!0,motionName:i,motionAppear:!0,onAppearStart:T,onAppearActive:I,onVisibleChanged:R},function(N,P){var A=N.className,_=N.style,B=V(V({},_),{},{"--thumb-start-left":k,"--thumb-start-width":_o(C==null?void 0:C.width),"--thumb-active-left":M,"--thumb-active-width":_o($==null?void 0:$.width),"--thumb-start-top":k,"--thumb-start-height":_o(C==null?void 0:C.height),"--thumb-active-top":M,"--thumb-active-height":_o($==null?void 0:$.height)}),F={ref:sr(d,P),style:B,className:J("".concat(t,"-thumb"),A)};return oG.NODE_ENV==="test"&&(F["data-test-style"]=JSON.stringify(B)),g.createElement("div",F)})}var aG={},sG=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"];function lG(e){if(typeof e.title<"u")return e.title;if(Ue(e.label)!=="object"){var t;return(t=e.label)===null||t===void 0?void 0:t.toString()}}function cG(e){return e.map(function(t){if(Ue(t)==="object"&&t!==null){var n=lG(t);return V(V({},t),{},{title:n})}return{label:t==null?void 0:t.toString(),title:t==null?void 0:t.toString(),value:t}})}var uG=function(t){var n=t.prefixCls,r=t.className,o=t.disabled,i=t.checked,a=t.label,s=t.title,l=t.value,c=t.name,u=t.onChange,d=t.onFocus,f=t.onBlur,h=t.onKeyDown,p=t.onKeyUp,v=t.onMouseDown,m=function(y){o||u(y,l)};return g.createElement("label",{className:J(r,z({},"".concat(n,"-item-disabled"),o)),onMouseDown:v},g.createElement("input",{name:c,className:"".concat(n,"-item-input"),type:"radio",disabled:o,checked:i,onChange:m,onFocus:d,onBlur:f,onKeyDown:h,onKeyUp:p}),g.createElement("div",{className:"".concat(n,"-item-label"),title:s},a))},zN=g.forwardRef(function(e,t){var n,r=e.prefixCls,o=r===void 0?"rc-segmented":r,i=e.direction,a=e.vertical,s=e.options,l=s===void 0?[]:s,c=e.disabled,u=e.defaultValue,d=e.value,f=e.name,h=e.onChange,p=e.className,v=p===void 0?"":p,m=e.motionName,b=m===void 0?"thumb-motion":m,y=st(e,sG),C=g.useRef(null),x=g.useMemo(function(){return sr(C,t)},[C,t]),S=g.useMemo(function(){return cG(l)},[l]),E=cn((n=S[0])===null||n===void 0?void 0:n.value,{value:d,defaultValue:u}),$=Y(E,2),O=$[0],k=$[1],M=g.useState(!1),T=Y(M,2),I=T[0],R=T[1],N=function(ne,Z){k(Z),h==null||h(Z)},P=nr(y,["children"]),A=g.useState(!1),_=Y(A,2),B=_[0],F=_[1],U=g.useState(!1),K=Y(U,2),j=K[0],D=K[1],H=function(){D(!0)},W=function(){D(!1)},q=function(){F(!1)},te=function(ne){ne.key==="Tab"&&F(!0)},G=function(ne){var Z=S.findIndex(function(ee){return ee.value===O}),ae=S.length,ie=(Z+ne+ae)%ae,X=S[ie];X&&(k(X.value),h==null||h(X.value))},re=function(ne){switch(ne.key){case"ArrowLeft":case"ArrowUp":G(-1);break;case"ArrowRight":case"ArrowDown":G(1);break}};return g.createElement("div",he({role:"radiogroup","aria-label":"segmented control",tabIndex:c?void 0:0,"aria-orientation":a?"vertical":"horizontal"},P,{className:J(o,z(z(z({},"".concat(o,"-rtl"),i==="rtl"),"".concat(o,"-disabled"),c),"".concat(o,"-vertical"),a),v),ref:x}),g.createElement("div",{className:"".concat(o,"-group")},g.createElement(iG,{vertical:a,prefixCls:o,value:O,containerRef:C,motionName:"".concat(o,"-").concat(b),direction:i,getValueIndex:function(ne){return S.findIndex(function(Z){return Z.value===ne})},onMotionStart:function(){R(!0)},onMotionEnd:function(){R(!1)}}),S.map(function(oe){return g.createElement(uG,he({},oe,{name:f,key:oe.value,prefixCls:o,className:J(oe.className,"".concat(o,"-item"),z(z({},"".concat(o,"-item-selected"),oe.value===O&&!I),"".concat(o,"-item-focused"),j&&B&&oe.value===O)),checked:oe.value===O,onChange:N,onFocus:H,onBlur:W,onKeyDown:re,onKeyUp:te,onMouseDown:q,disabled:!!c||!!oe.disabled}))})))});aG.NODE_ENV!=="production"&&(zN.displayName="Segmented");var dG=zN;function BN(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function FN(e){return{background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}const fG=Object.assign({overflow:"hidden"},va),hG=e=>{const{componentCls:t}=e,n=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),r=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),o=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`}),ba(e)),{[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${Q(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},FN(e)),{color:e.itemSelectedColor}),"&-focused":_d(e),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:not(${t}-item-selected):not(${t}-item-disabled)`]:{"&:hover, &:active":{color:e.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:e.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:n,lineHeight:Q(n),padding:`0 ${Q(e.segmentedPaddingHorizontal)}`},fG),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},FN(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${Q(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:r,lineHeight:Q(r),padding:`0 ${Q(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:o,lineHeight:Q(o),padding:`0 ${Q(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),BN(`&-disabled ${t}-item`,e)),BN(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}},pG=gn("Segmented",e=>{const{lineWidth:t,calc:n}=e,r=Dt(e,{segmentedPaddingHorizontal:n(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:n(e.controlPaddingHorizontalSM).sub(t).equal()});return hG(r)},e=>{const{colorTextLabel:t,colorText:n,colorFillSecondary:r,colorBgElevated:o,colorFill:i,lineWidthBold:a,colorBgLayout:s}=e;return{trackPadding:a,trackBg:s,itemColor:t,itemHoverColor:n,itemHoverBg:r,itemSelectedBg:o,itemActiveBg:i,itemSelectedColor:n}});var mG={},HN=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function gG(e){return typeof e=="object"&&!!(e!=null&&e.icon)}const VN=g.forwardRef((e,t)=>{const n=lf(),{prefixCls:r,className:o,rootClassName:i,block:a,options:s=[],size:l="middle",style:c,vertical:u,shape:d="default",name:f=n}=e,h=HN(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:p,direction:v,className:m,style:b}=xr("segmented"),y=p("segmented",r),[C,x,S]=pG(y),E=Wr(l),$=g.useMemo(()=>s.map(M=>{if(gG(M)){const{icon:T,label:I}=M,R=HN(M,["icon","label"]);return Object.assign(Object.assign({},R),{label:g.createElement(g.Fragment,null,g.createElement("span",{className:`${y}-item-icon`},T),I&&g.createElement("span",null,I))})}return M}),[s,y]),O=J(o,i,m,{[`${y}-block`]:a,[`${y}-sm`]:E==="small",[`${y}-lg`]:E==="large",[`${y}-vertical`]:u,[`${y}-shape-${d}`]:d==="round"},x,S),k=Object.assign(Object.assign({},b),c);return C(g.createElement(dG,Object.assign({},h,{name:f,className:O,style:k,options:$,ref:t,prefixCls:y,direction:v,vertical:u})))});mG.NODE_ENV!=="production"&&(VN.displayName="Segmented");const WN=w.createContext({}),UN=w.createContext({}),qN=({prefixCls:e,value:t,onChange:n})=>{const r=()=>{if(n&&t&&!t.cleared){const o=t.toHsb();o.a=0;const i=Xn(o);i.cleared=!0,n(i)}};return w.createElement("div",{className:`${e}-clear`,onClick:r})},KN="hex",GN="rgb",XN="hsb";var vG={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},bG={},yG=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:vG}))},YN=g.forwardRef(yG);bG.NODE_ENV!=="production"&&(YN.displayName="UpOutlined");function bb(){return typeof BigInt=="function"}function JN(e){return!e&&e!==0&&!Number.isNaN(e)||!String(e).trim()}function ka(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),t.startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),i=o[0]||"0",a=o[1]||"0";i==="0"&&a==="0"&&(n=!1);var s=n?"-":"";return{negative:n,negativeStr:s,trimStr:r,integerStr:i,decimalStr:a,fullStr:"".concat(s).concat(r)}}function Lf(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function QN(e){var t=e.toLowerCase().split("e"),n=Y(t,2),r=n[0],o=n[1],i=o===void 0?"0":o,a=r.startsWith("-"),s=a?r.slice(1):r,l=s.split("."),c=Y(l,2),u=c[0],d=u===void 0?"0":u,f=c[1],h=f===void 0?"":f,p="".concat(d).concat(h).replace(/^0+/,"")||"0";return{decimal:h,digits:p,exponent:Number(i),integer:d,negative:a}}function CG(e){var t=e.decimal,n=e.digits,r=e.exponent,o=e.integer,i=e.negative;if(n==="0")return"0";var a=o.replace(/^0+/,"").length,s=(t.match(/^0*/)||[""])[0].length,l=a||-s,c=l+r,u="";return c<=0?u="0.".concat("0".repeat(-c)).concat(n):c>=n.length?u="".concat(n).concat("0".repeat(c-n.length)):u="".concat(n.slice(0,c),".").concat(n.slice(c)),"".concat(i?"-":"").concat(u)}function ZN(e){return e.exponent>=0?Math.max(0,e.decimal.length-e.exponent):Math.abs(e.exponent)+e.decimal.length}function Ma(e){var t=String(e);return Lf(e)?ZN(QN(t)):t.includes(".")&&yb(t)?t.length-t.indexOf(".")-1:0}function jf(e){var t=String(e);if(Lf(e)){if(e>Number.MAX_SAFE_INTEGER)return String(bb()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(bb()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);var n=QN(t),r=ZN(n);t=r>100?CG(n):e.toFixed(r)}return ka(t).fullStr}function yb(e){return typeof e=="number"?!Number.isNaN(e):e?/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e):!1}var SG=(function(){function e(t){if(dn(this,e),z(this,"origin",""),z(this,"negative",void 0),z(this,"integer",void 0),z(this,"decimal",void 0),z(this,"decimalLen",void 0),z(this,"empty",void 0),z(this,"nan",void 0),JN(t)){this.empty=!0;return}if(this.origin=String(t),t==="-"||Number.isNaN(t)){this.nan=!0;return}var n=t;if(Lf(n)&&(n=Number(n)),n=typeof n=="string"?n:jf(n),yb(n)){var r=ka(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var i=o[1]||"0";this.decimal=BigInt(i),this.decimalLen=i.length}else this.nan=!0}return fn(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(n){var r="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(n,"0"));return BigInt(r)}},{key:"negate",value:function(){var n=new e(this.toString());return n.negative=!n.negative,n}},{key:"cal",value:function(n,r,o){var i=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),a=this.alignDecimal(i),s=n.alignDecimal(i),l=r(a,s).toString(),c=o(i),u=ka(l),d=u.negativeStr,f=u.trimStr,h="".concat(d).concat(f.padStart(c+1,"0"));return new e("".concat(h.slice(0,-c),".").concat(h.slice(-c)))}},{key:"add",value:function(n){if(this.isInvalidate())return new e(n);var r=new e(n);return r.isInvalidate()?this:this.cal(r,function(o,i){return o+i},function(o){return o})}},{key:"multi",value:function(n){var r=new e(n);return this.isInvalidate()||r.isInvalidate()?new e(NaN):this.cal(r,function(o,i){return o*i},function(o){return o*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(n){return this.toString()===(n==null?void 0:n.toString())}},{key:"lessEquals",value:function(n){return this.add(n.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":ka("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e})(),xG=(function(){function e(t){if(dn(this,e),z(this,"origin",""),z(this,"number",void 0),z(this,"empty",void 0),JN(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return fn(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(n){if(this.isInvalidate())return new e(n);var r=Number(n);if(Number.isNaN(r))return this;var o=this.number+r;if(o>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(o<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var i=Math.max(Ma(this.number),Ma(r));return new e(o.toFixed(i))}},{key:"multi",value:function(n){var r=Number(n);if(this.isInvalidate()||Number.isNaN(r))return new e(NaN);var o=this.number*r;if(o>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(o<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var i=Math.max(Ma(this.number),Ma(r));return new e(o.toFixed(i))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(n){return this.toNumber()===(n==null?void 0:n.toNumber())}},{key:"lessEquals",value:function(n){return this.add(n.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":Lf(this.number)&&Ma(this.number)>100?String(this.number):jf(this.number):this.origin}}]),e})();function vo(e){return bb()?new SG(e):new xG(e)}function zf(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e==="")return"";var o=ka(e),i=o.negativeStr,a=o.integerStr,s=o.decimalStr,l="".concat(t).concat(s),c="".concat(i).concat(a);if(n>=0){var u=Number(s[n]);if(u>=5&&!r){var d=vo(e).add("".concat(i,"0.").concat("0".repeat(n)).concat(10-u));return zf(d.toString(),t,n,r)}return n===0?c:"".concat(c).concat(t).concat(s.padEnd(n,"0").slice(0,n))}return l===".0"?c:"".concat(c).concat(l)}function wG(e){return!!(e.addonBefore||e.addonAfter)}function EG(e){return!!(e.prefix||e.suffix||e.allowClear)}function eT(e,t,n){var r=t.cloneNode(!0),o=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,typeof t.selectionStart=="number"&&typeof t.selectionEnd=="number"&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},o}function Bf(e,t,n,r){if(n){var o=t;if(t.type==="click"){o=eT(t,e,""),n(o);return}if(e.type!=="file"&&r!==void 0){o=eT(t,e,r),n(o);return}n(o)}}function Cb(e,t){if(e){e.focus(t);var n=t||{},r=n.cursor;if(r){var o=e.value.length;switch(r){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(o,o);break;default:e.setSelectionRange(0,o)}}}}var Sb=w.forwardRef(function(e,t){var n,r,o,i=e.inputElement,a=e.children,s=e.prefixCls,l=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,h=e.style,p=e.disabled,v=e.readOnly,m=e.focused,b=e.triggerFocus,y=e.allowClear,C=e.value,x=e.handleReset,S=e.hidden,E=e.classes,$=e.classNames,O=e.dataAttrs,k=e.styles,M=e.components,T=e.onClear,I=a??i,R=(M==null?void 0:M.affixWrapper)||"span",N=(M==null?void 0:M.groupWrapper)||"span",P=(M==null?void 0:M.wrapper)||"span",A=(M==null?void 0:M.groupAddon)||"span",_=w.useRef(null),B=function(X){var ee;(ee=_.current)!==null&&ee!==void 0&&ee.contains(X.target)&&(b==null||b())},F=EG(e),U=w.cloneElement(I,{value:C,className:J((n=I.props)===null||n===void 0?void 0:n.className,!F&&($==null?void 0:$.variant))||null}),K=w.useRef(null);if(w.useImperativeHandle(t,function(){return{nativeElement:K.current||_.current}}),F){var j=null;if(y){var D=!p&&!v&&C,H="".concat(s,"-clear-icon"),W=Ue(y)==="object"&&y!==null&&y!==void 0&&y.clearIcon?y.clearIcon:"✖";j=w.createElement("button",{type:"button",tabIndex:-1,onClick:function(X){x==null||x(X),T==null||T()},onMouseDown:function(X){return X.preventDefault()},className:J(H,z(z({},"".concat(H,"-hidden"),!D),"".concat(H,"-has-suffix"),!!c))},W)}var q="".concat(s,"-affix-wrapper"),te=J(q,z(z(z(z(z({},"".concat(s,"-disabled"),p),"".concat(q,"-disabled"),p),"".concat(q,"-focused"),m),"".concat(q,"-readonly"),v),"".concat(q,"-input-with-clear-btn"),c&&y&&C),E==null?void 0:E.affixWrapper,$==null?void 0:$.affixWrapper,$==null?void 0:$.variant),G=(c||y)&&w.createElement("span",{className:J("".concat(s,"-suffix"),$==null?void 0:$.suffix),style:k==null?void 0:k.suffix},j,c);U=w.createElement(R,he({className:te,style:k==null?void 0:k.affixWrapper,onClick:B},O==null?void 0:O.affixWrapper,{ref:_}),l&&w.createElement("span",{className:J("".concat(s,"-prefix"),$==null?void 0:$.prefix),style:k==null?void 0:k.prefix},l),U,G)}if(wG(e)){var re="".concat(s,"-group"),oe="".concat(re,"-addon"),ne="".concat(re,"-wrapper"),Z=J("".concat(s,"-wrapper"),re,E==null?void 0:E.wrapper,$==null?void 0:$.wrapper),ae=J(ne,z({},"".concat(ne,"-disabled"),p),E==null?void 0:E.group,$==null?void 0:$.groupWrapper);U=w.createElement(N,{className:ae,ref:K},w.createElement(P,{className:Z},u&&w.createElement(A,{className:oe},u),U,d&&w.createElement(A,{className:oe},d)))}return w.cloneElement(U,{className:J((r=U.props)===null||r===void 0?void 0:r.className,f)||null,style:V(V({},(o=U.props)===null||o===void 0?void 0:o.style),h),hidden:S})}),$G=["show"];function tT(e,t){return g.useMemo(function(){var n={};t&&(n.show=Ue(t)==="object"&&t.formatter?t.formatter:!!t),n=V(V({},n),e);var r=n,o=r.show,i=st(r,$G);return V(V({},i),{},{show:!!o,showFormatter:typeof o=="function"?o:void 0,strategy:i.strategy||function(a){return a.length}})},[e,t])}var OG=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],kG=w.forwardRef(function(e,t){var n=e.autoComplete,r=e.onChange,o=e.onFocus,i=e.onBlur,a=e.onPressEnter,s=e.onKeyDown,l=e.onKeyUp,c=e.prefixCls,u=c===void 0?"rc-input":c,d=e.disabled,f=e.htmlSize,h=e.className,p=e.maxLength,v=e.suffix,m=e.showCount,b=e.count,y=e.type,C=y===void 0?"text":y,x=e.classes,S=e.classNames,E=e.styles,$=e.onCompositionStart,O=e.onCompositionEnd,k=st(e,OG),M=w.useState(!1),T=Y(M,2),I=T[0],R=T[1],N=w.useRef(!1),P=w.useRef(!1),A=w.useRef(null),_=w.useRef(null),B=function(se){A.current&&Cb(A.current,se)},F=cn(e.defaultValue,{value:e.value}),U=Y(F,2),K=U[0],j=U[1],D=K==null?"":String(K),H=w.useState(null),W=Y(H,2),q=W[0],te=W[1],G=tT(b,m),re=G.max||p,oe=G.strategy(D),ne=!!re&&oe>re;w.useImperativeHandle(t,function(){var Ce;return{focus:B,blur:function(){var Se;(Se=A.current)===null||Se===void 0||Se.blur()},setSelectionRange:function(Se,ze,Ge){var Pe;(Pe=A.current)===null||Pe===void 0||Pe.setSelectionRange(Se,ze,Ge)},select:function(){var Se;(Se=A.current)===null||Se===void 0||Se.select()},input:A.current,nativeElement:((Ce=_.current)===null||Ce===void 0?void 0:Ce.nativeElement)||A.current}}),w.useEffect(function(){P.current&&(P.current=!1),R(function(Ce){return Ce&&d?!1:Ce})},[d]);var Z=function(se,Se,ze){var Ge=Se;if(!N.current&&G.exceedFormatter&&G.max&&G.strategy(Se)>G.max){if(Ge=G.exceedFormatter(Se,{max:G.max}),Se!==Ge){var Pe,Oe;te([((Pe=A.current)===null||Pe===void 0?void 0:Pe.selectionStart)||0,((Oe=A.current)===null||Oe===void 0?void 0:Oe.selectionEnd)||0])}}else if(ze.source==="compositionEnd")return;j(Ge),A.current&&Bf(A.current,se,r,Ge)};w.useEffect(function(){if(q){var Ce;(Ce=A.current)===null||Ce===void 0||Ce.setSelectionRange.apply(Ce,de(q))}},[q]);var ae=function(se){Z(se,se.target.value,{source:"change"})},ie=function(se){N.current=!1,Z(se,se.currentTarget.value,{source:"compositionEnd"}),O==null||O(se)},X=function(se){a&&se.key==="Enter"&&!P.current&&(P.current=!0,a(se)),s==null||s(se)},ee=function(se){se.key==="Enter"&&(P.current=!1),l==null||l(se)},le=function(se){R(!0),o==null||o(se)},ce=function(se){P.current&&(P.current=!1),R(!1),i==null||i(se)},ue=function(se){j(""),B(),A.current&&Bf(A.current,se,r)},ge=ne&&"".concat(u,"-out-of-range"),ye=function(){var se=nr(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return w.createElement("input",he({autoComplete:n},se,{onChange:ae,onFocus:le,onBlur:ce,onKeyDown:X,onKeyUp:ee,className:J(u,z({},"".concat(u,"-disabled"),d),S==null?void 0:S.input),style:E==null?void 0:E.input,ref:A,size:f,type:C,onCompositionStart:function(ze){N.current=!0,$==null||$(ze)},onCompositionEnd:ie}))},$e=function(){var se=Number(re)>0;if(v||G.show){var Se=G.showFormatter?G.showFormatter({value:D,count:oe,maxLength:re}):"".concat(oe).concat(se?" / ".concat(re):"");return w.createElement(w.Fragment,null,G.show&&w.createElement("span",{className:J("".concat(u,"-show-count-suffix"),z({},"".concat(u,"-show-count-has-suffix"),!!v),S==null?void 0:S.count),style:V({},E==null?void 0:E.count)},Se),v)}return null};return w.createElement(Sb,he({},k,{prefixCls:u,className:J(h,ge),handleReset:ue,value:D,focused:I,triggerFocus:B,suffix:$e(),disabled:d,classes:x,classNames:S,styles:E,ref:_}),ye())});function MG(e,t){return typeof Proxy<"u"&&e?new Proxy(e,{get:function(r,o){if(t[o])return t[o];var i=r[o];return typeof i=="function"?i.bind(r):i}}):e}function NG(e,t){var n=w.useRef(null);function r(){try{var i=e.selectionStart,a=e.selectionEnd,s=e.value,l=s.substring(0,i),c=s.substring(a);n.current={start:i,end:a,value:s,beforeTxt:l,afterTxt:c}}catch{}}function o(){if(e&&n.current&&t)try{var i=e.value,a=n.current,s=a.beforeTxt,l=a.afterTxt,c=a.start,u=i.length;if(i.startsWith(s))u=s.length;else if(i.endsWith(l))u=i.length-n.current.afterTxt.length;else{var d=s[c-1],f=i.indexOf(d,c-1);f!==-1&&(u=f+1)}e.setSelectionRange(u,u)}catch(h){ft(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(h.message))}}return[r,o]}var TG=function(){var t=w.useState(!1),n=Y(t,2),r=n[0],o=n[1];return Yt(function(){o(gf())},[]),r},IG=200,PG=600;function AG(e){var t=e.prefixCls,n=e.upNode,r=e.downNode,o=e.upDisabled,i=e.downDisabled,a=e.onStep,s=g.useRef(),l=g.useRef([]),c=g.useRef();c.current=a;var u=function(){clearTimeout(s.current)},d=function(C,x){C.preventDefault(),u(),c.current(x);function S(){c.current(x),s.current=setTimeout(S,IG)}s.current=setTimeout(S,PG)};g.useEffect(function(){return function(){u(),l.current.forEach(function(y){return Nt.cancel(y)})}},[]);var f=TG();if(f)return null;var h="".concat(t,"-handler"),p=J(h,"".concat(h,"-up"),z({},"".concat(h,"-up-disabled"),o)),v=J(h,"".concat(h,"-down"),z({},"".concat(h,"-down-disabled"),i)),m=function(){return l.current.push(Nt(u))},b={unselectable:"on",role:"button",onMouseUp:m,onMouseLeave:m};return g.createElement("div",{className:"".concat(h,"-wrap")},g.createElement("span",he({},b,{onMouseDown:function(C){d(C,!0)},"aria-label":"Increase Value","aria-disabled":o,className:p}),n||g.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),g.createElement("span",he({},b,{onMouseDown:function(C){d(C,!1)},"aria-label":"Decrease Value","aria-disabled":i,className:v}),r||g.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function nT(e){var t=typeof e=="number"?jf(e):ka(e).fullStr,n=t.includes(".");return n?ka(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}const RG=(function(){var e=w.useRef(0),t=function(){Nt.cancel(e.current)};return w.useEffect(function(){return t},[]),function(n){t(),e.current=Nt(function(){n()})}});var _G={},DG=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],LG=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],rT=function(t,n){return t||n.isEmpty()?n.toString():n.toNumber()},oT=function(t){var n=vo(t);return n.isInvalidate()?null:n},jG=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,o=e.style,i=e.min,a=e.max,s=e.step,l=s===void 0?1:s,c=e.defaultValue,u=e.value,d=e.disabled,f=e.readOnly,h=e.upHandler,p=e.downHandler,v=e.keyboard,m=e.changeOnWheel,b=m===void 0?!1:m,y=e.controls,C=y===void 0?!0:y;e.classNames;var x=e.stringMode,S=e.parser,E=e.formatter,$=e.precision,O=e.decimalSeparator,k=e.onChange,M=e.onInput,T=e.onPressEnter,I=e.onStep,R=e.changeOnBlur,N=R===void 0?!0:R,P=e.domRef,A=st(e,DG),_="".concat(n,"-input"),B=g.useRef(null),F=g.useState(!1),U=Y(F,2),K=U[0],j=U[1],D=g.useRef(!1),H=g.useRef(!1),W=g.useRef(!1),q=g.useState(function(){return vo(u??c)}),te=Y(q,2),G=te[0],re=te[1];function oe(Re){u===void 0&&re(Re)}var ne=g.useCallback(function(Re,je){if(!je)return $>=0?$:Math.max(Ma(Re),Ma(l))},[$,l]),Z=g.useCallback(function(Re){var je=String(Re);if(S)return S(je);var Qe=je;return O&&(Qe=Qe.replace(O,".")),Qe.replace(/[^\w.-]+/g,"")},[S,O]),ae=g.useRef(""),ie=g.useCallback(function(Re,je){if(E)return E(Re,{userTyping:je,input:String(ae.current)});var Qe=typeof Re=="number"?jf(Re):Re;if(!je){var Be=ne(Qe,je);if(yb(Qe)&&(O||Be>=0)){var it=O||".";Qe=zf(Qe,it,Be)}}return Qe},[E,ne,O]),X=g.useState(function(){var Re=c??u;return G.isInvalidate()&&["string","number"].includes(Ue(Re))?Number.isNaN(Re)?"":Re:ie(G.toString(),!1)}),ee=Y(X,2),le=ee[0],ce=ee[1];ae.current=le;function ue(Re,je){ce(ie(Re.isInvalidate()?Re.toString(!1):Re.toString(!je),je))}var ge=g.useMemo(function(){return oT(a)},[a,$]),ye=g.useMemo(function(){return oT(i)},[i,$]),$e=g.useMemo(function(){return!ge||!G||G.isInvalidate()?!1:ge.lessEquals(G)},[ge,G]),Ce=g.useMemo(function(){return!ye||!G||G.isInvalidate()?!1:G.lessEquals(ye)},[ye,G]),se=NG(B.current,K),Se=Y(se,2),ze=Se[0],Ge=Se[1],Pe=function(je){return ge&&!je.lessEquals(ge)?ge:ye&&!ye.lessEquals(je)?ye:null},Oe=function(je){return!Pe(je)},qe=function(je,Qe){var Be=je,it=Oe(Be)||Be.isEmpty();if(!Be.isEmpty()&&!Qe&&(Be=Pe(Be)||Be,it=!0),!f&&!d&&it){var $t=Be.toString(),bt=ne($t,Qe);return bt>=0&&(Be=vo(zf($t,".",bt)),Oe(Be)||(Be=vo(zf($t,".",bt,!0)))),Be.equals(G)||(oe(Be),k==null||k(Be.isEmpty()?null:rT(x,Be)),u===void 0&&ue(Be,Qe)),Be}return G},Ne=RG(),Fe=function Re(je){if(ze(),ae.current=je,ce(je),!H.current){var Qe=Z(je),Be=vo(Qe);Be.isNaN()||qe(Be,!0)}M==null||M(je),Ne(function(){var it=je;S||(it=je.replace(/。/g,".")),it!==je&&Re(it)})},Ae=function(){H.current=!0},ke=function(){H.current=!1,Fe(B.current.value)},Xe=function(je){Fe(je.target.value)},pe=function(je){var Qe;if(!(je&&$e||!je&&Ce)){D.current=!1;var Be=vo(W.current?nT(l):l);je||(Be=Be.negate());var it=(G||vo(0)).add(Be.toString()),$t=qe(it,!1);I==null||I(rT(x,$t),{offset:W.current?nT(l):l,type:je?"up":"down"}),(Qe=B.current)===null||Qe===void 0||Qe.focus()}},ve=function(je){var Qe=vo(Z(le)),Be;Qe.isNaN()?Be=qe(G,je):Be=qe(Qe,je),u!==void 0?ue(G,!1):Be.isNaN()||ue(Be,!1)},Ve=function(){D.current=!0},xe=function(je){var Qe=je.key,Be=je.shiftKey;D.current=!0,W.current=Be,Qe==="Enter"&&(H.current||(D.current=!1),ve(!1),T==null||T(je)),v!==!1&&!H.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Qe)&&(pe(Qe==="Up"||Qe==="ArrowUp"),je.preventDefault())},tt=function(){D.current=!1,W.current=!1};g.useEffect(function(){if(b&&K){var Re=function(Be){pe(Be.deltaY<0),Be.preventDefault()},je=B.current;if(je)return je.addEventListener("wheel",Re,{passive:!1}),function(){return je.removeEventListener("wheel",Re)}}});var pt=function(){N&&ve(!1),j(!1),D.current=!1};return ls(function(){G.isInvalidate()||ue(G,!1)},[$,E]),ls(function(){var Re=vo(u);re(Re);var je=vo(Z(le));(!Re.equals(je)||!D.current||E)&&ue(Re,D.current)},[u]),ls(function(){E&&Ge()},[le]),g.createElement("div",{ref:P,className:J(n,r,z(z(z(z(z({},"".concat(n,"-focused"),K),"".concat(n,"-disabled"),d),"".concat(n,"-readonly"),f),"".concat(n,"-not-a-number"),G.isNaN()),"".concat(n,"-out-of-range"),!G.isInvalidate()&&!Oe(G))),style:o,onFocus:function(){j(!0)},onBlur:pt,onKeyDown:xe,onKeyUp:tt,onCompositionStart:Ae,onCompositionEnd:ke,onBeforeInput:Ve},C&&g.createElement(AG,{prefixCls:n,upNode:h,downNode:p,upDisabled:$e,downDisabled:Ce,onStep:pe}),g.createElement("div",{className:"".concat(_,"-wrap")},g.createElement("input",he({autoComplete:"off",role:"spinbutton","aria-valuemin":i,"aria-valuemax":a,"aria-valuenow":G.isInvalidate()?null:G.toString(),step:l},A,{ref:sr(B,t),className:_,value:le,onChange:Xe,disabled:d,readOnly:f}))))}),iT=g.forwardRef(function(e,t){var n=e.disabled,r=e.style,o=e.prefixCls,i=o===void 0?"rc-input-number":o,a=e.value,s=e.prefix,l=e.suffix,c=e.addonBefore,u=e.addonAfter,d=e.className,f=e.classNames,h=st(e,LG),p=g.useRef(null),v=g.useRef(null),m=g.useRef(null),b=function(C){m.current&&Cb(m.current,C)};return g.useImperativeHandle(t,function(){return MG(m.current,{focus:b,nativeElement:p.current.nativeElement||v.current})}),g.createElement(Sb,{className:d,triggerFocus:b,prefixCls:i,value:a,disabled:n,style:r,prefix:s,suffix:l,addonAfter:u,addonBefore:c,classNames:f,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:p},g.createElement(jG,he({prefixCls:i,disabled:n,ref:m,domRef:v,className:f==null?void 0:f.input},h)))});_G.NODE_ENV!=="production"&&(iT.displayName="InputNumber");const zG=e=>{var t;const n=(t=e.handleVisible)!==null&&t!==void 0?t:"auto",r=e.controlHeightSM-e.lineWidth*2;return Object.assign(Object.assign({},mc(e)),{controlWidth:90,handleWidth:r,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new Ut(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:n===!0?1:0,handleVisibleWidth:n===!0?r:0})},aT=({componentCls:e,borderRadiusSM:t,borderRadiusLG:n},r)=>{const o=r==="lg"?n:t;return{[`&-${r}`]:{[`${e}-handler-wrap`]:{borderStartEndRadius:o,borderEndEndRadius:o},[`${e}-handler-up`]:{borderStartEndRadius:o},[`${e}-handler-down`]:{borderEndEndRadius:o}}}},BG=e=>{const{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,inputFontSizeSM:i,inputFontSizeLG:a,controlHeightLG:s,controlHeightSM:l,colorError:c,paddingInlineSM:u,paddingBlockSM:d,paddingBlockLG:f,paddingInlineLG:h,colorIcon:p,motionDurationMid:v,handleHoverColor:m,handleOpacity:b,paddingInline:y,paddingBlock:C,handleBg:x,handleActiveBg:S,colorTextDisabled:E,borderRadiusSM:$,borderRadiusLG:O,controlWidth:k,handleBorderColor:M,filledHandleBg:T,lineHeightLG:I,calc:R}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),If(e)),{display:"inline-block",width:k,margin:0,padding:0,borderRadius:o}),rN(e,{[`${t}-handler-wrap`]:{background:x,[`${t}-handler-down`]:{borderBlockStart:`${Q(n)} ${r} ${M}`}}})),cN(e,{[`${t}-handler-wrap`]:{background:T,[`${t}-handler-down`]:{borderBlockStart:`${Q(n)} ${r} ${M}`}},"&:focus-within":{[`${t}-handler-wrap`]:{background:x}}})),pN(e,{[`${t}-handler-wrap`]:{background:x,[`${t}-handler-down`]:{borderBlockStart:`${Q(n)} ${r} ${M}`}}})),aN(e)),{"&-rtl":{direction:"rtl",[`${t}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:I,borderRadius:O,[`input${t}-input`]:{height:R(s).sub(R(n).mul(2)).equal(),padding:`${Q(f)} ${Q(h)}`}},"&-sm":{padding:0,fontSize:i,borderRadius:$,[`input${t}-input`]:{height:R(l).sub(R(n).mul(2)).equal(),padding:`${Q(d)} ${Q(u)}`}},"&-out-of-range":{[`${t}-input-wrap`]:{input:{color:c}}},"&-group":Object.assign(Object.assign(Object.assign({},Pn(e)),bN(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",[`${t}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${t}-group-addon`]:{borderRadius:O,fontSize:e.fontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:$}}},iN(e)),dN(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),[`&-disabled ${t}-input`]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},Pn(e)),{width:"100%",padding:`${Q(C)} ${Q(y)}`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:`all ${v} linear`,appearance:"textfield",fontSize:"inherit"}),mN(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,appearance:"none"}})},[`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]:{width:e.handleWidth,opacity:1}})},{[t]:Object.assign(Object.assign(Object.assign({[`${t}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleVisibleWidth,opacity:b,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`all ${v}`,overflow:"hidden",[`${t}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
429
|
+
${t}-handler-up-inner,
|
|
430
|
+
${t}-handler-down-inner
|
|
431
|
+
`]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},[`${t}-handler`]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Q(n)} ${r} ${M}`,transition:`all ${v} linear`,"&:active":{background:S},"&:hover":{height:"60%",[`
|
|
432
|
+
${t}-handler-up-inner,
|
|
433
|
+
${t}-handler-down-inner
|
|
434
|
+
`]:{color:m}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},ys()),{color:p,transition:`all ${v} linear`,userSelect:"none"})},[`${t}-handler-up`]:{borderStartEndRadius:o},[`${t}-handler-down`]:{borderEndEndRadius:o}},aT(e,"lg")),aT(e,"sm")),{"&-disabled, &-readonly":{[`${t}-handler-wrap`]:{display:"none"},[`${t}-input`]:{color:"inherit"}},[`
|
|
435
|
+
${t}-handler-up-disabled,
|
|
436
|
+
${t}-handler-down-disabled
|
|
437
|
+
`]:{cursor:"not-allowed"},[`
|
|
438
|
+
${t}-handler-up-disabled:hover &-handler-up-inner,
|
|
439
|
+
${t}-handler-down-disabled:hover &-handler-down-inner
|
|
440
|
+
`]:{color:E}})}]},FG=e=>{const{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:i,borderRadiusLG:a,borderRadiusSM:s,paddingInlineLG:l,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d,motionDurationMid:f}=e;return{[`${t}-affix-wrapper`]:Object.assign(Object.assign({[`input${t}-input`]:{padding:`${Q(n)} 0`}},If(e)),{position:"relative",display:"inline-flex",alignItems:"center",width:i,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:a,paddingInlineStart:l,[`input${t}-input`]:{padding:`${Q(u)} 0`}},"&-sm":{borderRadius:s,paddingInlineStart:c,[`input${t}-input`]:{padding:`${Q(d)} 0`}},[`&:not(${t}-disabled):hover`]:{zIndex:1},"&-focused, &:focus":{zIndex:1},[`&-disabled > ${t}-disabled`]:{background:"transparent"},[`> div${t}`]:{width:"100%",border:"none",outline:"none",[`&${t}-focused`]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${t}-handler-wrap`]:{zIndex:2},[t]:{position:"static",color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{insetBlockStart:0,insetInlineEnd:0,height:"100%",marginInlineEnd:r,marginInlineStart:o,transition:`margin ${f}`}},[`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]:{width:e.handleWidth,opacity:1},[`&:not(${t}-affix-wrapper-without-controls):hover ${t}-suffix`]:{marginInlineEnd:e.calc(e.handleWidth).add(r).equal()}}),[`${t}-underlined`]:{borderRadius:0}}},HG=gn("InputNumber",e=>{const t=Dt(e,pc(e));return[BG(t),FG(t),Yl(t)]},zG,{unitless:{handleOpacity:!0},resetFont:!1});var sT={},VG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const lT=g.forwardRef((e,t)=>{if(sT.NODE_ENV!=="production"){const G=Wt("InputNumber");[["bordered","variant"],["addonAfter","Space.Compact"],["addonBefore","Space.Compact"]].forEach(([re,oe])=>{G.deprecated(!(re in e),re,oe)}),G(!(e.type==="number"&&e.changeOnWheel),"usage","When `type=number` is used together with `changeOnWheel`, changeOnWheel may not work properly. Please delete `type=number` if it is not necessary.")}const{getPrefixCls:n,direction:r}=g.useContext(wt),o=g.useRef(null);g.useImperativeHandle(t,()=>o.current);const{className:i,rootClassName:a,size:s,disabled:l,prefixCls:c,addonBefore:u,addonAfter:d,prefix:f,suffix:h,bordered:p,readOnly:v,status:m,controls:b,variant:y}=e,C=VG(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","suffix","bordered","readOnly","status","controls","variant"]),x=n("input-number",c),S=Po(x),[E,$,O]=HG(x,S),{compactSize:k,compactItemClassnames:M}=Ca(x,r);let T=g.createElement(YN,{className:`${x}-handler-up-inner`}),I=g.createElement(Jv,{className:`${x}-handler-down-inner`});const R=typeof b=="boolean"?b:void 0;typeof b=="object"&&(T=typeof b.upIcon>"u"?T:g.createElement("span",{className:`${x}-handler-up-inner`},b.upIcon),I=typeof b.downIcon>"u"?I:g.createElement("span",{className:`${x}-handler-down-inner`},b.downIcon));const{hasFeedback:N,status:P,isFormItemInput:A,feedbackIcon:_}=g.useContext(qr),B=ac(P,m),F=Wr(G=>{var re;return(re=s??k)!==null&&re!==void 0?re:G}),U=g.useContext(Hr),K=l??U,[j,D]=Sf("inputNumber",y,p),H=N&&g.createElement(g.Fragment,null,_),W=J({[`${x}-lg`]:F==="large",[`${x}-sm`]:F==="small",[`${x}-rtl`]:r==="rtl",[`${x}-in-form-item`]:A},$),q=`${x}-group`,te=g.createElement(iT,Object.assign({ref:o,disabled:K,className:J(O,S,i,a,M),upHandler:T,downHandler:I,prefixCls:x,readOnly:v,controls:R,prefix:f,suffix:H||h,addonBefore:u&&g.createElement(Fi,{form:!0,space:!0},u),addonAfter:d&&g.createElement(Fi,{form:!0,space:!0},d),classNames:{input:W,variant:J({[`${x}-${j}`]:D},Ea(x,B,N)),affixWrapper:J({[`${x}-affix-wrapper-sm`]:F==="small",[`${x}-affix-wrapper-lg`]:F==="large",[`${x}-affix-wrapper-rtl`]:r==="rtl",[`${x}-affix-wrapper-without-controls`]:b===!1||K||v},$),wrapper:J({[`${q}-rtl`]:r==="rtl"},$),groupWrapper:J({[`${x}-group-wrapper-sm`]:F==="small",[`${x}-group-wrapper-lg`]:F==="large",[`${x}-group-wrapper-rtl`]:r==="rtl",[`${x}-group-wrapper-${j}`]:D},Ea(`${x}-group-wrapper`,B,N),$)}},C));return E(te)}),xb=lT,WG=e=>g.createElement(ho,{theme:{components:{InputNumber:{handleVisible:!0}}}},g.createElement(lT,Object.assign({},e)));sT.NODE_ENV!=="production"&&(xb.displayName="InputNumber"),xb._InternalPanelDoNotUseOrYouWillBeFired=WG;const Na=({prefixCls:e,min:t=0,max:n=100,value:r,onChange:o,className:i,formatter:a})=>{const s=`${e}-steppers`,[l,c]=w.useState(0),u=Number.isNaN(r)?l:r;return w.createElement(xb,{className:J(s,i),min:t,max:n,value:u,formatter:a,size:"small",onChange:d=>{c(d||0),o==null||o(d)}})},UG=({prefixCls:e,value:t,onChange:n})=>{const r=`${e}-alpha-input`,[o,i]=w.useState(()=>Xn(t||"#000")),a=t||o,s=l=>{const c=a.toHsb();c.a=(l||0)/100;const u=Xn(c);i(u),n==null||n(u)};return w.createElement(Na,{value:lv(a),prefixCls:e,formatter:l=>`${l}%`,className:r,onChange:s})},cT=e=>{let t;return typeof e=="object"&&(e!=null&&e.clearIcon)?t=e:e&&(t={clearIcon:w.createElement(ws,null)}),t};function uT(e,t){const n=w.useRef([]),r=()=>{n.current.push(setTimeout(()=>{var o,i,a,s;!((o=e.current)===null||o===void 0)&&o.input&&((i=e.current)===null||i===void 0?void 0:i.input.getAttribute("type"))==="password"&&(!((a=e.current)===null||a===void 0)&&a.input.hasAttribute("value"))&&((s=e.current)===null||s===void 0||s.input.removeAttribute("value"))}))};return w.useEffect(()=>(t&&r(),()=>n.current.forEach(o=>{o&&clearTimeout(o)})),[]),r}function qG(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}var Ff={},KG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Fs=w.forwardRef((e,t)=>{const{prefixCls:n,bordered:r=!0,status:o,size:i,disabled:a,onBlur:s,onFocus:l,suffix:c,allowClear:u,addonAfter:d,addonBefore:f,className:h,style:p,styles:v,rootClassName:m,onChange:b,classNames:y,variant:C,_skipAddonWarning:x}=e,S=KG(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant","_skipAddonWarning"]);if(Ff.NODE_ENV!=="production"){const{deprecated:ge}=Wt("Input");ge(!("bordered"in e),"bordered","variant"),x||[["addonAfter","Space.Compact"],["addonBefore","Space.Compact"]].forEach(([ye,$e])=>{ge(!(ye in e),ye,$e)})}const{getPrefixCls:E,direction:$,allowClear:O,autoComplete:k,className:M,style:T,classNames:I,styles:R}=xr("input"),N=E("input",n),P=w.useRef(null),A=Po(N),[_,B,F]=yN(N,m),[U]=CN(N,A),{compactSize:K,compactItemClassnames:j}=Ca(N,$),D=Wr(ge=>{var ye;return(ye=i??K)!==null&&ye!==void 0?ye:ge}),H=w.useContext(Hr),W=a??H,{status:q,hasFeedback:te,feedbackIcon:G}=w.useContext(qr),re=ac(q,o),oe=qG(e)||!!te,ne=w.useRef(oe);if(Ff.NODE_ENV!=="production"){const ge=Wt("Input");w.useEffect(()=>{var ye;oe&&!ne.current&&Ff.NODE_ENV!=="production"&&ge(document.activeElement===((ye=P.current)===null||ye===void 0?void 0:ye.input),"usage","When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ"),ne.current=oe},[oe])}const Z=uT(P,!0),ae=ge=>{Z(),s==null||s(ge)},ie=ge=>{Z(),l==null||l(ge)},X=ge=>{Z(),b==null||b(ge)},ee=(te||c)&&w.createElement(w.Fragment,null,c,te&&G),le=cT(u??O),[ce,ue]=Sf("input",C,r);return _(U(w.createElement(kG,Object.assign({ref:sr(t,P),prefixCls:N,autoComplete:k},S,{disabled:W,onBlur:ae,onFocus:ie,style:Object.assign(Object.assign({},T),p),styles:Object.assign(Object.assign({},R),v),suffix:ee,allowClear:le,className:J(h,m,F,A,j,M),onChange:X,addonBefore:f&&w.createElement(Fi,{form:!0,space:!0},f),addonAfter:d&&w.createElement(Fi,{form:!0,space:!0},d),classNames:Object.assign(Object.assign(Object.assign({},y),I),{input:J({[`${N}-sm`]:D==="small",[`${N}-lg`]:D==="large",[`${N}-rtl`]:$==="rtl"},y==null?void 0:y.input,I.input,B),variant:J({[`${N}-${ce}`]:ue},Ea(N,re)),affixWrapper:J({[`${N}-affix-wrapper-sm`]:D==="small",[`${N}-affix-wrapper-lg`]:D==="large",[`${N}-affix-wrapper-rtl`]:$==="rtl"},B),wrapper:J({[`${N}-group-rtl`]:$==="rtl"},B),groupWrapper:J({[`${N}-group-wrapper-sm`]:D==="small",[`${N}-group-wrapper-lg`]:D==="large",[`${N}-group-wrapper-rtl`]:$==="rtl",[`${N}-group-wrapper-${ce}`]:ue},Ea(`${N}-group-wrapper`,re,te),B)})}))))});Ff.NODE_ENV!=="production"&&(Fs.displayName="Input");const GG=/(^#[\da-f]{6}$)|(^#[\da-f]{8}$)/i,XG=e=>GG.test(`#${e}`),YG=({prefixCls:e,value:t,onChange:n})=>{const r=`${e}-hex-input`,[o,i]=w.useState(()=>t?Xl(t.toHexString()):void 0);w.useEffect(()=>{t&&i(Xl(t.toHexString()))},[t]);const a=s=>{const l=s.target.value;i(Xl(l)),XG(Xl(l,!0))&&(n==null||n(Xn(l)))};return w.createElement(Fs,{className:r,value:o,prefix:"#",onChange:a,size:"small"})},JG=({prefixCls:e,value:t,onChange:n})=>{const r=`${e}-hsb-input`,[o,i]=w.useState(()=>Xn(t||"#000")),a=t||o,s=(l,c)=>{const u=a.toHsb();u[c]=c==="h"?l:(l||0)/100;const d=Xn(u);i(d),n==null||n(d)};return w.createElement("div",{className:r},w.createElement(Na,{max:360,min:0,value:Number(a.toHsb().h),prefixCls:e,className:r,formatter:l=>Jd(l||0).toString(),onChange:l=>s(Number(l),"h")}),w.createElement(Na,{max:100,min:0,value:Number(a.toHsb().s)*100,prefixCls:e,className:r,formatter:l=>`${Jd(l||0)}%`,onChange:l=>s(Number(l),"s")}),w.createElement(Na,{max:100,min:0,value:Number(a.toHsb().b)*100,prefixCls:e,className:r,formatter:l=>`${Jd(l||0)}%`,onChange:l=>s(Number(l),"b")}))},QG=({prefixCls:e,value:t,onChange:n})=>{const r=`${e}-rgb-input`,[o,i]=w.useState(()=>Xn(t||"#000")),a=t||o,s=(l,c)=>{const u=a.toRgb();u[c]=l||0;const d=Xn(u);i(d),n==null||n(d)};return w.createElement("div",{className:r},w.createElement(Na,{max:255,min:0,value:Number(a.toRgb().r),prefixCls:e,className:r,onChange:l=>s(Number(l),"r")}),w.createElement(Na,{max:255,min:0,value:Number(a.toRgb().g),prefixCls:e,className:r,onChange:l=>s(Number(l),"g")}),w.createElement(Na,{max:255,min:0,value:Number(a.toRgb().b),prefixCls:e,className:r,onChange:l=>s(Number(l),"b")}))},ZG=[KN,XN,GN].map(e=>({value:e,label:e.toUpperCase()})),eX=e=>{const{prefixCls:t,format:n,value:r,disabledAlpha:o,onFormatChange:i,onChange:a,disabledFormat:s}=e,[l,c]=cn(KN,{value:n,onChange:i}),u=`${t}-input`,d=h=>{c(h)},f=w.useMemo(()=>{const h={value:r,prefixCls:t,onChange:a};switch(l){case XN:return w.createElement(JG,Object.assign({},h));case GN:return w.createElement(QG,Object.assign({},h));default:return w.createElement(YG,Object.assign({},h))}},[l,t,r,a]);return w.createElement("div",{className:`${u}-container`},!s&&w.createElement($a,{value:l,variant:"borderless",getPopupContainer:h=>h,popupMatchSelectWidth:68,placement:"bottomRight",onChange:d,className:`${t}-format-select`,size:"small",options:ZG}),w.createElement("div",{className:u},f),!o&&w.createElement(UG,{prefixCls:t,value:r,onChange:a}))};function wb(e,t,n){return(e-t)/(n-t)}function Eb(e,t,n,r){var o=wb(t,n,r),i={};switch(e){case"rtl":i.right="".concat(o*100,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(o*100,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(o*100,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(o*100,"%"),i.transform="translateX(-50%)";break}return i}function Ta(e,t){return Array.isArray(e)?e[t]:e}var Ia=g.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),dT=g.createContext({}),tX={},nX=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],$b=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.value,o=e.valueIndex,i=e.onStartMove,a=e.onDelete,s=e.style,l=e.render,c=e.dragging,u=e.draggingDelete,d=e.onOffsetChange,f=e.onChangeComplete,h=e.onFocus,p=e.onMouseEnter,v=st(e,nX),m=g.useContext(Ia),b=m.min,y=m.max,C=m.direction,x=m.disabled,S=m.keyboard,E=m.range,$=m.tabIndex,O=m.ariaLabelForHandle,k=m.ariaLabelledByForHandle,M=m.ariaRequired,T=m.ariaValueTextFormatterForHandle,I=m.styles,R=m.classNames,N="".concat(n,"-handle"),P=function(W){x||i(W,o)},A=function(W){h==null||h(W,o)},_=function(W){p(W,o)},B=function(W){if(!x&&S){var q=null;switch(W.which||W.keyCode){case Le.LEFT:q=C==="ltr"||C==="btt"?-1:1;break;case Le.RIGHT:q=C==="ltr"||C==="btt"?1:-1;break;case Le.UP:q=C!=="ttb"?1:-1;break;case Le.DOWN:q=C!=="ttb"?-1:1;break;case Le.HOME:q="min";break;case Le.END:q="max";break;case Le.PAGE_UP:q=2;break;case Le.PAGE_DOWN:q=-2;break;case Le.BACKSPACE:case Le.DELETE:a==null||a(o);break}q!==null&&(W.preventDefault(),d(q,o))}},F=function(W){switch(W.which||W.keyCode){case Le.LEFT:case Le.RIGHT:case Le.UP:case Le.DOWN:case Le.HOME:case Le.END:case Le.PAGE_UP:case Le.PAGE_DOWN:f==null||f();break}},U=Eb(C,r,b,y),K={};if(o!==null){var j;K={tabIndex:x?null:Ta($,o),role:"slider","aria-valuemin":b,"aria-valuemax":y,"aria-valuenow":r,"aria-disabled":x,"aria-label":Ta(O,o),"aria-labelledby":Ta(k,o),"aria-required":Ta(M,o),"aria-valuetext":(j=Ta(T,o))===null||j===void 0?void 0:j(r),"aria-orientation":C==="ltr"||C==="rtl"?"horizontal":"vertical",onMouseDown:P,onTouchStart:P,onFocus:A,onMouseEnter:_,onKeyDown:B,onKeyUp:F}}var D=g.createElement("div",he({ref:t,className:J(N,z(z(z({},"".concat(N,"-").concat(o+1),o!==null&&E),"".concat(N,"-dragging"),c),"".concat(N,"-dragging-delete"),u),R.handle),style:V(V(V({},U),s),I.handle)},K,v));return l&&(D=l(D,{index:o,prefixCls:n,value:r,dragging:c,draggingDelete:u})),D});tX.NODE_ENV!=="production"&&($b.displayName="Handle");var rX={},oX=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],fT=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,o=e.onStartMove,i=e.onOffsetChange,a=e.values,s=e.handleRender,l=e.activeHandleRender,c=e.draggingIndex,u=e.draggingDelete,d=e.onFocus,f=st(e,oX),h=g.useRef({}),p=g.useState(!1),v=Y(p,2),m=v[0],b=v[1],y=g.useState(-1),C=Y(y,2),x=C[0],S=C[1],E=function(T){S(T),b(!0)},$=function(T,I){E(I),d==null||d(T)},O=function(T,I){E(I)};g.useImperativeHandle(t,function(){return{focus:function(T){var I;(I=h.current[T])===null||I===void 0||I.focus()},hideHelp:function(){En.flushSync(function(){b(!1)})}}});var k=V({prefixCls:n,onStartMove:o,onOffsetChange:i,render:s,onFocus:$,onMouseEnter:O},f);return g.createElement(g.Fragment,null,a.map(function(M,T){var I=c===T;return g.createElement($b,he({ref:function(N){N?h.current[T]=N:delete h.current[T]},dragging:I,draggingDelete:I&&u,style:Ta(r,T),key:T,value:M,valueIndex:T},k))}),l&&m&&g.createElement($b,he({key:"a11y"},k,{value:a[x],valueIndex:null,dragging:c!==-1,draggingDelete:u,render:l,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))});rX.NODE_ENV!=="production"&&(fT.displayName="Handles");var iX=function(t){var n=t.prefixCls,r=t.style,o=t.children,i=t.value,a=t.onClick,s=g.useContext(Ia),l=s.min,c=s.max,u=s.direction,d=s.includedStart,f=s.includedEnd,h=s.included,p="".concat(n,"-text"),v=Eb(u,i,l,c);return g.createElement("span",{className:J(p,z({},"".concat(p,"-active"),h&&d<=i&&i<=f)),style:V(V({},v),r),onMouseDown:function(b){b.stopPropagation()},onClick:function(){a(i)}},o)},aX=function(t){var n=t.prefixCls,r=t.marks,o=t.onClick,i="".concat(n,"-mark");return r.length?g.createElement("div",{className:i},r.map(function(a){var s=a.value,l=a.style,c=a.label;return g.createElement(iX,{key:s,prefixCls:i,style:l,value:s,onClick:o},c)})):null},sX=function(t){var n=t.prefixCls,r=t.value,o=t.style,i=t.activeStyle,a=g.useContext(Ia),s=a.min,l=a.max,c=a.direction,u=a.included,d=a.includedStart,f=a.includedEnd,h="".concat(n,"-dot"),p=u&&d<=r&&r<=f,v=V(V({},Eb(c,r,s,l)),typeof o=="function"?o(r):o);return p&&(v=V(V({},v),typeof i=="function"?i(r):i)),g.createElement("span",{className:J(h,z({},"".concat(h,"-active"),p)),style:v})},lX=function(t){var n=t.prefixCls,r=t.marks,o=t.dots,i=t.style,a=t.activeStyle,s=g.useContext(Ia),l=s.min,c=s.max,u=s.step,d=g.useMemo(function(){var f=new Set;if(r.forEach(function(p){f.add(p.value)}),o&&u!==null)for(var h=l;h<=c;)f.add(h),h+=u;return Array.from(f)},[l,c,u,o,r]);return g.createElement("div",{className:"".concat(n,"-step")},d.map(function(f){return g.createElement(sX,{prefixCls:n,key:f,value:f,style:i,activeStyle:a})}))},hT=function(t){var n=t.prefixCls,r=t.style,o=t.start,i=t.end,a=t.index,s=t.onStartMove,l=t.replaceCls,c=g.useContext(Ia),u=c.direction,d=c.min,f=c.max,h=c.disabled,p=c.range,v=c.classNames,m="".concat(n,"-track"),b=wb(o,d,f),y=wb(i,d,f),C=function($){!h&&s&&s($,-1)},x={};switch(u){case"rtl":x.right="".concat(b*100,"%"),x.width="".concat(y*100-b*100,"%");break;case"btt":x.bottom="".concat(b*100,"%"),x.height="".concat(y*100-b*100,"%");break;case"ttb":x.top="".concat(b*100,"%"),x.height="".concat(y*100-b*100,"%");break;default:x.left="".concat(b*100,"%"),x.width="".concat(y*100-b*100,"%")}var S=l||J(m,z(z({},"".concat(m,"-").concat(a+1),a!==null&&p),"".concat(n,"-track-draggable"),s),v.track);return g.createElement("div",{className:S,style:V(V({},x),r),onMouseDown:C,onTouchStart:C})},cX=function(t){var n=t.prefixCls,r=t.style,o=t.values,i=t.startPoint,a=t.onStartMove,s=g.useContext(Ia),l=s.included,c=s.range,u=s.min,d=s.styles,f=s.classNames,h=g.useMemo(function(){if(!c){if(o.length===0)return[];var v=i??u,m=o[0];return[{start:Math.min(v,m),end:Math.max(v,m)}]}for(var b=[],y=0;y<o.length-1;y+=1)b.push({start:o[y],end:o[y+1]});return b},[o,c,i,u]);if(!l)return null;var p=h!=null&&h.length&&(f.tracks||d.tracks)?g.createElement(hT,{index:null,prefixCls:n,start:h[0].start,end:h[h.length-1].end,replaceCls:J(f.tracks,"".concat(n,"-tracks")),style:d.tracks}):null;return g.createElement(g.Fragment,null,p,h.map(function(v,m){var b=v.start,y=v.end;return g.createElement(hT,{index:m,prefixCls:n,style:V(V({},Ta(r,m)),d.track),start:b,end:y,key:m,onStartMove:a})}))},uX=130;function pT(e){var t="targetTouches"in e?e.targetTouches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function dX(e,t,n,r,o,i,a,s,l,c,u){var d=g.useState(null),f=Y(d,2),h=f[0],p=f[1],v=g.useState(-1),m=Y(v,2),b=m[0],y=m[1],C=g.useState(!1),x=Y(C,2),S=x[0],E=x[1],$=g.useState(n),O=Y($,2),k=O[0],M=O[1],T=g.useState(n),I=Y(T,2),R=I[0],N=I[1],P=g.useRef(null),A=g.useRef(null),_=g.useRef(null),B=g.useContext(dT),F=B.onDragStart,U=B.onDragChange;Yt(function(){b===-1&&M(n)},[n,b]),g.useEffect(function(){return function(){document.removeEventListener("mousemove",P.current),document.removeEventListener("mouseup",A.current),_.current&&(_.current.removeEventListener("touchmove",P.current),_.current.removeEventListener("touchend",A.current))}},[]);var K=function(q,te,G){te!==void 0&&p(te),M(q);var re=q;G&&(re=q.filter(function(oe,ne){return ne!==b})),a(re),U&&U({rawValues:q,deleteIndex:G?b:-1,draggingIndex:b,draggingValue:te})},j=qt(function(W,q,te){if(W===-1){var G=R[0],re=R[R.length-1],oe=r-G,ne=o-re,Z=q*(o-r);Z=Math.max(Z,oe),Z=Math.min(Z,ne);var ae=i(G+Z);Z=ae-G;var ie=R.map(function(ce){return ce+Z});K(ie)}else{var X=(o-r)*q,ee=de(k);ee[W]=R[W];var le=l(ee,X,W,"dist");K(le.values,le.value,te)}}),D=function(q,te,G){q.stopPropagation();var re=G||n,oe=re[te];y(te),p(oe),N(re),M(re),E(!1);var ne=pT(q),Z=ne.pageX,ae=ne.pageY,ie=!1;F&&F({rawValues:re,draggingIndex:te,draggingValue:oe});var X=function(ce){ce.preventDefault();var ue=pT(ce),ge=ue.pageX,ye=ue.pageY,$e=ge-Z,Ce=ye-ae,se=e.current.getBoundingClientRect(),Se=se.width,ze=se.height,Ge,Pe;switch(t){case"btt":Ge=-Ce/ze,Pe=$e;break;case"ttb":Ge=Ce/ze,Pe=$e;break;case"rtl":Ge=-$e/Se,Pe=Ce;break;default:Ge=$e/Se,Pe=Ce}ie=c?Math.abs(Pe)>uX&&u<k.length:!1,E(ie),j(te,Ge,ie)},ee=function le(ce){ce.preventDefault(),document.removeEventListener("mouseup",le),document.removeEventListener("mousemove",X),_.current&&(_.current.removeEventListener("touchmove",P.current),_.current.removeEventListener("touchend",A.current)),P.current=null,A.current=null,_.current=null,s(ie),y(-1),E(!1)};document.addEventListener("mouseup",ee),document.addEventListener("mousemove",X),q.currentTarget.addEventListener("touchend",ee),q.currentTarget.addEventListener("touchmove",X),P.current=X,A.current=ee,_.current=q.currentTarget},H=g.useMemo(function(){var W=de(n).sort(function(oe,ne){return oe-ne}),q=de(k).sort(function(oe,ne){return oe-ne}),te={};q.forEach(function(oe){te[oe]=(te[oe]||0)+1}),W.forEach(function(oe){te[oe]=(te[oe]||0)-1});var G=c?1:0,re=Object.values(te).reduce(function(oe,ne){return oe+Math.abs(ne)},0);return re<=G?k:n},[n,k,c]);return[b,h,S,H,D]}function fX(e,t,n,r,o,i){var a=g.useCallback(function(h){return Math.max(e,Math.min(t,h))},[e,t]),s=g.useCallback(function(h){if(n!==null){var p=e+Math.round((a(h)-e)/n)*n,v=function(C){return(String(C).split(".")[1]||"").length},m=Math.max(v(n),v(t),v(e)),b=Number(p.toFixed(m));return e<=b&&b<=t?b:null}return null},[n,e,t,a]),l=g.useCallback(function(h){var p=a(h),v=r.map(function(y){return y.value});n!==null&&v.push(s(h)),v.push(e,t);var m=v[0],b=t-e;return v.forEach(function(y){var C=Math.abs(p-y);C<=b&&(m=y,b=C)}),m},[e,t,r,n,a,s]),c=function h(p,v,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof v=="number"){var y,C=p[m],x=C+v,S=[];r.forEach(function(M){S.push(M.value)}),S.push(e,t),S.push(s(C));var E=v>0?1:-1;b==="unit"?S.push(s(C+E*n)):S.push(s(x)),S=S.filter(function(M){return M!==null}).filter(function(M){return v<0?M<=C:M>=C}),b==="unit"&&(S=S.filter(function(M){return M!==C}));var $=b==="unit"?C:x;y=S[0];var O=Math.abs(y-$);if(S.forEach(function(M){var T=Math.abs(M-$);T<O&&(y=M,O=T)}),y===void 0)return v<0?e:t;if(b==="dist")return y;if(Math.abs(v)>1){var k=de(p);return k[m]=y,h(k,v-E,m,b)}return y}else{if(v==="min")return e;if(v==="max")return t}},u=function(p,v,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",y=p[m],C=c(p,v,m,b);return{value:C,changed:C!==y}},d=function(p){return i===null&&p===0||typeof i=="number"&&p<i},f=function(p,v,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",y=p.map(l),C=y[m],x=c(y,v,m,b);if(y[m]=x,o===!1){var S=i||0;m>0&&y[m-1]!==C&&(y[m]=Math.max(y[m],y[m-1]+S)),m<y.length-1&&y[m+1]!==C&&(y[m]=Math.min(y[m],y[m+1]-S))}else if(typeof i=="number"||i===null){for(var E=m+1;E<y.length;E+=1)for(var $=!0;d(y[E]-y[E-1])&&$;){var O=u(y,1,E);y[E]=O.value,$=O.changed}for(var k=m;k>0;k-=1)for(var M=!0;d(y[k]-y[k-1])&&M;){var T=u(y,-1,k-1);y[k-1]=T.value,M=T.changed}for(var I=y.length-1;I>0;I-=1)for(var R=!0;d(y[I]-y[I-1])&&R;){var N=u(y,-1,I-1);y[I-1]=N.value,R=N.changed}for(var P=0;P<y.length-1;P+=1)for(var A=!0;d(y[P+1]-y[P])&&A;){var _=u(y,1,P+1);y[P+1]=_.value,A=_.changed}}return{value:y[m],values:y}};return[l,f]}var hX={};function pX(e){return w.useMemo(function(){if(e===!0||!e)return[!!e,!1,!1,0];var t=e.editable,n=e.draggableTrack,r=e.minCount,o=e.maxCount;return hX.NODE_ENV!=="production"&&Mo(!t||!n,"`editable` can not work with `draggableTrack`."),[!0,t,!t&&n,r||0,o]},[e])}var mT={},gT=g.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-slider":n,o=e.className,i=e.style,a=e.classNames,s=e.styles,l=e.id,c=e.disabled,u=c===void 0?!1:c,d=e.keyboard,f=d===void 0?!0:d,h=e.autoFocus,p=e.onFocus,v=e.onBlur,m=e.min,b=m===void 0?0:m,y=e.max,C=y===void 0?100:y,x=e.step,S=x===void 0?1:x,E=e.value,$=e.defaultValue,O=e.range,k=e.count,M=e.onChange,T=e.onBeforeChange,I=e.onAfterChange,R=e.onChangeComplete,N=e.allowCross,P=N===void 0?!0:N,A=e.pushable,_=A===void 0?!1:A,B=e.reverse,F=e.vertical,U=e.included,K=U===void 0?!0:U,j=e.startPoint,D=e.trackStyle,H=e.handleStyle,W=e.railStyle,q=e.dotStyle,te=e.activeDotStyle,G=e.marks,re=e.dots,oe=e.handleRender,ne=e.activeHandleRender,Z=e.track,ae=e.tabIndex,ie=ae===void 0?0:ae,X=e.ariaLabelForHandle,ee=e.ariaLabelledByForHandle,le=e.ariaRequired,ce=e.ariaValueTextFormatterForHandle,ue=g.useRef(null),ge=g.useRef(null),ye=g.useMemo(function(){return F?B?"ttb":"btt":B?"rtl":"ltr"},[B,F]),$e=pX(O),Ce=Y($e,5),se=Ce[0],Se=Ce[1],ze=Ce[2],Ge=Ce[3],Pe=Ce[4],Oe=g.useMemo(function(){return isFinite(b)?b:0},[b]),qe=g.useMemo(function(){return isFinite(C)?C:100},[C]),Ne=g.useMemo(function(){return S!==null&&S<=0?1:S},[S]),Fe=g.useMemo(function(){return typeof _=="boolean"?_?Ne:!1:_>=0?_:!1},[_,Ne]),Ae=g.useMemo(function(){return Object.keys(G||{}).map(function(We){var Te=G[We],_e={value:Number(We)};return Te&&Ue(Te)==="object"&&!g.isValidElement(Te)&&("label"in Te||"style"in Te)?(_e.style=Te.style,_e.label=Te.label):_e.label=Te,_e}).filter(function(We){var Te=We.label;return Te||typeof Te=="number"}).sort(function(We,Te){return We.value-Te.value})},[G]),ke=fX(Oe,qe,Ne,Ae,P,Fe),Xe=Y(ke,2),pe=Xe[0],ve=Xe[1],Ve=cn($,{value:E}),xe=Y(Ve,2),tt=xe[0],pt=xe[1],Re=g.useMemo(function(){var We=tt==null?[]:Array.isArray(tt)?tt:[tt],Te=Y(We,1),_e=Te[0],Ie=_e===void 0?Oe:_e,Je=tt===null?[]:[Ie];if(se){if(Je=de(We),k||tt===void 0){var mt=k>=0?k+1:2;for(Je=Je.slice(0,mt);Je.length<mt;){var Ct;Je.push((Ct=Je[Je.length-1])!==null&&Ct!==void 0?Ct:Oe)}}Je.sort(function(Mt,Ht){return Mt-Ht})}return Je.forEach(function(Mt,Ht){Je[Ht]=pe(Mt)}),Je},[tt,se,Oe,k,pe]),je=function(Te){return se?Te:Te[0]},Qe=qt(function(We){var Te=de(We).sort(function(_e,Ie){return _e-Ie});M&&!as(Te,Re,!0)&&M(je(Te)),pt(Te)}),Be=qt(function(We){We&&ue.current.hideHelp();var Te=je(Re);I==null||I(Te),ft(!I,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),R==null||R(Te)}),it=function(Te){if(!(u||!Se||Re.length<=Ge)){var _e=de(Re);_e.splice(Te,1),T==null||T(je(_e)),Qe(_e);var Ie=Math.max(0,Te-1);ue.current.hideHelp(),ue.current.focus(Ie)}},$t=dX(ge,ye,Re,Oe,qe,pe,Qe,Be,ve,Se,Ge),bt=Y($t,5),rt=bt[0],dt=bt[1],ut=bt[2],De=bt[3],me=bt[4],fe=function(Te,_e){if(!u){var Ie=de(Re),Je=0,mt=0,Ct=qe-Oe;Re.forEach(function(bn,Fn){var An=Math.abs(Te-bn);An<=Ct&&(Ct=An,Je=Fn),bn<Te&&(mt=Fn)});var Mt=Je;Se&&Ct!==0&&(!Pe||Re.length<Pe)?(Ie.splice(mt+1,0,Te),Mt=mt+1):Ie[Je]=Te,se&&!Re.length&&k===void 0&&Ie.push(Te);var Ht=je(Ie);if(T==null||T(Ht),Qe(Ie),_e){var xn,pn;(xn=document.activeElement)===null||xn===void 0||(pn=xn.blur)===null||pn===void 0||pn.call(xn),ue.current.focus(Mt),me(_e,Mt,Ie)}else I==null||I(Ht),ft(!I,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),R==null||R(Ht)}},we=function(Te){Te.preventDefault();var _e=ge.current.getBoundingClientRect(),Ie=_e.width,Je=_e.height,mt=_e.left,Ct=_e.top,Mt=_e.bottom,Ht=_e.right,xn=Te.clientX,pn=Te.clientY,bn;switch(ye){case"btt":bn=(Mt-pn)/Je;break;case"ttb":bn=(pn-Ct)/Je;break;case"rtl":bn=(Ht-xn)/Ie;break;default:bn=(xn-mt)/Ie}var Fn=Oe+bn*(qe-Oe);fe(pe(Fn),Te)},Ze=g.useState(null),Ye=Y(Ze,2),yt=Ye[0],St=Ye[1],At=function(Te,_e){if(!u){var Ie=ve(Re,Te,_e);T==null||T(je(Re)),Qe(Ie.values),St(Ie.value)}};g.useEffect(function(){if(yt!==null){var We=Re.indexOf(yt);We>=0&&ue.current.focus(We)}St(null)},[yt]);var Et=g.useMemo(function(){return ze&&Ne===null?(mT.NODE_ENV!=="production"&&ft(!1,"`draggableTrack` is not supported when `step` is `null`."),!1):ze},[ze,Ne]),Bt=qt(function(We,Te){me(We,Te),T==null||T(je(Re))}),jt=rt!==-1;g.useEffect(function(){if(!jt){var We=Re.lastIndexOf(dt);ue.current.focus(We)}},[jt]);var Zt=g.useMemo(function(){return de(De).sort(function(We,Te){return We-Te})},[De]),On=g.useMemo(function(){return se?[Zt[0],Zt[Zt.length-1]]:[Oe,Zt[0]]},[Zt,se,Oe]),Ft=Y(On,2),Jt=Ft[0],Me=Ft[1];g.useImperativeHandle(t,function(){return{focus:function(){ue.current.focus(0)},blur:function(){var Te,_e=document,Ie=_e.activeElement;(Te=ge.current)!==null&&Te!==void 0&&Te.contains(Ie)&&(Ie==null||Ie.blur())}}}),g.useEffect(function(){h&&ue.current.focus(0)},[]);var Ke=g.useMemo(function(){return{min:Oe,max:qe,direction:ye,disabled:u,keyboard:f,step:Ne,included:K,includedStart:Jt,includedEnd:Me,range:se,tabIndex:ie,ariaLabelForHandle:X,ariaLabelledByForHandle:ee,ariaRequired:le,ariaValueTextFormatterForHandle:ce,styles:s||{},classNames:a||{}}},[Oe,qe,ye,u,f,Ne,K,Jt,Me,se,ie,X,ee,le,ce,s,a]);return g.createElement(Ia.Provider,{value:Ke},g.createElement("div",{ref:ge,className:J(r,o,z(z(z(z({},"".concat(r,"-disabled"),u),"".concat(r,"-vertical"),F),"".concat(r,"-horizontal"),!F),"".concat(r,"-with-marks"),Ae.length)),style:i,onMouseDown:we,id:l},g.createElement("div",{className:J("".concat(r,"-rail"),a==null?void 0:a.rail),style:V(V({},W),s==null?void 0:s.rail)}),Z!==!1&&g.createElement(cX,{prefixCls:r,style:D,values:Re,startPoint:j,onStartMove:Et?Bt:void 0}),g.createElement(lX,{prefixCls:r,marks:Ae,dots:re,style:q,activeStyle:te}),g.createElement(fT,{ref:ue,prefixCls:r,style:H,values:De,draggingIndex:rt,draggingDelete:ut,onStartMove:Bt,onOffsetChange:At,onFocus:p,onBlur:v,handleRender:oe,activeHandleRender:ne,onChangeComplete:Be,onDelete:Se?it:void 0}),g.createElement(aX,{prefixCls:r,marks:Ae,onClick:fe})))});mT.NODE_ENV!=="production"&&(gT.displayName="Slider");const vT=w.createContext({});var mX={};const Ob=g.forwardRef((e,t)=>{const{open:n,draggingDelete:r,value:o}=e,i=w.useRef(null),a=n&&!r,s=w.useRef(null);function l(){Nt.cancel(s.current),s.current=null}function c(){s.current=Nt(()=>{var u;(u=i.current)===null||u===void 0||u.forceAlign(),s.current=null})}return g.useEffect(()=>(a?c():l(),l),[a,e.title,o]),g.createElement(hn,Object.assign({ref:sr(i,t)},e,{open:a}))});mX.NODE_ENV!=="production"&&(Ob.displayName="SliderTooltip");const gX=e=>{const{componentCls:t,antCls:n,controlSize:r,dotSize:o,marginFull:i,marginPart:a,colorFillContentHover:s,handleColorDisabled:l,calc:c,handleSize:u,handleSizeHover:d,handleActiveColor:f,handleActiveOutlineColor:h,handleLineWidth:p,handleLineWidthHover:v,motionDurationMid:m}=e;return{[t]:Object.assign(Object.assign({},Pn(e)),{position:"relative",height:r,margin:`${Q(a)} ${Q(i)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Q(i)} ${Q(a)}`},[`${t}-rail`]:{position:"absolute",backgroundColor:e.railBg,borderRadius:e.borderRadiusXS,transition:`background-color ${m}`},[`${t}-track,${t}-tracks`]:{position:"absolute",transition:`background-color ${m}`},[`${t}-track`]:{backgroundColor:e.trackBg,borderRadius:e.borderRadiusXS},[`${t}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${t}-rail`]:{backgroundColor:e.railHoverBg},[`${t}-track`]:{backgroundColor:e.trackHoverBg},[`${t}-dot`]:{borderColor:s},[`${t}-handle::after`]:{boxShadow:`0 0 0 ${Q(p)} ${e.colorPrimaryBorderHover}`},[`${t}-dot-active`]:{borderColor:e.dotActiveBorderColor}},[`${t}-handle`]:{position:"absolute",width:u,height:u,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:c(p).mul(-1).equal(),insetBlockStart:c(p).mul(-1).equal(),width:c(u).add(c(p).mul(2)).equal(),height:c(u).add(c(p).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:u,height:u,backgroundColor:e.colorBgElevated,boxShadow:`0 0 0 ${Q(p)} ${e.handleColor}`,outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:`
|
|
441
|
+
inset-inline-start ${m},
|
|
442
|
+
inset-block-start ${m},
|
|
443
|
+
width ${m},
|
|
444
|
+
height ${m},
|
|
445
|
+
box-shadow ${m},
|
|
446
|
+
outline ${m}
|
|
447
|
+
`},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:c(d).sub(u).div(2).add(v).mul(-1).equal(),insetBlockStart:c(d).sub(u).div(2).add(v).mul(-1).equal(),width:c(d).add(c(v).mul(2)).equal(),height:c(d).add(c(v).mul(2)).equal()},"&::after":{boxShadow:`0 0 0 ${Q(v)} ${f}`,outline:`6px solid ${h}`,width:d,height:d,insetInlineStart:e.calc(u).sub(d).div(2).equal(),insetBlockStart:e.calc(u).sub(d).div(2).equal()}}},[`&-lock ${t}-handle`]:{"&::before, &::after":{transition:"none"}},[`${t}-mark`]:{position:"absolute",fontSize:e.fontSize},[`${t}-mark-text`]:{position:"absolute",display:"inline-block",color:e.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:e.colorText}},[`${t}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${t}-dot`]:{position:"absolute",width:o,height:o,backgroundColor:e.colorBgElevated,border:`${Q(p)} solid ${e.dotBorderColor}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:e.dotActiveBorderColor}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-rail`]:{backgroundColor:`${e.railBg} !important`},[`${t}-track`]:{backgroundColor:`${e.trackBgDisabled} !important`},[`
|
|
448
|
+
${t}-dot
|
|
449
|
+
`]:{backgroundColor:e.colorBgElevated,borderColor:e.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${t}-handle::after`]:{backgroundColor:e.colorBgElevated,cursor:"not-allowed",width:u,height:u,boxShadow:`0 0 0 ${Q(p)} ${l}`,insetInlineStart:0,insetBlockStart:0},[`
|
|
450
|
+
${t}-mark-text,
|
|
451
|
+
${t}-dot
|
|
452
|
+
`]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},bT=(e,t)=>{const{componentCls:n,railSize:r,handleSize:o,dotSize:i,marginFull:a,calc:s}=e,l=t?"paddingBlock":"paddingInline",c=t?"width":"height",u=t?"height":"width",d=t?"insetBlockStart":"insetInlineStart",f=t?"top":"insetInlineStart",h=s(r).mul(3).sub(o).div(2).equal(),p=s(o).sub(r).div(2).equal(),v=t?{borderWidth:`${Q(p)} 0`,transform:`translateY(${Q(s(p).mul(-1).equal())})`}:{borderWidth:`0 ${Q(p)}`,transform:`translateX(${Q(e.calc(p).mul(-1).equal())})`};return{[l]:r,[u]:s(r).mul(3).equal(),[`${n}-rail`]:{[c]:"100%",[u]:r},[`${n}-track,${n}-tracks`]:{[u]:r},[`${n}-track-draggable`]:Object.assign({},v),[`${n}-handle`]:{[d]:h},[`${n}-mark`]:{insetInlineStart:0,top:0,[f]:s(r).mul(3).add(t?0:a).equal(),[c]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[f]:r,[c]:"100%",[u]:r},[`${n}-dot`]:{position:"absolute",[d]:s(r).sub(i).div(2).equal()}}},vX=e=>{const{componentCls:t,marginPartWithMark:n}=e;return{[`${t}-horizontal`]:Object.assign(Object.assign({},bT(e,!0)),{[`&${t}-with-marks`]:{marginBottom:n}})}},bX=e=>{const{componentCls:t}=e;return{[`${t}-vertical`]:Object.assign(Object.assign({},bT(e,!1)),{height:"100%"})}},yX=gn("Slider",e=>{const t=Dt(e,{marginPart:e.calc(e.controlHeight).sub(e.controlSize).div(2).equal(),marginFull:e.calc(e.controlSize).div(2).equal(),marginPartWithMark:e.calc(e.controlHeightLG).sub(e.controlSize).equal()});return[gX(t),vX(t),bX(t)]},e=>{const n=e.controlHeightLG/4,r=e.controlHeightSM/2,o=e.lineWidth+1,i=e.lineWidth+1*1.5,a=e.colorPrimary,s=new Ut(a).setA(.2).toRgbString();return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:r,dotSize:8,handleLineWidth:o,handleLineWidthHover:i,railBg:e.colorFillTertiary,railHoverBg:e.colorFillSecondary,trackBg:e.colorPrimaryBorder,trackHoverBg:e.colorPrimaryBorderHover,handleColor:e.colorPrimaryBorder,handleActiveColor:a,handleActiveOutlineColor:s,handleColorDisabled:new Ut(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString(),dotBorderColor:e.colorBorderSecondary,dotActiveBorderColor:e.colorPrimaryBorder,trackBgDisabled:e.colorBgContainerDisabled}});function kb(){const[e,t]=g.useState(!1),n=g.useRef(null),r=()=>{Nt.cancel(n.current)},o=i=>{r(),i?t(i):n.current=Nt(()=>{t(i)})};return g.useEffect(()=>r,[]),[e,o]}var yT={},CX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function SX(e,t){return e||e===null?e:t||t===null?t:n=>typeof n=="number"?n.toString():""}const CT=w.forwardRef((e,t)=>{const{prefixCls:n,range:r,className:o,rootClassName:i,style:a,disabled:s,tooltipPrefixCls:l,tipFormatter:c,tooltipVisible:u,getTooltipPopupContainer:d,tooltipPlacement:f,tooltip:h={},onChangeComplete:p,classNames:v,styles:m}=e,b=CX(e,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:y}=e,{getPrefixCls:C,direction:x,className:S,style:E,classNames:$,styles:O,getPopupContainer:k}=xr("slider"),M=w.useContext(Hr),T=s??M,{handleRender:I,direction:R}=w.useContext(vT),P=(R||x)==="rtl",[A,_]=kb(),[B,F]=kb(),U=Object.assign({},h),{open:K,placement:j,getPopupContainer:D,prefixCls:H,formatter:W}=U,q=K??u,te=(A||B)&&q!==!1,G=SX(W,c),[re,oe]=kb(),ne=se=>{p==null||p(se),oe(!1)},Z=(se,Se)=>se||(Se?P?"left":"right":"top"),ae=C("slider",n),[ie,X,ee]=yX(ae),le=J(o,S,$.root,v==null?void 0:v.root,i,{[`${ae}-rtl`]:P,[`${ae}-lock`]:re},X,ee);if(P&&!b.vertical&&(b.reverse=!b.reverse),yT.NODE_ENV!=="production"){const se=Wt("Slider");[["tooltipPrefixCls","prefixCls"],["getTooltipPopupContainer","getPopupContainer"],["tipFormatter","formatter"],["tooltipPlacement","placement"],["tooltipVisible","open"]].forEach(([Se,ze])=>{se.deprecated(!(Se in e),Se,`tooltip.${ze}`)})}w.useEffect(()=>{const se=()=>{Nt(()=>{F(!1)},1)};return document.addEventListener("mouseup",se),()=>{document.removeEventListener("mouseup",se)}},[]);const ce=r&&!q,ue=I||((se,Se)=>{const{index:ze}=Se,Ge=se.props;function Pe(Fe,Ae,ke){var Xe,pe,ve,Ve;ke&&((pe=(Xe=b)[Fe])===null||pe===void 0||pe.call(Xe,Ae)),(Ve=(ve=Ge)[Fe])===null||Ve===void 0||Ve.call(ve,Ae)}const Oe=Object.assign(Object.assign({},Ge),{onMouseEnter:Fe=>{_(!0),Pe("onMouseEnter",Fe)},onMouseLeave:Fe=>{_(!1),Pe("onMouseLeave",Fe)},onMouseDown:Fe=>{F(!0),oe(!0),Pe("onMouseDown",Fe)},onFocus:Fe=>{var Ae;F(!0),(Ae=b.onFocus)===null||Ae===void 0||Ae.call(b,Fe),Pe("onFocus",Fe,!0)},onBlur:Fe=>{var Ae;F(!1),(Ae=b.onBlur)===null||Ae===void 0||Ae.call(b,Fe),Pe("onBlur",Fe,!0)}}),qe=w.cloneElement(se,Oe),Ne=(!!q||te)&&G!==null;return ce?qe:w.createElement(Ob,Object.assign({},U,{prefixCls:C("tooltip",H??l),title:G?G(Se.value):"",value:Se.value,open:Ne,placement:Z(j??f,y),key:ze,classNames:{root:`${ae}-tooltip`},getPopupContainer:D||d||k}),qe)}),ge=ce?(se,Se)=>{const ze=w.cloneElement(se,{style:Object.assign(Object.assign({},se.props.style),{visibility:"hidden"})});return w.createElement(Ob,Object.assign({},U,{prefixCls:C("tooltip",H??l),title:G?G(Se.value):"",open:G!==null&&te,placement:Z(j??f,y),key:"tooltip",classNames:{root:`${ae}-tooltip`},getPopupContainer:D||d||k,draggingDelete:Se.draggingDelete}),ze)}:void 0,ye=Object.assign(Object.assign(Object.assign(Object.assign({},O.root),E),m==null?void 0:m.root),a),$e=Object.assign(Object.assign({},O.tracks),m==null?void 0:m.tracks),Ce=J($.tracks,v==null?void 0:v.tracks);return ie(w.createElement(gT,Object.assign({},b,{classNames:Object.assign({handle:J($.handle,v==null?void 0:v.handle),rail:J($.rail,v==null?void 0:v.rail),track:J($.track,v==null?void 0:v.track)},Ce?{tracks:Ce}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},O.handle),m==null?void 0:m.handle),rail:Object.assign(Object.assign({},O.rail),m==null?void 0:m.rail),track:Object.assign(Object.assign({},O.track),m==null?void 0:m.track)},Object.keys($e).length?{tracks:$e}:{}),step:b.step,range:r,className:le,style:ye,disabled:T,ref:t,prefixCls:ae,handleRender:ue,activeHandleRender:ge,onChangeComplete:ne})))});yT.NODE_ENV!=="production"&&(CT.displayName="Slider");var xX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const ST=e=>{const{prefixCls:t,colors:n,type:r,color:o,range:i=!1,className:a,activeIndex:s,onActive:l,onDragStart:c,onDragChange:u,onKeyDelete:d}=e,f=xX(e,["prefixCls","colors","type","color","range","className","activeIndex","onActive","onDragStart","onDragChange","onKeyDelete"]),h=Object.assign(Object.assign({},f),{track:!1}),p=g.useMemo(()=>`linear-gradient(90deg, ${n.map(E=>`${E.color} ${E.percent}%`).join(", ")})`,[n]),v=g.useMemo(()=>!o||!r?null:r==="alpha"?o.toRgbString():`hsl(${o.toHsb().h}, 100%, 50%)`,[o,r]),m=qt(c),b=qt(u),y=g.useMemo(()=>({onDragStart:m,onDragChange:b}),[]),C=qt((S,E)=>{const{onFocus:$,style:O,className:k,onKeyDown:M}=S.props,T=Object.assign({},O);return r==="gradient"&&(T.background=vO(n,E.value)),g.cloneElement(S,{onFocus:I=>{l==null||l(E.index),$==null||$(I)},style:T,className:J(k,{[`${t}-slider-handle-active`]:s===E.index}),onKeyDown:I=>{(I.key==="Delete"||I.key==="Backspace")&&d&&d(E.index),M==null||M(I)}})}),x=g.useMemo(()=>({direction:"ltr",handleRender:C}),[]);return g.createElement(vT.Provider,{value:x},g.createElement(dT.Provider,{value:y},g.createElement(CT,Object.assign({},h,{className:J(a,`${t}-slider`),tooltip:{open:!1},range:{editable:i,minCount:2},styles:{rail:{background:p},handle:v?{background:v}:{}},classNames:{rail:`${t}-slider-rail`,handle:`${t}-slider-handle`}}))))},wX=e=>{const{value:t,onChange:n,onChangeComplete:r}=e,o=a=>n(a[0]),i=a=>r(a[0]);return g.createElement(ST,Object.assign({},e,{value:[t],onChange:o,onChangeComplete:i}))};function xT(e){return de(e).sort((t,n)=>t.percent-n.percent)}const EX=e=>{const{prefixCls:t,mode:n,onChange:r,onChangeComplete:o,onActive:i,activeIndex:a,onGradientDragging:s,colors:l}=e,c=n==="gradient",u=g.useMemo(()=>l.map(b=>({percent:b.percent,color:b.color.toRgbString()})),[l]),d=g.useMemo(()=>u.map(b=>b.percent),[u]),f=g.useRef(u),h=({rawValues:b,draggingIndex:y,draggingValue:C})=>{if(b.length>u.length){const x=vO(u,C),S=de(u);S.splice(y,0,{percent:C,color:x}),f.current=S}else f.current=u;s(!0),r(new $r(xT(f.current)),!0)},p=({deleteIndex:b,draggingIndex:y,draggingValue:C})=>{let x=de(f.current);b!==-1?x.splice(b,1):(x[y]=Object.assign(Object.assign({},x[y]),{percent:C}),x=xT(x)),r(new $r(x),!0)},v=b=>{const y=de(u);y.splice(b,1);const C=new $r(y);r(C),o(C)},m=b=>{o(new $r(u)),a>=b.length&&i(b.length-1),s(!1)};return c?g.createElement(ST,{min:0,max:100,prefixCls:t,className:`${t}-gradient-slider`,colors:u,color:null,value:d,range:!0,onChangeComplete:m,disabled:!1,type:"gradient",activeIndex:a,onActive:i,onDragStart:h,onDragChange:p,onKeyDelete:v}):null},$X=g.memo(EX);var OX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const kX={slider:wX},wT=()=>{const e=w.useContext(WN),{mode:t,onModeChange:n,modeOptions:r,prefixCls:o,allowClear:i,value:a,disabledAlpha:s,onChange:l,onClear:c,onChangeComplete:u,activeIndex:d,gradientDragging:f}=e,h=OX(e,["mode","onModeChange","modeOptions","prefixCls","allowClear","value","disabledAlpha","onChange","onClear","onChangeComplete","activeIndex","gradientDragging"]),p=w.useMemo(()=>a.cleared?[{percent:0,color:new $r("")},{percent:100,color:new $r("")}]:a.getColors(),[a]),v=!a.isGradient(),[m,b]=w.useState(a);Yt(()=>{var N;v||b((N=p[d])===null||N===void 0?void 0:N.color)},[v,p,f,d]);const y=w.useMemo(()=>{var N;return v?a:f?m:(N=p[d])===null||N===void 0?void 0:N.color},[p,a,d,v,m,f]),[C,x]=w.useState(y),[S,E]=$$(),$=C!=null&&C.equals(y)?y:C;Yt(()=>{x(y)},[S,y==null?void 0:y.toHexString()]);const O=(N,P)=>{let A=Xn(N);if(a.cleared){const B=A.toRgb();if(!B.r&&!B.g&&!B.b&&P){const{type:F,value:U=0}=P;A=new $r({h:F==="hue"?U:0,s:1,b:1,a:F==="alpha"?U/100:1})}else A=Qd(A)}if(t==="single")return A;const _=de(p);return _[d]=Object.assign(Object.assign({},_[d]),{color:A}),new $r(_)},k=(N,P,A)=>{const _=O(N,A);x(_.isGradient()?_.getColors()[d].color:_),l(_,P)},M=(N,P)=>{u(O(N,P)),E()},T=N=>{l(O(N))};let I=null;const R=r.length>1;return(i||R)&&(I=w.createElement("div",{className:`${o}-operation`},R&&w.createElement(VN,{size:"small",options:r,value:t,onChange:n}),w.createElement(qN,Object.assign({prefixCls:o,value:a,onChange:N=>{l(N),c==null||c()}},h)))),w.createElement(w.Fragment,null,I,w.createElement($X,Object.assign({},e,{colors:p})),w.createElement(rO,{prefixCls:o,value:$==null?void 0:$.toHsb(),disabledAlpha:s,onChange:(N,P)=>{k(N,!0,P)},onChangeComplete:(N,P)=>{M(N,P)},components:kX}),w.createElement(eX,Object.assign({value:y,onChange:T,prefixCls:o,disabledAlpha:s},h)))},ET=()=>{const{prefixCls:e,value:t,presets:n,onChange:r}=w.useContext(UN);return Array.isArray(n)?w.createElement(T6,{value:t,presets:n,prefixCls:e,onChange:r}):null};var MX={};const $T=e=>{const{prefixCls:t,presets:n,panelRender:r,value:o,onChange:i,onClear:a,allowClear:s,disabledAlpha:l,mode:c,onModeChange:u,modeOptions:d,onChangeComplete:f,activeIndex:h,onActive:p,format:v,onFormatChange:m,gradientDragging:b,onGradientDragging:y,disabledFormat:C}=e,x=`${t}-inner`,S=w.useMemo(()=>({prefixCls:t,value:o,onChange:i,onClear:a,allowClear:s,disabledAlpha:l,mode:c,onModeChange:u,modeOptions:d,onChangeComplete:f,activeIndex:h,onActive:p,format:v,onFormatChange:m,gradientDragging:b,onGradientDragging:y,disabledFormat:C}),[t,o,i,a,s,l,c,u,d,f,h,p,v,m,b,y,C]),E=w.useMemo(()=>({prefixCls:t,value:o,presets:n,onChange:i}),[t,o,n,i]),$=w.createElement("div",{className:`${x}-content`},w.createElement(wT,null),Array.isArray(n)&&w.createElement(LN,null),w.createElement(ET,null));return w.createElement(WN.Provider,{value:S},w.createElement(UN.Provider,{value:E},w.createElement("div",{className:x},typeof r=="function"?r($,{components:{Picker:wT,Presets:ET}}):$)))};MX.NODE_ENV!=="production"&&($T.displayName="ColorPickerPanel");var NX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const TX=w.forwardRef((e,t)=>{const{color:n,prefixCls:r,open:o,disabled:i,format:a,className:s,showText:l,activeIndex:c}=e,u=NX(e,["color","prefixCls","open","disabled","format","className","showText","activeIndex"]),d=`${r}-trigger`,f=`${d}-text`,h=`${f}-cell`,[p]=uo("ColorPicker"),v=w.useMemo(()=>{if(!l)return"";if(typeof l=="function")return l(n);if(n.cleared)return p.transparent;if(n.isGradient())return n.getColors().map((C,x)=>{const S=c!==-1&&c!==x;return w.createElement("span",{key:x,className:J(h,S&&`${h}-inactive`)},C.color.toRgbString()," ",C.percent,"%")});const b=n.toHexString().toUpperCase(),y=lv(n);switch(a){case"rgb":return n.toRgbString();case"hsb":return n.toHsbString();default:return y<100?`${b.slice(0,7)},${y}%`:b}},[n,a,l,c,p.transparent,h]),m=w.useMemo(()=>n.cleared?w.createElement(qN,{prefixCls:r}):w.createElement(ov,{prefixCls:r,color:n.toCssString()}),[n,r]);return w.createElement("div",Object.assign({ref:t,className:J(d,s,{[`${d}-active`]:o,[`${d}-disabled`]:i})},Vr(u)),m,l&&w.createElement("div",{className:f},v))});function IX(e,t,n){const[r]=uo("ColorPicker"),[o,i]=cn(e,{value:t}),[a,s]=g.useState("single"),[l,c]=g.useMemo(()=>{const v=(Array.isArray(n)?n:[n]).filter(C=>C);v.length||v.push("single");const m=new Set(v),b=[],y=(C,x)=>{m.has(C)&&b.push({label:x,value:C})};return y("single",r.singleColor),y("gradient",r.gradientColor),[b,m]},[n,r.singleColor,r.gradientColor]),[u,d]=g.useState(null),f=qt(v=>{d(v),i(v)}),h=g.useMemo(()=>{const v=Xn(o||"");return v.equals(u)?u:v},[o,u]),p=g.useMemo(()=>{var v;return c.has(a)?a:(v=l[0])===null||v===void 0?void 0:v.value},[c,a,l]);return g.useEffect(()=>{s(h.isGradient()?"gradient":"single")},[h]),[h,f,p,s,l]}const OT=(e,t)=>({backgroundImage:`conic-gradient(${t} 25%, transparent 25% 50%, ${t} 50% 75%, transparent 75% 100%)`,backgroundSize:`${e} ${e}`}),kT=(e,t)=>{const{componentCls:n,borderRadiusSM:r,colorPickerInsetShadow:o,lineWidth:i,colorFillSecondary:a}=e;return{[`${n}-color-block`]:Object.assign(Object.assign({position:"relative",borderRadius:r,width:t,height:t,boxShadow:o,flex:"none"},OT("50%",e.colorFillSecondary)),{[`${n}-color-block-inner`]:{width:"100%",height:"100%",boxShadow:`inset 0 0 0 ${Q(i)} ${a}`,borderRadius:"inherit"}})}},PX=e=>{const{componentCls:t,antCls:n,fontSizeSM:r,lineHeightSM:o,colorPickerAlphaInputWidth:i,marginXXS:a,paddingXXS:s,controlHeightSM:l,marginXS:c,fontSizeIcon:u,paddingXS:d,colorTextPlaceholder:f,colorPickerInputNumberHandleWidth:h,lineWidth:p}=e;return{[`${t}-input-container`]:{display:"flex",[`${t}-steppers${n}-input-number`]:{fontSize:r,lineHeight:o,[`${n}-input-number-input`]:{paddingInlineStart:s,paddingInlineEnd:0},[`${n}-input-number-handler-wrap`]:{width:h}},[`${t}-steppers${t}-alpha-input`]:{flex:`0 0 ${Q(i)}`,marginInlineStart:a},[`${t}-format-select${n}-select`]:{marginInlineEnd:c,width:"auto","&-single":{[`${n}-select-selector`]:{padding:0,border:0},[`${n}-select-arrow`]:{insetInlineEnd:0},[`${n}-select-selection-item`]:{paddingInlineEnd:e.calc(u).add(a).equal(),fontSize:r,lineHeight:Q(l)},[`${n}-select-item-option-content`]:{fontSize:r,lineHeight:o},[`${n}-select-dropdown`]:{[`${n}-select-item`]:{minHeight:"auto"}}}},[`${t}-input`]:{gap:a,alignItems:"center",flex:1,width:0,[`${t}-hsb-input,${t}-rgb-input`]:{display:"flex",gap:a,alignItems:"center"},[`${t}-steppers`]:{flex:1},[`${t}-hex-input${n}-input-affix-wrapper`]:{flex:1,padding:`0 ${Q(d)}`,[`${n}-input`]:{fontSize:r,textTransform:"uppercase",lineHeight:Q(e.calc(l).sub(e.calc(p).mul(2)).equal())},[`${n}-input-prefix`]:{color:f}}}}}},AX=e=>{const{componentCls:t,controlHeightLG:n,borderRadiusSM:r,colorPickerInsetShadow:o,marginSM:i,colorBgElevated:a,colorFillSecondary:s,lineWidthBold:l,colorPickerHandlerSize:c}=e;return{userSelect:"none",[`${t}-select`]:{[`${t}-palette`]:{minHeight:e.calc(n).mul(4).equal(),overflow:"hidden",borderRadius:r},[`${t}-saturation`]:{position:"absolute",borderRadius:"inherit",boxShadow:o,inset:0},marginBottom:i},[`${t}-handler`]:{width:c,height:c,border:`${Q(l)} solid ${a}`,position:"relative",borderRadius:"50%",cursor:"pointer",boxShadow:`${o}, 0 0 0 1px ${s}`}}},RX=e=>{const{componentCls:t,antCls:n,colorTextQuaternary:r,paddingXXS:o,colorPickerPresetColorSize:i,fontSizeSM:a,colorText:s,lineHeightSM:l,lineWidth:c,borderRadius:u,colorFill:d,colorWhite:f,marginXXS:h,paddingXS:p,fontHeightSM:v}=e;return{[`${t}-presets`]:{[`${n}-collapse-item > ${n}-collapse-header`]:{padding:0,[`${n}-collapse-expand-icon`]:{height:v,color:r,paddingInlineEnd:o}},[`${n}-collapse`]:{display:"flex",flexDirection:"column",gap:h},[`${n}-collapse-item > ${n}-collapse-content > ${n}-collapse-content-box`]:{padding:`${Q(p)} 0`},"&-label":{fontSize:a,color:s,lineHeight:l},"&-items":{display:"flex",flexWrap:"wrap",gap:e.calc(h).mul(1.5).equal(),[`${t}-presets-color`]:{position:"relative",cursor:"pointer",width:i,height:i,"&::before":{content:'""',pointerEvents:"none",width:e.calc(i).add(e.calc(c).mul(4)).equal(),height:e.calc(i).add(e.calc(c).mul(4)).equal(),position:"absolute",top:e.calc(c).mul(-2).equal(),insetInlineStart:e.calc(c).mul(-2).equal(),borderRadius:u,border:`${Q(c)} solid transparent`,transition:`border-color ${e.motionDurationMid} ${e.motionEaseInBack}`},"&:hover::before":{borderColor:d},"&::after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.calc(i).div(13).mul(5).equal(),height:e.calc(i).div(13).mul(8).equal(),border:`${Q(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`},[`&${t}-presets-color-checked`]:{"&::after":{opacity:1,borderColor:f,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`transform ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`},[`&${t}-presets-color-bright`]:{"&::after":{borderColor:"rgba(0, 0, 0, 0.45)"}}}}},"&-empty":{fontSize:a,color:r}}}},_X=e=>{const{componentCls:t,colorPickerInsetShadow:n,colorBgElevated:r,colorFillSecondary:o,lineWidthBold:i,colorPickerHandlerSizeSM:a,colorPickerSliderHeight:s,marginSM:l,marginXS:c}=e,u=e.calc(a).sub(e.calc(i).mul(2).equal()).equal(),d=e.calc(a).add(e.calc(i).mul(2).equal()).equal(),f={"&:after":{transform:"scale(1)",boxShadow:`${n}, 0 0 0 1px ${e.colorPrimaryActive}`}};return{[`${t}-slider`]:[OT(Q(s),e.colorFillSecondary),{margin:0,padding:0,height:s,borderRadius:e.calc(s).div(2).equal(),"&-rail":{height:s,borderRadius:e.calc(s).div(2).equal(),boxShadow:n},[`& ${t}-slider-handle`]:{width:u,height:u,top:0,borderRadius:"100%","&:before":{display:"block",position:"absolute",background:"transparent",left:{_skip_check_:!0,value:"50%"},top:"50%",transform:"translate(-50%, -50%)",width:d,height:d,borderRadius:"100%"},"&:after":{width:a,height:a,border:`${Q(i)} solid ${r}`,boxShadow:`${n}, 0 0 0 1px ${o}`,outline:"none",insetInlineStart:e.calc(i).mul(-1).equal(),top:e.calc(i).mul(-1).equal(),background:"transparent",transition:"none"},"&:focus":f}}],[`${t}-slider-container`]:{display:"flex",gap:l,marginBottom:l,[`${t}-slider-group`]:{flex:1,flexDirection:"column",justifyContent:"space-between",display:"flex","&-disabled-alpha":{justifyContent:"center"}}},[`${t}-gradient-slider`]:{marginBottom:c,[`& ${t}-slider-handle`]:{"&:after":{transform:"scale(0.8)"},"&-active, &:focus":f}}}},Mb=(e,t,n)=>({borderInlineEndWidth:e.lineWidth,borderColor:t,boxShadow:`0 0 0 ${Q(e.controlOutlineWidth)} ${n}`,outline:0}),DX=e=>{const{componentCls:t}=e;return{"&-rtl":{[`${t}-presets-color`]:{"&::after":{direction:"ltr"}},[`${t}-clear`]:{"&::after":{direction:"ltr"}}}}},MT=(e,t,n)=>{const{componentCls:r,borderRadiusSM:o,lineWidth:i,colorSplit:a,colorBorder:s,red6:l}=e;return{[`${r}-clear`]:Object.assign(Object.assign({width:t,height:t,borderRadius:o,border:`${Q(i)} solid ${a}`,position:"relative",overflow:"hidden",cursor:"inherit",transition:`all ${e.motionDurationFast}`},n),{"&::after":{content:'""',position:"absolute",insetInlineEnd:e.calc(i).mul(-1).equal(),top:e.calc(i).mul(-1).equal(),display:"block",width:40,height:2,transformOrigin:"calc(100% - 1px) 1px",transform:"rotate(-45deg)",backgroundColor:l},"&:hover":{borderColor:s}})}},LX=e=>{const{componentCls:t,colorError:n,colorWarning:r,colorErrorHover:o,colorWarningHover:i,colorErrorOutline:a,colorWarningOutline:s}=e;return{[`&${t}-status-error`]:{borderColor:n,"&:hover":{borderColor:o},[`&${t}-trigger-active`]:Object.assign({},Mb(e,n,a))},[`&${t}-status-warning`]:{borderColor:r,"&:hover":{borderColor:i},[`&${t}-trigger-active`]:Object.assign({},Mb(e,r,s))}}},jX=e=>{const{componentCls:t,controlHeightLG:n,controlHeightSM:r,controlHeight:o,controlHeightXS:i,borderRadius:a,borderRadiusSM:s,borderRadiusXS:l,borderRadiusLG:c,fontSizeLG:u}=e;return{[`&${t}-lg`]:{minWidth:n,minHeight:n,borderRadius:c,[`${t}-color-block, ${t}-clear`]:{width:o,height:o,borderRadius:a},[`${t}-trigger-text`]:{fontSize:u}},[`&${t}-sm`]:{minWidth:r,minHeight:r,borderRadius:s,[`${t}-color-block, ${t}-clear`]:{width:i,height:i,borderRadius:l},[`${t}-trigger-text`]:{lineHeight:Q(i)}}}},zX=e=>{const{antCls:t,componentCls:n,colorPickerWidth:r,colorPrimary:o,motionDurationMid:i,colorBgElevated:a,colorTextDisabled:s,colorText:l,colorBgContainerDisabled:c,borderRadius:u,marginXS:d,marginSM:f,controlHeight:h,controlHeightSM:p,colorBgTextActive:v,colorPickerPresetColorSize:m,colorPickerPreviewSize:b,lineWidth:y,colorBorder:C,paddingXXS:x,fontSize:S,colorPrimaryHover:E,controlOutline:$}=e;return[{[n]:Object.assign({[`${n}-inner`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"&-content":{display:"flex",flexDirection:"column",width:r,[`& > ${t}-divider`]:{margin:`${Q(f)} 0 ${Q(d)}`}},[`${n}-panel`]:Object.assign({},AX(e))},_X(e)),kT(e,b)),PX(e)),RX(e)),MT(e,m,{marginInlineStart:"auto"})),{[`${n}-operation`]:{display:"flex",justifyContent:"space-between",marginBottom:d}}),"&-trigger":Object.assign(Object.assign(Object.assign(Object.assign({minWidth:h,minHeight:h,borderRadius:u,border:`${Q(y)} solid ${C}`,cursor:"pointer",display:"inline-flex",alignItems:"flex-start",justifyContent:"center",transition:`all ${i}`,background:a,padding:e.calc(x).sub(y).equal(),[`${n}-trigger-text`]:{marginInlineStart:d,marginInlineEnd:e.calc(d).sub(e.calc(x).sub(y)).equal(),fontSize:S,color:l,alignSelf:"center","&-cell":{"&:not(:last-child):after":{content:'", "'},"&-inactive":{color:s}}},"&:hover":{borderColor:E},[`&${n}-trigger-active`]:Object.assign({},Mb(e,o,$)),"&-disabled":{color:s,background:c,cursor:"not-allowed","&:hover":{borderColor:v},[`${n}-trigger-text`]:{color:s}}},MT(e,p)),kT(e,p)),LX(e)),jX(e))},DX(e))},Yl(e,{focusElCls:`${n}-trigger-active`})]},BX=gn("ColorPicker",e=>{const{colorTextQuaternary:t,marginSM:n}=e,r=8,o=Dt(e,{colorPickerWidth:234,colorPickerHandlerSize:16,colorPickerHandlerSizeSM:12,colorPickerAlphaInputWidth:44,colorPickerInputNumberHandleWidth:16,colorPickerPresetColorSize:24,colorPickerInsetShadow:`inset 0 0 1px 0 ${t}`,colorPickerSliderHeight:r,colorPickerPreviewSize:e.calc(r).mul(2).add(n).equal()});return zX(o)});var Nb={},FX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Hf=e=>{const{mode:t,value:n,defaultValue:r,format:o,defaultFormat:i,allowClear:a=!1,presets:s,children:l,trigger:c="click",open:u,disabled:d,placement:f="bottomLeft",arrow:h=!0,panelRender:p,showText:v,style:m,className:b,size:y,rootClassName:C,prefixCls:x,styles:S,disabledAlpha:E=!1,onFormatChange:$,onChange:O,onClear:k,onOpenChange:M,onChangeComplete:T,getPopupContainer:I,autoAdjustOverflow:R=!0,destroyTooltipOnHide:N,destroyOnHidden:P,disabledFormat:A}=e,_=FX(e,["mode","value","defaultValue","format","defaultFormat","allowClear","presets","children","trigger","open","disabled","placement","arrow","panelRender","showText","style","className","size","rootClassName","prefixCls","styles","disabledAlpha","onFormatChange","onChange","onClear","onOpenChange","onChangeComplete","getPopupContainer","autoAdjustOverflow","destroyTooltipOnHide","destroyOnHidden","disabledFormat"]),{getPrefixCls:B,direction:F,colorPicker:U}=w.useContext(wt),K=w.useContext(Hr),j=d??K,[D,H]=cn(!1,{value:u,postState:ve=>!j&&ve,onChange:M}),[W,q]=cn(o,{value:o,defaultValue:i,onChange:$}),te=B("color-picker",x),[G,re,oe,ne,Z]=IX(r,n,t),ae=w.useMemo(()=>lv(G)<100,[G]),[ie,X]=w.useState(null),ee=ve=>{if(T){let Ve=Xn(ve);E&&ae&&(Ve=Qd(ve)),T(Ve)}},le=(ve,Ve)=>{let xe=Xn(ve);E&&ae&&(xe=Qd(xe)),re(xe),X(null),O&&O(xe,xe.toCssString()),Ve||ee(xe)},[ce,ue]=w.useState(0),[ge,ye]=w.useState(!1),$e=ve=>{if(ne(ve),ve==="single"&&G.isGradient())ue(0),le(new $r(G.getColors()[0].color)),X(G);else if(ve==="gradient"&&!G.isGradient()){const Ve=ae?Qd(G):G;le(new $r(ie||[{percent:0,color:Ve},{percent:100,color:Ve}]))}},{status:Ce}=w.useContext(qr),{compactSize:se,compactItemClassnames:Se}=Ca(te,F),ze=Wr(ve=>{var Ve;return(Ve=y??se)!==null&&Ve!==void 0?Ve:ve}),Ge=Po(te),[Pe,Oe,qe]=BX(te,Ge),Ne={[`${te}-rtl`]:F},Fe=J(C,qe,Ge,Ne),Ae=J(Ea(te,Ce),{[`${te}-sm`]:ze==="small",[`${te}-lg`]:ze==="large"},Se,U==null?void 0:U.className,Fe,b,Oe),ke=J(te,Fe);if(Nb.NODE_ENV!=="production"){const ve=Wt("ColorPicker");Nb.NODE_ENV!=="production"&&ve(!(E&&ae),"usage","`disabledAlpha` will make the alpha to be 100% when use alpha color.")}const Xe={open:D,trigger:c,placement:f,arrow:h,rootClassName:C,getPopupContainer:I,autoAdjustOverflow:R,destroyOnHidden:P??!!N},pe=Object.assign(Object.assign({},U==null?void 0:U.style),m);return Pe(w.createElement(Wi,Object.assign({style:S==null?void 0:S.popup,styles:{body:S==null?void 0:S.popupOverlayInner},onOpenChange:ve=>{(!ve||!j)&&H(ve)},content:w.createElement(Fi,{form:!0},w.createElement($T,{mode:oe,onModeChange:$e,modeOptions:Z,prefixCls:te,value:G,allowClear:a,disabled:j,disabledAlpha:E,presets:s,panelRender:p,format:W,onFormatChange:q,onChange:le,onChangeComplete:ee,onClear:k,activeIndex:ce,onActive:ue,gradientDragging:ge,onGradientDragging:ye,disabledFormat:A})),classNames:{root:ke}},Xe),l||w.createElement(TX,Object.assign({activeIndex:D?ce:-1,open:D,className:Ae,style:pe,prefixCls:te,disabled:j,showText:v,format:W},_,{color:G}))))};Nb.NODE_ENV!=="production"&&(Hf.displayName="ColorPicker");const HX=Nk(Hf,void 0,e=>Object.assign(Object.assign({},e),{placement:"bottom",autoAdjustOverflow:!1}),"color-picker",e=>e);Hf._InternalPanelDoNotUseOrYouWillBeFired=HX;var VX={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},WX={},UX=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:VX}))},Tb=g.forwardRef(UX);WX.NODE_ENV!=="production"&&(Tb.displayName="EyeOutlined");var qX={};const KX=e=>{const{getPrefixCls:t,direction:n}=w.useContext(wt),{prefixCls:r,className:o}=e,i=t("input-group",r),a=t("input"),[s,l,c]=CN(a),u=J(i,c,{[`${i}-lg`]:e.size==="large",[`${i}-sm`]:e.size==="small",[`${i}-compact`]:e.compact,[`${i}-rtl`]:n==="rtl"},l,o),d=w.useContext(qr),f=w.useMemo(()=>Object.assign(Object.assign({},d),{isFormItemInput:!1}),[d]);return qX.NODE_ENV!=="production"&&Wt("Input.Group").deprecated(!1,"Input.Group","Space.Compact"),s(g.createElement("span",{className:u,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},g.createElement(qr.Provider,{value:f},e.children)))},GX=e=>{const{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,[`${t}-input-wrapper`]:{position:"relative",[`${t}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${t}-mask-input`]:{color:"transparent",caretColor:e.colorText},[`${t}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${t}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${t}-input`]:{textAlign:"center",paddingInline:e.paddingXXS},[`&${t}-sm ${t}-input`]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},[`&${t}-lg ${t}-input`]:{paddingInline:e.paddingXS}}}},XX=gn(["Input","OTP"],e=>{const t=Dt(e,pc(e));return GX(t)},mc);var YX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const JX=g.forwardRef((e,t)=>{const{className:n,value:r,onChange:o,onActiveChange:i,index:a,mask:s}=e,l=YX(e,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:c}=g.useContext(wt),u=c("otp"),d=typeof s=="string"?s:r,f=g.useRef(null);g.useImperativeHandle(t,()=>f.current);const h=m=>{o(a,m.target.value)},p=()=>{Nt(()=>{var m;const b=(m=f.current)===null||m===void 0?void 0:m.input;document.activeElement===b&&b&&b.select()})},v=m=>{const{key:b,ctrlKey:y,metaKey:C}=m;b==="ArrowLeft"?i(a-1):b==="ArrowRight"?i(a+1):b==="z"&&(y||C)?m.preventDefault():b==="Backspace"&&!r&&i(a-1),p()};return g.createElement("span",{className:`${u}-input-wrapper`,role:"presentation"},s&&r!==""&&r!==void 0&&g.createElement("span",{className:`${u}-mask-icon`,"aria-hidden":"true"},d),g.createElement(Fs,Object.assign({"aria-label":`OTP Input ${a+1}`,type:s===!0?"password":"text"},l,{ref:f,value:r,onInput:h,onFocus:p,onKeyDown:v,onMouseDown:p,onMouseUp:p,className:J(n,{[`${u}-mask-input`]:s})})))});var NT={},QX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Vf(e){return(e||"").split("")}const ZX=e=>{const{index:t,prefixCls:n,separator:r}=e,o=typeof r=="function"?r(t):r;return o?g.createElement("span",{className:`${n}-separator`},o):null},eY=g.forwardRef((e,t)=>{const{prefixCls:n,length:r=6,size:o,defaultValue:i,value:a,onChange:s,formatter:l,separator:c,variant:u,disabled:d,status:f,autoFocus:h,mask:p,type:v,onInput:m,inputMode:b}=e,y=QX(e,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]);if(NT.NODE_ENV!=="production"){const H=Wt("Input.OTP");NT.NODE_ENV!=="production"&&H(!(typeof p=="string"&&p.length>1),"usage","`mask` prop should be a single character.")}const{getPrefixCls:C,direction:x}=g.useContext(wt),S=C("otp",n),E=Vr(y,{aria:!0,data:!0,attr:!0}),[$,O,k]=XX(S),M=Wr(H=>o??H),T=g.useContext(qr),I=ac(T.status,f),R=g.useMemo(()=>Object.assign(Object.assign({},T),{status:I,hasFeedback:!1,feedbackIcon:null}),[T,I]),N=g.useRef(null),P=g.useRef({});g.useImperativeHandle(t,()=>({focus:()=>{var H;(H=P.current[0])===null||H===void 0||H.focus()},blur:()=>{var H;for(let W=0;W<r;W+=1)(H=P.current[W])===null||H===void 0||H.blur()},nativeElement:N.current}));const A=H=>l?l(H):H,[_,B]=g.useState(()=>Vf(A(i||"")));g.useEffect(()=>{a!==void 0&&B(Vf(a))},[a]);const F=qt(H=>{B(H),m&&m(H),s&&H.length===r&&H.every(W=>W)&&H.some((W,q)=>_[q]!==W)&&s(H.join(""))}),U=qt((H,W)=>{let q=de(_);for(let G=0;G<H;G+=1)q[G]||(q[G]="");W.length<=1?q[H]=W:q=q.slice(0,H).concat(Vf(W)),q=q.slice(0,r);for(let G=q.length-1;G>=0&&!q[G];G-=1)q.pop();const te=A(q.map(G=>G||" ").join(""));return q=Vf(te).map((G,re)=>G===" "&&!q[re]?q[re]:G),q}),K=(H,W)=>{var q;const te=U(H,W),G=Math.min(H+W.length,r-1);G!==H&&te[H]!==void 0&&((q=P.current[G])===null||q===void 0||q.focus()),F(te)},j=H=>{var W;(W=P.current[H])===null||W===void 0||W.focus()},D={variant:u,disabled:d,status:I,mask:p,type:v,inputMode:b};return $(g.createElement("div",Object.assign({},E,{ref:N,className:J(S,{[`${S}-sm`]:M==="small",[`${S}-lg`]:M==="large",[`${S}-rtl`]:x==="rtl"},k,O),role:"group"}),g.createElement(qr.Provider,{value:R},Array.from({length:r}).map((H,W)=>{const q=`otp-${W}`,te=_[W]||"";return g.createElement(g.Fragment,{key:q},g.createElement(JX,Object.assign({ref:G=>{P.current[W]=G},index:W,size:M,htmlSize:1,className:`${S}-input`,onChange:K,value:te,onActiveChange:j,autoFocus:W===0&&h},D)),W<r-1&&g.createElement(ZX,{separator:c,index:W,prefixCls:S}))}))))});var tY={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},nY={},rY=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:tY}))},TT=g.forwardRef(rY);nY.NODE_ENV!=="production"&&(TT.displayName="EyeInvisibleOutlined");var oY={},iY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const aY=e=>e?g.createElement(Tb,null):g.createElement(TT,null),sY={click:"onClick",hover:"onMouseOver"},IT=g.forwardRef((e,t)=>{const{disabled:n,action:r="click",visibilityToggle:o=!0,iconRender:i=aY,suffix:a}=e,s=g.useContext(Hr),l=n??s,c=typeof o=="object"&&o.visible!==void 0,[u,d]=w.useState(()=>c?o.visible:!1),f=w.useRef(null);g.useEffect(()=>{c&&d(o.visible)},[c,o]);const h=uT(f),p=()=>{var T;if(l)return;u&&h();const I=!u;d(I),typeof o=="object"&&((T=o.onVisibleChange)===null||T===void 0||T.call(o,I))},v=T=>{const I=sY[r]||"",R=i(u),N={[I]:p,className:`${T}-icon`,key:"passwordIcon",onMouseDown:P=>{P.preventDefault()},onMouseUp:P=>{P.preventDefault()}};return g.cloneElement(g.isValidElement(R)?R:g.createElement("span",null,R),N)},{className:m,prefixCls:b,inputPrefixCls:y,size:C}=e,x=iY(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:S}=g.useContext(wt),E=S("input",y),$=S("input-password",b),O=o&&v($),k=J($,m,{[`${$}-${C}`]:!!C}),M=Object.assign(Object.assign({},nr(x,["suffix","iconRender","visibilityToggle"])),{type:u?"text":"password",className:k,prefixCls:E,suffix:g.createElement(g.Fragment,null,O,a)});return C&&(M.size=C),g.createElement(Fs,Object.assign({ref:sr(t,f)},M))});oY.NODE_ENV!=="production"&&(IT.displayName="Input.Password");var lY={},cY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const PT=g.forwardRef((e,t)=>{const{prefixCls:n,inputPrefixCls:r,className:o,size:i,suffix:a,enterButton:s=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:f,onCompositionStart:h,onCompositionEnd:p,variant:v,onPressEnter:m}=e,b=cY(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:y,direction:C}=g.useContext(wt),x=g.useRef(!1),S=y("input-search",n),E=y("input",r),{compactSize:$}=Ca(S,C),O=Wr(D=>{var H;return(H=i??$)!==null&&H!==void 0?H:D}),k=g.useRef(null),M=D=>{D!=null&&D.target&&D.type==="click"&&d&&d(D.target.value,D,{source:"clear"}),f==null||f(D)},T=D=>{var H;document.activeElement===((H=k.current)===null||H===void 0?void 0:H.input)&&D.preventDefault()},I=D=>{var H,W;d&&d((W=(H=k.current)===null||H===void 0?void 0:H.input)===null||W===void 0?void 0:W.value,D,{source:"input"})},R=D=>{x.current||c||(m==null||m(D),I(D))},N=typeof s=="boolean"?g.createElement(Qv,null):null,P=`${S}-button`;let A;const _=s||{},B=_.type&&_.type.__ANT_BUTTON===!0;B||_.type==="button"?A=Io(_,Object.assign({onMouseDown:T,onClick:D=>{var H,W;(W=(H=_==null?void 0:_.props)===null||H===void 0?void 0:H.onClick)===null||W===void 0||W.call(H,D),I(D)},key:"enterButton"},B?{className:P,size:O}:{})):A=g.createElement(mo,{className:P,color:s?"primary":"default",size:O,disabled:u,key:"enterButton",onMouseDown:T,onClick:I,loading:c,icon:N,variant:v==="borderless"||v==="filled"||v==="underlined"?"text":s?"solid":void 0},s),l&&(A=[A,Io(l,{key:"addonAfter"})]);const F=J(S,{[`${S}-rtl`]:C==="rtl",[`${S}-${O}`]:!!O,[`${S}-with-button`]:!!s},o),U=D=>{x.current=!0,h==null||h(D)},K=D=>{x.current=!1,p==null||p(D)},j=Object.assign(Object.assign({},b),{className:F,prefixCls:E,type:"search",size:O,variant:v,onPressEnter:R,onCompositionStart:U,onCompositionEnd:K,addonAfter:A,suffix:a,onChange:M,disabled:u,_skipAddonWarning:!0});return g.createElement(Fs,Object.assign({ref:sr(k,t)},j))});lY.NODE_ENV!=="production"&&(PT.displayName="Search");var uY=`
|
|
453
|
+
min-height:0 !important;
|
|
454
|
+
max-height:none !important;
|
|
455
|
+
height:0 !important;
|
|
456
|
+
visibility:hidden !important;
|
|
457
|
+
overflow:hidden !important;
|
|
458
|
+
position:absolute !important;
|
|
459
|
+
z-index:-1000 !important;
|
|
460
|
+
top:0 !important;
|
|
461
|
+
right:0 !important;
|
|
462
|
+
pointer-events: none !important;
|
|
463
|
+
`,dY=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Ib={},Mr;function fY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Ib[n])return Ib[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=dY.map(function(c){return"".concat(c,":").concat(r.getPropertyValue(c))}).join(";"),l={sizingStyle:s,paddingSize:i,borderSize:a,boxSizing:o};return t&&n&&(Ib[n]=l),l}function hY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Mr||(Mr=document.createElement("textarea"),Mr.setAttribute("tab-index","-1"),Mr.setAttribute("aria-hidden","true"),Mr.setAttribute("name","hiddenTextarea"),document.body.appendChild(Mr)),e.getAttribute("wrap")?Mr.setAttribute("wrap",e.getAttribute("wrap")):Mr.removeAttribute("wrap");var o=fY(e,t),i=o.paddingSize,a=o.borderSize,s=o.boxSizing,l=o.sizingStyle;Mr.setAttribute("style","".concat(l,";").concat(uY)),Mr.value=e.value||e.placeholder||"";var c=void 0,u=void 0,d,f=Mr.scrollHeight;if(s==="border-box"?f+=a:s==="content-box"&&(f-=i),n!==null||r!==null){Mr.value=" ";var h=Mr.scrollHeight-i;n!==null&&(c=h*n,s==="border-box"&&(c=c+i+a),f=Math.max(c,f)),r!==null&&(u=h*r,s==="border-box"&&(u=u+i+a),d=f>u?"":"hidden",f=Math.min(u,f))}var p={height:f,overflowY:d,resize:"none"};return c&&(p.minHeight=c),u&&(p.maxHeight=u),p}var pY={},mY=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Pb=0,Ab=1,Rb=2,gY=g.forwardRef(function(e,t){var n=e,r=n.prefixCls,o=n.defaultValue,i=n.value,a=n.autoSize,s=n.onResize,l=n.className,c=n.style,u=n.disabled,d=n.onChange,f=n.onInternalAutoSize,h=st(n,mY),p=cn(o,{value:i,postState:function(H){return H??""}}),v=Y(p,2),m=v[0],b=v[1],y=function(H){b(H.target.value),d==null||d(H)},C=g.useRef();g.useImperativeHandle(t,function(){return{textArea:C.current}});var x=g.useMemo(function(){return a&&Ue(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),S=Y(x,2),E=S[0],$=S[1],O=!!a,k=g.useState(Rb),M=Y(k,2),T=M[0],I=M[1],R=g.useState(),N=Y(R,2),P=N[0],A=N[1],_=function(){I(Pb),pY.NODE_ENV==="test"&&(f==null||f())};Yt(function(){O&&_()},[i,E,$,O]),Yt(function(){if(T===Pb)I(Ab);else if(T===Ab){var D=hY(C.current,!1,E,$);I(Rb),A(D)}},[T]);var B=g.useRef(),F=function(){Nt.cancel(B.current)},U=function(H){T===Rb&&(s==null||s(H),a&&(F(),B.current=Nt(function(){_()})))};g.useEffect(function(){return F},[]);var K=O?P:null,j=V(V({},c),K);return(T===Pb||T===Ab)&&(j.overflowY="hidden",j.overflowX="hidden"),g.createElement(zr,{onResize:U,disabled:!(a||s)},g.createElement("textarea",he({},h,{ref:C,style:j,className:J(r,l,z({},"".concat(r,"-disabled"),u)),disabled:u,value:m,onChange:y})))}),vY=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],bY=w.forwardRef(function(e,t){var n,r=e.defaultValue,o=e.value,i=e.onFocus,a=e.onBlur,s=e.onChange,l=e.allowClear,c=e.maxLength,u=e.onCompositionStart,d=e.onCompositionEnd,f=e.suffix,h=e.prefixCls,p=h===void 0?"rc-textarea":h,v=e.showCount,m=e.count,b=e.className,y=e.style,C=e.disabled,x=e.hidden,S=e.classNames,E=e.styles,$=e.onResize,O=e.onClear,k=e.onPressEnter,M=e.readOnly,T=e.autoSize,I=e.onKeyDown,R=st(e,vY),N=cn(r,{value:o,defaultValue:r}),P=Y(N,2),A=P[0],_=P[1],B=A==null?"":String(A),F=w.useState(!1),U=Y(F,2),K=U[0],j=U[1],D=w.useRef(!1),H=w.useState(null),W=Y(H,2),q=W[0],te=W[1],G=w.useRef(null),re=w.useRef(null),oe=function(){var ke;return(ke=re.current)===null||ke===void 0?void 0:ke.textArea},ne=function(){oe().focus()};w.useImperativeHandle(t,function(){var Ae;return{resizableTextArea:re.current,focus:ne,blur:function(){oe().blur()},nativeElement:((Ae=G.current)===null||Ae===void 0?void 0:Ae.nativeElement)||oe()}}),w.useEffect(function(){j(function(Ae){return!C&&Ae})},[C]);var Z=w.useState(null),ae=Y(Z,2),ie=ae[0],X=ae[1];w.useEffect(function(){if(ie){var Ae;(Ae=oe()).setSelectionRange.apply(Ae,de(ie))}},[ie]);var ee=tT(m,v),le=(n=ee.max)!==null&&n!==void 0?n:c,ce=Number(le)>0,ue=ee.strategy(B),ge=!!le&&ue>le,ye=function(ke,Xe){var pe=Xe;!D.current&&ee.exceedFormatter&&ee.max&&ee.strategy(Xe)>ee.max&&(pe=ee.exceedFormatter(Xe,{max:ee.max}),Xe!==pe&&X([oe().selectionStart||0,oe().selectionEnd||0])),_(pe),Bf(ke.currentTarget,ke,s,pe)},$e=function(ke){D.current=!0,u==null||u(ke)},Ce=function(ke){D.current=!1,ye(ke,ke.currentTarget.value),d==null||d(ke)},se=function(ke){ye(ke,ke.target.value)},Se=function(ke){ke.key==="Enter"&&k&&k(ke),I==null||I(ke)},ze=function(ke){j(!0),i==null||i(ke)},Ge=function(ke){j(!1),a==null||a(ke)},Pe=function(ke){_(""),ne(),Bf(oe(),ke,s)},Oe=f,qe;ee.show&&(ee.showFormatter?qe=ee.showFormatter({value:B,count:ue,maxLength:le}):qe="".concat(ue).concat(ce?" / ".concat(le):""),Oe=w.createElement(w.Fragment,null,Oe,w.createElement("span",{className:J("".concat(p,"-data-count"),S==null?void 0:S.count),style:E==null?void 0:E.count},qe)));var Ne=function(ke){var Xe;$==null||$(ke),(Xe=oe())!==null&&Xe!==void 0&&Xe.style.height&&te(!0)},Fe=!T&&!v&&!l;return w.createElement(Sb,{ref:G,value:B,allowClear:l,handleReset:Pe,suffix:Oe,prefixCls:p,classNames:V(V({},S),{},{affixWrapper:J(S==null?void 0:S.affixWrapper,z(z({},"".concat(p,"-show-count"),v),"".concat(p,"-textarea-allow-clear"),l))}),disabled:C,focused:K,className:J(b,ge&&"".concat(p,"-out-of-range")),style:V(V({},y),q&&!Fe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof qe=="string"?qe:void 0}},hidden:x,readOnly:M,onClear:O},w.createElement(gY,he({},R,{autoSize:T,maxLength:c,onKeyDown:Se,onChange:se,onFocus:ze,onBlur:Ge,onCompositionStart:$e,onCompositionEnd:Ce,className:J(S==null?void 0:S.textarea),style:V(V({},E==null?void 0:E.textarea),{},{resize:y==null?void 0:y.resize}),disabled:C,prefixCls:p,onResize:Ne,ref:re,readOnly:M})))});const yY=e=>{const{componentCls:t,paddingLG:n}=e,r=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[r]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
|
|
464
|
+
&-allow-clear > ${t},
|
|
465
|
+
&-affix-wrapper${r}-has-feedback ${t}
|
|
466
|
+
`]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},CY=gn(["Input","TextArea"],e=>{const t=Dt(e,pc(e));return yY(t)},mc,{resetFont:!1});var SY={},xY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const wY=w.forwardRef((e,t)=>{var n;const{prefixCls:r,bordered:o=!0,size:i,disabled:a,status:s,allowClear:l,classNames:c,rootClassName:u,className:d,style:f,styles:h,variant:p,showCount:v,onMouseDown:m,onResize:b}=e,y=xY(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]);if(SY.NODE_ENV!=="production"){const{deprecated:ee}=Wt("TextArea");ee(!("bordered"in e),"bordered","variant")}const{getPrefixCls:C,direction:x,allowClear:S,autoComplete:E,className:$,style:O,classNames:k,styles:M}=xr("textArea"),T=g.useContext(Hr),I=a??T,{status:R,hasFeedback:N,feedbackIcon:P}=g.useContext(qr),A=ac(R,s),_=g.useRef(null);g.useImperativeHandle(t,()=>{var ee;return{resizableTextArea:(ee=_.current)===null||ee===void 0?void 0:ee.resizableTextArea,focus:le=>{var ce,ue;Cb((ue=(ce=_.current)===null||ce===void 0?void 0:ce.resizableTextArea)===null||ue===void 0?void 0:ue.textArea,le)},blur:()=>{var le;return(le=_.current)===null||le===void 0?void 0:le.blur()}}});const B=C("input",r),F=Po(B),[U,K,j]=yN(B,u),[D]=CY(B,F),{compactSize:H,compactItemClassnames:W}=Ca(B,x),q=Wr(ee=>{var le;return(le=i??H)!==null&&le!==void 0?le:ee}),[te,G]=Sf("textArea",p,o),re=cT(l??S),[oe,ne]=g.useState(!1),[Z,ae]=g.useState(!1),ie=ee=>{ne(!0),m==null||m(ee);const le=()=>{ne(!1),document.removeEventListener("mouseup",le)};document.addEventListener("mouseup",le)},X=ee=>{var le,ce;if(b==null||b(ee),oe&&typeof getComputedStyle=="function"){const ue=(ce=(le=_.current)===null||le===void 0?void 0:le.nativeElement)===null||ce===void 0?void 0:ce.querySelector("textarea");ue&&getComputedStyle(ue).resize==="both"&&ae(!0)}};return U(D(g.createElement(bY,Object.assign({autoComplete:E},y,{style:Object.assign(Object.assign({},O),f),styles:Object.assign(Object.assign({},M),h),disabled:I,allowClear:re,className:J(j,F,d,u,W,$,Z&&`${B}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},c),k),{textarea:J({[`${B}-sm`]:q==="small",[`${B}-lg`]:q==="large"},K,c==null?void 0:c.textarea,k.textarea,oe&&`${B}-mouse-active`),variant:J({[`${B}-${te}`]:G},Ea(B,A)),affixWrapper:J(`${B}-textarea-affix-wrapper`,{[`${B}-affix-wrapper-rtl`]:x==="rtl",[`${B}-affix-wrapper-sm`]:q==="small",[`${B}-affix-wrapper-lg`]:q==="large",[`${B}-textarea-show-count`]:v||((n=e.count)===null||n===void 0?void 0:n.show)},K)}),prefixCls:B,suffix:N&&g.createElement("span",{className:`${B}-textarea-suffix`},P),showCount:v,ref:_,onResize:X,onMouseDown:ie}))))}),Do=Fs;Do.Group=KX,Do.Search=PT,Do.TextArea=wY,Do.Password=IT,Do.OTP=eY;var EY={};let Gr=null,Pa=e=>e(),gc=[],vc={};function AT(){const{getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=vc,i=(e==null?void 0:e())||document.body;return{getContainer:()=>i,duration:t,rtl:n,maxCount:r,top:o}}const $Y=w.forwardRef((e,t)=>{const{messageConfig:n,sync:r}=e,{getPrefixCls:o}=w.useContext(wt),i=vc.prefixCls||o("message"),a=w.useContext(f7),[s,l]=I$(Object.assign(Object.assign(Object.assign({},n),{prefixCls:i}),a.message));return w.useImperativeHandle(t,()=>{const c=Object.assign({},s);return Object.keys(c).forEach(u=>{c[u]=(...d)=>(r(),s[u].apply(s,d))}),{instance:c,sync:r}}),l}),OY=w.forwardRef((e,t)=>{const[n,r]=w.useState(AT),o=()=>{r(AT)};w.useEffect(o,[]);const i=jg(),a=i.getRootPrefixCls(),s=i.getIconPrefixCls(),l=i.getTheme(),c=w.createElement($Y,{ref:t,sync:o,messageConfig:n});return w.createElement(ho,{prefixCls:a,iconPrefixCls:s,theme:l},i.holderRender?i.holderRender(c):c)}),Wf=()=>{if(!Gr){const e=document.createDocumentFragment(),t={fragment:e};Gr=t,Pa(()=>{Xg()(w.createElement(OY,{ref:r=>{const{instance:o,sync:i}=r||{};Promise.resolve().then(()=>{!t.instance&&o&&(t.instance=o,t.sync=i,Wf())})}}),e)});return}Gr.instance&&(gc.forEach(e=>{const{type:t,skipped:n}=e;if(!n)switch(t){case"open":{Pa(()=>{const r=Gr.instance.open(Object.assign(Object.assign({},vc),e.config));r==null||r.then(e.resolve),e.setCloseFn(r)});break}case"destroy":Pa(()=>{Gr==null||Gr.instance.destroy(e.key)});break;default:Pa(()=>{var r;const o=(r=Gr.instance)[t].apply(r,de(e.args));o==null||o.then(e.resolve),e.setCloseFn(o)})}}),gc=[])};function kY(e){vc=Object.assign(Object.assign({},vc),e),Pa(()=>{var t;(t=Gr==null?void 0:Gr.sync)===null||t===void 0||t.call(Gr)})}function MY(e){const t=Wg(n=>{let r;const o={type:"open",config:e,resolve:n,setCloseFn:i=>{r=i}};return gc.push(o),()=>{r?Pa(()=>{r()}):o.skipped=!0}});return Wf(),t}function NY(e,t){const n=jg();EY.NODE_ENV!=="production"&&!n.holderRender&&n$("message");const r=Wg(o=>{let i;const a={type:e,args:t,resolve:o,setCloseFn:s=>{i=s}};return gc.push(a),()=>{i?Pa(()=>{i()}):a.skipped=!0}});return Wf(),r}const TY=e=>{gc.push({type:"destroy",key:e}),Wf()},IY=["success","info","warning","error","loading"],RT={open:MY,destroy:TY,config:kY,useMessage:X5,_InternalPanelDoNotUseOrYouWillBeFired:B5};IY.forEach(e=>{RT[e]=(...t)=>NY(e,t)});var PY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const AY=Mk(e=>{const{prefixCls:t,className:n,closeIcon:r,closable:o,type:i,title:a,children:s,footer:l}=e,c=PY(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:u}=g.useContext(wt),d=u(),f=t||u("modal"),h=Po(d),[p,v,m]=gk(f,h),b=`${f}-confirm`;let y={};return i?y={closable:o??!1,title:"",footer:"",children:g.createElement(bk,Object.assign({},e,{prefixCls:f,confirmPrefixCls:b,rootPrefixCls:d,content:s}))}:y={closable:o??!0,title:a,footer:l!==null&&g.createElement(dk,Object.assign({},e)),children:s},p(g.createElement(fv,Object.assign({prefixCls:f,className:J(v,`${f}-pure-panel`,i&&b,i&&`${b}-${i}`,n,m,h)},c,{closeIcon:uk(f,r),closable:o},y)))});var RY={};function _T(e){return nc(xk(e))}const Nr=vk;Nr.useModal=d7,Nr.info=function(t){return nc(wk(t))},Nr.success=function(t){return nc(Ek(t))},Nr.error=function(t){return nc($k(t))},Nr.warning=_T,Nr.warn=_T,Nr.confirm=function(t){return nc(Ok(t))},Nr.destroyAll=function(){for(;wa.length;){const t=wa.pop();t&&t()}},Nr.config=a7,Nr._InternalPanelDoNotUseOrYouWillBeFired=AY,RY.NODE_ENV!=="production"&&(Nr.displayName="Modal");var _Y={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},DY=function(){var t=w.useRef([]),n=w.useRef(null);return w.useEffect(function(){var r=Date.now(),o=!1;t.current.forEach(function(i){if(i){o=!0;var a=i.style;a.transitionDuration=".3s, .3s, .3s, .06s",n.current&&r-n.current<100&&(a.transitionDuration="0s, 0s")}}),o&&(n.current=Date.now())}),t.current},LY={},DT=0,jY=LY.NODE_ENV!=="test"&&Gn();function zY(){var e;return jY?(e=DT,DT+=1):e="TEST_OR_SSR",e}const BY=(function(e){var t=g.useState(),n=Y(t,2),r=n[0],o=n[1];return g.useEffect(function(){o("rc_progress_".concat(zY()))},[]),e||r});var FY={},LT=function(t){var n=t.bg,r=t.children;return g.createElement("div",{style:{width:"100%",height:"100%",background:n}},r)};function jT(e,t){return Object.keys(e).map(function(n){var r=parseFloat(n),o="".concat(Math.floor(r*t),"%");return"".concat(e[n]," ").concat(o)})}var zT=g.forwardRef(function(e,t){var n=e.prefixCls,r=e.color,o=e.gradientId,i=e.radius,a=e.style,s=e.ptg,l=e.strokeLinecap,c=e.strokeWidth,u=e.size,d=e.gapDegree,f=r&&Ue(r)==="object",h=f?"#FFF":void 0,p=u/2,v=g.createElement("circle",{className:"".concat(n,"-circle-path"),r:i,cx:p,cy:p,stroke:h,strokeLinecap:l,strokeWidth:c,opacity:s===0?0:1,style:a,ref:t});if(!f)return v;var m="".concat(o,"-conic"),b=d?"".concat(180+d/2,"deg"):"0deg",y=jT(r,(360-d)/360),C=jT(r,1),x="conic-gradient(from ".concat(b,", ").concat(y.join(", "),")"),S="linear-gradient(to ".concat(d?"bottom":"top",", ").concat(C.join(", "),")");return g.createElement(g.Fragment,null,g.createElement("mask",{id:m},v),g.createElement("foreignObject",{x:0,y:0,width:u,height:u,mask:"url(#".concat(m,")")},g.createElement(LT,{bg:S},g.createElement(LT,{bg:x}))))});FY.NODE_ENV!=="production"&&(zT.displayName="PtgCircle");var bc=100,_b=function(t,n,r,o,i,a,s,l,c,u){var d=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,f=r/100*360*((360-a)/360),h=a===0?0:{bottom:0,top:180,left:90,right:-90}[s],p=(100-o)/100*n;c==="round"&&o!==100&&(p+=u/2,p>=n&&(p=n-.01));var v=bc/2;return{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:p+d,transform:"rotate(".concat(i+f+h,"deg)"),transformOrigin:"".concat(v,"px ").concat(v,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},HY={},VY=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function BT(e){var t=e??[];return Array.isArray(t)?t:[t]}var FT=function(t){var n=V(V({},_Y),t),r=n.id,o=n.prefixCls,i=n.steps,a=n.strokeWidth,s=n.trailWidth,l=n.gapDegree,c=l===void 0?0:l,u=n.gapPosition,d=n.trailColor,f=n.strokeLinecap,h=n.style,p=n.className,v=n.strokeColor,m=n.percent,b=st(n,VY),y=bc/2,C=BY(r),x="".concat(C,"-gradient"),S=y-a/2,E=Math.PI*2*S,$=c>0?90+c/2:-90,O=E*((360-c)/360),k=Ue(i)==="object"?i:{count:i,gap:2},M=k.count,T=k.gap,I=BT(m),R=BT(v),N=R.find(function(K){return K&&Ue(K)==="object"}),P=N&&Ue(N)==="object",A=P?"butt":f,_=_b(E,O,0,100,$,c,u,d,A,a),B=DY(),F=function(){var j=0;return I.map(function(D,H){var W=R[H]||R[R.length-1],q=_b(E,O,j,D,$,c,u,W,A,a);return j+=D,g.createElement(zT,{key:H,color:W,ptg:D,radius:S,prefixCls:o,gradientId:x,style:q,strokeLinecap:A,strokeWidth:a,gapDegree:c,ref:function(G){B[H]=G},size:bc})}).reverse()},U=function(){var j=Math.round(M*(I[0]/100)),D=100/M,H=0;return new Array(M).fill(null).map(function(W,q){var te=q<=j-1?R[0]:d,G=te&&Ue(te)==="object"?"url(#".concat(x,")"):void 0,re=_b(E,O,H,D,$,c,u,te,"butt",a,T);return H+=(O-re.strokeDashoffset+T)*100/O,g.createElement("circle",{key:q,className:"".concat(o,"-circle-path"),r:S,cx:y,cy:y,stroke:G,strokeWidth:a,opacity:1,style:re,ref:function(ne){B[q]=ne}})})};return g.createElement("svg",he({className:J("".concat(o,"-circle"),p),viewBox:"0 0 ".concat(bc," ").concat(bc),style:h,id:r,role:"presentation"},b),!M&&g.createElement("circle",{className:"".concat(o,"-circle-trail"),r:S,cx:y,cy:y,stroke:d,strokeLinecap:A,strokeWidth:s||a,style:_}),M?U():F())};HY.NODE_ENV!=="production"&&(FT.displayName="Circle");function Ui(e){return!e||e<0?0:e>100?100:e}function Uf({success:e,successPercent:t}){let n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const WY=({percent:e,success:t,successPercent:n})=>{const r=Ui(Uf({success:t,successPercent:n}));return[r,Ui(Ui(e)-r)]},UY=({success:e={},strokeColor:t})=>{const{strokeColor:n}=e;return[n||ms.green,t||null]},qf=(e,t,n)=>{var r,o,i,a;let s=-1,l=-1;if(t==="step"){const c=n.steps,u=n.strokeWidth;typeof e=="string"||typeof e>"u"?(s=e==="small"?2:14,l=u??8):typeof e=="number"?[s,l]=[e,e]:[s=14,l=8]=Array.isArray(e)?e:[e.width,e.height],s*=c}else if(t==="line"){const c=n==null?void 0:n.strokeWidth;typeof e=="string"||typeof e>"u"?l=c||(e==="small"?6:8):typeof e=="number"?[s,l]=[e,e]:[s=-1,l=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[s,l]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[s,l]=[e,e]:Array.isArray(e)&&(s=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,l=(a=(i=e[0])!==null&&i!==void 0?i:e[1])!==null&&a!==void 0?a:120));return[s,l]},qY=3,KY=e=>qY/e*100,GY=e=>{const{prefixCls:t,trailColor:n=null,strokeLinecap:r="round",gapPosition:o,gapDegree:i,width:a=120,type:s,children:l,success:c,size:u=a,steps:d}=e,[f,h]=qf(u,"circle");let{strokeWidth:p}=e;p===void 0&&(p=Math.max(KY(f),6));const v={width:f,height:h,fontSize:f*.15+6},m=g.useMemo(()=>{if(i||i===0)return i;if(s==="dashboard")return 75},[i,s]),b=WY(e),y=o||s==="dashboard"&&"bottom"||void 0,C=Object.prototype.toString.call(e.strokeColor)==="[object Object]",x=UY({success:c,strokeColor:e.strokeColor}),S=J(`${t}-inner`,{[`${t}-circle-gradient`]:C}),E=g.createElement(FT,{steps:d,percent:d?b[1]:b,strokeWidth:p,trailWidth:p,strokeColor:d?x[1]:x,strokeLinecap:r,trailColor:n,prefixCls:t,gapDegree:m,gapPosition:y}),$=f<=20,O=g.createElement("div",{className:S,style:v},E,!$&&l);return $?g.createElement(hn,{title:l},O):O},Kf="--progress-line-stroke-color",HT="--progress-percent",VT=e=>{const t=e?"100%":"-100%";return new It(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},XY=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:Object.assign(Object.assign({},Pn(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${Kf})`]},height:"100%",width:`calc(1 / var(${HT}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[n]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${Q(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:VT(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:VT(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},YY=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[n]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},JY=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},QY=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},ZY=gn("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),n=Dt(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[XY(n),YY(n),JY(n),QY(n)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}));var eJ={},tJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const nJ=e=>{let t=[];return Object.keys(e).forEach(n=>{const r=Number.parseFloat(n.replace(/%/g,""));Number.isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((n,r)=>n.key-r.key),t.map(({key:n,value:r})=>`${r} ${n}%`).join(", ")},rJ=(e,t)=>{const{from:n=ms.blue,to:r=ms.blue,direction:o=t==="rtl"?"to left":"to right"}=e,i=tJ(e,["from","to","direction"]);if(Object.keys(i).length!==0){const s=nJ(i),l=`linear-gradient(${o}, ${s})`;return{background:l,[Kf]:l}}const a=`linear-gradient(${o}, ${n}, ${r})`;return{background:a,[Kf]:a}},oJ=e=>{const{prefixCls:t,direction:n,percent:r,size:o,strokeWidth:i,strokeColor:a,strokeLinecap:s="round",children:l,trailColor:c=null,percentPosition:u,success:d}=e,{align:f,type:h}=u,p=a&&typeof a!="string"?rJ(a,n):{[Kf]:a,background:a},v=s==="square"||s==="butt"?0:void 0,m=o??[-1,i||(o==="small"?6:8)],[b,y]=qf(m,"line",{strokeWidth:i});eJ.NODE_ENV!=="production"&&Wt("Progress").deprecated(!("strokeWidth"in e),"strokeWidth","size");const C={backgroundColor:c||void 0,borderRadius:v},x=Object.assign(Object.assign({width:`${Ui(r)}%`,height:y,borderRadius:v},p),{[HT]:Ui(r)/100}),S=Uf(e),E={width:`${Ui(S)}%`,height:y,borderRadius:v,backgroundColor:d==null?void 0:d.strokeColor},$={width:b<0?"100%":b},O=g.createElement("div",{className:`${t}-inner`,style:C},g.createElement("div",{className:J(`${t}-bg`,`${t}-bg-${h}`),style:x},h==="inner"&&l),S!==void 0&&g.createElement("div",{className:`${t}-success-bg`,style:E})),k=h==="outer"&&f==="start",M=h==="outer"&&f==="end";return h==="outer"&&f==="center"?g.createElement("div",{className:`${t}-layout-bottom`},O,l):g.createElement("div",{className:`${t}-outer`,style:$},k&&l,O,M&&l)},iJ=e=>{const{size:t,steps:n,rounding:r=Math.round,percent:o=0,strokeWidth:i=8,strokeColor:a,trailColor:s=null,prefixCls:l,children:c}=e,u=r(n*(o/100)),f=t??[t==="small"?2:14,i],[h,p]=qf(f,"step",{steps:n,strokeWidth:i}),v=h/n,m=Array.from({length:n});for(let b=0;b<n;b++){const y=Array.isArray(a)?a[b]:a;m[b]=g.createElement("div",{key:b,className:J(`${l}-steps-item`,{[`${l}-steps-item-active`]:b<=u-1}),style:{backgroundColor:b<=u-1?y:s,width:v,height:p}})}return g.createElement("div",{className:`${l}-steps-outer`},m,c)};var Gf={},aJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const sJ=["normal","exception","active","success"],WT=g.forwardRef((e,t)=>{const{prefixCls:n,className:r,rootClassName:o,steps:i,strokeColor:a,percent:s=0,size:l="default",showInfo:c=!0,type:u="line",status:d,format:f,style:h,percentPosition:p={}}=e,v=aJ(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:m="end",type:b="outer"}=p,y=Array.isArray(a)?a[0]:a,C=typeof a=="string"||Array.isArray(a)?a:void 0,x=g.useMemo(()=>{if(y){const F=typeof y=="string"?y:Object.values(y)[0];return new Ut(F).isLight()}return!1},[a]),S=g.useMemo(()=>{var F,U;const K=Uf(e);return Number.parseInt(K!==void 0?(F=K??0)===null||F===void 0?void 0:F.toString():(U=s??0)===null||U===void 0?void 0:U.toString(),10)},[s,e.success,e.successPercent]),E=g.useMemo(()=>!sJ.includes(d)&&S>=100?"success":d||"normal",[d,S]),{getPrefixCls:$,direction:O,progress:k}=g.useContext(wt),M=$("progress",n),[T,I,R]=ZY(M),N=u==="line",P=N&&!i,A=g.useMemo(()=>{if(!c)return null;const F=Uf(e);let U;const K=f||(D=>`${D}%`),j=N&&x&&b==="inner";return b==="inner"||f||E!=="exception"&&E!=="success"?U=K(Ui(s),Ui(F)):E==="exception"?U=N?g.createElement(ws,null):g.createElement(zi,null):E==="success"&&(U=N?g.createElement(Vd,null):g.createElement(Yv,null)),g.createElement("span",{className:J(`${M}-text`,{[`${M}-text-bright`]:j,[`${M}-text-${m}`]:P,[`${M}-text-${b}`]:P}),title:typeof U=="string"?U:void 0},U)},[c,s,S,E,u,M,f]);if(Gf.NODE_ENV!=="production"){const F=Wt("Progress");F.deprecated(!("successPercent"in e),"successPercent","success.percent"),F.deprecated(!("width"in e),"width","size"),(u==="circle"||u==="dashboard")&&(Array.isArray(l)?Gf.NODE_ENV!=="production"&&F(!1,"usage",'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.'):typeof l=="object"&&Gf.NODE_ENV!=="production"&&F(!1,"usage",'Type "circle" and "dashboard" do not accept object as `size`, please use number or preset size instead.')),e.success&&"progress"in e.success&&F.deprecated(!1,"success.progress","success.percent")}let _;u==="line"?_=i?g.createElement(iJ,Object.assign({},e,{strokeColor:C,prefixCls:M,steps:typeof i=="object"?i.count:i}),A):g.createElement(oJ,Object.assign({},e,{strokeColor:y,prefixCls:M,direction:O,percentPosition:{align:m,type:b}}),A):(u==="circle"||u==="dashboard")&&(_=g.createElement(GY,Object.assign({},e,{strokeColor:y,prefixCls:M,progressStatus:E}),A));const B=J(M,`${M}-status-${E}`,{[`${M}-${u==="dashboard"&&"circle"||u}`]:u!=="line",[`${M}-inline-circle`]:u==="circle"&&qf(l,"circle")[0]<=20,[`${M}-line`]:P,[`${M}-line-align-${m}`]:P,[`${M}-line-position-${b}`]:P,[`${M}-steps`]:i,[`${M}-show-info`]:c,[`${M}-${l}`]:typeof l=="string",[`${M}-rtl`]:O==="rtl"},k==null?void 0:k.className,r,o,I,R);return T(g.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},k==null?void 0:k.style),h),className:B,role:"progressbar","aria-valuenow":S,"aria-valuemin":0,"aria-valuemax":100},nr(v,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),_))});Gf.NODE_ENV!=="production"&&(WT.displayName="Progress");var lJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},cJ={},uJ=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:lJ}))},UT=g.forwardRef(uJ);cJ.NODE_ENV!=="production"&&(UT.displayName="DeleteOutlined");const Db=(function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",i=o.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim();if(/^\*(\/\*)?$/.test(a))return!0;if(s.charAt(0)==="."){var l=r.toLowerCase(),c=s.toLowerCase(),u=[c];return(c===".jpg"||c===".jpeg")&&(u=[".jpg",".jpeg"]),u.some(function(d){return l.endsWith(d)})}return/\/\*$/.test(s)?i===s.replace(/\/.*$/,""):o===s?!0:/^\w+$/.test(s)?(ft(!1,"Upload takes an invalidate 'accept' type '".concat(s,"'.Skip for check.")),!0):!1})}return!0});function dJ(e,t){var n="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),r=new Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}function qT(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function KT(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(i){i.total>0&&(i.percent=i.loaded/i.total*100),e.onProgress(i)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var i=e.data[o];if(Array.isArray(i)){i.forEach(function(a){n.append("".concat(o,"[]"),a)});return}n.append(o,i)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(i){e.onError(i)},t.onload=function(){return t.status<200||t.status>=300?e.onError(dJ(e,t),qT(t)):e.onSuccess(qT(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(o){r[o]!==null&&t.setRequestHeader(o,r[o])}),t.send(n),{abort:function(){t.abort()}}}var fJ=(function(){var e=lr(zt().mark(function t(n,r){var o,i,a,s,l,c,u,d;return zt().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:c=function(){return c=lr(zt().mark(function v(m){return zt().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return",new Promise(function(C){m.file(function(x){r(x)?(m.fullPath&&!x.webkitRelativePath&&(Object.defineProperties(x,{webkitRelativePath:{writable:!0}}),x.webkitRelativePath=m.fullPath.replace(/^\//,""),Object.defineProperties(x,{webkitRelativePath:{writable:!1}})),C(x)):C(null)})}));case 1:case"end":return y.stop()}},v)})),c.apply(this,arguments)},l=function(v){return c.apply(this,arguments)},s=function(){return s=lr(zt().mark(function v(m){var b,y,C,x,S;return zt().wrap(function($){for(;;)switch($.prev=$.next){case 0:b=m.createReader(),y=[];case 2:return $.next=5,new Promise(function(O){b.readEntries(O,function(){return O([])})});case 5:if(C=$.sent,x=C.length,x){$.next=9;break}return $.abrupt("break",12);case 9:for(S=0;S<x;S++)y.push(C[S]);$.next=2;break;case 12:return $.abrupt("return",y);case 13:case"end":return $.stop()}},v)})),s.apply(this,arguments)},a=function(v){return s.apply(this,arguments)},o=[],i=[],n.forEach(function(p){return i.push(p.webkitGetAsEntry())}),u=(function(){var p=lr(zt().mark(function v(m,b){var y,C;return zt().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m){S.next=2;break}return S.abrupt("return");case 2:if(m.path=b||"",!m.isFile){S.next=10;break}return S.next=6,l(m);case 6:y=S.sent,y&&o.push(y),S.next=15;break;case 10:if(!m.isDirectory){S.next=15;break}return S.next=13,a(m);case 13:C=S.sent,i.push.apply(i,de(C));case 15:case"end":return S.stop()}},v)}));return function(m,b){return p.apply(this,arguments)}})(),d=0;case 9:if(!(d<i.length)){h.next=15;break}return h.next=12,u(i[d]);case 12:d++,h.next=9;break;case 15:return h.abrupt("return",o);case 16:case"end":return h.stop()}},t)}));return function(n,r){return e.apply(this,arguments)}})(),hJ=+new Date,pJ=0;function Lb(){return"rc-upload-".concat(hJ,"-").concat(++pJ)}var mJ=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],gJ=(function(e){io(n,e);var t=ao(n);function n(){var r;dn(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),z(ct(r),"state",{uid:Lb()}),z(ct(r),"reqs",{}),z(ct(r),"fileInput",void 0),z(ct(r),"_isMounted",void 0),z(ct(r),"onChange",function(s){var l=r.props,c=l.accept,u=l.directory,d=s.target.files,f=de(d).filter(function(h){return!u||Db(h,c)});r.uploadFiles(f),r.reset()}),z(ct(r),"onClick",function(s){var l=r.fileInput;if(l){var c=s.target,u=r.props.onClick;if(c&&c.tagName==="BUTTON"){var d=l.parentNode;d.focus(),c.blur()}l.click(),u&&u(s)}}),z(ct(r),"onKeyDown",function(s){s.key==="Enter"&&r.onClick(s)}),z(ct(r),"onDataTransferFiles",(function(){var s=lr(zt().mark(function l(c,u){var d,f,h,p,v,m,b;return zt().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:if(d=r.props,f=d.multiple,h=d.accept,p=d.directory,v=de(c.items||[]),m=de(c.files||[]),(m.length>0||v.some(function(x){return x.kind==="file"}))&&(u==null||u()),!p){C.next=11;break}return C.next=7,fJ(Array.prototype.slice.call(v),function(x){return Db(x,r.props.accept)});case 7:m=C.sent,r.uploadFiles(m),C.next=14;break;case 11:b=de(m).filter(function(x){return Db(x,h)}),f===!1&&(b=m.slice(0,1)),r.uploadFiles(b);case 14:case"end":return C.stop()}},l)}));return function(l,c){return s.apply(this,arguments)}})()),z(ct(r),"onFilePaste",(function(){var s=lr(zt().mark(function l(c){var u,d;return zt().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=r.props.pastable,u){h.next=3;break}return h.abrupt("return");case 3:if(c.type!=="paste"){h.next=6;break}return d=c.clipboardData,h.abrupt("return",r.onDataTransferFiles(d,function(){c.preventDefault()}));case 6:case"end":return h.stop()}},l)}));return function(l){return s.apply(this,arguments)}})()),z(ct(r),"onFileDragOver",function(s){s.preventDefault()}),z(ct(r),"onFileDrop",(function(){var s=lr(zt().mark(function l(c){var u;return zt().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c.preventDefault(),c.type!=="drop"){f.next=4;break}return u=c.dataTransfer,f.abrupt("return",r.onDataTransferFiles(u));case 4:case"end":return f.stop()}},l)}));return function(l){return s.apply(this,arguments)}})()),z(ct(r),"uploadFiles",function(s){var l=de(s),c=l.map(function(u){return u.uid=Lb(),r.processFile(u,l)});Promise.all(c).then(function(u){var d=r.props.onBatchStart;d==null||d(u.map(function(f){var h=f.origin,p=f.parsedFile;return{file:h,parsedFile:p}})),u.filter(function(f){return f.parsedFile!==null}).forEach(function(f){r.post(f)})})}),z(ct(r),"processFile",(function(){var s=lr(zt().mark(function l(c,u){var d,f,h,p,v,m,b,y,C;return zt().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(d=r.props.beforeUpload,f=c,!d){S.next=14;break}return S.prev=3,S.next=6,d(c,u);case 6:f=S.sent,S.next=12;break;case 9:S.prev=9,S.t0=S.catch(3),f=!1;case 12:if(f!==!1){S.next=14;break}return S.abrupt("return",{origin:c,parsedFile:null,action:null,data:null});case 14:if(h=r.props.action,typeof h!="function"){S.next=21;break}return S.next=18,h(c);case 18:p=S.sent,S.next=22;break;case 21:p=h;case 22:if(v=r.props.data,typeof v!="function"){S.next=29;break}return S.next=26,v(c);case 26:m=S.sent,S.next=30;break;case 29:m=v;case 30:return b=(Ue(f)==="object"||typeof f=="string")&&f?f:c,b instanceof File?y=b:y=new File([b],c.name,{type:c.type}),C=y,C.uid=c.uid,S.abrupt("return",{origin:c,data:m,parsedFile:C,action:p});case 35:case"end":return S.stop()}},l,null,[[3,9]])}));return function(l,c){return s.apply(this,arguments)}})()),z(ct(r),"saveFileInput",function(s){r.fileInput=s}),r}return fn(n,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var i=this.props.pastable;i&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!i&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var i=this,a=o.data,s=o.origin,l=o.action,c=o.parsedFile;if(this._isMounted){var u=this.props,d=u.onStart,f=u.customRequest,h=u.name,p=u.headers,v=u.withCredentials,m=u.method,b=s.uid,y=f||KT,C={action:l,filename:h,data:a,file:c,headers:p,withCredentials:v,method:m||"post",onProgress:function(S){var E=i.props.onProgress;E==null||E(S,c)},onSuccess:function(S,E){var $=i.props.onSuccess;$==null||$(S,c,E),delete i.reqs[b]},onError:function(S,E){var $=i.props.onError;$==null||$(S,E,c),delete i.reqs[b]}};d(s),this.reqs[b]=y(C,{defaultRequest:KT})}}},{key:"reset",value:function(){this.setState({uid:Lb()})}},{key:"abort",value:function(o){var i=this.reqs;if(o){var a=o.uid?o.uid:o;i[a]&&i[a].abort&&i[a].abort(),delete i[a]}else Object.keys(i).forEach(function(s){i[s]&&i[s].abort&&i[s].abort(),delete i[s]})}},{key:"render",value:function(){var o=this.props,i=o.component,a=o.prefixCls,s=o.className,l=o.classNames,c=l===void 0?{}:l,u=o.disabled,d=o.id,f=o.name,h=o.style,p=o.styles,v=p===void 0?{}:p,m=o.multiple,b=o.accept,y=o.capture,C=o.children,x=o.directory,S=o.folder,E=o.openFileDialogOnClick,$=o.onMouseEnter,O=o.onMouseLeave,k=o.hasControlInside,M=st(o,mJ),T=J(z(z(z({},a,!0),"".concat(a,"-disabled"),u),s,s)),I=x||S?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},R=u?{}:{onClick:E?this.onClick:function(){},onKeyDown:E?this.onKeyDown:function(){},onMouseEnter:$,onMouseLeave:O,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:k?void 0:"0"};return w.createElement(i,he({},R,{className:T,role:k?void 0:"button",style:h}),w.createElement("input",he({},Vr(M,{aria:!0,data:!0}),{id:d,name:f,disabled:u,type:"file",ref:this.saveFileInput,onClick:function(P){return P.stopPropagation()},key:this.state.uid,style:V({display:"none"},v.input),className:c.input,accept:b},I,{multiple:m,onChange:this.onChange},y!=null?{capture:y}:{})),C)}}]),n})(w.Component);function jb(){}var zb=(function(e){io(n,e);var t=ao(n);function n(){var r;dn(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),z(ct(r),"uploader",void 0),z(ct(r),"saveUploader",function(s){r.uploader=s}),r}return fn(n,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return w.createElement(gJ,he({},this.props,{ref:this.saveUploader}))}}]),n})(w.Component);z(zb,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:jb,onError:jb,onSuccess:jb,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const vJ=e=>{const{componentCls:t,iconCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${Q(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:e.padding},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${Q(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
467
|
+
&:not(${t}-disabled):hover,
|
|
468
|
+
&-hover:not(${t}-disabled)
|
|
469
|
+
`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${Q(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${n},
|
|
470
|
+
p${t}-text,
|
|
471
|
+
p${t}-hint
|
|
472
|
+
`]:{color:e.colorTextDisabled}}}}}},bJ=e=>{const{componentCls:t,iconCls:n,fontSize:r,lineHeight:o,calc:i}=e,a=`${t}-list-item`,s=`${a}-actions`,l=`${a}-action`;return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},Rd()),{lineHeight:e.lineHeight,[a]:{position:"relative",height:i(e.lineHeight).mul(r).equal(),marginTop:e.marginXS,fontSize:r,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,borderRadius:e.borderRadiusSM,"&:hover":{backgroundColor:e.controlItemBgHover},[`${a}-name`]:Object.assign(Object.assign({},va),{padding:`0 ${Q(e.paddingXS)}`,lineHeight:o,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[s]:{whiteSpace:"nowrap",[l]:{opacity:0},[n]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[`
|
|
473
|
+
${l}:focus-visible,
|
|
474
|
+
&.picture ${l}
|
|
475
|
+
`]:{opacity:1}},[`${t}-icon ${n}`]:{color:e.colorIcon,fontSize:r},[`${a}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:i(r).add(e.paddingXS).equal(),fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${a}:hover ${l}`]:{opacity:1},[`${a}-error`]:{color:e.colorError,[`${a}-name, ${t}-icon ${n}`]:{color:e.colorError},[s]:{[`${n}, ${n}:hover`]:{color:e.colorError},[l]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},yJ=e=>{const{componentCls:t}=e,n=new It("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),r=new It("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),o=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${o}-appear, ${o}-enter, ${o}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${o}-appear, ${o}-enter`]:{animationName:n},[`${o}-leave`]:{animationName:r}}},{[`${t}-wrapper`]:lO(e)},n,r]},CJ=e=>{const{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:o,calc:i}=e,a=`${t}-list`,s=`${a}-item`;return{[`${t}-wrapper`]:{[`
|
|
476
|
+
${a}${a}-picture,
|
|
477
|
+
${a}${a}-picture-card,
|
|
478
|
+
${a}${a}-picture-circle
|
|
479
|
+
`]:{[s]:{position:"relative",height:i(r).add(i(e.lineWidth).mul(2)).add(i(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${s}-thumbnail`]:Object.assign(Object.assign({},va),{width:r,height:r,lineHeight:Q(i(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${s}-progress`]:{bottom:o,width:`calc(100% - ${Q(i(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:i(r).add(e.paddingXS).equal()}},[`${s}-error`]:{borderColor:e.colorError,[`${s}-thumbnail ${n}`]:{[`svg path[fill='${gs[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${gs.primary}']`]:{fill:e.colorError}}},[`${s}-uploading`]:{borderStyle:"dashed",[`${s}-name`]:{marginBottom:o}}},[`${a}${a}-picture-circle ${s}`]:{[`&, &::before, ${s}-thumbnail`]:{borderRadius:"50%"}}}}},SJ=e=>{const{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:o,calc:i}=e,a=`${t}-list`,s=`${a}-item`,l=e.uploadPicCardSize;return{[`
|
|
480
|
+
${t}-wrapper${t}-picture-card-wrapper,
|
|
481
|
+
${t}-wrapper${t}-picture-circle-wrapper
|
|
482
|
+
`]:Object.assign(Object.assign({},Rd()),{display:"block",[`${t}${t}-select`]:{width:l,height:l,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${Q(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${a}${a}-picture-card, ${a}${a}-picture-circle`]:{display:"flex",flexWrap:"wrap","@supports not (gap: 1px)":{"& > *":{marginBlockEnd:e.marginXS,marginInlineEnd:e.marginXS}},"@supports (gap: 1px)":{gap:e.marginXS},[`${a}-item-container`]:{display:"inline-block",width:l,height:l,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[s]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${Q(i(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${Q(i(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${s}:hover`]:{[`&::before, ${s}-actions`]:{opacity:1}},[`${s}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`
|
|
483
|
+
${n}-eye,
|
|
484
|
+
${n}-download,
|
|
485
|
+
${n}-delete
|
|
486
|
+
`]:{zIndex:10,width:r,margin:`0 ${Q(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${Q(i(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${Q(i(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},xJ=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},wJ=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},Pn(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},EJ=gn("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:o,calc:i}=e,a=Dt(e,{uploadThumbnailSize:i(t).mul(2).equal(),uploadProgressOffset:i(i(n).div(2)).add(r).equal(),uploadPicCardSize:o});return[wJ(a),vJ(a),CJ(a),SJ(a),bJ(a),yJ(a),xJ(a),sO(a)]},e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}));var $J={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},OJ={},kJ=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:$J}))},GT=g.forwardRef(kJ);OJ.NODE_ENV!=="production"&&(GT.displayName="FileTwoTone");var MJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},NJ={},TJ=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:MJ}))},XT=g.forwardRef(TJ);NJ.NODE_ENV!=="production"&&(XT.displayName="PaperClipOutlined");var IJ={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},PJ={},AJ=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:IJ}))},YT=g.forwardRef(AJ);PJ.NODE_ENV!=="production"&&(YT.displayName="PictureTwoTone");function Xf(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function Yf(e,t){const n=de(t),r=n.findIndex(({uid:o})=>o===e.uid);return r===-1?n.push(e):n[r]=e,n}function Bb(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function RJ(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(o=>o[n]!==e[n]);return r.length===t.length?null:r}const _J=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},JT=e=>e.indexOf("image/")===0,DJ=e=>{if(e.type&&!e.thumbUrl)return JT(e.type);const t=e.thumbUrl||e.url||"",n=_J(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},qi=200;function LJ(e){return new Promise(t=>{if(!e.type||!JT(e.type)){t("");return}const n=document.createElement("canvas");n.width=qi,n.height=qi,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${qi}px; height: ${qi}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:i,height:a}=o;let s=qi,l=qi,c=0,u=0;i>a?(l=a*(qi/i),u=-(l-s)/2):(s=i*(qi/a),c=-(s-l)/2),r.drawImage(o,c,u,s,l);const d=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(d)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const i=new FileReader;i.onload=()=>{i.result&&typeof i.result=="string"&&(o.src=i.result)},i.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const i=new FileReader;i.onload=()=>{i.result&&t(i.result)},i.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var jJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},zJ={},BJ=function(t,n){return g.createElement(vn,he({},t,{ref:n,icon:jJ}))},QT=g.forwardRef(BJ);zJ.NODE_ENV!=="production"&&(QT.displayName="DownloadOutlined");const FJ=g.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:o,file:i,items:a,progress:s,iconRender:l,actionIconRender:c,itemRender:u,isImgUrl:d,showPreviewIcon:f,showRemoveIcon:h,showDownloadIcon:p,previewIcon:v,removeIcon:m,downloadIcon:b,extra:y,onPreview:C,onDownload:x,onClose:S},E)=>{var $,O;const{status:k}=i,[M,T]=g.useState(k);g.useEffect(()=>{k!=="removed"&&T(k)},[k]);const[I,R]=g.useState(!1);g.useEffect(()=>{const Z=setTimeout(()=>{R(!0)},300);return()=>{clearTimeout(Z)}},[]);const N=l(i);let P=g.createElement("div",{className:`${e}-icon`},N);if(o==="picture"||o==="picture-card"||o==="picture-circle")if(M==="uploading"||!i.thumbUrl&&!i.url){const Z=J(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:M!=="uploading"});P=g.createElement("div",{className:Z},N)}else{const Z=d!=null&&d(i)?g.createElement("img",{src:i.thumbUrl||i.url,alt:i.name,className:`${e}-list-item-image`,crossOrigin:i.crossOrigin}):N,ae=J(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:d&&!d(i)});P=g.createElement("a",{className:ae,onClick:ie=>C(i,ie),href:i.url||i.thumbUrl,target:"_blank",rel:"noopener noreferrer"},Z)}const A=J(`${e}-list-item`,`${e}-list-item-${M}`),_=typeof i.linkProps=="string"?JSON.parse(i.linkProps):i.linkProps,B=(typeof h=="function"?h(i):h)?c((typeof m=="function"?m(i):m)||g.createElement(UT,null),()=>S(i),e,r.removeFile,!0):null,F=(typeof p=="function"?p(i):p)&&M==="done"?c((typeof b=="function"?b(i):b)||g.createElement(QT,null),()=>x(i),e,r.downloadFile):null,U=o!=="picture-card"&&o!=="picture-circle"&&g.createElement("span",{key:"download-delete",className:J(`${e}-list-item-actions`,{picture:o==="picture"})},F,B),K=typeof y=="function"?y(i):y,j=K&&g.createElement("span",{className:`${e}-list-item-extra`},K),D=J(`${e}-list-item-name`),H=i.url?g.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:D,title:i.name},_,{href:i.url,onClick:Z=>C(i,Z)}),i.name,j):g.createElement("span",{key:"view",className:D,onClick:Z=>C(i,Z),title:i.name},i.name,j),W=(typeof f=="function"?f(i):f)&&(i.url||i.thumbUrl)?g.createElement("a",{href:i.url||i.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:Z=>C(i,Z),title:r.previewFile},typeof v=="function"?v(i):v||g.createElement(Tb,null)):null,q=(o==="picture-card"||o==="picture-circle")&&M!=="uploading"&&g.createElement("span",{className:`${e}-list-item-actions`},W,M==="done"&&F,B),{getPrefixCls:te}=g.useContext(wt),G=te(),re=g.createElement("div",{className:A},P,H,U,q,I&&g.createElement(Er,{motionName:`${G}-fade`,visible:M==="uploading",motionDeadline:2e3},({className:Z})=>{const ae="percent"in i?g.createElement(WT,Object.assign({type:"line",percent:i.percent,"aria-label":i["aria-label"],"aria-labelledby":i["aria-labelledby"]},s)):null;return g.createElement("div",{className:J(`${e}-list-item-progress`,Z)},ae)})),oe=i.response&&typeof i.response=="string"?i.response:(($=i.error)===null||$===void 0?void 0:$.statusText)||((O=i.error)===null||O===void 0?void 0:O.message)||r.uploadError,ne=M==="error"?g.createElement(hn,{title:oe,getPopupContainer:Z=>Z.parentNode},re):re;return g.createElement("div",{className:J(`${e}-list-item-container`,t),style:n,ref:E},u?u(ne,i,a,{download:x.bind(null,i),preview:C.bind(null,i),remove:S.bind(null,i)}):ne)});var HJ={};const VJ=(e,t)=>{const{listType:n="text",previewFile:r=LJ,onPreview:o,onDownload:i,onRemove:a,locale:s,iconRender:l,isImageUrl:c=DJ,prefixCls:u,items:d=[],showPreviewIcon:f=!0,showRemoveIcon:h=!0,showDownloadIcon:p=!1,removeIcon:v,previewIcon:m,downloadIcon:b,extra:y,progress:C={size:[-1,2],showInfo:!1},appendAction:x,appendActionVisible:S=!0,itemRender:E,disabled:$}=e,[,O]=$$(),[k,M]=g.useState(!1),T=["picture-card","picture-circle"].includes(n);g.useEffect(()=>{n.startsWith("picture")&&(d||[]).forEach(D=>{!(D.originFileObj instanceof File||D.originFileObj instanceof Blob)||D.thumbUrl!==void 0||(D.thumbUrl="",r==null||r(D.originFileObj).then(H=>{D.thumbUrl=H||"",O()}))})},[n,d,r]),g.useEffect(()=>{M(!0)},[]);const I=(D,H)=>{if(o)return H==null||H.preventDefault(),o(D)},R=D=>{typeof i=="function"?i(D):D.url&&window.open(D.url)},N=D=>{a==null||a(D)},P=D=>{if(l)return l(D,n);const H=D.status==="uploading";if(n.startsWith("picture")){const W=n==="picture"?g.createElement(Es,null):s.uploading,q=c!=null&&c(D)?g.createElement(YT,null):g.createElement(GT,null);return H?W:q}return H?g.createElement(Es,null):g.createElement(XT,null)},A=(D,H,W,q,te)=>{const G={type:"text",size:"small",title:q,onClick:re=>{var oe,ne;H(),g.isValidElement(D)&&((ne=(oe=D.props).onClick)===null||ne===void 0||ne.call(oe,re))},className:`${W}-list-item-action`,disabled:te?$:!1};return g.isValidElement(D)?g.createElement(mo,Object.assign({},G,{icon:Io(D,Object.assign(Object.assign({},D.props),{onClick:()=>{}}))})):g.createElement(mo,Object.assign({},G),g.createElement("span",null,D))};g.useImperativeHandle(t,()=>({handlePreview:I,handleDownload:R}));const{getPrefixCls:_}=g.useContext(wt),B=_("upload",u),F=_(),U=J(`${B}-list`,`${B}-list-${n}`),K=g.useMemo(()=>nr(z$(F),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[F]),j=Object.assign(Object.assign({},T?{}:K),{motionDeadline:2e3,motionName:`${B}-${T?"animate-inline":"animate"}`,keys:de(d.map(D=>({key:D.uid,file:D}))),motionAppear:k});return g.createElement("div",{className:U},g.createElement(ZE,Object.assign({},j,{component:!1}),({key:D,file:H,className:W,style:q})=>g.createElement(FJ,{key:D,locale:s,prefixCls:B,className:W,style:q,file:H,items:d,progress:C,listType:n,isImgUrl:c,showPreviewIcon:f,showRemoveIcon:h,showDownloadIcon:p,removeIcon:v,previewIcon:m,downloadIcon:b,extra:y,iconRender:P,actionIconRender:A,itemRender:E,onPreview:I,onDownload:R,onClose:N})),x&&g.createElement(Er,Object.assign({},j,{visible:S,forceRender:!0}),({className:D,style:H})=>Io(x,W=>({className:J(W.className,D),style:Object.assign(Object.assign(Object.assign({},H),{pointerEvents:D?"none":void 0}),W.style)}))))},ZT=g.forwardRef(VJ);HJ.NODE_ENV!=="production"&&(ZT.displayName="UploadList");var Fb={},WJ=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(d){a(d)}}function l(u){try{c(r.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((r=r.apply(e,[])).next())})};const yc=`__LIST_IGNORE_${Date.now()}__`,UJ=(e,t)=>{const n=xr("upload"),{fileList:r,defaultFileList:o,onRemove:i,showUploadList:a=!0,listType:s="text",onPreview:l,onDownload:c,onChange:u,onDrop:d,previewFile:f,disabled:h,locale:p,iconRender:v,isImageUrl:m,progress:b,prefixCls:y,className:C,type:x="select",children:S,style:E,itemRender:$,maxCount:O,data:k={},multiple:M=!1,hasControlInside:T=!0,action:I="",accept:R="",supportServerRender:N=!0,rootClassName:P}=e,A=g.useContext(Hr),_=h??A,B=e.customRequest||n.customRequest,[F,U]=cn(o||[],{value:r,postState:pe=>pe??[]}),[K,j]=g.useState("drop"),D=g.useRef(null),H=g.useRef(null);if(Fb.NODE_ENV!=="production"){const pe=Wt("Upload");Fb.NODE_ENV!=="production"&&pe("fileList"in e||!("value"in e),"usage","`value` is not a valid prop, do you mean `fileList`?"),pe.deprecated(!("transformFile"in e),"transformFile","beforeUpload")}g.useMemo(()=>{const pe=Date.now();(r||[]).forEach((ve,Ve)=>{!ve.uid&&!Object.isFrozen(ve)&&(ve.uid=`__AUTO__${pe}_${Ve}__`)})},[r]);const W=(pe,ve,Ve)=>{let xe=de(ve),tt=!1;O===1?xe=xe.slice(-1):O&&(tt=xe.length>O,xe=xe.slice(0,O)),En.flushSync(()=>{U(xe)});const pt={file:pe,fileList:xe};Ve&&(pt.event=Ve),(!tt||pe.status==="removed"||xe.some(Re=>Re.uid===pe.uid))&&En.flushSync(()=>{u==null||u(pt)})},q=(pe,ve)=>WJ(void 0,void 0,void 0,function*(){const{beforeUpload:Ve,transformFile:xe}=e;let tt=pe;if(Ve){const pt=yield Ve(pe,ve);if(pt===!1)return!1;if(delete pe[yc],pt===yc)return Object.defineProperty(pe,yc,{value:!0,configurable:!0}),!1;typeof pt=="object"&&pt&&(tt=pt)}return xe&&(tt=yield xe(tt)),tt}),te=pe=>{const ve=pe.filter(tt=>!tt.file[yc]);if(!ve.length)return;const Ve=ve.map(tt=>Xf(tt.file));let xe=de(F);Ve.forEach(tt=>{xe=Yf(tt,xe)}),Ve.forEach((tt,pt)=>{let Re=tt;if(ve[pt].parsedFile)tt.status="uploading";else{const{originFileObj:je}=tt;let Qe;try{Qe=new File([je],je.name,{type:je.type})}catch{Qe=new Blob([je],{type:je.type}),Qe.name=je.name,Qe.lastModifiedDate=new Date,Qe.lastModified=new Date().getTime()}Qe.uid=tt.uid,Re=Qe}W(Re,xe)})},G=(pe,ve,Ve)=>{try{typeof pe=="string"&&(pe=JSON.parse(pe))}catch{}if(!Bb(ve,F))return;const xe=Xf(ve);xe.status="done",xe.percent=100,xe.response=pe,xe.xhr=Ve;const tt=Yf(xe,F);W(xe,tt)},re=(pe,ve)=>{if(!Bb(ve,F))return;const Ve=Xf(ve);Ve.status="uploading",Ve.percent=pe.percent;const xe=Yf(Ve,F);W(Ve,xe,pe)},oe=(pe,ve,Ve)=>{if(!Bb(Ve,F))return;const xe=Xf(Ve);xe.error=pe,xe.response=ve,xe.status="error";const tt=Yf(xe,F);W(xe,tt)},ne=pe=>{let ve;Promise.resolve(typeof i=="function"?i(pe):i).then(Ve=>{var xe;if(Ve===!1)return;const tt=RJ(pe,F);tt&&(ve=Object.assign(Object.assign({},pe),{status:"removed"}),F==null||F.forEach(pt=>{const Re=ve.uid!==void 0?"uid":"name";pt[Re]===ve[Re]&&!Object.isFrozen(pt)&&(pt.status="removed")}),(xe=D.current)===null||xe===void 0||xe.abort(ve),W(ve,tt))})},Z=pe=>{j(pe.type),pe.type==="drop"&&(d==null||d(pe))};g.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:G,onProgress:re,onError:oe,fileList:F,upload:D.current,nativeElement:H.current}));const{getPrefixCls:ae,direction:ie,upload:X}=g.useContext(wt),ee=ae("upload",y),le=Object.assign(Object.assign({onBatchStart:te,onError:oe,onProgress:re,onSuccess:G},e),{customRequest:B,data:k,multiple:M,action:I,accept:R,supportServerRender:N,prefixCls:ee,disabled:_,beforeUpload:q,onChange:void 0,hasControlInside:T});delete le.className,delete le.style,(!S||_)&&delete le.id;const ce=`${ee}-wrapper`,[ue,ge,ye]=EJ(ee,ce),[$e]=uo("Upload",ri.Upload),{showRemoveIcon:Ce,showPreviewIcon:se,showDownloadIcon:Se,removeIcon:ze,previewIcon:Ge,downloadIcon:Pe,extra:Oe}=typeof a=="boolean"?{}:a,qe=typeof Ce>"u"?!_:Ce,Ne=(pe,ve)=>a?g.createElement(ZT,{prefixCls:ee,listType:s,items:F,previewFile:f,onPreview:l,onDownload:c,onRemove:ne,showRemoveIcon:qe,showPreviewIcon:se,showDownloadIcon:Se,removeIcon:ze,previewIcon:Ge,downloadIcon:Pe,iconRender:v,extra:Oe,locale:Object.assign(Object.assign({},$e),p),isImageUrl:m,progress:b,appendAction:pe,appendActionVisible:ve,itemRender:$,disabled:_}):pe,Fe=J(ce,C,P,ge,ye,X==null?void 0:X.className,{[`${ee}-rtl`]:ie==="rtl",[`${ee}-picture-card-wrapper`]:s==="picture-card",[`${ee}-picture-circle-wrapper`]:s==="picture-circle"}),Ae=Object.assign(Object.assign({},X==null?void 0:X.style),E);if(x==="drag"){const pe=J(ge,ee,`${ee}-drag`,{[`${ee}-drag-uploading`]:F.some(ve=>ve.status==="uploading"),[`${ee}-drag-hover`]:K==="dragover",[`${ee}-disabled`]:_,[`${ee}-rtl`]:ie==="rtl"});return ue(g.createElement("span",{className:Fe,ref:H},g.createElement("div",{className:pe,style:Ae,onDrop:Z,onDragOver:Z,onDragLeave:Z},g.createElement(zb,Object.assign({},le,{ref:D,className:`${ee}-btn`}),g.createElement("div",{className:`${ee}-drag-container`},S))),Ne()))}const ke=J(ee,`${ee}-select`,{[`${ee}-disabled`]:_,[`${ee}-hidden`]:!S}),Xe=g.createElement("div",{className:ke,style:Ae},g.createElement(zb,Object.assign({},le,{ref:D})));return ue(s==="picture-card"||s==="picture-circle"?g.createElement("span",{className:Fe,ref:H},Ne(Xe,!!S)):g.createElement("span",{className:Fe,ref:H},Xe,Ne()))},Hb=g.forwardRef(UJ);Fb.NODE_ENV!=="production"&&(Hb.displayName="Upload");var qJ={},KJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const eI=g.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:o=!1,children:i}=e,a=KJ(e,["style","height","hasControlInside","children"]),s=Object.assign(Object.assign({},n),{height:r});return g.createElement(Hb,Object.assign({ref:t,hasControlInside:o},a,{style:s,type:"drag"}),i)});qJ.NODE_ENV!=="production"&&(eI.displayName="Dragger");const Vb=Hb;Vb.Dragger=eI,Vb.LIST_IGNORE=yc;const un=({onClick:e,disabled:t,isActive:n,icon:r,title:o})=>L.jsx(hn,{title:o,mouseEnterDelay:.5,children:L.jsx("button",{onClick:e,disabled:t,className:n?"is-active":"",children:L.jsx("span",{className:r,style:{width:16,height:16,display:"inline-flex"}})})}),GJ=[{id:"avatar",label:"头像",icon:"icon-[mdi--account-circle]"},{id:"nickname",label:"昵称",icon:"icon-[mdi--account]"},{id:"email",label:"邮箱",icon:"icon-[mdi--email]"},{id:"phone",label:"手机号",icon:"icon-[mdi--phone]"},{id:"date",label:"日期",icon:"icon-[mdi--calendar]"},{id:"time",label:"时间",icon:"icon-[mdi--clock]"}],XJ=({editor:e,children:t})=>{const[n,r]=w.useState(!1),{config:o}=w.useContext(Tr)||{},i=(o==null?void 0:o.theme)==="dark",a=f=>{e.chain().focus().insertVariable({id:f.id,label:f.label}).run(),r(!1)},s=i?"#374151":"#ffffff",l=i?"#4b5563":"#e5e7eb",c=i?"#f9fafb":"#1f2937",u=i?"#9ca3af":"#6b7280",d=L.jsxs("div",{className:"variable-panel",style:{background:s},children:[L.jsx("div",{className:"variable-panel-title",style:{color:c,borderBottomColor:l},children:"插入变量"}),L.jsx("div",{className:"variable-panel-list",children:GJ.map(f=>L.jsxs("div",{className:"variable-panel-item",onClick:()=>a(f),style:{borderRadius:4},children:[L.jsx("span",{className:f.icon,style:{width:16,height:16,display:"inline-flex",color:c}}),L.jsx("span",{className:"variable-panel-item-label",style:{color:c},children:f.label}),L.jsx("span",{className:"variable-panel-item-id",style:{color:u},children:`\${${f.id}}`})]},f.id))})]});return L.jsx(Wi,{content:d,trigger:"click",placement:"bottomLeft",arrow:!1,getPopupContainer:f=>f.parentElement,open:n,onOpenChange:r,children:t})},YJ=({editor:e,children:t})=>{const[n,r]=w.useState(!1),i=(()=>{if(!e)return{};let s="";try{typeof e.getMarkdown=="function"?s=e.getMarkdown():e.markdown&&typeof e.markdown.serialize=="function"&&(s=e.markdown.serialize(e.getJSON()))}catch(l){console.warn("Failed to get markdown:",l),s=""}return{html:e.getHTML(),json:JSON.stringify(e.getJSON(),null,2),markdown:s,text:e.getText()}})(),a=[{key:"html",label:"HTML",children:L.jsx("pre",{className:"source-code-content",children:i.html})},{key:"json",label:"JSON",children:L.jsx("pre",{className:"source-code-content",children:i.json})},{key:"markdown",label:"Markdown",children:L.jsx("pre",{className:"source-code-content",children:i.markdown})},{key:"text",label:"纯文本",children:L.jsx("pre",{className:"source-code-content",children:i.text})}];return L.jsxs(L.Fragment,{children:[L.jsx("div",{onClick:()=>r(!0),children:t}),L.jsx(Nr,{title:"源码查看器",open:n,onCancel:()=>r(!1),footer:null,width:800,className:"source-code-modal",children:L.jsx(Df,{items:a})})]})},JJ=({editor:e,children:t})=>{const[n,r]=w.useState(!1),o=w.useRef(null),i=()=>e?e.getHTML():"",a=s=>{const l=s.target.closest('a[href^="#"]');if(!l)return;s.preventDefault();const c=l.getAttribute("href").slice(1);if(!c||!o.current)return;const u=o.current.querySelector(`[id="${c}"]`);u&&u.scrollIntoView({behavior:"smooth",block:"center"})};return L.jsxs(L.Fragment,{children:[L.jsx("div",{onClick:()=>r(!0),children:t}),L.jsx(Nr,{title:"HTML 预览",open:n,onCancel:()=>r(!1),footer:null,width:900,className:"html-preview-modal",children:L.jsx("div",{className:"html-preview-container",ref:o,onClick:a,children:L.jsx("div",{className:"html-preview-content",dangerouslySetInnerHTML:{__html:i()}})})})]})},tI=8,QJ=({onSelect:e,isDark:t})=>{const[n,r]=w.useState({row:0,col:0}),o={width:20,height:20,border:`1px solid ${t?"#4b5563":"#e5e7eb"}`,borderRadius:2,cursor:"pointer",transition:"all 0.15s"},i={...o,background:"#1890ff",borderColor:"#1890ff"};return L.jsxs("div",{className:"table-insert-grid",children:[L.jsx("div",{className:"table-grid-label",style:{color:t?"#9ca3af":"#6b7280"},children:n.row>0&&n.col>0?`${n.row} × ${n.col}`:"选择大小"}),L.jsx("div",{className:"table-grid",onMouseLeave:()=>r({row:0,col:0}),children:Array.from({length:tI},(a,s)=>L.jsx("div",{className:"table-grid-row",style:{display:"flex",gap:2},children:Array.from({length:tI},(l,c)=>L.jsx("div",{style:s<n.row&&c<n.col?i:o,onMouseEnter:()=>r({row:s+1,col:c+1}),onClick:()=>e(s+1,c+1)},c))},s))})]})},ZJ=({editor:e,children:t})=>{const[n,r]=w.useState(!1),{config:o}=w.useContext(Tr)||{},i=(o==null?void 0:o.theme)==="dark",a=(e==null?void 0:e.isActive("table"))||!1,s=(p,v)=>{e.chain().focus().insertTable({rows:p,cols:v,withHeaderRow:!0}).run(),r(!1)},l=({icon:p,title:v,onClick:m,disabled:b})=>L.jsx(hn,{title:v,mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:"table-action-btn",onClick:m,disabled:b,children:L.jsx("span",{className:p,style:{width:16,height:16,display:"inline-flex"}})})}),c=i?"#374151":"#ffffff",u=i?"#4b5563":"#e5e7eb",d=i?"#9ca3af":"#6b7280",f=L.jsxs("div",{className:"table-menu-panel",style:{background:c},children:[L.jsx("div",{className:"table-menu-section-title",style:{color:d},children:"插入表格"}),L.jsx(QJ,{onSelect:s,isDark:i})]}),h=L.jsxs("div",{className:"table-menu-panel",style:{background:c},children:[L.jsx("div",{className:"table-menu-section-title",style:{color:d},children:"行操作"}),L.jsxs("div",{className:"table-menu-actions",children:[L.jsx(l,{icon:"icon-[mdi--table-row-plus-before]",title:"在上方插入行",onClick:()=>e.chain().focus().addRowBefore().run(),disabled:!(e!=null&&e.can().addRowBefore())}),L.jsx(l,{icon:"icon-[mdi--table-row-plus-after]",title:"在下方插入行",onClick:()=>e.chain().focus().addRowAfter().run(),disabled:!(e!=null&&e.can().addRowAfter())}),L.jsx(l,{icon:"icon-[mdi--table-row-remove]",title:"删除行",onClick:()=>e.chain().focus().deleteRow().run(),disabled:!(e!=null&&e.can().deleteRow())})]}),L.jsx("div",{className:"table-menu-section-title",style:{color:d},children:"列操作"}),L.jsxs("div",{className:"table-menu-actions",children:[L.jsx(l,{icon:"icon-[mdi--table-column-plus-before]",title:"在左侧插入列",onClick:()=>e.chain().focus().addColumnBefore().run(),disabled:!(e!=null&&e.can().addColumnBefore())}),L.jsx(l,{icon:"icon-[mdi--table-column-plus-after]",title:"在右侧插入列",onClick:()=>e.chain().focus().addColumnAfter().run(),disabled:!(e!=null&&e.can().addColumnAfter())}),L.jsx(l,{icon:"icon-[mdi--table-column-remove]",title:"删除列",onClick:()=>e.chain().focus().deleteColumn().run(),disabled:!(e!=null&&e.can().deleteColumn())})]}),L.jsx("div",{className:"table-menu-section-title",style:{color:d},children:"单元格操作"}),L.jsxs("div",{className:"table-menu-actions",children:[L.jsx(l,{icon:"icon-[mdi--table-merge-cells]",title:"合并单元格",onClick:()=>e.chain().focus().mergeCells().run(),disabled:!(e!=null&&e.can().mergeCells())}),L.jsx(l,{icon:"icon-[mdi--table-split-cell]",title:"拆分单元格",onClick:()=>e.chain().focus().splitCell().run(),disabled:!(e!=null&&e.can().splitCell())})]}),L.jsx("div",{className:"table-menu-section-title",style:{color:d},children:"表格操作"}),L.jsxs("div",{className:"table-menu-actions",children:[L.jsx(l,{icon:"icon-[mdi--table-border]",title:"切换表头",onClick:()=>e.chain().focus().toggleHeaderRow().run(),disabled:!(e!=null&&e.can().toggleHeaderRow())}),L.jsx(l,{icon:"icon-[mdi--table-large-plus]",title:"在下方追加行",onClick:()=>e.chain().focus().addRowAfter().run(),disabled:!(e!=null&&e.can().addRowAfter())}),L.jsx(l,{icon:"icon-[mdi--table-large-remove]",title:"删除表格",onClick:()=>e.chain().focus().deleteTable().run(),disabled:!(e!=null&&e.can().deleteTable())})]})]});return L.jsx(Wi,{content:a?h:f,trigger:"click",placement:"bottomLeft",arrow:!1,overlayClassName:"table-menu-popover",open:n,onOpenChange:r,styles:{root:{background:c,borderRadius:8,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:`1px solid ${u}`},body:{background:c,padding:12}},children:t})},Jf=({icon:e,title:t,isActive:n,onClick:r,textColor:o,hoverBg:i,activeBg:a,activeColor:s})=>L.jsx(hn,{title:t,mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:`align-action-btn ${n?"is-active":""}`,onClick:r,style:{color:n?s:o,background:n?a:"transparent"},children:L.jsx("span",{className:e,style:{width:16,height:16,display:"inline-flex"}})})}),eQ=({editor:e,children:t})=>{const[n,r]=w.useState(!1),o=w.useRef(null),{config:i}=w.useContext(Tr)||{},a=(i==null?void 0:i.theme)==="dark",s=a?"#374151":"#ffffff",l=a?"#4b5563":"#e5e7eb",c=a?"#f9fafb":"#1f2937",u=a?"#9ca3af":"#6b7280",d=a?"#4b5563":"#f3f4f6",f="#1890ff",h="#ffffff",p=Ei({editor:e,selector:m=>({textAlign:m.editor.getAttributes("paragraph").textAlign||"left"})});w.useEffect(()=>{const m=b=>{o.current&&!o.current.contains(b.target)&&r(!1)};return n&&document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[n]);const v=m=>{e.isActive({textAlign:m})?e.chain().focus().unsetTextAlign().run():e.chain().focus().setTextAlign(m).run()};return L.jsxs("div",{ref:o,className:"align-menu-wrapper",style:{display:"inline-flex"},children:[L.jsx("div",{onClick:()=>r(!n),children:t}),n&&L.jsxs("div",{className:"align-menu-popup",style:{background:s,border:`1px solid ${l}`},children:[L.jsx("div",{className:"align-menu-title",style:{color:u},children:"对齐方式"}),L.jsxs("div",{className:"align-menu-actions",children:[L.jsx(Jf,{icon:"icon-[mdi--format-align-left]",title:"左对齐",isActive:p.textAlign==="left",onClick:()=>v("left"),textColor:c,hoverBg:d,activeBg:f,activeColor:h}),L.jsx(Jf,{icon:"icon-[mdi--format-align-center]",title:"居中对齐",isActive:p.textAlign==="center",onClick:()=>v("center"),textColor:c,hoverBg:d,activeBg:f,activeColor:h}),L.jsx(Jf,{icon:"icon-[mdi--format-align-right]",title:"右对齐",isActive:p.textAlign==="right",onClick:()=>v("right"),textColor:c,hoverBg:d,activeBg:f,activeColor:h}),L.jsx(Jf,{icon:"icon-[mdi--format-align-justify]",title:"两端对齐",isActive:p.textAlign==="justify",onClick:()=>v("justify"),textColor:c,hoverBg:d,activeBg:f,activeColor:h})]})]})]})},tQ={uploadUrl:"/api/common/upload/file",fieldName:"file",headers:{},withCredentials:!0,responseParser:e=>{var t,n;return e.url||((t=e.data)==null?void 0:t.url)||((n=e.data)==null?void 0:n.full_url)||e},compress:!0,compressQuality:.8,compressMaxWidth:1920,compressMaxHeight:1080,compressType:"image/jpeg"},nQ=(e,t={})=>new Promise((n,r)=>{const{compressQuality:o=.8,compressMaxWidth:i=1920,compressMaxHeight:a=1080,compressType:s="image/jpeg"}=t;if(!e.type.startsWith("image/")){n(e);return}if(e.type==="image/gif"){n(e);return}const l=new FileReader;l.onload=c=>{const u=new Image;u.onload=()=>{let{width:d,height:f}=u;if(d>i||f>a){const v=Math.min(i/d,a/f);d=Math.round(d*v),f=Math.round(f*v)}const h=document.createElement("canvas");h.width=d,h.height=f,h.getContext("2d").drawImage(u,0,0,d,f),h.toBlob(v=>{if(!v){n(e);return}const m=new File([v],e.name.replace(/\.[^/.]+$/,".jpg"),{type:s,lastModified:Date.now()});if(m.size>=e.size){n(e);return}n(m)},s,o)},u.onerror=()=>n(e),u.src=c.target.result},l.onerror=()=>n(e),l.readAsDataURL(e)}),rQ=async(e,t={})=>{const n={...tQ,...t};let r=e;n.compress!==!1&&(r=await nQ(e,n));const o=new FormData;o.append(n.fieldName,r);const i={method:"POST",body:o,credentials:n.withCredentials?"include":"same-origin",headers:n.headers};Object.keys(i.headers).forEach(l=>{(i.headers[l]===void 0||i.headers[l]===null)&&delete i.headers[l]});const a=await fetch(n.uploadUrl,i);if(!a.ok)throw new Error(`Upload failed: ${a.status}`);const s=await a.json();if(s.code!==void 0&&s.code!==0&&s.code!==200)throw new Error(s.msg||s.message||"Upload failed");return n.responseParser(s)},{Dragger:oQ}=Vb,iQ=({editor:e,children:t})=>{const{config:n}=w.useContext(Tr),[r,o]=w.useState(!1),[i,a]=w.useState(""),s=(n==null?void 0:n.theme)==="dark",l=(m,b={})=>{e.chain().focus().insertImage({src:m,...b}).run(),o(!1),a("")},c=m=>{e.chain().focus().insertImage({src:"",file:m,status:"uploading"}).run(),o(!1)},u=()=>{if(!i.trim()){RT.warning("请输入图片地址");return}l(i.trim())},f={name:"file",multiple:!1,showUploadList:!1,accept:"image/*",beforeUpload:async m=>(c(m),!1)},h=s?"#374151":"#ffffff",p=s?"#4b5563":"#e5e7eb",v=[{key:"upload",label:"本地上传",children:L.jsx("div",{className:"image-menu-upload",children:L.jsxs(oQ,{...f,className:"image-menu-dragger",children:[L.jsx("p",{className:"ant-upload-drag-icon",children:L.jsx("span",{className:"icon-[mdi--cloud-upload]",style:{width:48,height:48,display:"inline-flex"}})}),L.jsx("p",{className:"ant-upload-text",children:"点击或拖拽图片到此区域上传"}),L.jsx("p",{className:"ant-upload-hint",children:"支持 JPG、PNG、GIF 等格式"})]})})},{key:"url",label:"网络图片",children:L.jsxs("div",{className:"image-menu-url",children:[L.jsx(Do,{placeholder:"请输入图片 URL",value:i,onChange:m=>a(m.target.value),onPressEnter:u}),L.jsx("button",{className:"image-menu-url-btn",onClick:u,children:"插入"})]})}];return L.jsx(Wi,{content:L.jsx("div",{className:"image-menu-panel",children:L.jsx(Df,{items:v})}),trigger:"click",placement:"bottomLeft",arrow:!1,open:r,onOpenChange:o,overlayClassName:"image-menu-popover",getPopupContainer:m=>m.parentElement,styles:{root:{background:h,borderRadius:8,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:`1px solid ${p}`},body:{background:h,padding:0}},children:t})},Qf=({editor:e,type:t,title:n})=>{const[r,o]=w.useState(null),[i,a]=w.useState(!1),{config:s}=w.useContext(Tr)||{},l=(s==null?void 0:s.theme)==="dark",c=l?"#374151":"#ffffff",u=l?"#4b5563":"#f0f0f0",d=l?"#f9fafb":"#666666",f=t==="text",h=f?e.getAttributes("textStyle").color:e.getAttributes("highlight").color;w.useEffect(()=>{o(h||null)},[h]);const p=b=>{var C;const y=((C=b==null?void 0:b.toHexString)==null?void 0:C.call(b))||(b==null?void 0:b.color);y&&(o(y),f?e.chain().focus().setColor(y).run():e.chain().focus().toggleHighlight({color:y}).run())},v=()=>{o(null),f?e.chain().focus().unsetColor().run():e.chain().focus().unsetHighlight().run(),a(!1)},m=f?"icon-[mdi--format-color-text]":"icon-[mdi--format-color-highlight]";return L.jsx(hn,{title:n,mouseEnterDelay:.5,children:L.jsx("span",{style:{display:"inline-flex"},children:L.jsx(Hf,{open:i,onOpenChange:a,value:r,onChange:p,showText:!1,size:"small",presets:[{label:"推荐颜色",colors:["#000000","#333333","#666666","#999999","#CCCCCC","#E83E8C","#D4333D","#C93C37","#1890FF","#2F855A","#D69E2E","#805AD5","#DD6B20","#38A169"]}],styles:{popup:{background:c}},panelRender:b=>L.jsxs("div",{style:{minWidth:200,background:c},children:[b,L.jsx("div",{style:{padding:"8px 0",borderTop:`1px solid ${u}`},children:L.jsx("button",{onClick:v,style:{width:"100%",padding:"4px 8px",border:"none",background:"transparent",cursor:"pointer",color:d,fontSize:"12px"},children:"清除颜色"})})]}),children:L.jsxs("button",{className:h?"is-active":"",style:{position:"relative"},children:[L.jsx("span",{className:m,style:{width:16,height:16,display:"inline-flex"}}),h&&L.jsx("span",{style:{position:"absolute",bottom:2,left:"50%",transform:"translateX(-50%)",width:14,height:3,borderRadius:2,background:h}})]})})})})},aQ=[12,14,16,18,20,24,28,32,36,48,72],sQ=({editor:e})=>{const[t,n]=w.useState(!1),[r,o]=w.useState(16),i=w.useRef(null),{config:a}=w.useContext(Tr)||{},s=(a==null?void 0:a.theme)==="dark",l=s?"#374151":"#ffffff",c=s?"#4b5563":"#e5e7eb",u=s?"#f9fafb":"#1f2937",d="#1890ff",f=s?"#ffffff":"#1890ff";w.useEffect(()=>{const p=v=>{i.current&&!i.current.contains(v.target)&&n(!1)};return t&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[t]);const h=p=>{e.chain().focus().setMark("textStyle",{fontSize:`${p}px`}).run(),o(p),n(!1)};return L.jsxs("div",{ref:i,className:"font-size-selector-wrapper",style:{display:"inline-flex",position:"relative"},children:[L.jsx(hn,{title:"字体大小",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",onClick:()=>n(!t),children:L.jsx("span",{className:"icon-[mdi--format-size]",style:{width:16,height:16,display:"inline-flex"}})})}),t&&L.jsx("div",{className:"font-size-selector-popup",style:{background:l,border:`1px solid ${c}`,display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"4px",padding:"8px",minWidth:"200px"},children:aQ.map(p=>L.jsxs("button",{type:"button",className:`font-size-option ${r===p?"is-active":""}`,onClick:()=>h(p),style:{color:r===p?f:u,background:r===p?s?d:"#e6f7ff":"transparent",flexDirection:"column",alignItems:"center",gap:"4px",padding:"8px 4px",minWidth:"40px",whiteSpace:"nowrap"},children:[L.jsx("span",{className:"icon-[mdi--format-font]",style:{width:18,height:18,display:"inline-flex"}}),L.jsx("span",{style:{fontSize:"12px"},children:p})]},p))})]})},nI=({level:e})=>{if(e===0)return L.jsx("span",{className:"icon-[mdi--format-paragraph]",style:{width:20,height:20,display:"inline-flex"}});if(e===1)return L.jsx("span",{className:"icon-[mdi--format-header-1]",style:{width:20,height:20,display:"inline-flex"}});if(e===2)return L.jsx("span",{className:"icon-[mdi--format-header-2]",style:{width:20,height:20,display:"inline-flex"}});if(e===3)return L.jsx("span",{className:"icon-[mdi--format-header-3]",style:{width:20,height:20,display:"inline-flex"}});if(e===4)return L.jsx("span",{className:"icon-[mdi--format-header-4]",style:{width:20,height:20,display:"inline-flex"}});if(e===5)return L.jsx("span",{className:"icon-[mdi--format-header-5]",style:{width:20,height:20,display:"inline-flex"}});if(e===6)return L.jsx("span",{className:"icon-[mdi--format-header-6]",style:{width:20,height:20,display:"inline-flex"}})},Wb=[{level:1,label:"标题 1"},{level:2,label:"标题 2"},{level:3,label:"标题 3"},{level:4,label:"标题 4"},{level:5,label:"标题 5"},{level:6,label:"标题 6"},{level:0,label:"正文"}],lQ=({editor:e})=>{const[t,n]=w.useState(!1),r=w.useRef(null),{config:o}=w.useContext(Tr)||{},i=(o==null?void 0:o.theme)==="dark",a=i?"#374151":"#ffffff",s=i?"#4b5563":"#e5e7eb",l=i?"#f9fafb":"#1f2937",c="#1890ff",u=i?"#ffffff":"#1890ff",d=Ei({editor:e,selector:p=>{let v=0;for(let m=1;m<=6;m++)if(p.editor.isActive("heading",{level:m})){v=m;break}return{activeLevel:v}}});w.useEffect(()=>{const p=v=>{r.current&&!r.current.contains(v.target)&&n(!1)};return t&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[t]);const f=p=>{p===0?e.chain().focus().setParagraph().run():e.chain().focus().toggleHeading({level:p}).run(),n(!1)},h=Wb.find(p=>p.level===d.activeLevel)||Wb[6];return L.jsxs("div",{ref:r,className:"heading-selector-wrapper",style:{display:"inline-flex",position:"relative"},children:[L.jsx(hn,{title:"标题",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",className:d.activeLevel>0?"is-active":"",onClick:()=>n(!t),children:L.jsx(nI,{level:h.level})})}),t&&L.jsx("div",{className:"heading-selector-popup",style:{background:a,border:`1px solid ${s}`},children:Wb.map(p=>L.jsxs("button",{type:"button",className:`heading-option ${d.activeLevel===p.level?"is-active":""}`,onClick:()=>f(p.level),style:{color:d.activeLevel===p.level?u:l,background:d.activeLevel===p.level?i?c:"#e6f7ff":"transparent",flexDirection:"row",alignItems:"center",gap:"8px",padding:"8px 12px",minWidth:"100px",whiteSpace:"nowrap"},children:[L.jsx(nI,{level:p.level}),L.jsx("span",{style:{fontSize:"13px"},children:p.label})]},p.level))})]})},rI=({editor:e})=>{const[t,n]=w.useState(!1),[r,o]=w.useState(""),i=w.useRef(null),{config:a}=w.useContext(Tr)||{},s=(a==null?void 0:a.theme)==="dark",l=s?"#374151":"#ffffff",c=s?"#4b5563":"#e5e7eb",u=Ei({editor:e,selector:h=>({isLink:h.editor.isActive("link"),linkUrl:h.editor.getAttributes("link").href||""})});w.useEffect(()=>{t&&o(u.linkUrl)},[t,u.linkUrl]),w.useEffect(()=>{const h=p=>{i.current&&!i.current.contains(p.target)&&n(!1)};return t&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const d=()=>{r?e.chain().focus().setLink({href:r}).run():e.chain().focus().unsetLink().run(),n(!1)},f=()=>{e.chain().focus().unsetLink().run(),n(!1)};return L.jsxs("div",{ref:i,className:"link-button-wrapper",style:{display:"inline-flex",position:"relative"},children:[L.jsx(hn,{title:"链接",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",className:u.isLink?"is-active":"",onClick:()=>n(!t),children:L.jsx("span",{className:"icon-[mdi--link]",style:{width:16,height:16,display:"inline-flex"}})})}),t&&L.jsx("div",{className:"link-button-popup",style:{background:l,border:`1px solid ${c}`},children:L.jsxs("div",{className:"link-input-wrapper",children:[L.jsx(Do,{placeholder:"输入链接地址",value:r,onChange:h=>o(h.target.value),onPressEnter:d,size:"small",style:{width:200}}),L.jsx(mo,{type:"primary",size:"small",onClick:d,children:"确定"}),u.isLink&&L.jsx(mo,{size:"small",onClick:f,children:"移除"})]})})]})},oI={表情:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🤐","🤨","😐","😑","😶","😏","😒","🙄","😬","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🤧","🥵","🥶","🥴","😵","🤯","🤠","🥳","😎","🤓","🧐"],手势:["👍","👎","👌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","☝️","✋","🤚","🖐️","🖖","👋","🤝","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🙏","✍️","💪","🦵","🦶","👂","👃","🧠","🦷","🦴","👀","👁️","👅","👄"],动物:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🙈","🙉","🙊","🐒","🐔","🐧","🐦","🐤","🐣","🐥","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🐛","🦋","🐌","🐞","🐜","🦟","🦗","🕷️","🦂","🐢","🐍","🦎","🦖","🦕","🐙","🦑","🦐","🦞","🦀","🐡","🐠","🐟","🐬","🐳","🐋","🦈","🐊","🐅","🐆","🦓","🦍","🦧","🐘","🦛","🦏","🐪","🐫","🦒","🦘","🐃","🐂","🐄","🐎","🐖","🐏","🐑","🦙","🐐","🦌","🐕","🐩","🦮","🐈","🐓","🦃","🦚","🦜","🦢","🦩","🐇","🦝","🦨","🦡","🦦","🦥"],食物:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🥦","🥬","🥒","🌶️","🫑","🌽","🥕","🫒","🧄","🧅","🥔","🍠","🥐","🥯","🍞","🥖","🥨","🧀","🥚","🍳","🧈","🥞","🧇","🥓","🥩","🍗","🍖","🦴","🌭","🍔","🍟","🍕","🫓","🥪","🥙","🧆","🌮","🌯","🫔","🥗","🥘","🫕","🍝","🍜","🍲","🍛","🍣","🍱","🥟","🦪","🍤","🍙","🍚","🍘","🍥","🥠","🥮","🍢","🍡","🍧","🍨","🍦","🥧","🧁","🍰","🎂","🍮","🍭","🍬","🍫","🍿","🍩","🍪","🌰","🥜","🍯","🥛","🍼","☕","🫖","🍵","🧃","🥤","🧋","🍶","🍺","🍻","🥂","🍷","🥃","🍸","🍹","🧉","🍾","🧊","🥄","🍴","🍽️","🥣","🥡","🥢","🧂"],自然:["🌸","💮","🏵️","🌹","🥀","🌺","🌻","🌼","🌷","🌱","🪴","🌲","🌳","🌴","🌵","🌾","🌿","☘️","🍀","🍁","🍂","🍃","🍄","🌰","🦀","🐚","🌍","🌎","🌏","🌐","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","☀️","🌝","🌞","⭐","🌟","🌠","☁️","⛅","⛈️","🌤️","🌥️","🌦️","🌧️","🌨️","🌩️","🌪️","🌫️","🌬️","🌀","🌈","🌂","☔","⚡","❄️","☃️","⛄","☄️","🔥","💧","🌊","💣","✨","💫","🌸"],物品:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","🖲️","🕹️","🗜️","💽","💾","💿","📀","📼","📷","📸","📹","🎥","📽️","🎞️","📞","☎️","📟","📠","📺","📻","🎙️","🎚️","🎛️","🧭","⏱️","⏲️","⏰","🕰️","⌛","⏳","📡","🔋","🔌","💡","🔦","🕯️","🪔","🧯","🛢️","💸","💵","💴","💶","💷","💰","💳","💎","⚖️","🔧","🔨","⚒️","🛠️","⛏️","🔩","⚙️","🔫","💣","🔪","🗡️","⚔️","🛡️","🚬","⚰️","🪦","⚱️","🏺","🔮","📿","🧿","💈","⚗️","🔭","🔬","🕳️","🩹","🩺","💊","💉","🩸","🧬","🦠","🧫","🧪","🌡️","🧹","🪠","🧺","🧻","🚽","🚿","🛁","🛀","🧼","🪥","🪒","🧽","🪣","🧴","🛎️","🔑","🗝️","🚪","🪑","🛋️","🛏️","🛌","🧸","🖼️","🛍️","🛒","🎁","🎈","🎏","🎀","🎊","🎉","🎎","🏮","🎐","🧧"],符号:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✝️","☪️","🕉️","☸️","✡️","🔯","🕎","☯️","☦️","🛐","⛎","♈","♉","♊","♋","♌","♍","♎","♏","♐","♑","♒","♓","🆔","⚛️","🉑","☢️","☣️","📴","📳","🈶","🈚","🈸","🈺","🈷️","✴️","🆚","💮","🉐","㊙️","㊗️","🈴","🈵","🈹","🈲","🅰️","🅱️","🆎","🆑","🅾️","🆘","❌","⭕","🛑","⛔","📛","🚫","💯","💢","♨️","🚷","🚯","🚳","🚱","🔞","📵","🚭","❗","❕","❓","❔","‼️","⁉️","🔅","🔆","〽️","⚠️","🚸","🔱","⚜️","🔰","♻️","✅","🈯","💹","❇️","✳️","❎","🌐","💠","Ⓜ️","🌀","💤","🏧","🚾","♿","🅿️","🛗","🈳","🈂️","🛂","🛃","🛄","🛅","🚹","🚺","🚼","⚧️","🚻","🚮","🎦","📶","🈁","🔣","ℹ️","🔤","🔡","🔠","🆖","🆗","🆙","🆒","🆕","🆓","0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","🔟","🔢","#️⃣","*️⃣","⏏️","▶️","⏸️","⏯️","⏹️","⏺️","⏭️","⏮️","⏩","⏪","⏫","⏬","◀️","🔼","🔽","➡️","⬅️","⬆️","⬇️","↗️","↘️","↙️","↖️","↕️","↔️","↪️","↩️","⤴️","⤵️","🔀","🔁","🔂","🔄","🔃","🎵","🎶","➕","➖","➗","✖️","🟰","♾️","💲","💱","™️","©️","®️","👁️🗨️","🔚","🔙","🔛","🔝","🔜","〰️","➰","➿","✔️","☑️","🔘","🔴","🟠","🟡","🟢","🔵","🟣","⚫","⚪","🟤","🔺","🔻","🔸","🔹","🔶","🔷","🔳","🔲","▪️","▫️","◾","◽","◼️","◻️","🟥","🟧","🟨","🟩","🟦","🟪","⬛","⬜","🟫","🔈","🔇","🔉","🔊","🔔","🔕","📣","📢","💬","💭","🗯️","♠️","♣️","♥️","♦️","🃏","🎴","🀄","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧"]},cQ=({editor:e})=>{const[t,n]=w.useState(!1),[r,o]=w.useState("表情"),i=w.useRef(null),{config:a}=w.useContext(Tr)||{},s=(a==null?void 0:a.theme)==="dark",l=s?"#374151":"#ffffff",c=s?"#4b5563":"#e5e7eb",u=s?"#f9fafb":"#1f2937",d="#1890ff",f="#ffffff";w.useEffect(()=>{const p=v=>{i.current&&!i.current.contains(v.target)&&n(!1)};return t&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[t]);const h=p=>{e.chain().focus().insertContent(p).run(),n(!1)};return L.jsxs("div",{ref:i,style:{display:"inline-flex",position:"relative"},children:[L.jsx(hn,{title:"插入表情",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",onClick:()=>n(!t),children:L.jsx("span",{className:"icon-[mdi--emoticon-outline]",style:{width:16,height:16,display:"inline-flex"}})})}),t&&L.jsxs("div",{style:{position:"absolute",top:"100%",left:0,marginTop:"4px",background:l,border:`1px solid ${c}`,borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px",zIndex:1e3,minWidth:"280px"},children:[L.jsx("div",{style:{display:"flex",gap:"4px",marginBottom:"8px",paddingBottom:"8px",borderBottom:`1px solid ${c}`,flexWrap:"wrap"},children:Object.keys(oI).map(p=>L.jsx("button",{type:"button",onClick:()=>o(p),style:{padding:"4px 8px",border:"none",borderRadius:"4px",background:r===p?d:"transparent",color:r===p?f:u,cursor:"pointer",fontSize:"12px",transition:"all 0.2s"},children:p},p))}),L.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",maxHeight:"200px",overflowY:"auto"},children:oI[r].map((p,v)=>L.jsx("button",{type:"button",onClick:()=>h(p),style:{width:"28px",height:"28px",border:"none",borderRadius:"4px",background:"transparent",cursor:"pointer",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s"},onMouseEnter:m=>{m.target.style.background=s?"#4b5563":"#f3f4f6"},onMouseLeave:m=>{m.target.style.background="transparent"},children:p},v))})]})]})};function uQ(e){return{isBold:e.editor.isActive("bold")??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isItalic:e.editor.isActive("italic")??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isUnderline:e.editor.isActive("underline")??!1,canUnderline:e.editor.can().chain().toggleUnderline().run()??!1,isStrike:e.editor.isActive("strike")??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive("code")??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isParagraph:e.editor.isActive("paragraph")??!1,isHeading1:e.editor.isActive("heading",{level:1})??!1,isHeading2:e.editor.isActive("heading",{level:2})??!1,isHeading3:e.editor.isActive("heading",{level:3})??!1,isHeading4:e.editor.isActive("heading",{level:4})??!1,isHeading5:e.editor.isActive("heading",{level:5})??!1,isHeading6:e.editor.isActive("heading",{level:6})??!1,isBulletList:e.editor.isActive("bulletList")??!1,isOrderedList:e.editor.isActive("orderedList")??!1,isCodeBlock:e.editor.isActive("codeBlock")??!1,isBlockquote:e.editor.isActive("blockquote")??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}const dQ=()=>L.jsx("div",{className:"menu-separator"}),fQ=(e,t,n)=>{switch(e){case"separator":return L.jsx(dQ,{},`separator-${Math.random()}`);case"undo":return L.jsx(un,{onClick:()=>t.chain().focus().undo().run(),disabled:!n.canUndo,icon:"icon-[mdi--undo]",title:"撤销"},"undo");case"redo":return L.jsx(un,{onClick:()=>t.chain().focus().redo().run(),disabled:!n.canRedo,icon:"icon-[mdi--redo]",title:"重做"},"redo");case"bold":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBold().run(),disabled:!n.canBold,isActive:n.isBold,icon:"icon-[mdi--format-bold]",title:"粗体"},"bold");case"italic":return L.jsx(un,{onClick:()=>t.chain().focus().toggleItalic().run(),disabled:!n.canItalic,isActive:n.isItalic,icon:"icon-[mdi--format-italic]",title:"斜体"},"italic");case"underline":return L.jsx(un,{onClick:()=>t.chain().focus().toggleUnderline().run(),disabled:!n.canUnderline,isActive:n.isUnderline,icon:"icon-[mdi--format-underline]",title:"下划线"},"underline");case"strike":return L.jsx(un,{onClick:()=>t.chain().focus().toggleStrike().run(),disabled:!n.canStrike,isActive:n.isStrike,icon:"icon-[mdi--format-strikethrough]",title:"删除线"},"strike");case"code":return L.jsx(un,{onClick:()=>t.chain().focus().toggleCode().run(),disabled:!n.canCode,isActive:n.isCode,icon:"icon-[mdi--code-tags]",title:"行内代码"},"code");case"heading":return L.jsx(lQ,{editor:t},"heading");case"fontSize":return L.jsx(sQ,{editor:t},"fontSize");case"color":return L.jsx(Qf,{editor:t,type:"text",title:"字体颜色"},"color");case"highlight":return L.jsx(Qf,{editor:t,type:"bg",title:"背景颜色"},"highlight");case"bulletList":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:n.isBulletList,icon:"icon-[mdi--format-list-bulleted]",title:"无序列表"},"bulletList");case"orderedList":return L.jsx(un,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:n.isOrderedList,icon:"icon-[mdi--format-list-numbered]",title:"有序列表"},"orderedList");case"codeBlock":return L.jsx(un,{onClick:()=>t.chain().focus().toggleCodeBlock().run(),isActive:n.isCodeBlock,icon:"icon-[mdi--code-tags]",title:"代码块"},"codeBlock");case"blockquote":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:n.isBlockquote,icon:"icon-[mdi--format-quote-close]",title:"引用"},"blockquote");case"link":return L.jsx(rI,{editor:t},"link");case"horizontalRule":return L.jsx(un,{onClick:()=>t.chain().focus().setHorizontalRule().run(),icon:"icon-[mdi--minus]",title:"分割线"},"horizontalRule");case"align":return L.jsx(eQ,{editor:t,children:L.jsx(un,{icon:"icon-[mdi--format-align-left]",title:"对齐方式"})},"align");case"image":return L.jsx(iQ,{editor:t,children:L.jsx(hn,{title:"插入图片",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",children:L.jsx("span",{className:"icon-[mdi--image]",style:{width:16,height:16,display:"inline-flex"}})})})},"image");case"table":return L.jsx(ZJ,{editor:t,children:L.jsx(hn,{title:"表格",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",className:t.isActive("table")?"is-active":"",children:L.jsx("span",{className:"icon-[mdi--table]",style:{width:16,height:16,display:"inline-flex"}})})})},"table");case"hardBreak":return L.jsx(un,{onClick:()=>t.chain().focus().setHardBreak().run(),icon:"icon-[mdi--keyboard-return]",title:"换行"},"hardBreak");case"variable":return L.jsx(XJ,{editor:t,children:L.jsx(hn,{title:"插入变量",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",children:L.jsx("span",{className:"icon-[mdi--code-braces]",style:{width:16,height:16,display:"inline-flex"}})})})},"variable");case"sourceCode":return L.jsx(YJ,{editor:t,children:L.jsx(hn,{title:"查看源码",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",children:L.jsx("span",{className:"icon-[mdi--xml]",style:{width:16,height:16,display:"inline-flex"}})})})},"sourceCode");case"htmlPreview":return L.jsx(JJ,{editor:t,children:L.jsx(hn,{title:"预览 HTML",mouseEnterDelay:.5,children:L.jsx("button",{type:"button",children:L.jsx("span",{className:"icon-[mdi--eye]",style:{width:16,height:16,display:"inline-flex"}})})})},"htmlPreview");case"emoji":return L.jsx(cQ,{editor:t},"emoji");default:return null}},hQ=({editor:e,config:t})=>{const n=Ei({editor:e,selector:uQ});return e?L.jsx("div",{className:"control-group",children:L.jsx("div",{className:"button-group",children:t.map(r=>fQ(r,e,n))})}):null};function Ub(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Aa=Ub();function iI(e){Aa=e}var Ra={exec:()=>null};function Lt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(cr.caret,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}var pQ=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),cr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},mQ=/^(?:[ \t]*(?:\n|$))+/,gQ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vQ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bQ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,aI=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sI=Lt(aI).replace(/bull/g,qb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),yQ=Lt(aI).replace(/bull/g,qb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,CQ=/^[^\n]+/,Gb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,SQ=Lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xQ=Lt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qb).getRegex(),Zf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wQ=Lt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Xb).replace("tag",Zf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lI=Lt(Kb).replace("hr",Cc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zf).getRegex(),EQ=Lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lI).getRegex(),Yb={blockquote:EQ,code:gQ,def:SQ,fences:vQ,heading:bQ,hr:Cc,html:wQ,lheading:sI,list:xQ,newline:mQ,paragraph:lI,table:Ra,text:CQ},cI=Lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zf).getRegex(),$Q={...Yb,lheading:yQ,table:cI,paragraph:Lt(Kb).replace("hr",Cc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cI).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zf).getRegex()},OQ={...Yb,html:Lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ra,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Lt(Kb).replace("hr",Cc).replace("heading",` *#{1,6} *[^
|
|
487
|
+
]`).replace("lheading",sI).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kQ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,MQ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uI=/^( {2,}|\\)\n(?!\s*$)/,NQ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hs=/[\p{P}\p{S}]/u,eh=/[\s\p{P}\p{S}]/u,Jb=/[^\s\p{P}\p{S}]/u,TQ=Lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,eh).getRegex(),dI=/(?!~)[\p{P}\p{S}]/u,IQ=/(?!~)[\s\p{P}\p{S}]/u,PQ=/(?:[^\s\p{P}\p{S}]|~)/u,AQ=Lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",pQ?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fI=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,RQ=Lt(fI,"u").replace(/punct/g,Hs).getRegex(),_Q=Lt(fI,"u").replace(/punct/g,dI).getRegex(),hI="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",DQ=Lt(hI,"gu").replace(/notPunctSpace/g,Jb).replace(/punctSpace/g,eh).replace(/punct/g,Hs).getRegex(),LQ=Lt(hI,"gu").replace(/notPunctSpace/g,PQ).replace(/punctSpace/g,IQ).replace(/punct/g,dI).getRegex(),jQ=Lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jb).replace(/punctSpace/g,eh).replace(/punct/g,Hs).getRegex(),zQ=Lt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Hs).getRegex(),BQ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",FQ=Lt(BQ,"gu").replace(/notPunctSpace/g,Jb).replace(/punctSpace/g,eh).replace(/punct/g,Hs).getRegex(),HQ=Lt(/\\(punct)/,"gu").replace(/punct/g,Hs).getRegex(),VQ=Lt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),WQ=Lt(Xb).replace("(?:-->|$)","-->").getRegex(),UQ=Lt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",WQ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),th=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,qQ=Lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",th).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pI=Lt(/^!?\[(label)\]\[(ref)\]/).replace("label",th).replace("ref",Gb).getRegex(),mI=Lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gb).getRegex(),KQ=Lt("reflink|nolink(?!\\()","g").replace("reflink",pI).replace("nolink",mI).getRegex(),gI=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Qb={_backpedal:Ra,anyPunctuation:HQ,autolink:VQ,blockSkip:AQ,br:uI,code:MQ,del:Ra,delLDelim:Ra,delRDelim:Ra,emStrongLDelim:RQ,emStrongRDelimAst:DQ,emStrongRDelimUnd:jQ,escape:kQ,link:qQ,nolink:mI,punctuation:TQ,reflink:pI,reflinkSearch:KQ,tag:UQ,text:NQ,url:Ra},GQ={...Qb,link:Lt(/^!?\[(label)\]\((.*?)\)/).replace("label",th).getRegex(),reflink:Lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",th).getRegex()},Zb={...Qb,emStrongRDelimAst:LQ,emStrongLDelim:_Q,delLDelim:zQ,delRDelim:FQ,url:Lt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",gI).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Lt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",gI).getRegex()},XQ={...Zb,br:Lt(uI).replace("{2,}","*").getRegex(),text:Lt(Zb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nh={normal:Yb,gfm:$Q,pedantic:OQ},Sc={normal:Qb,gfm:Zb,breaks:XQ,pedantic:GQ},YQ={"&":"&","<":"<",">":">",'"':""","'":"'"},vI=e=>YQ[e];function Lo(e,t){if(t){if(cr.escapeTest.test(e))return e.replace(cr.escapeReplace,vI)}else if(cr.escapeTestNoEncode.test(e))return e.replace(cr.escapeReplaceNoEncode,vI);return e}function bI(e){try{e=encodeURI(e).replace(cr.percentDecode,"%")}catch{return null}return e}function yI(e,t){var i;let n=e.replace(cr.findPipe,(a,s,l)=>{let c=!1,u=s;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(cr.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(cr.slashPipe,"|");return r}function xc(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function JQ(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function QQ(e,t=0){let n=t,r="";for(let o of e)if(o===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=o,n++;return r}function CI(e,t,n,r,o){let i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function ZQ(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
|
|
488
|
+
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[s]=a;return s.length>=o.length?i.slice(o.length):i}).join(`
|
|
489
|
+
`)}var rh=class{constructor(e){nn(this,"options");nn(this,"rules");nn(this,"lexer");this.options=e||Aa}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:xc(n,`
|
|
490
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=ZQ(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=xc(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:xc(t[0],`
|
|
491
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=xc(t[0],`
|
|
492
|
+
`).split(`
|
|
493
|
+
`),r="",o="",i=[];for(;n.length>0;){let a=!1,s=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))s.push(n[l]),a=!0;else if(!a)s.push(n[l]);else break;n=n.slice(l);let c=s.join(`
|
|
494
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
495
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
496
|
+
${c}`:c,o=o?`${o}
|
|
497
|
+
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=d,n.length===0)break;let f=i.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let h=f,p=h.raw+`
|
|
498
|
+
`+n.join(`
|
|
499
|
+
`),v=this.blockquote(p);i[i.length-1]=v,r=r.substring(0,r.length-h.raw.length)+v.raw,o=o.substring(0,o.length-h.text.length)+v.text;break}else if((f==null?void 0:f.type)==="list"){let h=f,p=h.raw+`
|
|
500
|
+
`+n.join(`
|
|
501
|
+
`),v=this.list(p);i[i.length-1]=v,r=r.substring(0,r.length-f.raw.length)+v.raw,o=o.substring(0,o.length-h.raw.length)+v.raw,n=p.substring(i.at(-1).raw.length).split(`
|
|
502
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:o}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let o=t[1].trim(),i=o.length>1,a={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let s=this.rules.other.listItemRegex(o),l=!1;for(;e;){let u=!1,d="",f="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let h=QQ(t[2].split(`
|
|
503
|
+
`,1)[0],t[1].length),p=e.split(`
|
|
504
|
+
`,1)[0],v=!h.trim(),m=0;if(this.options.pedantic?(m=2,f=h.trimStart()):v?m=t[1].length+1:(m=h.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=h.slice(m),m+=t[1].length),v&&this.rules.other.blankLine.test(p)&&(d+=p+`
|
|
505
|
+
`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),C=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m),E=this.rules.other.blockquoteBeginRegex(m);for(;e;){let $=e.split(`
|
|
506
|
+
`,1)[0],O;if(p=$,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),O=p):O=p.replace(this.rules.other.tabCharGlobal," "),C.test(p)||x.test(p)||S.test(p)||E.test(p)||b.test(p)||y.test(p))break;if(O.search(this.rules.other.nonSpaceChar)>=m||!p.trim())f+=`
|
|
507
|
+
`+O.slice(m);else{if(v||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(h)||x.test(h)||y.test(h))break;f+=`
|
|
508
|
+
`+p}v=!p.trim(),d+=$+`
|
|
509
|
+
`,e=e.substring($.length+1),h=O.slice(m)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),a.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),a.raw+=d}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u of a.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((n=u.tokens[0])==null?void 0:n.type)==="text"||((r=u.tokens[0])==null?void 0:r.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(u.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};u.checked=f.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}if(!a.loose){let d=u.tokens.filter(h=>h.type==="space"),f=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));a.loose=f}}if(a.loose)for(let u of a.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:o}}}table(e){var a;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=yI(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
510
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let s of r)this.rules.other.tableAlignRight.test(s)?i.align.push("right"):this.rules.other.tableAlignCenter.test(s)?i.align.push("center"):this.rules.other.tableAlignLeft.test(s)?i.align.push("left"):i.align.push(null);for(let s=0;s<n.length;s++)i.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:i.align[s]});for(let s of o)i.rows.push(yI(s,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
511
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=xc(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=JQ(t[2],"()");if(i===-2)return;if(i>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],o=i[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),CI(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return CI(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,i,a,s=o,l=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+o);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){s+=a;continue}else if((r[5]||r[6])&&o%3&&!((o+a)%3)){l+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+l);let u=[...r[0]][0].length,d=e.slice(0,o+r.index+u+a);if(Math.min(o,a)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,i,a,s=o,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+o);(r=l.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==o))continue;if(r[3]||r[4]){s+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s);let c=[...r[0]][0].length,u=e.slice(0,o+r.index+c+a),d=u.slice(o,-o);return{type:"del",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,o;if(t[2]==="@")r=t[0],o="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},bo=class d0{constructor(t){nn(this,"tokens");nn(this,"options");nn(this,"state");nn(this,"inlineQueue");nn(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Aa,this.options.tokenizer=this.options.tokenizer||new rh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:cr,block:nh.normal,inline:Sc.normal};this.options.pedantic?(n.block=nh.pedantic,n.inline=Sc.pedantic):this.options.gfm&&(n.block=nh.gfm,this.options.breaks?n.inline=Sc.breaks:n.inline=Sc.gfm),this.tokenizer.rules=n}static get rules(){return{block:nh,inline:Sc}}static lex(t,n){return new d0(n).lex(t)}static lexInline(t,n){return new d0(n).inlineTokens(t)}lex(t){t=t.replace(cr.carriageReturn,`
|
|
512
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var o,i,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(cr.tabCharGlobal," ").replace(cr.spaceLine,""));t;){let s;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(s=c.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let c=n.at(-1);s.raw.length===1&&c!==void 0?c.raw+=`
|
|
513
|
+
`:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
514
|
+
`)?"":`
|
|
515
|
+
`)+s.raw,c.text+=`
|
|
516
|
+
`+s.text,this.inlineQueue.at(-1).src=c.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
517
|
+
`)?"":`
|
|
518
|
+
`)+s.raw,c.text+=`
|
|
519
|
+
`+s.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let l=t;if((a=this.options.extensions)!=null&&a.startBlock){let c=1/0,u=t.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(this.state.top&&(s=this.tokenizer.paragraph(l))){let c=n.at(-1);r&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
|
|
520
|
+
`)?"":`
|
|
521
|
+
`)+s.raw,c.text+=`
|
|
522
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(s),r=l.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
523
|
+
`)?"":`
|
|
524
|
+
`)+s.raw,c.text+=`
|
|
525
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(s);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,u,d,f;this.tokenizer.lexer=this;let r=t,o=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=o[2]?o[2].length:0,r=r.slice(0,o.index+i)+"["+"a".repeat(o[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},r))??r;let a=!1,s="";for(;t;){a||(s=""),a=!1;let h;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(v=>(h=v.call({lexer:this},t,n))?(t=t.substring(h.raw.length),n.push(h),!0):!1))continue;if(h=this.tokenizer.escape(t)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.tag(t)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.link(t)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(h.raw.length);let v=n.at(-1);h.type==="text"&&(v==null?void 0:v.type)==="text"?(v.raw+=h.raw,v.text+=h.text):n.push(h);continue}if(h=this.tokenizer.emStrong(t,r,s)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.codespan(t)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.br(t)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.del(t,r,s)){t=t.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.autolink(t)){t=t.substring(h.raw.length),n.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(t))){t=t.substring(h.raw.length),n.push(h);continue}let p=t;if((f=this.options.extensions)!=null&&f.startInline){let v=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(y=>{b=y.call({lexer:this},m),typeof b=="number"&&b>=0&&(v=Math.min(v,b))}),v<1/0&&v>=0&&(p=t.substring(0,v+1))}if(h=this.tokenizer.inlineText(p)){t=t.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(s=h.raw.slice(-1)),a=!0;let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=h.raw,v.text+=h.text):n.push(h);continue}if(t){let v="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return n}},oh=class{constructor(e){nn(this,"options");nn(this,"parser");this.options=e||Aa}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(cr.notSpaceStart))==null?void 0:i[0],o=e.replace(cr.endingNewline,"")+`
|
|
526
|
+
`;return r?'<pre><code class="language-'+Lo(r)+'">'+(n?o:Lo(o,!0))+`</code></pre>
|
|
527
|
+
`:"<pre><code>"+(n?o:Lo(o,!0))+`</code></pre>
|
|
528
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
529
|
+
${this.parser.parse(e)}</blockquote>
|
|
530
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
531
|
+
`}hr(e){return`<hr>
|
|
532
|
+
`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a<e.items.length;a++){let s=e.items[a];r+=this.listitem(s)}let o=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+o+i+`>
|
|
533
|
+
`+r+"</"+o+`>
|
|
534
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
535
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
536
|
+
`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){let i=e.rows[o];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
537
|
+
<thead>
|
|
538
|
+
`+t+`</thead>
|
|
539
|
+
`+r+`</table>
|
|
540
|
+
`}tablerow({text:e}){return`<tr>
|
|
541
|
+
${e}</tr>
|
|
542
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
543
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Lo(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=bI(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+Lo(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=bI(e);if(o===null)return Lo(n);e=o;let i=`<img src="${e}" alt="${Lo(n)}"`;return t&&(i+=` title="${Lo(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Lo(e.text)}},e0=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},yo=class f0{constructor(t){nn(this,"options");nn(this,"renderer");nn(this,"textRenderer");this.options=t||Aa,this.options.renderer=this.options.renderer||new oh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new e0}static parse(t,n){return new f0(n).parse(t)}static parseInline(t,n){return new f0(n).parseInline(t)}parse(t){var r,o;this.renderer.parser=this;let n="";for(let i=0;i<t.length;i++){let a=t[i];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[a.type]){let l=a,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let s=a;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){var o,i;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let s=t[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[s.type]){let c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=c||"";continue}}let l=s;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},wc=(lh=class{constructor(e){nn(this,"options");nn(this,"block");this.options=e||Aa}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?bo.lex:bo.lexInline}provideParser(e=this.block){return e?yo.parse:yo.parseInline}},nn(lh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),nn(lh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),lh),eZ=class{constructor(...e){nn(this,"defaults",Ub());nn(this,"options",this.setOptions);nn(this,"parse",this.parseMarkdown(!0));nn(this,"parseInline",this.parseMarkdown(!1));nn(this,"Parser",yo);nn(this,"Renderer",oh);nn(this,"TextRenderer",e0);nn(this,"Lexer",bo);nn(this,"Tokenizer",rh);nn(this,"Hooks",wc);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let a=i;for(let s of a.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of a.rows)for(let l of s)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=i;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(s=>{let l=a[s].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=t.renderers[o.name];i?t.renderers[o.name]=function(...a){let s=o.renderer.apply(this,a);return s===!1&&(s=i.apply(this,a)),s}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new oh(this.defaults);for(let i in n.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,s=n.renderer[a],l=o[a];o[a]=(...c)=>{let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new rh(this.defaults);for(let i in n.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,s=n.tokenizer[a],l=o[a];o[a]=(...c)=>{let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new wc;for(let i in n.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,s=n.hooks[a],l=o[a];wc.passThroughHooks.has(i)?o[a]=c=>{if(this.defaults.async&&wc.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await s.call(o,c);return l.call(o,d)})();let u=s.call(o,c);return l.call(o,u)}:o[a]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await s.apply(o,c);return d===!1&&(d=await l.apply(o,c)),d})();let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let s=[];return s.push(i.call(this,a)),o&&(s=s.concat(o.call(this,a))),s}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return bo.lex(e,t??this.defaults)}parser(e,t){return yo.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(t):t,s=await(o.hooks?await o.hooks.provideLexer(e):e?bo.lex:bo.lexInline)(a,o),l=o.hooks?await o.hooks.processAllTokens(s):s;o.walkTokens&&await Promise.all(this.walkTokens(l,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser(e):e?yo.parse:yo.parseInline)(l,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let a=(o.hooks?o.hooks.provideLexer(e):e?bo.lex:bo.lexInline)(t,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let s=(o.hooks?o.hooks.provideParser(e):e?yo.parse:yo.parseInline)(a,o);return o.hooks&&(s=o.hooks.postprocess(s)),s}catch(a){return i(a)}}}onError(e,t){return n=>{if(n.message+=`
|
|
544
|
+
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Lo(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},_a=new eZ;function Qt(e,t){return _a.parse(e,t)}Qt.options=Qt.setOptions=function(e){return _a.setOptions(e),Qt.defaults=_a.defaults,iI(Qt.defaults),Qt},Qt.getDefaults=Ub,Qt.defaults=Aa,Qt.use=function(...e){return _a.use(...e),Qt.defaults=_a.defaults,iI(Qt.defaults),Qt},Qt.walkTokens=function(e,t){return _a.walkTokens(e,t)},Qt.parseInline=_a.parseInline,Qt.Parser=yo,Qt.parser=yo.parse,Qt.Renderer=oh,Qt.TextRenderer=e0,Qt.Lexer=bo,Qt.lexer=bo.lex,Qt.Tokenizer=rh,Qt.Hooks=wc,Qt.parse=Qt,Qt.options,Qt.setOptions,Qt.use,Qt.walkTokens,Qt.parseInline,yo.parse,bo.lex;function tZ(e,t){const r=t.split(`
|
|
545
|
+
`).flatMap(o=>[o,""]).map(o=>`${e}${o}`).join(`
|
|
546
|
+
`);return r.slice(0,r.length-1)}function nZ(e,t){const n=[];return Array.from(e.keys()).forEach(r=>{(!t||!t.marks||!t.marks.map(o=>o.type).includes(r))&&n.push(r)}),n}function rZ(e,t){const n=[];return Array.from(t.entries()).forEach(([r,o])=>{e.has(r)||n.push({type:r,mark:o})}),n}function oZ(e,t,n,r){const o=!n,i=n&&n.type==="text"&&(!n.marks||n.marks.length===0),a=n&&n.type==="text"&&n.marks&&!r(t,new Map(n.marks.map(l=>[l.type,l]))),s=[];if(o||i||a)if(n&&n.type==="text"&&n.marks){const l=new Map(n.marks.map(c=>[c.type,c]));Array.from(e.keys()).reverse().forEach(c=>{l.has(c)||s.push(c)})}else(o||i)&&s.push(...Array.from(e.keys()).reverse());return s}function iZ(e,t){let n="";return Array.from(e.keys()).reverse().forEach(r=>{const o=e.get(r),i=t(r,o);i&&(n=i+n)}),e.clear(),n}function aZ(e,t,n){let r="";return Array.from(e.entries()).forEach(([o,i])=>{const a=n(o,i);a&&(r+=a),t.set(o,i)}),r}function t0(e){const n=(e.raw||e.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return n?{isTask:!0,checked:n[2].toLowerCase()==="x",indentLevel:n[1].length}:{isTask:!1,indentLevel:0}}function ih(e,t){return typeof e!="string"?"json":t}var sZ=class{constructor(e){this.activeParseLexer=null,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.lastParseResult=null;var t,n,r,o,i;this.markedInstance=(t=e==null?void 0:e.marked)!=null?t:Qt,this.indentStyle=(r=(n=e==null?void 0:e.indentation)==null?void 0:n.style)!=null?r:"space",this.indentSize=(i=(o=e==null?void 0:e.indentation)==null?void 0:o.size)!=null?i:2,this.baseExtensions=(e==null?void 0:e.extensions)||[],e!=null&&e.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e!=null&&e.extensions&&(this.baseExtensions=e.extensions,ou(e.extensions).forEach(s=>this.registerExtension(s)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){var t,n;this.extensions.push(e);const r=Vt(nt(e,"code")),o=e.name;r&&this.codeTypes.add(o);const i=nt(e,"markdownTokenName")||o,a=nt(e,"parseMarkdown"),s=nt(e,"renderMarkdown"),l=nt(e,"markdownTokenizer"),c=(t=nt(e,"markdownOptions"))!=null?t:null,u=(n=c==null?void 0:c.indentsContent)!=null?n:!1,d=c==null?void 0:c.htmlReopen,f={tokenName:i,nodeName:o,parseMarkdown:a,renderMarkdown:s,isIndenting:u,htmlReopen:d,tokenizer:l};if(i&&a){const h=this.registry.get(i)||[];h.push(f),this.registry.set(i,h)}if(s){const h=this.nodeTypeRegistry.get(o)||[];h.push(f),this.nodeTypeRegistry.set(o,h)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>e.blockTokens(t)}}tokenizeInline(e){var t;return((t=this.activeParseLexer)!=null?t:this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;const{name:t,start:n,level:r="inline",tokenize:o}=e,i=this.createTokenizerHelpers.bind(this),a=this.createLexer.bind(this);let s;n?s=typeof n=="function"?n:c=>c.indexOf(n):s=c=>{const u=o(c,[],this.createTokenizerHelpers(this.createLexer()));return u&&u.raw?c.indexOf(u.raw):-1};const l={name:t,level:r,start:s,tokenizer(c,u){const d=this.lexer?i(this.lexer):i(a()),f=o(c,u,d);if(f&&f.type)return{...f,type:f.type||t,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){const t=this.getHandlersForToken(e);if(t.length>0)return t[0];const n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return"";const t=this.renderNodes(e,e);return this.isEmptyOutput(t)?"":t}isEmptyOutput(e){return!e||e.trim()===""?!0:e.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(e){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const r=n.lex(e);return{type:"doc",content:this.parseTokens(r,!0)}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){const n=e.reduce((i,a,s)=>(a.type!=="space"&&i.push(s),i),[]);let r=-1,o=0;return e.flatMap((i,a)=>{for(var s;o<n.length&&n[o]<a;)r=n[o],o+=1;if(t&&i.type==="space"){const c=(s=n[o])!=null?s:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,c)}const l=this.parseToken(i,t);return l===null?[]:Array.isArray(l)?l:[l]})}createImplicitEmptyParagraphsFromSpace(e,t,n){const r=this.countParagraphSeparators(e.raw||"");if(r===0)return[];const i=Math.max(r-(t===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,`
|
|
547
|
+
`).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type==="list")return this.parseListToken(e);const n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(e,r),s=this.normalizeParseResult(a);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);const t=e.items.some(s=>t0(s).isTask),n=e.items.some(s=>!t0(s).isTask);if(!t||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(e);const r=[];let o=[],i=null;for(let s=0;s<e.items.length;s+=1){const l=e.items[s],{isTask:c,checked:u,indentLevel:d}=t0(l);let f=l;if(c){const v=(l.raw||l.text||"").split(`
|
|
548
|
+
`),m=v[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),b=m?m[2]:"";let y=[];if(v.length>1&&v.slice(1).join(`
|
|
549
|
+
`).trim()){const x=v.slice(1),S=x.filter(E=>E.trim());if(S.length>0){const E=Math.min(...S.map(k=>k.length-k.trimStart().length)),O=x.map(k=>k.trim()?k.slice(E):"").join(`
|
|
550
|
+
`).trim();O&&(y=this.markedInstance.lexer(`${O}
|
|
551
|
+
`))}}f={type:"taskItem",raw:"",mainContent:b,indentLevel:d,checked:u??!1,text:b,tokens:this.tokenizeInline(b),nestedTokens:y}}const h=c?"taskList":"list";i!==h?(o.length>0&&r.push({type:i,items:o}),o=[f],i=h):o.push(f)}o.length>0&&r.push({type:i,items:o});const a=[];for(let s=0;s<r.length;s+=1){const l=r[s],c={...e,type:l.type,items:l.items},u=this.parseToken(c);u&&(Array.isArray(u)?a.push(...u):a.push(u))}return a.length>0?a:null}parseTokenWithHandlers(e){if(!e.type)return null;const t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(o=>{if(!o.parseMarkdown)return!1;const i=o.parseMarkdown(e,n),a=this.normalizeParseResult(i);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const o=this.lastParseResult;return this.lastParseResult=null,o}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:"text",text:e,marks:t||void 0}),createNode:(e,t,n)=>{const r={type:e,attrs:t||void 0,content:n||void 0};return(!t||Object.keys(t).length===0)&&delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){var t,n,r,o;const i=[];for(let a=0;a<e.length;a+=1){const s=e[a];if(s.type==="text")i.push({type:"text",text:TS(s.text||"")});else if(s.type==="html"){const l=((n=(t=s.raw)!=null?t:s.text)!=null?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(l),u=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(l)){const f=u[1],h=this.escapeRegex(f),p=new RegExp(`^<\\/\\s*${h}\\b`,"i");let v=-1;const m=[l];for(let b=a+1;b<e.length;b+=1){const y=e[b],C=((o=(r=y.raw)!=null?r:y.text)!=null?o:"").toString();if(m.push(C),y.type==="html"&&p.test(C)){v=b;break}}if(v!==-1){const b=m.join(""),y={type:"html",raw:b,text:b,block:!1},C=this.parseHTMLToken(y);if(C){const x=this.normalizeParseResult(C);Array.isArray(x)?i.push(...x):x&&i.push(x)}a=v;continue}}const d=this.parseHTMLToken(s);if(d){const f=this.normalizeParseResult(d);Array.isArray(f)?i.push(...f):f&&i.push(f)}}else if(s.type){const l=this.getHandlerForToken(s.type);if(l&&l.parseMarkdown){const c=this.createParseHelpers(),u=l.parseMarkdown(s,c);if(this.isMarkResult(u)){const d=this.applyMarkToContent(u.mark,u.content,u.attrs);i.push(...d)}else{const d=this.normalizeParseResult(u);Array.isArray(d)?i.push(...d):d&&i.push(d)}}else s.tokens&&i.push(...this.parseInlineTokens(s.tokens))}}return i}applyMarkToContent(e,t,n){return t.map(r=>{if(r.type==="text"){const o=r.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...r,marks:[...o,i]}}return{...r,content:r.content?this.applyMarkToContent(e,r.content,n):void 0}})}isMarkResult(e){return e&&typeof e=="object"&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:TS(e.text||"")};case"html":return this.parseHTMLToken(e);case"space":return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){const t=e.text||e.raw||"";if(!t.trim())return null;if(typeof window>"u")return e.block?{type:"paragraph",content:[{type:"text",text:t}]}:{type:"text",text:t};try{const n=U2(t,this.baseExtensions);return n.type==="doc"&&n.content?e.block?n.content:n.content.length===1&&n.content[0].type==="paragraph"&&n.content[0].content?n.content[0].content:n.content:n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}encodeTextForMarkdown(e,t,n){return(n==null?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(o=>this.codeTypes.has(typeof o=="string"?o:o.type))?e:F_(e)}renderNodeToMarkdown(e,t,n=0,r=0,o={}){var i;if(e.type==="text")return this.encodeTextForMarkdown(e.text||"",e,t);if(!e.type)return"";const a=this.getHandlerForToken(e.type);if(!a)return"";const s=Array.isArray(t==null?void 0:t.content)&&n>0?t.content[n-1]:void 0,l={renderChildren:(d,f)=>{const h=a.isIndenting?r+1:r;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,e,f||"",n,h):this.renderNodes(d,e,f||"",n,h)},renderChild:(d,f)=>{const h=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(d,e,f,h)},indent:d=>this.indentString+d,wrapInBlock:tZ},c={index:n,level:r,parentType:t==null?void 0:t.type,previousNode:s,meta:{parentAttrs:t==null?void 0:t.attrs,...o}};return((i=a.renderMarkdown)==null?void 0:i.call(a,e,l,c))||""}renderNodes(e,t,n="",r=0,o=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,o):e.type?this.renderNodeToMarkdown(e,t,r,o):""}renderNodesWithMarkBoundaries(e,t,n="",r=0){const o=[],i=new Map,a=new Set,s=new Map;return e.forEach((l,c)=>{const u=c<e.length-1?e[c+1]:null;if(l.type)if(l.type==="text"){let d=this.encodeTextForMarkdown(l.text||"",l,t);const f=new Map((l.marks||[]).map(S=>[S.type,S])),h=rZ(i,f),p=nZ(f,u),v=p.filter(S=>i.has(S)),m=v.length>0&&h.length>0;let b="";if(p.length>0&&!m){const S=d.match(/(\s+)$/);S&&(b=S[1],d=d.slice(0,-b.length))}m||p.forEach(S=>{if(!i.has(S))return;const E=f.get(S),$=this.getMarkClosing(S,E,s.get(S));$&&(d+=$),i.has(S)&&(i.delete(S),s.delete(S))});let y="";if(h.length>0){const S=d.match(/^(\s+)/);S&&(y=S[1],d=d.slice(y.length))}h.forEach(({type:S,mark:E})=>{const $=a.has(S)?"html":"markdown",O=this.getMarkOpening(S,E,$);O&&(d=O+d),s.set(S,$),a.delete(S)}),m||h.slice().reverse().forEach(({type:S,mark:E})=>{i.set(S,E)}),d=y+d;let C;if(m){const S=new Set(((u==null?void 0:u.marks)||[]).map(E=>E.type));h.forEach(({type:E})=>{S.has(E)&&this.getHtmlReopenTags(E)&&a.add(E)}),C=[...h.map(E=>E.type),...v]}else C=oZ(i,f,u,this.markSetsEqual.bind(this));let x="";if(C.length>0){const S=d.match(/(\s+)$/);S&&(x=S[1],d=d.slice(0,-x.length))}C.forEach(S=>{var E;const $=(E=i.get(S))!=null?E:f.get(S),O=this.getMarkClosing(S,$,s.get(S));O&&(d+=O),i.delete(S),s.delete(S)}),d+=x,d+=b,o.push(d)}else{const d=new Map(i),f=new Map(s),h=iZ(i,(m,b)=>this.getMarkClosing(m,b,s.get(m)));s.clear();const p=this.renderNodeToMarkdown(l,t,c,r),v=l.type==="hardBreak"?"":aZ(d,i,(m,b)=>{var y;const C=(y=f.get(m))!=null?y:"markdown";return s.set(m,C),this.getMarkOpening(m,b,C)});o.push(h+p+v)}}),o.join(n)}getMarkOpening(e,t,n="markdown"){var r;if(n==="html")return((r=this.getHtmlReopenTags(e))==null?void 0:r.open)||"";const o=this.getHandlersForNodeType(e),i=o.length>0?o[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",s={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const l=i.renderMarkdown(s,{renderChildren:()=>a,renderChild:()=>a,indent:u=>u,wrapInBlock:(u,d)=>u+d},{index:0,level:0,parentType:"text",meta:{}}),c=l.indexOf(a);return c>=0?l.substring(0,c):""}catch(l){throw new Error(`Failed to get mark opening for ${e}: ${l}`)}}getMarkClosing(e,t,n="markdown"){var r;if(n==="html")return((r=this.getHtmlReopenTags(e))==null?void 0:r.close)||"";const o=this.getHandlersForNodeType(e),i=o.length>0?o[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",s={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const l=i.renderMarkdown(s,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),c=l.indexOf(a),u=c+a.length;return c>=0?l.substring(u):""}catch(l){throw new Error(`Failed to get mark closing for ${e}: ${l}`)}}getHtmlReopenTags(e){const t=this.getHandlersForNodeType(e),n=t.length>0?t[0]:void 0;return n==null?void 0:n.htmlReopen}markSetsEqual(e,t){return e.size!==t.size?!1:Array.from(e.keys()).every(n=>t.has(n))}},SI=sZ,lZ=_t.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!(t!=null&&t.contentType)||ih(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return Qr.setContent(e,t);const r=this.editor.markdown.parse(e);return Qr.setContent(r,t)},insertContent:(e,t)=>{if(!(t!=null&&t.contentType)||ih(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return Qr.insertContent(e,t);const r=this.editor.markdown.parse(e);return Qr.insertContent(r,t)},insertContentAt:(e,t,n)=>{if(!(n!=null&&n.contentType)||ih(t,n==null?void 0:n.contentType)!=="markdown"||!this.editor.markdown)return Qr.insertContentAt(e,t,n);const o=this.editor.markdown.parse(t);return Qr.insertContentAt(e,o,n)}}},addStorage(){return{manager:new SI({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new SI({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||ih(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const t=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=t}});function ah(e){return e==="left"||e==="right"||e==="center"?e:null}function cZ(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return ah(t||n)}function uZ(e){return ah(e==null?void 0:e.align)}function xI(){return{default:null,parseHTML:e=>cZ(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var dZ=Tn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var t,n;const r=e.getAttribute("colwidth"),o=r?r.split(",").map(i=>parseInt(i,10)):null;if(!o){const i=(t=e.closest("table"))==null?void 0:t.querySelectorAll("colgroup > col"),a=Array.from(((n=e.parentElement)==null?void 0:n.children)||[]).indexOf(e);if(a&&a>-1&&i&&i[a]){const s=i[a].getAttribute("width");return s?[parseInt(s,10)]:null}}return o}},align:xI()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",en(this.options.HTMLAttributes,e),0]}}),fZ=Tn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}},align:xI()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",en(this.options.HTMLAttributes,e),0]}}),hZ=Tn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",en(this.options.HTMLAttributes,e),0]}});function n0(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function wI(e,t,n,r,o,i){var a;let s=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u!==null)for(let f=0,h=0;f<u.childCount;f+=1){const{colspan:p,colwidth:v}=u.child(f).attrs;for(let m=0;m<p;m+=1,h+=1){const b=o===h?i:v&&v[m],y=b?`${b}px`:"";if(s+=b||r,b||(l=!1),c){if(c.style.width!==y){const[C,x]=n0(r,b);c.style.setProperty(C,x)}c=c.nextSibling}else{const C=document.createElement("col"),[x,S]=n0(r,b);C.style.setProperty(x,S),t.appendChild(C)}}}for(;c;){const f=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=f}const d=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);l&&!d?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var pZ=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),wI(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,wI(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function mZ(e,t,n,r){let o=0,i=!0;const a=[],s=e.firstChild;if(!s)return{};for(let d=0,f=0;d<s.childCount;d+=1){const{colspan:h,colwidth:p}=s.child(d).attrs;for(let v=0;v<h;v+=1,f+=1){const m=n===f?r:p&&p[v];o+=m||t,m||(i=!1);const[b,y]=n0(t,m);a.push(["col",{style:`${b}: ${y}`}])}}const l=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:l,tableMinWidth:c}}function EI(e,t){return e.createAndFill()}function gZ(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function vZ(e,t,n,r,o){const i=gZ(e),a=[],s=[];for(let c=0;c<n;c+=1){const u=EI(i.cell);if(u&&s.push(u),r){const d=EI(i.header_cell);d&&a.push(d)}}const l=[];for(let c=0;c<t;c+=1)l.push(i.row.createChecked(null,r&&c===0?a:s));return i.table.createChecked(null,l)}function bZ(e){return e instanceof an}var sh=({editor:e})=>{const{selection:t}=e.state;if(!bZ(t))return!1;let n=0;const r=tS(t.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},yZ="";function CZ(e){return(e||"").replace(/\s+/g," ").trim()}function SZ(e,t,n={}){var r;const o=(r=n.cellLineSeparator)!=null?r:yZ;if(!e||!e.content||e.content.length===0)return"";const i=[];e.content.forEach(v=>{const m=[];v.content&&v.content.forEach(b=>{let y="";b.content&&Array.isArray(b.content)&&b.content.length>1?y=b.content.map($=>t.renderChildren($)).join(o):y=b.content?t.renderChildren(b.content):"";const C=CZ(y),x=b.type==="tableHeader",S=uZ(b.attrs);m.push({text:C,isHeader:x,align:S})}),i.push(m)});const a=i.reduce((v,m)=>Math.max(v,m.length),0);if(a===0)return"";const s=new Array(a).fill(0);i.forEach(v=>{var m;for(let b=0;b<a;b+=1){const C=(((m=v[b])==null?void 0:m.text)||"").length;C>s[b]&&(s[b]=C),s[b]<3&&(s[b]=3)}});const l=(v,m)=>v+" ".repeat(Math.max(0,m-v.length)),c=i[0],u=c.some(v=>v.isHeader),d=new Array(a).fill(null);i.forEach(v=>{var m;for(let b=0;b<a;b+=1)!d[b]&&((m=v[b])!=null&&m.align)&&(d[b]=v[b].align)});let f=`
|
|
552
|
+
`;const h=new Array(a).fill(0).map((v,m)=>u&&c[m]&&c[m].text||"");return f+=`| ${h.map((v,m)=>l(v,s[m])).join(" | ")} |
|
|
553
|
+
`,f+=`| ${s.map((v,m)=>{const b=Math.max(3,v),y=d[m];return y==="left"?`:${"-".repeat(b)}`:y==="right"?`${"-".repeat(b)}:`:y==="center"?`:${"-".repeat(b)}:`:"-".repeat(b)}).join(" | ")} |
|
|
554
|
+
`,(u?i.slice(1):i).forEach(v=>{f+=`| ${new Array(a).fill(0).map((m,b)=>l(v[b]&&v[b].text||"",s[b])).join(" | ")} |
|
|
555
|
+
`}),f}var xZ=SZ,wZ=Tn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:pZ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=mZ(e,this.options.cellMinWidth),i=t.style;function a(){return i||(r?`width: ${r}`:`min-width: ${o}`)}const s=["table",en(this.options.HTMLAttributes,t,{style:a()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},s]:s},parseMarkdown:(e,t)=>{const n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){const o=[];e.header.forEach((i,a)=>{var s;const l=ah((s=r[a])!=null?s:i.align),c=l?{align:l}:{};o.push(t.createNode("tableHeader",c,[{type:"paragraph",content:t.parseInline(i.tokens)}]))}),n.push(t.createNode("tableRow",{},o))}return e.rows&&e.rows.forEach(o=>{const i=[];o.forEach((a,s)=>{var l;const c=ah((l=r[s])!=null?l:a.align),u=c?{align:c}:{};i.push(t.createNode("tableCell",u,[{type:"paragraph",content:t.parseInline(a.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>xZ(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const a=vZ(i.schema,e,t,n);if(o){const s=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(lt.near(r.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>aj(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>sj(e,t),deleteColumn:()=>({state:e,dispatch:t})=>cj(e,t),addRowBefore:()=>({state:e,dispatch:t})=>dj(e,t),addRowAfter:()=>({state:e,dispatch:t})=>fj(e,t),deleteRow:()=>({state:e,dispatch:t})=>pj(e,t),deleteTable:()=>({state:e,dispatch:t})=>Sj(e,t),mergeCells:()=>({state:e,dispatch:t})=>Rx(e,t),splitCell:()=>({state:e,dispatch:t})=>_x(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>yl("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>yl("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>yj(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Rx(e,t)?!0:_x(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>vj(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>Lx(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Lx(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Tx(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=an.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:sh,"Mod-Backspace":sh,Delete:sh,"Mod-Delete":sh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Ij({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Fj({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Vt(nt(e,"tableRole",t))}}}),EZ=_t.create({name:"tableKit",addExtensions(){const e=[];return this.options.table!==!1&&e.push(wZ.configure(this.options.table)),this.options.tableCell!==!1&&e.push(dZ.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(fZ.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(hZ.configure(this.options.tableRow)),e}}),$Z=_t.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),OZ=$Z;const kZ=_t.create({name:"pasteMarkdown",addProseMirrorPlugins(){const{editor:e}=this;return[new Kt({props:{handlePaste(t,n,r){var i;const o=(i=n.clipboardData)==null?void 0:i.getData("text/plain");if(!o)return!1;if(e.markdown&&MZ(o)){const{state:a,dispatch:s}=t,l=e.markdown.parse(o);return e.commands.insertContent(l),!0}return!1}}})]}});function MZ(e){return/^#{1,6}\s/.test(e)||/\*\*[^*]+\*\*/.test(e)||/\[.+\]\(.+\)/.test(e)||/^[-*+]\s/.test(e)}const NZ=()=>L.jsx("div",{className:"menu-separator"}),TZ=(e,t,n,r)=>{switch(e){case"separator":return L.jsx(NZ,{},`separator-${r}`);case"heading":return L.jsxs(w.Fragment,{children:[L.jsx(un,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:n.isHeading1,icon:"icon-[mdi--format-header-1]",title:"标题1"}),L.jsx(un,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:n.isHeading2,icon:"icon-[mdi--format-header-2]",title:"标题2"})]},`heading-${r}`);case"bulletList":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:n.isBulletList,icon:"icon-[mdi--format-list-bulleted]",title:"无序列表"},"bulletList");case"orderedList":return L.jsx(un,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:n.isOrderedList,icon:"icon-[mdi--format-list-numbered]",title:"有序列表"},"orderedList");case"codeBlock":return L.jsx(un,{onClick:()=>t.chain().focus().toggleCodeBlock().run(),isActive:n.isCodeBlock,icon:"icon-[mdi--code-tags]",title:"代码块"},"codeBlock");case"blockquote":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:n.isBlockquote,icon:"icon-[mdi--format-quote-close]",title:"引用"},"blockquote");default:return null}},IZ=({editor:e,config:t})=>{const n=Ei({editor:e,selector:r=>({isHeading1:r.editor.isActive("heading",{level:1}),isHeading2:r.editor.isActive("heading",{level:2}),isBulletList:r.editor.isActive("bulletList"),isOrderedList:r.editor.isActive("orderedList"),isCodeBlock:r.editor.isActive("codeBlock"),isBlockquote:r.editor.isActive("blockquote")})});return L.jsx(L.Fragment,{children:t.map((r,o)=>TZ(r,e,n,o))})},PZ=()=>L.jsx("div",{className:"menu-separator"}),AZ=(e,t,n)=>{switch(e){case"separator":return L.jsx(PZ,{},`separator-${Math.random()}`);case"bold":return L.jsx(un,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:n.isBold,icon:"icon-[mdi--format-bold]",title:"粗体"},"bold");case"italic":return L.jsx(un,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:n.isItalic,icon:"icon-[mdi--format-italic]",title:"斜体"},"italic");case"underline":return L.jsx(un,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:n.isUnderline,icon:"icon-[mdi--format-underline]",title:"下划线"},"underline");case"strike":return L.jsx(un,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:n.isStrike,icon:"icon-[mdi--format-strikethrough]",title:"删除线"},"strike");case"code":return L.jsx(un,{onClick:()=>t.chain().focus().toggleCode().run(),isActive:n.isCode,icon:"icon-[mdi--code-tags]",title:"行内代码"},"code");case"color":return L.jsx(Qf,{editor:t,type:"text",title:"字体颜色"},"color");case"highlight":return L.jsx(Qf,{editor:t,type:"bg",title:"背景颜色"},"highlight");case"link":return L.jsx(rI,{editor:t},"link");default:return null}},RZ=({editor:e,config:t})=>{const n=Ei({editor:e,selector:r=>({isBold:r.editor.isActive("bold"),isItalic:r.editor.isActive("italic"),isUnderline:r.editor.isActive("underline"),isStrike:r.editor.isActive("strike"),isCode:r.editor.isActive("code")})});return L.jsx(L.Fragment,{children:t.map(r=>AZ(r,e,n))})},_Z=({editor:e,node:t,deleteNode:n,selected:r})=>{const[o,i]=w.useState([]),a=w.useRef(null);w.useEffect(()=>{const l=()=>{const c=[],{doc:u}=e.state;u.descendants((d,f)=>{d.type.name==="heading"&&d.attrs.id&&c.push({level:d.attrs.level,text:d.textContent,pos:f,id:d.attrs.id})}),i(c)};return l(),e.on("update",l),()=>e.off("update",l)},[e]);const s=l=>{const c=document.getElementById(l.id);c&&(c.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{e.commands.setTextSelection(l.pos),e.commands.focus()},300))};return L.jsxs(gu,{ref:a,className:"outline-node react-component","data-drag-handle":!0,contentEditable:!1,style:{background:"#f8f9fa",border:r?"2px solid #1890ff":"1px solid #e9ecef",borderRadius:"8px",padding:"16px",margin:"16px 0",color:"#333"},children:[L.jsxs("div",{className:"outline-node-header",contentEditable:!1,style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid #e9ecef",color:"#333"},children:[L.jsx("span",{className:"outline-node-title",style:{fontWeight:600,fontSize:"14px",color:"#333"},children:"目录"}),L.jsx("button",{className:"outline-node-delete",onClick:n,title:"删除目录",type:"button",tabIndex:-1,style:{width:"20px",height:"20px",padding:0,border:"none",borderRadius:"50%",background:"transparent",color:"#999",cursor:"pointer",fontSize:"16px",lineHeight:1},onMouseEnter:l=>{l.target.style.background="#ff4d4f",l.target.style.color="#fff"},onMouseLeave:l=>{l.target.style.background="transparent",l.target.style.color="#999"},children:"×"})]}),o.length===0?L.jsx("div",{className:"outline-node-empty",style:{color:"#999",fontSize:"13px",textAlign:"center",padding:"12px"},children:"暂无标题"}):L.jsx("nav",{className:"outline-node-nav",style:{color:"#333"},children:L.jsx("ul",{className:"outline-node-list",style:{listStyle:"none",padding:0,margin:0,overflowY:"auto",color:"#333"},children:o.map((l,c)=>{const u=l.level===1?"8px":l.level===2?"20px":l.level===3?"32px":l.level===4?"44px":l.level===5?"56px":"68px",d=l.level<=2?"13px":"12px",f=l.level===1?500:"normal",h=l.level>=5?"#999":"#666";return L.jsx("li",{className:`outline-node-item outline-node-level-${l.level}`,style:{padding:0,margin:0,color:h},children:L.jsx("span",{className:"outline-node-link","data-href":`#${l.id}`,onClick:()=>s(l),style:{display:"block",padding:"6px 8px",paddingLeft:u,fontSize:d,fontWeight:f,color:h,textDecoration:"none",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",borderRadius:"4px"},onMouseEnter:p=>{p.target.style.background="#e6f7ff",p.target.style.color="#1890ff"},onMouseLeave:p=>{p.target.style.background="transparent",p.target.style.color=h},children:l.text||"(空标题)"})},`${l.pos}-${c}`)})})})]})},DZ=Tn.create({name:"outline",group:"block",atom:!0,defining:!0,selectable:!1,draggable:!1,parseHTML(){return[{tag:'div[data-type="outline"]'}]},renderHTML({HTMLAttributes:e}){const t=[],n=this.editor;n&&n.state.doc.descendants((a,s)=>{a.type.name==="heading"&&a.attrs.id&&t.push({level:a.attrs.level,text:a.textContent,pos:s,id:a.attrs.id})});let r="";t.length===0?r='<div style="color: #999; font-size: 13px; text-align: center; padding: 12px;">暂无标题</div>':r=`<nav><ul style="list-style: none; padding: 0; margin: 0; overflow-y: auto;">${t.map(s=>{const l=s.level===1?"8px":s.level===2?"20px":s.level===3?"32px":s.level===4?"44px":s.level===5?"56px":"68px",c=s.level<=2?"13px":"12px",u=s.level===1?"500":"normal",d=s.level>=5?"#999":"#666";return`<li class="outline-node-item outline-node-level-${s.level}" style="padding: 0; margin: 0; color: ${d}; list-style: none;">
|
|
556
|
+
<a href="#${s.id}" style="display: block; padding: 6px 8px; padding-left: ${l}; font-size: ${c}; font-weight: ${u}; color: ${d}; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
|
557
|
+
${s.text||"(空标题)"}
|
|
558
|
+
</a>
|
|
559
|
+
</li>`}).join("")}</ul></nav>`;const o=`<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e9ecef;">
|
|
560
|
+
<span style="font-weight: 600; font-size: 14px; color: #333;">目录</span>
|
|
561
|
+
</div>
|
|
562
|
+
${r}`,i=document.createElement("div");return i.setAttribute("data-type","outline"),i.style.cssText="background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 16px; margin: 16px 0; color: #333;",i.innerHTML=o,Object.keys(e).forEach(a=>{a==="class"?i.className=e[a]:a==="style"?i.style.cssText+=";"+e[a]:i.setAttribute(a,e[a])}),{dom:i}},addNodeView(){return Dp(_Z)},addCommands(){return{insertOutline:()=>({commands:e,editor:t})=>{const{state:n}=t;return n.doc.descendants(o=>o.type.name==="outline")?!1:e.insertContentAt(0,{type:this.name})}}}}),LZ=(e,t)=>{const n=e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w\u4e00-\u9fa5-]/g,"").slice(0,30);return`heading-${t}-${n||"untitled"}`},jZ=Oz.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),id:{default:null,parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addProseMirrorPlugins(){return[new Kt({appendTransaction:(e,t,n)=>{const r=n.tr;let o=!1;return n.doc.descendants((i,a)=>{if(i.type.name==="heading"&&!i.attrs.id){const s=LZ(i.textContent,a);r.setNodeMarkup(a,null,{...i.attrs,id:s}),o=!0}}),o?r:null}})]}}),zZ=({node:e})=>L.jsx(gu,{className:"variable-node-wrapper",as:"span",children:L.jsx("span",{className:"variable-node-content","data-id":e.attrs.id,children:`\${${e.attrs.label||e.attrs.id}}`})}),BZ=Tn.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes(){return{id:{default:null},label:{default:null}}},parseHTML(){return[{tag:'span[data-type="variable"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",en(t,{"data-type":"variable","data-id":e.attrs.id,"data-label":e.attrs.label,class:"variable-node"}),`\${${e.attrs.id}}`]},addNodeView(){return Dp(zZ)},addCommands(){return{insertVariable:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),jo=({icon:e,title:t,onClick:n,disabled:r})=>L.jsx(hn,{title:t,mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:"table-action-btn",onClick:n,disabled:r,children:L.jsx("span",{className:e,style:{width:16,height:16,display:"inline-flex"}})})}),FZ=({editor:e})=>{const t=w.useRef(null),[n,r]=w.useState(!1),[o,i]=w.useState({top:0,left:0}),a=w.useRef(null),s=w.useCallback(()=>{a.current&&(a.current.classList.remove("table-selected"),a.current=null)},[]),l=w.useCallback(()=>{if(!e||e.isDestroyed)return;const{selection:c}=e.state;let u=null;const d=c.$from;for(let b=d.depth;b>0;b--)if(d.node(b).type.name==="table"){u=d.before(b);break}if(u===null){s(),r(!1);return}const f=e.view.nodeDOM(u);if(!f){s(),r(!1);return}let h=f;if(h&&h.tagName!=="TABLE"&&h.querySelector){const b=h.querySelector("table");b&&(h=b)}a.current&&a.current!==h&&a.current.classList.remove("table-selected"),h&&h.classList&&(h.classList.add("table-selected"),a.current=h);const p=document.querySelector(".nice-editor");if(!p)return;const v=p.getBoundingClientRect(),m=h.getBoundingClientRect();i({top:m.top-v.top+p.scrollTop,left:m.left-v.left+p.scrollLeft}),r(!0)},[e,s]);return w.useEffect(()=>{if(!e)return;const c=()=>{if(!e.isDestroyed){if(!e.isActive("table")){s(),r(!1);return}l()}};e.on("transaction",c),e.on("selectionUpdate",c);const u=()=>{e.isDestroyed||n&&l()};return window.addEventListener("scroll",u,!0),e.view.dom.addEventListener("scroll",u),()=>{e.off("transaction",c),e.off("selectionUpdate",c),window.removeEventListener("scroll",u,!0),e.view.dom.removeEventListener("scroll",u),s()}},[e,l,n,s]),!e||!n?null:L.jsxs("div",{ref:t,className:"table-floating-toolbar",contentEditable:!1,style:{position:"absolute",top:`${o.top-36}px`,left:`${o.left}px`},children:[L.jsx("div",{className:"table-toolbar-toggle",children:L.jsx("span",{className:"icon-[mdi--table]",style:{width:16,height:16,display:"inline-flex"}})}),L.jsx("div",{className:"table-toolbar-expanded",children:L.jsx(HZ,{editor:e})})]})},HZ=({editor:e})=>{const t=Ei({editor:e,selector:n=>({canAddRowBefore:n.editor.can().addRowBefore(),canAddRowAfter:n.editor.can().addRowAfter(),canAddColumnBefore:n.editor.can().addColumnBefore(),canAddColumnAfter:n.editor.can().addColumnAfter(),canMergeCells:n.editor.can().mergeCells(),canSplitCell:n.editor.can().splitCell(),canToggleHeaderRow:n.editor.can().toggleHeaderRow(),canDeleteRow:n.editor.can().deleteRow(),canDeleteColumn:n.editor.can().deleteColumn(),canDeleteTable:n.editor.can().deleteTable()})});return L.jsxs(L.Fragment,{children:[L.jsx(jo,{icon:"icon-[mdi--table-row-plus-before]",title:"上方插入行",onClick:()=>e.chain().addRowBefore().run(),disabled:!t.canAddRowBefore}),L.jsx(jo,{icon:"icon-[mdi--table-row-plus-after]",title:"下方插入行",onClick:()=>e.chain().addRowAfter().run(),disabled:!t.canAddRowAfter}),L.jsx(jo,{icon:"icon-[mdi--table-column-plus-before]",title:"左侧插入列",onClick:()=>e.chain().addColumnBefore().run(),disabled:!t.canAddColumnBefore}),L.jsx(jo,{icon:"icon-[mdi--table-column-plus-after]",title:"右侧插入列",onClick:()=>e.chain().addColumnAfter().run(),disabled:!t.canAddColumnAfter}),L.jsx("div",{className:"table-bubble-divider"}),L.jsx(jo,{icon:"icon-[mdi--table-merge-cells]",title:"合并单元格",onClick:()=>e.chain().mergeCells().run(),disabled:!t.canMergeCells}),L.jsx(jo,{icon:"icon-[mdi--table-split-cell]",title:"拆分单元格",onClick:()=>e.chain().splitCell().run(),disabled:!t.canSplitCell}),L.jsx("div",{className:"table-bubble-divider"}),L.jsx(jo,{icon:"icon-[mdi--table-border]",title:"切换表头",onClick:()=>e.chain().toggleHeaderRow().run(),disabled:!t.canToggleHeaderRow}),L.jsx(jo,{icon:"icon-[mdi--table-row-remove]",title:"删除行",onClick:()=>e.chain().deleteRow().run(),disabled:!t.canDeleteRow}),L.jsx(jo,{icon:"icon-[mdi--table-column-remove]",title:"删除列",onClick:()=>e.chain().deleteColumn().run(),disabled:!t.canDeleteColumn}),L.jsx(jo,{icon:"icon-[mdi--table-large-remove]",title:"删除表格",onClick:()=>e.chain().deleteTable().run(),disabled:!t.canDeleteTable})]})},VZ=({status:e,error:t,onRetry:n})=>e==="uploading"?L.jsxs("div",{className:"image-placeholder uploading",children:[L.jsx("div",{className:"image-placeholder-spinner"}),L.jsx("span",{className:"image-placeholder-text",children:"上传中..."})]}):e==="error"?L.jsxs("div",{className:"image-placeholder error",onClick:n,children:[L.jsx("span",{className:"icon-[mdi--image-broken]",style:{width:32,height:32,display:"inline-flex"}}),L.jsx("span",{className:"image-placeholder-text",children:t||"上传失败"}),L.jsx("span",{className:"image-placeholder-retry",children:"点击重试"})]}):null,WZ=({node:e,updateAttributes:t,deleteNode:n,selected:r,editor:o})=>{const{config:i}=w.useContext(Tr)||{},a=(i==null?void 0:i.upload)||{},[s,l]=w.useState(e.attrs.status||"done"),[c,u]=w.useState(e.attrs.error||null),d=w.useRef(null),[f,h]=w.useState(!1),[p,v]=w.useState(null),m=w.useRef({x:0,y:0,width:0,height:0,corner:"",aspectRatio:1}),[b,y]=w.useState({width:0,height:0}),C=w.useCallback(async()=>{const P=e.attrs.file;if(P){l("uploading"),u(null);try{const A=await rQ(P,a);l("done"),t({src:A,status:"done",error:null,file:null})}catch(A){l("error"),u(A.message||"上传失败")}}},[e.attrs.file,t,a]);w.useEffect(()=>{s==="uploading"&&e.attrs.file&&C()},[s,e.attrs.file,C]);const x=()=>{l("uploading")},S=P=>{y({width:P.target.naturalWidth,height:P.target.naturalHeight})},E=(P,A)=>{var D;P.preventDefault(),P.stopPropagation();const _=(D=d.current)==null?void 0:D.querySelector("img");if(!_)return;const B=_.getBoundingClientRect(),F=e.attrs.width||"auto",U=e.attrs.height||"auto",K=F==="auto"?B.width:parseInt(F),j=U==="auto"?B.height:parseInt(U);m.current={x:P.clientX,y:P.clientY,width:K,height:j,corner:A,aspectRatio:b.width/b.height||K/j},v(K),h(!0)};w.useEffect(()=>{if(!f)return;const P=_=>{const B=_.clientX-m.current.x;let F=m.current.width;switch(m.current.corner){case"nw":case"sw":F=Math.max(50,m.current.width-B);break;case"ne":case"se":F=Math.max(50,m.current.width+B);break}v(Math.round(F))},A=_=>{if(!f)return;const B=_.clientX-m.current.x;let F=m.current.width;switch(m.current.corner){case"nw":case"sw":F=Math.max(50,m.current.width-B);break;case"ne":case"se":F=Math.max(50,m.current.width+B);break}F=Math.round(F),t({width:`${F}px`}),h(!1),v(null)};return document.addEventListener("mousemove",P),document.addEventListener("mouseup",A),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",A)}},[f,t]);const $=e.attrs.align||"center",O=e.attrs.float||"none",k=p!==null?`${p}px`:e.attrs.width||"auto",M=e.attrs.height||"auto",T={textAlign:$,maxWidth:"100%",clear:"both"},I={display:"inline-block",float:O,marginLeft:O==="right"?"16px":"0",marginRight:O==="left"?"16px":"0",maxWidth:"100%",outline:r?"2px solid #1890ff":"none",outlineOffset:"2px",borderRadius:"4px",cursor:"pointer",position:"relative"},R={position:"absolute",width:"12px",height:"12px",background:"#1890ff",border:"2px solid #fff",borderRadius:"50%",cursor:"nwse-resize",zIndex:10},N=[{name:"nw",cursor:"nwse-resize",style:{top:-6,left:-6}},{name:"ne",cursor:"nesw-resize",style:{top:-6,right:-6}},{name:"sw",cursor:"nesw-resize",style:{bottom:-6,left:-6}},{name:"se",cursor:"nwse-resize",style:{bottom:-6,right:-6}}];return s!=="done"?L.jsx(gu,{className:"image-node-wrapper",style:T,ref:d,children:L.jsx("div",{style:I,children:L.jsx(VZ,{status:s,error:c,onRetry:x})})}):L.jsx(gu,{className:"image-node-wrapper",style:T,ref:d,children:L.jsxs("div",{style:I,children:[L.jsx("img",{src:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title,width:k!=="auto"?k:void 0,height:M!=="auto"?M:void 0,className:"image-node-content",style:{maxWidth:"100%",display:"block"},draggable:!1,onLoad:S}),r&&L.jsx(L.Fragment,{children:N.map(P=>L.jsx("div",{style:{...R,...P.style,cursor:P.cursor},onMouseDown:A=>E(A,P.name)},P.name))})]})})},UZ=Tn.create({name:"customImage",group:"block",atom:!0,draggable:!0,selectable:!0,inline:!1,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},align:{default:"center"},float:{default:"none"},status:{default:"done"},error:{default:null},file:{default:null}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:e}){return["img",en(e)]},addNodeView(){return Dp(WZ)},addCommands(){return{insertImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateImage:e=>({commands:t})=>t.updateAttributes(this.name,e)}}}),qZ=new on("imagePaste"),KZ=_t.create({name:"imagePaste",addProseMirrorPlugins(){return[new Kt({key:qZ,props:{handlePaste:(e,t)=>{var i;const n=(i=t.clipboardData)==null?void 0:i.items;if(!n)return!1;const r=[];for(let a=0;a<n.length;a++){const s=n[a];if(s.type.indexOf("image")!==-1){const l=s.getAsFile();l&&r.push(l)}}if(r.length===0)return!1;t.preventDefault();const{schema:o}=e.state;return r.forEach(a=>{const s=e.state.tr,l=o.nodes.customImage.create({src:"",file:a,status:"uploading"});s.replaceSelectionWith(l),e.dispatch(s)}),!0},handleDrop:(e,t)=>{var i;const n=(i=t.dataTransfer)==null?void 0:i.files;if(!n||n.length===0)return!1;const r=Array.from(n).filter(a=>a.type.startsWith("image/"));if(r.length===0)return!1;t.preventDefault();const{schema:o}=e.state;return r.forEach(a=>{const s=e.state.tr,l=o.nodes.customImage.create({src:"",file:a,status:"uploading"});s.replaceSelectionWith(l),e.dispatch(s)}),!0}}})]}}),Ec=({icon:e,title:t,isActive:n,onClick:r})=>L.jsx(hn,{title:t,mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:`image-toolbar-btn ${n?"is-active":""}`,onClick:r,children:L.jsx("span",{className:e,style:{width:16,height:16,display:"inline-flex"}})})}),GZ=({label:e,width:t,currentWidth:n,onClick:r})=>L.jsx("button",{type:"button",className:`image-toolbar-size-btn ${n===t?"is-active":""}`,onClick:()=>r(t),children:e}),XZ=({editor:e})=>{const t=w.useRef(null),[n,r]=w.useState(!1),[o,i]=w.useState({top:0,left:0}),[a,s]=w.useState(""),[l,c]=w.useState(""),[u,d]=w.useState(""),[f,h]=w.useState({}),{config:p}=w.useContext(Tr)||{},v=(p==null?void 0:p.theme)==="dark",m=v?"#374151":"#ffffff",b=v?"#4b5563":"#e5e7eb",y=v?"#f9fafb":"#1f2937",C=v?"#9ca3af":"#6b7280",x=w.useCallback(()=>{if(!e||e.isDestroyed)return;const N=document.querySelector(".nice-editor");if(!N)return;const P=N.querySelector(".ProseMirror-selectednode");if(!P){r(!1);return}const A=P.querySelector("img")||P;if(!A||!A.getBoundingClientRect){r(!1);return}const _=N.getBoundingClientRect(),B=A.getBoundingClientRect();i({top:B.top-_.top+N.scrollTop,left:B.left-_.left+N.scrollLeft,width:B.width});const F=e.getAttributes("customImage");h({width:F.width||"auto",height:F.height||"auto",align:F.align||"center",float:F.float||"none",alt:F.alt||""}),s(F.alt||""),c(F.width==="auto"?"":String(F.width).replace("px","")),d(F.height==="auto"?"":String(F.height).replace("px","")),r(!0)},[e]);if(w.useEffect(()=>{if(!e)return;const N=()=>{if(e.isDestroyed)return;const P=document.querySelector(".nice-editor");if(!P)return;if(!P.querySelector(".ProseMirror-selectednode")){r(!1);return}setTimeout(x,10)};return e.on("transaction",N),e.on("selectionUpdate",N),e.on("focus",N),()=>{e.off("transaction",N),e.off("selectionUpdate",N),e.off("focus",N)}},[e,x]),!e||!n)return null;const S=N=>{e.chain().focus().updateImage({width:N}).run()},E=N=>{e.chain().focus().updateImage({align:N}).run()},$=N=>{e.chain().focus().updateImage({float:N}).run()},O=N=>{e.chain().focus().updateImage({alt:N}).run()},k=()=>{const N=l?`${l}px`:"auto",P=u?`${u}px`:"auto";e.chain().focus().updateImage({width:N,height:P}).run()},M=[{label:"小",width:"200px"},{label:"中",width:"400px"},{label:"大",width:"600px"},{label:"自适应",width:"auto"}],T=L.jsxs("div",{style:{padding:"8px 0",background:m},children:[L.jsx("div",{style:{marginBottom:8,fontSize:12,color:C},children:"设置图片替代文本"}),L.jsx(Do,{placeholder:"输入 alt 文本",value:a,onChange:N=>s(N.target.value),onPressEnter:()=>O(a),onBlur:()=>O(a),style:{width:200}})]}),I=L.jsxs("div",{style:{padding:"8px 0",background:m},children:[L.jsx("div",{style:{marginBottom:8,fontSize:12,color:C},children:"自定义尺寸 (px)"}),L.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[L.jsx(Do,{placeholder:"宽度",value:l,onChange:N=>c(N.target.value.replace(/\D/g,"")),style:{width:80}}),L.jsx("span",{style:{color:y},children:"×"}),L.jsx(Do,{placeholder:"高度",value:u,onChange:N=>d(N.target.value.replace(/\D/g,"")),style:{width:80}}),L.jsx("button",{onClick:k,style:{padding:"4px 12px",background:"#1890ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer"},children:"应用"})]})]}),R={root:{background:m,borderRadius:8,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:`1px solid ${b}`},body:{background:m,padding:12}};return L.jsxs("div",{ref:t,className:"image-floating-toolbar",contentEditable:!1,style:{position:"absolute",top:`${o.top-44}px`,left:`${o.left}px`,zIndex:100},children:[L.jsx("div",{className:"image-toolbar-toggle",children:L.jsx("span",{className:"icon-[mdi--image]",style:{width:16,height:16,display:"inline-flex"}})}),L.jsxs("div",{className:"image-toolbar-expanded",children:[L.jsxs("div",{className:"image-toolbar-section",children:[L.jsx("span",{className:"image-toolbar-label",children:"宽度"}),L.jsx("div",{className:"image-toolbar-sizes",children:M.map(N=>L.jsx(GZ,{label:N.label,width:N.width,currentWidth:f.width,onClick:S},N.width))})]}),L.jsx("div",{className:"image-toolbar-divider"}),L.jsxs("div",{className:"image-toolbar-section",children:[L.jsx("span",{className:"image-toolbar-label",children:"对齐"}),L.jsxs("div",{className:"image-toolbar-floats",children:[L.jsx(Ec,{icon:"icon-[mdi--format-align-left]",title:"左对齐",isActive:f.align==="left",onClick:()=>E("left")}),L.jsx(Ec,{icon:"icon-[mdi--format-align-center]",title:"居中",isActive:f.align==="center",onClick:()=>E("center")}),L.jsx(Ec,{icon:"icon-[mdi--format-align-right]",title:"右对齐",isActive:f.align==="right",onClick:()=>E("right")})]})]}),L.jsx("div",{className:"image-toolbar-divider"}),L.jsxs("div",{className:"image-toolbar-section",children:[L.jsx("span",{className:"image-toolbar-label",children:"浮动"}),L.jsxs("div",{className:"image-toolbar-floats",children:[L.jsx(Ec,{icon:"icon-[mdi--format-float-left]",title:"左浮动",isActive:f.float==="left",onClick:()=>$(f.float==="left"?"none":"left")}),L.jsx(Ec,{icon:"icon-[mdi--format-float-right]",title:"右浮动",isActive:f.float==="right",onClick:()=>$(f.float==="right"?"none":"right")})]})]}),L.jsx("div",{className:"image-toolbar-divider"}),L.jsx(Wi,{content:I,trigger:"click",placement:"bottom",styles:R,children:L.jsx(hn,{title:"自定义尺寸",mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:"image-toolbar-btn",children:L.jsx("span",{className:"icon-[mdi--resize]",style:{width:16,height:16,display:"inline-flex"}})})})}),L.jsx(Wi,{content:T,trigger:"click",placement:"bottom",styles:R,children:L.jsx(hn,{title:"Alt 文本",mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:`image-toolbar-btn ${f.alt?"is-active":""}`,children:L.jsx("span",{className:"icon-[mdi--image-text]",style:{width:16,height:16,display:"inline-flex"}})})})}),L.jsx("div",{className:"image-toolbar-divider"}),L.jsx(hn,{title:"删除图片",mouseEnterDelay:.3,children:L.jsx("button",{type:"button",className:"image-toolbar-btn image-toolbar-delete",onClick:()=>e.chain().focus().deleteSelection().run(),children:L.jsx("span",{className:"icon-[mdi--delete]",style:{width:16,height:16,display:"inline-flex"}})})})]})]})},YZ={toolbar:{undo:"撤销",redo:"重做",bold:"粗体",italic:"斜体",underline:"下划线",strike:"删除线",code:"行内代码",heading:"标题",fontSize:"字体大小",textColor:"字体颜色",bgColor:"背景颜色",bulletList:"无序列表",orderedList:"有序列表",codeBlock:"代码块",blockquote:"引用",link:"链接",horizontalRule:"分割线",align:"对齐方式",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignJustify:"两端对齐",image:"插入图片",table:"表格",hardBreak:"换行",variable:"插入变量",sourceCode:"查看源码",htmlPreview:"预览 HTML",clearFormat:"清除格式"},image:{upload:"本地上传",url:"网络图片",uploadPlaceholder:"点击或拖拽图片到此区域上传",uploadHint:"支持 JPG、PNG、GIF 等格式",urlPlaceholder:"请输入图片 URL",insert:"插入",width:"宽度",small:"小",medium:"中",large:"大",auto:"自适应",align:"对齐",float:"浮动",floatLeft:"左浮动",floatRight:"右浮动",customSize:"自定义尺寸",altText:"Alt 文本",altPlaceholder:"输入 alt 文本",delete:"删除图片",retry:"重试",uploading:"上传中...",uploadFailed:"上传失败"},table:{insertTable:"插入表格",insertRowAbove:"上方插入行",insertRowBelow:"下方插入行",insertColLeft:"左侧插入列",insertColRight:"右侧插入列",deleteRow:"删除行",deleteCol:"删除列",mergeCells:"合并单元格",splitCell:"拆分单元格",deleteTable:"删除表格",rows:"行",cols:"列"},link:{placeholder:"输入链接地址",insert:"确定",remove:"移除"},sourceCode:{html:"HTML",json:"JSON",markdown:"Markdown",text:"文本"},variable:{title:"插入变量",avatar:"头像",nickname:"昵称"},outline:{title:"目录",empty:"暂无标题"}},JZ={toolbar:{undo:"Undo",redo:"Redo",bold:"Bold",italic:"Italic",underline:"Underline",strike:"Strikethrough",code:"Inline Code",heading:"Heading",fontSize:"Font Size",textColor:"Text Color",bgColor:"Background Color",bulletList:"Bullet List",orderedList:"Ordered List",codeBlock:"Code Block",blockquote:"Quote",link:"Link",horizontalRule:"Horizontal Rule",align:"Alignment",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Justify",image:"Insert Image",table:"Table",hardBreak:"Hard Break",variable:"Insert Variable",sourceCode:"View Source",htmlPreview:"Preview HTML",clearFormat:"Clear Format"},image:{upload:"Upload",url:"URL",uploadPlaceholder:"Click or drag image to upload",uploadHint:"Supports JPG, PNG, GIF, etc.",urlPlaceholder:"Enter image URL",insert:"Insert",width:"Width",small:"Small",medium:"Medium",large:"Large",auto:"Auto",align:"Align",float:"Float",floatLeft:"Float Left",floatRight:"Float Right",customSize:"Custom Size",altText:"Alt Text",altPlaceholder:"Enter alt text",delete:"Delete Image",retry:"Retry",uploading:"Uploading...",uploadFailed:"Upload Failed"},table:{insertTable:"Insert Table",insertRowAbove:"Insert Row Above",insertRowBelow:"Insert Row Below",insertColLeft:"Insert Column Left",insertColRight:"Insert Column Right",deleteRow:"Delete Row",deleteCol:"Delete Column",mergeCells:"Merge Cells",splitCell:"Split Cell",deleteTable:"Delete Table",rows:"Rows",cols:"Columns"},link:{placeholder:"Enter link URL",insert:"Insert",remove:"Remove"},sourceCode:{html:"HTML",json:"JSON",markdown:"Markdown",text:"Text"},variable:{title:"Insert Variable",avatar:"Avatar",nickname:"Nickname"},outline:{title:"Outline",empty:"No Headings"}},QZ={toolbar:{undo:"元に戻す",redo:"やり直し",bold:"太字",italic:"斜体",underline:"下線",strike:"取り消し線",code:"インラインコード",heading:"見出し",fontSize:"フォントサイズ",textColor:"文字色",bgColor:"背景色",bulletList:"箇条書き",orderedList:"番号付きリスト",codeBlock:"コードブロック",blockquote:"引用",link:"リンク",horizontalRule:"水平線",align:"配置",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え",alignJustify:"両端揃え",image:"画像を挿入",table:"テーブル",hardBreak:"改行",variable:"変数を挿入",sourceCode:"ソースを表示",htmlPreview:"HTMLプレビュー",clearFormat:"書式をクリア"},image:{upload:"アップロード",url:"URL",uploadPlaceholder:"クリックまたはドラッグしてアップロード",uploadHint:"JPG、PNG、GIFなどに対応",urlPlaceholder:"画像URLを入力",insert:"挿入",width:"幅",small:"小",medium:"中",large:"大",auto:"自動",align:"配置",float:"フロート",floatLeft:"左フロート",floatRight:"右フロート",customSize:"カスタムサイズ",altText:"代替テキスト",altPlaceholder:"代替テキストを入力",delete:"画像を削除",retry:"再試行",uploading:"アップロード中...",uploadFailed:"アップロード失敗"},table:{insertTable:"テーブルを挿入",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",insertColLeft:"左に列を挿入",insertColRight:"右に列を挿入",deleteRow:"行を削除",deleteCol:"列を削除",mergeCells:"セルを結合",splitCell:"セルを分割",deleteTable:"テーブルを削除",rows:"行",cols:"列"},link:{placeholder:"リンクURLを入力",insert:"挿入",remove:"削除"},sourceCode:{html:"HTML",json:"JSON",markdown:"Markdown",text:"テキスト"},variable:{title:"変数を挿入",avatar:"アバター",nickname:"ニックネーム"},outline:{title:"目次",empty:"見出しがありません"}},$I=()=>{if(typeof navigator>"u")return"zh";const t=(navigator.language||navigator.userLanguage||"").toLowerCase().split("-")[0];return t==="zh"?"zh":t==="ja"?"ja":t==="en"?"en":"zh"},OI={zh:YZ,en:JZ,ja:QZ},ZZ=["undo","redo","separator","bold","italic","underline","strike","code","separator","heading","fontSize","separator","color","highlight","separator","bulletList","orderedList","codeBlock","blockquote","separator","link","emoji","separator","horizontalRule","align","image","table","hardBreak","separator","variable","sourceCode","htmlPreview"],eee=["bold","italic","underline","strike","code","separator","color","highlight","separator","link"],tee=["heading","bulletList","orderedList","codeBlock","blockquote"],nee={uploadUrl:"/api/common/upload/file",fieldName:"file",headers:{lang:"zh_cn"},withCredentials:!0,responseParser:e=>{var t,n;return e.url||((t=e.data)==null?void 0:t.url)||((n=e.data)==null?void 0:n.full_url)||e},compress:!0,compressQuality:.8,compressMaxWidth:1920,compressMaxHeight:1080,compressType:"image/jpeg"},ree=["html","md","json","text"],Vs={menuBar:ZZ,bubbleMenu:eee,floatingMenu:tee,theme:"light",locale:$I(),exportFormats:ree},r0=new on("poroFloatingMenu"),Tr=w.createContext(null),kI=({content:e="<p>Hello World!</p>",onChange:t,config:n})=>{const r=w.useMemo(()=>({menuBar:(n==null?void 0:n.menuBar)??Vs.menuBar,bubbleMenu:(n==null?void 0:n.bubbleMenu)??Vs.bubbleMenu,floatingMenu:(n==null?void 0:n.floatingMenu)??Vs.floatingMenu,upload:{...nee,...n==null?void 0:n.upload},theme:(n==null?void 0:n.theme)??Vs.theme,locale:(n==null?void 0:n.locale)??Vs.locale,exportFormats:(n==null?void 0:n.exportFormats)??Vs.exportFormats}),[n]),o=w.useMemo(()=>{const s=r.locale||$I();return OI[s]||OI.zh},[r.locale]),i=JD({extensions:[XB.configure({heading:!1,underline:!1,link:!1}),Ww,Uw,iF.configure({multicolor:!0}),wB,rB.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}}),jZ,lZ.configure({transformPastedText:!0}),kZ,DZ,BZ,EZ.configure({table:{resizable:!0}}),OZ.configure({types:["heading","paragraph"]}),UZ,KZ],content:e,contentType:"markdown",editorProps:{attributes:{class:"nice ProseMirror",translate:"no",role:"textbox"}},onUpdate:({editor:s})=>{if(!t)return;const l=r.exportFormats,c={};if(l.includes("html")&&(c.html=s.getHTML()),l.includes("md")){let u="";try{typeof s.getMarkdown=="function"?u=s.getMarkdown():s.markdown&&typeof s.markdown.serialize=="function"&&(u=s.markdown.serialize(s.getJSON()))}catch(d){console.warn("Failed to get markdown:",d)}c.md=u}l.includes("json")&&(c.json=s.getJSON()),l.includes("text")&&(c.text=s.getText()),l.length===1?t(c[l[0]]):t(c)}}),a=w.useMemo(()=>({editor:i,config:r,t:o}),[i,r,o]);return w.useEffect(()=>{if(!i)return;const s=()=>{if(i.isDestroyed)return;const{$from:u}=i.state.selection;u.depth===1&&u.parent.content.size>0&&i.view.dispatch(i.state.tr.setMeta(r0,"hide"))},l=({transaction:u})=>{u.docChanged&&(u.getMeta(r0)||s())},c=()=>{setTimeout(s,0)};return i.on("transaction",l),i.view.dom.addEventListener("compositionend",c),()=>{i.off("transaction",l),i.view.dom.removeEventListener("compositionend",c)}},[i]),i?L.jsx(Tr.Provider,{value:a,children:L.jsxs("div",{className:"nice-editor","data-theme":r.theme,children:[r.menuBar&&r.menuBar.length>0&&L.jsx(hQ,{editor:i,config:r.menuBar}),L.jsx(BS,{editor:i}),r.floatingMenu&&r.floatingMenu.length>0&&L.jsx(uz,{editor:i,pluginKey:r0,className:"floating-menu",tabIndex:-1,children:L.jsx(IZ,{editor:i,config:r.floatingMenu,tabIndex:-1})}),r.bubbleMenu&&r.bubbleMenu.length>0&&L.jsx(cz,{editor:i,className:"bubble-menu",tabIndex:-1,shouldShow:({state:s})=>{const{from:l,to:c}=s.selection;return l===c?!1:s.doc.textBetween(l,c,"").length>0},children:L.jsx(RZ,{editor:i,config:r.bubbleMenu})}),L.jsx(FZ,{editor:i}),L.jsx(XZ,{editor:i})]})}):null};Yn.EditorContext=Tr,Yn.Tiptap=kI,Yn.default=kI,Object.defineProperties(Yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
563
|
+
//# sourceMappingURL=poro-editor.umd.cjs.map
|