zs_library 0.3.14 → 0.3.16

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/index.umd.js CHANGED
@@ -1,37 +1,8 @@
1
- (function(E,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("@emotion/css"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react","@emotion/css","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],u):(E=typeof globalThis<"u"?globalThis:E||self,u(E.zs_library={},E.React,E.css,E.Slider,E.reactSortablejs,E.framerMotion,E.ahooks,E.uuid,E.RcTooltip,E.react,E.Dialog,E.ReactJson,E.MDXEditor,E.Markdown,E.remarkGfm,E.emoji,E.rehypeRaw,E.reactSyntaxHighlighter,E.clsx,E.tailwindMerge))})(this,function(E,u,a,kt,Pe,h,Ye,We,vt,ke,Ve,xt,C,wt,yt,Ct,St,jt,Tt,It){"use strict";var hr=Object.defineProperty;var br=(E,u,a)=>u in E?hr(E,u,{enumerable:!0,configurable:!0,writable:!0,value:a}):E[u]=a;var ze=(E,u,a)=>br(E,typeof u!="symbol"?u+"":u,a);require("./style.css");var ye={exports:{}},ve={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Xe;function Rt(){if(Xe)return ve;Xe=1;var f=u,t=Symbol.for("react.element"),c=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,d=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function g(k,l,j){var x,N={},M=null,V=null;j!==void 0&&(M=""+j),l.key!==void 0&&(M=""+l.key),l.ref!==void 0&&(V=l.ref);for(x in l)n.call(l,x)&&!s.hasOwnProperty(x)&&(N[x]=l[x]);if(k&&k.defaultProps)for(x in l=k.defaultProps,l)N[x]===void 0&&(N[x]=l[x]);return{$$typeof:t,type:k,key:M,ref:V,props:N,_owner:d.current}}return ve.Fragment=c,ve.jsx=g,ve.jsxs=g,ve}var xe={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ue;function Et(){return Ue||(Ue=1,process.env.NODE_ENV!=="production"&&function(){var f=u,t=Symbol.for("react.element"),c=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),k=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),X=Symbol.iterator,v="@@iterator";function m(e){if(e===null||typeof e!="object")return null;var o=X&&e[X]||e[v];return typeof o=="function"?o:null}var _=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var o=arguments.length,i=new Array(o>1?o-1:0),p=1;p<o;p++)i[p-1]=arguments[p];U("error",e,i)}}function U(e,o,i){{var p=_.ReactDebugCurrentFrame,D=p.getStackAddendum();D!==""&&(o+="%s",i=i.concat([D]));var F=i.map(function(R){return String(R)});F.unshift("Warning: "+o),Function.prototype.apply.call(console[e],console,F)}}var w=!1,B=!1,O=!1,y=!1,T=!1,K;K=Symbol.for("react.module.reference");function de(e){return!!(typeof e=="string"||typeof e=="function"||e===n||e===s||T||e===d||e===j||e===x||y||e===V||w||B||O||typeof e=="object"&&e!==null&&(e.$$typeof===M||e.$$typeof===N||e.$$typeof===g||e.$$typeof===k||e.$$typeof===l||e.$$typeof===K||e.getModuleId!==void 0))}function q(e,o,i){var p=e.displayName;if(p)return p;var D=o.displayName||o.name||"";return D!==""?i+"("+D+")":i}function fe(e){return e.displayName||"Context"}function $(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case n:return"Fragment";case c:return"Portal";case s:return"Profiler";case d:return"StrictMode";case j:return"Suspense";case x:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case k:var o=e;return fe(o)+".Consumer";case g:var i=e;return fe(i._context)+".Provider";case l:return q(e,e.render,"ForwardRef");case N:var p=e.displayName||null;return p!==null?p:$(e.type)||"Memo";case M:{var D=e,F=D._payload,R=D._init;try{return $(R(F))}catch{return null}}}return null}var oe=Object.assign,se=0,Y,ae,ce,Ce,Se,je,Te;function P(){}P.__reactDisabledLog=!0;function Q(){{if(se===0){Y=console.log,ae=console.info,ce=console.warn,Ce=console.error,Se=console.group,je=console.groupCollapsed,Te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}se++}}function Z(){{if(se--,se===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:oe({},e,{value:Y}),info:oe({},e,{value:ae}),warn:oe({},e,{value:ce}),error:oe({},e,{value:Ce}),group:oe({},e,{value:Se}),groupCollapsed:oe({},e,{value:je}),groupEnd:oe({},e,{value:Te})})}se<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=_.ReactCurrentDispatcher,W;function z(e,o,i){{if(W===void 0)try{throw Error()}catch(D){var p=D.stack.trim().match(/\n( *(at )?)/);W=p&&p[1]||""}return`
18
- `+W+e}}var I=!1,A;{var J=typeof WeakMap=="function"?WeakMap:Map;A=new J}function ne(e,o){if(!e||I)return"";{var i=A.get(e);if(i!==void 0)return i}var p;I=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var F;F=L.current,L.current=null,Q();try{if(o){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(re){p=re}Reflect.construct(e,[],R)}else{try{R.call()}catch(re){p=re}e.call(R.prototype)}}else{try{throw Error()}catch(re){p=re}e()}}catch(re){if(re&&p&&typeof re.stack=="string"){for(var S=re.stack.split(`
19
- `),ee=p.stack.split(`
20
- `),G=S.length-1,H=ee.length-1;G>=1&&H>=0&&S[G]!==ee[H];)H--;for(;G>=1&&H>=0;G--,H--)if(S[G]!==ee[H]){if(G!==1||H!==1)do if(G--,H--,H<0||S[G]!==ee[H]){var ie=`
21
- `+S[G].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),typeof e=="function"&&A.set(e,ie),ie}while(G>=1&&H>=0);break}}}finally{I=!1,L.current=F,Z(),Error.prepareStackTrace=D}var be=e?e.displayName||e.name:"",me=be?z(be):"";return typeof e=="function"&&A.set(e,me),me}function Ie(e,o,i){return ne(e,!1)}function Re(e){var o=e.prototype;return!!(o&&o.isReactComponent)}function te(e,o,i){if(e==null)return"";if(typeof e=="function")return ne(e,Re(e));if(typeof e=="string")return z(e);switch(e){case j:return z("Suspense");case x:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Ie(e.render);case N:return te(e.type,o,i);case M:{var p=e,D=p._payload,F=p._init;try{return te(F(D),o,i)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,at={},it=_.ReactDebugCurrentFrame;function Ee(e){if(e){var o=e._owner,i=te(e.type,e._source,o?o.type:null);it.setExtraStackFrame(i)}else it.setExtraStackFrame(null)}function Jt(e,o,i,p,D){{var F=Function.call.bind(ge);for(var R in e)if(F(e,R)){var S=void 0;try{if(typeof e[R]!="function"){var ee=Error((p||"React class")+": "+i+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ee.name="Invariant Violation",ee}S=e[R](o,R,p,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){S=G}S&&!(S instanceof Error)&&(Ee(D),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",p||"React class",i,R,typeof S),Ee(null)),S instanceof Error&&!(S.message in at)&&(at[S.message]=!0,Ee(D),b("Failed %s type: %s",i,S.message),Ee(null))}}}var Kt=Array.isArray;function Ne(e){return Kt(e)}function $t(e){{var o=typeof Symbol=="function"&&Symbol.toStringTag,i=o&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function qt(e){try{return lt(e),!1}catch{return!0}}function lt(e){return""+e}function st(e){if(qt(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",$t(e)),lt(e)}var we=_.ReactCurrentOwner,Zt={key:!0,ref:!0,__self:!0,__source:!0},ct,dt,Oe;Oe={};function Qt(e){if(ge.call(e,"ref")){var o=Object.getOwnPropertyDescriptor(e,"ref").get;if(o&&o.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(ge.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function tr(e,o){if(typeof e.ref=="string"&&we.current&&o&&we.current.stateNode!==o){var i=$(we.current.type);Oe[i]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',$(we.current.type),e.ref),Oe[i]=!0)}}function rr(e,o){{var i=function(){ct||(ct=!0,b("%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://reactjs.org/link/special-props)",o))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function or(e,o){{var i=function(){dt||(dt=!0,b("%s: `ref` 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://reactjs.org/link/special-props)",o))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var nr=function(e,o,i,p,D,F,R){var S={$$typeof:t,type:e,key:o,ref:i,props:R,_owner:F};return S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(S,"_self",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.defineProperty(S,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S};function ar(e,o,i,p,D){{var F,R={},S=null,ee=null;i!==void 0&&(st(i),S=""+i),er(o)&&(st(o.key),S=""+o.key),Qt(o)&&(ee=o.ref,tr(o,D));for(F in o)ge.call(o,F)&&!Zt.hasOwnProperty(F)&&(R[F]=o[F]);if(e&&e.defaultProps){var G=e.defaultProps;for(F in G)R[F]===void 0&&(R[F]=G[F])}if(S||ee){var H=typeof e=="function"?e.displayName||e.name||"Unknown":e;S&&rr(R,H),ee&&or(R,H)}return nr(e,S,ee,D,p,we.current,R)}}var Ae=_.ReactCurrentOwner,ut=_.ReactDebugCurrentFrame;function he(e){if(e){var o=e._owner,i=te(e.type,e._source,o?o.type:null);ut.setExtraStackFrame(i)}else ut.setExtraStackFrame(null)}var Be;Be=!1;function Le(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}function gt(){{if(Ae.current){var e=$(Ae.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function ir(e){return""}var mt={};function lr(e){{var o=gt();if(!o){var i=typeof e=="string"?e:e.displayName||e.name;i&&(o=`
24
-
25
- Check the top-level render call using <`+i+">.")}return o}}function pt(e,o){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=lr(o);if(mt[i])return;mt[i]=!0;var p="";e&&e._owner&&e._owner!==Ae.current&&(p=" It was passed a child from "+$(e._owner.type)+"."),he(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,p),he(null)}}function ft(e,o){{if(typeof e!="object")return;if(Ne(e))for(var i=0;i<e.length;i++){var p=e[i];Le(p)&&pt(p,o)}else if(Le(e))e._store&&(e._store.validated=!0);else if(e){var D=m(e);if(typeof D=="function"&&D!==e.entries)for(var F=D.call(e),R;!(R=F.next()).done;)Le(R.value)&&pt(R.value,o)}}}function sr(e){{var o=e.type;if(o==null||typeof o=="string")return;var i;if(typeof o=="function")i=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===l||o.$$typeof===N))i=o.propTypes;else return;if(i){var p=$(o);Jt(i,e.props,"prop",p,e)}else if(o.PropTypes!==void 0&&!Be){Be=!0;var D=$(o);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var o=Object.keys(e.props),i=0;i<o.length;i++){var p=o[i];if(p!=="children"&&p!=="key"){he(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",p),he(null);break}}e.ref!==null&&(he(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var ht={};function bt(e,o,i,p,D,F){{var R=de(e);if(!R){var S="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ee=ir();ee?S+=ee:S+=gt();var G;e===null?G="null":Ne(e)?G="array":e!==void 0&&e.$$typeof===t?(G="<"+($(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):G=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,S)}var H=ar(e,o,i,D,F);if(H==null)return H;if(R){var ie=o.children;if(ie!==void 0)if(p)if(Ne(ie)){for(var be=0;be<ie.length;be++)ft(ie[be],e);Object.freeze&&Object.freeze(ie)}else b("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 ft(ie,e)}if(ge.call(o,"key")){var me=$(e),re=Object.keys(o).filter(function(fr){return fr!=="key"}),Fe=re.length>0?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}";if(!ht[me+Fe]){var pr=re.length>0?"{"+re.join(": ..., ")+": ...}":"{}";b(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,Fe,me,pr,me),ht[me+Fe]=!0}}return e===n?cr(H):sr(H),H}}function dr(e,o,i){return bt(e,o,i,!0)}function ur(e,o,i){return bt(e,o,i,!1)}var gr=ur,mr=dr;xe.Fragment=n,xe.jsx=gr,xe.jsxs=mr}()),xe}var Ge;function Pt(){return Ge||(Ge=1,process.env.NODE_ENV==="production"?ye.exports=Rt():ye.exports=Et()),ye.exports}var r=Pt();const He={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},Je={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},Ke=u.createContext({}),_t=f=>{const{children:t,theme:c,...n}=f,d=u.useMemo(()=>c==="light"?He:c==="dark"?Je:c,[c]);return r.jsx(Ke.Provider,{value:{theme:d,...n},children:t})},ue=()=>u.useContext(Ke),$e={maxRow:2,maxCol:2},Dt={...$e},qe={app:$e,group:Dt};class le{}ze(le,"uniqueArray",t=>t.reduce((c,n)=>c.find(s=>s.id===n.id)?c:c.concat([n]),[])),ze(le,"getTheme",t=>{const c=He.token,n=Je.token,d={...c,...t==null?void 0:t.token},s={...n,...t==null?void 0:t.token};return{light:d,dark:s}});const Ze=u.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),Mt=f=>{const{children:t,list:c=[],onChange:n,storageKey:d="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:s=!0}=f,[g,k]=u.useState(),[l,j]=u.useState(),[x,N]=u.useState(null),M=u.useRef(x),[V,X]=u.useState(null),[v,m]=u.useState([]),[_,b]=u.useState(null),[U,w]=u.useState(null),[B,O]=u.useState(!1),[y,T]=u.useState(null),[K,de]=u.useState(null),[q,fe]=u.useState(!1),[$,oe]=Ye.useLocalStorageState(d,{defaultValue:[],listenStorageChange:!0}),se=()=>{X(null),clearTimeout(g),k(void 0),M.current=null},Y=(P,Q)=>{X({...P,pageX:P.pageX,pageY:P.pageY,data:Q}),clearTimeout(g)},ae=(P,Q=!0)=>{const{config:Z={}}=P;return Z.allowContextMenu===!1?{}:{onMouseDown:L=>{k(setTimeout(()=>{Q&&M.current===null&&Y(L,P)},800)),O(!1),j(setTimeout(()=>{O(!0)},800))},onMouseUp:()=>{clearTimeout(l),j(void 0),clearTimeout(g),k(void 0)},onContextMenu:L=>{Q&&(L.preventDefault(),Y(L,P))}}},ce=(P,Q)=>{const Z=[...Q||[]];if(Z.length>0)m(L=>{const W=[...L],z=I=>{var Ie,Re;const A=Z.shift(),J=I.find(te=>te.id===A),ne=I.findIndex(te=>te.id===A);if(Z.length&&J){if(((Ie=J.children)==null?void 0:Ie.filter(te=>!P.some(ge=>ge.id===te.id)).length)===1&&P.length===1){const te={...P[0]};return I.splice(ne,1,te),n==null||n(I),I}return J.children=z(J.children||[]),I.splice(ne,1,J),n==null||n(I),I}if(J){if(!((Re=J.children)!=null&&Re.length)&&P.length){const te={...J};return J.data={name:"文件夹"},J.type="group",J.children=[te,...P],J.id=We.v4(),I.splice(ne,1,J),n==null||n(I),I}return J.children=le.uniqueArray(P),I.splice(ne,1,J),n==null||n(I),I}return le.uniqueArray(P)};return le.uniqueArray(z(W))});else{const L=le.uniqueArray(P);n==null||n(L),m(L)}},Ce=(P,Q)=>{m(Z=>{const L=[...Z],W=z=>{var I;for(let A=0;A<z.length;A++)if(z[A].id===P){z[A].config=Q;break}else((I=z[A].children)==null?void 0:I.length)!==void 0&&W(z[A].children)};return W(L),n==null||n(L),L})},Se=(P,Q)=>{m(Z=>{const L=[...Z],W=z=>{var I;for(let A=0;A<z.length;A++)if(z[A].id===P){z[A].data=Q;break}else((I=z[A].children)==null?void 0:I.length)!==void 0&&W(z[A].children)};return W(L),n==null||n(L),L})},je=P=>{m(Q=>{const Z=[...Q],L=W=>{var z;for(let I=0;I<W.length;I++)if(W[I].id===P){W.splice(I,1);break}else((z=W[I].children)==null?void 0:z.length)!==void 0&&L(W[I].children)};return L(Z),n==null||n(Z),Z})},Te=(P,Q)=>{const Z=[...v],L=(W,z)=>{const I=z.shift(),A=W.find(ne=>ne.id===I),J=W.findIndex(ne=>ne.id===I);if(A){if(z.length)A.children=L(A.children||[],z);else{const ne=(P==null?void 0:P.type)??"app";A.children=[...A.children??[],{...P,id:We.v4(),config:(P==null?void 0:P.config)??qe[ne]}]}return W.splice(J,1,A),W}else return W};m(L(Z,Q))};return u.useEffect(()=>{(c==null?void 0:c.length)>0&&v.length===0&&ce(c)},[c]),u.useEffect(()=>{M.current=x,x!==null&&se()},[x]),u.useEffect(()=>{s&&$!=null&&$.length&&!q&&(ce($),fe(!0))},[$,q,s]),Ye.useDebounceEffect(()=>{s&&oe(v)},[v,s],{wait:1e3}),r.jsx(Ze.Provider,{value:{list:v,setList:ce,contextMenu:V,setContextMenu:X,listStatus:x,setListStatus:N,contextMenuFuns:ae,hideContextMenu:se,showInfoItemData:_,setShowInfoItemData:b,openGroupItemData:U,setOpenGroupItemData:w,longPressTriggered:B,updateItemConfig:Ce,updateItem:Se,removeItem:je,addItem:Te,moveItemId:y,setMoveItemId:T,moveTargetId:K,setMoveTargetId:de},children:t})},pe=()=>u.useContext(Ze),Nt={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},_e=f=>{const{icon:t,title:c,onClick:n}=f,{theme:d}=ue(),{light:s,dark:g}=le.getTheme(d);return r.jsx(h.motion.div,{className:a.css`
1
+ (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.zs_library={},k.jsxRuntime,k.css,k.React,k.Slider,k.reactSortablejs,k.framerMotion,k.ahooks,k.uuid,k.RcTooltip,k.react$1,k.Dialog,k.ReactJson,k.MDXEditor,k.Markdown,k.remarkGfm,k.emoji,k.rehypeRaw,k.reactSyntaxHighlighter,k.clsx,k.tailwindMerge))})(this,function(k,e,t,f,Ie,oe,s,ie,se,Se,Q,ce,Te,h,Me,Ne,De,Be,Pe,$e,Le){"use strict";var to=Object.defineProperty;var ro=(k,e,t)=>e in k?to(k,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):k[e]=t;var ae=(k,e,t)=>ro(k,typeof e!="symbol"?e+"":e,t);require("./zs_library.css");const de={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},ue={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},ge=f.createContext({}),ze=d=>{const{children:o,theme:l,...r}=d,a=f.useMemo(()=>l==="light"?de:l==="dark"?ue:l,[l]);return e.jsx(ge.Provider,{value:{theme:a,...r},children:o})},U=()=>f.useContext(ge),he={maxRow:2,maxCol:2},qe={...he},pe={app:he,group:qe};class Y{}ae(Y,"uniqueArray",o=>o.reduce((l,r)=>l.find(n=>n.id===r.id)?l:l.concat([r]),[])),ae(Y,"getTheme",o=>{const l=de.token,r=ue.token,a={...l,...o==null?void 0:o.token},n={...r,...o==null?void 0:o.token};return{light:a,dark:n}});const me=f.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),Ae=d=>{const{children:o,list:l=[],onChange:r,storageKey:a="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:n=!0}=d,[u,b]=f.useState(),[i,C]=f.useState(),[S,q]=f.useState(null),B=f.useRef(S),[E,A]=f.useState(null),[g,c]=f.useState([]),[M,y]=f.useState(null),[L,p]=f.useState(null),[T,I]=f.useState(!1),[m,x]=f.useState(null),[X,W]=f.useState(null),[F,le]=f.useState(!1),[J,R]=ie.useLocalStorageState(a,{defaultValue:[],listenStorageChange:!0}),ee=()=>{A(null),clearTimeout(u),b(void 0),B.current=null},P=(v,G)=>{A({...v,pageX:v.pageX,pageY:v.pageY,data:G}),clearTimeout(u)},O=(v,G=!0)=>{const{config:H={}}=v;return H.allowContextMenu===!1?{}:{onMouseDown:N=>{b(setTimeout(()=>{G&&B.current===null&&P(N,v)},800)),I(!1),C(setTimeout(()=>{I(!0)},800))},onMouseUp:()=>{clearTimeout(i),C(void 0),clearTimeout(u),b(void 0)},onContextMenu:N=>{G&&(N.preventDefault(),P(N,v))}}},K=(v,G)=>{const H=[...G||[]];if(H.length>0)c(N=>{const z=[...N],$=w=>{var Ce,ye;const D=H.shift(),j=w.find(V=>V.id===D),_=w.findIndex(V=>V.id===D);if(H.length&&j){if(((Ce=j.children)==null?void 0:Ce.filter(V=>!v.some(oo=>oo.id===V.id)).length)===1&&v.length===1){const V={...v[0]};return w.splice(_,1,V),r==null||r(w),w}return j.children=$(j.children||[]),w.splice(_,1,j),r==null||r(w),w}if(j){if(!((ye=j.children)!=null&&ye.length)&&v.length){const V={...j};return j.data={name:"文件夹"},j.type="group",j.children=[V,...v],j.id=se.v4(),w.splice(_,1,j),r==null||r(w),w}return j.children=Y.uniqueArray(v),w.splice(_,1,j),r==null||r(w),w}return Y.uniqueArray(v)};return Y.uniqueArray($(z))});else{const N=Y.uniqueArray(v);r==null||r(N),c(N)}},Ze=(v,G)=>{c(H=>{const N=[...H],z=$=>{var w;for(let D=0;D<$.length;D++)if($[D].id===v){$[D].config=G;break}else((w=$[D].children)==null?void 0:w.length)!==void 0&&z($[D].children)};return z(N),r==null||r(N),N})},Qe=(v,G)=>{c(H=>{const N=[...H],z=$=>{var w;for(let D=0;D<$.length;D++)if($[D].id===v){$[D].data=G;break}else((w=$[D].children)==null?void 0:w.length)!==void 0&&z($[D].children)};return z(N),r==null||r(N),N})},Re=v=>{c(G=>{const H=[...G],N=z=>{var $;for(let w=0;w<z.length;w++)if(z[w].id===v){z.splice(w,1);break}else(($=z[w].children)==null?void 0:$.length)!==void 0&&N(z[w].children)};return N(H),r==null||r(H),H})},eo=(v,G)=>{const H=[...g],N=(z,$)=>{const w=$.shift(),D=z.find(_=>_.id===w),j=z.findIndex(_=>_.id===w);if(D){if($.length)D.children=N(D.children||[],$);else{const _=(v==null?void 0:v.type)??"app";D.children=[...D.children??[],{...v,id:se.v4(),config:(v==null?void 0:v.config)??pe[_]}]}return z.splice(j,1,D),z}else return z};c(N(H,G))};return f.useEffect(()=>{(l==null?void 0:l.length)>0&&g.length===0&&K(l)},[l]),f.useEffect(()=>{B.current=S,S!==null&&ee()},[S]),f.useEffect(()=>{n&&J!=null&&J.length&&!F&&(K(J),le(!0))},[J,F,n]),ie.useDebounceEffect(()=>{n&&R(g)},[g,n],{wait:1e3}),e.jsx(me.Provider,{value:{list:g,setList:K,contextMenu:E,setContextMenu:A,listStatus:S,setListStatus:q,contextMenuFuns:O,hideContextMenu:ee,showInfoItemData:M,setShowInfoItemData:y,openGroupItemData:L,setOpenGroupItemData:p,longPressTriggered:T,updateItemConfig:Ze,updateItem:Qe,removeItem:Re,addItem:eo,moveItemId:m,setMoveItemId:x,moveTargetId:X,setMoveTargetId:W},children:o})},Z=()=>f.useContext(me),je={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=d=>{const{icon:o,title:l,onClick:r}=d,{theme:a}=U(),{light:n,dark:u}=Y.getTheme(a);return e.jsx(s.motion.div,{className:t.css`
31
2
  &:hover {
32
- background-color: ${s.contextMenuActiveColor};
3
+ background-color: ${n.contextMenuActiveColor};
33
4
  @media (prefers-color-scheme: dark) {
34
- background-color: ${g.contextMenuActiveColor};
5
+ background-color: ${u.contextMenuActiveColor};
35
6
  }
36
7
  }
37
8
  @media (prefers-color-scheme: dark) {
@@ -43,35 +14,35 @@ React keys must be passed directly to JSX without using spread:
43
14
  transition: all 0.3s;
44
15
  user-select: none;
45
16
  border-radius: 0.5rem;
46
- `,onClick:k=>{k.stopPropagation(),n==null||n()},variants:Nt,children:r.jsxs(h.motion.div,{className:a.cx("py-1.5 px-3 rounded-lg",a.css`
17
+ `,onClick:b=>{b.stopPropagation(),r==null||r()},variants:je,children:e.jsxs(s.motion.div,{className:t.cx("py-1.5 px-3 rounded-lg",t.css`
47
18
  padding-top: 0.375rem;
48
19
  padding-bottom: 0.375rem;
49
20
  padding-left: 0.75rem;
50
21
  padding-right: 0.75rem;
51
22
  border-radius: 0.5rem;
52
- `),whileTap:{scale:.9},children:[r.jsx(h.motion.div,{className:a.cx(a.css`
23
+ `),whileTap:{scale:.9},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
53
24
  margin-bottom: 0.375rem;
54
25
  display: flex;
55
26
  justify-content: center;
56
- `),children:t}),r.jsx(h.motion.div,{children:c})]})})},Ot=f=>{const{showInfoButton:t=!0,showRemoveButton:c=!0,showShareButton:n=!0,showSizeButton:d=!0,onInfoClick:s,onShareClick:g,onRemoveClick:k}=f,{contextMenu:l,setContextMenu:j,hideContextMenu:x,setShowInfoItemData:N,removeItem:M,updateItemConfig:V}=pe(),{theme:X}=ue(),{light:v,dark:m}=le.getTheme(X),{data:_}=l??{},{config:b={}}=_??{},U=()=>{var O;const w=qe[(O=l==null?void 0:l.data)==null?void 0:O.type],B=[];for(let y=1;y<=((w==null?void 0:w.maxRow)??2);y++)for(let T=1;T<=((w==null?void 0:w.maxCol)??2);T++)B.push(`${y}x${T}`);return B};return r.jsx(h.AnimatePresence,{children:l&&r.jsxs(h.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:w=>{w.stopPropagation(),w.preventDefault()},children:[r.jsx(h.motion.div,{className:a.cx(a.css`
27
+ `),children:o}),e.jsx(s.motion.div,{children:l})]})})},Ee=d=>{const{showInfoButton:o=!0,showRemoveButton:l=!0,showShareButton:r=!0,showSizeButton:a=!0,onInfoClick:n,onShareClick:u,onRemoveClick:b}=d,{contextMenu:i,setContextMenu:C,hideContextMenu:S,setShowInfoItemData:q,removeItem:B,updateItemConfig:E}=Z(),{theme:A}=U(),{light:g,dark:c}=Y.getTheme(A),{data:M}=i??{},{config:y={}}=M??{},L=()=>{var I;const p=pe[(I=i==null?void 0:i.data)==null?void 0:I.type],T=[];for(let m=1;m<=((p==null?void 0:p.maxRow)??2);m++)for(let x=1;x<=((p==null?void 0:p.maxCol)??2);x++)T.push(`${m}x${x}`);return T};return e.jsx(s.AnimatePresence,{children:i&&e.jsxs(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:p=>{p.stopPropagation(),p.preventDefault()},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
57
28
  border-radius: 0.5rem;
58
29
  overflow: hidden;
59
- background-color: ${v.contextMenuBackgroundColor};
60
- box-shadow: 0 0 0.5rem ${v.contextMenuShadowColor};
30
+ background-color: ${g.contextMenuBackgroundColor};
31
+ box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
61
32
  @media (prefers-color-scheme: dark) {
62
- background-color: ${m.contextMenuBackgroundColor};
63
- box-shadow: 0 0 0.5rem ${m.contextMenuShadowColor};
33
+ background-color: ${c.contextMenuBackgroundColor};
34
+ box-shadow: 0 0 0.5rem ${c.contextMenuShadowColor};
64
35
  }
65
- `),children:d&&b.allowResize!==!1&&r.jsx(h.motion.ul,{className:a.css`
36
+ `),children:a&&y.allowResize!==!1&&e.jsx(s.motion.ul,{className:t.css`
66
37
  background-color: white;
67
38
  padding: 0.25rem;
68
39
  margin: 0;
69
- `,children:[{label:"修改大小",key:"size",icon:r.jsx(ke.RiPencilRuler2Line,{size:14}),items:U().map(w=>({label:w,key:w,onClick:()=>{const[B,O]=w.split("x").map(Number);V(l.data.id,{row:B,col:O})}}))}].map(w=>r.jsxs(h.motion.li,{className:a.css`
40
+ `,children:[{label:"修改大小",key:"size",icon:e.jsx(Q.RiPencilRuler2Line,{size:14}),items:L().map(p=>({label:p,key:p,onClick:()=>{const[T,I]=p.split("x").map(Number);E(i.data.id,{row:T,col:I})}}))}].map(p=>e.jsxs(s.motion.li,{className:t.css`
70
41
  padding-top: 0.5rem;
71
42
  padding-bottom: 0.5rem;
72
43
  padding-left: 0.75rem;
73
44
  padding-right: 0.75rem;
74
- `,children:[r.jsxs(h.motion.p,{className:a.css`
45
+ `,children:[e.jsxs(s.motion.p,{className:t.css`
75
46
  display: flex;
76
47
  align-items: center;
77
48
  font-size: 0.875rem;
@@ -79,11 +50,11 @@ React keys must be passed directly to JSX without using spread:
79
50
  gap: 0.5rem;
80
51
  padding-bottom: 0.5rem;
81
52
  margin: 0;
82
- `,children:[w.icon," ",w.label]}),r.jsx(h.motion.div,{className:a.css`
53
+ `,children:[p.icon," ",p.label]}),e.jsx(s.motion.div,{className:t.css`
83
54
  display: grid;
84
55
  grid-template-columns: repeat(2, minmax(0, 1fr));
85
56
  gap: 0.25rem;
86
- `,children:w.items.map(B=>r.jsx(h.motion.div,{className:a.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",a.css`
57
+ `,children:p.items.map(T=>e.jsx(s.motion.div,{className:t.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",t.css`
87
58
  padding-top: 0.25rem;
88
59
  padding-bottom: 0.25rem;
89
60
  padding-left: 0.5rem;
@@ -94,27 +65,27 @@ React keys must be passed directly to JSX without using spread:
94
65
  line-height: 1.25rem;
95
66
  cursor: pointer;
96
67
  text-align: center;
97
- color: ${v.contextMenuTextColor};
68
+ color: ${g.contextMenuTextColor};
98
69
  @media (prefers-color-scheme: dark) {
99
- color: ${m.contextMenuTextColor};
70
+ color: ${c.contextMenuTextColor};
100
71
  }
101
72
  &:hover {
102
- background-color: ${v.contextMenuActiveColor};
73
+ background-color: ${g.contextMenuActiveColor};
103
74
  @media (prefers-color-scheme: dark) {
104
- background-color: ${m.contextMenuActiveColor};
75
+ background-color: ${c.contextMenuActiveColor};
105
76
  }
106
77
  }
107
- `,`${b.row}x${b.col}`===B.key&&a.css`
108
- background-color: ${v.contextMenuActiveColor};
78
+ `,`${y.row}x${y.col}`===T.key&&t.css`
79
+ background-color: ${g.contextMenuActiveColor};
109
80
  @media (prefers-color-scheme: dark) {
110
- background-color: ${m.contextMenuActiveColor};
81
+ background-color: ${c.contextMenuActiveColor};
111
82
  }
112
- `),onClick:B.onClick,children:B.label},B.key))})]},w.key))})}),r.jsxs(h.motion.div,{className:a.cx(a.css`
113
- background-color: ${v.contextMenuBackgroundColor};
114
- box-shadow: 0 0 0.5rem ${v.contextMenuShadowColor};
83
+ `),onClick:T.onClick,children:T.label},T.key))})]},p.key))})}),e.jsxs(s.motion.div,{className:t.cx(t.css`
84
+ background-color: ${g.contextMenuBackgroundColor};
85
+ box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
115
86
  @media (prefers-color-scheme: dark) {
116
- background-color: ${m.contextMenuBackgroundColor};
117
- box-shadow: 0 0 0.5rem ${m.contextMenuShadowColor};
87
+ background-color: ${c.contextMenuBackgroundColor};
88
+ box-shadow: 0 0 0.5rem ${c.contextMenuShadowColor};
118
89
  }
119
90
  display: flex;
120
91
  justify-content: space-around;
@@ -123,82 +94,82 @@ React keys must be passed directly to JSX without using spread:
123
94
  border-radius: 0.5rem;
124
95
  overflow: hidden;
125
96
  padding: 0.25rem;
126
- `),children:[n&&r.jsx(_e,{icon:r.jsx(ke.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(g){g(l.data);return}}}),t&&r.jsx(_e,{icon:r.jsx(ke.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(s){s(l.data);return}N({...l.data,pageX:l.pageX,pageY:l.pageY}),x()}}),c&&r.jsx(_e,{icon:r.jsx(ke.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(k){k(l.data,M);return}j(null),M(l.data.id)}})]})]})})},At=f=>{const{data:t,noLetters:c=!1}=f,{contextMenuFuns:n}=pe(),{itemIconBuilder:d,theme:s,contextMenu:g}=ue(),{light:k,dark:l}=le.getTheme(s),{data:j={}}=t,{name:x}=j;return r.jsxs(r.Fragment,{children:[r.jsx(h.motion.div,{className:a.css`
97
+ `),children:[r&&e.jsx(te,{icon:e.jsx(Q.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(u){u(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(Q.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(n){n(i.data);return}q({...i.data,pageX:i.pageX,pageY:i.pageY}),S()}}),l&&e.jsx(te,{icon:e.jsx(Q.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(b){b(i.data,B);return}C(null),B(i.data.id)}})]})]})})},Xe=d=>{const{data:o,noLetters:l=!1}=d,{contextMenuFuns:r}=Z(),{itemIconBuilder:a,theme:n,contextMenu:u}=U(),{light:b,dark:i}=Y.getTheme(n),{data:C={}}=o,{name:S}=C;return e.jsxs(e.Fragment,{children:[e.jsx(s.motion.div,{className:t.css`
127
98
  width: 4rem;
128
99
  height: 4rem;
129
- background-color: ${k.itemIconBackgroundColor};
100
+ background-color: ${b.itemIconBackgroundColor};
130
101
  border-radius: 0.75rem;
131
- box-shadow: 0 0 0.5rem ${k.itemIconShadowColor};
102
+ box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
132
103
  cursor: pointer;
133
104
  position: relative;
134
105
  overflow: hidden;
135
106
  @media (prefers-color-scheme: dark) {
136
- background-color: ${l.itemIconBackgroundColor};
137
- box-shadow: 0 0 0.5rem ${l.itemIconShadowColor};
107
+ background-color: ${i.itemIconBackgroundColor};
108
+ box-shadow: 0 0 0.5rem ${i.itemIconShadowColor};
138
109
  }
139
- `,whileTap:{scale:.9},children:r.jsx("div",{className:a.css`
110
+ `,whileTap:{scale:.9},children:e.jsx("div",{className:t.css`
140
111
  position: absolute;
141
112
  left: 0;
142
113
  top: 0;
143
114
  width: 100%;
144
115
  height: 100%;
145
- color: ${k.itemNameColor};
116
+ color: ${b.itemNameColor};
146
117
  @media (prefers-color-scheme: dark) {
147
- color: ${l.itemNameColor};
118
+ color: ${i.itemNameColor};
148
119
  }
149
- `,...n(t,g!==!1),children:d==null?void 0:d(t)})}),r.jsx(h.motion.p,{className:a.cx(a.css`
120
+ `,...r(o,u!==!1),children:a==null?void 0:a(o)})}),e.jsx(s.motion.p,{className:t.cx(t.css`
150
121
  text-align: center;
151
122
  margin-top: 0.25rem;
152
123
  margin-bottom: 0;
153
- color: ${k.itemNameColor};
124
+ color: ${b.itemNameColor};
154
125
  @media (prefers-color-scheme: dark) {
155
- color: ${l.itemNameColor};
126
+ color: ${i.itemNameColor};
156
127
  }
157
- `,c&&a.css`
128
+ `,l&&t.css`
158
129
  color: transparent;
159
- `),children:x})]})},De=f=>{const{data:t,className:c,itemIndex:n,onClick:d,disabledDrag:s=!1,children:g,parentIds:k,childrenLength:l}=f,{contextMenu:j,setContextMenu:x}=pe(),{contextMenu:N}=ue();return r.jsx(vt,{placement:"bottom",overlayClassName:a.css`
130
+ `),children:S})]})},re=d=>{const{data:o,className:l,itemIndex:r,onClick:a,disabledDrag:n=!1,children:u,parentIds:b,childrenLength:i}=d,{contextMenu:C,setContextMenu:S}=Z(),{contextMenu:q}=U();return e.jsx(Se,{placement:"bottom",overlayClassName:t.css`
160
131
  background-color: transparent;
161
132
  .rc-tooltip-inner {
162
133
  background-color: transparent;
163
134
  padding: 0;
164
135
  border: none;
165
136
  }
166
- `,overlay:r.jsx(Ot,{...N}),visible:(j==null?void 0:j.data.id)===t.id,onVisibleChange:M=>{M||x(null)},destroyTooltipOnHide:!0,children:r.jsx(h.motion.div,{"data-id":t.id,"data-index":n,"data-parent-ids":k==null?void 0:k.join(","),"data-children-length":l,onClick:()=>d==null?void 0:d(t),className:a.cx(s&&"drag-disabled",c),children:g??r.jsx(At,{...f})})})},Bt=f=>{const{data:t,className:c,parentIds:n,itemIndex:d,onClick:s,noLetters:g=!1}=f,{contextMenuFuns:k,setList:l,setOpenGroupItemData:j,longPressTriggered:x,moveItemId:N,moveTargetId:M,setMoveTargetId:V,listStatus:X}=pe(),{itemIconBuilder:v,theme:m,contextMenu:_}=ue(),{light:b,dark:U}=le.getTheme(m),{children:w,data:B,config:O}=t,{row:y=1,col:T=1}=O??{},K={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},de=((w==null?void 0:w.length)??0)===0,q=de?[t]:[...w??[]].slice(0,9),fe=u.useMemo(()=>N===t.id.toString(),[t.id,N]),$=u.useMemo(()=>M===t.id,[t.id,M]),oe=a.css`
137
+ `,overlay:e.jsx(Ee,{...q}),visible:(C==null?void 0:C.data.id)===o.id,onVisibleChange:B=>{B||S(null)},destroyTooltipOnHide:!0,children:e.jsx(s.motion.div,{"data-id":o.id,"data-index":r,"data-parent-ids":b==null?void 0:b.join(","),"data-children-length":i,onClick:()=>a==null?void 0:a(o),className:t.cx(n&&"drag-disabled",l),children:u??e.jsx(Xe,{...d})})})},Fe=d=>{const{data:o,className:l,parentIds:r,itemIndex:a,onClick:n,noLetters:u=!1}=d,{contextMenuFuns:b,setList:i,setOpenGroupItemData:C,longPressTriggered:S,moveItemId:q,moveTargetId:B,setMoveTargetId:E,listStatus:A}=Z(),{itemIconBuilder:g,theme:c,contextMenu:M}=U(),{light:y,dark:L}=Y.getTheme(c),{children:p,data:T,config:I}=o,{row:m=1,col:x=1}=I??{},X={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},W=((p==null?void 0:p.length)??0)===0,F=W?[o]:[...p??[]].slice(0,9),le=f.useMemo(()=>q===o.id.toString(),[o.id,q]),J=f.useMemo(()=>B===o.id,[o.id,B]),R=t.css`
167
138
  overflow: hidden;
168
139
  cursor: pointer;
169
- background-color: ${b.itemIconBackgroundColor};
170
- box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
140
+ background-color: ${y.itemIconBackgroundColor};
141
+ box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
171
142
  @media (prefers-color-scheme: dark) {
172
- background-color: ${U.itemIconBackgroundColor};
173
- box-shadow: 0 0 0.5rem ${U.itemIconShadowColor};
143
+ background-color: ${L.itemIconBackgroundColor};
144
+ box-shadow: 0 0 0.5rem ${L.itemIconShadowColor};
174
145
  }
175
- `,se=()=>{if(de)return r.jsx(h.motion.div,{className:a.cx("sortable-group-item",a.css`
146
+ `,ee=()=>{if(W)return e.jsx(s.motion.div,{className:t.cx("sortable-group-item",t.css`
176
147
  overflow: hidden;
177
148
  cursor: pointer;
178
149
  width: 100%;
179
150
  height: 100%;
180
- background-color: ${b.itemIconBackgroundColor};
151
+ background-color: ${y.itemIconBackgroundColor};
181
152
  position: absolute;
182
153
  left: 0;
183
154
  top: 0;
184
155
  border-radius: 0.75rem;
185
156
  @media (prefers-color-scheme: dark) {
186
- background-color: ${U.itemIconBackgroundColor};
157
+ background-color: ${L.itemIconBackgroundColor};
187
158
  }
188
- `),onClick:Y=>{Y.stopPropagation(),s==null||s(t)},children:v==null?void 0:v(t)});if(y===1&&T===1||y===2&&T===2)return r.jsx(h.motion.div,{className:a.css`
159
+ `),onClick:P=>{P.stopPropagation(),n==null||n(o)},children:g==null?void 0:g(o)});if(m===1&&x===1||m===2&&x===2)return e.jsx(s.motion.div,{className:t.css`
189
160
  display: grid;
190
161
  width: 100%;
191
162
  height: 100%;
192
163
  grid-template-columns: repeat(3, minmax(0, 1fr));
193
164
  grid-template-rows: repeat(3, minmax(0, 1fr));
194
- padding: ${T===1?"0.125rem":"0.25rem"};
195
- gap: ${T===1?"0.125rem":"0.5rem"};
165
+ padding: ${x===1?"0.125rem":"0.25rem"};
166
+ gap: ${x===1?"0.125rem":"0.5rem"};
196
167
  place-items: center;
197
- `,children:q==null?void 0:q.slice(0,9).map(Y=>r.jsx(h.motion.div,{className:a.cx(oe,a.css`
198
- border-radius: ${T===1?"0.25rem":"0.5rem"};
168
+ `,children:F==null?void 0:F.slice(0,9).map(P=>e.jsx(s.motion.div,{className:t.cx(R,t.css`
169
+ border-radius: ${x===1?"0.25rem":"0.5rem"};
199
170
  width: 100%;
200
171
  height: 100%;
201
- `),onClick:ae=>{ae.stopPropagation(),s==null||s(Y)},children:v==null?void 0:v(Y)},Y.id))});if(y===1&&T===2)return r.jsx(h.motion.div,{className:a.css`
172
+ `),onClick:O=>{O.stopPropagation(),n==null||n(P)},children:g==null?void 0:g(P)},P.id))});if(m===1&&x===2)return e.jsx(s.motion.div,{className:t.css`
202
173
  display: grid;
203
174
  grid-template-columns: repeat(10, minmax(0, 1fr));
204
175
  grid-template-rows: repeat(4, minmax(0, 1fr));
@@ -207,19 +178,19 @@ React keys must be passed directly to JSX without using spread:
207
178
  width: 144px;
208
179
  height: 52px;
209
180
  place-items: center;
210
- `,children:q==null?void 0:q.slice(0,4).map((Y,ae)=>r.jsx(h.motion.div,{className:a.cx(oe,ae<2?a.css`
181
+ `,children:F==null?void 0:F.slice(0,4).map((P,O)=>e.jsx(s.motion.div,{className:t.cx(R,O<2?t.css`
211
182
  width: 52px;
212
183
  height: 52px;
213
184
  border-radius: 0.5rem;
214
185
  grid-column: span 4 / span 4;
215
186
  grid-row: span 4 / span 4;
216
- `:a.css`
187
+ `:t.css`
217
188
  width: 1.5rem;
218
189
  height: 1.5rem;
219
190
  border-radius: 0.375rem;
220
191
  grid-column: span 2 / span 2;
221
192
  grid-row: span 2 / span 2;
222
- `),onClick:ce=>{ae>2||(ce.stopPropagation(),s==null||s(Y))},children:v==null?void 0:v(Y)},Y.id))});if(y===2&&T===1)return r.jsx(h.motion.div,{className:a.css`
193
+ `),onClick:K=>{O>2||(K.stopPropagation(),n==null||n(P))},children:g==null?void 0:g(P)},P.id))});if(m===2&&x===1)return e.jsx(s.motion.div,{className:t.css`
223
194
  display: grid;
224
195
  grid-template-columns: repeat(4, minmax(0, 1fr));
225
196
  grid-template-rows: repeat(10, minmax(0, 1fr));
@@ -228,36 +199,36 @@ React keys must be passed directly to JSX without using spread:
228
199
  width: 52px;
229
200
  height: 144px;
230
201
  place-items: center;
231
- `,children:q==null?void 0:q.slice(0,4).map((Y,ae)=>r.jsx(h.motion.div,{className:a.cx(oe,ae<2?a.css`
202
+ `,children:F==null?void 0:F.slice(0,4).map((P,O)=>e.jsx(s.motion.div,{className:t.cx(R,O<2?t.css`
232
203
  width: 52px;
233
204
  height: 52px;
234
205
  border-radius: 0.5rem;
235
206
  grid-column: span 4 / span 4;
236
207
  grid-row: span 4 / span 4;
237
- `:a.css`
208
+ `:t.css`
238
209
  width: 1.5rem;
239
210
  height: 1.5rem;
240
211
  grid-column: span 2 / span 2;
241
212
  grid-row: span 2 / span 2;
242
- `),onClick:ce=>{ae>2||(ce.stopPropagation(),s==null||s(Y))},children:v==null?void 0:v(Y)},Y.id))})};return r.jsxs(De,{data:t,itemIndex:d,parentIds:n,childrenLength:w==null?void 0:w.length,className:a.cx(a.css`
243
- grid-row: span ${y};
244
- grid-column: span ${T};
245
- `,c),children:[r.jsx(h.motion.div,{whileTap:{scale:.9},className:a.cx($?"!scale-110":"",a.css`
213
+ `),onClick:K=>{O>2||(K.stopPropagation(),n==null||n(P))},children:g==null?void 0:g(P)},P.id))})};return e.jsxs(re,{data:o,itemIndex:a,parentIds:r,childrenLength:p==null?void 0:p.length,className:t.cx(t.css`
214
+ grid-row: span ${m};
215
+ grid-column: span ${x};
216
+ `,l),children:[e.jsx(s.motion.div,{whileTap:{scale:.9},className:t.cx(J?"!scale-110":"",t.css`
246
217
  cursor: pointer;
247
218
  position: relative;
248
219
  border-radius: 0.75rem;
249
- background-color: ${b.groupItemIconBackgroundColor};
250
- box-shadow: 0 0 0.5rem ${b.groupItemIconShadowColor};
220
+ background-color: ${y.groupItemIconBackgroundColor};
221
+ box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
251
222
  @media (prefers-color-scheme: dark) {
252
- background-color: ${U.groupItemIconBackgroundColor};
253
- box-shadow: 0 0 0.5rem ${U.groupItemIconShadowColor};
223
+ background-color: ${L.groupItemIconBackgroundColor};
224
+ box-shadow: 0 0 0.5rem ${L.groupItemIconShadowColor};
254
225
  }
255
226
  /* overflow: hidden; */
256
227
  transition: all 0.3s;
257
228
  margin: 0 auto;
258
- width: ${T*64+32*(T-1)}px;
259
- height: ${y*64+32*(y-1)}px;
260
- `),onClick:Y=>{!de&&!x&&(t.parentIds=n,t.pageX=Y.pageX,t.pageY=Y.pageY,j(t))},...k(t,_!==!1),children:r.jsxs(h.motion.div,{className:a.css`
229
+ width: ${x*64+32*(x-1)}px;
230
+ height: ${m*64+32*(m-1)}px;
231
+ `),onClick:P=>{!W&&!S&&(o.parentIds=r,o.pageX=P.pageX,o.pageY=P.pageY,C(o))},...b(o,M!==!1),children:e.jsxs(s.motion.div,{className:t.css`
261
232
  position: relative;
262
233
  width: 100%;
263
234
  height: 100%;
@@ -265,28 +236,28 @@ React keys must be passed directly to JSX without using spread:
265
236
  justify-content: center;
266
237
  align-items: center;
267
238
  padding: 0.375rem;
268
- `,children:[se(),r.jsx(Pe.ReactSortable,{className:a.cx("sortable-group-item",a.css`
239
+ `,children:[ee(),e.jsx(oe.ReactSortable,{className:t.cx("sortable-group-item",t.css`
269
240
  position: absolute;
270
241
  cursor: pointer;
271
242
  left: 0.375rem;
272
243
  top: 0.375rem;
273
244
  width: calc(100% - 0.75rem);
274
245
  height: calc(100% - 0.75rem);
275
- pointer-events: ${X===null?"none":"auto"};
246
+ pointer-events: ${A===null?"none":"auto"};
276
247
  > * {
277
248
  opacity: 0;
278
249
  }
279
- `),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:w??[],setList:Y=>l(Y,n),filter:()=>!0,"data-id":t.id,onChange:()=>{V(t.id)}})]})}),r.jsx(h.motion.p,{className:a.cx(a.css`
250
+ `),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:p??[],setList:P=>i(P,r),filter:()=>!0,"data-id":o.id,onChange:()=>{E(o.id)}})]})}),e.jsx(s.motion.p,{className:t.cx(t.css`
280
251
  text-align: center;
281
252
  margin-top: 0.25rem;
282
253
  margin-bottom: 0;
283
- color: ${b.itemNameColor};
254
+ color: ${y.itemNameColor};
284
255
  @media (prefers-color-scheme: dark) {
285
- color: ${U.itemNameColor};
256
+ color: ${L.itemNameColor};
286
257
  }
287
- `,g&&a.css`
258
+ `,u&&t.css`
288
259
  color: transparent;
289
- `),variants:K,animate:fe?"hidden":"visible",children:(B==null?void 0:B.name)??"文件夹"})]})},Qe=a.css`
260
+ `),variants:X,animate:le?"hidden":"visible",children:(T==null?void 0:T.name)??"文件夹"})]})},ke=t.css`
290
261
  padding: 8px;
291
262
  transition: all 0.2s;
292
263
  > div {
@@ -298,7 +269,7 @@ React keys must be passed directly to JSX without using spread:
298
269
  transition: all 0.2s;
299
270
  }
300
271
  }
301
- `,Lt=f=>{const{data:t,onClose:c,onItemClick:n}=f,{list:d,setList:s,setListStatus:g,setMoveItemId:k,setMoveTargetId:l,updateItem:j}=pe(),{theme:x}=ue(),{light:N,dark:M}=le.getTheme(x),[V,X]=u.useState("文件夹"),v=[...(t==null?void 0:t.children)??[]];return u.useEffect(()=>{var m;t&&X((m=t.data)==null?void 0:m.name)},[t]),r.jsx(Ve,{visible:!!t,onClose:()=>{c()},animation:"zoom",maskAnimation:"fade",mousePosition:t!=null&&t.pageX&&(t!=null&&t.pageY)?{x:t==null?void 0:t.pageX,y:t==null?void 0:t.pageY}:null,title:r.jsx("input",{className:a.css`
272
+ `,He=d=>{const{data:o,onClose:l,onItemClick:r}=d,{list:a,setList:n,setListStatus:u,setMoveItemId:b,setMoveTargetId:i,updateItem:C}=Z(),{theme:S}=U(),{light:q,dark:B}=Y.getTheme(S),[E,A]=f.useState("文件夹"),g=[...(o==null?void 0:o.children)??[]];return f.useEffect(()=>{var c;o&&A((c=o.data)==null?void 0:c.name)},[o]),e.jsx(ce,{visible:!!o,onClose:()=>{l()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,title:e.jsx("input",{className:t.css`
302
273
  background-color: transparent;
303
274
  border-style: none;
304
275
  text-align: center;
@@ -311,7 +282,7 @@ React keys must be passed directly to JSX without using spread:
311
282
  &:focus {
312
283
  outline: none;
313
284
  }
314
- `,value:V,onChange:m=>{X(m.target.value)},onBlur:()=>{t&&j(t.id,{...t.data,name:V})}}),footer:null,closable:!1,className:a.cx("group-item-modal",a.css`
285
+ `,value:E,onChange:c=>{A(c.target.value)},onBlur:()=>{o&&C(o.id,{...o.data,name:E})}}),footer:null,closable:!1,className:t.cx("group-item-modal",t.css`
315
286
  .rc-dialog-content {
316
287
  background-color: transparent;
317
288
  box-shadow: none;
@@ -326,26 +297,26 @@ React keys must be passed directly to JSX without using spread:
326
297
  }
327
298
  }
328
299
  .rc-dialog-body {
329
- background-color: ${N.groupItemModalBackgroundColor};
300
+ background-color: ${q.groupItemModalBackgroundColor};
330
301
  @media (prefers-color-scheme: dark) {
331
- background-color: ${M.groupItemModalBackgroundColor};
302
+ background-color: ${B.groupItemModalBackgroundColor};
332
303
  }
333
304
  border-radius: 0.5rem;
334
305
  overflow: hidden;
335
306
  }
336
307
  }
337
- `),width:600,destroyOnClose:!0,children:r.jsx("div",{className:a.css`
308
+ `),width:600,destroyOnClose:!0,children:e.jsx("div",{className:t.css`
338
309
  overflow-y: auto;
339
310
  max-height: 60vh;
340
311
  padding: 1.25rem 0;
341
- `,onDragLeave:m=>{const _=m.relatedTarget;_&&(m.currentTarget.contains(_)||setTimeout(()=>{c()},500))},children:r.jsx(Pe.ReactSortable,{className:a.css`
312
+ `,onDragLeave:c=>{const M=c.relatedTarget;M&&(c.currentTarget.contains(M)||setTimeout(()=>{l()},500))},children:e.jsx(oe.ReactSortable,{className:t.css`
342
313
  display: grid;
343
314
  gap: 1rem;
344
315
  place-items: center;
345
316
  grid-template-columns: repeat(auto-fill, 96px);
346
317
  grid-auto-flow: dense;
347
318
  grid-auto-rows: 96px;
348
- `,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(t==null?void 0:t.children)??[],setList:m=>{var U,w;const _=m.map(B=>B.id),b=(w=(U=d.find(B=>B.id===(t==null?void 0:t.id)))==null?void 0:U.children)==null?void 0:w.map(B=>B.id);_.length===(b==null?void 0:b.length)&&_.every((B,O)=>B===b[O])||_.length<((b==null?void 0:b.length)??0)||s(m,[...(t==null?void 0:t.parentIds)??[],t==null?void 0:t.id])},onMove:()=>(l(null),g("onMove"),!0),onStart:m=>{const _=m.item.dataset;_!=null&&_.id&&k(_.id),g("onMove")},onEnd:()=>{k(null),l(null),g(null)},ghostClass:Qe,children:v.map((m,_)=>r.jsx(De,{data:m,itemIndex:_,onClick:n},m.id))})})})},Ft=f=>{var n;const{data:t,onClose:c}=f;return r.jsx(Ve,{visible:!!t,onClose:()=>{c()},animation:"zoom",maskAnimation:"fade",mousePosition:t!=null&&t.pageX&&(t!=null&&t.pageY)?{x:t==null?void 0:t.pageX,y:t==null?void 0:t.pageY}:null,footer:null,title:((n=t==null?void 0:t.data)==null?void 0:n.name)??"信息",children:t&&r.jsxs("div",{children:[r.jsx("div",{className:"mb-2",children:"开发者信息"}),r.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:r.jsx(xt,{src:t,theme:"monokai"})})]})})},zt=f=>{const{pagination:t={position:"bottom"},className:c,sliderProps:n,sliderRef:d,onItemClick:s}=f,g=u.useRef(null),k=u.useRef(null),{list:l,setList:j,setListStatus:x,showInfoItemData:N,setShowInfoItemData:M,openGroupItemData:V,setOpenGroupItemData:X,setMoveItemId:v,setMoveTargetId:m,addItem:_}=pe(),{pagingDotBuilder:b,pagingDotsBuilder:U,itemBuilder:w}=ue(),B=u.useMemo(()=>t===!1?{}:{top:a.css`
319
+ `,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:c=>{var L,p;const M=c.map(T=>T.id),y=(p=(L=a.find(T=>T.id===(o==null?void 0:o.id)))==null?void 0:L.children)==null?void 0:p.map(T=>T.id);M.length===(y==null?void 0:y.length)&&M.every((T,I)=>T===y[I])||M.length<((y==null?void 0:y.length)??0)||n(c,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),u("onMove"),!0),onStart:c=>{const M=c.item.dataset;M!=null&&M.id&&b(M.id),u("onMove")},onEnd:()=>{b(null),i(null),u(null)},ghostClass:ke,children:g.map((c,M)=>e.jsx(re,{data:c,itemIndex:M,onClick:r},c.id))})})})},Ge=d=>{var r;const{data:o,onClose:l}=d;return e.jsx(ce,{visible:!!o,onClose:()=>{l()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,footer:null,title:((r=o==null?void 0:o.data)==null?void 0:r.name)??"信息",children:o&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:"开发者信息"}),e.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:e.jsx(Te,{src:o,theme:"monokai"})})]})})},Ye=d=>{const{pagination:o={position:"bottom"},className:l,sliderProps:r,sliderRef:a,onItemClick:n}=d,u=f.useRef(null),b=f.useRef(null),{list:i,setList:C,setListStatus:S,showInfoItemData:q,setShowInfoItemData:B,openGroupItemData:E,setOpenGroupItemData:A,setMoveItemId:g,setMoveTargetId:c,addItem:M}=Z(),{pagingDotBuilder:y,pagingDotsBuilder:L,itemBuilder:p}=U(),T=f.useMemo(()=>o===!1?{}:{top:t.css`
349
320
  display: flex;
350
321
  flex-direction: column;
351
322
  .slick-list {
@@ -354,11 +325,11 @@ React keys must be passed directly to JSX without using spread:
354
325
  .slick-dots {
355
326
  position: static;
356
327
  }
357
- `,bottom:a.css`
328
+ `,bottom:t.css`
358
329
  .slick-dots {
359
330
  position: static;
360
331
  }
361
- `,left:a.css`
332
+ `,left:t.css`
362
333
  .slick-dots {
363
334
  position: absolute;
364
335
  width: auto;
@@ -373,7 +344,7 @@ React keys must be passed directly to JSX without using spread:
373
344
  flex-direction: column;
374
345
  }
375
346
  }
376
- `,right:a.css`
347
+ `,right:t.css`
377
348
  .slick-dots {
378
349
  position: absolute;
379
350
  width: auto;
@@ -388,7 +359,7 @@ React keys must be passed directly to JSX without using spread:
388
359
  flex-direction: column;
389
360
  }
390
361
  }
391
- `}[t.position??"bottom"],[t]);return r.jsxs(r.Fragment,{children:[r.jsx(kt,{useCSS:!0,useTransform:!0,arrows:!1,ref:d??g,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:a.cx(B,a.css`
362
+ `}[o.position??"bottom"],[o]);return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{useCSS:!0,useTransform:!0,arrows:!1,ref:a??u,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:t.cx(T,t.css`
392
363
  .slick-track {
393
364
  display: flex;
394
365
  align-items: stretch;
@@ -403,7 +374,7 @@ React keys must be passed directly to JSX without using spread:
403
374
  width: 100%;
404
375
  }
405
376
  }
406
- `,c),customPaging:O=>{var y,T;return b?b(l[O],O):r.jsx("div",{onDragEnter:()=>{var K;(K=(d??g).current)==null||K.slickGoTo(O)},children:(T=(y=l[O])==null?void 0:y.data)==null?void 0:T.name})},appendDots:O=>U?U(O):t===!1?r.jsx("div",{}):r.jsx("div",{children:r.jsx("ul",{ref:k,className:a.cx("slick-dots-default",a.css`
377
+ `,l),customPaging:I=>{var m,x;return y?y(i[I],I):e.jsx("div",{onDragEnter:()=>{var X;(X=(a??u).current)==null||X.slickGoTo(I)},children:(x=(m=i[I])==null?void 0:m.data)==null?void 0:x.name})},appendDots:I=>L?L(I):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:b,className:t.cx("slick-dots-default",t.css`
407
378
  padding: 0.5rem;
408
379
  display: inline-flex;
409
380
  justify-content: center;
@@ -422,7 +393,7 @@ React keys must be passed directly to JSX without using spread:
422
393
  width: auto;
423
394
  height: auto;
424
395
  }
425
- `),children:O})}),...n,children:l.map(O=>r.jsx("div",{onDrop:y=>{y.preventDefault();const T=y.dataTransfer.getData("text/plain");if(T!=="")try{_(JSON.parse(T),[O.id])}catch(K){console.log("drag error",K)}},onDragOver:y=>{y.preventDefault()},children:r.jsx(Pe.ReactSortable,{className:a.cx(a.css`
396
+ `),children:I})}),...r,children:i.map(I=>e.jsx("div",{onDrop:m=>{m.preventDefault();const x=m.dataTransfer.getData("text/plain");if(x!=="")try{M(JSON.parse(x),[I.id])}catch(X){console.log("drag error",X)}},onDragOver:m=>{m.preventDefault()},children:e.jsx(oe.ReactSortable,{className:t.cx(t.css`
426
397
  display: grid;
427
398
  transition: all 0.3s;
428
399
  grid-template-columns: repeat(auto-fill, 96px);
@@ -431,7 +402,7 @@ React keys must be passed directly to JSX without using spread:
431
402
  place-items: center;
432
403
  justify-content: center;
433
404
  align-items: center;
434
- `),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:O.children??[],setList:y=>j(y,[O.id]),filter:".drag-disabled",onMove:y=>{x("onMove");const{dragged:T,related:K}=y,de=T.dataset,q=K.dataset;return m(null),!((Object.keys(q).length===0||q.parentIds)&&Number(de.childrenLength)>0&&K.classList.contains("sortable-group-item"))},onStart:y=>{const T=y.item.dataset;T!=null&&T.id&&v(T.id),x("onMove")},onEnd:()=>{v(null),m(null),x(null)},ghostClass:Qe,children:(O.children??[]).map((y,T)=>{let K;if(w)return w(y);switch(y.type){case"group":case"app":K=r.jsx(Bt,{data:y,itemIndex:T,parentIds:[O.id,y.id],onClick:s},y.id);break;default:K=r.jsx(De,{data:y,itemIndex:T,onClick:s},y.id);break}return K})})},O.id))}),r.jsx(Ft,{data:N,onClose:()=>{M(null)}}),r.jsx(Lt,{data:V,onClose:()=>{X(null)},onItemClick:s})]})},Yt=f=>{const{list:t,onChange:c,storageKey:n,enableCaching:d,theme:s,noLetters:g,contextMenu:k,contextMenuBuilder:l,itemBuilder:j,itemIconBuilder:x,pagingDotBuilder:N,pagingDotsBuilder:M,...V}=f,X={list:t,onChange:c,storageKey:n,enableCaching:d},v={theme:s,noLetters:g,contextMenu:k,pagingDotsBuilder:M,pagingDotBuilder:N,itemBuilder:j,itemIconBuilder:x,contextMenuBuilder:l};return r.jsx(Mt,{...X,children:r.jsx(_t,{...v,children:r.jsx(zt,{...V})})})},Wt={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Vt=(f,t,c)=>{const d=f.split(".").reduce((s,g)=>typeof s=="string"?s:s[g],Wt);return typeof d!="string"?t:c?d.replace(/{{(.*?)}}/g,(s,g)=>c[g]):d},Xt=a.css`
405
+ `),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:I.children??[],setList:m=>C(m,[I.id]),filter:".drag-disabled",onMove:m=>{S("onMove");const{dragged:x,related:X}=m,W=x.dataset,F=X.dataset;return c(null),!((Object.keys(F).length===0||F.parentIds)&&Number(W.childrenLength)>0&&X.classList.contains("sortable-group-item"))},onStart:m=>{const x=m.item.dataset;x!=null&&x.id&&g(x.id),S("onMove")},onEnd:()=>{g(null),c(null),S(null)},ghostClass:ke,children:(I.children??[]).map((m,x)=>{let X;if(p)return p(m);switch(m.type){case"group":case"app":X=e.jsx(Fe,{data:m,itemIndex:x,parentIds:[I.id,m.id],onClick:n},m.id);break;default:X=e.jsx(re,{data:m,itemIndex:x,onClick:n},m.id);break}return X})})},I.id))}),e.jsx(Ge,{data:q,onClose:()=>{B(null)}}),e.jsx(He,{data:E,onClose:()=>{A(null)},onItemClick:n})]})},_e=d=>{const{list:o,onChange:l,storageKey:r,enableCaching:a,theme:n,noLetters:u,contextMenu:b,contextMenuBuilder:i,itemBuilder:C,itemIconBuilder:S,pagingDotBuilder:q,pagingDotsBuilder:B,...E}=d,A={list:o,onChange:l,storageKey:r,enableCaching:a},g={theme:n,noLetters:u,contextMenu:b,pagingDotsBuilder:B,pagingDotBuilder:q,itemBuilder:C,itemIconBuilder:S,contextMenuBuilder:i};return e.jsx(Ae,{...A,children:e.jsx(ze,{...g,children:e.jsx(Ye,{...E})})})},Oe={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Ve=(d,o,l)=>{const a=d.split(".").reduce((n,u)=>typeof n=="string"?n:n[u],Oe);return typeof a!="string"?o:l?a.replace(/{{(.*?)}}/g,(n,u)=>l[u]):a},Ue=t.css`
435
406
  [class*="_toolbarRoot"] {
436
407
  flex-wrap: wrap;
437
408
  }
@@ -500,7 +471,7 @@ React keys must be passed directly to JSX without using spread:
500
471
  margin-bottom: 0;
501
472
  }
502
473
  }
503
- `,et=a.cx("markdown-body",a.css`
474
+ `,fe=t.cx("markdown-body",t.css`
504
475
  p {
505
476
  margin-bottom: 8px;
506
477
  }
@@ -520,4 +491,4 @@ React keys must be passed directly to JSX without using spread:
520
491
  margin: 0 !important;
521
492
  }
522
493
  }
523
- `),Ut={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},Gt=f=>{const{children:t="",className:c}=f;return r.jsx(wt,{className:a.cx(et,c),remarkPlugins:[yt,Ct],rehypePlugins:[St],components:{code(n){const{children:d,className:s,node:g,ref:k,...l}=n,j=/language-(\w+)/.exec(s||"");return j?r.jsx(jt.Prism,{...l,PreTag:"div",children:String(d).replace(/\n$/,""),language:j[1],style:Ut}):r.jsx("code",{...l,className:s,children:d})}},children:t})},tt=f=>{const{value:t,onChange:c,translation:n,pluginConfig:d,...s}=f,g=u.useRef(null),{image:k,diffSource:l={viewMode:"rich-text"},headings:j,link:x,codeBlock:N,codeMirror:M={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:V={directiveDescriptors:[C.AdmonitionDirectiveDescriptor]}}=d??{},[X,v]=u.useState("");return u.useEffect(()=>{var m;t!==void 0&&g.current&&((m=g.current)==null||m.setMarkdown(t),v(t))},[t,g]),r.jsx(C.MDXEditor,{ref:g,className:Xt,contentEditableClassName:et,markdown:X,onChange:m=>{!t&&!c&&v(m),c&&c(m)},translation:n??Vt,plugins:[C.toolbarPlugin({toolbarContents:()=>r.jsxs(C.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[r.jsx(C.UndoRedo,{}),r.jsx(C.Separator,{}),r.jsx(C.BoldItalicUnderlineToggles,{}),r.jsx(C.CodeToggle,{}),r.jsx(C.Separator,{}),r.jsx(C.StrikeThroughSupSubToggles,{}),r.jsx(C.Separator,{}),r.jsx(C.ListsToggle,{}),r.jsx(C.Separator,{}),r.jsx(C.CreateLink,{}),r.jsx(C.InsertImage,{}),r.jsx(C.Separator,{}),r.jsx(C.InsertTable,{}),r.jsx(C.InsertThematicBreak,{}),r.jsx(C.Separator,{}),r.jsx(C.InsertCodeBlock,{}),r.jsx(C.Separator,{}),r.jsx(C.InsertFrontmatter,{})]})}),C.diffSourcePlugin(l),C.listsPlugin(),C.quotePlugin(),C.headingsPlugin(j),C.linkPlugin(x),C.linkDialogPlugin(),C.imagePlugin(k),C.tablePlugin(),C.thematicBreakPlugin(),C.frontmatterPlugin(),C.codeBlockPlugin(N),C.codeMirrorPlugin(M),C.markdownShortcutPlugin(),C.directivesPlugin(V)],...s})};tt.Preview=Gt;function rt(...f){return It.twMerge(Tt.clsx(f))}const Ht=f=>{const{mouseX:t,title:c,icon:n,href:d}=f,s=u.useRef(null),g=h.useTransform(t,_=>{var U;const b=((U=s.current)==null?void 0:U.getBoundingClientRect())??{x:0,width:0};return _-b.x-b.width/2}),k=h.useTransform(g,[-150,0,150],[40,80,40]),l=h.useTransform(g,[-150,0,150],[40,80,40]),j=h.useTransform(g,[-150,0,150],[20,40,20]),x=h.useTransform(g,[-150,0,150],[20,40,20]),N=h.useSpring(k,{mass:.1,stiffness:150,damping:12}),M=h.useSpring(l,{mass:.1,stiffness:150,damping:12}),V=h.useSpring(j,{mass:.1,stiffness:150,damping:12}),X=h.useSpring(x,{mass:.1,stiffness:150,damping:12}),[v,m]=u.useState(!1);return r.jsx("a",{href:d,children:r.jsxs(h.motion.div,{ref:s,style:{width:N,height:M},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[r.jsx(h.AnimatePresence,{children:v&&r.jsx(h.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:c})}),r.jsx(h.motion.div,{style:{width:V,height:X},className:"flex items-center justify-center",children:n})]})})},ot=f=>{const{items:t,className:c}=f,n=h.useMotionValue(1/0);return r.jsx(h.motion.div,{onMouseMove:d=>n.set(d.pageX),onMouseLeave:()=>n.set(1/0),className:rt("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",c),children:t.map(d=>r.jsx(Ht,{mouseX:n,...d},d.title))})},nt=f=>{const{items:t,className:c,collapseIcon:n,autoHidden:d=!1}=f,[s,g]=u.useState(!1),k=()=>{g(!s)};return r.jsxs("div",{className:rt("relative block",d?"md:hidden":"",c),children:[r.jsx(h.AnimatePresence,{children:s&&r.jsx(h.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:t.map((l,j)=>r.jsx(h.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:j*.05}},transition:{delay:(t.length-1-j)*.05},children:r.jsx("a",{href:l.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:r.jsx("div",{className:"h-4 w-4",children:l.icon})},l.title)},l.title))})}),r.jsx("button",{onClick:k,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:n||r.jsx(ke.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},Me=f=>{const{items:t,desktopClassName:c,mobileClassName:n,...d}=f;return r.jsxs(r.Fragment,{children:[r.jsx(ot,{items:t,className:c,...d}),r.jsx(nt,{items:t,className:n,autoHidden:!0,...d})]})};Me.Desktop=ot,Me.Mobile=nt,E.Desktop=Yt,E.Dock=Me,E.MdEditor=tt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
494
+ `),We={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},Je=d=>{const{children:o="",className:l}=d;return e.jsx(Me,{className:t.cx(fe,l),remarkPlugins:[Ne,De],rehypePlugins:[Be],components:{code(r){const{children:a,className:n,node:u,ref:b,...i}=r,C=/language-(\w+)/.exec(n||"");return C?e.jsx(Pe.Prism,{...i,PreTag:"div",children:String(a).replace(/\n$/,""),language:C[1],style:We}):e.jsx("code",{...i,className:n,children:a})}},children:o})},be=d=>{const{value:o,onChange:l,translation:r,pluginConfig:a,...n}=d,u=f.useRef(null),{image:b,diffSource:i={viewMode:"rich-text"},headings:C,link:S,codeBlock:q,codeMirror:B={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:E={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=a??{},[A,g]=f.useState("");return f.useEffect(()=>{var c;o!==void 0&&u.current&&((c=u.current)==null||c.setMarkdown(o),g(o))},[o,u]),e.jsx(h.MDXEditor,{ref:u,className:Ue,contentEditableClassName:fe,markdown:A,onChange:c=>{!o&&!l&&g(c),l&&l(c)},translation:r??Ve,plugins:[h.toolbarPlugin({toolbarContents:()=>e.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(h.UndoRedo,{}),e.jsx(h.Separator,{}),e.jsx(h.BoldItalicUnderlineToggles,{}),e.jsx(h.CodeToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.StrikeThroughSupSubToggles,{}),e.jsx(h.Separator,{}),e.jsx(h.ListsToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.CreateLink,{}),e.jsx(h.InsertImage,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertTable,{}),e.jsx(h.InsertThematicBreak,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertCodeBlock,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(i),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(C),h.linkPlugin(S),h.linkDialogPlugin(),h.imagePlugin(b),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(q),h.codeMirrorPlugin(B),h.markdownShortcutPlugin(),h.directivesPlugin(E)],...n})};be.Preview=Je;function xe(...d){return Le.twMerge($e.clsx(d))}const Ke=d=>{const{mouseX:o,title:l,icon:r,href:a}=d,n=f.useRef(null),u=s.useTransform(o,M=>{var L;const y=((L=n.current)==null?void 0:L.getBoundingClientRect())??{x:0,width:0};return M-y.x-y.width/2}),b=s.useTransform(u,[-150,0,150],[40,80,40]),i=s.useTransform(u,[-150,0,150],[40,80,40]),C=s.useTransform(u,[-150,0,150],[20,40,20]),S=s.useTransform(u,[-150,0,150],[20,40,20]),q=s.useSpring(b,{mass:.1,stiffness:150,damping:12}),B=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),E=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),A=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),[g,c]=f.useState(!1);return e.jsx("a",{href:a,children:e.jsxs(s.motion.div,{ref:n,style:{width:q,height:B},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[e.jsx(s.AnimatePresence,{children:g&&e.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:l})}),e.jsx(s.motion.div,{style:{width:E,height:A},className:"flex items-center justify-center",children:r})]})})},ve=d=>{const{items:o,className:l}=d,r=s.useMotionValue(1/0);return e.jsx(s.motion.div,{onMouseMove:a=>r.set(a.pageX),onMouseLeave:()=>r.set(1/0),className:xe("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",l),children:o.map(a=>e.jsx(Ke,{mouseX:r,...a},a.title))})},we=d=>{const{items:o,className:l,collapseIcon:r,autoHidden:a=!1}=d,[n,u]=f.useState(!1),b=()=>{u(!n)};return e.jsxs("div",{className:xe("relative block",a?"md:hidden":"",l),children:[e.jsx(s.AnimatePresence,{children:n&&e.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:o.map((i,C)=>e.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:C*.05}},transition:{delay:(o.length-1-C)*.05},children:e.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),e.jsx("button",{onClick:b,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||e.jsx(Q.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ne=d=>{const{items:o,desktopClassName:l,mobileClassName:r,...a}=d;return e.jsxs(e.Fragment,{children:[e.jsx(ve,{items:o,className:l,...a}),e.jsx(we,{items:o,className:r,autoHidden:!0,...a})]})};ne.Desktop=ve,ne.Mobile=we,k.Desktop=_e,k.Dock=ne,k.MdEditor=be,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});