@forsion/clip 2.1.0 → 2.1.1
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/chrome-mv3/assets/App-DAX-PWFH.css +1 -0
- package/chrome-mv3/background.js +27 -27
- package/chrome-mv3/chunks/App-X9aJfcOs.js +408 -0
- package/chrome-mv3/manifest.json +1 -1
- package/chrome-mv3/options.html +2 -2
- package/chrome-mv3/sidepanel.html +2 -2
- package/package.json +1 -1
- package/chrome-mv3/assets/App-CTFaMeAz.css +0 -1
- package/chrome-mv3/chunks/App-CjD26llS.js +0 -408
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
var Cj=Object.defineProperty;var Tj=(n,a,r)=>a in n?Cj(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var Ly=(n,a,r)=>Tj(n,typeof a!="symbol"?a+"":a,r);import{E as Aj,r as Uh,u as Lh,D as ih,I as $y}from"./imageHosts-Cmp3E2vS.js";function Oj(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lh={exports:{}},Ls={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var By;function kj(){if(By)return Ls;By=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(s,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:n,type:s,key:h,ref:o!==void 0?o:null,props:d}}return Ls.Fragment=a,Ls.jsx=r,Ls.jsxs=r,Ls}var Zy;function Mj(){return Zy||(Zy=1,lh.exports=kj()),lh.exports}var u=Mj(),rh={exports:{}},De={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Hy;function Dj(){if(Hy)return De;Hy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),j=Symbol.iterator;function z(O){return O===null||typeof O!="object"?null:(O=j&&O[j]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,T={};function L(O,X,pe){this.props=O,this.context=X,this.refs=T,this.updater=pe||w}L.prototype.isReactComponent={},L.prototype.setState=function(O,X){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,X,"setState")},L.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function oe(){}oe.prototype=L.prototype;function I(O,X,pe){this.props=O,this.context=X,this.refs=T,this.updater=pe||w}var te=I.prototype=new oe;te.constructor=I,N(te,L.prototype),te.isPureReactComponent=!0;var K=Array.isArray;function q(){}var H={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function me(O,X,pe){var ue=pe.ref;return{$$typeof:n,type:O,key:X,ref:ue!==void 0?ue:null,props:pe}}function ae(O,X){return me(O.type,X,O.props)}function ge(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function fe(O){var X={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(pe){return X[pe]})}var ie=/\/+/g;function G(O,X){return typeof O=="object"&&O!==null&&O.key!=null?fe(""+O.key):X.toString(36)}function C(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(q,q):(O.status="pending",O.then(function(X){O.status==="pending"&&(O.status="fulfilled",O.value=X)},function(X){O.status==="pending"&&(O.status="rejected",O.reason=X)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function R(O,X,pe,ue,ze){var re=typeof O;(re==="undefined"||re==="boolean")&&(O=null);var he=!1;if(O===null)he=!0;else switch(re){case"bigint":case"string":case"number":he=!0;break;case"object":switch(O.$$typeof){case n:case a:he=!0;break;case p:return he=O._init,R(he(O._payload),X,pe,ue,ze)}}if(he)return ze=ze(O),he=ue===""?"."+G(O,0):ue,K(ze)?(pe="",he!=null&&(pe=he.replace(ie,"$&/")+"/"),R(ze,X,pe,"",function(Ve){return Ve})):ze!=null&&(ge(ze)&&(ze=ae(ze,pe+(ze.key==null||O&&O.key===ze.key?"":(""+ze.key).replace(ie,"$&/")+"/")+he)),X.push(ze)),1;he=0;var de=ue===""?".":ue+":";if(K(O))for(var ye=0;ye<O.length;ye++)ue=O[ye],re=de+G(ue,ye),he+=R(ue,X,pe,re,ze);else if(ye=z(O),typeof ye=="function")for(O=ye.call(O),ye=0;!(ue=O.next()).done;)ue=ue.value,re=de+G(ue,ye++),he+=R(ue,X,pe,re,ze);else if(re==="object"){if(typeof O.then=="function")return R(C(O),X,pe,ue,ze);throw X=String(O),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return he}function B(O,X,pe){if(O==null)return O;var ue=[],ze=0;return R(O,ue,"","",function(re){return X.call(pe,re,ze++)}),ue}function ce(O){if(O._status===-1){var X=O._result,pe=X();pe.then(function(ue){(O._status===0||O._status===-1)&&(O._status=1,O._result=ue,pe.status===void 0&&(pe.status="fulfilled",pe.value=ue))},function(ue){(O._status===0||O._status===-1)&&(O._status=2,O._result=ue,pe.status===void 0&&(pe.status="rejected",pe.reason=ue))}),O._status===-1&&(O._status=0,O._result=pe)}if(O._status===1)return O._result.default;throw O._result}var ne=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function xe(O){var X=H.T,pe={};pe.types=X!==null?X.types:null,H.T=pe;try{var ue=O(),ze=H.S;ze!==null&&ze(pe,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(q,ne)}catch(re){ne(re)}finally{X!==null&&pe.types!==null&&(X.types=pe.types),H.T=X}}function Te(O){var X=H.T;if(X!==null){var pe=X.types;pe===null?X.types=[O]:pe.indexOf(O)===-1&&pe.push(O)}else xe(Te.bind(null,O))}var Me={map:B,forEach:function(O,X,pe){B(O,function(){X.apply(this,arguments)},pe)},count:function(O){var X=0;return B(O,function(){X++}),X},toArray:function(O){return B(O,function(X){return X})||[]},only:function(O){if(!ge(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return De.Activity=g,De.Children=Me,De.Component=L,De.Fragment=r,De.Profiler=o,De.PureComponent=I,De.StrictMode=s,De.Suspense=y,De.ViewTransition=S,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,De.__COMPILER_RUNTIME={__proto__:null,c:function(O){return H.H.useMemoCache(O)}},De.addTransitionType=Te,De.cache=function(O){return function(){return O.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(O,X,pe){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ue=N({},O.props),ze=O.key;if(X!=null)for(re in X.key!==void 0&&(ze=""+X.key),X)!J.call(X,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&X.ref===void 0||(ue[re]=X[re]);var re=arguments.length-2;if(re===1)ue.children=pe;else if(1<re){for(var he=Array(re),de=0;de<re;de++)he[de]=arguments[de+2];ue.children=he}return me(O.type,ze,ue)},De.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:d,_context:O},O},De.createElement=function(O,X,pe){var ue,ze={},re=null;if(X!=null)for(ue in X.key!==void 0&&(re=""+X.key),X)J.call(X,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ze[ue]=X[ue]);var he=arguments.length-2;if(he===1)ze.children=pe;else if(1<he){for(var de=Array(he),ye=0;ye<he;ye++)de[ye]=arguments[ye+2];ze.children=de}if(O&&O.defaultProps)for(ue in he=O.defaultProps,he)ze[ue]===void 0&&(ze[ue]=he[ue]);return me(O,re,ze)},De.createRef=function(){return{current:null}},De.forwardRef=function(O){return{$$typeof:m,render:O}},De.isValidElement=ge,De.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:ce}},De.memo=function(O,X){return{$$typeof:b,type:O,compare:X===void 0?null:X}},De.startTransition=xe,De.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},De.use=function(O){return H.H.use(O)},De.useActionState=function(O,X,pe){return H.H.useActionState(O,X,pe)},De.useCallback=function(O,X){return H.H.useCallback(O,X)},De.useContext=function(O){return H.H.useContext(O)},De.useDebugValue=function(){},De.useDeferredValue=function(O,X){return H.H.useDeferredValue(O,X)},De.useEffect=function(O,X){return H.H.useEffect(O,X)},De.useEffectEvent=function(O){return H.H.useEffectEvent(O)},De.useId=function(){return H.H.useId()},De.useImperativeHandle=function(O,X,pe){return H.H.useImperativeHandle(O,X,pe)},De.useInsertionEffect=function(O,X){return H.H.useInsertionEffect(O,X)},De.useLayoutEffect=function(O,X){return H.H.useLayoutEffect(O,X)},De.useMemo=function(O,X){return H.H.useMemo(O,X)},De.useOptimistic=function(O,X){return H.H.useOptimistic(O,X)},De.useReducer=function(O,X,pe){return H.H.useReducer(O,X,pe)},De.useRef=function(O){return H.H.useRef(O)},De.useState=function(O){return H.H.useState(O)},De.useSyncExternalStore=function(O,X,pe){return H.H.useSyncExternalStore(O,X,pe)},De.useTransition=function(){return H.H.useTransition()},De.version="19.3.0",De}var qy;function fm(){return qy||(qy=1,rh.exports=Dj()),rh.exports}var M=fm();const qc=Oj(M),Vy="2.1.1";var sh={exports:{}},$s={},oh={exports:{}},ch={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Yy;function Rj(){return Yy||(Yy=1,(function(n){function a(C,R){var B=C.length;C.push(R);e:for(;0<B;){var ce=B-1>>>1,ne=C[ce];if(0<o(ne,R))C[ce]=R,C[B]=ne,B=ce;else break e}}function r(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var R=C[0],B=C.pop();if(B!==R){C[0]=B;e:for(var ce=0,ne=C.length,xe=ne>>>1;ce<xe;){var Te=2*(ce+1)-1,Me=C[Te],O=Te+1,X=C[O];if(0>o(Me,B))O<ne&&0>o(X,Me)?(C[ce]=X,C[O]=B,ce=O):(C[ce]=Me,C[Te]=B,ce=Te);else if(O<ne&&0>o(X,B))C[ce]=X,C[O]=B,ce=O;else break e}}return R}function o(C,R){var B=C.sortIndex-R.sortIndex;return B!==0?B:C.id-R.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var y=[],b=[],p=1,g=null,S=3,j=!1,z=!1,w=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,oe=typeof setImmediate<"u"?setImmediate:null;function I(C){for(var R=r(b);R!==null;){if(R.callback===null)s(b);else if(R.startTime<=C)s(b),R.sortIndex=R.expirationTime,a(y,R);else break;R=r(b)}}function te(C){if(w=!1,I(C),!z)if(r(y)!==null)z=!0,K||(K=!0,ge());else{var R=r(b);R!==null&&G(te,R.startTime-C)}}var K=!1,q=-1,H=5,J=-1;function me(){return N?!0:!(n.unstable_now()-J<H)}function ae(){if(N=!1,K){var C=n.unstable_now();J=C;var R=!0;try{e:{z=!1,w&&(w=!1,L(q),q=-1),j=!0;var B=S;try{t:{for(I(C),g=r(y);g!==null&&!(g.expirationTime>C&&me());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,S=g.priorityLevel;var ne=ce(g.expirationTime<=C);if(C=n.unstable_now(),typeof ne=="function"){g.callback=ne,I(C),R=!0;break t}g===r(y)&&s(y),I(C)}else s(y);g=r(y)}if(g!==null)R=!0;else{var xe=r(b);xe!==null&&G(te,xe.startTime-C),R=!1}}break e}finally{g=null,S=B,j=!1}R=void 0}}finally{R?ge():K=!1}}}var ge;if(typeof oe=="function")ge=function(){oe(ae)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ie=fe.port2;fe.port1.onmessage=ae,ge=function(){ie.postMessage(null)}}else ge=function(){T(ae,0)};function G(C,R){q=T(function(){C(n.unstable_now())},R)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(C){C.callback=null},n.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<C?Math.floor(1e3/C):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(C){switch(S){case 1:case 2:case 3:var R=3;break;default:R=S}var B=S;S=R;try{return C()}finally{S=B}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(C,R){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var B=S;S=C;try{return R()}finally{S=B}},n.unstable_scheduleCallback=function(C,R,B){var ce=n.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ce+B:ce):B=ce,C){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=B+ne,C={id:p++,callback:R,priorityLevel:C,startTime:B,expirationTime:ne,sortIndex:-1},B>ce?(C.sortIndex=B,a(b,C),r(y)===null&&C===r(b)&&(w?(L(q),q=-1):w=!0,G(te,B-ce))):(C.sortIndex=ne,a(y,C),z||j||(z=!0,K||(K=!0,ge()))),C},n.unstable_shouldYield=me,n.unstable_wrapCallback=function(C){var R=S;return function(){var B=S;S=R;try{return C.apply(this,arguments)}finally{S=B}}}})(ch)),ch}var Iy;function Uj(){return Iy||(Iy=1,oh.exports=Rj()),oh.exports}var uh={exports:{}},tn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Gy;function Lj(){if(Gy)return tn;Gy=1;var n=fm();function a(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function m(p,g,S){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:j===h?h:""+j,children:p,containerInfo:g,implementation:S}}var y=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,tn.browser=function(p){return{$$typeof:d,_reason:p}},tn.createPortal=function(p,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return m(p,g,null,S)},tn.flushSync=function(p){var g=y.T,S=s.p;try{if(y.T=null,s.p=2,p)return p()}finally{y.T=g,s.p=S,s.d.f()}},tn.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},tn.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},tn.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var S=g.as,j=b(S,g.crossOrigin),z=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:z,fetchPriority:w}):S==="script"&&s.d.X(p,{crossOrigin:j,integrity:z,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},tn.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=b(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&s.d.M(p)},tn.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,j=b(S,g.crossOrigin);s.d.L(p,S,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},tn.preloadModule=function(p,g){if(typeof p=="string")if(g){var S=b(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else s.d.m(p)},tn.requestFormReset=function(p){s.d.r(p)},tn.unstable_batchedUpdates=function(p,g){return p(g)},tn.useFormState=function(p,g,S){return y.H.useFormState(p,g,S)},tn.useFormStatus=function(){return y.H.useHostTransitionStatus()},tn.version="19.3.0",tn}var Fy;function j0(){if(Fy)return uh.exports;Fy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),uh.exports=Lj(),uh.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Ky;function $j(){if(Ky)return $s;Ky=1;var n=Uj(),a=fm(),r=j0();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(s(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var c=i.return;if(c===null)break;var f=c.alternate;if(f===null){if(l=c.return,l!==null){i=l;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===i)return y(c),e;if(f===l)return y(c),t;f=f.sibling}throw Error(s(188))}if(i.return!==l.return)i=c,l=f;else{for(var v=!1,_=c.child;_;){if(_===i){v=!0,i=c,l=f;break}if(_===l){v=!0,l=c,i=f;break}_=_.sibling}if(!v){for(_=f.child;_;){if(_===i){v=!0,i=f,l=c;break}if(_===l){v=!0,l=f,i=c;break}_=_.sibling}if(!v)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function g(e,t,i,l,c,f){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,l,c,f)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&g(e.child,t,i,l,c,f))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function j(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function z(e){var t=[null,null],i=S(e);return i===null||w(t,e,i.child,{foundSelf:!1}),t}function w(e,t,i,l){for(;i!==null;){if(i===t)l.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(l.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&w(e,t,i.child,l))return!0;i=i.sibling}return!1}function N(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var T=null,L=null;function oe(e,t,i){return e===i?!0:e===t?(T=e,!0):!1}function I(e,t,i){return e===i?(L=e,!1):e===t?(L!==null&&(T=e),!0):!1}function te(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function K(e,t,i){for(var l=0,c=e;c;c=i(c))l++;c=0;for(var f=t;f;f=i(f))c++;for(;0<l-c;)e=i(e),l--;for(;0<c-l;)t=i(t),c--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var q=Object.assign,H=Symbol.for("react.element"),J=Symbol.for("react.transitional.element"),me=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),ge=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),G=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),Te=Symbol.for("react.legacy_hidden"),Me=Symbol.for("react.memo_cache_sentinel"),O=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),pe=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=pe&&e[pe]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ze?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ae:return"Fragment";case fe:return"Profiler";case ge:return"StrictMode";case R:return"Suspense";case B:return"SuspenseList";case xe:return"Activity";case O:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case me:return"Portal";case G:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case C:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var he=Array.isArray,de=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ve={pending:!1,data:null,method:null,action:null},xn=[],ja=-1;function Xt(e){return{current:e}}function _t(e){0>ja||(e.current=xn[ja],xn[ja]=null,ja--)}function et(e,t){ja++,xn[ja]=e.current,e.current=t}var un=Xt(null),an=Xt(null),ln=Xt(null),kn=Xt(null);function Ha(e,t){switch(et(ln,t),et(an,e),et(un,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gv(t),e=Fv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_t(un),et(un,e)}function Zt(){_t(un),_t(an),_t(ln)}function ca(e){var t=e.memoizedState;t!==null&&(br._currentValue=t.memoizedState,et(kn,e)),t=un.current;var i=Fv(t,e.type);t!==i&&(et(an,e),et(un,i))}function qa(e){an.current===e&&(_t(un),_t(an)),kn.current===e&&(_t(kn),br._currentValue=Ve)}var wa,el;function rn(e){if(wa===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);wa=t&&t[1]||"",el=-1<i.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+wa+e+el}var se=!1;function Ye(e,t){if(!e||se)return"";se=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(ve){var D=ve}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(ve){D=ve}ee=!1;try{var V=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ee=!0,new e}finally{ee&&(V!==void 0?Object.defineProperty(e.prototype,"props",V):delete e.prototype.props)}}}else{try{throw Error()}catch(ve){D=ve}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(ve){if(ve&&D&&typeof ve.stack=="string")return[ve.stack,D.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),v=f[0],_=f[1];if(v&&_){var A=v.split(`
|
|
44
|
+
`),$=_.split(`
|
|
45
|
+
`);for(c=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;if(l===A.length||c===$.length)for(l=A.length-1,c=$.length-1;1<=l&&0<=c&&A[l]!==$[c];)c--;for(;1<=l&&0<=c;l--,c--)if(A[l]!==$[c]){if(l!==1||c!==1)do if(l--,c--,0>c||A[l]!==$[c]){var Y=`
|
|
46
|
+
`+A[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=c);break}}}finally{se=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?rn(i):""}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return e.child!==t&&t!==null?rn("Suspense Fallback"):rn("Suspense");case 19:return rn("SuspenseList");case 0:case 15:return Ye(e.type,!1);case 11:return Ye(e.type.render,!1);case 1:return Ye(e.type,!0);case 31:return rn("Activity");case 30:return rn("ViewTransition");default:return""}}function ht(e){try{var t="",i=null;do t+=Ae(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var kt=Object.prototype.hasOwnProperty,za=n.unstable_scheduleCallback,fn=n.unstable_cancelCallback,Ml=n.unstable_shouldYield,ua=n.unstable_requestPaint,Ht=n.unstable_now,Au=n.unstable_getCurrentPriorityLevel,go=n.unstable_ImmediatePriority,je=n.unstable_UserBlockingPriority,rt=n.unstable_NormalPriority,Re=n.unstable_LowPriority,Mt=n.unstable_IdlePriority,Ou=n.log,ku=n.unstable_setDisableYieldValue,Mn=null,sn=null;function Dn(e){if(typeof Ou=="function"&&ku(e),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Mn,e)}catch{}}var on=Math.clz32?Math.clz32:Mu,pi=Math.log,gi=Math.LN2;function Mu(e){return e>>>=0,e===0?32:31-(pi(e)/gi|0)|0}var Va=256,E=262144,Jn=4194304;function Oe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _n(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var c=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var _=l&134217727;return _!==0?(l=_&~f,l!==0?c=Oe(l):(v&=_,v!==0?c=Oe(v):i||(i=_&~e,i!==0&&(c=Oe(i))))):(_=l&~f,_!==0?c=Oe(_):v!==0?c=Oe(v):i||(i=l&~e,i!==0&&(c=Oe(i)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,i=t&-t,f>=i||f===32&&(i&4194048)!==0)?t:c}function Rn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $r(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var l=31-on(i),c=1<<l;t|=e[l],i&=~c}return t}function Br(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zr(){var e=Jn;return Jn<<=1,(Jn&62914560)===0&&(Jn=4194304),e}function Dl(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ya(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Du(e,t,i,l,c,f){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var _=e.entanglements,A=e.expirationTimes,$=e.hiddenUpdates;for(i=v&~i;0<i;){var Y=31-on(i),ee=1<<Y;_[Y]=0,A[Y]=-1;var D=$[Y];if(D!==null)for($[Y]=null,Y=0;Y<D.length;Y++){var V=D[Y];V!==null&&(V.lane&=-536870913)}i&=~ee}l!==0&&vo(e,l,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(v&~t))}function vo(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-on(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function Rl(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-on(i),c=1<<l;c&t|e[l]&t&&(e[l]|=t),i&=~c}}function ft(e,t){var i=t&-t;return i=(i&42)!==0?1:dn(i),(i&(e.suspendedLanes|t))!==0?0:i}function dn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function qr(){var e=ye.p;return e!==0?e:(e=window.event,e===void 0?32:Ay(e.type))}function tl(e,t){var i=ye.p;try{return ye.p=e,t()}finally{ye.p=i}}var Un=Math.random().toString(36).slice(2),qt="__reactFiber$"+Un,Dt="__reactProps$"+Un,fa="__reactContainer$"+Un,yo="__reactEvents$"+Un,bo="__reactListeners$"+Un,Ru="__reactHandles$"+Un,nl="__reactResources$"+Un,vi="__reactMarker$"+Un,Ul="__reactLoad$"+Un;function Ll(e){delete e[qt],delete e[Dt],delete e[bo],delete e[Ru]}function Pn(e){var t;if(t=e[qt])return t;for(var i=e.parentNode;i;){if(t=i[fa]||i[qt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=uy(e);e!==null;){if(i=e[qt])return i;e=uy(e)}return t}e=i,i=e.parentNode}return null}function Ia(e){if(e=e[qt]||e[fa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Na(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function hn(e){var t=e[nl];return t||(t=e[nl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[vi]=!0}function So(e){e[Ul]=void 0}var xo=new Set,Vr={};function Ea(e,t){Ga(e,t),Ga(e+"Capture",t)}function Ga(e,t){for(Vr[e]=t,e=0;e<t.length;e++)xo.add(t[e])}var _o=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yr={},Ir={};function jo(e){return kt.call(Ir,e)?!0:kt.call(Yr,e)?!1:_o.test(e)?Ir[e]=!0:(Yr[e]=!0,!1)}var Qe=!1;function Gr(){var e=Qe;return Qe=!1,e}function al(e,t,i){if(jo(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function il(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function x(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,l)}}function Q(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function F(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $e(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,f=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(v){i=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ne(e){if(!e._valueTracker){var t=F(e)?"checked":"value";e._valueTracker=$e(e,t,""+e[t])}}function Ze(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=F(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}var vt=/[\n"\\]/g;function Je(e){return e.replace(vt,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vt(e,t,i,l,c,f,v,_){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Q(t)):e.value!==""+Q(t)&&(e.value=""+Q(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?v==="number"&&e.value==t?$l(e,Q(e.value)):$l(e,Q(t)):i!=null?$l(e,Q(i)):l!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Q(_):e.removeAttribute("name")}function Fa(e,t,i,l,c,f,v,_){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||i!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Ne(e);return}i=i!=null?""+Q(i):"",t=t!=null?""+Q(t):i,_||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=_?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Ne(e)}function $l(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Ka(e,t,i,l){if(e=e.options,t){t={};for(var c=0;c<i.length;c++)t["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=t.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Q(i),t=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Fr(e,t,i){if(t!=null&&(t=""+Q(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Q(i):""}function P(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(s(92));if(he(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=Q(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Ne(e)}function be(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var it=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tt(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||it.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function nt(e,t,i){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Qe=!0);for(var c in t)l=t[c],t.hasOwnProperty(c)&&i[c]!==l&&(tt(e,c,l),Qe=!0)}else for(var f in t)t.hasOwnProperty(f)&&tt(e,f,t[f])}function ll(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uu=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Kr=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wo(e){return Kr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ca(){}var Lu=null;function $u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bl=null,Zl=null;function Zm(e){var t=Ia(e);if(t&&(e=t.stateNode)){var i=e[Dt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vt(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Je(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var c=l[Dt]||null;if(!c)throw Error(s(90));Vt(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&Ze(l)}break e;case"textarea":Fr(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Ka(e,!!i.multiple,t,!1)}}}var Bu=!1;function Hm(e,t,i){if(Bu)return e(t,i);Bu=!0;try{var l=e(t);return l}finally{if(Bu=!1,(Bl!==null||Zl!==null)&&(wc(),Bl&&(t=Bl,e=Zl,Zl=Bl=null,Zm(t),e)))for(t=0;t<e.length;t++)Zm(e[t])}}function Xr(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Dt]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zu=!1;if(Xa)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){Zu=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{Zu=!1}var yi=null,Hu=null,zo=null;function qm(){if(zo)return zo;var e,t=Hu,i=t.length,l,c="value"in yi?yi.value:yi.textContent,f=c.length;for(e=0;e<i&&t[e]===c[e];e++);var v=i-e;for(l=1;l<=v&&t[i-l]===c[f-l];l++);return zo=c.slice(e,1<l?1-l:void 0)}function No(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Eo(){return!0}function Vm(){return!1}function mn(e){function t(i,l,c,f,v){this._reactName=i,this._targetInst=c,this.type=l,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(i=e[_],this[_]=i?i(f):f[_]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Eo:Vm,this.isPropagationStopped=Vm,this}return q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Eo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Eo)},persist:function(){},isPersistent:Eo}),t}var bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Co=mn(bi),Jr=q({},bi,{view:0,detail:0}),WS=mn(Jr),qu,Vu,Pr,To=q({},Jr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Pr&&(Pr&&e.type==="mousemove"?(qu=e.screenX-Pr.screenX,Vu=e.screenY-Pr.screenY):Vu=qu=0,Pr=e),qu)},movementY:function(e){return"movementY"in e?e.movementY:Vu}}),Ym=mn(To),ex=q({},To,{dataTransfer:0}),tx=mn(ex),nx=q({},Jr,{relatedTarget:0}),Yu=mn(nx),ax=q({},bi,{animationName:0,elapsedTime:0,pseudoElement:0}),ix=mn(ax),lx=q({},bi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rx=mn(lx),sx=q({},bi,{data:0}),Im=mn(sx),ox={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ux={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ux[e])?!!t[e]:!1}function Iu(){return fx}var dx=q({},Jr,{key:function(e){if(e.key){var t=ox[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=No(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iu,charCode:function(e){return e.type==="keypress"?No(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?No(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hx=mn(dx),mx=q({},To,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gm=mn(mx),px=q({},bi,{submitter:0}),gx=mn(px),vx=q({},Jr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iu}),yx=mn(vx),bx=q({},bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sx=mn(bx),xx=q({},To,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_x=mn(xx),jx=q({},bi,{newState:0,oldState:0,source:0}),wx=mn(jx),zx=[9,13,27,32],Gu=Xa&&"CompositionEvent"in window,Wr=null;Xa&&"documentMode"in document&&(Wr=document.documentMode);var Nx=Xa&&"TextEvent"in window&&!Wr,Fm=Xa&&(!Gu||Wr&&8<Wr&&11>=Wr),Km=" ",Xm=!1;function Qm(e,t){switch(e){case"keyup":return zx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hl=!1;function Ex(e,t){switch(e){case"compositionend":return Jm(t);case"keypress":return t.which!==32?null:(Xm=!0,Km);case"textInput":return e=t.data,e===Km&&Xm?null:e;default:return null}}function Cx(e,t){if(Hl)return e==="compositionend"||!Gu&&Qm(e,t)?(e=qm(),zo=Hu=yi=null,Hl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fm&&t.locale!=="ko"?null:t.data;default:return null}}var Tx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tx[e.type]:t==="textarea"}function Wm(e,t,i,l){Bl?Zl?Zl.push(l):Zl=[l]:Bl=l,t=Ac(t,"onChange"),0<t.length&&(i=new Co("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var es=null,ts=null;function Ax(e){Zv(e,0)}function Ao(e){var t=Na(e);if(Ze(t))return e}function ep(e,t){if(e==="change")return t}var tp=!1;if(Xa){var Fu;if(Xa){var Ku="oninput"in document;if(!Ku){var np=document.createElement("div");np.setAttribute("oninput","return;"),Ku=typeof np.oninput=="function"}Fu=Ku}else Fu=!1;tp=Fu&&(!document.documentMode||9<document.documentMode)}function ap(){es&&(es.detachEvent("onpropertychange",ip),ts=es=null)}function ip(e){if(e.propertyName==="value"&&Ao(ts)){var t=[];Wm(t,ts,e,$u(e)),Hm(Ax,t)}}function Ox(e,t,i){e==="focusin"?(ap(),es=t,ts=i,es.attachEvent("onpropertychange",ip)):e==="focusout"&&ap()}function kx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ao(ts)}function Mx(e,t){if(e==="click")return Ao(t)}function Dx(e,t){if(e==="input"||e==="change")return Ao(t)}function Rx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ln=typeof Object.is=="function"?Object.is:Rx;function ns(e,t){if(Ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var c=i[l];if(!kt.call(t,c)||!Ln(e[c],t[c]))return!1}return!0}function Xu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rp(e,t){var i=lp(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=lp(i)}}function sp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function op(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xu(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Xu(e.document)}return t}function Qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ux=Xa&&"documentMode"in document&&11>=document.documentMode,ql=null,Ju=null,as=null,Pu=!1;function cp(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Pu||ql==null||ql!==Xu(l)||(l=ql,"selectionStart"in l&&Qu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),as&&ns(as,l)||(as=l,l=Ac(Ju,"onSelect"),0<l.length&&(t=new Co("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=ql)))}function rl(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Vl={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionrun:rl("Transition","TransitionRun"),transitionstart:rl("Transition","TransitionStart"),transitioncancel:rl("Transition","TransitionCancel"),transitionend:rl("Transition","TransitionEnd")},Wu={},up={};Xa&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function sl(e){if(Wu[e])return Wu[e];if(!Vl[e])return e;var t=Vl[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in up)return Wu[e]=t[i];return e}var fp=sl("animationend"),dp=sl("animationiteration"),hp=sl("animationstart"),Lx=sl("transitionrun"),$x=sl("transitionstart"),Bx=sl("transitioncancel"),mp=sl("transitionend"),pp=new Map,ef="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ef.push("scrollEnd");function da(e,t){pp.set(e,t),Ea(t,[e])}var Zx=0;function Qa(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ga.identifierPrefix;var i=Zx++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function gp(e){if(e==null||typeof e=="string")return e;var t=null,i=cr;if(i!==null)for(var l=0;l<i.length;l++){var c=e[i[l]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Ja(e,t){return e=gp(e),t=gp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Oo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Wn=[],Yl=0,tf=0;function ko(){for(var e=Yl,t=tf=Yl=0;t<e;){var i=Wn[t];Wn[t++]=null;var l=Wn[t];Wn[t++]=null;var c=Wn[t];Wn[t++]=null;var f=Wn[t];if(Wn[t++]=null,l!==null&&c!==null){var v=l.pending;v===null?c.next=c:(c.next=v.next,v.next=c),l.pending=c}f!==0&&vp(i,c,f)}}function Mo(e,t,i,l){Wn[Yl++]=e,Wn[Yl++]=t,Wn[Yl++]=i,Wn[Yl++]=l,tf|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function nf(e,t,i,l){return Mo(e,t,i,l),Do(e)}function ol(e,t){return Mo(e,null,null,t),Do(e)}function vp(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var c=!1,f=e.return;f!==null;)f.childLanes|=i,l=f.alternate,l!==null&&(l.childLanes|=i),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-on(i),e=f.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=i|536870912),f):null}function Do(e){if(50<zs)throw zs=0,jc=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Il={};function Hx(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,i,l){return new Hx(e,t,i,l)}function af(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pa(e,t){var i=e.alternate;return i===null?(i=jn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function yp(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ro(e,t,i,l,c,f){var v=0;if(l=e,typeof l=="function")af(l)&&(v=1);else if(typeof l=="string")v=pj(e,i,un.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case xe:return e=jn(31,i,t,c),e.elementType=xe,e.lanes=f,e;case ae:return cl(i.children,c,f,t);case ge:v=8,c|=24;break;case fe:return e=jn(12,i,t,c|2),e.elementType=fe,e.lanes=f,e;case R:return e=jn(13,i,t,c),e.elementType=R,e.lanes=f,e;case B:return e=jn(19,i,t,c),e.elementType=B,e.lanes=f,e;case Te:case O:return e=c|32,e=jn(30,i,t,e),e.elementType=O,e.lanes=f,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case G:v=10;break e;case ie:v=9;break e;case C:v=11;break e;case ce:v=14;break e;case ne:v=16,l=null;break e}v=29,i=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=jn(v,i,t,c),t.elementType=e,t.type=l,t.lanes=f,t}function cl(e,t,i,l){return e=jn(7,e,l,t),e.lanes=i,e}function lf(e,t,i){return e=jn(6,e,null,t),e.lanes=i,e}function bp(e){var t=jn(18,null,null,0);return t.stateNode=e,t}function rf(e,t,i){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Sp=new WeakMap;function ea(e,t){if(typeof e=="object"&&e!==null){var i=Sp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ht(t)},Sp.set(e,t),t)}return{value:e,source:t,stack:ht(t)}}var Gl=[],Fl=0,Uo=null,is=0,ta=[],na=0,Si=null,Ta=1,Aa="";function Wa(e,t){Gl[Fl++]=is,Gl[Fl++]=Uo,Uo=e,is=t}function xp(e,t,i){ta[na++]=Ta,ta[na++]=Aa,ta[na++]=Si,Si=e;var l=Ta;e=Aa;var c=32-on(l)-1;l&=~(1<<c),i+=1;var f=32-on(t)+c;if(30<f){var v=c-c%5;f=(l&(1<<v)-1).toString(32),l>>=v,c-=v,Ta=1<<32-on(t)+c|i<<c|l,Aa=f+e}else Ta=1<<f|i<<c|l,Aa=e}function Lo(e){e.return!==null&&(Wa(e,1),xp(e,1,0))}function sf(e){for(;e===Uo;)Uo=Gl[--Fl],Gl[Fl]=null,is=Gl[--Fl],Gl[Fl]=null;for(;e===Si;)Si=ta[--na],ta[na]=null,Aa=ta[--na],ta[na]=null,Ta=ta[--na],ta[na]=null}function _p(e,t){ta[na++]=Ta,ta[na++]=Aa,ta[na++]=Si,Ta=t.id,Aa=t.overflow,Si=e}var It=null,pt=null,He=!1,xi=null,aa=!1,of=Error(s(519));function _i(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ls(ea(t,e)),of}function jp(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[qt]=e,t[Dt]=l,i){case"dialog":Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":case"embed":Ge("load",t);break;case"video":case"audio":for(i=0;i<Es.length;i++)Ge(Es[i],t);break;case"source":Ge("error",t);break;case"img":case"image":case"link":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"input":Ge("invalid",t),Fa(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),P(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||Yv(t.textContent,i)?(l.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),l.onScroll!=null&&Ge("scroll",t),l.onScrollEnd!=null&&Ge("scrollend",t),l.onClick!=null&&(t.onclick=Ca),t=!0):t=!1,t||_i(e,!0)}function $o(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:It=It.return}}function Kl(e){if(e!==It)return!1;if(!He)return $o(e),He=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||$d(e.type,e.memoizedProps)),i=!i),i&&pt&&_i(e),$o(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));pt=cy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));pt=cy(e)}else t===27?(t=pt,$i(e.type)?(e=Fd,Fd=null,pt=e):pt=t):pt=It?la(e.stateNode.nextSibling):null;return!0}function ul(){pt=It=null,He=!1}function cf(){var e=xi;return e!==null&&(Nn===null?Nn=e:Nn.push.apply(Nn,e),xi=null),e}function ls(e){xi===null?xi=[e]:xi.push(e)}var uf=Xt(null),fl=null,ei=null;function ji(e,t,i){et(uf,t._currentValue),t._currentValue=i}function ti(e){e._currentValue=uf.current,_t(uf)}function Bo(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function ff(e,t,i,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var v=c.child;f=f.firstContext;e:for(;f!==null;){var _=f;f=c;for(var A=0;A<t.length;A++)if(_.context===t[A]){f.lanes|=i,_=f.alternate,_!==null&&(_.lanes|=i),Bo(f.return,i,e),l||(v=null);break e}f=_.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(s(341));v.lanes|=i,f=v.alternate,f!==null&&(f.lanes|=i),Bo(v,i,e),v=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=i,v=c.alternate,v!==null&&(v.lanes|=i),Bo(c.return,i,e),v=c.child,v=v!==null?v.sibling:null):v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===e){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function dl(e,t,i,l){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var _=c.type;Ln(c.pendingProps.value,v.value)||(e!==null?e.push(_):e=[_])}}else if(c===kn.current){if(v=c.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(br):e=[br])}c=c.return}return e!==null&&ff(t,e,i,l),t.flags|=262144,e!==null}function Zo(e){for(e=e.firstContext;e!==null;){if(!Ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hl(e){fl=e,ei=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return wp(fl,e)}function Ho(e,t){return fl===null&&hl(e),wp(e,t)}function wp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ei===null){if(e===null)throw Error(s(308));ei=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ei=ei.next=t;return i}var qx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Vx=n.unstable_scheduleCallback,Yx=n.unstable_NormalPriority,Rt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function df(){return{controller:new qx,data:new Map,refCount:0}}function rs(e){e.refCount--,e.refCount===0&&Vx(Yx,function(){e.controller.abort()})}function zp(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];i.indexOf(l)===-1&&i.push(l)}}}var ss=null;function Ix(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var os=null,hf=0,ml=0,Xl=null;function Gx(e,t){if(os===null){var i=os=[];hf=0,ml=Td(),Xl={status:"pending",value:void 0,then:function(l){i.push(l)}}}return hf++,t.then(Np,Np),t}function Np(){if(--hf===0&&(ss=null,os!==null)){Xl!==null&&(Xl.status="fulfilled");var e=os;os=null,ml=0,Xl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fx(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<i.length;c++)(0,i[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),l}var Ep=de.S;de.S=function(e,t){if(bv=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Gx(e,t),ss!==null)for(var i=hr;i!==null;)zp(i,ss),i=i.next;if(i=e.types,i!==null){for(var l=hr;l!==null;)zp(l,i),l=l.next;if(ml!==0){l=ss,l===null&&(l=ss=[]);for(var c=0;c<i.length;c++){var f=i[c];l.indexOf(f)===-1&&l.push(f)}}}Ep!==null&&Ep(e,t)};var pl=Xt(null);function mf(){var e=pl.current;return e!==null?e:mt.pooledCache}function qo(e,t){t===null?et(pl,pl.current):et(pl,t.pool)}function Cp(){var e=mf();return e===null?null:{parent:Rt._currentValue,pool:e}}var Ql=Error(s(460)),pf=Error(s(474)),Vo=Error(s(542)),Yo={then:function(){}};function Tp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ap(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Ca,Ca),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kp(e),e===void 0&&!("reason"in t)?Error(s(600)):e;default:if(typeof t.status=="string")t.then(Ca,Ca);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kp(e),e}throw vl=t,Ql}}function gl(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(vl=i,Ql):i}}var vl=null;function Op(){if(vl===null)throw Error(s(459));var e=vl;return vl=null,e}function kp(e){if(e===Ql||e===Vo)throw Error(s(483))}var Jl=null,cs=0;function Io(e){var t=cs;return cs+=1,Jl===null&&(Jl=[]),Ap(Jl,e,t)}function wi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Go(e,t){throw t.$$typeof===H?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Mp(e){function t(U,k){if(e){var Z=U.deletions;Z===null?(U.deletions=[k],U.flags|=16):Z.push(k)}}function i(U,k){if(!e)return null;for(;k!==null;)t(U,k),k=k.sibling;return null}function l(U){for(var k=new Map;U!==null;)U.key===null?k.set(U.index,U):k.set(U.key,U),U=U.sibling;return k}function c(U,k){return U=Pa(U,k),U.index=0,U.sibling=null,U}function f(U,k,Z){return U.index=Z,e?(Z=U.alternate,Z!==null?(Z=Z.index,Z<k?(U.flags|=2,k):Z):(U.flags|=134217730,k)):(U.flags|=1048576,k)}function v(U){return e&&U.alternate===null&&(U.flags|=134217730),U}function _(U,k,Z,W){return k===null||k.tag!==6?(k=lf(Z,U.mode,W),k.return=U,k):(k=c(k,Z),k.return=U,k)}function A(U,k,Z,W){var _e=Z.type;return _e===ae?(U=Y(U,k,Z.props.children,W,Z.key),wi(U,Z),U):k!==null&&(k.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ne&&gl(_e)===k.type)?(k=c(k,Z.props),wi(k,Z),k.return=U,k):(k=Ro(Z.type,Z.key,Z.props,null,U.mode,W),wi(k,Z),k.return=U,k)}function $(U,k,Z,W){return k===null||k.tag!==4||k.stateNode.containerInfo!==Z.containerInfo||k.stateNode.implementation!==Z.implementation?(k=rf(Z,U.mode,W),k.return=U,k):(k=c(k,Z.children||[]),k.return=U,k)}function Y(U,k,Z,W,_e){return k===null||k.tag!==7?(k=cl(Z,U.mode,W,_e),k.return=U,k):(k=c(k,Z),k.return=U,k)}function ee(U,k,Z){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=lf(""+k,U.mode,Z),k.return=U,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case J:return Z=Ro(k.type,k.key,k.props,null,U.mode,Z),wi(Z,k),Z.return=U,Z;case me:return k=rf(k,U.mode,Z),k.return=U,k;case ne:return k=gl(k),ee(U,k,Z)}if(he(k)||ue(k))return k=cl(k,U.mode,Z,null),k.return=U,k;if(typeof k.then=="function")return ee(U,Io(k),Z);if(k.$$typeof===G)return ee(U,Ho(U,k),Z);Go(U,k)}return null}function D(U,k,Z,W){var _e=k!==null?k.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return _e!==null?null:_(U,k,""+Z,W);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case J:return Z.key===_e?A(U,k,Z,W):null;case me:return Z.key===_e?$(U,k,Z,W):null;case ne:return Z=gl(Z),D(U,k,Z,W)}if(he(Z)||ue(Z))return _e!==null?null:Y(U,k,Z,W,null);if(typeof Z.then=="function")return D(U,k,Io(Z),W);if(Z.$$typeof===G)return D(U,k,Ho(U,Z),W);Go(U,Z)}return null}function V(U,k,Z,W,_e){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return U=U.get(Z)||null,_(k,U,""+W,_e);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case J:return U=U.get(W.key===null?Z:W.key)||null,A(k,U,W,_e);case me:return U=U.get(W.key===null?Z:W.key)||null,$(k,U,W,_e);case ne:return W=gl(W),V(U,k,Z,W,_e)}if(he(W)||ue(W))return U=U.get(Z)||null,Y(k,U,W,_e,null);if(typeof W.then=="function")return V(U,k,Z,Io(W),_e);if(W.$$typeof===G)return V(U,k,Z,Ho(k,W),_e);Go(k,W)}return null}function ve(U,k,Z,W){for(var _e=null,Xe=null,Ee=k,ke=k=0,$t=null;Ee!==null&&ke<Z.length;ke++){Ee.index>ke?($t=Ee,Ee=null):$t=Ee.sibling;var Pe=D(U,Ee,Z[ke],W);if(Pe===null){Ee===null&&(Ee=$t);break}e&&Ee&&Pe.alternate===null&&t(U,Ee),k=f(Pe,k,ke),Xe===null?_e=Pe:Xe.sibling=Pe,Xe=Pe,Ee=$t}if(ke===Z.length)return i(U,Ee),He&&Wa(U,ke),_e;if(Ee===null){for(;ke<Z.length;ke++)Ee=ee(U,Z[ke],W),Ee!==null&&(k=f(Ee,k,ke),Xe===null?_e=Ee:Xe.sibling=Ee,Xe=Ee);return He&&Wa(U,ke),_e}for(Ee=l(Ee);ke<Z.length;ke++)$t=V(Ee,U,ke,Z[ke],W),$t!==null&&(e&&(Pe=$t.alternate,Pe!==null&&Ee.delete(Pe.key===null?ke:Pe.key)),k=f($t,k,ke),Xe===null?_e=$t:Xe.sibling=$t,Xe=$t);return e&&Ee.forEach(function(Vi){return t(U,Vi)}),He&&Wa(U,ke),_e}function we(U,k,Z,W){if(Z==null)throw Error(s(151));for(var _e=null,Xe=null,Ee=k,ke=k=0,$t=null,Pe=Z.next();Ee!==null&&!Pe.done;ke++,Pe=Z.next()){Ee.index>ke?($t=Ee,Ee=null):$t=Ee.sibling;var Vi=D(U,Ee,Pe.value,W);if(Vi===null){Ee===null&&(Ee=$t);break}e&&Ee&&Vi.alternate===null&&t(U,Ee),k=f(Vi,k,ke),Xe===null?_e=Vi:Xe.sibling=Vi,Xe=Vi,Ee=$t}if(Pe.done)return i(U,Ee),He&&Wa(U,ke),_e;if(Ee===null){for(;!Pe.done;ke++,Pe=Z.next())Pe=ee(U,Pe.value,W),Pe!==null&&(k=f(Pe,k,ke),Xe===null?_e=Pe:Xe.sibling=Pe,Xe=Pe);return He&&Wa(U,ke),_e}for(Ee=l(Ee);!Pe.done;ke++,Pe=Z.next())Pe=V(Ee,U,ke,Pe.value,W),Pe!==null&&(e&&($t=Pe.alternate,$t!==null&&Ee.delete($t.key===null?ke:$t.key)),k=f(Pe,k,ke),Xe===null?_e=Pe:Xe.sibling=Pe,Xe=Pe);return e&&Ee.forEach(function(Ej){return t(U,Ej)}),He&&Wa(U,ke),_e}function Le(U,k,Z,W){if(typeof Z=="object"&&Z!==null&&Z.type===ae&&Z.key===null&&Z.props.ref===void 0&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case J:e:{for(var _e=Z.key;k!==null;){if(k.key===_e){if(_e=Z.type,_e===ae){if(k.tag===7){i(U,k.sibling),W=c(k,Z.props.children),wi(W,Z),W.return=U,U=W;break e}}else if(k.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ne&&gl(_e)===k.type){i(U,k.sibling),W=c(k,Z.props),wi(W,Z),W.return=U,U=W;break e}i(U,k);break}else t(U,k);k=k.sibling}Z.type===ae?(W=cl(Z.props.children,U.mode,W,Z.key),wi(W,Z),W.return=U,U=W):(W=Ro(Z.type,Z.key,Z.props,null,U.mode,W),wi(W,Z),W.return=U,U=W)}return v(U);case me:e:{for(_e=Z.key;k!==null;){if(k.key===_e)if(k.tag===4&&k.stateNode.containerInfo===Z.containerInfo&&k.stateNode.implementation===Z.implementation){i(U,k.sibling),W=c(k,Z.children||[]),W.return=U,U=W;break e}else{i(U,k);break}else t(U,k);k=k.sibling}W=rf(Z,U.mode,W),W.return=U,U=W}return v(U);case ne:return Z=gl(Z),Le(U,k,Z,W)}if(he(Z))return ve(U,k,Z,W);if(ue(Z)){if(_e=ue(Z),typeof _e!="function")throw Error(s(150));return Z=_e.call(Z),we(U,k,Z,W)}if(typeof Z.then=="function")return Le(U,k,Io(Z),W);if(Z.$$typeof===G)return Le(U,k,Ho(U,Z),W);Go(U,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,k!==null&&k.tag===6?(i(U,k.sibling),W=c(k,Z),W.return=U,U=W):(i(U,k),W=lf(Z,U.mode,W),W.return=U,U=W),v(U)):i(U,k)}return function(U,k,Z,W){try{cs=0;var _e=Le(U,k,Z,W);return Jl=null,_e}catch(Ee){if(Ee===Ql||Ee===Vo)throw Ee;var Xe=jn(29,Ee,null,U.mode);return Xe.lanes=W,Xe.return=U,Xe}finally{}}}var yl=Mp(!0),Dp=Mp(!1),zi=!1;function gf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ni(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ei(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(at&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=Do(e),vp(e,null,i),t}return Mo(e,l,t,i),Do(e)}function us(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Rl(e,i)}}function yf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var c=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};f===null?c=f=v:f=f.next=v,i=i.next}while(i!==null);f===null?c=f=t:f=f.next=t}else c=f=t;i={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var bf=!1;function fs(){if(bf){var e=Xl;if(e!==null)throw e}}function ds(e,t,i,l){bf=!1;var c=e.updateQueue;zi=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,_=c.shared.pending;if(_!==null){c.shared.pending=null;var A=_,$=A.next;A.next=null,v===null?f=$:v.next=$,v=A;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,_=Y.lastBaseUpdate,_!==v&&(_===null?Y.firstBaseUpdate=$:_.next=$,Y.lastBaseUpdate=A))}if(f!==null){var ee=c.baseState;v=0,Y=$=A=null,_=f;do{var D=_.lane&-536870913,V=D!==_.lane;if(V?(Ke&D)===D:(l&D)===D){D!==0&&D===ml&&(bf=!0),Y!==null&&(Y=Y.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=e,we=_;D=t;var Le=i;switch(we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ee=ve.call(Le,ee,D);break e}ee=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,D=typeof ve=="function"?ve.call(Le,ee,D):ve,D==null)break e;ee=q({},ee,D);break e;case 2:zi=!0}}D=_.callback,D!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[D]:V.push(D))}else V={lane:D,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Y===null?($=Y=V,A=ee):Y=Y.next=V,v|=D;if(_=_.next,_===null){if(_=c.shared.pending,_===null)break;V=_,_=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);Y===null&&(A=ee),c.baseState=A,c.firstBaseUpdate=$,c.lastBaseUpdate=Y,f===null&&(c.shared.lanes=0),Di|=v,e.lanes=v,e.memoizedState=ee}}function Rp(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Up(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Rp(i[e],t)}var Ci=Xt(null),Fo=Xt(0);function Lp(e,t){e=ri,et(Fo,e),et(Ci,t),ri=e|t.baseLanes}function Sf(){et(Fo,ri),et(Ci,Ci.current)}function xf(){ri=Fo.current,_t(Ci),_t(Fo)}var Jt=Xt(null),cn=null;function Ti(e){var t=e.alternate;et(Pt,Pt.current&1),et(Jt,e),cn===null&&(t===null||Ci.current!==null||t.memoizedState!==null)&&(cn=e)}function _f(e){et(Pt,Pt.current),et(Jt,e),cn===null&&(cn=e)}function $p(e){e.tag===22?(et(Pt,Pt.current),et(Jt,e),cn===null&&(cn=e)):Ai()}function Ai(){et(Pt,Pt.current),et(Jt,Jt.current)}function $n(e){_t(Jt),cn===e&&(cn=null),_t(Pt)}var Pt=Xt(0);function hs(e,t){et(Jt,Jt.current),et(Pt,t)}function jf(e){_t(Pt),_t(Jt),cn===e&&(cn=null)}function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Id(i)||Gd(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ni=0,Ue=null,dt=null,Ut=null,Xo=!1,Pl=!1,bl=!1,Qo=0,ms=0,Wl=null,Kx=0;function Nt(){throw Error(s(321))}function wf(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Ln(e[i],t[i]))return!1;return!0}function zf(e,t,i,l,c,f){return ni=f,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?xg:_g,bl=!1,f=i(l,c),bl=!1,Pl&&(f=Zp(t,i,l,c)),Bp(e),f}function Bp(e){de.H=ac;var t=dt!==null&&dt.next!==null;if(ni=0,Ut=dt=Ue=null,Xo=!1,ms=0,Wl=null,t)throw Error(s(300));e===null||Lt||(e=e.dependencies,e!==null&&Zo(e)&&(Lt=!0))}function Zp(e,t,i,l){Ue=e;var c=0;do{if(Pl&&(Wl=null),ms=0,Pl=!1,25<=c)throw Error(s(301));if(c+=1,Ut=dt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}de.H=n_,f=t(i,l)}while(Pl);return f}function Xx(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?ps(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Ue.flags|=1024),t}function Nf(){var e=Qo!==0;return Qo=0,e}function Ef(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Cf(e){if(Xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xo=!1}ni=0,Ut=dt=Ue=null,Pl=!1,ms=Qo=0,Wl=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ue.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Ot(){if(dt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Ut===null?Ue.memoizedState:Ut.next;if(t!==null)Ut=t,dt=e;else{if(e===null)throw Ue.alternate===null?Error(s(467)):Error(s(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Ut===null?Ue.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ps(e){var t=ms;return ms+=1,Wl===null&&(Wl=[]),e=Ap(Wl,e,t),t=Ue,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?xg:_g),e}function Po(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ps(e);if(e.$$typeof===X)return;if(e.$$typeof===G)return Qt(e)}throw Error(s(438,String(e)))}function Tf(e){var t=null,i=Ue.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=Ue.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Jo(),Ue.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=Me;return t.index++,i}function ai(e,t){return typeof t=="function"?t(e):t}function Wo(e){var t=Ot();return Af(t,dt,e)}function Af(e,t,i){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var c=e.baseQueue,f=l.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}t.baseQueue=c=f,l.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var _=v=null,A=null,$=t,Y=!1;do{var ee=$.lane&-536870913;if(ee!==$.lane?(Ke&ee)===ee:(ni&ee)===ee){var D=$.revertLane;if(D===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),ee===ml&&(Y=!0);else if((ni&D)===D){$=$.next,D===ml&&(Y=!0);continue}else ee={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},A===null?(_=A=ee,v=f):A=A.next=ee,Ue.lanes|=D,Di|=D;ee=$.action,bl&&i(f,ee),f=$.hasEagerState?$.eagerState:i(f,ee)}else D={lane:ee,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},A===null?(_=A=D,v=f):A=A.next=D,Ue.lanes|=ee,Di|=ee;$=$.next}while($!==null&&$!==t);if(A===null?v=f:A.next=_,!Ln(f,e.memoizedState)&&(Lt=!0,Y&&(i=Xl,i!==null)))throw i;e.memoizedState=f,e.baseState=v,e.baseQueue=A,l.lastRenderedState=f}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Of(e){var t=Ot(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,c=i.pending,f=t.memoizedState;if(c!==null){i.pending=null;var v=c=c.next;do f=e(f,v.action),v=v.next;while(v!==c);Ln(f,t.memoizedState)||(Lt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),i.lastRenderedState=f}return[f,l]}function Hp(e,t,i){var l=Ue,c=Ot(),f=He;if(f){if(i===void 0)throw Error(s(407));i=i()}else i=t();var v=!Ln((dt||c).memoizedState,i);if(v&&(c.memoizedState=i,Lt=!0),c=c.queue,Df(Yp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||v||Ut!==null&&(Ut.memoizedState.tag&1)!==0,er(e?9:8,{destroy:void 0},Vp.bind(null,l,c,i,t),null),e){if(l.flags|=2048,mt===null)throw Error(s(349));f||(ni&127)!==0||qp(l,t,i)}return i}function qp(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ue.updateQueue,t===null?(t=Jo(),Ue.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Vp(e,t,i,l){t.value=i,t.getSnapshot=l,Ip(t)&&Gp(e)}function Yp(e,t,i){return i(function(){Ip(t)&&Gp(e)})}function Ip(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Ln(e,i)}catch{return!0}}function Gp(e){var t=ol(e,2);t!==null&&En(t,e,2)}function kf(e){var t=pn();if(typeof e=="function"){var i=e;if(e=i(),bl){Dn(!0);try{i()}finally{Dn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:e},t}function Fp(e,t,i,l){return e.baseState=i,Af(e,dt,typeof l=="function"?l:ai)}function Qx(e,t,i,l,c){if(nc(e))throw Error(s(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){f.listeners.push(v)}};de.T!==null?i(!0):f.isTransition=!1,l(f),i=t.pending,i===null?(f.next=t.pending=f,Kp(t,f)):(f.next=i.next,t.pending=i.next=f)}}function Kp(e,t){var i=t.action,l=t.payload,c=e.state;if(t.isTransition){var f=de.T,v={};v.types=f!==null?f.types:null,de.T=v;try{var _=i(c,l),A=de.S;A!==null&&A(v,_),Xp(e,t,_)}catch($){Mf(e,t,$)}finally{f!==null&&v.types!==null&&(f.types=v.types),de.T=f}}else try{f=i(c,l),Xp(e,t,f)}catch($){Mf(e,t,$)}}function Xp(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Qp(e,t,l)},function(l){return Mf(e,t,l)}):Qp(e,t,i)}function Qp(e,t,i){t.status="fulfilled",t.value=i,Jp(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Kp(e,i)))}function Mf(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Jp(t),t=t.next;while(t!==l)}e.action=null}function Jp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Pp(e,t){return t}function Wp(e,t){if(He){var i=mt.formState;if(i!==null){e:{var l=Ue;if(He){if(pt){t:{for(var c=pt,f=aa;c.nodeType!==8;){if(!f){c=null;break t}if(c=la(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){pt=la(c.nextSibling),l=c.data==="F!";break e}}_i(l)}l=!1}l&&(t=i[0])}}return i=pn(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pp,lastRenderedState:t},i.queue=l,i=yg.bind(null,Ue,l),l.dispatch=i,l=kf(!1),f=Bf.bind(null,Ue,!1,l.queue),l=pn(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,i=Qx.bind(null,Ue,c,f,i),c.dispatch=i,l.memoizedState=e,[t,i,!1]}function eg(e){var t=Ot();return tg(t,dt,e)}function tg(e,t,i){if(t=Af(e,t,Pp)[0],e=Wo(ai)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ps(t)}catch(v){throw v===Ql?Vo:v}else l=t;t=Ot();var c=t.queue,f=c.dispatch;return i!==t.memoizedState&&(Ue.flags|=2048,er(9,{destroy:void 0},Jx.bind(null,c,i),null)),[l,f,e]}function Jx(e,t){e.action=t}function ng(e){var t=Ot(),i=dt;if(i!==null)return tg(t,i,e);Ot(),t=t.memoizedState,i=Ot();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function er(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=Jo(),Ue.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function ag(){return Ot().memoizedState}function ec(e,t,i,l){var c=pn();Ue.flags|=e,c.memoizedState=er(1|t,{destroy:void 0},i,l===void 0?null:l)}function tc(e,t,i,l){var c=Ot();l=l===void 0?null:l;var f=c.memoizedState.inst;dt!==null&&l!==null&&wf(l,dt.memoizedState.deps)?c.memoizedState=er(t,f,i,l):(Ue.flags|=e,c.memoizedState=er(1|t,f,i,l))}function ig(e,t){ec(8390656,8,e,t)}function Df(e,t){tc(2048,8,e,t)}function Px(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=Jo(),Ue.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function lg(e){var t=Ot().memoizedState;return Px({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function rg(e,t){return tc(4,2,e,t)}function sg(e,t){return tc(4,4,e,t)}function og(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cg(e,t,i){i=i!=null?i.concat([e]):null,tc(4,4,og.bind(null,t,e),i)}function Rf(){}function ug(e,t){var i=Ot();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&wf(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function fg(e,t){var i=Ot();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&wf(t,l[1]))return l[0];if(l=e(),bl){Dn(!0);try{e()}finally{Dn(!1)}}return i.memoizedState=[l,t],l}function Uf(e,t,i){return i===void 0||(ni&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=xv(),Ue.lanes|=e,Di|=e,i)}function dg(e,t,i,l){return Ln(i,t)?i:Ci.current!==null?(e=Uf(e,i,l),Ln(e,t)||(Lt=!0),e):(ni&106)===0||(ni&1073741824)!==0&&(Ke&261930)===0?(Lt=!0,e.memoizedState=i):(e=xv(),Ue.lanes|=e,Di|=e,t)}function hg(e,t,i,l,c){var f=ye.p;ye.p=f!==0&&8>f?f:8;var v=de.T,_={};_.types=v!==null?v.types:null,de.T=_,Bf(e,!1,t,i);try{var A=c(),$=de.S;if($!==null&&$(_,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var Y=Fx(A,l);gs(e,t,Y,qn(e))}else gs(e,t,l,qn(e))}catch(ee){gs(e,t,{then:function(){},status:"rejected",reason:ee},qn())}finally{ye.p=f,v!==null&&_.types!==null&&(v.types=_.types),de.T=v}}function Wx(){}function Lf(e,t,i,l){if(e.tag!==5)throw Error(s(476));var c=mg(e).queue;hg(e,c,t,Ve,i===null?Wx:function(){return pg(e),i(l)})}function mg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ve,baseState:Ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:Ve},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pg(e){var t=mg(e);t.next===null&&(t=e.alternate.memoizedState),gs(e,t.next.queue,{},qn())}function $f(){return Qt(br)}function gg(){return Ot().memoizedState}function vg(){return Ot().memoizedState}function e_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=qn();e=Ni(i);var l=Ei(t,e,i);l!==null&&(En(l,t,i),us(l,t,i)),t={cache:df()},e.payload=t;return}t=t.return}}function t_(e,t,i){var l=qn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},nc(e)?bg(t,i):(i=nf(e,t,i,l),i!==null&&(En(i,e,l),Sg(i,t,l)))}function yg(e,t,i){var l=qn();gs(e,t,i,l)}function gs(e,t,i,l){var c={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(nc(e))bg(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,_=f(v,i);if(c.hasEagerState=!0,c.eagerState=_,Ln(_,v))return Mo(e,t,c,0),mt===null&&ko(),!1}catch{}finally{}if(i=nf(e,t,c,l),i!==null)return En(i,e,l),Sg(i,t,l),!0}return!1}function Bf(e,t,i,l){if(l={lane:2,revertLane:Td(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nc(e)){if(t)throw Error(s(479))}else t=nf(e,i,l,2),t!==null&&En(t,e,2)}function nc(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function bg(e,t){Pl=Xo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Sg(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Rl(e,i)}}var ac={readContext:Qt,use:Po,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt,useEffectEvent:Nt},xg={readContext:Qt,use:Po,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:ig,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ec(4194308,4,og.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ec(4194308,4,e,t)},useInsertionEffect:function(e,t){ec(4,2,e,t)},useMemo:function(e,t){var i=pn();t=t===void 0?null:t;var l=e();if(bl){Dn(!0);try{e()}finally{Dn(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=pn();if(i!==void 0){var c=i(t);if(bl){Dn(!0);try{i(t)}finally{Dn(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=t_.bind(null,Ue,e),[l.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:function(e){e=kf(e);var t=e.queue,i=yg.bind(null,Ue,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Rf,useDeferredValue:function(e,t){var i=pn();return Uf(i,e,t)},useTransition:function(){var e=kf(!1);return e=hg.bind(null,Ue,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=Ue,c=pn();if(He){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),mt===null)throw Error(s(349));(Ke&127)!==0||qp(l,t,i)}c.memoizedState=i;var f={value:i,getSnapshot:t};return c.queue=f,ig(Yp.bind(null,l,f,e),[e]),l.flags|=2048,er(9,{destroy:void 0},Vp.bind(null,l,f,i,t),null),i},useId:function(){var e=pn(),t=mt.identifierPrefix;if(He){var i=Aa,l=Ta;i=(l&~(1<<32-on(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Qo++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Kx++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$f,useFormState:Wp,useActionState:Wp,useOptimistic:function(e){var t=pn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Bf.bind(null,Ue,!0,i),i.dispatch=t,[e,t]},useMemoCache:Tf,useCacheRefresh:function(){return pn().memoizedState=e_.bind(null,Ue)},useEffectEvent:function(e){var t=pn(),i={impl:e};return t.memoizedState=i,function(){if((at&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},_g={readContext:Qt,use:Po,useCallback:ug,useContext:Qt,useEffect:Df,useImperativeHandle:cg,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:fg,useReducer:Wo,useRef:ag,useState:function(){return Wo(ai)},useDebugValue:Rf,useDeferredValue:function(e,t){var i=Ot();return dg(i,dt.memoizedState,e,t)},useTransition:function(){var e=Wo(ai)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:ps(e),t]},useSyncExternalStore:Hp,useId:gg,useHostTransitionStatus:$f,useFormState:eg,useActionState:eg,useOptimistic:function(e,t){var i=Ot();return Fp(i,dt,e,t)},useMemoCache:Tf,useCacheRefresh:vg,useEffectEvent:lg},n_={readContext:Qt,use:Po,useCallback:ug,useContext:Qt,useEffect:Df,useImperativeHandle:cg,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:fg,useReducer:Of,useRef:ag,useState:function(){return Of(ai)},useDebugValue:Rf,useDeferredValue:function(e,t){var i=Ot();return dt===null?Uf(i,e,t):dg(i,dt.memoizedState,e,t)},useTransition:function(){var e=Of(ai)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:ps(e),t]},useSyncExternalStore:Hp,useId:gg,useHostTransitionStatus:$f,useFormState:ng,useActionState:ng,useOptimistic:function(e,t){var i=Ot();return dt!==null?Fp(i,dt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Tf,useCacheRefresh:vg,useEffectEvent:lg};function Zf(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:q({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Hf={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=qn(),c=Ni(l);c.payload=t,i!=null&&(c.callback=i),t=Ei(e,c,l),t!==null&&(En(t,e,l),us(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=qn(),c=Ni(l);c.tag=1,c.payload=t,i!=null&&(c.callback=i),t=Ei(e,c,l),t!==null&&(En(t,e,l),us(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=qn(),l=Ni(i);l.tag=2,t!=null&&(l.callback=t),t=Ei(e,l,i),t!==null&&(En(t,e,i),us(t,e,i))}};function jg(e,t,i,l,c,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!ns(i,l)||!ns(c,f):!0}function wg(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Hf.enqueueReplaceState(t,t.state,null)}function Sl(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=q({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function zg(e){Oo(e)}function Ng(e){console.error(e)}function Eg(e){Oo(e)}function ic(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Cg(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function qf(e,t,i){return i=Ni(i),i.tag=3,i.payload={element:null},i.callback=function(){ic(e,t)},i}function Tg(e){return e=Ni(e),e.tag=3,e}function Ag(e,t,i,l){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var f=l.value;e.payload=function(){return c(f)},e.callback=function(){Cg(t,i,l)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Cg(t,i,l),typeof c!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function a_(e,t,i,l,c){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&dl(t,i,c,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return cn===null?zc():i.alternate===null&&Et===0&&(Et=3),i.flags&=-257,i.flags|=65536,i.lanes=c,l===Yo?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),Nd(e,l,c)),!1;case 22:return i.flags|=65536,l===Yo?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),Nd(e,l,c)),!1}throw Error(s(435,i.tag))}return Nd(e,l,c),zc(),!1}if(He)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==of&&(e=Error(s(422),{cause:l}),ls(ea(e,i)))):(l!==of&&(t=Error(s(423),{cause:l}),ls(ea(t,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=ea(l,i),c=qf(e.stateNode,l,c),yf(e,c),Et!==4&&(Et=2)),!1;var f=Error(s(520),{cause:l});if(f=ea(f,i),ws===null?ws=[f]:ws.push(f),Et!==4&&(Et=2),t===null)return!0;l=ea(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=qf(i.stateNode,l,e),yf(i,e),!1;case 1:if(t=i.type,f=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ri===null||!Ri.has(f))))return i.flags|=65536,c&=-c,i.lanes|=c,c=Tg(c),Ag(c,e,i,l),yf(i,c),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Vf=Error(s(461)),Lt=!1;function Yt(e,t,i,l){t.child=e===null?Dp(t,null,i,l):yl(t,e.child,i,l)}function Og(e,t,i,l,c){i=i.render;var f=t.ref;if("ref"in l){var v={};for(var _ in l)_!=="ref"&&(v[_]=l[_])}else v=l;return hl(t),l=zf(e,t,i,v,f,c),_=Nf(),e!==null&&!Lt?(Ef(e,t,c),ii(e,t,c)):(He&&_&&Lo(t),t.flags|=1,Yt(e,t,l,c),t.child)}function kg(e,t,i,l,c){if(e===null){var f=i.type;return typeof f=="function"&&!af(f)&&f.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=f,Mg(e,t,f,l,c)):(e=Ro(i.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Jf(e,c)){var v=f.memoizedProps;if(i=i.compare,i=i!==null?i:ns,i(v,l)&&e.ref===t.ref)return ii(e,t,c)}return t.flags|=1,e=Pa(f,l),e.ref=t.ref,e.return=t,t.child=e}function Mg(e,t,i,l,c){if(e!==null){var f=e.memoizedProps;if(ns(f,l)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=l=f,Jf(e,c))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,ii(e,t,c)}return Yf(e,t,i,l,c)}function Dg(e,t,i,l){var c=l.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|i:i,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~f}else l=0,t.child=null;return Rg(e,t,f,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qo(t,f!==null?f.cachePool:null),f!==null?Lp(t,f):Sf(),$p(t);else return l=t.lanes=536870912,Rg(e,t,f!==null?f.baseLanes|i:i,i,l)}else f!==null?(qo(t,f.cachePool),Lp(t,f),Ai(),t.memoizedState=null):(e!==null&&qo(t,null),Sf(),Ai());return Yt(e,t,c,i),t.child}function vs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rg(e,t,i,l,c){var f=mf();return f=f===null?null:{parent:Rt._currentValue,pool:f},t.memoizedState={baseLanes:i,cachePool:f},e!==null&&qo(t,null),Sf(),$p(t),e!==null&&dl(e,t,l,!0),t.childLanes=c,null}function lc(e,t){return t=rc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ug(e,t,i){return yl(t,e.child,null,i),e=lc(t,t.pendingProps),e.flags|=2,$n(t),t.memoizedState=null,e}function i_(e,t,i){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(l.mode==="hidden")return e=lc(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},vs(null,e);if(_f(t),(e=pt)?(e=oy(e,aa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si!==null?{id:Ta,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},i=bp(e),i.return=t,t.child=i,It=t,pt=null)):e=null,e===null)throw _i(t);return t.lanes=536870912,null}return lc(t,l)}var f=e.memoizedState;if(f!==null){var v=f.dehydrated;if(_f(t),c)if(t.flags&256)t.flags&=-257,t=Ug(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Lt||dl(e,t,i,!1),c=(i&e.childLanes)!==0,Lt||c){if(Ci.current===null){if(l=mt,l!==null&&(v=ft(l,i),v!==0&&v!==f.retryLane))throw f.retryLane=v,ol(e,v),En(l,e,v),Vf;zc()}t=Ug(e,t,i)}else e=f.treeContext,pt=la(v.nextSibling),It=t,He=!0,xi=null,aa=!1,e!==null&&_p(t,e),t=lc(t,l),t.flags|=134221824;return t}return e=Pa(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function tr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Yf(e,t,i,l,c){return hl(t),i=zf(e,t,i,l,void 0,c),l=Nf(),e!==null&&!Lt?(Ef(e,t,c),ii(e,t,c)):(He&&l&&Lo(t),t.flags|=1,Yt(e,t,i,c),t.child)}function Lg(e,t,i,l,c,f){return hl(t),t.updateQueue=null,i=Zp(t,l,i,c),Bp(e),l=Nf(),e!==null&&!Lt?(Ef(e,t,f),ii(e,t,f)):(He&&l&&Lo(t),t.flags|=1,Yt(e,t,i,f),t.child)}function $g(e,t,i,l,c){if(hl(t),t.stateNode===null){var f=Il,v=i.contextType;typeof v=="object"&&v!==null&&(f=Qt(v)),f=new i(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Hf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},gf(t),v=i.contextType,f.context=typeof v=="object"&&v!==null?Qt(v):Il,f.state=t.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Zf(t,i,v,l),f.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&Hf.enqueueReplaceState(f,f.state,null),ds(t,l,f,c),fs(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var _=t.memoizedProps,A=Sl(i,_);f.props=A;var $=f.context,Y=i.contextType;v=Il,typeof Y=="object"&&Y!==null&&(v=Qt(Y));var ee=i.getDerivedStateFromProps;Y=typeof ee=="function"||typeof f.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,Y||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_||$!==v)&&wg(t,f,l,v),zi=!1;var D=t.memoizedState;f.state=D,ds(t,l,f,c),fs(),$=t.memoizedState,_||D!==$||zi?(typeof ee=="function"&&(Zf(t,i,ee,l),$=t.memoizedState),(A=zi||jg(t,i,A,l,D,$,v))?(Y||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=$),f.props=l,f.state=$,f.context=v,l=A):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,vf(e,t),v=t.memoizedProps,Y=Sl(i,v),f.props=Y,ee=t.pendingProps,D=f.context,$=i.contextType,A=Il,typeof $=="object"&&$!==null&&(A=Qt($)),_=i.getDerivedStateFromProps,($=typeof _=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==ee||D!==A)&&wg(t,f,l,A),zi=!1,D=t.memoizedState,f.state=D,ds(t,l,f,c),fs();var V=t.memoizedState;v!==ee||D!==V||zi||e!==null&&e.dependencies!==null&&Zo(e.dependencies)?(typeof _=="function"&&(Zf(t,i,_,l),V=t.memoizedState),(Y=zi||jg(t,i,Y,l,D,V,A)||e!==null&&e.dependencies!==null&&Zo(e.dependencies))?($||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,V,A),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,V,A)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=V),f.props=l,f.state=V,f.context=A,l=Y):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,tr(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=yl(t,e.child,null,c),t.child=yl(t,null,i,c)):Yt(e,t,i,c),t.memoizedState=f.state,e=t.child):e=ii(e,t,c),e}function Bg(e,t,i,l){return ul(),t.flags|=256,Yt(e,t,i,l),t.child}var If={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(e){return{baseLanes:e,cachePool:Cp()}}function Ff(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Hn),e}function Zg(e,t,i){var l=t.pendingProps,c=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(Pt.current&2)!==0),v&&(c=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(c?Ti(t):Ai(),(e=pt)?(e=oy(e,aa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si!==null?{id:Ta,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},i=bp(e),i.return=t,t.child=i,It=t,pt=null)):e=null,e===null)throw _i(t);return Gd(e)?t.lanes=32:t.lanes=536870912,null}return f=l.children,l=l.fallback,c?(Ai(),c=t.mode,f=rc({mode:"hidden",children:f},c),l=cl(l,c,i,null),f.return=t,l.return=t,f.sibling=l,t.child=f,l=t.child,l.memoizedState=Gf(i),l.childLanes=Ff(e,v,i),t.memoizedState=If,vs(null,l)):(Ti(t),Kf(t,f))}var _=e.memoizedState;if(_!==null){var A=_.dehydrated;if(A!==null)return l_(e,t,f,v,l,A,_,i)}return c?(Ai(),c=l.fallback,f=t.mode,_=e.child,A=_.sibling,l=Pa(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&1206910976,A!==null?c=Pa(A,c):(c=cl(c,f,i,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,vs(null,l),l=t.child,c=e.child.memoizedState,c===null?c=Gf(i):(f=c.cachePool,f!==null?(_=Rt._currentValue,f=f.parent!==_?{parent:_,pool:_}:f):f=Cp(),c={baseLanes:c.baseLanes|i,cachePool:f}),l.memoizedState=c,l.childLanes=Ff(e,v,i),t.memoizedState=If,vs(e.child,l)):(Ti(t),i=e.child,e=i.sibling,i=Pa(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=i,t.memoizedState=null,i)}function Kf(e,t){return t=rc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function rc(e,t){return e=jn(22,e,null,t),e.lanes=0,e}function sc(e,t,i){return yl(t,e.child,null,i),e=Kf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function l_(e,t,i,l,c,f,v,_){if(i)return t.flags&256?(Ti(t),t.flags&=-257,sc(e,t,_)):t.memoizedState!==null?(Ai(),t.child=e.child,t.flags|=128,null):(Ai(),f=c.fallback,v=t.mode,c=rc({mode:"visible",children:c.children},v),f=cl(f,v,_,null),f.flags|=2,c.return=t,f.return=t,c.sibling=f,t.child=c,yl(t,e.child,null,_),c=t.child,c.memoizedState=Gf(_),c.childLanes=Ff(e,l,_),t.memoizedState=If,vs(null,c));if(Ti(t),Gd(f)){if(l=f.nextSibling&&f.nextSibling.dataset,l)var A=l.dgst;return l=A,l!==""&&(c=Error(s(419)),c.stack="",c.digest=l,ls({value:c,source:null,stack:null})),sc(e,t,_)}if(Lt||dl(e,t,_,!1),l=(_&e.childLanes)!==0,Lt||l){if(Ci.current!==null)return sc(e,t,_);if(l=mt,l!==null&&(c=ft(l,_),c!==0&&c!==v.retryLane))throw v.retryLane=c,ol(e,c),En(l,e,c),Vf;return Id(f)||zc(),sc(e,t,_)}return Id(f)?(t.flags|=192,t.child=e.child,null):(e=v.treeContext,pt=la(f.nextSibling),It=t,He=!0,xi=null,aa=!1,e!==null&&_p(t,e),t=Kf(t,c.children),t.flags|=134221824,t)}function Hg(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Bo(e.return,t,i)}function qg(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&Ko(i)===null&&(t=e),e=e.sibling}return t}function oc(e,t,i,l,c,f){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:c,treeForkCount:f}:(v.isBackwards=t,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=i,v.tailMode=c,v.treeForkCount=f)}function Xf(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function Qf(e,t,i){var l=t.pendingProps,c=l.revealOrder,f=l.tail;l=l.children;var v=Pt.current;if(t.flags&128)return hs(t,v),null;var _=(v&2)!==0;if(_?(v=v&1|2,t.flags|=128):v&=1,hs(t,v),c==="backwards"&&e!==null?(Xf(e),Yt(e,t,l,i),Xf(e)):Yt(e,t,l,i),l=He?is:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hg(e,i,t);else if(e.tag===19)Hg(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":i=qg(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null,Xf(t)),oc(t,!0,c,null,f,l);break;case"unstable_legacy-backwards":for(i=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Ko(e)===null){t.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}oc(t,!0,i,null,f,l);break;case"together":oc(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:i=qg(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null),oc(t,!1,c,i,f,l)}return t.child}function Vg(e,t,i){var l=t.pendingProps;return ji(t,t.type,l.value),Yt(e,t,l.children,i),t.child}function ii(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(dl(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=Pa(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Pa(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Jf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zo(e)))}function r_(e,t,i){switch(t.tag){case 3:Ha(t,t.stateNode.containerInfo),ji(t,Rt,e.memoizedState.cache),ul();break;case 27:case 5:ca(t);break;case 4:Ha(t,t.stateNode.containerInfo);break;case 10:ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_f(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ti(t),t.flags|=128,null;l=dl(e,t,i,!1);var c=t.child.childLanes;return l||(i&c)!==0?Zg(e,t,i):(Ti(t),e=ii(e,t,i),e!==null?e.sibling:null)}Ti(t);break;case 19:if(t.flags&128)return Qf(e,t,i);if(c=(e.flags&128)!==0,l=(i&t.childLanes)!==0,l||(dl(e,t,i,!1),l=(i&t.childLanes)!==0),c){if(l)return Qf(e,t,i);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),hs(t,Pt.current),l)break;return null;case 22:return t.lanes=0,Dg(e,t,i,t.pendingProps);case 24:ji(t,Rt,e.memoizedState.cache)}return ii(e,t,i)}function Yg(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!Jf(e,i)&&(t.flags&128)===0)return Lt=!1,r_(e,t,i);Lt=(e.flags&131072)!==0}else Lt=!1,He&&(t.flags&1048576)!==0&&xp(t,is,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=gl(t.elementType),t.type=e,typeof e=="function")af(e)?(l=Sl(e,l),t.tag=1,t=$g(null,t,e,l,i)):(t.tag=0,t=Yf(null,t,e,l,i));else{if(e!=null){var c=e.$$typeof;if(c===C){t.tag=11,t=Og(null,t,e,l,i);break e}else if(c===ce){t.tag=14,t=kg(null,t,e,l,i);break e}else if(c===G){t.tag=10,t.type=e,t=Vg(null,t,i);break e}}throw t=re(e)||e,Error(s(306,t,""))}}return t;case 0:return Yf(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,c=Sl(l,t.pendingProps),$g(e,t,l,c,i);case 3:e:{if(Ha(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var f=t.memoizedState;c=f.element,vf(e,t),ds(t,l,null,i);var v=t.memoizedState;if(l=v.cache,ji(t,Rt,l),l!==f.cache&&ff(t,[Rt],i,!0),fs(),l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Bg(e,t,l,i);break e}else if(l!==c){c=ea(Error(s(424)),t),ls(c),t=Bg(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(pt=la(e.firstChild),It=t,He=!0,xi=null,aa=!0,i=Dp(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling}else{if(ul(),l===c){t=ii(e,t,i);break e}Yt(e,t,l,i)}t=t.child}return t;case 26:return tr(e,t),e===null?(i=py(t.type,null,t.pendingProps,null))?t.memoizedState=i:He||(t.stateNode=Kv(t.type,t.pendingProps,ln.current,t)):t.memoizedState=py(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ca(t),e===null&&He&&(l=t.stateNode=fy(t.type,t.pendingProps,ln.current),It=t,aa=!0,c=pt,$i(t.type)?(Fd=c,pt=la(l.firstChild)):pt=c),Yt(e,t,t.pendingProps.children,i),tr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((c=l=pt)&&(l=ej(l,t.type,t.pendingProps,aa),l!==null?(t.stateNode=l,It=t,pt=la(l.firstChild),aa=!1,c=!0):c=!1),c||_i(t)),ca(t),c=t.type,f=t.pendingProps,v=e!==null?e.memoizedProps:null,l=f.children,$d(c,f)?l=null:v!==null&&$d(c,v)&&(t.flags|=32),t.memoizedState!==null&&(c=zf(e,t,Xx,null,null,i),br._currentValue=c),tr(e,t),Yt(e,t,l,i),t.child;case 6:return e===null&&He&&((e=i=pt)&&(i=tj(i,t.pendingProps,aa),i!==null?(t.stateNode=i,It=t,pt=null,e=!0):e=!1),e||_i(t)),null;case 13:return Zg(e,t,i);case 4:return Ha(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=yl(t,null,l,i):Yt(e,t,l,i),t.child;case 11:return Og(e,t,t.type,t.pendingProps,i);case 7:return l=t.pendingProps,tr(e,t),Yt(e,t,l,i),t.child;case 8:return Yt(e,t,t.pendingProps.children,i),t.child;case 12:return Yt(e,t,t.pendingProps.children,i),t.child;case 10:return Vg(e,t,i);case 9:return c=t.type._context,l=t.pendingProps.children,hl(t),c=Qt(c),l=l(c),t.flags|=1,Yt(e,t,l,i),t.child;case 14:return kg(e,t,t.type,t.pendingProps,i);case 15:return Mg(e,t,t.type,t.pendingProps,i);case 19:return Qf(e,t,i);case 31:return i_(e,t,i);case 22:return Dg(e,t,i,t.pendingProps);case 24:return hl(t),l=Qt(Rt),e===null?(c=mf(),c===null&&(c=mt,f=df(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=i),c=f),t.memoizedState={parent:l,cache:c},gf(t),ji(t,Rt,c)):((e.lanes&i)!==0&&(vf(e,t),ds(t,null,null,i),fs()),c=e.memoizedState,f=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ji(t,Rt,l)):(l=f.cache,ji(t,Rt,l),l!==c.cache&&ff(t,[Rt],i,!0))),Yt(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:He&&Lo(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:tr(e,t),Yt(e,t,l.children,i),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function li(e){e.flags|=4}function Pf(e,t,i,l,c){var f;if((f=(e.mode&32)!==0)&&(f=i===null?by(t,l):by(t,l)&&(l.src!==i.src||l.srcSet!==i.srcSet)),f){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(zv())e.flags|=8192;else throw vl=Yo,pf}else e.flags&=-16777217}function Ig(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sy(t))if(zv())e.flags|=8192;else throw vl=Yo,pf}function cc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zr():536870912,e.lanes|=t,rr|=t)}function ys(e,t){if(!He)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,l|=c.subtreeFlags&1206910976,l|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function s_(e,t,i){var l=t.pendingProps;switch(sf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ti(Rt),Zt(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Kl(t)?li(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cf())),gt(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(li(t),f!==null?(gt(t),Ig(t,f)):(gt(t),Pf(t,c,null,l,i))):f?f!==e.memoizedState?(li(t),gt(t),Ig(t,f)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&li(t),gt(t),Pf(t,c,e,l,i)),null;case 27:if(qa(t),i=ln.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return gt(t),t.subtreeFlags&=-33554433,null}e=un.current,Kl(t)?jp(t):(e=fy(c,l,i),t.stateNode=e,li(t))}return gt(t),t.subtreeFlags&=-33554433,null;case 5:if(qa(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return gt(t),t.subtreeFlags&=-33554433,null}if(f=un.current,Kl(t))jp(t);else{var v=Ts(ln.current);switch(f){case 1:f=v.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=v.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=v.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?v.createElement(c,{is:l.is}):v.createElement(c)}}f[qt]=t,f[Dt]=l;e:for(v=t.child;v!==null;){if(v.tag===5||v.tag===6)f.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}t.stateNode=f;e:switch(en(f,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&li(t)}}return gt(t),t.subtreeFlags&=-33554433,Pf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=ln.current,Kl(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,c=It,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[qt]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Yv(e.nodeValue,i)),e||_i(t,!0)}else e=Ts(e).createTextNode(l),e[qt]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Kl(t),i!==null){if(e===null){if(!l)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[qt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=cf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?($n(t),t):($n(t),null);if((t.flags&128)!==0)throw Error(s(558))}return gt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Kl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(s(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));c[qt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),c=!1}else c=cf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?($n(t),t):($n(t),null)}return $n(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==c&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),cc(t,t.updateQueue),gt(t),null);case 4:return Zt(),e===null&&Md(t.stateNode.containerInfo),t.flags|=67108864,gt(t),null;case 10:return ti(t.type),gt(t),null;case 19:if(jf(t),l=t.memoizedState,l===null)return gt(t),null;if(c=(t.flags&128)!==0,f=l.rendering,f===null)if(c)ys(l,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ko(e),f!==null){for(t.flags|=128,ys(l,!1),e=f.updateQueue,t.updateQueue=e,cc(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)yp(i,e),i=i.sibling;return hs(t,Pt.current&1|2),He&&Wa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ht()>xc&&(t.flags|=128,c=!0,ys(l,!1),t.lanes=4194304)}else{if(!c)if(e=Ko(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,cc(t,e),ys(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!f.alternate&&!He)return gt(t),null}else 2*Ht()-l.renderingStartTime>xc&&i!==536870912&&(t.flags|=128,c=!0,ys(l,!1),t.lanes=4194304);l.isBackwards?(f.sibling=t.child,t.child=f):(e=l.last,e!==null?e.sibling=f:t.child=f,l.last=f)}if(l.tail!==null){e=l.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ht(),e.sibling=null,f=Pt.current,f=c?f&1|2:f&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!i||He?hs(t,f):(i=f,et(Jt,t),et(Pt,i),cn===null&&(cn=t)),He&&Wa(t,l.treeForkCount),e}return gt(t),null;case 22:case 23:return $n(t),xf(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&cc(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&_t(pl),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ti(Rt),gt(t),null;case 25:return null;case 30:return t.flags|=33554432,gt(t),null}throw Error(s(156,t.tag))}function o_(e,t){switch(sf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(Rt),Zt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qa(t),null;case 31:if(t.memoizedState!==null){if($n(t),t.alternate===null)throw Error(s(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($n(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jf(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Zt(),null;case 10:return ti(t.type),null;case 22:case 23:return $n(t),xf(),e!==null&&_t(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ti(Rt),null;case 25:return null;default:return null}}function Gg(e,t){switch(sf(t),t.tag){case 3:ti(Rt),Zt();break;case 26:case 27:case 5:qa(t);break;case 4:Zt();break;case 31:t.memoizedState!==null&&$n(t);break;case 13:$n(t);break;case 19:jf(t);break;case 10:ti(t.type);break;case 22:case 23:$n(t),xf(),e!==null&&_t(pl);break;case 24:ti(Rt)}}function bs(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var c=l.next;i=c;do{if((i.tag&e)===e){l=void 0;var f=i.create,v=i.inst;l=f(),v.destroy=l}i=i.next}while(i!==c)}}catch(_){ot(t,t.return,_)}}function Oi(e,t,i){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var f=c.next;l=f;do{if((l.tag&e)===e){var v=l.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,c=t;var A=i,$=_;try{$()}catch(Y){ot(c,A,Y)}}}l=l.next}while(l!==f)}}catch(Y){ot(t,t.return,Y)}}function Fg(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Up(t,i)}catch(l){ot(e,e.return,l)}}}function Kg(e,t,i){i.props=Sl(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){ot(e,t,l)}}function Oa(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var c=e.stateNode,f=Qa(e.memoizedProps,c);(c.ref===null||c.ref.name!==f)&&(c.ref=ty(f)),l=c.ref;break;case 7:if(e.stateNode===null){var v=new Vn(e);g(e.child,!1,P_,v,void 0,void 0),e.stateNode=v}l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(_){ot(e,t,_)}}function Wt(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(c){ot(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){ot(e,t,c)}else i.current=null}function uc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)sy(e.stateNode,t[i])}function Xg(e){for(var t=e.return;t!==null&&(ed(t)&&sy(e.stateNode,t.stateNode),!Wf(t));)t=t.return}function Ss(e){for(var t=e.return;t!==null&&(ed(t)&&W_(e.stateNode,t.stateNode),!Wf(t));)t=t.return}function Wf(e){return e.tag===5||e.tag===3||e.tag===27}function ed(e){return e&&e.tag===7&&e.stateNode!==null}function td(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(c){ot(e,e.return,c)}}function nd(e,t,i){try{var l=e.stateNode;D_(l,e.type,i,t),l[Dt]=t}catch(c){ot(e,e.return,c)}}function Qg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$i(e.type)||e.tag===4}function ad(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$i(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function id(e,t,i,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(c,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(c),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Ca)),uc(e,l),Qe=!0;else if(c!==4&&(c===27&&(uc(e,l),l=null,$i(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(id(e,t,i,l),e=e.sibling;e!==null;)id(e,t,i,l),e=e.sibling}function fc(e,t,i,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?i.insertBefore(c,t):i.appendChild(c),uc(e,l),Qe=!0;else if(c!==4&&(c===27&&(uc(e,l),l=null,$i(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(fc(e,t,i,l),e=e.sibling;e!==null;)fc(e,t,i,l),e=e.sibling}function Jg(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);en(t,l,i),t[qt]=e,t[Dt]=i}catch(f){ot(e,e.return,f)}}var dc=!1,Bn=null;function Pg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(dc=!0)}var ka=null;function Wg(){var e=ka;return ka=null,e}var wn=0;function nr(e,t,i,l,c){return wn=0,ev(e.child,t,i,l,c)}function ev(e,t,i,l,c){for(var f=!1;e!==null;){if(e.tag===5){var v=e.stateNode;if(l!==null){var _=Hd(v);l.push(_),_.view&&(f=!0)}else f||Hd(v).view&&(f=!0);dc=!0,Wv(v,wn===0?t:t+"_"+wn,i),wn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||ev(e.child,t,i,l,c)&&(f=!0));e=e.sibling}return f}function Ma(e,t){for(;e!==null;)e.tag===5?ey(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ma(e.child,t)),e=e.sibling}function hc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(hc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(s(544));var i=t.name;t=Ja(t.default,t.share),t!=="none"&&(nr(e,i,t,null,!1)||Ma(e.child,!1))}e=e.sibling}}function ld(e,t){if(e.tag===30){var i=e.stateNode,l=e.memoizedProps,c=Qa(l,i),f=Ja(l.default,i.paired?l.share:l.enter);f!=="none"?nr(e,c,f,null,!1)?(hc(e),i.paired||t||ur(e,l.onEnter)):Ma(e.child,!1):hc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ld(e,t),e=e.sibling;else hc(e)}function rd(e){if(Bn!==null&&Bn.size!==0){var t=Bn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,l=i.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var f=Ja(i.default,i.share);if(f!=="none"&&(nr(e,l,f,null,!1)?(f=e.stateNode,c.paired=f,f.paired=c,ur(e,i.onShare)):Ma(e.child,!1)),t.delete(l),t.size===0)break}}}rd(e)}e=e.sibling}}}function sd(e){if(e.tag===30){var t=e.memoizedProps,i=Qa(t,e.stateNode),l=Bn!==null?Bn.get(i):void 0,c=Ja(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(nr(e,i,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,Bn.delete(i),ur(e,t.onShare)):ur(e,t.onExit):Ma(e.child,!1)),Bn!==null&&rd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)sd(e),e=e.sibling;else Bn!==null&&rd(e)}function tv(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Qa(t,e.stateNode);t=Ja(t.default,t.update),e.flags&=-5,t!=="none"&&nr(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&tv(e);e=e.sibling}}function od(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ma(e.child,!1))}od(e)}e=e.sibling}}function mc(e){if(e.tag===30)e.stateNode.paired=null,Ma(e.child,!1),od(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)mc(e),e=e.sibling;else od(e)}function nv(e){for(e=e.child;e!==null;)e.tag===30?Ma(e.child,!1):(e.subtreeFlags&33554432)!==0&&nv(e),e=e.sibling}function cd(e,t,i,l,c,f,v){for(var _=!1;t!==null;){if(t.tag===5){var A=t.stateNode;if(f!==null&&wn<f.length){var $=f[wn],Y=Hd(A);($.view||Y.view)&&(_=!0);var ee;if(ee=(e.flags&4)===0)if(Y.clip)ee=!0;else{ee=$.rect;var D=Y.rect;ee=ee.y!==D.y||ee.x!==D.x||ee.height!==D.height||ee.width!==D.width}ee&&(e.flags|=4),Y.abs?Y=!$.abs:($=$.rect,Y=Y.rect,Y=$.height!==Y.height||$.width!==Y.width),Y&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Wv(A,wn===0?i:i+"_"+wn,c),_&&(e.flags&4)!==0||(ka===null&&(ka=[]),ka.push(A,wn===0?l:l+"_"+wn,t.memoizedProps)),wn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&v?e.flags|=t.flags&32:cd(e,t.child,i,l,c,f,v)&&(_=!0));t=t.sibling}return _}function av(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,l=e.stateNode,c=Qa(i,l),f=Ja(i.default,i.update),v;v=e.memoizedState,e.memoizedState=null,l=e;var _=e.child;wn=0,c=cd(l,_,c,c,f,v,!1),(e.flags&4)!==0&&c&&ur(e,i.onUpdate)}else(e.subtreeFlags&33554432)!==0&&av(e);e=e.sibling}}var Gt=!1,lt=!1,Da=!1,ud=!1,iv=typeof WeakSet=="function"?WeakSet:Set,Ft=null,Ra=!1,xs=!1,pc=!1,fd=!1;function c_(e,t,i){if(e=e.containerInfo,Ud=Sr,e=op(e),Qu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var f=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,A=-1,$=-1,Y=0,ee=0,D=e,V=null;t:for(;;){for(var ve;D!==l||f!==0&&D.nodeType!==3||(A=_+f),D!==v||c!==0&&D.nodeType!==3||($=_+c),D.nodeType===3&&(_+=D.nodeValue.length),(ve=D.firstChild)!==null;)V=D,D=ve;for(;;){if(D===e)break t;if(V===l&&++Y===f&&(A=_),V===v&&++ee===c&&($=_),(ve=D.nextSibling)!==null)break;D=V,V=D.parentNode}D=ve}l=A===-1||$===-1?null:{start:A,end:$}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ld={focusedElem:e,selectionRange:l},Sr=!1,i=(i&335544064)===i,Ft=t,t=i?9270:1024;Ft!==null;){if(e=Ft,i&&(l=e.deletions,l!==null))for(f=0;f<l.length;f++)i&&sd(l[f]);if(e.alternate===null&&(e.flags&2)!==0)i&&Pg(e),gc(i);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&i&&sd(l),gc(i);continue}else if(l!==null&&l.memoizedState!==null){i&&Pg(e),gc(i);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Ft=l):(i&&tv(e),gc(i))}}Bn=null}function gc(e){for(;Ft!==null;){var t=Ft,i=e,l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&l!==null){i=void 0,c=l.memoizedProps,l=l.memoizedState;var f=t.stateNode;try{var v=Sl(t.type,c);i=f.getSnapshotBeforeUpdate(v,l),f.__reactInternalSnapshotBeforeUpdate=i}catch(_){ot(t,t.return,_)}}break;case 3:if((c&1024)!==0){if(l=t.stateNode.containerInfo,i=l.nodeType,i===9)Yd(l);else if(i===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Yd(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&l!==null&&(i=Qa(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=Ja(c.default,c.update),c!=="none"&&nr(l,i,c,l.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(s(163))}if(l=t.sibling,l!==null){l.return=t.return,Ft=l;break}Ft=t.return}}function lv(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:Ua(e,i),l&4&&bs(5,i);break;case 1:if(Ua(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(v){ot(i,i.return,v)}else{var c=Sl(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(v){ot(i,i.return,v)}}l&64&&Fg(i),l&512&&Oa(i,i.return);break;case 3:if(Ua(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Up(e,t)}catch(v){ot(i,i.return,v)}}break;case 27:t===null&&l&4&&Jg(i);case 26:case 5:Ua(e,i),t===null&&l&4&&td(i),l&512&&Oa(i,i.return);break;case 12:Ua(e,i);break;case 31:Ua(e,i),l&4&&cv(e,i);break;case 13:Ua(e,i),l&4&&uv(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=x_.bind(null,i),nj(e,i))));break;case 22:if(l=i.memoizedState!==null||Gt,!l){var f=t!==null&&t.memoizedState!==null||lt;t=Gt,c=lt,Gt=l,(lt=f)&&!c?(l=2,(i.subtreeFlags&8772)!==0&&(l|=1),pa(e,i,l)):Ua(e,i),Gt=t,lt=c}break;case 30:Ua(e,i),l&512&&Oa(i,i.return);break;case 7:l&512&&Oa(i,i.return);default:Ua(e,i)}}function dd(e,t){for(e=e.child;e!==null;)rv(e,t),e=e.sibling}function rv(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var l=i.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var c=e.stateNode,f=e.memoizedProps.style,v=f!=null&&f.hasOwnProperty("display")?f.display:null;c.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(A){ot(e,e.return,A)}hd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Qe=!0}catch(A){ot(e,e.return,A)}break;case 18:try{var _=e.stateNode;t?Pv(_,!0):Pv(e.stateNode,!1)}catch(A){ot(e,e.return,A)}break;case 22:case 23:e.memoizedState===null&&dd(e,t);break;default:dd(e,t)}}function hd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,l=t;switch(i.tag){case 4:rv(i,l);break e;case 22:i.memoizedState===null&&hd(i,l);break e;default:hd(i,l)}}e=e.sibling}}function sv(e){var t=e.alternate;t!==null&&(e.alternate=null,sv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ll(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,zn=!1;function ha(e,t,i){for(i=i.child;i!==null;)ov(e,t,i),i=i.sibling}function ov(e,t,i){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Mn,i)}catch{}switch(i.tag){case 26:lt||Wt(i,t),ha(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!lt&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:lt||Wt(i,t),Ss(i);var l=St,c=zn;$i(i.type)&&(St=i.stateNode,zn=!1),ha(e,t,i),dy(i.stateNode,i.type,i.memoizedProps),St=l,zn=c;break;case 5:lt||Wt(i,t),Ss(i);case 6:if(i.tag===6&&Ss(i),l=St,c=zn,St=null,ha(e,t,i),St=l,zn=c,St!==null)if(zn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(i.stateNode),Qe=!0}catch(f){ot(i,t,f)}else try{St.removeChild(i.stateNode),Qe=!0}catch(f){ot(i,t,f)}break;case 18:St!==null&&(zn?(e=St,Jv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),xr(e)):Jv(St,i.stateNode));break;case 4:l=St,c=zn,St=i.stateNode.containerInfo,zn=!0,ha(e,t,i),St=l,zn=c;break;case 0:case 11:case 14:case 15:Oi(2,i,t),lt||Oi(4,i,t),ha(e,t,i);break;case 1:lt||(Wt(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Kg(i,t,l)),ha(e,t,i);break;case 21:ha(e,t,i);break;case 22:lt=(l=lt)||i.memoizedState!==null,ha(e,t,i),lt=l;break;case 30:Wt(i,t),ha(e,t,i);break;case 7:lt||Wt(i,t),ha(e,t,i);break;default:ha(e,t,i)}}function cv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xr(e)}catch(i){ot(t,t.return,i)}}}function uv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xr(e)}catch(i){ot(t,t.return,i)}}function u_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iv),t;default:throw Error(s(435,e.tag))}}function vc(e,t){var i=u_(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var c=__.bind(null,e,l);l.then(c,c)}})}function gn(e,t,i){var l=t.deletions;if(l!==null)for(var c=0;c<l.length;c++){var f=l[c],v=e,_=t,A=_;e:for(;A!==null;){switch(A.tag){case 27:if($i(A.type)){St=A.stateNode,zn=!1;break e}break;case 5:St=A.stateNode,zn=!1;break e;case 3:case 4:St=A.stateNode.containerInfo,zn=!0;break e}A=A.return}if(St===null)throw Error(s(160));ov(v,_,f),St=null,zn=!1,v=f.alternate,v!==null&&(v.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fv(t,e,i),t=t.sibling}var ma=null;function fv(e,t,i){var l=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var f=0;f<l.length;f++){var v=l[f];v.ref.impl=v.nextImpl}gn(t,e,i),vn(e),c&4&&(Oi(3,e,e.return),bs(3,e),Oi(5,e,e.return));break;case 1:gn(t,e,i),vn(e),c&512&&(lt||l===null||Wt(l,l.return)),c&64&&Gt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(f=ma,gn(t,e,i),vn(e),c&512&&(lt||l===null||Wt(l,l.return)),c&4)if(c=l!==null?l.memoizedState:null,i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null)if(Gt)e.stateNode=Kv(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,c=f.ownerDocument||f;t:switch(t){case"title":l=c.getElementsByTagName("title")[0],(!l||l[vi]||l[qt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=c.createElement(t),c.head.insertBefore(l,c.querySelector("head > title"))),en(l,t,i),l[qt]=e,jt(l),t=l;break e;case"link":if(f=yy("link","href",c).get(t+(i.href||""))){for(v=0;v<f.length;v++)if(l=f[v],l.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&l.getAttribute("rel")===(i.rel==null?null:i.rel)&&l.getAttribute("title")===(i.title==null?null:i.title)&&l.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){f.splice(v,1);break t}}l=c.createElement(t),en(l,t,i),c.head.appendChild(l);break;case"meta":if(f=yy("meta","content",c).get(t+(i.content||""))){for(v=0;v<f.length;v++)if(l=f[v],l.getAttribute("content")===(i.content==null?null:""+i.content)&&l.getAttribute("name")===(i.name==null?null:i.name)&&l.getAttribute("property")===(i.property==null?null:i.property)&&l.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&l.getAttribute("charset")===(i.charSet==null?null:i.charSet)){f.splice(v,1);break t}}l=c.createElement(t),en(l,t,i),c.head.appendChild(l);break;default:throw Error(s(468,t))}l[qt]=e,jt(l),t=l}e.stateNode=t}else Gt||Jd(f,e.type,e.stateNode);else e.stateNode=vy(f,i,e.memoizedProps);else c!==i?(c===null?(t=l.stateNode,t===null||lt||t.parentNode.removeChild(t)):c.count--,i===null?Gt||Jd(f,e.type,e.stateNode):vy(f,i,e.memoizedProps)):i===null&&e.stateNode!==null&&nd(e,e.memoizedProps,l.memoizedProps);break;case 27:gn(t,e,i),vn(e),c&512&&(lt||l===null||Wt(l,l.return)),l!==null&&c&4&&nd(e,e.memoizedProps,l.memoizedProps);break;case 5:if(f=Da,Da=!1,gn(t,e,i),Da=f,vn(e),c&512&&(lt||l===null||Wt(l,l.return)),e.flags&32){t=e.stateNode;try{be(t,""),Qe=!0}catch(Y){ot(e,e.return,Y)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,nd(e,t,l!==null?l.memoizedProps:t)),c&1024&&(ud=!0);break;case 6:if(gn(t,e,i),vn(e),c&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,Qe=!0}catch(Y){ot(e,e.return,Y)}}break;case 3:if(Qe=!1,kc=null,f=ma,ma=As(t.containerInfo),gn(t,e,i),ma=f,vn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{xr(t.containerInfo)}catch(Y){ot(e,e.return,Y)}ud&&(ud=!1,dv(e)),Qe=!1;break;case 4:c=Da,Da=Gt,l=Gr(),f=ma,ma=As(e.stateNode.containerInfo),gn(t,e,i),vn(e),ma=f,Qe&&xs&&(pc=!0),Qe=l,Da=c;break;case 12:gn(t,e,i),vn(e);break;case 31:gn(t,e,i),vn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vc(e,t)));break;case 13:gn(t,e,i),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Sc=Ht()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vc(e,t)));break;case 22:f=e.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var _=Gt,A=lt,$=Da;Gt=_||f,Da=$||f,lt=A||v,gn(t,e,i),lt=A,Da=$,Gt=_,vn(e),c&8192&&(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,!f||l===null||v||Gt||lt||(t=v||lt,i=Gt,l=lt,Gt=f||Gt,lt=t,ki(e,2),Gt=i,lt=l),!f&&Da||dd(e,f)),c&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,vc(e,i))));break;case 19:gn(t,e,i),vn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vc(e,t)));break;case 30:c&512&&(lt||l===null||Wt(l,l.return)),c=Gr(),f=xs,v=(i&335544064)===i,_=e.memoizedProps,xs=v&&Ja(_.default,_.update)!=="none",gn(t,e,i),vn(e),v&&l!==null&&Qe&&(e.flags|=4),xs=f,Qe=c;break;case 21:break;case 7:c&512&&(lt||l===null||Wt(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:gn(t,e,i),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Qg(l)){i=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(ed(c)){var f=c.stateNode;l===null?l=[f]:l.push(f)}if(Wf(c))break;c=c.return}var v=l;if(i==null)throw Error(s(160));switch(i.tag){case 27:var _=i.stateNode,A=ad(e);fc(e,A,_,v);break;case 5:var $=i.stateNode;i.flags&32&&(be($,""),i.flags&=-33);var Y=ad(e);fc(e,Y,$,v);break;case 3:case 4:var ee=i.stateNode.containerInfo,D=ad(e);id(e,D,ee,v);break;default:throw Error(s(161))}}catch(V){ot(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dv(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sr=!0,t.reset(),Sr=!1),e=e.sibling}}function ar(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)hv(t,e),t=t.sibling;else av(t)}function hv(e,t){var i=e.alternate;if(i===null)ld(e,!1);else switch(e.tag){case 3:if(fd=Ra=!1,Wg(),ar(t,e),!Ra&&!pc){if(e=ka,e!==null)for(var l=0;l<e.length;l+=3){i=e[l];var c=e[l+1];ey(i,e[l+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),fd=!0}ka=null;break;case 5:ar(t,e);break;case 4:l=Ra,Ra=!1,ar(t,e),Ra&&(pc=!0),Ra=l;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?ld(e,!1):ar(t,e));break;case 30:l=Ra,c=Wg(),Ra=!1,ar(t,e),Ra&&(e.flags|=4);var f=e.memoizedProps,v=e.stateNode;t=Qa(f,v),v=Qa(i.memoizedProps,v);var _=Ja(f.default,f.update);_==="none"?t=!1:(f=i.memoizedState,i.memoizedState=null,i=e.child,wn=0,t=cd(e,i,t,v,_,f,!0),wn!==(f===null?0:f.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ur(e,e.memoizedProps.onUpdate),ka=c):c!==null&&(c.push.apply(c,ka),ka=c),Ra=(e.flags&32)!==0?!0:l;break;default:ar(t,e)}}function Ua(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lv(e,t.alternate,t),t=t.sibling}function ki(e,t){for(e=e.child;e!==null;){var i=e,l=t;switch(i.tag){case 0:case 11:case 14:case 15:Oi(4,i,i.return),ki(i,l);break;case 1:Wt(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&Kg(i,i.return,c),ki(i,l);break;case 27:(l&2)!==0&&dy(i.stateNode,i.type,i.memoizedProps);case 5:Wt(i,i.return),i.tag!==5&&i.tag!==27||Ss(i),ki(i,l);break;case 6:Ss(i);break;case 26:Wt(i,i.return),c=i.stateNode,i.memoizedState!==null||c===null||lt||c.parentNode.removeChild(c),ki(i,l);break;case 22:i.memoizedState===null&&ki(i,l);break;case 30:Wt(i,i.return),ki(i,l);break;case 7:Wt(i,i.return);default:ki(i,l)}e=e.sibling}}function pa(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var l=t.alternate,c=e,f=t,v=f.flags,_=(i&1)!==0;switch(f.tag){case 0:case 11:case 15:pa(c,f,i),bs(4,f);break;case 1:if(pa(c,f,i),l=f,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){ot(l,l.return,Y)}if(l=f,c=l.updateQueue,c!==null){var A=l.stateNode;try{var $=c.shared.hiddenCallbacks;if($!==null)for(c.shared.hiddenCallbacks=null,c=0;c<$.length;c++)Rp($[c],A)}catch(Y){ot(l,l.return,Y)}}_&&v&64&&Fg(f),Oa(f,f.return);break;case 27:(i&2)!==0&&Jg(f);case 5:f.tag!==5&&f.tag!==27||Xg(f),pa(c,f,i),_&&l===null&&v&4&&td(f),Oa(f,f.return);break;case 6:Xg(f);break;case 26:A=f.stateNode,f.memoizedState!==null||A===null||Gt||Jd(As(A.ownerDocument),f.type,A),pa(c,f,i),_&&l===null&&v&4&&td(f),Oa(f,f.return);break;case 12:pa(c,f,i);break;case 31:pa(c,f,i),_&&v&4&&cv(c,f);break;case 13:pa(c,f,i),_&&v&4&&uv(c,f);break;case 22:f.memoizedState===null&&pa(c,f,i),Oa(f,f.return);break;case 30:pa(c,f,i),Oa(f,f.return);break;case 7:Oa(f,f.return);default:pa(c,f,i)}t=t.sibling}}function md(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&rs(i))}function pd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rs(e))}function ia(e,t,i,l){var c=(i&335544064)===i;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)mv(e,t,i,l),t=t.sibling;else c&&nv(t)}function mv(e,t,i,l){var c=(i&335544064)===i;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&mc(t);var f=t.flags;switch(t.tag){case 0:case 11:case 15:ia(e,t,i,l),f&2048&&bs(9,t);break;case 1:ia(e,t,i,l);break;case 3:ia(e,t,i,l),c&&fd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),f&2048&&(f=null,t.alternate!==null&&(f=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==f&&(t.refCount++,f!=null&&rs(f)));break;case 12:if(f&2048){ia(e,t,i,l),f=t.stateNode;try{var v=t.memoizedProps,_=v.id,A=v.onPostCommit;typeof A=="function"&&A(_,t.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch($){ot(t,t.return,$)}}else ia(e,t,i,l);break;case 31:ia(e,t,i,l);break;case 13:ia(e,t,i,l);break;case 23:break;case 22:v=t.stateNode,_=t.alternate,t.memoizedState!==null?(c&&_!==null&&_.memoizedState===null&&mc(_),v._visibility&2?ia(e,t,i,l):_s(e,t)):(c&&_!==null&&_.memoizedState!==null&&mc(t),v._visibility&2?ia(e,t,i,l):(v._visibility|=2,ir(e,t,i,l,(t.subtreeFlags&10256)!==0||!1))),f&2048&&md(_,t);break;case 24:ia(e,t,i,l),f&2048&&pd(t.alternate,t);break;case 30:c&&(f=t.alternate,f!==null&&(Ma(f.child,!0),Ma(t.child,!0))),ia(e,t,i,l);break;default:ia(e,t,i,l)}}function ir(e,t,i,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,v=t,_=i,A=l,$=v.flags;switch(v.tag){case 0:case 11:case 15:ir(f,v,_,A,c),bs(8,v);break;case 23:break;case 22:var Y=v.stateNode;v.memoizedState!==null?Y._visibility&2?ir(f,v,_,A,c):_s(f,v):(Y._visibility|=2,ir(f,v,_,A,c)),c&&$&2048&&md(v.alternate,v);break;case 24:ir(f,v,_,A,c),c&&$&2048&&pd(v.alternate,v);break;default:ir(f,v,_,A,c)}t=t.sibling}}function _s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,c=l.flags;switch(l.tag){case 22:_s(i,l),c&2048&&md(l.alternate,l);break;case 24:_s(i,l),c&2048&&pd(l.alternate,l);break;default:_s(i,l)}t=t.sibling}}var xl=8192;function _l(e,t,i){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)pv(e,t,i),e=e.sibling}function pv(e,t,i){switch(e.tag){case 26:_l(e,t,i),e.flags&xl&&(e.memoizedState!==null?gj(i,ma,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&_y(i,e)));break;case 5:_l(e,t,i),e.flags&xl&&(e=e.stateNode,(t&335544128)===t&&_y(i,e));break;case 3:case 4:var l=ma;ma=As(e.stateNode.containerInfo),_l(e,t,i),ma=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=xl,xl=16777216,_l(e,t,i),xl=l):_l(e,t,i));break;case 30:if((e.flags&xl)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,Bn===null&&(Bn=new Map),Bn.set(l,c)}_l(e,t,i);break;default:_l(e,t,i)}}function gv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ft=l,yv(l,e)}gv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vv(e),e=e.sibling}function vv(e){switch(e.tag){case 0:case 11:case 15:js(e),e.flags&2048&&Oi(9,e,e.return);break;case 3:js(e);break;case 12:js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yc(e)):js(e);break;default:js(e)}}function yc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ft=l,yv(l,e)}gv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oi(8,t,t.return),yc(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,yc(t));break;default:yc(t)}e=e.sibling}}function yv(e,t){for(;Ft!==null;){var i=Ft;switch(i.tag){case 0:case 11:case 15:Oi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:rs(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Ft=l;else e:for(i=e;Ft!==null;){l=Ft;var c=l.sibling,f=l.return;if(sv(l),l===i){Ft=null;break e}if(c!==null){c.return=f,Ft=c;break e}Ft=f}}}var f_={getCacheForType:function(e){var t=Qt(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Qt(Rt).controller.signal}},d_=typeof WeakMap=="function"?WeakMap:Map,at=0,mt=null,Ie=null,Ke=0,st=0,Zn=null,Mi=!1,lr=!1,gd=!1,ri=0,Et=0,Di=0,jl=0,bc=0,Hn=0,rr=0,ws=null,Nn=null,vd=!1,Sc=0,bv=0,xc=1/0,_c=null,Ri=null,wt=0,ga=null,wl=null,La=0,yd=0,bd=null,Sv=null,sr=null,or=null,cr=null,zs=0,jc=null;function qn(){return(at&2)!==0&&Ke!==0?Ke&-Ke:de.T!==null?Td():qr()}function xv(){if(Hn===0)if((Ke&536870912)===0||He){var e=E;E<<=1,(E&3932160)===0&&(E=262144),Hn=e}else Hn=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Hn}function ur(e,t){if(t!=null){var i=e.stateNode,l=i.ref;l===null&&(l=i.ref=ty(Qa(e.memoizedProps,i))),or===null&&(or=[]),or.push(t.bind(null,l))}}function En(e,t,i){(e===mt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(fr(e,0),Ui(e,Ke,Hn,!1)),Ya(e,i),((at&2)===0||e!==mt)&&(e===mt&&((at&2)===0&&(jl|=i),Et===4&&Ui(e,Ke,Hn,!1)),$a(e))}function _v(e,t,i){if((at&6)!==0)throw Error(s(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Rn(e,t),c=l?p_(e,t):xd(e,t,!0),f=l;do{if(c===0){lr&&!l&&Ui(e,t,0,!1);break}else{if(i=e.current.alternate,f&&!h_(i)){c=xd(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){t=v;e:{var _=e;c=ws;var A=_.current.memoizedState.isDehydrated;if(A&&(fr(_,v).flags|=256),v=xd(_,v,!1),v!==2&&v!==6){if(gd&&!A){_.errorRecoveryDisabledLanes|=f,jl|=f,c=4;break e}f=Nn,Nn=c,f!==null&&(Nn===null?Nn=f:Nn.push.apply(Nn,f))}c=v}if(f=!1,c!==2)continue}}if(c===1){fr(e,0),Ui(e,t,0,!0);break}e:{switch(l=e,f=c,f){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ui(l,t,Hn,!Mi);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(c=Sc+300-Ht(),10<c)){if(Ui(l,t,Hn,!Mi),_n(l,0,!0)!==0)break e;La=t,l.timeoutHandle=Zd(jv.bind(null,l,i,Nn,_c,vd,t,Hn,jl,rr,Mi,f,"Throttled",-0,0),c);break e}jv(l,i,Nn,_c,vd,t,Hn,jl,rr,Mi,f,null,-0,0)}}break}while(!0);$a(e)}function jv(e,t,i,l,c,f,v,_,A,$,Y,ee,D,V){e.timeoutHandle=-1;var ve=t.subtreeFlags,we=(f&335544064)===f;if(ee=null,(we||ve&8192||(ve&16785408)===16785408)&&(ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ca},Bn=null,pv(t,f,ee),we&&(ve=ee,we=e.containerInfo,we=(we.nodeType===9?we:we.ownerDocument).__reactViewTransition,we!=null&&(ve.count++,ve.waitingForViewTransition=!0,ve=Ms.bind(ve),we.finished.then(ve,ve))),ve=(f&62914560)===f?Sc-Ht():(f&4194048)===f?bv-Ht():0,ve=vj(ee,ve),ve!==null)){La=f,e.cancelPendingCommit=ve(Ov.bind(null,e,t,f,i,l,c,v,_,A,$,Y,ee,null,D,V)),Ui(e,f,v,!$);return}Ov(e,t,f,i,l,c,v,_,A,$,Y,ee)}function h_(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var c=i[l],f=c.getSnapshot;c=c.value;try{if(!Ln(f(),c))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ui(e,t,i,l){t=$r(e,t),t&=~bc,t&=~jl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var f=31-on(c),v=1<<f;l[f]=-1,c&=~v}i!==0&&vo(e,i,t)}function wc(){return(at&6)===0?(Ns(0),!1):!0}function Sd(){if(Ie!==null){if(st===0)var e=Ie.return;else e=Ie,ei=fl=null,Cf(e),Jl=null,cs=0,e=Ie;for(;e!==null;)Gg(e.alternate,e),e=e.return;Ie=null}}function fr(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,L_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),La=0,Sd(),mt=e,Ie=i=Pa(e.current,null),Ke=t,st=0,Zn=null,Mi=!1,lr=Rn(e,t),gd=!1,rr=Hn=bc=jl=Di=Et=0,Nn=ws=null,vd=!1,ri=$r(e,t),ko(),i}function wv(e,t){Ue=null,de.H=ac,t===Ql||t===Vo?(t=Op(),st=3):t===pf?(t=Op(),st=4):st=t===Vf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Zn=t,Ie===null&&(Et=1,ic(e,ea(t,e.current)))}function zv(){var e=Jt.current;return e===null?!0:(Ke&4194048)===Ke?cn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===cn:!1}function Nv(){var e=de.H;return de.H=ac,e===null?ac:e}function Ev(){var e=de.A;return de.A=f_,e}function zc(){Et=4,Mi||(Ke&4194048)!==Ke&&Jt.current!==null||(lr=!0),(Di&134217727)===0&&(jl&134217727)===0||mt===null||Ui(mt,Ke,Hn,!1)}function xd(e,t,i){var l=at;at|=2;var c=Nv(),f=Ev();(mt!==e||Ke!==t)&&(_c=null,fr(e,t)),t=!1;var v=Et;e:do try{if(st!==0&&Ie!==null){var _=Ie,A=Zn;switch(st){case 8:Sd(),v=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var $=st;if(st=0,Zn=null,dr(e,_,A,$),i&&lr){v=0;break e}break;default:$=st,st=0,Zn=null,dr(e,_,A,$)}}m_(),v=Et;break}catch(Y){wv(e,Y)}while(!0);return t&&e.shellSuspendCounter++,ei=fl=null,at=l,de.H=c,de.A=f,Ie===null&&(mt=null,Ke=0,ko()),v}function m_(){for(;Ie!==null;)Cv(Ie)}function p_(e,t){var i=at;at|=2;var l=Nv(),c=Ev();mt!==e||Ke!==t?(_c=null,xc=Ht()+500,fr(e,t)):lr=Rn(e,t);e:do try{if(st!==0&&Ie!==null){t=Ie;var f=Zn;t:switch(st){case 1:st=0,Zn=null,dr(e,t,f,1);break;case 2:case 9:if(Tp(f)){st=0,Zn=null,Tv(t);break}t=function(){st!==2&&st!==9||mt!==e||(st=7),$a(e)},f.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Tp(f)?(st=0,Zn=null,Tv(t)):(st=0,Zn=null,dr(e,t,f,7));break;case 5:var v=null;switch(Ie.tag){case 26:v=Ie.memoizedState;case 5:case 27:var _=Ie;if(v?Sy(v):_.stateNode.complete){st=0,Zn=null;var A=_.sibling;if(A!==null)Ie=A;else{var $=_.return;$!==null?(Ie=$,Nc($)):Ie=null}break t}}st=0,Zn=null,dr(e,t,f,5);break;case 6:st=0,Zn=null,dr(e,t,f,6);break;case 8:Sd(),Et=6;break e;default:throw Error(s(462))}}g_();break}catch(Y){wv(e,Y)}while(!0);return ei=fl=null,de.H=l,de.A=c,at=i,Ie!==null?0:(mt=null,Ke=0,ko(),Et)}function g_(){for(;Ie!==null&&!Ml();)Cv(Ie)}function Cv(e){var t=Yg(e.alternate,e,ri);e.memoizedProps=e.pendingProps,t===null?Nc(e):Ie=t}function Tv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Lg(i,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Lg(i,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Cf(t);var l=t;l===It&&(He?($o(l),l.tag===5&&l.stateNode!=null&&(pt=l.stateNode)):($o(l),He=!0));default:Gg(i,t),t=Ie=yp(t,ri),t=Yg(i,t,ri)}e.memoizedProps=e.pendingProps,t===null?Nc(e):Ie=t}function dr(e,t,i,l){ei=fl=null,Cf(t),Jl=null,cs=0;var c=t.return;try{if(a_(e,c,t,i,Ke)){Et=1,ic(e,ea(i,e.current)),Ie=null;return}}catch(f){if(c!==null)throw Ie=c,f;Et=1,ic(e,ea(i,e.current)),Ie=null;return}t.flags&32768?(He||l===1?e=!0:lr||(Ke&536870912)!==0?e=!1:(Mi=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Av(t,e)):Nc(t)}function Nc(e){var t=e;do{if((t.flags&32768)!==0){Av(t,Mi);return}e=t.return;var i=s_(t.alternate,t,ri);if(i!==null){Ie=i;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);Et===0&&(Et=5)}function Av(e,t){do{var i=o_(e.alternate,e);if(i!==null){i.flags&=32767,Ie=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=i}while(e!==null);Et=6,Ie=null}function Ov(e,t,i,l,c,f,v,_,A,$,Y,ee){e.cancelPendingCommit=null;do Ec();while(wt!==0);if((at&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===mt&&(Ie=mt=null,Ke=0),wl=t,ga=e,La=i,bd=c,Sv=l,v_(e,t,i,v,_,A,ee)}}function v_(e,t,i,l,c,f,v){var _=t.lanes|t.childLanes;if(yd=_,_|=tf,Du(e,i,_,l,c,f),or=null,(i&335544064)===i?(cr=Ix(e),l=10262):(cr=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,j_(rt,function(){return zd(),null})):(e.callbackNode=null,e.callbackPriority=0),dc=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=de.T,de.T=null,c=ye.p,ye.p=2,f=at,at|=4;try{c_(e,t,i)}finally{at=f,ye.p=c,de.T=l}}wt=1,dc?sr=V_(v,e.containerInfo,cr,_d,jd,b_,wd,zd,y_):(_d(),jd(),wd())}function y_(e){if(wt!==0){var t=ga.onRecoverableError;t(e,{componentStack:null})}}function b_(){wt===3&&(wt=0,hv(wl,ga),wt=4)}function _d(){if(wt===1){wt=0;var e=ga,t=wl,i=La,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=de.T,de.T=null;var c=ye.p;ye.p=2;var f=at;at|=4;try{xs=pc=!1,fv(t,e,i),i=Ld;var v=op(e.containerInfo),_=i.focusedElem,A=i.selectionRange;if(v!==_&&_&&_.ownerDocument&&sp(_.ownerDocument.documentElement,_)){if(A!==null&&Qu(_)){var $=A.start,Y=A.end;if(Y===void 0&&(Y=$),"selectionStart"in _)_.selectionStart=$,_.selectionEnd=Math.min(Y,_.value.length);else{var ee=_.ownerDocument||document,D=ee&&ee.defaultView||window;if(D.getSelection){var V=D.getSelection(),ve=_.textContent.length,we=Math.min(A.start,ve),Le=A.end===void 0?we:Math.min(A.end,ve);!V.extend&&we>Le&&(v=Le,Le=we,we=v);var U=rp(_,we),k=rp(_,Le);if(U&&k&&(V.rangeCount!==1||V.anchorNode!==U.node||V.anchorOffset!==U.offset||V.focusNode!==k.node||V.focusOffset!==k.offset)){var Z=ee.createRange();Z.setStart(U.node,U.offset),V.removeAllRanges(),we>Le?(V.addRange(Z),V.extend(k.node,k.offset)):(Z.setEnd(k.node,k.offset),V.addRange(Z))}}}}for(ee=[],V=_;V=V.parentNode;)V.nodeType===1&&ee.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ee.length;_++){var W=ee[_];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Sr=!!Ud,Ld=Ud=null}finally{at=f,ye.p=c,de.T=l}}e.current=t,wt=2}}function jd(){if(wt===2){wt=0;var e=ga,t=wl,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=de.T,de.T=null;var l=ye.p;ye.p=2;var c=at;at|=4;try{lv(e,t.alternate,t)}finally{at=c,ye.p=l,de.T=i}}wt=3}}function wd(){if(wt===4||wt===3){wt=0;var e=sr;sr=null,ua();var t=ga,i=wl,l=La,c=Sv,f=(l&335544064)===l?10262:10256;if((i.subtreeFlags&f)!==0||(i.flags&f)!==0?wt=5:(wt=0,wl=ga=null,kv(t,t.pendingLanes)),f=t.pendingLanes,f===0&&(Ri=null),Hr(l),i=i.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Mn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=de.T,f=ye.p,ye.p=2,de.T=null;try{for(var v=t.onRecoverableError,_=0;_<c.length;_++){var A=c[_];v(A.value,{componentStack:A.stack})}}finally{de.T=i,ye.p=f}}if(c=or,v=cr,cr=null,c!==null&&(or=null,v===null&&(v=[]),e!==null))for(A=0;A<c.length;A++)i=(0,c[A])(v),i!==void 0&&e.finished.finally(i);(La&3)!==0&&Ec(),$a(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===jc?zs++:(zs=0,jc=t):(zs=0,jc=null),Ns(0)}}function kv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rs(t)))}function Ec(){return sr!==null&&(sr.skipTransition(),sr=null),_d(),jd(),wd(),zd()}function zd(){if(wt!==5)return!1;var e=ga,t=yd;yd=0;var i=Hr(La),l=de.T,c=ye.p;try{ye.p=32>i?32:i,de.T=null,i=bd,bd=null;var f=ga,v=La;if(wt=0,wl=ga=null,La=0,(at&6)!==0)throw Error(s(331));var _=at;if(at|=4,vv(f.current),mv(f,f.current,v,i),at=_,Ns(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Mn,f)}catch{}return!0}finally{ye.p=c,de.T=l,kv(e,t)}}function Mv(e,t,i){t=ea(i,t),t=qf(e.stateNode,t,2),e=Ei(e,t,2),e!==null&&(Ya(e,2),$a(e))}function ot(e,t,i){if(e.tag===3)Mv(e,e,i);else for(;t!==null;){if(t.tag===3){Mv(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ri===null||!Ri.has(l))){e=ea(i,e),i=Tg(2),l=Ei(t,i,2),l!==null&&(Ag(i,l,t,e),Ya(l,2),$a(l));break}}t=t.return}}function Nd(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new d_;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(i)||(gd=!0,c.add(i),e=S_.bind(null,e,t,i),t.then(e,e))}function S_(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,mt===e&&(Ke&i)===i&&((Et===4||Et===3&&(Ke&62914560)===Ke&&300>Ht()-Sc)&&(at&2)===0?fr(e,0):bc|=i,rr===Ke&&(rr=0)),$a(e)}function Dv(e,t){t===0&&(t=Zr()),e=ol(e,t),e!==null&&(Ya(e,t),$a(e))}function x_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Dv(e,i)}function __(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),Dv(e,i)}function j_(e,t){return za(e,t)}var hr=null,mr=null,Ed=!1,Cc=!1,Cd=!1,Li=0;function $a(e){e!==mr&&e.next===null&&(mr===null?hr=mr=e:mr=mr.next=e),Cc=!0,Ed||(Ed=!0,z_())}function Ns(e,t){if(!Cd&&Cc){Cd=!0;do for(var i=!1,l=hr;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var f=0;else{var v=l.suspendedLanes,_=l.pingedLanes;f=(1<<31-on(42|e)+1)-1,f&=c&~(v&~_),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(i=!0,$v(l,f))}else f=Ke,f=_n(l,l===mt?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||Rn(l,f)||(i=!0,$v(l,f));l=l.next}while(i);Cd=!1}}function w_(){Rv()}function Rv(){Cc=Ed=!1;var e=0;Li!==0&&U_()&&(e=Li);for(var t=Ht(),i=null,l=hr;l!==null;){var c=l.next,f=Uv(l,t);f===0?(l.next=null,i===null?hr=c:i.next=c,c===null&&(mr=i)):(i=l,(e!==0||(f&3)!==0)&&(Cc=!0)),l=c}wt!==0&&wt!==5||Ns(e),Li!==0&&(Li=0)}function Uv(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var v=31-on(f),_=1<<v,A=c[v];A===-1?((_&i)===0||(_&l)!==0)&&(c[v]=Br(_,t)):A<=t&&(e.expiredLanes|=_),f&=~_}if(t=mt,i=Ke,i=_n(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&fn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Rn(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&fn(l),Hr(i)){case 2:case 8:i=je;break;case 32:i=rt;break;case 268435456:i=Mt;break;default:i=rt}return l=Lv.bind(null,e),i=za(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&fn(l),e.callbackPriority=2,e.callbackNode=null,2}function Lv(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ec()&&e.callbackNode!==i)return null;var l=Ke;return l=_n(e,e===mt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(_v(e,l,t),Uv(e,Ht()),e.callbackNode!=null&&e.callbackNode===i?Lv.bind(null,e):null)}function $v(e,t){if(Ec())return null;_v(e,t,!0)}function z_(){$_(function(){(at&6)!==0?za(go,w_):Rv()})}function Td(){if(Li===0){var e=ml;e===0&&(e=Va,Va<<=1,(Va&261888)===0&&(Va=256)),Li=e}return Li}function Bv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wo(e)}function N_(e,t,i,l,c){if(t==="submit"&&i&&i.stateNode===c){var f=Bv((c[Dt]||null).action),v=l.submitter;v&&(t=(t=v[Dt]||null)?Bv(t.formAction):v.getAttribute("formAction"),t!==null&&(f=t,v=null));var _=new Co("action","action",null,l,c);e.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Li!==0){var A=new FormData(c,v);Lf(i,{pending:!0,data:A,method:c.method,action:f},null,A)}}else typeof f=="function"&&(_.preventDefault(),A=new FormData(c,v),Lf(i,{pending:!0,data:A,method:c.method,action:f},f,A))},currentTarget:c}]})}}for(var Ad=0;Ad<ef.length;Ad++){var Od=ef[Ad],E_=Od.toLowerCase(),C_=Od[0].toUpperCase()+Od.slice(1);da(E_,"on"+C_)}da(fp,"onAnimationEnd"),da(dp,"onAnimationIteration"),da(hp,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(Lx,"onTransitionRun"),da($x,"onTransitionStart"),da(Bx,"onTransitionCancel"),da(mp,"onTransitionEnd"),Ga("onMouseEnter",["mouseout","mouseover"]),Ga("onMouseLeave",["mouseout","mouseover"]),Ga("onPointerEnter",["pointerout","pointerover"]),Ga("onPointerLeave",["pointerout","pointerover"]),Ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Es="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),T_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Es));function Zv(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],c=l.event;l=l.listeners;e:{var f=void 0;if(t)for(var v=l.length-1;0<=v;v--){var _=l[v],A=_.instance,$=_.currentTarget;if(_=_.listener,A!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=$;try{f(c)}catch(Y){Oo(Y)}c.currentTarget=null,f=A}else for(v=0;v<l.length;v++){if(_=l[v],A=_.instance,$=_.currentTarget,_=_.listener,A!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=$;try{f(c)}catch(Y){Oo(Y)}c.currentTarget=null,f=A}}}}function Ge(e,t){var i=t[yo];i===void 0&&(i=t[yo]=new Set);var l=e+"__bubble";i.has(l)||(Hv(t,e,2,!1),i.add(l))}function kd(e,t,i){var l=0;t&&(l|=4),Hv(i,e,l,t)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function Md(e){if(!e[Tc]){e[Tc]=!0,xo.forEach(function(i){i!=="selectionchange"&&(T_.has(i)||kd(i,!1,e),kd(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tc]||(t[Tc]=!0,kd("selectionchange",!1,t))}}function Hv(e,t,i,l){switch(Ay(t)){case 2:var c=xj;break;case 8:c=_j;break;default:c=Wd}i=c.bind(null,t,i,e),c=void 0,!Zu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,i,{capture:!0,passive:c}):e.addEventListener(t,i,!0):c!==void 0?e.addEventListener(t,i,{passive:c}):e.addEventListener(t,i,!1)}function Dd(e,t,i,l,c){var f=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var _=l.stateNode.containerInfo;if(_===c)break;if(v===4)for(v=l.return;v!==null;){var A=v.tag;if((A===3||A===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;_!==null;){if(v=Pn(_),v===null)return;if(A=v.tag,A===5||A===6||A===26||A===27){l=f=v;continue e}_=_.parentNode}}l=l.return}Hm(function(){var $=f,Y=$u(i),ee=[];e:{var D=pp.get(e);if(D!==void 0){var V=Co,ve=e;switch(e){case"keypress":if(No(i)===0)break e;case"keydown":case"keyup":V=hx;break;case"focusin":ve="focus",V=Yu;break;case"focusout":ve="blur",V=Yu;break;case"beforeblur":case"afterblur":V=Yu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Ym;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=yx;break;case fp:case dp:case hp:V=ix;break;case mp:V=Sx;break;case"scroll":case"scrollend":V=WS;break;case"wheel":V=_x;break;case"copy":case"cut":case"paste":V=rx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Gm;break;case"submit":V=gx;break;case"toggle":case"beforetoggle":V=wx}var we=(t&4)!==0,Le=!we&&(e==="scroll"||e==="scrollend"),U=we?D!==null?D+"Capture":null:D;we=[];for(var k=$,Z;k!==null;){var W=k;if(Z=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||Z===null||U===null||(W=Xr(k,U),W!=null&&we.push(Cs(k,W,Z))),Le)break;k=k.return}0<we.length&&(D=new V(D,ve,null,i,Y),ee.push({event:D,listeners:we}))}}if((t&7)===0){e:{if(V=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",V&&i!==Lu&&(ve=i.relatedTarget||i.fromElement)&&(Pn(ve)||ve[fa]))break e;(D||V)&&(ve=Y.window===Y?Y:(V=Y.ownerDocument)?V.defaultView||V.parentWindow:window,D?(V=i.relatedTarget||i.toElement,D=$,V=V?Pn(V):null,V!==null&&(Le=d(V),we=V.tag,V!==Le||we!==5&&we!==27&&we!==6)&&(V=null)):(D=null,V=$),D!==V&&(we=Ym,W="onMouseLeave",U="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(we=Gm,W="onPointerLeave",U="onPointerEnter",k="pointer"),Le=D==null?ve:Na(D),Z=V==null?ve:Na(V),ve=new we(W,k+"leave",D,i,Y),ve.target=Le,ve.relatedTarget=Z,W=null,Pn(Y)===$&&(we=new we(U,k+"enter",V,i,Y),we.target=Z,we.relatedTarget=Le,W=we),Le=W,we=D&&V?K(D,V,A_):null,D!==null&&qv(ee,ve,D,we,!1),V!==null&&Le!==null&&qv(ee,Le,V,we,!0)))}e:{if(D=$?Na($):window,V=D.nodeName&&D.nodeName.toLowerCase(),V==="select"||V==="input"&&D.type==="file")var _e=ep;else if(Pm(D))if(tp)_e=Dx;else{_e=kx;var Xe=Ox}else V=D.nodeName,!V||V.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?$&&ll($.elementType)&&(_e=ep):_e=Mx;if(_e&&(_e=_e(e,$))){Wm(ee,_e,i,Y);break e}Xe&&Xe(e,D,$)}switch(Xe=$?Na($):window,e){case"focusin":(Pm(Xe)||Xe.contentEditable==="true")&&(ql=Xe,Ju=$,as=null);break;case"focusout":as=Ju=ql=null;break;case"mousedown":Pu=!0;break;case"contextmenu":case"mouseup":case"dragend":Pu=!1,cp(ee,i,Y);break;case"selectionchange":if(Ux)break;case"keydown":case"keyup":cp(ee,i,Y)}var Ee;if(Gu)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Hl?Qm(e,i)&&(ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ke="onCompositionStart");ke&&(Fm&&i.locale!=="ko"&&(Hl||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Hl&&(Ee=qm()):(yi=Y,Hu="value"in yi?yi.value:yi.textContent,Hl=!0)),Xe=Ac($,ke),0<Xe.length&&(ke=new Im(ke,e,null,i,Y),ee.push({event:ke,listeners:Xe}),Ee?ke.data=Ee:(Ee=Jm(i),Ee!==null&&(ke.data=Ee)))),(Ee=Nx?Ex(e,i):Cx(e,i))&&(ke=Ac($,"onBeforeInput"),0<ke.length&&(Xe=new Im("onBeforeInput","beforeinput",null,i,Y),ee.push({event:Xe,listeners:ke}),Xe.data=Ee)),N_(ee,e,$,i,Y)}Zv(ee,t)})}function Cs(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Ac(e,t){for(var i=t+"Capture",l=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Xr(e,i),c!=null&&l.unshift(Cs(e,c,f)),c=Xr(e,t),c!=null&&l.push(Cs(e,c,f))),e.tag===3)return l;e=e.return}return[]}function A_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qv(e,t,i,l,c){for(var f=t._reactName,v=[];i!==null&&i!==l;){var _=i,A=_.alternate,$=_.stateNode;if(_=_.tag,A!==null&&A===l)break;_!==5&&_!==26&&_!==27||$===null||(A=$,c?($=Xr(i,f),$!=null&&v.unshift(Cs(i,$,A))):c||($=Xr(i,f),$!=null&&v.push(Cs(i,$,A)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var O_=/\r\n?/g,k_=/\u0000|\uFFFD/g;function Vv(e){return(typeof e=="string"?e:""+e).replace(O_,`
|
|
49
|
+
`).replace(k_,"")}function Yv(e,t){return t=Vv(t),Vv(e)===t}function ct(e,t,i,l,c,f){switch(i){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||be(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&be(e,""+l);else return;break;case"className":il(e,"class",l);break;case"tabIndex":il(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":il(e,i,l);break;case"style":nt(e,l,f);return;case"data":if(t!=="object"){il(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=wo(l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(i==="formAction"?(t!=="input"&&ct(e,t,"name",c.name,c,null),ct(e,t,"formEncType",c.formEncType,c,null),ct(e,t,"formMethod",c.formMethod,c,null),ct(e,t,"formTarget",c.formTarget,c,null)):(ct(e,t,"encType",c.encType,c,null),ct(e,t,"method",c.method,c,null),ct(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=wo(l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Ca);return;case"onScroll":l!=null&&Ge("scroll",e);return;case"onScrollEnd":l!=null&&Ge("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(c.children!=null)throw Error(s(60));(f!=null?f.__html:void 0)!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=wo(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),al(e,"popover",l);break;case"xlinkActuate":x(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":x(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":x(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":x(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":x(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":x(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":x(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":x(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":x(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":al(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=Uu.get(i)||i,al(e,i,l);else return}Qe=!0}function Rd(e,t,i,l,c,f){switch(i){case"style":nt(e,l,f);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(c.children!=null)throw Error(s(60));(f!=null?f.__html:void 0)!==i&&(e.innerHTML=i)}}break;case"children":if(typeof l=="string")be(e,l);else if(typeof l=="number"||typeof l=="bigint")be(e,""+l);else return;break;case"onScroll":l!=null&&Ge("scroll",e);return;case"onScrollEnd":l!=null&&Ge("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Ca);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Vr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),f=i.slice(2,c?i.length-7:void 0),t=e[Dt]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(f,t,c),typeof l=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(f,l,c);break e}Qe=!0,i in e?e[i]=l:l===!0?e.setAttribute(i,""):al(e,i,l)}return}Qe=!0}function en(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var l=!1,c=!1,f;for(f in i)if(i.hasOwnProperty(f)){var v=i[f];if(v!=null)switch(f){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:ct(e,t,f,v,i,null)}}c&&ct(e,t,"srcSet",i.srcSet,i,null),l&&ct(e,t,"src",i.src,i,null);return;case"input":Ge("invalid",e);var _=f=v=c=null,A=null,$=null;for(l in i)if(i.hasOwnProperty(l)){var Y=i[l];if(Y!=null)switch(l){case"name":c=Y;break;case"type":v=Y;break;case"checked":A=Y;break;case"defaultChecked":$=Y;break;case"value":f=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,t));break;default:ct(e,t,l,Y,i,null)}}Fa(e,f,_,A,$,v,c,!1);return;case"select":Ge("invalid",e),l=v=f=null;for(c in i)if(i.hasOwnProperty(c)&&(_=i[c],_!=null))switch(c){case"value":f=_;break;case"defaultValue":v=_;break;case"multiple":l=_;default:ct(e,t,c,_,i,null)}t=f,i=v,e.multiple=!!l,t!=null?Ka(e,!!l,t,!1):i!=null&&Ka(e,!!l,i,!0);return;case"textarea":Ge("invalid",e),f=c=l=null;for(v in i)if(i.hasOwnProperty(v)&&(_=i[v],_!=null))switch(v){case"value":l=_;break;case"defaultValue":c=_;break;case"children":f=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(91));break;default:ct(e,t,v,_,i,null)}P(e,l,c,f);return;case"option":for(A in i)if(i.hasOwnProperty(A)&&(l=i[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ct(e,t,A,l,i,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(l=0;l<Es.length;l++)Ge(Es[l],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for($ in i)if(i.hasOwnProperty($)&&(l=i[$],l!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:ct(e,t,$,l,i,null)}return;default:if(ll(t)){for(Y in i)i.hasOwnProperty(Y)&&(l=i[Y],l!==void 0&&Rd(e,t,Y,l,i,void 0));return}}for(_ in i)i.hasOwnProperty(_)&&(l=i[_],l!=null&&ct(e,t,_,l,i,null))}var M_={};function D_(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,v=null,_=null,A=null,$=null,Y=null;for(V in i){var ee=i[V];if(i.hasOwnProperty(V)&&ee!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":A=ee;default:l.hasOwnProperty(V)||ct(e,t,V,null,l,ee)}}for(var D in l){var V=l[D];if(ee=i[D],l.hasOwnProperty(D)&&(V!=null||ee!=null))switch(D){case"type":V!==ee&&(Qe=!0),f=V;break;case"name":V!==ee&&(Qe=!0),c=V;break;case"checked":V!==ee&&(Qe=!0),$=V;break;case"defaultChecked":V!==ee&&(Qe=!0),Y=V;break;case"value":V!==ee&&(Qe=!0),v=V;break;case"defaultValue":V!==ee&&(Qe=!0),_=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,t));break;default:V!==ee&&ct(e,t,D,V,l,ee)}}Vt(e,v,_,A,$,Y,f,c);return;case"select":V=v=_=D=null;for(f in i)if(A=i[f],i.hasOwnProperty(f)&&A!=null)switch(f){case"value":break;case"multiple":V=A;default:l.hasOwnProperty(f)||ct(e,t,f,null,l,A)}for(c in l)if(f=l[c],A=i[c],l.hasOwnProperty(c)&&(f!=null||A!=null))switch(c){case"value":f!==A&&(Qe=!0),D=f;break;case"defaultValue":f!==A&&(Qe=!0),_=f;break;case"multiple":f!==A&&(Qe=!0),v=f;default:f!==A&&ct(e,t,c,f,l,A)}t=_,i=v,l=V,D!=null?Ka(e,!!i,D,!1):!!l!=!!i&&(t!=null?Ka(e,!!i,t,!0):Ka(e,!!i,i?[]:"",!1));return;case"textarea":V=D=null;for(_ in i)if(c=i[_],i.hasOwnProperty(_)&&c!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ct(e,t,_,null,l,c)}for(v in l)if(c=l[v],f=i[v],l.hasOwnProperty(v)&&(c!=null||f!=null))switch(v){case"value":c!==f&&(Qe=!0),D=c;break;case"defaultValue":c!==f&&(Qe=!0),V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(s(91));break;default:c!==f&&ct(e,t,v,c,l,f)}Fr(e,D,V);return;case"option":for(var ve in i)if(D=i[ve],i.hasOwnProperty(ve)&&D!=null&&!l.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:ct(e,t,ve,null,l,D)}for(A in l)if(D=l[A],V=i[A],l.hasOwnProperty(A)&&D!==V&&(D!=null||V!=null))switch(A){case"selected":D!==V&&(Qe=!0),e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:ct(e,t,A,D,l,V)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in i)D=i[we],i.hasOwnProperty(we)&&D!=null&&!l.hasOwnProperty(we)&&ct(e,t,we,null,l,D);for($ in l)if(D=l[$],V=i[$],l.hasOwnProperty($)&&D!==V&&(D!=null||V!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(137,t));break;default:ct(e,t,$,D,l,V)}return;default:if(ll(t)){for(var Le in i)D=i[Le],i.hasOwnProperty(Le)&&D!==void 0&&!l.hasOwnProperty(Le)&&Rd(e,t,Le,void 0,l,D);for(Y in l)D=l[Y],V=i[Y],!l.hasOwnProperty(Y)||D===V||D===void 0&&V===void 0||Rd(e,t,Y,D,l,V);return}}for(var U in i)D=i[U],i.hasOwnProperty(U)&&D!=null&&!l.hasOwnProperty(U)&&ct(e,t,U,null,l,D);for(ee in l)D=l[ee],V=i[ee],!l.hasOwnProperty(ee)||D===V||D==null&&V==null||ct(e,t,ee,D,l,V)}function Iv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function R_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var c=i[l],f=c.transferSize,v=c.initiatorType,_=c.duration;if(f&&_&&Iv(v)){for(v=0,_=c.responseEnd,l+=1;l<i.length;l++){var A=i[l],$=A.startTime;if($>_)break;var Y=A.transferSize,ee=A.initiatorType;Y&&Iv(ee)&&(A=A.responseEnd,v+=Y*(A<_?1:(_-$)/(A-$)))}if(--l,t+=8*(f+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ud=null,Ld=null;function Ts(e){return e.nodeType===9?e:e.ownerDocument}function Gv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Kv(e,t,i,l){return i=Ts(i).createElement(e),i[qt]=l,i[Dt]=t,en(i,e,t),jt(i),i}function $d(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bd=null;function U_(){var e=window.event;return e&&e.type==="popstate"?e===Bd?!1:(Bd=e,!0):(Bd=null,!1)}var Zd=typeof setTimeout=="function"?setTimeout:void 0,L_=typeof clearTimeout=="function"?clearTimeout:void 0,Xv=typeof Promise=="function"?Promise:void 0,Qv=typeof requestAnimationFrame=="function"?requestAnimationFrame:Zd,$_=typeof queueMicrotask=="function"?queueMicrotask:typeof Xv<"u"?function(e){return Xv.resolve(null).then(e).catch(B_)}:Zd;function B_(e){setTimeout(function(){throw e})}function $i(e){return e==="head"}function Jv(e,t){var i=t,l=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(c),xr(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Kd(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Kd(i);for(var f=i.firstChild;f;){var v=f.nextSibling,_=f.nodeName;f[vi]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&f.rel.toLowerCase()==="stylesheet"||i.removeChild(f),f=v}}else i==="body"&&Kd(e.ownerDocument.body);i=c}while(i);xr(t)}function Pv(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Wv(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var c=l=0;c<t.length;c++){var f=t[c];0<f.width&&0<f.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function ey(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Z_(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Hd(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return Z_(t,i,e)}function H_(e){return e.documentElement.clientHeight}function q_(e){this.addEventListener("load",e),this.addEventListener("error",e)}function V_(e,t,i,l,c,f,v,_,A){var $=t.nodeType===9?t:t.ownerDocument;try{var Y=$.startViewTransition({update:function(){var D=$.defaultView,V=D.navigation&&D.navigation.transition,ve=$.fonts.status;l();var we=[];if(ve==="loaded"&&(H_($),$.fonts.status==="loading"&&we.push($.fonts.ready)),ve=we.length,e!==null)for(var Le=e.suspenseyImages,U=0,k=0;k<Le.length;k++){var Z=Le[k];if(!Z.complete){var W=Z.getBoundingClientRect();if(0<W.bottom&&0<W.right&&W.top<D.innerHeight&&W.left<D.innerWidth){if(U+=xy(Z),U>Mc){we.length=ve;break}Z=new Promise(q_.bind(Z)),we.push(Z)}}}if(0<we.length)return D=Promise.race([Promise.all(we),new Promise(function(_e){return setTimeout(_e,500)})]).then(c,c),(V?Promise.allSettled([V.finished,D]):D).then(f,f);if(c(),V)return V.finished.then(f,f);f()},types:i});$.__reactViewTransition=Y;var ee=[];return Y.ready.then(function(){for(var D=$.documentElement.getAnimations({subtree:!0}),V=0;V<D.length;V++){var ve=D[V],we=ve.effect,Le=we.pseudoElement;if(Le!=null&&Le.startsWith("::view-transition")){ee.push(ve),ve=we.getKeyframes();for(var U=Le=void 0,k=!0,Z=0;Z<ve.length;Z++){var W=ve[Z],_e=W.width;if(Le===void 0)Le=_e;else if(Le!==_e){k=!1;break}if(_e=W.height,U===void 0)U=_e;else if(U!==_e){k=!1;break}delete W.width,delete W.height,W.transform==="none"&&delete W.transform}k&&Le!==void 0&&U!==void 0&&(we.setKeyframes(ve),k=getComputedStyle(we.target,we.pseudoElement),k.width!==Le||k.height!==U)&&(k=ve[0],k.width=Le,k.height=U,k=ve[ve.length-1],k.width=Le,k.height=U,we.setKeyframes(ve))}}v()},function(D){$.__reactViewTransition===Y&&($.__reactViewTransition=null);try{if(typeof D=="object"&&D!==null)switch(D.name){case"InvalidStateError":(D.message==="View transition was skipped because document visibility state is hidden."||D.message==="Skipping view transition because document visibility state has become hidden."||D.message==="Skipping view transition because viewport size changed."||D.message==="Transition was aborted because of invalid state")&&(D=null)}D!==null&&A(D)}finally{l(),c(),v()}}),Y.finished.finally(function(){for(var D=0;D<ee.length;D++)ee[D].cancel();$.__reactViewTransition===Y&&($.__reactViewTransition=null),_()}),Y}catch{return l(),c(),v(),null}}function zl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}zl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:q({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),l=[],c=0;c<i.length;c++){var f=i[c].effect;f!==null&&f.target===e&&f.pseudoElement===t&&l.push(i[c])}return l},zl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ty(e){return{name:e,group:new zl("group",e),imagePair:new zl("image-pair",e),old:new zl("old",e),new:new zl("new",e)}}function Vn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vn.prototype.addEventListener=function(e,t,i){var l=null,c=null;if(!(i!=null&&typeof i!="boolean"&&(l=i.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var f=this._eventListeners;if(ay(f,e,t,i)===-1){var v=this,_=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(_=function(A){v.removeEventListener(e,t,i),typeof t=="function"?t.call(this,A):t.handleEvent(A)}),l!==null&&(c=v.removeEventListener.bind(v,e,t,i),l.addEventListener("abort",c,{once:!0}),c=l.removeEventListener.bind(l,"abort",c)),l=pr(i),f.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:_,cleanup:c}),g(this._fragmentFiber.child,!1,Y_,e,_,l)}this._eventListeners=f}};function Y_(e,t,i,l){return N(e).addEventListener(t,i,l),!1}Vn.prototype.removeEventListener=function(e,t,i){var l=this._eventListeners;if(l!==null&&(t=ay(l,e,t,i),t!==-1)){var c=l[t];i=c.attachedListener;var f=c.cleanup;c=pr(c.optionsOrUseCapture),g(this._fragmentFiber.child,!1,I_,e,i,c),l.splice(t,1),f!==null&&f()}};function I_(e,t,i,l){return N(e).removeEventListener(t,i,l),!1}function pr(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ny(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function ay(e,t,i,l){if(e.length===0)return-1;l=ny(l);for(var c=0;c<e.length;c++){var f=e[c];if(f.type===t&&f.listener===i&&ny(f.optionsOrUseCapture)===l)return c}return-1}Vn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=N(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var c=0;c<i.length;c++){var f=i[c];l.addEventListener(f.type,f.attachedListener,pr(f.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),i)for(c=0;c<i.length;c++)f=i[c],l.removeEventListener(f.type,f.attachedListener,pr(f.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Vn.prototype.focus=function(e){g(this._fragmentFiber.child,!0,iy,e,void 0,void 0)};function iy(e,t){return e.tag===6?!1:(e=N(e),aj(e,t))}Vn.prototype.focusLast=function(e){var t=[];g(this._fragmentFiber.child,!0,qd,t,void 0,void 0);for(var i=t.length-1;0<=i&&!iy(t[i],e);i--);};function qd(e,t){return t.push(e),!1}Vn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=N(e),e=Ts(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,G_,e,void 0,void 0))};function G_(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),g(this._fragmentFiber.child,!1,F_,e,void 0,void 0)};function F_(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}Vn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),g(this._fragmentFiber.child,!1,K_,e,void 0,void 0);for(var i=t=0;i<va.length;i++){var l=va[i];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):va[t++]=l}va.length=t}};function K_(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var va=[],Vd=!1;function X_(e,t,i){va.push({fragmentInstance:e,observer:t,instance:i}),Vd||(Vd=!0,ij(function(){Vd=!1;var l=va;va=[];for(var c=0;c<l.length;c++){var f=l[c];f.observer.unobserve(f.instance)}}))}Vn.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,Q_,e,void 0,void 0),e};function Q_(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=N(e),t.push.apply(t,e.getClientRects());return!1}Vn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},Vn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];g(this._fragmentFiber.child,!1,qd,i,void 0,void 0);var l=N(t);if(i.length===0){if(i=l,j(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var c=l=i.compareDocumentPosition(e);return i===e?c=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=z(t)[1],i===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=N(i).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(i[0]),c=N(i[i.length-1]);var f=j(this._fragmentFiber)?t.parentElement:l;if(f==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=f.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,f=f.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=t.compareDocumentPosition(e),_=c.compareDocumentPosition(e),A=v&Node.DOCUMENT_POSITION_CONTAINED_BY||_&Node.DOCUMENT_POSITION_CONTAINED_BY;return _=l&&f&&v&Node.DOCUMENT_POSITION_FOLLOWING&&_&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||f&&c===e||A||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!f&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||J_(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function J_(e,t,i,l,c){var f=Pn(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!f)e:{for(;f!==null;){if(f.tag===7&&(f===t||f.alternate===t)){i=!0;break e}f=f.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(f===null)return f=c.ownerDocument,c===f||c===f.documentElement||c===f.body;e:{for(f=t,t=S(t);f!==null;){if(!(f.tag!==5&&f.tag!==3&&f.tag!==27||f!==t&&f.alternate!==t)){f=!0;break e}f=f.return}f=!1}return f}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!f)&&!(t=f===i)&&(t=K(i,f,te),t===null?t=!1:(g(t,!0,oe,f,i),f=T,T=null,t=f!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!f)&&!(t=f===l)&&(t=K(l,f,te),t===null?t=!1:(g(t,!0,I,f,l),f=T,L=T=null,t=f!==null)),t):!1}function ly(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(s(566));var t=[];g(this._fragmentFiber.child,!1,qd,t,void 0,void 0);var i=e!==!1;if(t.length===0){var l=z(this._fragmentFiber);if(l=i?l[1]||l[0]||S(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=N(l),ly(e,i);return}if(l=N(l),l.nodeType!==9){if(l.nodeType===11){i="host"in l?l.host:null,i!==null&&i.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=i?t.length-1:0;l!==(i?-1:t.length);){var c=t[l];c.tag===6?(c=N(c),ly(c,i)):N(c).scrollIntoView(e),l+=i?-1:1}};function P_(e,t){return e=N(e),ry(e,t),!1}function ry(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function sy(e,t){var i=t._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];e.addEventListener(c.type,c.attachedListener,pr(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(f){for(var v=0,_=0;_<va.length;_++){var A=va[_];(A.fragmentInstance!==t||A.observer!==f||A.instance!==e)&&(va[v++]=A)}va.length=v,f.observe(e)}),ry(e,t))}function W_(e,t){var i=t._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];e.removeEventListener(c.type,c.attachedListener,pr(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(f){typeof f.rootMargin=="string"?X_(t,f,e):f.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Yd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Yd(i),Ll(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function ej(e,t,i,l){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[vi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=la(e.nextSibling),e===null)break}return null}function tj(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=la(e.nextSibling),e===null))return null;return e}function oy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=la(e.nextSibling),e===null))return null;return e}function Id(e){return e.data==="$?"||e.data==="$~"}function Gd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function nj(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function la(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Fd=null;function cy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return la(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function uy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function aj(e,t){function i(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return l}function ij(e){Qv(function(){Qv(function(t){return e(t)})})}function fy(e,t,i){switch(t=Ts(i),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function dy(e,t,i){for(var l in i){var c=i[l];i.hasOwnProperty(l)&&c!=null&&ct(e,t,l,null,M_,c)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Ca&&(e.onclick=null),Ll(e)}function Kd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ll(e)}var ra=new Map,hy=new Set;function As(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var si=ye.d;ye.d={f:lj,r:rj,D:sj,C:oj,L:cj,m:uj,X:dj,S:fj,M:hj};function lj(){var e=si.f(),t=wc();return e||t}function rj(e){var t=Ia(e);t!==null&&t.tag===5&&t.type==="form"?pg(t):si.r(e)}var gr=typeof document>"u"?null:document;function my(e,t,i){var l=gr;if(l&&typeof t=="string"&&t){var c=Je(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),hy.has(c)||(hy.add(c),e={rel:e,crossOrigin:i,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),en(t,"link",e),jt(t),l.head.appendChild(t)))}}function sj(e){si.D(e),my("dns-prefetch",e,null)}function oj(e,t){si.C(e,t),my("preconnect",e,t)}function cj(e,t,i){si.L(e,t,i);var l=gr;if(l&&e&&t){var c='link[rel="preload"][as="'+Je(t)+'"]';t==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+Je(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+Je(i.imageSizes)+'"]')):c+='[href="'+Je(e)+'"]';var f=c;switch(t){case"style":f=vr(e);break;case"script":f=yr(e)}if(!(ra.has(f)||(e=q({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),ra.set(f,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(Os(f))||t==="script"&&l.querySelector(ks(f))))){var v=l.createElement("link");en(v,"link",e),t==="style"&&(v[Ul]=!0,v.onload=v.onerror=function(){So(v)}),jt(v),l.head.appendChild(v)}}}function uj(e,t){si.m(e,t);var i=gr;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Je(l)+'"][href="'+Je(e)+'"]',f=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=yr(e)}if(!ra.has(f)&&(e=q({rel:"modulepreload",href:e},t),ra.set(f,e),i.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ks(f)))return}l=i.createElement("link"),en(l,"link",e),jt(l),i.head.appendChild(l)}}}function fj(e,t,i){si.S(e,t,i);var l=gr;if(l&&e){var c=hn(l).hoistableStyles,f=vr(e);t=t||"default";var v=c.get(f);if(!v){var _={loading:0,preload:null};if(v=l.querySelector(Os(f)))_.loading=5;else{e=q({rel:"stylesheet",href:e,"data-precedence":t},i),(i=ra.get(f))&&Xd(e,i);var A=v=l.createElement("link");jt(A),en(A,"link",e),A._p=new Promise(function($,Y){A.onload=$,A.onerror=Y}),A.addEventListener("load",function(){_.loading|=1}),A.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Oc(v,t,l)}v={type:"stylesheet",instance:v,count:1,state:_},c.set(f,v)}}}function dj(e,t){si.X(e,t);var i=gr;if(i&&e){var l=hn(i).hoistableScripts,c=yr(e),f=l.get(c);f||(f=i.querySelector(ks(c)),f||(e=q({src:e,async:!0},t),(t=ra.get(c))&&Qd(e,t),f=i.createElement("script"),jt(f),en(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function hj(e,t){si.M(e,t);var i=gr;if(i&&e){var l=hn(i).hoistableScripts,c=yr(e),f=l.get(c);f||(f=i.querySelector(ks(c)),f||(e=q({src:e,async:!0,type:"module"},t),(t=ra.get(c))&&Qd(e,t),f=i.createElement("script"),jt(f),en(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function py(e,t,i,l){var c=(c=ln.current)?As(c):null;if(!c)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=vr(i.href),t=hn(c).hoistableStyles,l=t.get(i),l||(l={type:"style",instance:null,count:0,state:null},t.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=vr(i.href);var f=hn(c).hoistableStyles,v=f.get(e);if(v||(c=c.ownerDocument||c,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,v),(f=c.querySelector(Os(e)))?f._p||(v.instance=f,v.state.loading=5):(f=ra.get(e),f||(f={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},ra.set(e,f)),mj(c,e,f,v.state))),t&&l===null)throw Error(s(528,""));return v}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=yr(i),t=hn(c).hoistableScripts,l=t.get(i),l||(l={type:"script",instance:null,count:0,state:null},t.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function vr(e){return'href="'+Je(e)+'"'}function Os(e){return'link[rel="stylesheet"]['+e+"]"}function gy(e){return q({},e,{"data-precedence":e.precedence,precedence:null})}function mj(e,t,i,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ul]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Ul]=!0,t.onload=t.onerror=So.bind(null,t),en(t,"link",i),jt(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function yr(e){return'[src="'+Je(e)+'"]'}function ks(e){return"script[async]"+e}function vy(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Je(i.href)+'"]');if(l)return t.instance=l,jt(l),l;var c=q({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),jt(l),en(l,"style",c),Oc(l,i.precedence,e),t.instance=l;case"stylesheet":c=vr(i.href);var f=e.querySelector(Os(c));if(f)return t.state.loading|=4,t.instance=f,jt(f),f;l=gy(i),(c=ra.get(c))&&Xd(l,c),f=(e.ownerDocument||e).createElement("link"),jt(f);var v=f;return v._p=new Promise(function(_,A){v.onload=_,v.onerror=A}),en(f,"link",l),t.state.loading|=4,Oc(f,i.precedence,e),t.instance=f;case"script":return f=yr(i.src),(c=e.querySelector(ks(f)))?(t.instance=c,jt(c),c):(l=i,(c=ra.get(f))&&(l=q({},i),Qd(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),jt(c),en(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Oc(l,i.precedence,e));return t.instance}function Oc(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,f=c,v=0;v<l.length;v++){var _=l[v];if(_.dataset.precedence===t)f=_;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Xd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Qd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kc=null;function yy(e,t,i){if(kc===null){var l=new Map,c=kc=new Map;c.set(i,l)}else c=kc,l=c.get(i),l||(l=new Map,c.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var f=i[c];if(!(f[vi]||f[qt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var v=f.getAttribute(t)||"";v=e+v;var _=l.get(v);_?_.push(f):l.set(v,[f])}}return l}function Jd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function pj(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function by(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Sy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function _y(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=xy(t),e.suspenseyImages.push(t)),e=yj.bind(e),t.decode().then(e,e))}function gj(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=vr(l.href),f=t.querySelector(Os(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ms.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=f,jt(f);return}f=t.ownerDocument||t,l=gy(l),(c=ra.get(c))&&Xd(l,c),f=f.createElement("link"),jt(f);var v=f;v._p=new Promise(function(_,A){v.onload=_,v.onerror=A}),en(f,"link",l),i.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ms.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Mc=0;function vj(e,t){return e.stylesheets&&e.count===0&&Rc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&Rc(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Mc===0&&(Mc=62500*R_());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Rc(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Mc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function jy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Rc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ms(){this.count--,jy(this)}function yj(){this.imgCount--,jy(this)}var Dc=null;function Rc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Dc=new Map,t.forEach(bj,e),Dc=null,Ms.call(e))}function bj(e,t){if(!(t.state.loading&4)){var i=Dc.get(e);if(i)var l=i.get(null);else{i=new Map,Dc.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var v=c[f];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(i.set(v.dataset.precedence,v),l=v)}l&&i.set(null,l)}c=t.instance,v=c.getAttribute("data-precedence"),f=i.get(v)||l,f===l&&i.set(null,c),i.set(v,c),this.count++,l=Ms.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var br={$$typeof:G,Provider:null,Consumer:null,_currentValue:Ve,_currentValue2:Ve,_threadCount:0};function Sj(e,t,i,l,c,f,v,_,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Dl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.hiddenUpdates=Dl(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.transitionTypes=null,this.incompleteTransitions=new Map}function wy(e,t,i,l,c,f,v,_,A,$,Y,ee){return e=new Sj(e,t,i,v,A,$,Y,ee,_),t=1,f===!0&&(t|=24),f=jn(3,null,null,t),e.current=f,f.stateNode=e,t=df(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:l,isDehydrated:i,cache:t},gf(f),e}function zy(e){return e?(e=Il,e):Il}function Ny(e,t,i,l,c,f){c=zy(c),l.context===null?l.context=c:l.pendingContext=c,l=Ni(t),l.payload={element:i},f=f===void 0?null:f,f!==null&&(l.callback=f),i=Ei(e,l,t),i!==null&&(En(i,e,t),us(i,e,t))}function Ey(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Pd(e,t){Ey(e,t),(e=e.alternate)&&Ey(e,t)}function Cy(e){if(e.tag===13||e.tag===31){var t=ol(e,67108864);t!==null&&En(t,e,67108864),Pd(e,67108864)}}function Ty(e){if(e.tag===13||e.tag===31){var t=qn();t=dn(t);var i=ol(e,t);i!==null&&En(i,e,t),Pd(e,t)}}var Sr=!0;function xj(e,t,i,l){var c=de.T;de.T=null;var f=ye.p;try{ye.p=2,Wd(e,t,i,l)}finally{ye.p=f,de.T=c}}function _j(e,t,i,l){var c=de.T;de.T=null;var f=ye.p;try{ye.p=8,Wd(e,t,i,l)}finally{ye.p=f,de.T=c}}function Wd(e,t,i,l){if(Sr){var c=eh(l);if(c===null)Dd(e,t,l,Uc,i),Oy(e,l);else if(wj(c,e,t,i,l))l.stopPropagation();else if(Oy(e,l),t&4&&-1<jj.indexOf(e)){for(;c!==null;){var f=Ia(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var v=Oe(f.pendingLanes);if(v!==0){var _=f;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var A=1<<31-on(v);_.entanglements[1]|=A,v&=~A}$a(f),(at&6)===0&&(xc=Ht()+500,Ns(0))}}break;case 31:case 13:_=ol(f,2),_!==null&&En(_,f,2),wc(),Pd(f,2)}if(f=eh(l),f===null&&Dd(e,t,l,Uc,i),f===c)break;c=f}c!==null&&l.stopPropagation()}else Dd(e,t,l,null,i)}}function eh(e){return e=$u(e),th(e)}var Uc=null;function th(e){if(Uc=null,e=Pn(e),e!==null){var t=d(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=h(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function Ay(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Au()){case go:return 2;case je:return 8;case rt:case Re:return 32;case Mt:return 268435456;default:return 32}default:return 32}}var nh=!1,Bi=null,Zi=null,Hi=null,Ds=new Map,Rs=new Map,qi=[],jj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Oy(e,t){switch(e){case"focusin":case"focusout":Bi=null;break;case"dragenter":case"dragleave":Zi=null;break;case"mouseover":case"mouseout":Hi=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rs.delete(t.pointerId)}}function Us(e,t,i,l,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Ia(t),t!==null&&Cy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function wj(e,t,i,l,c){switch(t){case"focusin":return Bi=Us(Bi,e,t,i,l,c),!0;case"dragenter":return Zi=Us(Zi,e,t,i,l,c),!0;case"mouseover":return Hi=Us(Hi,e,t,i,l,c),!0;case"pointerover":var f=c.pointerId;return Ds.set(f,Us(Ds.get(f)||null,e,t,i,l,c)),!0;case"gotpointercapture":return f=c.pointerId,Rs.set(f,Us(Rs.get(f)||null,e,t,i,l,c)),!0}return!1}function ky(e){var t=Pn(e.target);if(t!==null){var i=d(t);if(i!==null){if(t=i.tag,t===13){if(t=h(i),t!==null){e.blockedOn=t,tl(e.priority,function(){Ty(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,tl(e.priority,function(){Ty(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=eh(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Lu=l,i.target.dispatchEvent(l),Lu=null}else return t=Ia(i),t!==null&&Cy(t),e.blockedOn=i,!1;t.shift()}return!0}function My(e,t,i){Lc(e)&&i.delete(t)}function zj(){nh=!1,Bi!==null&&Lc(Bi)&&(Bi=null),Zi!==null&&Lc(Zi)&&(Zi=null),Hi!==null&&Lc(Hi)&&(Hi=null),Ds.forEach(My),Rs.forEach(My)}function $c(e,t){e.blockedOn===t&&(e.blockedOn=null,nh||(nh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,zj)))}var Bc=null;function Dy(e){Bc!==e&&(Bc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(th(l||i)===null)continue;break}var f=Ia(i);f!==null&&(e.splice(t,3),t-=3,Lf(f,{pending:!0,data:c,method:i.method,action:l},l,c))}}))}function xr(e){function t(A){return $c(A,e)}Bi!==null&&$c(Bi,e),Zi!==null&&$c(Zi,e),Hi!==null&&$c(Hi,e),Ds.forEach(t),Rs.forEach(t);for(var i=0;i<qi.length;i++){var l=qi[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<qi.length&&(i=qi[0],i.blockedOn===null);)ky(i),i.blockedOn===null&&qi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var c=i[l],f=i[l+1],v=c[Dt]||null;if(typeof f=="function")v||Dy(i);else if(v){var _=null;if(f&&f.hasAttribute("formAction")){if(c=f,v=f[Dt]||null)_=v.formAction;else if(th(c)!==null)continue}else _=v.action;typeof _=="function"?i[l+1]=_:(i.splice(l,3),l-=3),Dy(i)}}}function Ry(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(v){return c=v})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function ah(e){this._internalRoot=e}Zc.prototype.render=ah.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,l=qn();Ny(i,l,e,t,null,null)},Zc.prototype.unmount=ah.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ny(e.current,2,null,e,null,null),wc(),t[fa]=null}};function Zc(e){this._internalRoot=e}Zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=qr();e={blockedOn:null,target:e,priority:t};for(var i=0;i<qi.length&&t!==0&&t<qi[i].priority;i++);qi.splice(i,0,e),i===0&&ky(e)}};var Uy=a.version;if(Uy!=="19.3.0")throw Error(s(527,Uy,"19.3.0"));ye.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=b(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var Nj={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hc.isDisabled&&Hc.supportsFiber)try{Mn=Hc.inject(Nj),sn=Hc}catch{}}return $s.createRoot=function(e,t){if(!o(e))throw Error(s(299));var i=!1,l="",c=zg,f=Ng,v=Eg;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(v=t.onRecoverableError)),t=wy(e,1,!1,null,null,i,l,null,c,f,v,Ry),e[fa]=t.current,Md(e),new ah(t)},$s.hydrateRoot=function(e,t,i){if(!o(e))throw Error(s(299));var l=!1,c="",f=zg,v=Ng,_=Eg,A=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(_=i.onRecoverableError),i.formState!==void 0&&(A=i.formState)),t=wy(e,1,!0,t,i??null,l,c,A,f,v,_,Ry),t.context=zy(null),i=t.current,l=qn(),l=dn(l),c=Ni(l),c.callback=null,Ei(i,c,l),i=l,t.current.lanes=i,Ya(t,i),$a(t),e[fa]=t.current,Md(e),new Zc(t)},$s.version="19.3.0",$s}var Xy;function Bj(){if(Xy)return sh.exports;Xy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),sh.exports=$j(),sh.exports}var Zj=Bj();const Hj=M.forwardRef(function({className:a="",...r},s){return u.jsx("div",{...r,ref:s,className:`t2c-card ${a}`,"data-ui-component":"chat-box"})}),qj=M.forwardRef(function({className:a="",autoSize:r=!0,...s},o){const d=M.useRef(null);return M.useLayoutEffect(()=>{var p;const h=d.current;if(!h||!r)return;const m=()=>{h.style.height="auto",h.style.height=`${h.scrollHeight}px`};m();let y=(p=h.parentElement)==null?void 0:p.clientWidth;const b=new ResizeObserver(([g])=>{g.contentRect.width!==y&&(y=g.contentRect.width,m())});return h.parentElement&&b.observe(h.parentElement),()=>b.disconnect()},[r,s.value,s.placeholder]),u.jsx("textarea",{...s,rows:s.rows??1,className:`t2c-ta ${a}`,ref:h=>{d.current=h,typeof o=="function"?o(h):o&&(o.current=h)}})});function Vj({className:n="",...a}){return u.jsx("div",{...a,className:`t2c-row ${n}`})}function Yj({className:n="",children:a,...r}){return u.jsx("button",{type:"button",...r,className:`t2c-send ${n}`,children:a??u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M12 19V5m-6 6 6-6 6 6"})})})}function Ij({value:n,onValueChange:a,onSubmit:r,submitLabel:s,disabled:o,submitDisabled:d,submitOn:h="modifier-enter",className:m,inputRef:y,inputProps:b,beforeInput:p,afterInput:g,controls:S,submitContent:j,submitClassName:z}){const w=()=>{!o&&!d&&r()};return u.jsxs(Hj,{className:m,children:[p,u.jsx(qj,{...b,ref:y,value:n,disabled:o,onChange:N=>a(N.target.value),onKeyDown:N=>{var T;(T=b==null?void 0:b.onKeyDown)==null||T.call(b,N),!N.defaultPrevented&&N.key==="Enter"&&!N.shiftKey&&!N.nativeEvent.isComposing&&(h==="enter"||N.metaKey||N.ctrlKey)&&(N.preventDefault(),w())}}),g,u.jsxs(Vj,{children:[S,u.jsx("span",{className:"t2c-grow"}),u.jsx(Yj,{className:z,disabled:o||d,title:s,"aria-label":s,onClick:w,children:j})]})]})}j0();const Qy=n=>{let a;const r=new Set,s=(b,p)=>{const g=typeof b=="function"?b(a):b;if(!Object.is(g,a)){const S=a;a=p??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(j=>j(a,S))}},o=()=>a,m={setState:s,getState:o,getInitialState:()=>y,subscribe:b=>(r.add(b),()=>r.delete(b))},y=a=n(s,o,m);return m},Gj=(n=>n?Qy(n):Qy),Fj=n=>n;function Kj(n,a=Fj){const r=qc.useSyncExternalStore(n.subscribe,qc.useCallback(()=>a(n.getState()),[n,a]),qc.useCallback(()=>a(n.getInitialState()),[n,a]));return qc.useDebugValue(r),r}const Jy=n=>{const a=Gj(n),r=s=>Kj(a,s);return Object.assign(r,a),r},Rr=(n=>n?Jy(n):Jy),dm="forsion_shortcuts";function w0(){try{const n=JSON.parse(localStorage.getItem(dm)||"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}function fh(n){try{localStorage.setItem(dm,JSON.stringify(n))}catch{}}const Xj=Rr(n=>({overrides:w0(),recording:!1,setOverride:(a,r)=>n(s=>{const o={...s.overrides,[a]:r};return fh(o),{overrides:o}}),clearOverride:a=>n(r=>{const s={...r.overrides};return delete s[a],fh(s),{overrides:s}}),resetAll:()=>{fh({}),n({overrides:{}})},setRecording:a=>n({recording:a})}));typeof window<"u"&&window.addEventListener("storage",n=>{(n.key===dm||n.key===null)&&Xj.setState({overrides:w0()})});const z0="mod+mod",Py=new Set,Qj=new WeakMap;let Wy=!1;function eb(n,a){const r=n.replace(/(Left|Right)$/,"");return r===n?null:r===(a?"Meta":"Control")?z0:r==="Shift"?"shift+shift":r==="Alt"?"alt+alt":null}function Jj(n,a,r){if(a.type==="keyup")return n.delete(a.code),null;const s=eb(a.code,r);if(!s)return n.clear(),null;if(a.repeat||([...n].some(d=>eb(d,r)!==s)&&n.clear(),n.add(a.code),n.size<2))return null;const o=s===z0?r?"metaKey":"ctrlKey":s==="shift+shift"?"shiftKey":"altKey";return["metaKey","ctrlKey","shiftKey","altKey"].some(d=>d!==o&&a[d])?null:(n.clear(),s)}function Pj(){if(Wy||typeof window>"u")return;Wy=!0;const n=a=>{const r=Jj(Py,a,Wj());r&&Qj.set(a,r)};window.addEventListener("keydown",n,!0),window.addEventListener("keyup",n,!0),window.addEventListener("blur",()=>Py.clear())}function Wj(){try{return document.documentElement.dataset.platform==="mac"}catch{return!1}}Pj();Rr((n,a)=>({commands:[],paletteOpen:!1,pickCb:null,addCommand:r=>n(s=>({commands:[...s.commands.filter(o=>o.id!==r.id),r]})),removeCommand:r=>n(s=>({commands:s.commands.filter(o=>o.id!==r)})),run:(r,s)=>{var d;const o=a().commands.find(h=>h.id===r);if(o){if(s&&((d=o.invoke)!=null&&d.run)){o.invoke.run(s);return}o.run(s)}},setPaletteOpen:r=>n(r?{paletteOpen:!0}:{paletteOpen:!1,pickCb:null})}));const e2="lcl.uiMode",Gi=typeof location<"u"&&new URLSearchParams(location.search).get("window")==="mini",t2=Gi&&new URLSearchParams(location.search).get("transient")==="1";(()=>{if(typeof location>"u")return null;const n=new URLSearchParams(location.search);return n.get("window")==="detached"&&n.get("space")||null})();typeof location>"u"||new URLSearchParams(location.search).get("window");function n2(){if(Gi)return"desktop";try{const n=new URLSearchParams(location.search).get("ui");return n==="mobile"||n==="desktop"?n:localStorage.getItem(e2)==="mobile"?"mobile":"desktop"}catch{return"desktop"}}n2();function a2(n,a={}){const r=new Set(Object.entries(n.panels??{}).filter(([,m])=>m.contentComponent==="__extend").map(([m])=>m));if(!r.size)return n;const s=structuredClone(n);for(const m of r)delete s.panels[m];const o=m=>{if(Array.isArray(m.data))return m.data=m.data.map(o).filter(b=>b!==null),m.data.length?m:null;const y=m.data.views.length;if(m.data.views=m.data.views.filter(b=>!r.has(b)),y&&!m.data.views.length)return null;if(m.data.activeView&&r.has(m.data.activeView)){const b=a[m.data.activeView];m.data.activeView=m.data.views.includes(b)?b:m.data.views[0]}return m},d=o(s.grid.root);d&&(s.grid.root=d);const h=(m,y)=>Array.isArray(m.data)?m.data.some(b=>h(b,y)):m.data.id===y;return s.activeGroup&&!h(s.grid.root,s.activeGroup)&&delete s.activeGroup,s}const i2=3,l2=.01;function $h(n){var h;const a={sashes:[],fractions:[]};let r;try{r=n.toJSON()}catch{return a}const s=r.panels??{},o=m=>{if(m.type!=="leaf")return!1;const y=(m.data??{}).views??[];return y.length>0&&y.every(b=>{var g,S;const p=(S=(g=s[b])==null?void 0:g.params)==null?void 0:S.__loc;return p==="left"||p==="right"})},d=m=>{if(!m||m.type!=="branch"||!Array.isArray(m.data))return;const y=m.data.filter(b=>b&&b.visible!==!1);if(y.some(o)){let b=0;y.forEach((p,g)=>{b+=p.size??0;const S=y[g+1];S&&!o(p)&&!o(S)&&a.sashes.push(b)})}else if(y.length>1){const b=y.reduce((p,g)=>p+(g.size??0),0);if(b>0)for(const p of y)a.fractions.push((p.size??0)/b)}y.forEach(d)};return d((h=r.grid)==null?void 0:h.root),a}function r2(n,a){return n.sashes.length!==a.sashes.length||n.fractions.length!==a.fractions.length?!1:n.sashes.every((r,s)=>Math.abs(r-a.sashes[s])<=i2)&&n.fractions.every((r,s)=>Math.abs(r-a.fractions[s])<=l2)}const s2=n=>n==="horizontal"?"vertical":"horizontal";function su(n,a){const r=a.filter(s=>!!s).flatMap(s=>"axis"in s&&s.axis===n?s.children:[s]);return r.length?r.length===1?r[0]:{axis:n,children:r,width:n==="horizontal"?r.reduce((s,o)=>s+o.width,0):Math.max(...r.map(s=>s.width)),height:n==="vertical"?r.reduce((s,o)=>s+o.height,0):Math.max(...r.map(s=>s.height))}:null}function oo(n){const a=n.toJSON().grid;if(!(a!=null&&a.root))return null;const r=(s,o)=>{var h;if(Array.isArray(s.data))return su(o,s.data.map(m=>r(m,s2(o))));const d=n.getPanel(s.data.views[0]);return d?{panel:d.id,instance:d,loc:((h=d.params)==null?void 0:h.__loc)??"main",width:d.group.api.width,height:d.group.api.height}:null};return r(a.root,a.orientation==="HORIZONTAL"?"horizontal":"vertical")}function co(n,a){return"panel"in n?n.loc===a?n:null:su(n.axis,n.children.map(r=>co(r,a)))}const N0=n=>"panel"in n?n.panel:N0(n.children[0]),Bh=n=>"panel"in n?[n.panel]:n.children.flatMap(Bh),E0=(n,a)=>"panel"in a?n.getPanel(a.panel)===a.instance:a.children.every(r=>E0(n,r)),uo=n=>"panel"in n?n.panel:`${n.axis}(${n.children.map(uo).join(",")})`;function hm(n,a){var s;const r=oo(n);if(!(!r||!a))for(const o of["main","left","right","bottom"]){const d=co(a,o),h=co(r,o);if(!d||!h||!E0(n,d)||uo(d)!==uo(h))continue;const m=[],y=(b,p,g,S)=>{if("panel"in b){m.push({panel:b.panel,width:p,height:g,depth:S});return}const j=b.axis==="horizontal"?"width":"height",z=b.children.reduce((w,N)=>w+N[j],0)||1;b.children.forEach(w=>y(w,j==="width"?p*w.width/z:p,j==="height"?g*w.height/z:g,S+1))};y(d,h.width,h.height,0),m.sort((b,p)=>b.depth-p.depth);for(const{panel:b,width:p,height:g}of m)(s=n.getPanel(b))==null||s.group.api.setSize({width:p,height:g})}}function o2(n,a,r="right"){var T,L,oe;const s=oo(n);if(!s)return!1;const o=I=>{const te=co(s,I),K=a&&co(a,I);return te&&K&&Bh(te).sort().join("|")===Bh(K).sort().join("|")?K:te},d=o("main");if(!d)return!1;const h=o("left"),m=o("right"),y=o("bottom"),b=(...I)=>su("horizontal",I),p=(...I)=>su("vertical",I),g=r==="left"?b(p(b(h,d),y),m):r==="full"?p(b(h,d,m),y):r==="main"?b(h,p(d,y),m):b(h,p(b(d,m),y));if(uo(s)===uo(g))return!1;const S=(T=n.activePanel)==null?void 0:T.id,j=n.groups.map(I=>{var te;return(te=I.activePanel)==null?void 0:te.id}).filter(I=>!!I),z=I=>n.getPanel(N0(I)).group,w=n.addGroup({direction:"right",skipSetActive:!0});z(g).api.moveTo({group:w,position:"right",skipSetActive:!0});const N=I=>{if(!("panel"in I)){for(let te=1;te<I.children.length;te++)z(I.children[te]).api.moveTo({group:z(I.children[te-1]),position:I.axis==="horizontal"?"right":"bottom",skipSetActive:!0});I.children.forEach(N)}};N(g),n.removeGroup(w),hm(n,g);for(const I of j)(L=n.getPanel(I))==null||L.api.setActive();return S&&((oe=n.getPanel(S))==null||oe.api.setActive()),!0}const c2=new Map;function Ct(n){return c2.get(n)}function Tn(n){return typeof n=="function"?n():n}function C0(n){return Object.keys(n).filter(a=>/path$/i.test(a)||a==="sessionId").sort().map(a=>`${a}=${String(n[a])}`).join("&")}function u2(n){const a=r=>typeof n[r]=="string"&&n[r]?n[r]:void 0;return a("notePath")??a("path")??Object.keys(n).filter(r=>/Path$/.test(r)).sort().map(a).find(Boolean)}function f2(n){var r,s;const a=n;for(const o of((r=a.getAnimations)==null?void 0:r.call(a,{subtree:!0}))??[])if(((s=o.effect)==null?void 0:s.getTiming().iterations)!==1/0&&!(Number(o.currentTime??0)>80))try{o.finish()}catch{}}const d2=.191,tb=220;function h2(n,a,r){const d=Math.round(Math.min(a==="left"?280:300,Math.max(a==="left"?220:240,n*d2)));if(!r.free)return d;const h=typeof r.saved=="number"?r.saved:Math.round(d*(r.scale??1)),m=Math.max(tb,Math.min(680,Math.round(n*.6)));return Math.min(m,Math.max(tb,h))}const nb=120;function m2(n,a){const r=Math.max(nb,Math.round(n*.6)),s=typeof a=="number"?a:Math.round(n*.32);return Math.min(r,Math.max(nb,s))}function T0(n){var r;return(((r=n.panels[0])==null?void 0:r.params)??{}).__loc??"main"}function Fi(n,a,r){var s;return!!((s=n[a])!=null&&s.some(o=>o.type===r))}function ou(n,a,r,s){return Fi(n,r,s)&&a.filter(o=>o.loc===r&&o.type===s).length<=1}function A0(n,a,r){const s=[];for(const o of["main","left","right"])for(const d of n[o]??[])r(d.type)&&!a.some(h=>h.loc===o&&h.type===d.type)&&s.push({...d,loc:o});return s}let Zh=0;function ab(n,a,r,s){const o=n().stacks[r];!o||s===o.idx||s<0||s>=o.entries.length||(a({stacks:{...n().stacks,[r]:{...o,idx:s}}}),Zh++,Promise.resolve(o.entries[s].restore()).finally(()=>{Zh--}))}const Tl=Rr((n,a)=>({stacks:{},record(r,s){var h;if(Zh>0||!r)return;const o=a().stacks[r]??{entries:[],idx:-1};if(((h=o.entries[o.idx])==null?void 0:h.key)===s.key)return;const d=[...o.entries.slice(0,o.idx+1),s].slice(-100);n({stacks:{...a().stacks,[r]:{entries:d,idx:d.length-1}}})},back(r){var s;ab(a,n,r,(((s=a().stacks[r])==null?void 0:s.idx)??0)-1)},forward(r){var s;ab(a,n,r,(((s=a().stacks[r])==null?void 0:s.idx)??-1)+1)},drop(r){if(!(r in a().stacks))return;const s={...a().stacks};delete s[r],n({stacks:s})},reset(){n({stacks:{}})}})),O0="forsion_tangu_ribbon_expanded",Fs="forsion_tangu_ribbon_order",k0="forsion_tangu_ribbon_v2",mm="forsion_ribbon_recent_spaces",p2=5,dh=3;function Hh(){try{const n=localStorage.getItem(mm),a=n===null?dh:Number(n);return Number.isInteger(a)?Math.max(0,Math.min(p2,a)):dh}catch{return dh}}function g2(){try{return localStorage.getItem(O0)==="1"}catch{return!1}}function v2(){try{const n=JSON.parse(localStorage.getItem(Fs)||"[]");return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}const hh=n=>Array.isArray(n)?n.filter(a=>typeof a=="string"):[],y2=n=>{const a={};if(n&&typeof n=="object")for(const[r,s]of Object.entries(n))typeof s=="string"&&(a[r]=s);return a};function b2(){try{const n=JSON.parse(localStorage.getItem(k0)||"{}");return{bottomOrder:hh(n.bottomOrder),commandItems:hh(n.commandItems),commandIcons:y2(n.commandIcons),folders:(Array.isArray(n.folders)?n.folders:[]).filter(a=>!!a&&typeof a.id=="string").map(a=>({id:a.id,name:typeof a.name=="string"?a.name:"",zone:a.zone==="bottom"?"bottom":"top",items:hh(a.items),...typeof a.icon=="string"?{icon:a.icon}:{}}))}}catch{return{bottomOrder:[],folders:[],commandItems:[],commandIcons:{}}}}const S2=n=>{try{localStorage.setItem(k0,JSON.stringify({bottomOrder:n.bottomOrder,folders:n.folders,commandItems:n.commandItems,commandIcons:n.commandIcons}))}catch{}},x2=n=>a=>n(r=>{const s=a(r);return S2({...r,...s}),s}),_2=Rr(n=>{const a=x2(n);return{items:[],expanded:g2(),order:v2(),recentCount:Hh(),setRecentCount:r=>{try{localStorage.setItem(mm,String(r))}catch{}n({recentCount:Hh()})},...b2(),addRibbonIcon:r=>n(s=>({items:[...s.items.filter(o=>o.id!==r.id),r]})),removeRibbonIcon:r=>a(s=>{const o=s.order.filter(d=>d!==r);try{localStorage.setItem(Fs,JSON.stringify(o))}catch{}return{items:s.items.filter(d=>d.id!==r),order:o,bottomOrder:s.bottomOrder.filter(d=>d!==r),folders:s.folders.map(d=>({...d,items:d.items.filter(h=>h!==r)}))}}),toggleExpanded:()=>n(r=>{const s=!r.expanded;try{localStorage.setItem(O0,s?"1":"0")}catch{}return{expanded:s}}),setZoneOrder:(r,s)=>{if(r==="top"){try{localStorage.setItem(Fs,JSON.stringify(s))}catch{}n({order:s})}else a(()=>({bottomOrder:s}))},addFolder:(r,s)=>a(o=>{const d=`folder:${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`,h=[...o.folders,{id:d,name:s,zone:r,items:[]}],m=[...r==="top"?o.order:o.bottomOrder,d];if(r==="top")try{localStorage.setItem(Fs,JSON.stringify(m))}catch{}return r==="top"?{folders:h,order:m}:{folders:h,bottomOrder:m}}),renameFolder:(r,s)=>a(o=>({folders:o.folders.map(d=>d.id===r?{...d,name:s}:d)})),setFolderIcon:(r,s)=>a(o=>({folders:o.folders.map(d=>d.id===r?{...d,icon:s||void 0}:d)})),setCommandIcon:(r,s)=>a(o=>{const d={...o.commandIcons};return s?d[r]=s:delete d[r],{commandIcons:d}}),removeFolder:r=>a(s=>{const o=s.folders.find(b=>b.id===r);if(!o)return{};const d=o.zone==="top"?s.order:s.bottomOrder,h=d.indexOf(r),m=h>=0?[...d.slice(0,h),...o.items,...d.slice(h+1)]:[...d,...o.items];if(o.zone==="top")try{localStorage.setItem(Fs,JSON.stringify(m))}catch{}const y=s.folders.filter(b=>b.id!==r);return o.zone==="top"?{folders:y,order:m}:{folders:y,bottomOrder:m}}),setFolderItems:(r,s)=>a(o=>({folders:o.folders.map(d=>d.id===r?{...d,items:s}:d)})),moveIntoFolder:(r,s)=>a(o=>({folders:o.folders.map(d=>d.id===r?{...d,items:[...d.items.filter(h=>h!==s),s]}:{...d,items:d.items.filter(h=>h!==s)})})),moveOutOfFolder:r=>a(s=>({folders:s.folders.map(o=>({...o,items:o.items.filter(d=>d!==r)}))})),addCommandItem:r=>a(s=>s.commandItems.includes(r)?{}:{commandItems:[...s.commandItems,r],bottomOrder:[...s.bottomOrder,`cmd:${r}`]}),removeCommandItem:r=>a(s=>{const o={...s.commandIcons};return delete o[r],{commandItems:s.commandItems.filter(d=>d!==r),commandIcons:o,bottomOrder:s.bottomOrder.filter(d=>d!==`cmd:${r}`),folders:s.folders.map(d=>({...d,items:d.items.filter(h=>h!==`cmd:${r}`)}))}})}});typeof window<"u"&&window.addEventListener("storage",n=>{n.key===mm&&_2.setState({recentCount:Hh()})});const mh={},j2={"lcl.withHotkey":{zh:"{label}({key})",en:"{label} ({key})"},"lcl.ribbon.showLabels":{zh:"显示名称",en:"Show labels"},"lcl.ribbon.iconsOnly":{zh:"只显示图标",en:"Icons only"},"lcl.ribbon.addSpaceOrFolder":{zh:"新建 Space 或收纳夹",en:"New Space or folder"},"lcl.ribbon.addCommand":{zh:"添加命令",en:"Add command"},"lcl.ribbon.more":{zh:"更多",en:"More"},"lcl.ribbon.less":{zh:"收起",en:"Show less"},"lcl.ribbon.switchSpace":{zh:"切到第 {n} 个 Space",en:"Switch to Space {n}"},"lcl.ribbon.newSpace":{zh:"新建 Space",en:"New Space"},"lcl.ribbon.newFolder":{zh:"新建收纳夹",en:"New folder"},"lcl.ribbon.folderDefaultName":{zh:"收纳夹",en:"Folder"},"lcl.ribbon.newFolderSpaces":{zh:"新建收纳夹(Space 区)",en:"New folder (Spaces)"},"lcl.ribbon.newFolderCommands":{zh:"新建收纳夹(命令区)",en:"New folder (commands)"},"lcl.ribbon.changeIcon":{zh:"更换图标",en:"Change icon"},"lcl.ribbon.rename":{zh:"重命名",en:"Rename"},"lcl.ribbon.renameFolder":{zh:"重命名收纳夹",en:"Rename folder"},"lcl.ribbon.dissolveFolder":{zh:"解散收纳夹",en:"Dissolve folder"},"lcl.ribbon.setIcon":{zh:"设置图标",en:"Set icon"},"lcl.ribbon.removeCommand":{zh:"从 Ribbon 移除",en:"Remove from ribbon"},"lcl.ribbon.moveOut":{zh:"移出收纳夹",en:"Move out of folder"},"lcl.ribbon.folderEmpty":{zh:"把图标拖到收纳夹图标上即可放入",en:"Drag icons onto the folder to collect them"},"lcl.peek.enter":{zh:"进入「{name}」",en:"Go to {name}"},"lcl.ribbon.defaultIcon":{zh:"默认图标",en:"Default icon"},"lcl.ribbon.openInNewWindow":{zh:"在新窗口中打开",en:"Open in new window"},"lcl.ribbon.recentSpaces":{zh:"最近使用的 Space",en:"Recent Spaces"},"lcl.tab.close":{zh:"关闭",en:"Close"},"lcl.tab.moveToWindow":{zh:"移到新窗口",en:"Move to new window"},"lcl.tab.new":{zh:"新建标签页",en:"New tab"},"lcl.nav.back":{zh:"后退",en:"Back"},"lcl.nav.forward":{zh:"前进",en:"Forward"},"lcl.edge.left":{zh:"左侧栏",en:"Toggle left panel"},"lcl.edge.right":{zh:"右侧栏",en:"Toggle right panel"},"lcl.edge.bottom":{zh:"底部面板",en:"Toggle bottom panel"},"lcl.edge.reset":{zh:"恢复本 Space 默认布局",en:"Restore default layout for this Space"},"lcl.layout.restored":{zh:"已恢复本 Space 默认布局",en:"Restored the default layout"},"lcl.layout.undo":{zh:"撤销",en:"Undo"},"lcl.view.loadFailed":{zh:"此视图加载失败",en:"Failed to load this view"},"lcl.view.retry":{zh:"重试",en:"Retry"},"lcl.palette.pickCommand":{zh:"选择要添加的命令…",en:"Pick a command to add…"},"lcl.mini.switchSpace":{zh:"切换 Space",en:"Switch Space"},"lcl.mini.showMain":{zh:"在主面板显示",en:"Show in main panel"},"lcl.mini.close":{zh:"关闭 Mini Panel",en:"Close Mini Panel"},"lcl.mini.empty":{zh:"暂无已适配的 Space",en:"No Mini Panel Spaces available"},"lcl.mini.closeMenu":{zh:"关闭菜单",en:"Close menu"},"lcl.mobile.closeTab":{zh:"关闭标签页",en:"Close tab"},"lcl.mobile.leftPanel":{zh:"左侧面板",en:"Left panel"},"lcl.mobile.rightPanel":{zh:"右侧面板",en:"Right panel"},"lcl.mobile.tabs":{zh:"标签页",en:"Tabs"},"lcl.mobile.more":{zh:"更多",en:"More"},"lcl.mobile.back":{zh:"返回",en:"Back"},"lcl.mobile.allSpaces":{zh:"全部",en:"All"},"lcl.mobile.allSpacesTitle":{zh:"全部 Space",en:"All Spaces"},"lcl.mobile.dock.inDock":{zh:"固定在 Dock",en:"In the dock"},"lcl.mobile.dock.others":{zh:"其他",en:"Others"},"lcl.mobile.dock.edit":{zh:"选择固定在 Dock 的 Space",en:"Choose the Spaces in the dock"},"lcl.mobile.dock.editTitle":{zh:"固定在 Dock",en:"Spaces in the dock"},"lcl.mobile.dock.editHint":{zh:"{first}常驻,另外最多固定 {max} 个。满了先取消一个再选。",en:"{first} is always there; pick up to {max} more. When the dock is full, take one out first."},"lcl.mobile.dock.done":{zh:"完成",en:"Done"},"lcl.viewMode.aria":{zh:"看法",en:"View mode"},"lcl.viewMode.next":{zh:"切到下一种看法",en:"Next view mode"},"lcl.viewMode.pick":{zh:"看法:{label}",en:"View: {label}"}};function ib(n,a){return a?n.replace(/\{(\w+)\}/g,(r,s)=>s in a?String(a[s]):r):n}function w2(n,a){const r=j2[n];if(!r)return ib(n,a);let s=!1;try{s=document.documentElement.lang.startsWith("zh")}catch{}return ib(s?r.zh:r.en,a)}let z2=w2;function lb(n,a){return z2(n,a)}function N2(n){var d;const a=(d=n.dockview)==null?void 0:d.panels,{left:r,right:s,bottom:o}=n.sidebars;return!Object.keys(a??{}).length&&!r.stash.length&&!s.stash.length&&!(o!=null&&o.stash.length)}function E2(){try{const n=new URLSearchParams(location.search);if(n.get("window")==="detached")return`tangu2_layout_detached_${n.get("id")||"default"}`}catch{}return"tangu2_layout_v4"}const M0=E2(),C2="tangu2_layout_v3",D0="tangu2_named_layouts";function ph(n){return Array.isArray(n)&&n.every(a=>!!a&&typeof a=="object"&&typeof a.type=="string")}function T2(n){var r,s,o,d;if(!n||typeof n!="object")return!1;const a=n;return a.version===4&&!!a.sidebars&&typeof((r=a.sidebars.left)==null?void 0:r.visible)=="boolean"&&typeof((s=a.sidebars.right)==null?void 0:s.visible)=="boolean"&&ph((o=a.sidebars.left)==null?void 0:o.stash)&&ph((d=a.sidebars.right)==null?void 0:d.stash)&&(a.sidebars.bottom===void 0||typeof a.sidebars.bottom.visible=="boolean"&&ph(a.sidebars.bottom.stash))}function A2(n){if(!n||typeof n!="object")return null;const a=n.panels;if(!a||typeof a!="object")return null;const r=new Set(Object.values(a).map(s=>{var o;return(o=s==null?void 0:s.params)==null?void 0:o.__loc}).filter(Boolean));return!r.has("left")||!r.has("right")?null:{version:4,dockview:n,sidebars:{left:{visible:!0,stash:[]},right:{visible:!0,stash:[]}}}}function bu(n){if(n)return n;try{return typeof localStorage<"u"?localStorage:null}catch{return null}}function O2(n,a){const r=bu(a);if(r)try{r.setItem(M0,JSON.stringify(n))}catch{}}function k2(n){const a=bu(n);a==null||a.removeItem(M0),a==null||a.removeItem(C2)}function pm(n){const a=bu(n);if(!a)return{};try{const r=a.getItem(D0);if(!r)return{};const s=JSON.parse(r),o={};for(const[d,h]of Object.entries(s)){const m=T2(h)?h:A2(h);m&&(o[d]=m)}return o}catch{return{}}}function M2(n,a,r){const s=bu(r);if(!s)return;const o=pm(s);o[n]=a;try{s.setItem(D0,JSON.stringify(o))}catch{}}function D2(n,a){const r=pm(a);return n in r?r[n]:null}function R2(n,a){const r=new Set(n);let s=1;for(;r.has(`${a}#${s}`);)s++;return`${a}#${s}`}function Ks(n,a){return R2(n.panels.map(r=>r.id),a)}function gh(n,a){if(a==="main")return;const r=qe(n,a);r.some(s=>Be(s)!=="sidebar-empty")&&r.filter(s=>Be(s)==="sidebar-empty").forEach(s=>s.api.close())}const Ki={left:!1,right:!1,bottom:!1},sa={},fo={},rb=()=>{var n,a;for(const r of["left","right","bottom"])(n=fo[r])==null||n.dismiss("layout"),(a=fo[r])==null||a.dispose(!0)},qh=new WeakSet;typeof document<"u"&&document.addEventListener("contentvisibilityautostatechange",n=>{const a=n.target;n.skipped?qh.add(a):qh.delete(a)},!0);function eu(){const n=typeof document<"u"?document.querySelector(".wb-dockview"):null;if(!n)return()=>{};const a=[],r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:d=>{const h=d,m=h.scrollTop,y=h.scrollLeft;return(m||y)&&a.push({el:h,top:m,left:y}),qh.has(h)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;r.nextNode(););const s=()=>{for(const d of a)d.el.scrollTop!==d.top&&(d.el.scrollTop=d.top),d.el.scrollLeft!==d.left&&(d.el.scrollLeft=d.left)},o=()=>f2(n);return()=>{s(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{s(),o()}):o()}}const sb={left:0,right:0,bottom:0};let vh=!1;const Vh=100;function Vc(n){return n==="left"?"leftVisible":n==="right"?"rightVisible":"bottomVisible"}function gm(n,a){var o;const r=An.getState(),s=h2(n.width,a,{free:r.sideFree[a],saved:r.sideWidths[a],scale:r.sideScale[a]});return r.sideWidths[a]==null?((o=fo[a])==null?void 0:o.defaultWidth)??s:s}function R0(n){return m2(n.height,An.getState().sideWidths.bottom)}function U0(n){var s;const a=()=>{var o;if(!Ki.bottom)try{(o=qe(n,"bottom")[0])==null||o.group.api.setSize({height:R0(n)})}catch{}},r=typeof requestAnimationFrame=="function"?requestAnimationFrame:o=>o();(s=qe(n,"bottom")[0])==null||s.group,a(),r(()=>r(a)),setTimeout(()=>{a()},60)}function L0(n,a,r=!1){var o,d,h;const s=[];for(const m of a){const y=(o=qe(n,m)[0])==null?void 0:o.group;if(!y)continue;const b=(r?y.api.width:0)||gm(n,m);try{(h=(d=y.api).setConstraints)==null||h.call(d,{minimumWidth:b,maximumWidth:b})}catch{}s.push(y)}return()=>{var m,y;for(const b of s)try{(y=(m=b.api).setConstraints)==null||y.call(m,{minimumWidth:0,maximumWidth:Number.MAX_SAFE_INTEGER})}catch{}}}const U2=(n,a)=>L0(n,[a==="left"?"right":"left"]);function ob(n,a,r,s,o,d){var p;if(typeof requestAnimationFrame!="function"||typeof window<"u"&&((p=window.matchMedia)!=null&&p.call(window,"(prefers-reduced-motion: reduce)").matches)){if(d!=null&&d())return;try{n.api.setSize({[a]:s})}catch{}o();return}const h=200,m=g=>1-Math.pow(1-g,3);let y=0;const b=g=>{if(d!=null&&d())return;y||(y=g);const S=Math.min(1,(g-y)/h);try{n.api.setSize({[a]:Math.round(r+(s-r)*m(S))})}catch{}S<1?requestAnimationFrame(b):o()};requestAnimationFrame(b)}function Xs(n){const a=()=>{var o;if(n.width){for(const d of["left","right"])if(!Ki[d])try{(o=qe(n,d)[0])==null||o.group.api.setSize({width:gm(n,d)})}catch{}}},r=typeof requestAnimationFrame=="function"?requestAnimationFrame:s=>s();r(()=>r(a)),setTimeout(()=>{a()},60)}function Be(n){return(n.params??{}).__type||n.component||""}const ho=new Set;function cb(n=An.getState().api){if(n){for(const a of n.panels){if(ho.has(a.id))continue;const r=Ct(Be(a));if(!r)continue;const s=Tn(r.displayName);a.title!==s&&a.api.setTitle(s)}An.getState().refreshTabs()}}function ui(n){const a=n.params??{},{__loc:r,__type:s,...o}=a;return{id:n.id,type:Be(n),loc:r??"main",params:o,setTitle:d=>{ho.add(n.id),n.api.setTitle(d)},setParams:d=>{n.api.updateParameters({...n.params??{},...d}),An.getState().refreshTabs(),Cn()},close:()=>An.getState().closeLeaf(n.id)}}function qe(n,a){return n.panels.filter(r=>(r.params??{}).__loc===a)}const Cr=n=>(n.params??{}).__loc??"main",Yh=n=>n.panels.map(a=>({loc:Cr(a),type:Be(a)}));function jr(n,a){return ou(An.getState().pinned,Yh(n),Cr(a),Be(a))}function L2(n,a,r){const s=n.getPanel(a);return!s||T0(r.group)===Cr(s)||!jr(n,s)}function ub(n,a,r,s,o){const d=Ct(r),h=n.addPanel({id:d!=null&&d.singleton&&!n.getPanel(r)?r:Ks(n,r),component:"__frame",title:d?Tn(d.displayName):r,params:{...s,__loc:"main",__type:r},position:o??{referencePanel:a.id,direction:"within"}});return r==="chat"&&An.setState({focusedChatLeafId:h.id}),Cn(),ui(h)}function $2(n,a){if(a.group.api.location.type!=="grid")return{referencePanel:a.id,direction:"within"};const r=m=>m.element.getBoundingClientRect(),s=m=>{const y=r(m);return y.left+y.width/2},o=r(a.group),d=[...new Set(qe(n,"main").map(m=>m.group))].filter(m=>{if(m.id===a.group.id||m.api.location.type!=="grid")return!1;const y=r(m);return y.width>0&&y.top<o.bottom-1&&y.bottom>o.top+1&&Math.abs(s(m)-s(a.group))>1}),h=d.filter(m=>s(m)>s(a.group)).sort((m,y)=>s(m)-s(y))[0]??d.sort((m,y)=>s(y)-s(m))[0];return h?{referenceGroup:h.id,direction:"within"}:{referencePanel:a.id,direction:"right"}}function yh(n,a,r,s){const o=Ct(r);if(!o)return null;const{focusedChatLeafId:d,refreshTabs:h}=An.getState(),m=a.params??{},y=Be(a)===r,b={};for(const p of Object.keys(m))b[p]=void 0;if(a.api.updateParameters({...b,...s,__loc:m.__loc??"main",__type:r}),ho.delete(a.id),a.api.setTitle(Tn(o.displayName)),a.api.setActive(),r==="chat")An.setState({focusedChatLeafId:a.id});else if(!y&&d===a.id){const p=qe(n,"main").find(g=>g.id!==a.id&&Be(g)==="chat");An.setState({focusedChatLeafId:(p==null?void 0:p.id)??null})}return h(),Cn(),ui(a)}let Qs=null;function $0(n){const a=qe(n,"main"),r=n.activePanel;if(r&&a.some(d=>d.id===r.id))return r;const s=d=>d.group,o=a.filter(d=>{var h,m;return((m=(h=s(d))==null?void 0:h.activePanel)==null?void 0:m.id)===d.id});return o.find(d=>{var h;return((h=s(d))==null?void 0:h.id)===Qs})??o[0]??a[0]??null}function fb(n,a){const r=qe(n,a);if(r.length)return{referencePanel:r[0].id,direction:"within"};if(a==="main")return;const s=a==="bottom"?B2(n):void 0;if(s){try{s.api.setVisible(!0),Ki.bottom||s.api.setConstraints({minimumHeight:Vh})}catch{}return{referenceGroup:s.id,direction:"within"}}return{direction:a==="bottom"?"below":a}}function B2(n){var a;return(a=n.groups)==null?void 0:a.find(r=>r.panels.length===0&&r.api.isVisible===!1)}function Z2(n,a){const r=n.component;r!=null&&r.removePanel?r.removePanel(a,{removeEmptyGroup:!1}):a.api.close()}function db(n,a,r){var s,o;for(const d of r)try{d.group===a?Z2(n,d):d.api.close()}catch{}if(!(!((s=n.groups)!=null&&s.includes(a))||a.panels.length))try{n.activeGroup===a&&((o=$0(n))==null||o.group.api.setActive()),a.api.setVisible(!1)}catch{}}function bh(n,a){const r=a??oo(n),s=eu();Xs(n);try{o2(n,r,An.getState().bottomSpan),qe(n,"bottom").length&&U0(n),setTimeout(()=>{An.getState().api===n&&!Object.values(Ki).some(Boolean)&&hm(n,r)},80)}finally{s()}}let Nr;function Sh(n,a){const r=Nr===void 0?a.sideProfileKey:Nr;return{version:4,...r?{space:r}:{},dockview:a2(n.toJSON(),Object.fromEntries(Object.values(fo).filter(s=>s.previousId).map(s=>[s.id,s.previousId]))),sidebars:{left:{visible:qe(n,"left").some(s=>Be(s)!=="__extend"),stash:a.stash.left},right:{visible:qe(n,"right").some(s=>Be(s)!=="__extend"),stash:a.stash.right},bottom:{visible:qe(n,"bottom").some(s=>Be(s)!=="__extend"),stash:a.stash.bottom}}}}let El=null;const H2=600;function hb(n,a){return n.api!==a||B0(a)!==n.shape?!1:Date.now()<n.settleUntil||r2($h(a),n.metrics)}function B0(n){try{return n.groups.map(a=>a.panels.map(r=>r.id).join(",")).join("|")}catch{return""}}function xh(){var a;const n=El;El=null;try{(a=n==null?void 0:n.dismiss)==null||a.call(n)}catch{}}let Yc=null;function Cn(){Yc&&clearTimeout(Yc),Yc=setTimeout(()=>{Yc=null,An.getState().saveCurrent()},100)}const An=Rr((n,a)=>({api:null,focusedChatLeafId:null,mainTabs:[],leftTabs:[],rightTabs:[],chatSurfaces:{},leftVisible:!0,rightVisible:!0,bottomVisible:!1,stash:{left:[],right:[],bottom:[]},stashActive:{left:null,right:null,bottom:null},sidebarDefaults:{left:[],right:[],bottom:[]},defaultBuilder:null,sideFree:{left:!1,right:!1},sideWidths:{left:null,right:null,bottom:null},sideScale:{left:1,right:1},sideProfileKey:null,bottomSpan:"right",pinned:{},setApi:r=>{var s;(s=r==null?void 0:r.onDidRemovePanel)==null||s.call(r,o=>ho.delete(o.id)),n({api:r})},setDefaultBuilder:r=>n({defaultBuilder:r}),setSidebarDefaults:r=>n({sidebarDefaults:{left:r.left,right:r.right,bottom:r.bottom??[]}}),setSideProfile:(r,s,o,d)=>{let h={left:null,right:null,bottom:null};try{localStorage.removeItem(`lcl.sideWidth.${r}`);const m=localStorage.getItem(`lcl.sideWidth2.${r}`);if(m){const y=JSON.parse(m);h={left:typeof y.left=="number"?y.left:null,right:typeof y.right=="number"?y.right:null,bottom:typeof y.bottomH=="number"?y.bottomH:null}}}catch{}Nr=void 0,n({sideProfileKey:r,sideFree:{left:s.left!==!1,right:s.right!==!1},sideWidths:h,sideScale:{left:(o==null?void 0:o.left)??1,right:(o==null?void 0:o.right)??1},bottomSpan:d??"right",stashActive:{left:null,right:null,bottom:null}})},initializeSidebar:(r,s)=>n(o=>({[Vc(r)]:s,stash:s?o.stash:{...o.stash,[r]:o.sidebarDefaults[r]}})),setFocusedLeaf:r=>{r&&Be(r)==="chat"&&n({focusedChatLeafId:r.id})},registerChatSurface:(r,s)=>n(o=>{const d={...o.chatSurfaces};return s?d[r]=s:delete d[r],{chatSurfaces:d}}),syncPanelState:()=>{const r=a().api;if(!r)return;const s=qe(r,"left").length>0,o=qe(r,"right").length>0,d=qe(r,"bottom").length>0;(s!==a().leftVisible||o!==a().rightVisible||d!==a().bottomVisible)&&n({leftVisible:s,rightVisible:o,bottomVisible:d})},retitleDefaults:()=>cb(a().api),realignRegions:()=>{const r=a().api;r&&bh(r)},setPinned:r=>{n({pinned:r??{}}),a().refreshTabs()},isPinnedLeaf:r=>{const s=a().api,o=s==null?void 0:s.getPanel(r);return!!s&&!!o&&jr(s,o)},ensurePinned:()=>{const r=a().api;if(!r)return;const s=Yh(r),o=h=>a().stash[h].length?a().stash[h]:a().sidebarDefaults[h];for(const h of["left","right"])if(!qe(r,h).length)for(const m of o(h))s.push({loc:h,type:m.type});const d=A0(a().pinned,s,h=>!!Ct(h));if(d.length){for(const h of d){const m=qe(r,h.loc);if(h.loc!=="main"&&!m.length){const b=h.loc;n(p=>({stash:{...p.stash,[b]:[{type:h.type,params:h.params},...o(b)]}}));continue}if(m.length===1&&Be(m[0])==="home"){yh(r,m[0],h.type,h.params);continue}const y=Ct(h.type);r.addPanel({id:y.singleton&&!r.getPanel(h.type)?h.type:Ks(r,h.type),component:h.loc==="main"?"__frame":h.type,title:Tn(y.displayName),params:{...h.params,__loc:h.loc,__type:h.type},position:m.length?{referencePanel:m[0],index:0}:fb(r,h.loc),inactive:m.length>0}),m.filter(b=>Be(b)==="sidebar-empty").forEach(b=>b.api.close())}a().refreshTabs(),Cn()}},refreshTabs:()=>{var j,z;const r=a().api;if(!r){a().mainTabs.length&&n({mainTabs:[]});return}const s=(j=r.activePanel)==null?void 0:j.id;r.activePanel&&(r.activePanel.params??{}).__loc==="main"&&(Qs=((z=r.activePanel.group)==null?void 0:z.id)??null);const o=a().pinned,d=Yh(r),h=qe(r,"main").map(w=>{var oe,I;const N=Be(w),T=w.params??{},L=Ct(N);return{id:w.id,type:N,title:w.title||(L?Tn(L.displayName):N),active:w.id===s,closable:(L==null?void 0:L.closable)!==!1&&!ou(o,d,"main",N),sessionId:typeof T.sessionId=="string"?T.sessionId:void 0,followActive:T.followActive!==!1,filePath:u2(T),front:((I=(oe=w.group)==null?void 0:oe.activePanel)==null?void 0:I.id)===w.id,sig:C0(T)}}),m=a().mainTabs;m.length===h.length&&m.every((w,N)=>w.id===h[N].id&&w.active===h[N].active&&w.title===h[N].title&&w.filePath===h[N].filePath&&w.front===h[N].front&&w.sig===h[N].sig&&w.closable===h[N].closable)||n({mainTabs:h});const b=w=>{const N=w==="left"?a().leftVisible:a().rightVisible,T=(oe,I)=>{const te=Ct(oe),K=N?ou(o,d,w,oe):Fi(o,w,oe);return{type:oe,title:te?Tn(te.displayName):oe,active:I,closable:(te==null?void 0:te.closable)!==!1&&!K}};return N?qe(r,w).map(oe=>{var te;const I=oe.group;return{...T(Be(oe),((te=I==null?void 0:I.activePanel)==null?void 0:te.id)===oe.id),title:oe.title??Be(oe)}}):(a().stash[w].length?a().stash[w]:a().sidebarDefaults[w]).map(oe=>T(oe.type,!1))},p=(w,N)=>w.length===N.length&&w.every((T,L)=>T.type===N[L].type&&T.active===N[L].active&&T.closable===N[L].closable),g=b("left"),S=b("right");p(a().leftTabs,g)||n({leftTabs:g}),p(a().rightTabs,S)||n({rightTabs:S})},activateLeaf:r=>{var o;const s=(o=a().api)==null?void 0:o.getPanel(r);s&&Cr(s),s==null||s.api.setActive(),a().refreshTabs()},closeLeaf:(r,s)=>{const o=a().api,d=o==null?void 0:o.getPanel(r);if(!o||!d)return;if(Be(d)==="__extend"){const p=Object.values(fo).find(g=>(g==null?void 0:g.id)===r);p==null||p.dismiss(),p==null||p.dispose();return}if(Be(d)==="home"||!s&&jr(o,d))return;const h=(d.params??{}).__loc??"main";if(h==="main"&&qe(o,"main").length<=1){Tl.getState().drop(r),yh(o,d,"home",{});return}const m=(h==="left"||h==="right")&&Be(d)!=="sidebar-empty"&&qe(o,h).length<=1,y=h==="bottom"&&qe(o,"bottom").length<=1,b=h==="main"?L0(o,["left","right"],!0):()=>{};y?db(o,d.group,[d]):d.api.close(),m&&a().openView("sidebar-empty",{},h),y&&n(p=>({stash:{...p.stash,bottom:[]},stashActive:{...p.stashActive,bottom:null},bottomVisible:!1})),Tl.getState().drop(r),a().refreshTabs(),setTimeout(b,180)},dropView:(r,s)=>{var p;const o=a().api,d=o==null?void 0:o.getPanel(r);if(!o||!d)return;const h=T0(s.group);if(!L2(o,r,s))return;const m=(d.params??{}).__loc==="main"?((p=d.group)==null?void 0:p.id)??null:null,y={left:qe(o,"left").length,right:qe(o,"right").length,bottom:qe(o,"bottom").length};try{s.mode==="tab"?d.api.moveTo({group:s.group,position:"center",index:s.index}):d.api.moveTo({group:s.group,position:s.dir})}catch{return}d.api.updateParameters({...d.params??{},__loc:h}),m&&h!=="main"&&(Qs=m),qe(o,"main").length===0&&a().openView("home",{},"main");for(const g of["left","right"]){const S=qe(o,g);y[g]>0&&S.length===0?a().openView("sidebar-empty",{},g):S.length>1&&S.filter(j=>Be(j)==="sidebar-empty").forEach(j=>j.api.close())}const b=qe(o,"bottom");y.bottom>0&&b.length===0?n(g=>({stash:{...g.stash,bottom:[]},stashActive:{...g.stashActive,bottom:null},bottomVisible:!1})):b.length>1&&b.filter(g=>Be(g)==="sidebar-empty").forEach(g=>g.api.close()),Xs(o),a().refreshTabs(),Cn()},showSideView:(r,s)=>{const o=a().api;if(!o)return;if(a()[Vc(r)]){const y=qe(o,r).find(b=>{var g;const p=b.group;return((g=p==null?void 0:p.activePanel)==null?void 0:g.id)===b.id});if(y&&Be(y)===s){a().toggleSidebar(r),a().refreshTabs();return}}else a().toggleSidebar(r);const m=qe(a().api,r).find(y=>Be(y)===s);m?m.api.setActive():a().openView(s,{},r),a().refreshTabs()},closeSideView:(r,s)=>{const o=a().api;if(!o)return;const d=qe(o,r).find(h=>Be(h)===s);d&&!jr(o,d)&&d.api.close(),a().refreshTabs()},closeViewsOfType(r,s){const o=a().api;if(o){for(const d of o.panels.filter(h=>Be(h)===r))a().closeLeaf(d.id,s);a().refreshTabs()}},replaceViewsOfType(r,s,o={}){var I,te,K;const d=a().api;if(!d||r===s||!Ct(s))return 0;const h=(I=d.activePanel)==null?void 0:I.id,m=Ct(s);let y=0,b=0,p=!1,g=!0;const S=a().pinned;for(const q of[...d.panels]){if(Be(q)!==r)continue;const H=(q.params??{}).__loc??"main",J=jr(d,q);J&&h===q.id&&(g=!1);const me=H!=="main"||J||Fi(S,"main",s);if(H==="main"&&!(me&&qe(d,"main").some(ie=>ie!==q&&Be(ie)===s))){a().navigateLeaf(q.id,s,o)&&y++;continue}const ae=q.group,ge=qe(d,H).find(ie=>ie!==q&&Be(ie)===s);if(ge){if(Object.keys(o).length&&ge.api.updateParameters({...ge.params??{},...o}),(ae==null?void 0:ae.activePanel)===q&&(ge.api.setActive(),p=!0),J)continue;H==="main"?a().closeLeaf(q.id):d.removePanel(q),y++,b++;continue}const fe=((te=ae==null?void 0:ae.panels)==null?void 0:te.indexOf(q))??-1;d.addPanel({id:m.singleton&&!d.getPanel(s)?s:Ks(d,s),component:s,title:Tn(m.displayName),params:{...o,__loc:H,__type:s},position:{referencePanel:q,...fe>=0?{index:J?fe+1:fe}:{}},inactive:(ae==null?void 0:ae.activePanel)!==q}),J||d.removePanel(q),y++,b++}b&&(a().refreshTabs(),Cn());const j=h?d.getPanel(h):void 0;(y||p)&&j&&g&&(((K=j.group)==null?void 0:K.activePanel)===j?j.group.api.setActive():j.api.setActive());const z=(q,H)=>{if(Fi(S,q,r)||!H.some(ae=>ae.type===r))return H;const J=H.find(ae=>ae.type===s);if(J)return H.filter(ae=>ae.type!==r).map(ae=>ae===J?{...ae,params:{...ae.params??{},...o}}:ae);const me=H.findIndex(ae=>ae.type===r);return H.filter((ae,ge)=>ae.type!==r||ge===me).map(ae=>ae.type===r?{type:s,params:{...o}}:ae)},{stash:w,stashActive:N,sidebarDefaults:T}=a();let L=["left","right","bottom"].reduce((q,H)=>q+(Fi(S,H,r)?0:w[H].filter(J=>J.type===r).length),0);const oe=q=>{const H=w[q],J=H.findIndex(me=>me.type===r);return J<0||!Fi(S,q,r)?H:H.some(me=>me.type===s)?Object.keys(o).length?H.map(me=>me.type===s?{...me,params:{...me.params??{},...o}}:me):H:(L++,[...H.slice(0,J+1),{type:s,params:{...o}},...H.slice(J+1)])};return n({stash:{left:z("left",oe("left")),right:z("right",oe("right")),bottom:z("bottom",w.bottom)},stashActive:Object.fromEntries(["left","right","bottom"].map(q=>[q,N[q]===r?s:N[q]])),sidebarDefaults:{left:z("left",T.left),right:z("right",T.right),bottom:z("bottom",T.bottom)}}),L&&(a().refreshTabs(),Cn()),y+L},remapLeaves(r){var d;for(const h of[...((d=a().api)==null?void 0:d.panels)??[]]){const{__loc:m,__type:y,...b}=h.params??{},p=r(Be(h),b);p===null?a().closeLeaf(h.id,!0):p&&ui(h).setParams(p)}let s=!1;const o=Object.fromEntries(Object.entries(a().stash).map(([h,m])=>[h,m.flatMap(y=>{const b=r(y.type,y.params);return b===void 0?[y]:(s=!0,b===null?[]:[{...y,params:{...y.params,...b}}])})]));s&&(n({stash:o}),a().refreshTabs(),Cn()),a().ensurePinned()},resetLayout(r){var d,h,m;const s=a().api;if(!s)return;let o=null;if(r!=null&&r.undoable)try{o={env:Sh(s,a()),api:s,profile:a().sideProfileKey,owner:Nr,stashActive:{...a().stashActive}}}catch{o=null}xh(),rb();try{s.clear()}catch{}if(k2(),Nr=void 0,Tl.getState().reset(),Qs=null,n({stash:{left:[],right:[],bottom:[]},stashActive:{left:null,right:null,bottom:null},leftVisible:!0,rightVisible:!0,bottomVisible:!1,focusedChatLeafId:null}),(h=(d=a()).defaultBuilder)==null||h.call(d),Cn(),o){const y={...o,shape:B0(s),metrics:$h(s),settleUntil:Date.now()+H2};El=y;const b=(m=mh.notify)==null?void 0:m.call(mh,lb("lcl.layout.restored"),{label:lb("lcl.layout.undo"),run:()=>{a().undoResetLayout()}});typeof b=="function"&&El===y&&(y.dismiss=b)}},noteLayoutChange(){const r=El;if(!r)return;const s=a().api;if(!s||!hb(r,s)){xh();return}Date.now()<r.settleUntil&&(r.metrics=$h(s))},undoResetLayout(){const r=El;El=null;const s=a().api;if(!r||!s||r.profile!==a().sideProfileKey||!hb(r,s))return!1;const o=a().applyLayout(r.env);return o&&(Nr=r.owner,n({stashActive:r.stashActive}),Cn()),o},repinSides:()=>{const r=a().api;r&&Xs(r)},openView(r,s={},o="main",d){const h=a().api;if(!h)return null;const m=Ct(r);if(m!=null&&m.singleton&&!(d!=null&&d.newTab)){const z=s.reuseKey,w=h.panels.find(N=>{if(Be(N)!==r)return!1;if(z===void 0)return!0;const T=N.params??{};return T.reuseKey===z||z==="primary"&&T.reuseKey===void 0&&T.followActive!==!1});if(w)return z==="primary"&&w.api.updateParameters({...w.params??{},...s}),gh(h,Cr(w)),w.api.setActive(),ui(w)}if(o==="main"&&!(d!=null&&d.newTab)){const z=$0(h);if(z&&(d!=null&&d.split))return ub(h,z,r,s,$2(h,z));if(z)return a().navigateLeaf(z.id,r,s)}if(o!=="main"&&!(d!=null&&d.newTab)){const z=qe(h,o).find(w=>Be(w)===r);if(z)return gh(h,o),z.api.setActive(),ui(z)}const y=m!=null&&m.singleton&&!(d!=null&&d.newTab)?r:Ks(h,r),b=m?Tn(m.displayName):r,p=o!=="main"&&qe(h,o).length===0,g=p?oo(h):null,S=p&&!vh?eu():()=>{},j=h.addPanel({id:y,component:o==="main"?"__frame":r,title:b,params:{...s,__loc:o,__type:r},position:fb(h,o)});return p&&(bh(h,g),o==="bottom"&&U0(h),S()),gh(h,o),o!=="main"&&n({[Vc(o)]:!0}),r==="chat"&&n({focusedChatLeafId:j.id}),Cn(),ui(j)},navigateLeaf(r,s,o={}){const d=a().api,h=d==null?void 0:d.getPanel(r);return!d||!h||!Ct(s)?null:Be(h)!==s&&jr(d,h)?Cr(h)==="main"?ub(d,h,s,o):null:yh(d,h,s,o)},getActiveLeaf(){const r=a().api,s=r==null?void 0:r.activePanel;return s?ui(s):null},leafById(r){var o;const s=(o=a().api)==null?void 0:o.getPanel(r);return s?ui(s):null},splitActive(r,s){const o=a().api,d=o==null?void 0:o.activePanel;if(!o||!d)return null;const h=Be(d);if(h==="__extend")return null;const{__loc:m,__type:y,...b}=d.params??{},p=m==="left"||m==="right",g=o.addPanel({id:Ks(o,h),component:m&&m!=="main"?h:"__frame",title:d.title??h,params:{...b,...s,__loc:m??"main",__type:h},position:{referencePanel:d.id,direction:r==="right"&&!p?"right":"below"}});return h==="chat"&&n({focusedChatLeafId:g.id}),Cn(),ui(g)},toggleSidebar(r){var T,L,oe,I,te,K,q,H;const s=a().api;if(!s)return;const o=oo(s),d=r==="bottom",h=d?"height":"width",m=J=>d?J.api.height:J.api.width,y=()=>d?R0(s):gm(s,r),b=(J,me)=>{try{J.api.setSize({[h]:me})}catch{}},p=()=>{d||Xs(s),setTimeout(()=>{w()||hm(s,o)},80)},g=()=>d?()=>{}:U2(s,r),S=Vc(r),j=qe(s,r),z=++sb[r],w=()=>z!==sb[r];if(j.length>0){const J=j.filter(C=>!["sidebar-empty","__extend"].includes(Be(C))).map(C=>{const{__loc:R,__type:B,...ce}=C.params??{};return{type:Be(C),params:ce}}),me=j.find(C=>{var B;const R=C.group;return((B=R==null?void 0:R.activePanel)==null?void 0:B.id)===C.id}),ae=me&&!["sidebar-empty","__extend"].includes(Be(me))?Be(me):a().stashActive[r];j.every(C=>Be(C)==="__extend")&&J.push(...a().stash[r]),n(C=>({stash:{...C.stash,[r]:J},stashActive:{...C.stashActive,[r]:ae},[S]:!1}));const ge=j[0].group;(T=sa[r])==null||T.call(sa);const fe=g(),ie=()=>{fe(),sa[r]===ie&&delete sa[r]};sa[r]=ie;const G=()=>{if(w())return;const C=eu();d?db(s,j[0].group,j):j.forEach(R=>{try{R.api.close()}catch{}}),C(),p(),setTimeout(ie,180),Cn()};if(ge){Ki[r]=!0;try{(oe=(L=ge.api).setConstraints)==null||oe.call(L,d?{minimumHeight:0}:{minimumWidth:0})}catch{}const C=m(ge)??y();ob(ge,h,C,0,()=>{w()||(Ki[r]=!1,G())},w)}else G()}else{const J=ne=>!!Ct(ne.type),me=a().stash[r].filter(J),ae=a().sidebarDefaults[r].filter(J),ge=me.length?me:ae,fe=ge.length?ge:[{type:"sidebar-empty",params:{}}];n({[S]:!0}),Ki[r]=!0,(I=sa[r])==null||I.call(sa);const ie=g(),G=()=>{ie(),sa[r]===G&&delete sa[r]};sa[r]=G;const C=eu();vh=!0;try{fe.forEach(ne=>a().openView(ne.type,ne.params,r))}finally{vh=!1}C();const R=a().stashActive[r]??((te=fe[0])==null?void 0:te.type)??null;if(R){const ne=qe(s,r).find(xe=>Be(xe)===R);ne&&a().activateLeaf(ne.id)}const B=(K=qe(s,r)[0])==null?void 0:K.group,ce=()=>{w()||(Ki[r]=!1,p(),setTimeout(G,180),Cn())};if(B){try{(H=(q=B.api).setConstraints)==null||H.call(q,d?{minimumHeight:0}:{minimumWidth:0})}catch{}b(B,1),ob(B,h,1,y(),()=>{var ne,xe;if(!w()){try{(xe=(ne=B.api).setConstraints)==null||xe.call(ne,d?{minimumHeight:Vh}:{minimumWidth:Vh})}catch{}ce()}},w)}else ce()}},saveCurrent(){const r=a().api;r&&O2(Sh(r,a()))},saveNamed(r){const s=a().api;s&&M2(r,Sh(s,a()))},applyNamed(r){const s=D2(r);return!a().api||!s||N2(s)?!1:(xh(),a().applyLayout(s))},applyLayout(r){var o,d;const s=a().api;if(!s)return!1;try{return V2(r),rb(),ho.clear(),s.fromJSON(r.dockview),bh(s),cb(),Tl.getState().reset(),Qs=null,n({leftVisible:r.sidebars.left.visible,rightVisible:r.sidebars.right.visible,bottomVisible:((o=r.sidebars.bottom)==null?void 0:o.visible)??!1,stash:{left:r.sidebars.left.stash,right:r.sidebars.right.stash,bottom:((d=r.sidebars.bottom)==null?void 0:d.stash)??[]}}),Xs(s),n({mainTabs:[]}),a().refreshTabs(),!0}catch{return!1}},namedLayouts:()=>Object.keys(pm())})),q2={sessions:"workspace",files:"workspace","amadeus-pages":"workspace",toc:"outline","amadeus-outline":"outline","inbox-list":{type:"workspace",params:{mode:"plugin:inbox:messages"}}};function mb(n){const a=n?q2[n]:void 0;return a?typeof a=="string"?{type:a,params:{}}:a:null}function V2(n){var r,s;const a=(r=n.dockview)==null?void 0:r.panels;if(a)for(const o of Object.values(a)){if(!o||typeof o!="object")continue;const d=o.params??(o.params={}),h=mb(d.__type);if(h){d.__type=h.type,o.contentComponent=h.type;const m=d;for(const[y,b]of Object.entries(h.params))m[y]===void 0&&(m[y]=b)}(d.__loc??"main")==="main"&&(o.contentComponent="__frame")}for(const o of["left","right","bottom"]){const d=(s=n.sidebars)==null?void 0:s[o];d&&(d.stash=d.stash.map(h=>{const m=mb(h.type);return m?{...h,type:m.type,params:{...m.params,...h.params??{}}}:h}))}}function Kt(n){return n==="left"?"leftLeaves":n==="right"?"rightLeaves":"mainLeaves"}function wr(n){return n==="left"?"leftActiveId":n==="right"?"rightActiveId":"activeMainId"}function _h(n,a){const r=new Set(a);let s=1;for(;r.has(`${n}#${s}`);)s++;return`${n}#${s}`}function Z0(n){try{const a=new URLSearchParams(location.search).get("window");return a&&a!=="main"?`${n}_${a}`:n}catch{return n}}const Js=Z0("lcl_sc_layout_v1"),Bs=Z0("lcl_sc_named_layouts_v1");function zr(n){try{const a=localStorage.getItem(n);return a?JSON.parse(a):null}catch{return null}}function pb(n,a){if(!t2)try{localStorage.setItem(n,JSON.stringify(a))}catch(r){console.warn("[lcl] 单列布局存盘失败",n,r)}}function vm(n){const a=n;return!!a&&a.v===1&&Array.isArray(a.main)&&Array.isArray(a.left)&&Array.isArray(a.right)}const Y2=n=>typeof(n==null?void 0:n.space)=="string"&&n.space?n.space:null,jh=n=>n.filter(a=>!!a&&typeof a=="object"&&typeof a.id=="string"&&typeof a.type=="string"&&!!a.params&&typeof a.params=="object"&&!!Ct(a.type));let H0=null,cu;const tu=()=>!Ar.getState().mainLeaves.length,I2=()=>{if(tu()){const n=zr(Js);return vm(n)?Y2(n):null}return cu===void 0?H0:cu};function G2(n){var d;if(!vm(n))return!1;const a=jh(n.main);if(a.every(h=>h.type==="home"))return!1;const r=jh(n.left),s=jh(n.right),o=(h,m)=>{var y;return m.some(b=>b.id===h)?h:((y=m[m.length-1])==null?void 0:y.id)??null};return Tl.getState().reset(),Ar.setState({mainLeaves:a,leftLeaves:r,rightLeaves:s,activeMainId:o(n.activeMainId,a),leftActiveId:o(n.leftActiveId,r),rightActiveId:o(n.rightActiveId,s),leftVisible:!1,rightVisible:!1,focusedChatLeafId:((d=a.find(h=>h.type==="chat"))==null?void 0:d.id)??null}),q0(),Ar.getState().refreshTabs(),!0}function q0(){const n=Ar.getState();n.wideMode&&!n.leftVisible&&(n.leftLeaves.length>0||n.sidebarDefaults.left.length>0)&&n.toggleSidebar("left")}function gb(){const n=Ar.getState(),a=s=>{var d,h,m;const o=n[Kt(s)].filter(y=>y.type!=="__extend");return((d=o.find(y=>y.id===n[wr(s)]))==null?void 0:d.id)??((h=o.find(y=>{var b;return y.id===((b=V0[s])==null?void 0:b.previousId)}))==null?void 0:h.id)??((m=o[0])==null?void 0:m.id)??null},r=I2();return{v:1,...r?{space:r}:{},main:n.mainLeaves,left:n.leftLeaves.filter(s=>s.type!=="__extend"),right:n.rightLeaves.filter(s=>s.type!=="__extend"),activeMainId:n.activeMainId,leftActiveId:a("left"),rightActiveId:a("right")}}function F2(){}typeof window<"u"&&window.addEventListener("pagehide",()=>{});const Ar=Rr((n,a)=>{const r=()=>[...a().mainLeaves,...a().leftLeaves,...a().rightLeaves],s=p=>r().find(g=>g.id===p),o=()=>Gi?{}:a().pinned,d=p=>ou(o(),r(),p.loc,p.type),h=p=>({id:p.id,type:p.type,loc:p.loc,get params(){var g;return((g=s(p.id))==null?void 0:g.params)??p.params},setTitle:g=>{const S=s(p.id);!S||S.title===g||(n(j=>({[Kt(p.loc)]:j[Kt(p.loc)].map(z=>z.id===p.id?{...z,title:g}:z)})),a().refreshTabs())},setParams:g=>{const S=s(p.id);if(!S)return;const j={...S.params,...g},z=new Set([...Object.keys(S.params),...Object.keys(j)]);let w=!1;for(const N of z)if(S.params[N]!==j[N]){w=!0;break}w&&(n(N=>({[Kt(p.loc)]:N[Kt(p.loc)].map(T=>T.id===p.id?{...T,params:j}:T)})),a().refreshTabs())},close:()=>a().closeLeaf(p.id)}),m=(p,g)=>{if(n({[wr(p)]:g}),p==="main"){const S=s(g);(S==null?void 0:S.type)==="chat"&&n({focusedChatLeafId:g})}},y=()=>{const p=a(),g={};!p.wideMode&&p.leftVisible&&(g.leftVisible=!1),p.rightVisible&&(g.rightVisible=!1),Object.keys(g).length&&n(g)},b=(p,g,S)=>{const j=Ct(g);if(!j)return null;const z=p.type==="chat",w={...p,type:g,params:{...S},title:Tn(j.displayName)};if(n(N=>({[Kt(p.loc)]:N[Kt(p.loc)].map(T=>T.id===p.id?w:T)})),g==="chat")n({focusedChatLeafId:p.id});else if(z&&a().focusedChatLeafId===p.id){const N=a().mainLeaves.find(T=>T.id!==p.id&&T.type==="chat");n({focusedChatLeafId:(N==null?void 0:N.id)??null})}return p.loc==="main"&&y(),a().refreshTabs(),h(w)};return{api:null,mainLeaves:[],leftLeaves:[],rightLeaves:[],activeMainId:null,leftActiveId:null,rightActiveId:null,leftVisible:!1,rightVisible:!1,wideMode:!1,focusedChatLeafId:null,chatSurfaces:{},sidebarDefaults:{left:[],right:[]},mainTabs:[],leftTabs:[],rightTabs:[],defaultBuilder:null,pinned:{},setPinned:p=>{n({pinned:p??{}}),a().refreshTabs()},isPinnedLeaf:p=>{const g=s(p);return!!g&&d(g)},ensurePinned:()=>{const p=[...r()];for(const S of["left","right"])if(!a()[Kt(S)].length)for(const j of a().sidebarDefaults[S])p.push({loc:S,type:j.type});const g=A0(o(),p,S=>!!Ct(S));if(g.length){for(const S of g){const j=Kt(S.loc),z=a()[j];if(S.loc==="main"&&z.length===1&&z[0].type==="home"){b(z[0],S.type,S.params);continue}const w=Ct(S.type),N={id:w.singleton&&!s(S.type)?S.type:_h(S.type,r().map(T=>T.id)),type:S.type,loc:S.loc,params:S.params,title:Tn(w.displayName)};n({[j]:[N,...z],...z.length?{}:{[wr(S.loc)]:N.id}})}a().refreshTabs()}},setApi:()=>{},setWideMode:p=>n({wideMode:p}),setDefaultBuilder:p=>n({defaultBuilder:p}),setSidebarDefaults:p=>n({sidebarDefaults:p}),setSideProfile:p=>{H0=p,cu=void 0},initializeSidebar:(p,g)=>n({[p==="left"?"leftVisible":"rightVisible"]:g}),registerChatSurface:(p,g)=>n(S=>{const j={...S.chatSurfaces};return g?j[p]=g:delete j[p],{chatSurfaces:j}}),syncPanelState:()=>{},refreshTabs:()=>{const p=a(),g=(j,z)=>{const w=Ct(j.type);return{id:j.id,type:j.type,title:j.title||(w?Tn(w.displayName):j.type),active:z,closable:(w==null?void 0:w.closable)!==!1&&!d(j),sessionId:typeof j.params.sessionId=="string"?j.params.sessionId:void 0,followActive:j.params.followActive!==!1,filePath:typeof j.params.notePath=="string"?j.params.notePath:typeof j.params.path=="string"?j.params.path:void 0,front:z,sig:C0(j.params)}},S=(j,z)=>j.map(w=>{const N=Ct(w.type);return{type:w.type,title:w.title||(N?Tn(N.displayName):w.type),active:w.id===z,closable:(N==null?void 0:N.closable)!==!1&&!d(w)}});n({mainTabs:p.mainLeaves.map(j=>g(j,j.id===p.activeMainId)),leftTabs:S(p.leftLeaves,p.leftActiveId),rightTabs:S(p.rightLeaves,p.rightActiveId)})},openView(p,g={},S="main",j){if(Gi){const N={type:p,params:g};if(!N)return null;p=N.type,g=N.params??{},S="main",j=void 0}const z=Ct(p);if(z!=null&&z.singleton){const N=g.reuseKey,T=r().find(L=>L.type!==p?!1:N===void 0?!0:L.params.reuseKey===N||N==="primary"&&L.params.reuseKey===void 0&&L.params.followActive!==!1);if(T)return z.idParam,(Gi||N==="primary")&&n(L=>({[Kt(T.loc)]:L[Kt(T.loc)].map(oe=>oe.id===T.id?{...oe,params:{...oe.params,...g}}:oe)})),m(T.loc,T.id),T.loc==="main"&&y(),a().refreshTabs(),h(T)}if(S==="main"&&!(j!=null&&j.newTab)&&a().activeMainId)return a().navigateLeaf(a().activeMainId,p,g);if(S!=="main"){const T=a()[Kt(S)].find(L=>L.type===p);if(T)return m(S,T.id),a().refreshTabs(),h(T)}const w={id:z!=null&&z.singleton?p:_h(p,r().map(N=>N.id)),type:p,loc:S,params:g,title:z?Tn(z.displayName):p};return n(N=>({[Kt(S)]:[...N[Kt(S)],w]})),n({[wr(S)]:w.id}),p==="chat"&&n({focusedChatLeafId:w.id}),S==="main"&&y(),a().refreshTabs(),h(w)},navigateLeaf(p,g,S={}){if(Gi){const z={type:g,params:S};if(!z)return null;g=z.type,S=z.params??{}}const j=s(p);return!j||!Ct(g)?null:j.type!==g&&d(j)?j.loc==="main"?a().openView(g,S,"main",{newTab:!0}):null:b(j,g,S)},getActiveLeaf(){const p=a().activeMainId,g=p?s(p):void 0;return g?h(g):null},getActiveSideLeaf(p){const g=p==="left"?a().leftActiveId:a().rightActiveId,S=g?s(g):void 0,j=(p==="left"?a().leftLeaves:a().rightLeaves)[0],z=S??j;return z?h(z):null},leafById(p){const g=s(p);return g?h(g):null},splitActive(p,g){const S=a().activeMainId?s(a().activeMainId):void 0;return S?a().openView(S.type,{...S.params,...g},"main",{newTab:!0}):null},toggleSidebar(p){const g=p==="left"?"leftVisible":"rightVisible";if(a()[g]){n({[g]:!1});return}if(a()[Kt(p)].length===0)for(const z of a().sidebarDefaults[p])a().openView(z.type,z.params,p);n({[g]:!0}),a().refreshTabs()},showSideView(p,g){const S=p==="left"?"leftVisible":"rightVisible";a()[S]||a().toggleSidebar(p);const j=a()[Kt(p)].find(z=>z.type===g);j?m(p,j.id):a().openView(g,{},p),a().refreshTabs()},activateLeaf(p){const g=s(p);g&&(m(g.loc,p),g.loc==="main"&&y(),a().refreshTabs())},closeLeaf(p,g){var N;const S=s(p);if(!S)return;if(S.type==="__extend"){const T=V0[S.loc];T==null||T.dismiss(),T==null||T.dispose();return}if(S.type==="home"||!g&&d(S))return;if(!Gi&&S.loc==="main"&&a().mainLeaves.length<=1){b(S,"home",{});return}const j=Kt(S.loc),z=a()[j].filter(T=>T.id!==p);n({[j]:z}),Tl.getState().drop(p);const w=wr(S.loc);if(a()[w]===p&&n({[w]:((N=z[z.length-1])==null?void 0:N.id)??null}),a().focusedChatLeafId===p){const T=a().mainLeaves.find(L=>L.type==="chat");n({focusedChatLeafId:(T==null?void 0:T.id)??null})}a().refreshTabs()},closeViewsOfType(p,g){for(const S of r().filter(j=>j.type===p))a().closeLeaf(S.id,g)},replaceViewsOfType(p,g,S={}){if(p===g||!Ct(g))return 0;let j=0;const z=Ct(g);for(const T of r().filter(L=>L.type===p)){const L=d(T),oe=Kt(T.loc),te=T.loc!=="main"||L||Fi(o(),"main",g)?a()[oe].find(J=>J.id!==T.id&&J.type===g):void 0,K=a()[wr(T.loc)]===T.id;if(te){Object.keys(S).length&&h(te).setParams(S),K&&m(T.loc,te.id),L||(a().closeLeaf(T.id),j++);continue}if(!L){a().navigateLeaf(T.id,g,S)&&j++;continue}const q=r().map(J=>J.id),H={id:z.singleton&&!q.includes(g)?g:_h(g,q),type:g,loc:T.loc,params:{...S},title:Tn(z.displayName)};n(J=>({[oe]:[...J[oe],H]})),K&&m(T.loc,H.id),j++}a().refreshTabs();const w=(T,L)=>Fi(o(),T,p)?L:L.map(oe=>oe.type===p?{type:g,params:{...S}}:oe),N=a().sidebarDefaults;return n({sidebarDefaults:{left:w("left",N.left),right:w("right",N.right)}}),j},remapLeaves(p){for(const g of r()){const S=p(g.type,g.params);S===null?a().closeLeaf(g.id,!0):S&&h(g).setParams(S)}a().ensurePinned()},resetLayout(){var p,g;if(cu=void 0,n({mainLeaves:[],leftLeaves:[],rightLeaves:[],activeMainId:null,leftActiveId:null,rightActiveId:null,leftVisible:!1,rightVisible:!1,focusedChatLeafId:null}),Tl.getState().reset(),(g=(p=a()).defaultBuilder)==null||g.call(p),q0(),tu()&&!Gi)try{const S=localStorage.getItem(Js);S&&Object.values(zr(Bs)??{}).some(j=>JSON.stringify(j)===S)&&localStorage.removeItem(Js)}catch{}a().refreshTabs()},saveCurrent(){tu()||pb(Js,gb())},saveNamed(p){const g=tu()?zr(Js):gb();if(!vm(g))return;const S=zr(Bs)??{};S[p]=g,pb(Bs,S)},applyNamed(p){return G2((zr(Bs)??{})[p])},namedLayouts(){return Object.keys(zr(Bs)??{})}}});Ar.subscribe(F2);const V0={};function yt(n){return u.jsxs("div",{className:`settings-control-row settings-setting-row${n.className?` ${n.className}`:""}`,"data-setting-anchor":n.anchor,"data-fit":n.fit,children:[u.jsx("div",{className:"settings-control-copy",children:u.jsxs("span",{children:[u.jsx("strong",{children:n.label}),n.description&&u.jsx("small",{children:n.description})]})}),n.control&&u.jsx("div",{className:"settings-row-control",children:n.control}),n.children]})}function Kn(n){return u.jsx("button",{type:"button",role:"switch","aria-checked":n.checked,"aria-label":n.label,className:`settings-switch${n.checked?" active":""}`,disabled:n.disabled,onClick:()=>n.onChange(!n.checked),children:u.jsx("span",{})})}/**
|
|
50
|
+
* @license lucide-react v1.55.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const K2=n=>n==null?void 0:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
55
|
+
* @license lucide-react v1.55.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/function X2(n,a,r=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:K2(n),size:24,node:a,...r.length>0?{aliases:r}:{}}}/**
|
|
60
|
+
* @license lucide-react v1.55.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const Q2=n=>{let a="",r=!1;for(const s of n){if(s==="-"||s==="_"||s<=" "){r=a.length>0;continue}a.length===0?a+=s.toLowerCase():a+=r?s.toUpperCase():s,r=!1}return a};/**
|
|
65
|
+
* @license lucide-react v1.55.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const J2=n=>{const a=Q2(n);return a.charAt(0).toUpperCase()+a.slice(1)};/**
|
|
70
|
+
* @license lucide-react v1.55.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const Ih=(...n)=>n.filter((a,r,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===r).join(" ").trim();/**
|
|
75
|
+
* @license lucide-react v1.55.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const Nl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
80
|
+
* @license lucide-react v1.55.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/function wh(n){return n!=null}function P2(n,a={}){var S,j;const r=a.attributeNames??{},s=z=>r[z]??z,o=n.size??n.width??Nl.width,d=n.size??n.height??Nl.height,h=((S=n.aliases)==null?void 0:S.filter(z=>typeof z=="string"&&z.trim()!=="").map(z=>`lucide-${z}`))??[],m=[...n.name?[`lucide-${n.name}`]:[],...h],y=((j=a.className)==null?void 0:j.split(" ").filter(Boolean))??[],b=a.includeDefaultClasses===!1?Ih(...y):Ih("lucide",...m,...y),p=a.absoluteStrokeWidth?Number(a.strokeWidth??Nl["stroke-width"])*Number(n.size??n.width??Nl.width)/Number(a.size??a.width??Nl.width):a.strokeWidth??Nl["stroke-width"];return["svg",{...Object.entries(Nl).reduce((z,[w,N])=>(z[s(w)]=N,z),{}),..."color"in a&&a.color&&{[s("stroke")]:a.color},..."size"in a&&wh(a.size)&&{[s("width")]:a.size,[s("height")]:a.size},..."width"in a&&wh(a.width)&&{[s("width")]:a.width},..."height"in a&&wh(a.height)&&{[s("height")]:a.height},[s("stroke-width")]:p,...b&&{[s("class")]:b},[s("viewBox")]:`0 0 ${o} ${d}`,...a.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},n.node.map(z=>{const[w,N,T]=z,L=a.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...N}:N;return T?[w,L,T]:[w,L]})]}/**
|
|
85
|
+
* @license lucide-react v1.55.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/function W2(n,a={}){return P2(n,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
90
|
+
* @license lucide-react v1.55.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const ew=n=>{for(const a in n)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},tw=M.createContext({}),nw=()=>M.useContext(tw),aw=M.forwardRef(({color:n,size:a,width:r,height:s,strokeWidth:o,absoluteStrokeWidth:d,nonScalingStroke:h,className:m="",children:y,iconNode:b=[],icon:p={node:b,aliases:[],size:24},...g},S)=>{const{size:j=24,strokeWidth:z=2,absoluteStrokeWidth:w=!1,nonScalingStroke:N=!1,color:T="currentColor",className:L=""}=nw()??{},oe=!!y||ew(g),[I,te,K=[]]=W2(p,{color:n??T,width:r??a??j,height:s??a??j,strokeWidth:o??z,absoluteStrokeWidth:d??w,nonScalingStroke:h??N,className:Ih(L,m),hasA11yProp:oe,attributes:g});return M.createElement(I,{ref:S,...te},[...K.map(([q,H])=>M.createElement(q,H)),...Array.isArray(y)?y:[y]])});/**
|
|
95
|
+
* @license lucide-react v1.55.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/function Fe(n,a=[],r=[]){const s=typeof n=="string"?X2(n,a,r):n,o=M.forwardRef(({className:d,...h},m)=>M.createElement(aw,{ref:m,icon:s,className:d,...h}));return s.name&&(o.displayName=J2(s.name)),o}/**
|
|
100
|
+
* @license lucide-react v1.55.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const Y0={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};Y0.node;const ym=Fe(Y0);/**
|
|
105
|
+
* @license lucide-react v1.55.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const I0={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};I0.node;const iw=Fe(I0);/**
|
|
110
|
+
* @license lucide-react v1.55.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const G0={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};G0.node;const zh=Fe(G0);/**
|
|
115
|
+
* @license lucide-react v1.55.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const F0={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};F0.node;const bm=Fe(F0);/**
|
|
120
|
+
* @license lucide-react v1.55.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const K0={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};K0.node;const Gh=Fe(K0);/**
|
|
125
|
+
* @license lucide-react v1.55.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const X0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};X0.node;const Su=Fe(X0);/**
|
|
130
|
+
* @license lucide-react v1.55.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const Q0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Q0.node;const vb=Fe(Q0);/**
|
|
135
|
+
* @license lucide-react v1.55.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const J0={name:"circle-stop",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],aliases:["stop-circle"]};J0.node;const lw=Fe(J0);/**
|
|
140
|
+
* @license lucide-react v1.55.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const P0={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};P0.node;const yb=Fe(P0);/**
|
|
145
|
+
* @license lucide-react v1.55.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const W0={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};W0.node;const rw=Fe(W0);/**
|
|
150
|
+
* @license lucide-react v1.55.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const e1={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};e1.node;const Ba=Fe(e1);/**
|
|
155
|
+
* @license lucide-react v1.55.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const t1={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};t1.node;const xu=Fe(t1);/**
|
|
160
|
+
* @license lucide-react v1.55.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const n1={name:"highlighter",size:24,node:[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]};n1.node;const a1=Fe(n1);/**
|
|
165
|
+
* @license lucide-react v1.55.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const i1={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};i1.node;const sw=Fe(i1);/**
|
|
170
|
+
* @license lucide-react v1.55.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const l1={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};l1.node;const ow=Fe(l1);/**
|
|
175
|
+
* @license lucide-react v1.55.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const r1={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};r1.node;const s1=Fe(r1);/**
|
|
180
|
+
* @license lucide-react v1.55.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const o1={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};o1.node;const cw=Fe(o1);/**
|
|
185
|
+
* @license lucide-react v1.55.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const c1={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};c1.node;const uw=Fe(c1);/**
|
|
190
|
+
* @license lucide-react v1.55.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const u1={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};u1.node;const fw=Fe(u1);/**
|
|
195
|
+
* @license lucide-react v1.55.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const f1={name:"notebook-pen",size:24,node:[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]};f1.node;const Ps=Fe(f1);/**
|
|
200
|
+
* @license lucide-react v1.55.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const d1={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};d1.node;const dw=Fe(d1);/**
|
|
205
|
+
* @license lucide-react v1.55.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const h1={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};h1.node;const Ws=Fe(h1);/**
|
|
210
|
+
* @license lucide-react v1.55.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const m1={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};m1.node;const p1=Fe(m1);/**
|
|
215
|
+
* @license lucide-react v1.55.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const g1={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};g1.node;const Cl=Fe(g1);/**
|
|
220
|
+
* @license lucide-react v1.55.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const v1={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};v1.node;const no=Fe(v1);/**
|
|
225
|
+
* @license lucide-react v1.55.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const y1={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};y1.node;const b1=Fe(y1);/**
|
|
230
|
+
* @license lucide-react v1.55.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const S1={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};S1.node;const Sm=Fe(S1);/**
|
|
235
|
+
* @license lucide-react v1.55.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const x1={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};x1.node;const Fh=Fe(x1);/**
|
|
240
|
+
* @license lucide-react v1.55.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const _1={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};_1.node;const hw=Fe(_1);/**
|
|
245
|
+
* @license lucide-react v1.55.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const j1={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};j1.node;const Zs=Fe(j1);/**
|
|
250
|
+
* @license lucide-react v1.55.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const w1={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};w1.node;const mw=Fe(w1);/**
|
|
255
|
+
* @license lucide-react v1.55.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const z1={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};z1.node;const pw=Fe(z1);/**
|
|
260
|
+
* @license lucide-react v1.55.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const N1={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};N1.node;const Xi=Fe(N1);/**
|
|
265
|
+
* @license lucide-react v1.55.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const E1={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};E1.node;const C1=Fe(E1);/**
|
|
270
|
+
* @license lucide-react v1.55.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const T1={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};T1.node;const A1=Fe(T1);/**
|
|
275
|
+
* @license lucide-react v1.55.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const O1={name:"wand-sparkles",size:24,node:[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],aliases:["wand-2"]};O1.node;const gw=Fe(O1);/**
|
|
280
|
+
* @license lucide-react v1.55.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const k1={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};k1.node;const Tr=Fe(k1);async function Se(n,a={}){const r=await chrome.runtime.sendMessage({type:"forsion-rpc",method:n,params:a});if(!(r!=null&&r.ok))throw new Error((r==null?void 0:r.error)||"Forsion Clip service unavailable");return r.data}const vw=5e6,M1=1e4;class ba extends Error{constructor(a,r){super(`Vocabulary import ${a}${r?` at row ${r}`:""}`),this.reason=a,this.row=r,this.name="VocabularyTransferError"}}function yw(n,a){const r=n instanceof Error?n.message:String(n),s=/^Vocabulary import (size|csv|empty|row)(?: at row (\d+))?$/.exec(r);if(!s)return;const o=s[2]||"?";return{size:["CSV 不能超过 5 MB 或 10000 条记录。原有生词未修改。","CSV cannot exceed 5 MB or 10,000 records. Existing vocabulary is unchanged."],csv:["CSV 格式无效,请检查引号、分隔符和列数。原有生词未修改。","Invalid CSV. Check quotes, separators, and column counts. Existing vocabulary is unchanged."],empty:["CSV 中没有可导入的词语。","The CSV contains no words to import."],row:[`第 ${o} 条记录格式无效,请检查词语、字段长度、日期和掌握状态。整批未导入。`,`Record ${o} is invalid. Check its word, field lengths, date, and mastery status. No records were imported.`]}[s[1]][a==="zh"?0:1]}function bw(n){if(!Array.isArray(n)||n.length>M1)throw new ba("size");if(!n.length)throw new ba("empty");return n.map((a,r)=>{const s=()=>{throw new ba("row",r+1)};if(!a||typeof a!="object"||Array.isArray(a))return s();const o=a;if(typeof o.word!="string"||!o.word.trim()||o.word.trim().length>300)return s();for(const[d,h]of Object.entries({meaning:2e4,sentence:2e4,url:4096,title:2e3}))if(o[d]!==void 0&&(typeof o[d]!="string"||o[d].length>h))return s();return o.createdAt!==void 0&&(typeof o.createdAt!="string"||o.createdAt.length>64||!Number.isFinite(Date.parse(o.createdAt)))||o.reviewed!==void 0&&typeof o.reviewed!="boolean"?s():{word:o.word.trim(),meaning:o.meaning??"",sentence:o.sentence??"",url:o.url??"",title:o.title??"",...o.createdAt?{createdAt:new Date(o.createdAt).toISOString()}:{},...o.reviewed!==void 0?{reviewed:o.reviewed}:{}}})}function Sw(n){if(n.length>vw)throw new ba("size");n=n.replace(/^\uFEFF/,"");const a=[];let r=[],s="",o=!1,d=!1;const h=()=>{r.push(s),s="",d=!1},m=()=>{if(h(),r.some(y=>y.trim())&&a.push(r),r=[],a.length>M1+1)throw new ba("size")};for(let y=0;y<n.length;y++){const b=n[y];if(o)b==='"'?n[y+1]==='"'?(s+='"',y++):(o=!1,d=!0):s+=b;else if(b===",")h();else if(b===`
|
|
285
|
+
`||b==="\r")b==="\r"&&n[y+1]===`
|
|
286
|
+
`&&y++,m();else if(b==='"'&&!s&&!d)o=!0;else{if(d||b==='"')throw new ba("csv");s+=b}}if(o)throw new ba("csv");return(s||r.length||d)&&m(),a}const xw={word:"word",term:"word",单词:"word",词语:"word",definition:"meaning",meaning:"meaning",释义:"meaning",sentence:"sentence",context:"sentence",句子:"sentence",例句:"sentence",上下文:"sentence",sourceurl:"url",url:"url",来源链接:"url",来源网址:"url",链接:"url",sourcetitle:"title",title:"title",来源标题:"title",来源:"title",标题:"title",createdat:"createdAt",added:"createdAt",添加时间:"createdAt",创建时间:"createdAt",reviewed:"reviewed",mastered:"reviewed",已掌握:"reviewed",掌握状态:"reviewed",forsioncsvescaping:"escaping"},_w=n=>n.trim().toLowerCase().replace(/[\s_-]+/g,""),D1=/^(?:\s*[=+\-@]|[\t\r\n])/,jw=n=>n.startsWith("'")||D1.test(n)?"'"+n:n,ww=n=>n.startsWith("'")&&(n[1]==="'"||D1.test(n.slice(1)))?n.slice(1):n;function zw(n){const a=Sw(n);if(!a.length)throw new ba("empty");const r=a[0].map(m=>xw[_w(m)]),s=r.includes("word")&&r.some(m=>m&&m!=="word"),o=s?r:["word","meaning","sentence","url","title","createdAt"];if(s&&new Set(r.filter(Boolean)).size!==r.filter(Boolean).length)throw new ba("csv");const h=(s?a.slice(1):a).map((m,y)=>{if(m.length>o.length||s&&m.length!==o.length)throw new ba("row",y+1);const b={},p=s&&m[r.indexOf("escaping")]==="apostrophe-v1";return m.forEach((g,S)=>{const j=o[S];if(!j||j==="escaping")return;const z=p?ww(g):g;if(j==="reviewed"){if(!z.trim())return;if(/^(true|1|yes|mastered|已掌握)$/i.test(z.trim()))b.reviewed=!0;else if(/^(false|0|no|learning|学习中)$/i.test(z.trim()))b.reviewed=!1;else throw new ba("row",y+1)}else j==="createdAt"?z.trim()&&(b.createdAt=z.trim()):b[j]=z}),b});return bw(h)}function Nw(n,a){const r=a==="zh"?["词语","释义","例句","来源链接","来源标题","添加时间","已掌握","forsionCsvEscaping"]:["word","definition","sentence","sourceUrl","sourceTitle","createdAt","reviewed","forsionCsvEscaping"],s=o=>`"${jw(o).replace(/"/g,'""')}"`;return"\uFEFF"+[r.join(","),...n.map(o=>[o.word,o.meaning||"",o.sentence,o.url,o.title,o.createdAt,String(o.reviewed),"apostrophe-v1"].map(s).join(","))].join(`\r
|
|
287
|
+
`)+`\r
|
|
288
|
+
`}async function Ew(n,a){const r=await chrome.downloads.download({url:`data:text/csv;charset=utf-8,${encodeURIComponent(Nw(n,a))}`,filename:`${a==="zh"?"生词本":"vocabulary"}-${new Date().toISOString().slice(0,10)}.csv`,saveAs:!0,conflictAction:"uniquify"});if(!Number.isInteger(r))throw new Error(a==="zh"?"无法开始 CSV 下载,请重试。":"Could not start CSV download. Please retry.");return r}function Cw(n,a,r=new Date){const s=new Date(r.getFullYear(),r.getMonth(),r.getDate());return a.time==="week"&&s.setDate(s.getDate()-7),a.time==="month"&&s.setMonth(s.getMonth()-1),Ow(n,a.query,a.mastery).filter(o=>(!a.source||o.title===a.source)&&(!a.time||a.time==="all"||Date.parse(o.createdAt)>=s.getTime())).sort((o,d)=>a.sort==="alphabetical"?o.word.localeCompare(d.word):(a.sort==="oldest"?1:-1)*((Date.parse(o.createdAt)||0)-(Date.parse(d.createdAt)||0)))}const R1={read:{zh:"无法读取生词本,请重试。现有数据未被覆盖。",en:"Could not read vocabulary. Retry; existing data has not been overwritten."},write:{zh:"生词未保存,请检查浏览器存储空间后重试。",en:"Vocabulary was not saved. Check browser storage space and retry."},invalid:{zh:"生词本数据格式异常,已停止修改以保留原始数据。",en:"Vocabulary data is invalid. Changes were stopped to preserve the original data."},full:{zh:"生词本已达到 2000 条,请先导出并移除不需要的词语。",en:"Vocabulary has reached 2,000 words. Export it and remove words you no longer need."},missing:{zh:"该生词已被移除,请刷新列表。",en:"This word has been removed. Refresh the list."},word:{zh:"词语不能为空,且不能超过 300 个字符。",en:"Enter a word of no more than 300 characters."},meaning:{zh:"释义不能超过 20000 个字符。",en:"The meaning cannot exceed 20,000 characters."},sentence:{zh:"例句必须是文本,且不能超过 20000 个字符。",en:"Context must be text of no more than 20,000 characters."},duplicate:{zh:"生词本中已有这个词语,请编辑原有条目。",en:"This word already exists. Edit the existing entry instead."},download:{zh:"无法开始下载,请重试。",en:"Could not start the download. Please retry."}};class Tw extends Error{constructor(a){super(R1[a].en),this.code=a,this.name="VocabularyError"}}function Aw(n,a){const r=n instanceof Error?n.message:String(n),s=Object.values(R1).find(o=>o.en===r);return s?s[a]:r}Promise.resolve();const bb=n=>n.normalize("NFC").trim().toLowerCase();function Ow(n,a="",r="all"){const s=bb(a).split(/\s+/).filter(Boolean);return n.filter(o=>{if(r==="learning"&&o.reviewed||r==="mastered"&&!o.reviewed)return!1;const d=bb([o.word,o.meaning,o.sentence,o.title,o.url].join(`
|
|
289
|
+
`));return s.every(h=>d.includes(h))})}function U1(n){try{const a=new URL(n);return["https:","http:"].includes(a.protocol)&&!a.username&&!a.password?a.href:null}catch{return null}}const Hs=n=>n.replace(/&/g,"&").replace(/\\/g,"\\\\").replace(/[\[\]`*_{}#!|>~]/g,"\\$&").replace(/</g,"<");function kw(n,a="en"){const r=(s,o)=>a==="zh"?s:o;return`# ${r("生词本","Vocabulary")}
|
|
290
|
+
|
|
291
|
+
`+n.map(s=>{const o=U1(s.url),d=Hs(s.sentence).split(/\r?\n/).map(h=>`> ${h}`).join(`
|
|
292
|
+
`);return[`## ${Hs(s.word).replace(/\r?\n/g," ")}`,`**${r("释义","Meaning")}**
|
|
293
|
+
|
|
294
|
+
${Hs(s.meaning||"")||r("尚未填写","Not added yet")}`,d||"",o?`[${Hs(s.title||o).replace(/\r?\n/g," ")}](${o.replace(/[()<>\\\s]/g,h=>encodeURIComponent(h).replace(/\(/g,"%28").replace(/\)/g,"%29"))})`:"",`- ${r("状态:","Status: ")}${s.reviewed?r("已掌握","Mastered"):r("学习中","Learning")}`,`- ${r("添加时间:","Added: ")}${Hs(s.createdAt)}`].filter(Boolean).join(`
|
|
295
|
+
|
|
296
|
+
`)}).join(`
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
`)+`
|
|
301
|
+
`}async function Mw(n,a){try{const r=await chrome.downloads.download({url:`data:text/markdown;charset=utf-8,${encodeURIComponent(kw(n,a))}`,filename:a==="zh"?"生词本.md":"vocabulary.md",saveAs:!0,conflictAction:"uniquify"});if(!Number.isInteger(r))throw new Error("No download ID");return r}catch{throw new Tw("download")}}function Dw({locale:n,words:a,onRefresh:r,run:s}){const o=(re,he)=>n==="zh"?re:he,[d,h]=M.useState(""),[m,y]=M.useState("all"),[b,p]=M.useState("all"),[g,S]=M.useState(""),[j,z]=M.useState("newest"),[w,N]=M.useState(!1),[T,L]=M.useState(null),[oe,I]=M.useState(""),[te,K]=M.useState(""),[q,H]=M.useState(""),[J,me]=M.useState(!1),ae=M.useRef(!1),[ge,fe]=M.useState(null),[ie,G]=M.useState(!1),C=M.useMemo(()=>Cw(a,{query:d,mastery:m,time:b,source:g,sort:j}),[a,d,m,b,g,j]),R=M.useMemo(()=>[...new Set(a.map(re=>re.title).filter(Boolean))].sort(),[a]),B=M.useMemo(()=>{const re=new Set(a.map(ye=>ye.word.normalize("NFC").trim().toLowerCase()));let he=0,de=0;for(const ye of T||[]){const Ve=ye.word.normalize("NFC").trim().toLowerCase();re.has(Ve)?de++:(re.add(Ve),he++)}return{added:he,skipped:de}},[a,T]),ce=C.filter(re=>!re.reviewed),ne=ge?a.find(re=>re.id===ge.ids[ge.index]):void 0,xe=!!ge&&ge.index>=ge.ids.length,Te=M.useRef(null);function Me(){var re;Te.current&&(Te.current.onend=null,Te.current.onerror=null,(re=window.speechSynthesis)==null||re.cancel(),Te.current=null)}M.useEffect(()=>()=>Me(),[]),M.useEffect(()=>{Me(),G(!1)},[ne==null?void 0:ne.id]),M.useEffect(()=>{ge&&!xe&&!ne&&fe(re=>re?{...re,index:re.index+1}:null)},[ge,xe,ne]);const O=async(re,he)=>{if(ae.current)return!1;ae.current=!0,me(!0),K(""),H("");let de=!1;const ye=async()=>{try{await re(),he==null||he(),de=!0}catch(Ve){throw K(yw(Ve,n)||Aw(Ve,n)),Ve}};try{s?await s("vocabulary",ye):await ye()}catch{}finally{ae.current=!1,me(!1)}return de};async function X(re,he){await Se(re,he),await r()}function pe(re){if(K(""),!("speechSynthesis"in window)||!("SpeechSynthesisUtterance"in window)){K(o("此浏览器不支持朗读。","This browser does not support speech playback."));return}Me();try{const he=new window.SpeechSynthesisUtterance(re);he.lang=/[\u3040-\u30ff]/u.test(re)?"ja-JP":/[\u3400-\u9fff]/u.test(re)?"zh-CN":"en-US";const de=window.speechSynthesis.getVoices().filter(Ve=>Ve.lang.split("-")[0]===he.lang.split("-")[0]),ye=de.find(Ve=>Ve.localService)||de[0];ye&&(he.voice=ye),he.onerror=Ve=>{Ve.error!=="canceled"&&Ve.error!=="interrupted"&&K(o("朗读失败,请检查系统语音设置后重试。","Speech playback failed. Check system voice settings and retry.")),Te.current=null},he.onend=()=>{Te.current=null},Te.current=he,window.speechSynthesis.speak(he)}catch{K(o("无法开始朗读。","Could not start speech playback."))}}function ue(){Me(),fe(null),G(!1)}function ze(re){ne&&O(()=>X("vocab-review",{id:ne.id,reviewed:re}),()=>{G(!1),fe(he=>he?{...he,index:he.index+1}:null)})}return u.jsxs("section",{"aria-label":o("生词本","Vocabulary"),children:[u.jsxs("div",{className:"page-heading",style:{flexWrap:"wrap"},children:[u.jsxs("div",{children:[u.jsx("h1",{children:o("生词本","Vocabulary")}),u.jsx("p",{children:o("记录释义,保留上下文,逐词复习。","Add meanings, keep context, and review at your own pace.")})]}),u.jsxs("div",{className:"actions",children:[u.jsxs("button",{type:"button",className:"btn",disabled:J||!!ge,"aria-expanded":w,onClick:()=>N(re=>!re),children:[u.jsx(C1,{size:15}),o("导入 CSV","Import CSV")]}),u.jsxs("button",{type:"button",className:"btn",disabled:J||!C.length,onClick:()=>void O(async()=>{await Ew(C,n),H(o("已开始下载当前筛选结果的 CSV。","CSV download started for the current results."))}),children:[u.jsx(Ba,{size:15}),o("导出筛选结果 CSV","Export results as CSV")]}),u.jsxs("button",{type:"button",className:"btn",disabled:J||!a.length,onClick:()=>void O(async()=>{await Mw(a,n),H(o("下载已开始,请在浏览器中查看进度。","Download started. Check its progress in your browser."))}),children:[u.jsx(Ba,{size:15}),o("导出全部","Export all")]}),!ge&&u.jsxs("button",{type:"button",className:"btn primary",disabled:J||!ce.length,onClick:()=>{fe({ids:ce.map(re=>re.id),index:0}),G(!1),K(""),H("")},children:[u.jsx(Gh,{size:15}),o("复习未掌握","Review unmastered")]})]})]}),te&&u.jsx("p",{role:"alert",className:"failed",style:{marginBottom:14,overflowWrap:"anywhere"},children:te}),q&&u.jsx("p",{role:"status",className:"muted",style:{marginBottom:14},children:q}),w&&!ge&&u.jsxs("section",{className:"vocabulary-import","aria-label":o("CSV 导入","CSV import"),children:[u.jsx("p",{className:"caption",children:o("兼容原插件的中英文 CSV。导入只新增词语,重复词语会跳过;原有释义和复习状态保留。","Accepts the original extension’s Chinese and English CSV files. Only new words are added; duplicates are skipped and existing meanings and review states are preserved.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("选择 CSV 文件","Choose a CSV file")}),u.jsx("input",{type:"file",accept:".csv,text/csv",disabled:J,onChange:re=>{var de;const he=(de=re.currentTarget.files)==null?void 0:de[0];L(null),I(""),he&&O(async()=>{if(he.size>5e6)throw new Error(n==="zh"?"CSV 不能超过 5 MB。":"CSV cannot exceed 5 MB.");const ye=zw(await he.text());L(ye),I(he.name)})}})]}),T&&u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"caption",role:"status",children:[oe," · ",o(`将新增 ${B.added} 条,跳过 ${B.skipped} 条重复记录。`,`${B.added} new words; ${B.skipped} duplicates will be skipped.`)]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"button",className:"btn primary",disabled:J,onClick:()=>void O(async()=>{const re=await Se("vocab-import",{rows:T});await r(),L(null),I(""),N(!1),H(o(`已新增 ${re.added} 条,跳过 ${re.skipped} 条;生词本共 ${re.total} 条。`,`Added ${re.added}, skipped ${re.skipped}; ${re.total} words in vocabulary.`))}),children:o("确认导入","Import words")}),u.jsx("button",{type:"button",className:"btn",disabled:J,onClick:()=>{L(null),I(""),N(!1)},children:o("取消","Cancel")})]})]})]}),ge?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"actions",style:{justifyContent:"space-between"},children:[u.jsxs("span",{className:"caption",children:[o("本轮进度","Session progress")," ",Math.min(ge.index,ge.ids.length)," / ",ge.ids.length]}),u.jsxs("button",{type:"button",className:"btn",disabled:J,onClick:ue,children:[u.jsx(Tr,{size:14}),o("结束复习","End review")]})]}),xe?u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:o("本轮复习完成","Review complete")}),u.jsx("p",{className:"muted",style:{marginBlock:12},children:o("掌握状态已保存。标记为「再练一次」的词语仍会出现在下次复习中。","Your progress is saved. Words marked “Again” remain available for your next review.")}),u.jsx("button",{type:"button",className:"btn",onClick:ue,children:o("返回生词本","Back to vocabulary")})]}):ne&&u.jsxs("article",{className:"card word","aria-label":o("复习卡片","Review card"),children:[u.jsxs("div",{className:"section-title",children:[u.jsx("h2",{className:"grow",style:{overflowWrap:"anywhere"},children:ne.word}),u.jsx("button",{type:"button",className:"btn","aria-label":o("朗读词语","Read word aloud"),onClick:()=>pe(ne.word),children:u.jsx(A1,{size:16})})]}),ie?u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:ne.meaning||o("尚未填写释义,可返回列表编辑。","No meaning yet. Add one in the vocabulary list.")}),ne.sentence&&u.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:ne.sentence}),u.jsx(L1,{word:ne}),u.jsxs("div",{className:"actions",style:{marginTop:20},children:[u.jsx("button",{type:"button",className:"btn",disabled:J,onClick:()=>ze(!1),children:o("再练一次","Again")}),u.jsxs("button",{type:"button",className:"btn primary",disabled:J,onClick:()=>ze(!0),children:[u.jsx(Su,{size:15}),o("已经掌握","Mastered")]})]})]}):u.jsx("button",{type:"button",className:"btn",disabled:J,onClick:()=>G(!0),children:o("显示释义与例句","Show meaning and context")})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"search",style:{maxWidth:"none"},children:[u.jsx(Sm,{size:15}),u.jsx("input",{type:"search","aria-label":o("搜索生词","Search vocabulary"),placeholder:o("搜索词语、释义或例句","Search words, meanings, or context"),value:d,onChange:re=>h(re.target.value)})]}),u.jsxs("div",{className:"vocabulary-filters",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("添加时间","Added")}),u.jsxs("select",{"aria-label":o("按添加时间筛选","Filter by added date"),value:b,onChange:re=>p(re.target.value),children:[u.jsx("option",{value:"all",children:o("全部时间","Any time")}),u.jsx("option",{value:"today",children:o("今天","Today")}),u.jsx("option",{value:"week",children:o("过去一周","Past week")}),u.jsx("option",{value:"month",children:o("过去一个月","Past month")})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("来源","Source")}),u.jsxs("select",{"aria-label":o("按来源筛选","Filter by source"),value:g,onChange:re=>S(re.target.value),children:[u.jsx("option",{value:"",children:o("全部来源","All sources")}),R.map(re=>u.jsx("option",{value:re,children:re},re)),g&&!R.includes(g)&&u.jsx("option",{value:g,children:g})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("排序","Sort")}),u.jsxs("select",{"aria-label":o("生词排序","Sort vocabulary"),value:j,onChange:re=>z(re.target.value),children:[u.jsx("option",{value:"newest",children:o("最新添加","Newest first")}),u.jsx("option",{value:"oldest",children:o("最早添加","Oldest first")}),u.jsx("option",{value:"alphabetical",children:o("字母顺序","Alphabetically")})]})]})]}),u.jsxs("div",{className:"actions",children:[u.jsx("span",{className:"caption",children:o(`显示 ${C.length} / ${a.length} 条`,`Showing ${C.length} of ${a.length}`)}),(d||m!=="all"||b!=="all"||g)&&u.jsx("button",{type:"button",className:"btn",onClick:()=>{h(""),y("all"),p("all"),S("")},children:o("清除筛选","Clear filters")})]}),u.jsx("div",{className:"actions","aria-label":o("掌握状态筛选","Filter by mastery"),children:["all","learning","mastered"].map(re=>u.jsxs("button",{type:"button",className:"btn","aria-pressed":m===re,onClick:()=>y(re),style:m===re?{background:"var(--overlay-medium)"}:void 0,children:[re==="all"?o("全部","All"):re==="learning"?o("学习中","Learning"):o("已掌握","Mastered")," ",re==="all"?a.length:a.filter(he=>re==="mastered"?he.reviewed:!he.reviewed).length]},re))}),!C.length&&u.jsxs("div",{className:"empty",children:[u.jsx(Gh,{size:30}),u.jsx("p",{children:a.length?o("没有符合当前搜索与筛选条件的词语。","No words match your search and filter."):o("在网页中选中词语,点击「加入生词本」。","Select a word on a web page and choose “Add to vocabulary”.")})]}),C.map(re=>u.jsx(Rw,{word:re,locale:n,busy:J,perform:O,mutate:X,speak:pe},re.id))]})]})}function L1({word:n}){const a=U1(n.url);return a?u.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{overflowWrap:"anywhere"},children:n.title||a}):null}function Rw({word:n,locale:a,busy:r,perform:s,mutate:o,speak:d}){const h=(te,K)=>a==="zh"?te:K,[m,y]=M.useState(!1),[b,p]=M.useState(n.word),[g,S]=M.useState(n.meaning||""),[j,z]=M.useState(n.sentence),[w,N]=M.useState(!1),T=M.useRef(null),L=M.useRef(null),oe=b.trim()!==n.word||g.trim()!==(n.meaning||"")||j!==n.sentence;function I(){var te;y(!1),(te=L.current)==null||te.focus()}return u.jsxs("article",{className:"card word","data-word-id":n.id,children:[u.jsxs("div",{className:"section-title",style:{flexWrap:"wrap"},children:[u.jsx("h2",{className:"grow",style:{overflowWrap:"anywhere"},children:n.word}),u.jsx("button",{type:"button",className:"btn","aria-label":h("朗读词语","Read word aloud"),onClick:()=>d(n.word),children:u.jsx(A1,{size:16})}),u.jsx("button",{type:"button",className:"btn",ref:L,"aria-label":h("编辑词语与释义","Edit word and meaning"),disabled:r||m,onClick:()=>{p(n.word),S(n.meaning||""),z(n.sentence),y(!0),N(!1)},children:u.jsx(p1,{size:15})}),u.jsx("button",{type:"button",className:"btn",ref:T,"aria-label":h("移除词语","Remove word"),disabled:r||m,onClick:()=>N(!0),children:u.jsx(Xi,{size:15})})]}),m?u.jsxs("form",{onSubmit:te=>{te.preventDefault(),s(()=>o("vocab-meaning",{id:n.id,meaning:g,word:b,sentence:j}),()=>y(!1))},children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:h("词语","Word")}),u.jsx("input",{value:b,autoFocus:!0,required:!0,maxLength:300,disabled:r,onChange:te=>p(te.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:h("释义","Meaning")}),u.jsx("textarea",{value:g,maxLength:2e4,disabled:r,placeholder:h("填写释义或自己的理解","Add a definition or your own explanation"),onChange:te=>S(te.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:h("例句与上下文","Example and context")}),u.jsx("textarea",{"aria-label":h("例句与上下文","Example and context"),value:j,maxLength:2e4,disabled:r,onChange:te=>z(te.target.value)})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"submit",className:"btn primary",disabled:r||!b.trim()||!oe,children:h("保存","Save")}),u.jsx("button",{type:"button",className:"btn",disabled:r,onClick:I,children:h("取消","Cancel")})]})]}):u.jsx("p",{className:n.meaning?void 0:"muted",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:n.meaning||h("尚未填写释义","No meaning yet")}),n.sentence&&u.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:n.sentence}),u.jsx(L1,{word:n}),u.jsxs("label",{className:"check",children:[u.jsx("input",{type:"checkbox",checked:n.reviewed,disabled:r||m,onChange:te=>void s(()=>o("vocab-review",{id:n.id,reviewed:te.target.checked}))}),h("已经掌握","Mastered")]}),w&&u.jsxs("div",{role:"group","aria-label":h("确认移除词语","Confirm word removal"),children:[u.jsx("p",{className:"muted",style:{marginBottom:8},children:h(`移除「${n.word}」及其释义和例句?此操作无法撤销。`,`Remove “${n.word}” and its meaning and context? This cannot be undone.`)}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"button",className:"btn",disabled:r,autoFocus:!0,onClick:()=>{var te;N(!1),(te=T.current)==null||te.focus()},children:h("取消","Cancel")}),u.jsx("button",{type:"button",className:"btn failed",disabled:r,onClick:()=>void s(()=>o("vocab-remove",{id:n.id})),children:h("确认移除","Confirm removal")})]})]})]})}const Or=[{name:"yellow",hex:"#F8F3DE",label:"重点"},{name:"red",hex:"#FBE3E3",label:"疑问"},{name:"green",hex:"#E1F3E5",label:"启发"},{name:"blue",hex:"#DFEBFB",label:"定义"},{name:"purple",hex:"#EFE4FA",label:"行动"}];function Uw(n){const a=Or.find(r=>r.hex.toLowerCase()===(n||"").toLowerCase());return a&&a.name!=="yellow"?a.label:null}function Kh(n){const a=Object.values(n).filter(s=>typeof s=="number");return Object.entries(n).filter(([s,o])=>a.indexOf(+s)===-1).map(([s,o])=>o)}function Sb(n,a="|"){return n.map(r=>V1(r)).join(a)}function Xh(n,a){return typeof a=="bigint"?a.toString():a}class Lw{constructor(a){this._getter=a,this._value=void 0}get value(){const a=this._getter;return a!==void 0&&(this._value=a(),this._getter=void 0),this._value}}function xm(n){return new Lw(n)}function $w(n){return n==null}function _m(n){const a=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(a,r)}function Bw(n,a){const r=n/a,s=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-s)<o?0:r-s}function Pi(n,a,r){Object.defineProperty(n,a,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $1(n){const a=Object.getOwnPropertyDescriptor(n,"shape");return a!=null&&a.get?a.get.raw:a==null?void 0:a.value}function mi(n){return $1(n._zod.def)??n._zod.def.shape}function B1(n,a,r){Object.defineProperty(n,a,{get(){const s=r();return Pi(this,a,s),s},enumerable:!0,configurable:!0})}function Z1(n,a,r){a in n?Pi(n,a,r):n[a]=r}function Ol(n,a,r,s){const o=mi(a);for(const d of r){const h=Object.getOwnPropertyDescriptor(o,d);h.enumerable&&(h.get?B1(n,d,()=>{const m=a._zod.def.shape[d];return s?s(m,d):m}):Z1(n,d,s?s(h.value,d):h.value))}}function Zw(n,a){for(const r of Reflect.ownKeys(a)){const s=Object.getOwnPropertyDescriptor(a,r);s.enumerable&&(s.get?B1(n,r,()=>a[r]):Z1(n,r,s.value))}}function Xn(...n){const a={};for(const r of n){const s=Object.getOwnPropertyDescriptors(r);Object.assign(a,s)}return Object.defineProperties({},a)}function Hw(n){return JSON.stringify(n)}function qw(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const H1="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function uu(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const Vw=xm(()=>{var n;if(_a.jitless||typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const a=Function;return new a(""),!0}catch{return!1}});function kr(n){if(uu(n)===!1)return!1;const a=n.constructor;if(a===void 0||typeof a!="function")return!0;const r=a.prototype;return!(uu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function q1(n){return kr(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const Yw=new Set(["string","number","symbol"]);function _u(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wi(n,a,r){const s=new n._zod.constr(a??n._zod.def);return(!a||r!=null&&r.parent)&&(s._zod.parent=n),s}function Ce(n){const a=n;if(!a)return{};if(typeof a=="string")return{error:()=>a};if((a==null?void 0:a.message)!==void 0){if((a==null?void 0:a.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function V1(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Iw(n){return Object.keys(n).filter(a=>n[a]._zod.optin!==void 0&&n[a]._zod.optout==="optional")}const Y1={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Gw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Fw(n,a){const r=n._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const d={};return Ol(d,n,ju(n,a)),Wi(n,Xn(r,{shape:d,checks:[]}))}function ju(n,a){var o;const r=mi(n),s=[];for(const d of Reflect.ownKeys(a)){if(!((o=Object.getOwnPropertyDescriptor(r,d))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(d)}"`);a[d]&&s.push(d)}return s}function Kw(n,a){const r=n._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const d=new Set(ju(n,a)),h={};return Ol(h,n,Reflect.ownKeys(mi(n)).filter(m=>!d.has(m))),Wi(n,Xn(r,{shape:h,checks:[]}))}function Xw(n,a){if(!kr(a))throw new Error("Invalid input to extend: expected a plain object");const r=n._zod.def.checks;if(r&&r.length>0){const o=mi(n);for(const d of Reflect.ownKeys(a))if(Object.getOwnPropertyDescriptor(o,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Wi(n,Xn(n._zod.def,{shape:I1(n,a)}))}function I1(n,a){const r={};return Ol(r,n,Reflect.ownKeys(mi(n))),Zw(r,a),r}function Qw(n,a){if(!kr(a))throw new Error("Invalid input to safeExtend: expected a plain object");return Wi(n,Xn(n._zod.def,{shape:I1(n,a)}))}function Jw(n,a){var o,d;if(!((o=a==null?void 0:a._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((d=n._zod.def.checks)!=null&&d.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};Ol(r,n,Reflect.ownKeys(mi(n))),Ol(r,a,Reflect.ownKeys(mi(a)));const s=Xn(n._zod.def,{shape:r,get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Wi(n,s)}function xb(n,a,r,s="partial"){const d=a._zod.def.checks;if(d&&d.length>0)throw new Error(`.${s}() cannot be used on object schemas containing refinements`);const m=r?new Set(ju(a,r)):void 0,y={};return Ol(y,a,Reflect.ownKeys(mi(a)),n&&((b,p)=>m&&!m.has(p)?b:new n({type:"optional",innerType:b}))),Wi(a,Xn(a._zod.def,{shape:y,checks:[]}))}function Pw(n,a,r){const s=r?new Set(ju(a,r)):void 0,o={};return Ol(o,a,Reflect.ownKeys(mi(a)),(d,h)=>s&&!s.has(h)?d:new n({type:"nonoptional",innerType:d})),Wi(a,Xn(a._zod.def,{shape:o}))}function fi(n,a=0){var r;if(n.aborted===!0)return!0;for(let s=a;s<n.issues.length;s++)if(((r=n.issues[s])==null?void 0:r.continue)!==!0)return!0;return!1}function Ww(n,a=0){var r;if(n.aborted===!0)return!0;for(let s=a;s<n.issues.length;s++)if(((r=n.issues[s])==null?void 0:r.continue)===!1)return!0;return!1}function Er(n,a){return a.map(r=>{var s;return(s=r).path??(s.path=[]),r.path.unshift(n),r})}function qs(n){return typeof n=="string"?n:n==null?void 0:n.message}function _b(n){const a=[];for(const r of n??[]){const s=r._zod.def;if(!/_(length|size)$|_equals$/.test(s.check))break;const o=s.maximum??s.length??s.size;o>=0&&a.push([o,r])}return a}function Qh(n,a,r){var s;for(let o=a;o<n.length;o++)(s=n[o]).schema??(s.schema=r)}function Qi(n,a,r){var y,b,p,g,S,j,z,w,N,T;var s;const o=(b=(y=n.inst)==null?void 0:y._zod)==null?void 0:b.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(s=n).schema??(s.schema=n.inst):n.schema=n.inst);const d=n.schema!==n.inst?(g=(p=n.schema)==null?void 0:p._zod.def)==null?void 0:g.error:void 0,h=n.message?n.message:qs((z=(j=(S=n.inst)==null?void 0:S._zod.def)==null?void 0:j.error)==null?void 0:z.call(j,n))??qs(d==null?void 0:d(n))??qs((w=a==null?void 0:a.error)==null?void 0:w.call(a,n))??qs((N=r.customError)==null?void 0:N.call(r,n))??qs((T=r.localeError)==null?void 0:T.call(r,n))??"Invalid input",m={};for(const L of Object.keys(n))L==="inst"||L==="schema"||L==="continue"||L==="input"||L==="__proto__"||(m[L]=n[L]);return m.path??(m.path=[]),m.message=h,a!=null&&a.reportInput&&(m.input=n.input),m}const ez=/[\uD800-\uDBFF]/;function jm(n){const a=n.length;if(!ez.test(n))return a;let r=a;for(let s=0;s<a-1;s++)(n.charCodeAt(s)&64512)===55296&&(n.charCodeAt(s+1)&64512)===56320&&(r--,s++);return r}function wm(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function tz(n){const a=typeof n;switch(a){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";const r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return a}function mo(...n){const[a,r,s]=n;return typeof a=="string"?{message:a,code:"custom",input:r,inst:s}:{...a}}function nz(n,a){for(const r in a){const s=Object.getOwnPropertyDescriptor(a,r);s.get?Object.defineProperty(n,r,{...s,enumerable:!1}):az(n,r,s.value)}}function Ji(n,a,r,s=!0){return Object.defineProperty(n,a,{configurable:!0,writable:!0,enumerable:s,value:r}),r}function G1(n,a,r){return Ji(n,a,r,!1)}function F1(n,a){for(const r in n){const s=n[r];Object.defineProperty(a,r,{configurable:!0,enumerable:!0,get(){return Ji(this,r,s(this))},set(o){Ji(this,r,o)}})}return a}function az(n,a,r){Object.defineProperty(n,a,{configurable:!0,get(){return this==null?r:Ji(this,a,r.bind(this))},set(s){Ji(this,a,s)}})}function iz(n,a){const r=Object.getPrototypeOf(n);return a in r?void 0:r}let Nh,Ii=!1;const lz={configurable:!0,get(){Ii=!0}};function ut(n,a,r){const s=Object.getPrototypeOf(n._zod);if(a in s&&Nh!==n._zod){Nh=void 0;return}Nh=n._zod,Object.defineProperty(s,a,{configurable:!0,get(){Object.defineProperty(this,a,lz);const o=Ii;Ii=!1;try{const d=r(this);return Ii?delete this[a]:Object.defineProperty(this,a,{configurable:!0,writable:!0,value:d}),Ii=Ii||o,d}catch(d){throw delete this[a],Ii=Ii||o,d}},set(o){Object.defineProperty(this,a,{configurable:!0,writable:!0,value:o})}})}function rz(n,a,r,s){const o=iz(n,a);o&&Object.defineProperty(o,a,{configurable:!0,get(){const d={configurable:!0,writable:!0,enumerable:s,value:void 0};return Object.defineProperty(this,a,d),d.value=r(this),Object.defineProperty(this,a,d),d.value},set(d){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:s,value:d})}})}const sz="~constantCatch";function oz(n){const a=()=>n;return a[sz]=!0,a}var jb;const Eh={value:void 0,enumerable:!1};let wb="captureStackTrace"in Error?Error:null;function cz(n){const a=wb;if(a){const r=a.stackTraceLimit;if(typeof r=="number"){try{a.stackTraceLimit=0}catch{return wb=null,new n}try{return new n}finally{a.stackTraceLimit=r}}}return new n}function le(n,a,r,s){const o={};function d(S){this.def=S,this.constr=g,this.traits=new Set}d.prototype=o;const h=r,m=h&&new WeakSet;function y(S,j){if(S._zod){if(S._zod.traits.has(n))return}else{Eh.value=new d(j);try{Object.defineProperty(S,"_zod",Eh)}finally{Eh.value=void 0}}if(S._zod.traits.add(n),a(S,j),m){const w=Object.getPrototypeOf(S),N=S._zod.constr.prototype;let T=w;for(;T&&T!==N;)T=Object.getPrototypeOf(T);const L=T??w;m.has(L)||(m.add(L),nz(L,h))}const z=g.prototype;for(const w in z)Object.prototype.hasOwnProperty.call(z,w)&&(w in S||(S[w]=z[w].bind(S)))}const b=(s==null?void 0:s.Parent)??Object;class p extends b{}Object.defineProperty(p,"name",{value:n});function g(S){var N;const j=s!=null&&s.Parent?cz(p):this;y(j,S);const z=j._zod.deferred;if(z){for(const T of z)T();j._zod.deferred=void 0}const w=(N=globalThis.__zod_globalConfig)==null?void 0:N.postProcessor;return w&&w(j),j}return Object.defineProperty(g,"init",{value:y}),Object.defineProperty(g,Symbol.hasInstance,{value:S=>{var j,z;return s!=null&&s.Parent&&S instanceof s.Parent?!0:(z=(j=S==null?void 0:S._zod)==null?void 0:j.traits)==null?void 0:z.has(n)}}),Object.defineProperty(g,"name",{value:n}),g}class Al extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class K1 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(jb=globalThis).__zod_globalConfig??(jb.__zod_globalConfig={});const _a=globalThis.__zod_globalConfig;function Za(n){return n&&Object.assign(_a,n),_a}function uz(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Xh,2)),n.message}function fz(n){this._zod.message=n}const dz={get:uz,set:fz,enumerable:!0,configurable:!0},Ch={value:void 0,enumerable:!1},zb=new WeakSet([Object.prototype,Error.prototype]),hz=(n,a)=>{n.name="$ZodError",Ch.value=a,Object.defineProperty(n,"issues",Ch),Ch.value=void 0,Object.defineProperty(n,"message",dz);const r=Object.getPrototypeOf(n);zb.has(r)||(zb.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const s=()=>this.message;return Object.defineProperty(this,"toString",{value:s,configurable:!0,writable:!0}),s},set(s){Object.defineProperty(this,"toString",{value:s,configurable:!0,writable:!0})}}))},mz=le("$ZodError",hz);function pz(n,a,r){return Object.prototype.hasOwnProperty.call(n,a)||(a==="__proto__"?Object.defineProperty(n,a,{value:r(),writable:!0,enumerable:!0,configurable:!0}):n[a]=r()),n[a]}function gz(n,a=r=>r.message){const r={},s=[];for(const o of n.issues)o.path.length>0?pz(r,o.path[0],()=>[]).push(a(o)):s.push(a(o));return{formErrors:s,fieldErrors:r}}function vz(n,a=r=>r.message){const r={_errors:[]},s=(o,d=[])=>{for(const h of o.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(m=>s({issues:m},[...d,...h.path]));else if(h.code==="invalid_key")s({issues:h.issues},[...d,...h.path]);else if(h.code==="invalid_element")s({issues:h.issues},[...d,...h.path]);else{const m=[...d,...h.path];if(m.length===0)r._errors.push(a(h));else{let y=r,b=0;for(;b<m.length;){const p=m[b],g=b===m.length-1;if(p==="_errors"){g&&y._errors.push(a(h)),b++;continue}Object.prototype.hasOwnProperty.call(y,p)||Object.defineProperty(y,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const S=y[p];g&&S._errors.push(a(h)),y=S,b++}}}};return s(n),r}function wu(n,a){return{callee:(a==null?void 0:a.callee)??n,Err:a==null?void 0:a.Err}}const zm=n=>{const a=(r,s,o,d)=>{const h=o?{...o,async:!1}:{async:!1},m=r._zod.run({value:s,issues:[]},h);if(m instanceof Promise)throw new Al;if(m.issues.length){const y=new((d==null?void 0:d.Err)??n)(m.issues.map(b=>Qi(b,h,Za())));throw H1(y,(d==null?void 0:d.callee)??a),y}return m.value};return a},Nm=n=>{const a=async(r,s,o,d)=>{const h=o?{...o,async:!0}:{async:!0};let m=r._zod.run({value:s,issues:[]},h);if(m instanceof Promise&&(m=await m),m.issues.length){const y=new((d==null?void 0:d.Err)??n)(m.issues.map(b=>Qi(b,h,Za())));throw H1(y,(d==null?void 0:d.callee)??a),y}return m.value};return a},Em=n=>(a,r,s)=>{const o=s?{...s,async:!1}:{async:!1},d=a._zod.run({value:r,issues:[]},o);if(d instanceof Promise)throw new Al;return d.issues.length?X1(n,d.issues,o):{success:!0,data:d.value}};function X1(n,a,r){let s;return{success:!1,get error(){return s||(s=new n(a.map(o=>Qi(o,r,Za()))),a=void 0,r=void 0),s},set error(o){s=o,a=void 0,r=void 0}}}const Cm=n=>async(a,r,s)=>{const o=s?{...s,async:!0}:{async:!0};let d=a._zod.run({value:r,issues:[]},o);return d instanceof Promise&&(d=await d),d.issues.length?X1(n,d.issues,o):{success:!0,data:d.value}},yz=Symbol.for("zod.compile.invalid"),bz=Symbol.for("zod.compile.fallback"),Sz=((n,a,r)=>{const s=n._zod.bag.validator;if(s!==void 0){if(s(a)!==yz)return!0;if(s.definite===!0&&r===void 0)return!1}return xz(n,a,r)});function xz(n,a,r){const s=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=n._zod.bag.fallbackRun;let d;if(o?(s[bz]=!0,d=o({value:a,issues:[]},s)):d=n._zod.run({value:a,issues:[]},s),d instanceof Promise)throw new Al;return d.issues.length===0}const _z=async(n,a,r)=>{const s=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=n._zod.run({value:a,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length===0},jz=n=>{const a=zm(n),r=(s,o,d,h)=>{const m=d?{...d,direction:"backward"}:{direction:"backward"};return a(s,o,m,wu(r,h))};return r},wz=n=>{const a=zm(n),r=(s,o,d,h)=>a(s,o,d,wu(r,h));return r},zz=n=>{const a=Nm(n),r=async(s,o,d,h)=>{const m=d?{...d,direction:"backward"}:{direction:"backward"};return await a(s,o,m,wu(r,h))};return r},Nz=n=>{const a=Nm(n),r=async(s,o,d,h)=>await a(s,o,d,wu(r,h));return r},Ez=n=>(a,r,s)=>{const o=s?{...s,direction:"backward"}:{direction:"backward"};return Em(n)(a,r,o)},Cz=n=>(a,r,s)=>Em(n)(a,r,s),Tz=n=>async(a,r,s)=>{const o=s?{...s,direction:"backward"}:{direction:"backward"};return Cm(n)(a,r,o)},Az=n=>async(a,r,s)=>Cm(n)(a,r,s),Oz=/^[cC][0-9a-z]{6,}$/,kz=/^[0-9a-z]+$/,Mz=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Dz=/^[0-9a-vA-V]{20}$/,Rz=/^[A-Za-z0-9]{27}$/,Uz=/^[a-zA-Z0-9_-]{21}$/;function Lz(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const $z=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Nb=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Zz=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Hz="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function qz(){return new RegExp(Hz,"u")}const Vz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Iz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Gz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kz=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Xz=/^https?$/,Qz=/^\+[1-9]\d{6,14}$/,Q1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Jz(n){return new RegExp(`^${n}$`)}const Pz=Jz(Q1);function Jh(n){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${a}`:n.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${a}:[0-5]\\d(?:\\.\\d+)?`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wz(n){return new RegExp(`^${Jh(n)}$`)}function eN(n){const a=["Z"];n.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${Jh({precision:n.precision,seconds:!0})}(?:${a.join("|")})`,s=n.local?`${r}|${Jh({precision:n.precision})}`:r;return new RegExp(`^${Q1}T(?:${s})$`)}const tN=/^[\s\S]{0,}$/,nN=/^-?\d+$/,Tm=/^-?\d+(?:\.\d+)?$/,aN=/^(?:true|false)$/i,iN=/^[^A-Z]*$/,lN=/^[^a-z]*$/,On=le("$ZodCheck",(n,a)=>{var r;n._zod??(n._zod={}),n._zod.def=a,(r=n._zod).onattach??(r.onattach=[])}),Am=n=>{const a=n.value;return!$w(a)&&a.length!==void 0},fu={number:"number",bigint:"bigint",object:"date"},J1=le("$ZodCheckLessThan",(n,a)=>{On.init(n,a);const r=fu[typeof a.value];n._zod.check=s=>{(a.inclusive?s.value<=a.value:s.value<a.value)||s.issues.push({origin:fu[typeof s.value]??r,code:"too_big",maximum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:n,continue:!a.abort})}}),P1=le("$ZodCheckGreaterThan",(n,a)=>{On.init(n,a);const r=fu[typeof a.value];n._zod.check=s=>{(a.inclusive?s.value>=a.value:s.value>a.value)||s.issues.push({origin:fu[typeof s.value]??r,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:n,continue:!a.abort})}}),rN=le("$ZodCheckMultipleOf",(n,a)=>{On.init(n,a),n._zod.check=r=>{if(typeof r.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?a.value!==BigInt(0)&&r.value%a.value===BigInt(0):Bw(r.value,a.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:a.value,input:r.value,inst:n,continue:!a.abort})}}),sN=le("$ZodCheckNumberFormat",(n,a)=>{var h;On.init(n,a),a.format=a.format||"float64";const r=(h=a.format)==null?void 0:h.includes("int"),s=r?"int":"number",[o,d]=Y1[a.format];n._zod.check=m=>{const y=m.value;if(r){if(!Number.isInteger(y)){m.issues.push({expected:s,format:a.format,code:"invalid_type",continue:!1,input:y,inst:n});return}if(!Number.isSafeInteger(y)){y>0?m.issues.push({input:y,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort}):m.issues.push({input:y,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort});return}}y<o&&m.issues.push({origin:"number",input:y,code:"too_small",minimum:o,inclusive:!0,inst:n,continue:!a.abort}),y>d&&m.issues.push({origin:"number",input:y,code:"too_big",maximum:d,inclusive:!0,inst:n,continue:!a.abort})}}),oN=le("$ZodCheckMaxLength",(n,a)=>{var r;On.init(n,a),(r=n._zod.def).when??(r.when=Am),n._zod.check=s=>{const o=s.value,d=o.length;if((typeof o=="string"&&d>a.maximum?jm(o):d)<=a.maximum)return;const m=wm(o);s.issues.push({origin:m,code:"too_big",maximum:a.maximum,inclusive:!0,input:o,inst:n,continue:!a.abort})}}),cN=le("$ZodCheckMinLength",(n,a)=>{var r;On.init(n,a),(r=n._zod.def).when??(r.when=Am),n._zod.check=s=>{const o=s.value,d=o.length;if((typeof o=="string"&&d>=a.minimum&&d<a.minimum*2?jm(o):d)>=a.minimum)return;const m=wm(o);s.issues.push({origin:m,code:"too_small",minimum:a.minimum,inclusive:!0,input:o,inst:n,continue:!a.abort})}}),uN=le("$ZodCheckLengthEquals",(n,a)=>{var r;On.init(n,a),(r=n._zod.def).when??(r.when=Am),n._zod.check=s=>{const o=s.value,d=o.length,h=typeof o=="string"&&d>=a.length&&d<=a.length*2?jm(o):d;if(h===a.length)return;const m=wm(o),y=h>a.length;s.issues.push({origin:m,...y?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:s.value,inst:n,continue:!a.abort})}}),zu=le("$ZodCheckStringFormat",(n,a)=>{var r,s;On.init(n,a),a.pattern?(r=n._zod).check??(r.check=o=>{a.pattern.lastIndex=0,!a.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:a.format,input:o.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:n,continue:!a.abort})}):(s=n._zod).check??(s.check=()=>{})}),fN=le("$ZodCheckRegex",(n,a)=>{zu.init(n,a),n._zod.check=r=>{a.pattern.lastIndex=0,!a.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:a.pattern.toString(),inst:n,continue:!a.abort})}}),dN=le("$ZodCheckLowerCase",(n,a)=>{a.pattern??(a.pattern=iN),zu.init(n,a)}),hN=le("$ZodCheckUpperCase",(n,a)=>{a.pattern??(a.pattern=lN),zu.init(n,a)}),mN=le("$ZodCheckIncludes",(n,a)=>{On.init(n,a);const r=_u(a.includes),s=new RegExp(typeof a.position=="number"?`^.{${a.position},}${r}`:r);a.pattern=s,n._zod.check=o=>{o.value.includes(a.includes,a.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:o.value,inst:n,continue:!a.abort})}}),pN=le("$ZodCheckStartsWith",(n,a)=>{On.init(n,a);const r=new RegExp(`^${_u(a.prefix)}.*`);a.pattern??(a.pattern=r),n._zod.check=s=>{s.value.startsWith(a.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:s.value,inst:n,continue:!a.abort})}}),gN=le("$ZodCheckEndsWith",(n,a)=>{On.init(n,a);const r=new RegExp(`.*${_u(a.suffix)}$`);a.pattern??(a.pattern=r),n._zod.check=s=>{s.value.endsWith(a.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:s.value,inst:n,continue:!a.abort})}}),vN=le("$ZodCheckOverwrite",(n,a)=>{On.init(n,a),n._zod.check=r=>{r.value=a.tx(r.value)}});class yN{constructor(a=[],r={}){this.content=[],this.indent=0,this.args=a,this.closed=r}indented(a){this.indent+=1;try{a(this)}finally{this.indent-=1}}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const s=a.split(`
|
|
302
|
+
`).filter(h=>h),o=Math.min(...s.map(h=>h.length-h.trimStart().length)),d=s.map(h=>h.slice(o)).map(h=>" ".repeat(this.indent*2)+h);for(const h of d)this.content.push(h)}compile(){const a=Function,r=(this==null?void 0:this.content)??[""];return new a(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
303
|
+
${r.join(`
|
|
304
|
+
`)}
|
|
305
|
+
};`)(...Object.values(this.closed))}}const bN={major:4,minor:6,patch:7},Tt=le("$ZodType",(n,a)=>{var d;var r;n??(n={}),n._zod.def=a,n._zod.bag=n._zod.bag||{},n._zod.version=bN;const s=n._zod.def.checks,o=n._zod.traits.has("$ZodCheck")?[n,...s??[]]:s!=null&&s.length?[...s]:[];for(const h of o)for(const m of h._zod.onattach)m(n);if(o.length===0)(r=n._zod).deferred??(r.deferred=[]),(d=n._zod.deferred)==null||d.push(()=>{n._zod.run=n._zod.parse});else{const h=(y,b,p)=>{if(y.memo)return y;let g=fi(y),S;for(const j of b){if(j._zod.def.when){if(Ww(y)||!j._zod.def.when(y))continue}else if(g)continue;const z=y.issues.length,w=j._zod.check(y);if(w instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Al;if(S||w instanceof Promise)S=(S??Promise.resolve()).then(async()=>{await w,y.issues.length!==z&&(Qh(y.issues,z,n),g||(g=fi(y,z)))});else{if(y.issues.length===z)continue;Qh(y.issues,z,n),g||(g=fi(y,z))}}return S?S.then(()=>y):y},m=(y,b,p)=>{if(fi(y))return y.aborted=!0,y;const g=h(b,o,p);if(g instanceof Promise){if(p.async===!1)throw new Al;return g.then(S=>n._zod.parse(S,p))}return n._zod.parse(g,p)};n._zod.run=(y,b)=>{if(b.skipChecks)return n._zod.parse(y,b);if(b.direction==="backward"){const g=n._zod.parse({value:y.value,issues:[]},{...b,skipChecks:!0});return g instanceof Promise?g.then(S=>m(S,y,b)):m(g,y,b)}const p=n._zod.parse(y,b);if(p instanceof Promise){if(b.async===!1)throw new Al;return p.then(g=>h(g,o,b))}return h(p,o,b)}}},{get"~standard"(){return G1(this,"~standard",eS(this))},set"~standard"(n){Ji(this,"~standard",n)}}),W1=(n,a)=>n.issues.length?{issues:n.issues.map(r=>Qi(r,a,Za()))}:{value:n.value};async function SN(n,a){const r={async:!0};return W1(await n._zod.run({value:a,issues:[]},r),r)}function eS(n){return{validate:a=>{const r={async:!1};try{const s=n._zod.run({value:a,issues:[]},r);if(!(s instanceof Promise))return W1(s,r)}catch{}return SN(n,a)},vendor:"zod",version:1}}const Om=le("$ZodString",(n,a)=>{Tt.init(n,a),n._zod.pattern=a.pattern??tN,n._zod.parse=(r,s)=>{if(a.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),xt=le("$ZodStringFormat",(n,a)=>{zu.init(n,a),Om.init(n,a)}),xN=le("$ZodGUID",(n,a)=>{a.pattern??(a.pattern=Bz),xt.init(n,a)}),_N=le("$ZodUUID",(n,a)=>{if(a.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(s===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Nb(s))}else a.pattern??(a.pattern=Nb());xt.init(n,a)}),jN=le("$ZodEmail",(n,a)=>{a.pattern??(a.pattern=Zz),xt.init(n,a)}),tS=1,du=2;function nS(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function wN(n,a){return!("normalize"in a)&&!("hostname"in a)&&!("protocol"in a)?nS(n)||du:zN(n,a)}function zN(n,a){var r;if(!a.normalize&&((r=a.protocol)==null?void 0:r.source)===Xz.source&&!/^https?:\/\//i.test(n))return tS;try{if(typeof URL<"u"){const s=URL;if(typeof s.parse=="function")return s.parse(n)??du}return new URL(n)}catch{return du}}const NN=/[\t\n\r]/g;function Eb(n){return n.replace(NN,"")}function EN(n,a){return a.lastIndex=0,a.test(n.hostname)}function CN(n,a){return a.lastIndex=0,a.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const TN=le("$ZodURL",(n,a)=>{xt.init(n,a),n._zod.check=r=>{try{const s=r.value.trim(),o=wN(s,a);if(o===tS){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:n,continue:!a.abort});return}if(o===du){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!a.abort});return}if(o===!0){r.value=Eb(s);return}a.hostname&&!EN(o,a.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:r.value,inst:n,continue:!a.abort}),a.protocol&&!CN(o,a.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:r.value,inst:n,continue:!a.abort}),r.value=a.normalize?o.href:Eb(s);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!a.abort})}}}),AN=le("$ZodEmoji",(n,a)=>{a.pattern??(a.pattern=qz()),xt.init(n,a)}),ON=le("$ZodNanoID",(n,a)=>{if(a.length!==void 0&&(!Number.isInteger(a.length)||a.length<1))throw new Error(`Invalid nanoid length: ${a.length}`);a.pattern??(a.pattern=a.length===void 0?Uz:Lz(a.length)),xt.init(n,a)}),kN=le("$ZodCUID",(n,a)=>{a.pattern??(a.pattern=Oz),xt.init(n,a)}),MN=le("$ZodCUID2",(n,a)=>{a.pattern??(a.pattern=kz),xt.init(n,a)}),DN=le("$ZodULID",(n,a)=>{a.pattern??(a.pattern=Mz),xt.init(n,a)}),RN=le("$ZodXID",(n,a)=>{a.pattern??(a.pattern=Dz),xt.init(n,a)}),UN=le("$ZodKSUID",(n,a)=>{a.pattern??(a.pattern=Rz),xt.init(n,a)}),LN=le("$ZodISODateTime",(n,a)=>{a.pattern??(a.pattern=eN(a)),xt.init(n,a)}),$N=le("$ZodISODate",(n,a)=>{a.pattern??(a.pattern=Pz),xt.init(n,a)}),BN=le("$ZodISOTime",(n,a)=>{a.pattern??(a.pattern=Wz(a)),xt.init(n,a)}),ZN=le("$ZodISODuration",(n,a)=>{a.pattern??(a.pattern=$z),xt.init(n,a)}),HN=le("$ZodIPv4",(n,a)=>{a.pattern??(a.pattern=Vz),xt.init(n,a)}),qN=/^[0-9a-fA-F:.]+$/;function aS(n){return qN.test(n)?nS(`http://[${n}]`):!1}const VN=le("$ZodIPv6",(n,a)=>{a.pattern??(a.pattern=Yz),xt.init(n,a),n._zod.check=r=>{aS(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!a.abort})}}),YN=le("$ZodCIDRv4",(n,a)=>{a.pattern??(a.pattern=Iz),xt.init(n,a)});function IN(n){const a=n.split("/");if(a.length!==2)return!1;const[r,s]=a;if(!s)return!1;const o=Number(s);return`${o}`!==s||o<0||o>128?!1:aS(r)}const GN=le("$ZodCIDRv6",(n,a)=>{a.pattern??(a.pattern=Gz),xt.init(n,a),n._zod.check=r=>{IN(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!a.abort})}});function iS(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const lS=/^[0-9a-zA-Z+/]*={0,2}$/,FN=le("$ZodBase64",(n,a)=>{a.pattern??(a.pattern=lS),xt.init(n,a),n._zod.check=r=>{iS(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!a.abort})}}),km=/^[A-Za-z0-9_-]*$/;function KN(n){if(!km.test(n))return!1;const a=n.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=a.padEnd(Math.ceil(a.length/4)*4,"=");return iS(r)}const XN=le("$ZodBase64URL",(n,a)=>{a.pattern??(a.pattern=km),xt.init(n,a),n._zod.check=r=>{KN(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!a.abort})}}),QN=le("$ZodE164",(n,a)=>{a.pattern??(a.pattern=Qz),xt.init(n,a)});function JN(n,a=null){try{const r=n.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||a&&(!("alg"in o)||o.alg!==a))}catch{return!1}}const PN=le("$ZodJWT",(n,a)=>{xt.init(n,a),n._zod.check=r=>{JN(r.value,a.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!a.abort})}}),rS=le("$ZodNumber",(n,a)=>{Tt.init(n,a),n._zod.pattern=Tm,n._zod.parse=(r,s)=>{if(a.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const d=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:n,...d?{received:d}:{}}),r}}),WN=le("$ZodNumberFormat",(n,a)=>{sN.init(n,a),rS.init(n,a)}),eE=le("$ZodBoolean",(n,a)=>{Tt.init(n,a),n._zod.pattern=aN,n._zod.parse=(r,s)=>{if(a.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:n}),r}}),tE=le("$ZodUnknown",(n,a)=>{Tt.init(n,a),n._zod.parse=r=>r}),nE=le("$ZodNever",(n,a)=>{Tt.init(n,a),n._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)});function aE(n,a){const r=_b(n._zod.def.checks);if(!r.length)return;const s=Math.min(...r.map(d=>d[0])),o=n._zod.parse;n._zod.parse=(d,h)=>{const m=a(d.value);if(m>s&&!(h!=null&&h.skipChecks)&&(h==null?void 0:h.direction)!=="backward"){for(const[y,b]of _b(n._zod.def.checks))if(m>y&&b._zod.def.when(d)){const p=d.issues.length;return b._zod.check(d),d.issues[p].continue=!1,Qh(d.issues,p,n),d}}return o(d,h)}}const iE=n=>Array.isArray(n)?n.length:-1;function Cb(n,a,r){n.issues.length&&a.issues.push(...Er(r,n.issues)),a.value[r]=n.value}const lE=le("$ZodArray",(n,a)=>{Tt.init(n,a);const r=_a.memoizer;r==null||r.attach(n),n._zod.parse=(s,o)=>{const d=s.value;if(!Array.isArray(d))return s.issues.push({expected:"array",code:"invalid_type",input:d,inst:n}),s;s.value=r?r.alloc(n,s,Array(d.length),o):Array(d.length);const h=[],m=o==null?void 0:o.abortEarly;for(let y=0;y<d.length;y++){const b=d[y],p=a.element._zod.run({value:b,issues:[]},o);if(p instanceof Promise)h.push(p.then(g=>Cb(g,s,y)));else if(Cb(p,s,y),m&&p.issues.length!==0&&fi(p))break}return h.length?Promise.all(h).then(()=>s):s},aE(n,iE)});function hu(n,a,r,s,o,d){const h=r in s,m=d==="optional";if(!(!h&&m&&o==="optional")){if(n.issues.length){if(o!==void 0&&m&&!h)return;a.issues.push(...Er(r,n.issues))}if(!h&&o===void 0){n.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}n.value===void 0?(h||o==="defaulted"&&!m)&&(a.value[r]=void 0):a.value[r]=n.value}}const rE=[];function sS(n){var h,m,y,b;const a=Object.keys(n.shape),r=Object.getOwnPropertySymbols(n.shape),s=r.length?r:rE,o=s.length?[...a,...s]:a;for(const p of o)if(!((b=(y=(m=(h=n.shape)==null?void 0:h[p])==null?void 0:m._zod)==null?void 0:y.traits)!=null&&b.has("$ZodType")))throw new Error(`Invalid element at key "${String(p)}": expected a Zod schema`);const d=Iw(n.shape);return{...n,allKeys:o,symbolKeys:s,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(d)}}function oS(n,a,r,s,o,d,h){const m=[],y=o.keySet,b=o.catchall._zod,p=b.def.type,g=b.optin,S=b.optout;let j=0;for(const z in a){if(h&&r.issues.length!==j){if(fi(r,j))break;j=r.issues.length}if(y.has(z))continue;if(z==="__proto__"){p==="never"&&m.push(z);continue}if(p==="never"){m.push(z);continue}const w=b.run({value:a[z],issues:[]},s);w instanceof Promise?n.push(w.then(N=>hu(N,r,z,a,g,S))):hu(w,r,z,a,g,S)}return m.length&&r.issues.push({code:"unrecognized_keys",keys:m,input:a,inst:d,continue:!0}),n.length?Promise.all(n).then(()=>r):r}const sE=le("$ZodObject",(n,a)=>{Tt.init(n,a);const r=Object.getOwnPropertyDescriptor(a,"shape"),s=r!=null&&r.get?r.get.raw:a.shape??{};if(s){const b=()=>{const p={...s};return Object.defineProperty(a,"shape",{value:p}),b.raw=p,p};b.raw=s,Object.defineProperty(a,"shape",{get:b})}const o=xm(()=>sS(a));ut(n,"propValues",b=>{const p=b.def.shape,g={};for(const S in p){const j=p[S]._zod;if(j.values){Object.prototype.hasOwnProperty.call(g,S)||Pi(g,S,new Set);for(const z of j.values)g[S].add(z);j.optin!==void 0&&g[S].add(void 0)}}return g});const d=uu,h=a.catchall;let m;const y=_a.memoizer;y==null||y.attach(n),n._zod.parse=(b,p)=>{m??(m=o.value);const g=b.value;if(!d(g))return b.issues.push({expected:"object",code:"invalid_type",input:g,inst:n}),b;b.value=y?y.alloc(n,b,{},p):{};const S=[],j=m.shape,z=p==null?void 0:p.abortEarly;let w=b.issues.length;for(const N of m.allKeys){if(z&&b.issues.length!==w){if(fi(b,w))break;w=b.issues.length}if(N==="__proto__")continue;const T=j[N],L=T._zod.optin,oe=T._zod.optout,I=T._zod.run({value:g[N],issues:[]},p);I instanceof Promise?S.push(I.then(te=>hu(te,b,N,g,L,oe))):hu(I,b,N,g,L,oe)}return h?oS(S,g,b,p,o.value,n,z===!0):S.length?Promise.all(S).then(()=>b):b}}),oE=le("$ZodObjectJIT",(n,a)=>{sE.init(n,a);const r=n._zod.parse,s=xm(()=>sS(a)),o=_a.memoizer,d=j=>{var te,K;const z=s.value,w=z.symbolKeys,N=new yN(["payload","ctx"],{shape:j,inst:n,memo:o,syms:w}),T=q=>`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`,L=(q,H)=>`
|
|
306
|
+
let ${q}_ab = false;
|
|
307
|
+
for (let i = 0; i < ${q}.issues.length; i++) {
|
|
308
|
+
const iss = ${q}.issues[i];
|
|
309
|
+
iss.path = iss.path ? [${H}, ...iss.path] : [${H}];
|
|
310
|
+
payload.issues.push(iss);
|
|
311
|
+
if (iss.continue !== true) ${q}_ab = true;
|
|
312
|
+
}
|
|
313
|
+
if (${q}_ab && ctx && ctx.abortEarly) {
|
|
314
|
+
payload.value = newResult;
|
|
315
|
+
return payload;
|
|
316
|
+
}`;N.write("const input = payload.value;");const oe=Object.create(null);let I=0;for(const q of z.allKeys)oe[q]=`key_${I++}`;N.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const q of z.allKeys){if(q==="__proto__")continue;const H=oe[q],J=typeof q=="symbol"?`syms[${w.indexOf(q)}]`:Hw(q),me=`${J} in input`,ae=j[q],ge=(te=ae==null?void 0:ae._zod)==null?void 0:te.optin,fe=ge!==void 0,ie=((K=ae==null?void 0:ae._zod)==null?void 0:K.optout)==="optional";if(N.write(`const ${H} = ${T(J)};`),fe&&ie){const G=ge==="optional"?`${H}_present`:`${H}.value !== undefined || ${H}_present`;N.write(`
|
|
317
|
+
const ${H}_present = ${me};
|
|
318
|
+
if (!${H}.issues.length || ${H}_present) {
|
|
319
|
+
if (${H}.issues.length) {${L(H,J)}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (${G}) {
|
|
323
|
+
newResult[${J}] = ${H}.value;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
`)}else fe?(N.write(`
|
|
328
|
+
if (${H}.issues.length) {${L(H,J)}
|
|
329
|
+
}
|
|
330
|
+
`),ge==="defaulted"?N.write(`newResult[${J}] = ${H}.value;`):N.write(`
|
|
331
|
+
if (${H}.value !== undefined || ${me}) {
|
|
332
|
+
newResult[${J}] = ${H}.value;
|
|
333
|
+
}
|
|
334
|
+
`)):N.write(`
|
|
335
|
+
const ${H}_present = ${me};
|
|
336
|
+
if (${H}.issues.length) {${L(H,J)}
|
|
337
|
+
}
|
|
338
|
+
if (!${H}_present && !${H}.issues.length) {
|
|
339
|
+
payload.issues.push({
|
|
340
|
+
code: "invalid_type",
|
|
341
|
+
expected: "nonoptional",
|
|
342
|
+
input: undefined,
|
|
343
|
+
path: [${J}]
|
|
344
|
+
});
|
|
345
|
+
if (ctx && ctx.abortEarly) {
|
|
346
|
+
payload.value = newResult;
|
|
347
|
+
return payload;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (${H}_present) {
|
|
352
|
+
newResult[${J}] = ${H}.value;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
`)}return N.write("payload.value = newResult;"),N.write("return payload;"),N.compile()};let h;const m=uu,y=!_a.jitless,p=y&&Vw.value,g=a.catchall;let S;n._zod.parse=(j,z)=>{S??(S=s.value);const w=j.value;return m(w)?y&&p&&(z==null?void 0:z.async)===!1&&z.jitless!==!0?(h||(h=d(a.shape)),j=h(j,z),g?oS([],w,j,z,S,n,(z==null?void 0:z.abortEarly)===!0):j):r(j,z):(j.issues.push({expected:"object",code:"invalid_type",input:w,inst:n}),j)}});function Tb(n,a,r,s){for(const d of n)if(d.issues.length===0)return a.value=d.value,a;const o=n.filter(d=>!fi(d));return o.length===1?(a.value=o[0].value,o[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:r,errors:n.map(d=>d.issues.map(h=>Qi(h,s,Za())))}),a)}const cE=le("$ZodUnion",(n,a)=>{Tt.init(n,a),ut(n,"optin",s=>s.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":s.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),ut(n,"optout",s=>s.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ut(n,"values",s=>{if(s.def.options.every(o=>o._zod.values))return new Set(s.def.options.flatMap(o=>Array.from(o._zod.values)))}),ut(n,"pattern",s=>{if(s.def.options.every(o=>o._zod.pattern)){const o=s.def.options.map(d=>d._zod.pattern);return new RegExp(`^(${o.map(d=>_m(d.source)).join("|")})$`)}});const r=a.options.length===1?a.options[0]._zod.run:null;n._zod.parse=(s,o)=>{if(r)return r(s,o);let d=!1;const h=[];for(const m of a.options){const y=m._zod.run({value:s.value,issues:[]},o);if(y instanceof Promise)h.push(y),d=!0;else{if(y.issues.length===0)return y;h.push(y)}}return d?Promise.all(h).then(m=>Tb(m,s,n,o)):Tb(h,s,n,o)}}),uE=le("$ZodIntersection",(n,a)=>{Tt.init(n,a),n._zod.parse=(r,s)=>{const o=r.value,d=a.left._zod.run({value:o,issues:[]},s),h=a.right._zod.run({value:o,issues:[]},s);return d instanceof Promise||h instanceof Promise?Promise.all([d,h]).then(([y,b])=>Ab(r,y,b)):Ab(r,d,h)}});function Ph(n,a){if(n===a)return{valid:!0,data:n};if(n instanceof Date&&a instanceof Date&&+n==+a)return{valid:!0,data:n};if(kr(n)&&kr(a)){const r=Object.keys(a),s=Object.keys(n).filter(d=>r.indexOf(d)!==-1),o={...n,...a};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const d of s){if(d==="__proto__")continue;const h=Ph(n[d],a[d]);if(!h.valid)return{valid:!1,mergeErrorPath:[d,...h.mergeErrorPath]};o[d]=h.data}return{valid:!0,data:o}}if(Array.isArray(n)&&Array.isArray(a)){if(n.length!==a.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;s<n.length;s++){const o=n[s],d=a[s],h=Ph(o,d);if(!h.valid)return{valid:!1,mergeErrorPath:[s,...h.mergeErrorPath]};r.push(h.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ab(n,a,r){const s=new Map;let o;const d=new Map,h=(b,p)=>{var S,j;let g;if(b.code==="unrecognized_keys"&&!((S=b.path)!=null&&S.length))o??(o=b),g=b.keys;else if(b.code==="invalid_key"&&b.origin==="record"&&((j=b.path)==null?void 0:j.length)===1){const z=String(b.path[0]);d.has(z)||d.set(z,b),g=[z]}else return!1;for(const z of g)s.has(z)||s.set(z,{}),s.get(z)[p]=!0;return!0};for(const b of a.issues)h(b,"l")||n.issues.push(b);for(const b of r.issues)h(b,"r")||n.issues.push(b);const m=[...s].filter(([,b])=>b.l&&b.r).map(([b])=>b);if(m.length){const b=o?m.filter(p=>o.keys.includes(p)):[];b.length&&n.issues.push({...o,keys:b});for(const p of m)!b.includes(p)&&d.has(p)&&n.issues.push(d.get(p))}const y=Ph(a.value,r.value);if(!y.valid){if(fi(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(y.mergeErrorPath)}`)}return n.value=y.data,n}const fE=le("$ZodRecord",(n,a)=>{Tt.init(n,a);const r=_a.memoizer;r==null||r.attach(n),n._zod.parse=(s,o)=>{const d=s.value;if(!kr(d))return s.issues.push({expected:"record",code:"invalid_type",input:d,inst:n}),s;const h=[],m=a.keyType._zod.values;if(m&&!a.partial){s.value=r?r.alloc(n,s,{},o):{};const y=new Set;for(const p of m)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){if(y.add(typeof p=="number"?p.toString():p),p==="__proto__")continue;const g=a.keyType._zod.run({value:p,issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(g.issues.length){s.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(z=>Qi(z,o,Za())),input:p,path:[p],inst:n});continue}const S=g.value;if(S==="__proto__")continue;const j=a.valueType._zod.run({value:d[p],issues:[]},o);j instanceof Promise?h.push(j.then(z=>{z.issues.length&&s.issues.push(...Er(p,z.issues)),s.value[S]=z.value})):(j.issues.length&&s.issues.push(...Er(p,j.issues)),s.value[S]=j.value)}let b;for(const p in d)if(!y.has(p))if(a.mode==="loose"){if(p==="__proto__")continue;s.value[p]=d[p]}else b=b??[],b.push(p);b&&b.length>0&&s.issues.push({code:"unrecognized_keys",input:d,inst:n,keys:b,continue:!0})}else{s.value=r?r.alloc(n,s,{},o):{};let y;for(const b of Reflect.ownKeys(d)){if(b==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,b))continue;let p=a.keyType._zod.run({value:b,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof b=="string"&&Tm.test(b)&&p.issues.length){const z=a.keyType._zod.run({value:Number(b),issues:[]},o);if(z instanceof Promise)throw new Error("Async schemas not supported in object keys currently");z.issues.length===0&&(p=z)}if(p.issues.length){a.mode==="loose"?s.value[b]=d[b]:m?(y=y??[],y.push(b)):s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(z=>Qi(z,o,Za())),input:b,path:[b],inst:n});continue}const S=p.value;if(S==="__proto__")continue;const j=a.valueType._zod.run({value:d[b],issues:[]},o);j instanceof Promise?h.push(j.then(z=>{z.issues.length&&s.issues.push(...Er(b,z.issues)),s.value[S]=z.value})):(j.issues.length&&s.issues.push(...Er(b,j.issues)),s.value[S]=j.value)}y&&y.length>0&&s.issues.push({code:"unrecognized_keys",input:d,inst:n,keys:y,continue:!0})}return h.length?Promise.all(h).then(()=>s):s}}),dE=le("$ZodEnum",(n,a)=>{Tt.init(n,a);const r=Kh(a.entries),s=new Set(r);n._zod.values=s,ut(n,"pattern",o=>{const d=Kh(o.def.entries).filter(h=>Yw.has(typeof h));return new RegExp(d.length?`^(${d.map(h=>_u(h.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(o,d)=>{const h=o.value;return s.has(h)||o.issues.push({code:"invalid_value",values:r,input:h,inst:n}),o}}),hE=le("$ZodTransform",(n,a)=>{var r;Tt.init(n,a),n._zod.optin="optional",(r=_a.memoizer)==null||r.guard(n),n._zod.parse=(s,o)=>{if(o.direction==="backward")throw new K1(n.constructor.name);const d=a.transform(s.value,s);if(o.async)return(d instanceof Promise?d:Promise.resolve(d)).then(m=>(s.value=m,s));if(d instanceof Promise)throw new Al;return s.value=d,s}});function Ob(n,a){return n.value=a.issues.length?void 0:a.value,n}const cS=le("$ZodOptional",(n,a)=>{Tt.init(n,a),ut(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",ut(n,"values",r=>{const s=r.def.innerType._zod.values;return s?new Set([...s,void 0]):void 0}),ut(n,"pattern",r=>{const s=r.def.innerType._zod.pattern;return s?new RegExp(`^(${_m(s.source)})?$`):void 0}),n._zod.parse=(r,s)=>{if(r.value===void 0){if(a.innerType._zod.optin!=="defaulted")return r;const o=a.innerType._zod.run({value:r.value,issues:[]},s);return o instanceof Promise?o.then(d=>Ob(r,d)):Ob(r,o)}return a.innerType._zod.run(r,s)}}),mE=le("$ZodExactOptional",(n,a)=>{cS.init(n,a),ut(n,"values",r=>r.def.innerType._zod.values),ut(n,"pattern",r=>r.def.innerType._zod.pattern),n._zod.parse=(r,s)=>a.innerType._zod.run(r,s)}),pE=le("$ZodNullable",(n,a)=>{Tt.init(n,a),ut(n,"optin",r=>r.def.innerType._zod.optin),ut(n,"optout",r=>r.def.innerType._zod.optout),ut(n,"pattern",r=>{const s=r.def.innerType._zod.pattern;return s?new RegExp(`^(${_m(s.source)}|null)$`):void 0}),ut(n,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),n._zod.parse=(r,s)=>r.value===null?r:a.innerType._zod.run(r,s)}),gE=le("$ZodDefault",(n,a)=>{Tt.init(n,a),n._zod.optin="defaulted",ut(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);if(r.value===void 0)return r.value=a.defaultValue,r;const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(d=>kb(d,a)):kb(o,a)}});function kb(n,a){return n.value===void 0&&(n.value=a.defaultValue),n}const vE=le("$ZodPrefault",(n,a)=>{Tt.init(n,a),n._zod.optin="defaulted",ut(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,s)=>(s.direction==="backward"||r.value===void 0&&(r.value=a.defaultValue),a.innerType._zod.run(r,s))}),yE=le("$ZodNonOptional",(n,a)=>{Tt.init(n,a),ut(n,"values",r=>{const s=r.def.innerType._zod.values;return s?new Set([...s].filter(o=>o!==void 0)):void 0}),n._zod.parse=(r,s)=>{const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(d=>Mb(d,n)):Mb(o,n)}});function Mb(n,a){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:a}),n}function Db(n,a,r,s){return a.issues.length?(n.value=r.catchValue({...a,value:n.value,error:{issues:a.issues.map(o=>Qi(o,s,Za()))},input:n.value}),n):(n.value=a.value,a.memo&&(n.memo=!0),n)}const bE=le("$ZodCatch",(n,a)=>{Tt.init(n,a),ut(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ut(n,"optout",r=>r.def.innerType._zod.optout),ut(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);const o=a.innerType._zod.run({value:r.value,issues:[]},s);return o instanceof Promise?o.then(d=>Db(r,d,a,s)):Db(r,o,a,s)}}),SE=le("$ZodPipe",(n,a)=>{Tt.init(n,a),ut(n,"values",r=>r.def.in._zod.values),ut(n,"optin",r=>r.def.in._zod.optin),ut(n,"optout",r=>r.def.out._zod.optout),ut(n,"propValues",r=>r.def.in._zod.propValues),n._zod.parse=(r,s)=>{if(s.direction==="backward"){const d=a.out._zod.run(r,s);return d instanceof Promise?d.then(h=>Ic(h,a.in,s)):Ic(d,a.in,s)}const o=a.in._zod.run(r,s);return o instanceof Promise?o.then(d=>Ic(d,a.out,s)):Ic(o,a.out,s)}});function Ic(n,a,r){return n.issues.some(s=>s.code!=="unrecognized_keys")?(n.aborted=!0,n):a._zod.run({value:n.value,issues:n.issues},r)}const xE=le("$ZodReadonly",(n,a)=>{Tt.init(n,a),ut(n,"propValues",r=>r.def.innerType._zod.propValues),ut(n,"values",r=>r.def.innerType._zod.values),ut(n,"optin",r=>{var s,o;return(o=(s=r.def.innerType)==null?void 0:s._zod)==null?void 0:o.optin}),ut(n,"optout",r=>{var s,o;return(o=(s=r.def.innerType)==null?void 0:s._zod)==null?void 0:o.optout}),n._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(Rb):Rb(o)}});function Rb(n){return n.memo||(n.value=Object.freeze(n.value)),n}const _E=le("$ZodCustom",(n,a)=>{On.init(n,a),Tt.init(n,a),n._zod.parse=(r,s)=>r,n._zod.check=r=>{const s=r.value,o=a.fn(s);if(o instanceof Promise)return o.then(d=>Ub(d,r,s,n));Ub(o,r,s,n)}});function Ub(n,a,r,s){if(!n){const o={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(o.params=s._zod.def.params),a.issues.push(mo(o))}}class jE extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Wh="~memo",Lb=[];function uS(n){return n!==null&&typeof n=="object"}function Th(n){return n.map(a=>a.path?{...a,path:a.path.slice()}:{...a})}const fS=new WeakMap,eo=0,nu=1,ao=2;function au(n,a,r){const s=fS.get(n);if(s!==void 0)return s?ao:eo;if(a.has(n))return ao;a.add(n);let o=eo;const d=p=>{if(o!==ao&&(p!=null&&p._zod)){const g=au(p,a);g>o&&(o=g)}},h=(p,g)=>{var j;let S=eo;for(const z of Reflect.ownKeys(p)){const w=Object.getOwnPropertyDescriptor(p,z);if(!w.enumerable)continue;const N=w.get?nu:(j=w.value)!=null&&j._zod?au(w.value,a):eo;N>S&&(S=N)}return S},m=p=>{p>o&&(o=p)},y=n._zod.def;switch(y.type){case"object":{const p=$1(y);m(p?h(p):nu),d(y.catchall);break}case"array":d(y.element);break;case"tuple":for(const p of y.items)d(p);d(y.rest);break;case"record":case"map":d(y.keyType),d(y.valueType);break;case"set":d(y.valueType);break;case"union":for(const p of y.options)d(p);break;case"intersection":d(y.left),d(y.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":d(y.innerType);break;case"pipe":d(y.in),d(y.out);break;case"function":d(y.input),d(y.output);break;case"lazy":{const p=y._cachedInner??void 0;m(p?au(p,a):nu);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const p in y){const g=Object.getOwnPropertyDescriptor(y,p);if(!g||g.get)continue;const S=g.value;if(!(!S||typeof S!="object")){if(S._zod)d(S);else if(Array.isArray(S))for(const j of S)d(j)}}}return a.delete(n),wE(n,o)}function wE(n,a){return a!==nu&&fS.set(n,a===ao),a}function zE(n,a){let r=n.buckets.get(a);return r||(r=new WeakMap,n.buckets.set(a,r)),r}let Gc;const Fc=[],NE={alloc(n,a,r){const s=Gc;if(!s)return r;Gc=void 0;const o={value:r,issues:null};return s.set(a.value,o),Fc.push(o),r},guard(n){var a;(a=n._zod).deferred??(a.deferred=[]),n._zod.deferred.push(()=>{const r=n._zod.parse,s=(o,d)=>{if(d.direction!=="backward"&&CE(d,o.value))throw new jE;return r(o,d)};n._zod.parse=s,n._zod.run===r&&(n._zod.run=s)})},attach(n){var a;let r,s=!1,o,d;(a=n._zod).deferred??(a.deferred=[]),n._zod.deferred.push(()=>{const h=n._zod.parse,m=(y,b)=>{if(r===void 0){const T=au(n,new Set);if(T===eo)return n._zod.parse=h,n._zod.run===m&&(n._zod.run=h),h(y,b);T===ao||s?r=!0:s=!0}const p=y.value;if(!uS(p))return h(y,b);let g=b[Wh];g||(g={buckets:new WeakMap,backEdges:void 0},b[Wh]=g);let S;o===b?S=d:(S=zE(g,n),o=b,d=S);const j=S.get(p);if(j)return y.value=j.value,j.issues?j.issues.length&&y.issues.push(...Th(j.issues)):(y.memo=!0,g.backEdges??(g.backEdges=new WeakSet),g.backEdges.add(j.value)),y;Gc=S;const z=Fc.length,w=h(y,b);Gc=void 0;const N=Fc.length>z?Fc.pop():void 0;return w instanceof Promise?w.then(T=>(N&&(N.issues=T.issues.length?Th(T.issues):Lb),T)):(N&&(N.issues=w.issues.length?Th(w.issues):Lb),w)};n._zod.parse=m,n._zod.run===h&&(n._zod.run=m)})}};function EE(){return NE}function CE(n,a){var s;const r=(s=n[Wh])==null?void 0:s.backEdges;return r!==void 0&&uS(a)&&r.has(a)}const TE=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function a(d){return n[d]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},s={nan:"NaN"};function o(d,h){return d==="number"&&typeof h=="number"&&!Number.isFinite(h)?String(h):s[d]??d}return d=>{switch(d.code){case"invalid_type":{const h=o(d.expected),m=tz(d.input),y=o(m,d.input);return`Invalid input: expected ${h}, received ${y}`}case"invalid_value":return d.values.length===1?`Invalid input: expected ${V1(d.values[0])}`:`Invalid option: expected one of ${Sb(d.values,"|")}`;case"too_big":{const h=d.exact?"exactly ":d.inclusive?"<=":"<",m=a(d.origin);return m?`Too big: expected ${d.origin??"value"} to have ${h}${d.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${d.origin??"value"} to be ${h}${d.maximum.toString()}`}case"too_small":{const h=d.exact?"exactly ":d.inclusive?">=":">",m=a(d.origin);return m?`Too small: expected ${d.origin} to have ${h}${d.minimum.toString()} ${m.unit}`:`Too small: expected ${d.origin} to be ${h}${d.minimum.toString()}`}case"invalid_format":{const h=d;return h.format==="starts_with"?`Invalid string: must start with "${h.prefix}"`:h.format==="ends_with"?`Invalid string: must end with "${h.suffix}"`:h.format==="includes"?`Invalid string: must include "${h.includes}"`:h.format==="regex"?`Invalid string: must match pattern ${h.pattern}`:`Invalid ${r[h.format]??d.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${d.divisor}`;case"unrecognized_keys":return`Unrecognized key${d.keys.length>1?"s":""}: ${Sb(d.keys,", ")}`;case"invalid_key":return`Invalid key in ${d.origin}`;case"invalid_union":return d.options&&Array.isArray(d.options)&&d.options.length>0?`Invalid discriminator value. Expected ${d.options.map(m=>`'${m}'`).join(" | ")}`:d.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${d.origin}`;default:return"Invalid input"}}};function AE(){return{localeError:TE()}}var $b;class OE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...r){const s=r[0];return this._map.set(a,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const r=this._map.get(a);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(a),this}get(a){const r=a._zod.parent;if(r){const s={...this.get(r)??{}};delete s.id;const o={...s,...this._map.get(a)};return Object.keys(o).length?o:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function kE(){return new OE}($b=globalThis).__zod_globalRegistry??($b.__zod_globalRegistry=kE());const to=globalThis.__zod_globalRegistry;function dS(n){return n.checks&&(n.checks=[...n.checks]),n}function ME(n,a){return new n(dS({type:"string",...Ce(a)}))}function DE(n,a){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ce(a)})}function RE(n,a){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(a)})}function UE(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(a)})}function LE(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(a)})}function $E(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(a)})}function BE(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(a)})}function ZE(n,a){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ce(a)})}function HE(n,a){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(a)})}function qE(n,a){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(a)})}function VE(n,a){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(a)})}function YE(n,a){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(a)})}function IE(n,a){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(a)})}function GE(n,a){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(a)})}function FE(n,a){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(a)})}function KE(n,a){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(a)})}function XE(n,a){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(a)})}function QE(n,a){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(a)})}function JE(n,a){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(a)})}function PE(n,a){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(a)})}function WE(n,a){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(a)})}function eC(n,a){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(a)})}function tC(n,a){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(a)})}function nC(n,a){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(a)})}function aC(n,a){return new n({type:"string",format:"date",check:"string_format",...Ce(a)})}function iC(n,a){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ce(a)})}function lC(n,a){return new n({type:"string",format:"duration",check:"string_format",...Ce(a)})}function rC(n,a){return new n(dS({type:"number",checks:[],...Ce(a)}))}function sC(n,a){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(a)})}function oC(n,a){return new n({type:"boolean",...Ce(a)})}function cC(n){return new n({type:"unknown"})}function uC(n,a){return new n({type:"never",...Ce(a)})}function Bb(n,a){return new J1({check:"less_than",...Ce(a),value:n,inclusive:!1})}function Ah(n,a){return new J1({check:"less_than",...Ce(a),value:n,inclusive:!0})}function Zb(n,a){return new P1({check:"greater_than",...Ce(a),value:n,inclusive:!1})}function Oh(n,a){return new P1({check:"greater_than",...Ce(a),value:n,inclusive:!0})}function Hb(n,a){return new rN({check:"multiple_of",...Ce(a),value:n})}function hS(n,a){return new oN({check:"max_length",...Ce(a),maximum:n})}function mu(n,a){return new cN({check:"min_length",...Ce(a),minimum:n})}function mS(n,a){return new uN({check:"length_equals",...Ce(a),length:n})}function fC(n,a){return new fN({check:"string_format",format:"regex",...Ce(a),pattern:n})}function dC(n){return new dN({check:"string_format",format:"lowercase",...Ce(n)})}function hC(n){return new hN({check:"string_format",format:"uppercase",...Ce(n)})}function mC(n,a){return new mN({check:"string_format",format:"includes",...Ce(a),includes:n})}function pC(n,a){return new pN({check:"string_format",format:"starts_with",...Ce(a),prefix:n})}function gC(n,a){return new gN({check:"string_format",format:"ends_with",...Ce(a),suffix:n})}function Ur(n){return new vN({check:"overwrite",tx:n})}function vC(n){return Ur(a=>a.normalize(n))}function yC(){return Ur(n=>n.trim())}function bC(){return Ur(n=>n.toLowerCase())}function SC(){return Ur(n=>n.toUpperCase())}function xC(){return Ur(n=>qw(n))}function _C(n,a,r){return new n({type:"array",element:a,...Ce(r)})}function jC(n,a,r){return new n({type:"custom",check:"custom",fn:a,...Ce(r)})}function wC(n,a){const r=zC(s=>(s.addIssue=o=>{if(typeof o=="string")s.issues.push(mo(o,s.value,r._zod.def));else{const d=o;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),"input"in d||(d.input=s.value),d.inst??(d.inst=r),d.continue??(d.continue=!r._zod.def.abort),s.issues.push(mo(d))}},n(s.value,s)),a);return r}function zC(n,a){const r=new On({check:"custom",...Ce(a)});return r._zod.check=n,r}function io(n,...a){for(const r of a)for(const s of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,s)&&Pi(n,s,r[s]);return n}function pS(n){let a=(n==null?void 0:n.target)??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??to,target:a,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",intersections:[],deferred:[],external:(n==null?void 0:n.external)??void 0}}function Lr(n,a,r,s,o){const d=typeof a.unrepresentable=="function"?a.unrepresentable({zodSchema:n,path:s.path,message:o}):a.unrepresentable;if(d==="any")return!1;if(d===void 0||d==="throw")throw new Error(o);return Object.assign(r,d),!0}function Bt(n,a,r={path:[],schemaPath:[]}){var p,g;var s;const o=n._zod.def,d=a.seen.get(n);if(d)return d.count++,r.schemaPath.includes(n)&&(d.cycle=r.path),d.schema;const h={schema:{},count:1,cycle:void 0,path:r.path};a.seen.set(n,h),a.sharedDefsExtractedFor=void 0,a.sharedEmitDoneFor=void 0;const m=(g=(p=n._zod).toJSONSchema)==null?void 0:g.call(p);if(m)h.schema=m;else{const S={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(a,h.schema,S);else{const z=h.schema,w=a.processors[o.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);w(n,a,z,S)}const j=n._zod.parent;j&&(h.ref||(h.ref=j),Bt(j,a,S),a.seen.get(j).isParent=!0)}const y=a.metadataRegistry.get(n);return y&&io(h.schema,y),a.io==="input"&&yn(n)&&(delete h.schema.examples,delete h.schema.default),a.io==="input"&&"_prefault"in h.schema&&((s=h.schema).default??(s.default=h.schema._prefault)),delete h.schema._prefault,a.seen.get(n).schema}function qb(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function gS(n,a){var h,m,y,b;const r=n.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const s=new Map;for(const p of n.seen.entries()){const g=(h=n.metadataRegistry.get(p[0]))==null?void 0:h.id;if(g){const S=s.get(g);if(S&&S!==p[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(g,p[0])}}const o=p=>{var w;const g=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const N=(w=n.external.registry.get(p[0]))==null?void 0:w.id,T=n.external.uri??(oe=>oe);if(N)return{ref:T(N)};const L=p[1].defId??p[1].schema.id??`schema${n.counter++}`;return p[1].defId=L,{defId:L,ref:`${T("__shared")}#/${g}/${qb(L)}`}}const S="#",j=`${S}/${g}/`;if(p[1]===r&&!p[1].schema.id)return{ref:S};const z=p[1].schema.id??`__schema${n.counter++}`;return{defId:z,ref:j+qb(z)}},d=p=>{if(p[1].schema.$ref)return;const g=p[1],{ref:S,defId:j}=o(p);g.def={...g.schema},j&&(g.defId=j);const z=g.schema;for(const w in z)delete z[w];z.$ref=S};if(n.cycles==="throw")for(const p of n.seen.entries()){const g=p[1];if(g.cycle)throw new Error(`Cycle detected: #/${(m=g.cycle)==null?void 0:m.join("/")}/<root>
|
|
356
|
+
|
|
357
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of n.seen.entries()){const g=p[1];if(a===p[0]){d(p);continue}if(n.external){const j=(y=n.external.registry.get(p[0]))==null?void 0:y.id;if(a!==p[0]&&j){d(p);continue}}if((b=n.metadataRegistry.get(p[0]))==null?void 0:b.id){d(p);continue}if(g.cycle){d(p);continue}g.count>1&&n.reused==="ref"&&d(p)}n.external&&(n.sharedDefsExtractedFor=n.external)}function vS(n){const a=n.anyOf;if(!Array.isArray(a)||a.length===0||n.type!==void 0)return;const r=[];for(const s of a){if(!s||typeof s!="object")return;vS(s);const o=Object.keys(s);if(o.length!==1||o[0]!=="type")return;const d=s.type;for(const h of Array.isArray(d)?d:[d]){if(typeof h!="string")return;r.includes(h)||r.push(h)}}delete n.anyOf,n.type=r.length===1?r[0]:r}const yS=new Set(["type","properties","required","additionalProperties"]),Vb=["oneOf","anyOf"];function Yb(n){const a=n.additionalProperties;return a===void 0||a===!1||typeof a!="object"||a===null?null:Object.keys(a).length?a:null}function em(n){var d;const a=[];for(const h of n){if(typeof h!="object"||h.type!=="object")return null;for(const m in h)if(!yS.has(m))return null;a.push(h)}const r={},s=new Set;for(const h of a){for(const m in h.properties){if(Object.prototype.hasOwnProperty.call(r,m))continue;const y=[];for(const p of a){const g=((d=p.properties)==null?void 0:d[m])??Yb(p);g!=null&&(y.some(S=>JSON.stringify(S)===JSON.stringify(g))||y.push(g))}const b=y.length===1?y[0]:em(y)??{allOf:y};Pi(r,m,b)}for(const m of h.required??[])s.add(m)}const o={type:"object",properties:r};if(s.size&&(o.required=[...s]),a.every(h=>h.additionalProperties===!1))o.additionalProperties=!1;else{const h=[];for(const m of a){const y=Yb(m);y&&!h.some(b=>JSON.stringify(b)===JSON.stringify(y))&&h.push(y)}h.length===1?o.additionalProperties=h[0]:h.length>1&&(o.additionalProperties={allOf:h})}return o}function NC(n){const a=n.allOf;if(!Array.isArray(a)||a.length<2)return;for(const o of yS)if(o in n)return;const r=a.filter(o=>Vb.some(d=>Array.isArray(o[d])));let s=null;if(!r.length)s=em(a);else{const o=r[0],d=Vb.find(y=>Array.isArray(o[y]));if(Object.keys(o).length!==1)return;const h=a.filter(y=>y!==o),m=o[d].map(y=>em([...h,y]));if(m.some(y=>!y))return;s={[d]:m}}s&&(delete n.allOf,io(n,s))}function bS(n,a){var m,y,b,p;const r=n.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=g=>{const S=n.seen.get(g);if(S.ref===null)return;const j=S.def??S.schema,z={...j},w=S.ref;if(S.ref=null,w){s(w);const T=n.seen.get(w),L=T.schema;if(L.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(j.allOf=j.allOf??[],j.allOf.push(L)):io(j,L),io(j,z),g._zod.parent===w)for(const I in j)I==="$ref"||I==="allOf"||I in z||delete j[I];if(L.$ref&&T.def)for(const I in j)I==="$ref"||I==="allOf"||I in T.def&&JSON.stringify(j[I])===JSON.stringify(T.def[I])&&delete j[I]}const N=g._zod.parent;if(N&&N!==w){s(N);const T=n.seen.get(N);if(T!=null&&T.schema.$ref&&(j.$ref=T.schema.$ref,T.def))for(const L in j)L==="$ref"||L==="allOf"||L in T.def&&JSON.stringify(j[L])===JSON.stringify(T.def[L])&&delete j[L]}n.override({zodSchema:g,jsonSchema:j,path:S.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const g of[...n.seen.entries()].reverse())s(g[0]);if(n.target!=="openapi-3.0")for(const g of n.seen.entries())vS(g[1].def??g[1].schema);for(const g of n.deferred)g();if(n.intersections.length){const g=new Map;for(const S of n.seen.values())for(const j of[S.schema,S.def]){const z=j==null?void 0:j.allOf;if(!Array.isArray(z))continue;const w=g.get(z);w?w.push(j):g.set(z,[j])}for(const S of n.intersections)for(const j of g.get(S)??[])NC(j)}}const o={};if(n.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":n.target,(m=n.external)!=null&&m.uri){const g=(y=n.external.registry.get(a))==null?void 0:y.id;if(!g)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(g)}io(o,r.defId?r.schema:r.def??r.schema);const d=(b=n.metadataRegistry.get(a))==null?void 0:b.id;d!==void 0&&o.id===d&&delete o.id;const h=((p=n.external)==null?void 0:p.defs)??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const g of n.seen.entries()){const S=g[1];S.def&&S.defId&&(S.def.id===S.defId&&delete S.def.id,Pi(h,S.defId,S.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(h).length>0&&(n.target==="draft-2020-12"?o.$defs=h:o.definitions=h);try{const g=JSON.parse(JSON.stringify(o));return Object.defineProperty(g,"~standard",{value:{...a["~standard"],jsonSchema:{input:pu(a,"input",n.processors),output:pu(a,"output",n.processors)}},enumerable:!1,writable:!1}),g}catch{throw new Error("Error converting schema to JSON.")}}function yn(n,a){const r=a??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);const s=n._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return yn(s.element,r);if(s.type==="set")return yn(s.valueType,r);if(s.type==="lazy")return yn(s.getter(),r);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault"||s.type==="catch")return yn(s.innerType,r);if(s.type==="intersection")return yn(s.left,r)||yn(s.right,r);if(s.type==="record"||s.type==="map")return yn(s.keyType,r)||yn(s.valueType,r);if(s.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:yn(s.in,r)||yn(s.out,r);if(s.type==="object"){for(const o in s.shape)if(yn(s.shape[o],r))return!0;return!1}if(s.type==="union"){for(const o of s.options)if(yn(o,r))return!0;return!1}if(s.type==="tuple"){for(const o of s.items)if(yn(o,r))return!0;return!!(s.rest&&yn(s.rest,r))}return!1}const EC=(n,a={})=>r=>{const s=pS({...r,processors:a});return Bt(n,s),gS(s,n),bS(s,n)},pu=(n,a,r={})=>s=>{const{libraryOptions:o,target:d}=s??{},h=pS({...o??{},target:d,io:a,processors:r});return Bt(n,h),gS(h,n),bS(h,n)},Mr=(n,a,r)=>{(n[a]===void 0||r>n[a])&&(n[a]=r)},Dr=(n,a,r)=>{(n[a]===void 0||r<n[a])&&(n[a]=r)},Ib=(n,a)=>{Mr(n,"minimum",a),Dr(n,"maximum",a)},SS=(n,a)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(a)||n.multipleOf.push(a)},xS=(n,a)=>{n.patterns??(n.patterns=new Set),n.patterns.add(a)},_S=(n,a)=>{n.mime=n.mime?n.mime.filter(r=>a.includes(r)):[...a]},jS=(n,a)=>{n.format=a,a.includes("int")&&(n.isInt=!0)},Gb=(n,a)=>Mr(n,"minimum",a.minimum),Fb=(n,a)=>Dr(n,"maximum",a.maximum),Kb=n=>(a,r)=>{jS(a,r.format);const[s,o]=n[r.format];Mr(a,"minimum",s),Dr(a,"maximum",o)},kh={greater_than:(n,a)=>Mr(n,a.inclusive?"minimum":"exclusiveMinimum",a.value),less_than:(n,a)=>Dr(n,a.inclusive?"maximum":"exclusiveMaximum",a.value),multiple_of:(n,a)=>SS(n,a.value),number_format:Kb(Y1),bigint_format:Kb(Gw),min_length:Gb,max_length:Fb,length_equals:(n,a)=>Ib(n,a.length),min_size:Gb,max_size:Fb,size_equals:(n,a)=>Ib(n,a.size),string_format:(n,a)=>{jS(n,a.format),a.pattern&&xS(n,a.pattern),(a.format==="base64"||a.format==="base64url")&&(n.contentEncoding=a.format),(a.local||a.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,a)=>_S(n,a.mime)};function Sa(n){var d;const a={},r=n._zod.def,s=n._zod.traits.has("$ZodCheck")?[n,...r.checks??[]]:r.checks??[];for(const h of s)(d=kh[h._zod.def.check])==null||d.call(kh,a,h._zod.def);const o=n._zod.bag;o.minimum!==void 0&&Mr(a,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Mr(a,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Dr(a,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Dr(a,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&SS(a,o.multipleOf),o.format!==void 0&&(a.format??(a.format=o.format),o.format.includes("int")&&(a.isInt=!0)),o.mime&&_S(a,o.mime);for(const h of o.patterns??[])xS(a,h);return a}const CC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},TC=new Map([[lS,Fz],[km,Kz]]),wS=n=>TC.get(n)??n,AC=(n,a,r,s)=>{const o=r;o.type="string";const{minimum:d,maximum:h,format:m,patterns:y,contentEncoding:b,laxFormat:p}=Sa(n);if(typeof d=="number"&&(o.minLength=d),typeof h=="number"&&(o.maxLength=h),m&&(o.format=CC[m]??m,o.format===""&&delete o.format,(m==="time"||p)&&delete o.format),b&&(o.contentEncoding=b),y&&y.size>0){const g=[...y].map(wS);g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(S=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},OC=(n,a,r,s)=>{const o=r,{minimum:d,maximum:h,multipleOf:m,exclusiveMaximum:y,exclusiveMinimum:b,isInt:p}=Sa(n);o.type=p?"integer":"number";const g=typeof b=="number"&&b>=(d??Number.NEGATIVE_INFINITY),S=typeof y=="number"&&y<=(h??Number.POSITIVE_INFINITY),j=a.target==="draft-04"||a.target==="openapi-3.0";if(g?j?(o.minimum=b,o.exclusiveMinimum=!0):o.exclusiveMinimum=b:typeof d=="number"&&(o.minimum=d),S?j?(o.maximum=y,o.exclusiveMaximum=!0):o.exclusiveMaximum=y:typeof h=="number"&&(o.maximum=h),m){const z=new Set;for(const T of m)Number.isFinite(T)&&T!==0?z.add(Math.abs(T)):Lr(n,a,o,s,`A multipleOf divisor of ${T} cannot be represented in JSON Schema`);const[w,...N]=z;w!==void 0&&(o.multipleOf=w),N.length&&(o.allOf=[...o.allOf??[],...N.map(T=>({multipleOf:T}))])}},kC=(n,a,r,s)=>{r.type="boolean"},MC=(n,a,r,s)=>{r.not={}},DC=(n,a,r,s)=>{},RC=(n,a,r,s)=>{const o=n._zod.def,d=Kh(o.entries);if(d.length===0){r.not={};return}d.every(h=>typeof h=="number")&&(r.type="number"),d.every(h=>typeof h=="string")&&(r.type="string"),r.enum=d},UC=(n,a,r,s)=>{Lr(n,a,r,s,"Custom types cannot be represented in JSON Schema")},LC=(n,a,r,s)=>{Lr(n,a,r,s,"Transforms cannot be represented in JSON Schema")},$C=(n,a,r,s)=>{const o=r,d=n._zod.def,{minimum:h,maximum:m}=Sa(n);typeof h=="number"&&(o.minItems=h),typeof m=="number"&&(o.maxItems=m),o.type="array",o.items=Bt(d.element,a,{...s,path:[...s.path,"items"]})};function gu(n){const a=n._zod.def;return a.type==="pipe"&&a.in._zod.traits.has("$ZodTransform")?gu(a.out):a.type==="catch"?gu(a.innerType):n._zod.optin}const BC=(n,a,r,s)=>{var b;const o=r,d=n._zod.def,h=d.shape;if(Object.getOwnPropertySymbols(h).length&&Lr(n,a,o,s,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const p in h)Pi(o.properties,p,Bt(h[p],a,{...s,path:[...s.path,"properties",p]}));const y=[];for(const p of Object.keys(h)){const g=d.shape[p];(a.io==="input"?gu(g)===void 0:g._zod.optout===void 0)&&y.push(p)}y.length>0&&(o.required=y),((b=d.catchall)==null?void 0:b._zod.def.type)==="never"?o.additionalProperties=!1:d.catchall?d.catchall&&(o.additionalProperties=Bt(d.catchall,a,{...s,path:[...s.path,"additionalProperties"]})):a.io==="output"&&(o.additionalProperties=!1)},ZC=(n,a,r,s)=>{const o=n._zod.def,d=o.inclusive===!1,h=o.options.map((m,y)=>Bt(m,a,{...s,path:[...s.path,d?"oneOf":"anyOf",y]}));d?r.oneOf=h:r.anyOf=h},HC=(n,a,r,s)=>{const o=n._zod.def,d=Bt(o.left,a,{...s,path:[...s.path,"allOf",0]}),h=Bt(o.right,a,{...s,path:[...s.path,"allOf",1]}),m=b=>"allOf"in b&&Object.keys(b).length===1,y=[...m(d)?d.allOf:[d],...m(h)?h.allOf:[h]];r.allOf=y,a.intersections.push(y)};function tm(n,a,r){var z;if(a.$ref){if(r.has(a))return a;r.add(a);const w=(z=n.get(a))==null?void 0:z.def;if(!w)return a;const N=tm(n,w,r);return N===w?a:N}for(const w of["anyOf","oneOf"]){const N=a[w];if(!Array.isArray(N))continue;const T=N.map(L=>tm(n,L,r));T.some((L,oe)=>L!==N[oe])&&(a={...a,[w]:T})}const s=Array.isArray(a.type)?a.type:[a.type],o=!s.includes("string")&&s.some(w=>w==="number"||w==="integer"),d=a.enum??(a.const!==void 0?[a.const]:void 0);if(!o&&!(d!=null&&d.some(w=>typeof w=="number")))return a;const{minimum:h,maximum:m,exclusiveMinimum:y,exclusiveMaximum:b,multipleOf:p,format:g,id:S,...j}=a;return j.enum?j.enum=j.enum.map(w=>typeof w=="number"?String(w):w):typeof j.const=="number"&&(j.const=String(j.const)),o&&(j.type="string",d||(j.pattern=(s.includes("number")?Tm:nN).source)),j}const nm=new WeakMap;function qC(n){var s;const a=new Map;for(const o of n.seen.values())o.def&&!a.has(o.schema)&&a.set(o.schema,o);const r=new Map;for(const o of nm.get(n)??[]){const d=n.seen.get(o),h=(s=(d==null?void 0:d.def)??(d==null?void 0:d.schema))==null?void 0:s.propertyNames;if(!h||h===!0||r.has(h))continue;const m=tm(a,h,new Set);m!==h&&r.set(h,m)}if(r.size)for(const o of n.seen.values())for(const d of[o.schema,o.def]){const h=d&&r.get(d.propertyNames);h&&(d.propertyNames=h)}}const VC=(n,a,r,s)=>{const o=r,d=n._zod.def;o.type="object";const h=d.keyType,m=Sa(h).patterns;if(d.mode==="loose"&&m&&m.size>0){const p=Bt(d.valueType,a,{...s,path:[...s.path,"patternProperties","*"]});o.patternProperties={};for(const g of m)Pi(o.patternProperties,wS(g).source,p)}else{if(a.target==="draft-07"||a.target==="draft-2020-12"){o.propertyNames=Bt(d.keyType,a,{...s,path:[...s.path,"propertyNames"]});let p=nm.get(a);p||(p=[],nm.set(a,p),a.deferred.push(()=>qC(a))),p.push(n)}o.additionalProperties=Bt(d.valueType,a,{...s,path:[...s.path,"additionalProperties"]})}const y=h._zod.values,b=a.io==="input"&&gu(d.valueType)!==void 0;if(y&&!d.partial&&!b){const p=[...y].filter(g=>typeof g=="string"||typeof g=="number");p.length>0&&(o.required=p.map(String))}},YC=(n,a,r,s)=>{const o=n._zod.def,d=Bt(o.innerType,a,s),h=a.seen.get(n);a.target==="openapi-3.0"?(h.ref=o.innerType,r.nullable=!0):r.anyOf=[d,{type:"null"}]},IC=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);d.ref=o.innerType},Mm=Symbol();function zS(n,a,r,s,o){let d=!1;const h=JSON.stringify(n,(m,y)=>typeof y!="bigint"?y:(d=!0,null));return d?(Lr(a,r,s,o,"BigInt defaults cannot be represented in JSON Schema"),Mm):JSON.parse(h)}const GC=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);d.ref=o.innerType;const h=zS(o.defaultValue,n,a,r,s);h!==Mm&&(r.default=h)},FC=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);if(d.ref=o.innerType,a.io!=="input")return;const h=zS(o.defaultValue,n,a,r,s);h!==Mm&&(r._prefault=h)},KC=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);d.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{Lr(n,a,r,s,"Dynamic catch values are not supported in JSON Schema");return}r.default=h},XC=(n,a,r,s)=>{const o=n._zod.def,d=o.in._zod.traits.has("$ZodTransform"),h=a.io==="input"?d?o.out:o.in:o.out;Bt(h,a,s);const m=a.seen.get(n);m.ref=h},QC=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);d.ref=o.innerType,r.readOnly=!0},NS=(n,a,r,s)=>{const o=n._zod.def;Bt(o.innerType,a,s);const d=a.seen.get(n);d.ref=o.innerType},Xb=new WeakSet([Object.prototype,Error.prototype]);function Kc(n,a,r){Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const s=r(this);return Object.defineProperty(this,a,{value:s,configurable:!0,writable:!0}),s},set(s){Object.defineProperty(this,a,{value:s,configurable:!0,writable:!0})}})}const JC=(n,a)=>{mz.init(n,a),n.name="ZodError";const r=Object.getPrototypeOf(n);Xb.has(r)||(Xb.add(r),Kc(r,"format",s=>o=>vz(s,o)),Kc(r,"flatten",s=>o=>gz(s,o)),Kc(r,"addIssue",s=>o=>{s.issues.push(o),s.message=JSON.stringify(s.issues,Xh,2)}),Kc(r,"addIssues",s=>o=>{s.issues.push(...o),s.message=JSON.stringify(s.issues,Xh,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},oa=le("ZodError",JC,void 0,{Parent:Error}),PC=zm(oa),WC=Nm(oa),eT=Em(oa),tT=Cm(oa),nT=jz(oa),aT=wz(oa),iT=zz(oa),lT=Nz(oa),rT=Ez(oa),sT=Cz(oa),oT=Tz(oa),cT=Az(oa);function uT(){_a.localeError||Za(AE())}function Nu(){_a.memoizer||Za({memoizer:EE()})}const At=le("ZodType",(n,a)=>(uT(),Tt.init(n,a),n.def=a,n.type=a.type,n),{check(...n){const a=this.def;return this.clone(Xn(a,{checks:[...a.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,a){return Wi(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(s4(n,a))},superRefine(n,a){return this.check(o4(n,a))},overwrite(n){return this.check(Ur(n))},optional(){return Pb(this)},exactOptional(){return KT(this)},nullable(){return Wb(this)},nullish(){return Pb(Wb(this))},nonoptional(n){return e4(this,n)},array(){return ya(this)},or(n){return qT([this,n])},and(n){return YT(this,n)},transform(n){return e0(this,FT(n))},default(n){return JT(this,n)},prefault(n){return WT(this,n)},catch(n){return n4(this,n)},pipe(n){return e0(this,n)},readonly(){return l4(this)},describe(n){const a=this.clone();return to.add(a,{description:n}),a},meta(...n){if(n.length===0)return to.get(this);const a=this.clone();return to.add(a,n[0]),a},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...a){return a.length===0?n(this):n(this,...a)},get"~standard"(){return G1(this,"~standard",{...eS(this),jsonSchema:{input:pu(this,"input"),output:pu(this,"output")}})},set"~standard"(n){Ji(this,"~standard",n)},parse:function n(a,r){return PC(this,a,r,{callee:n})},parseAsync:async function n(a,r){return await WC(this,a,r,{callee:n})},safeParse(n,a){return eT(this,n,a)},async safeParseAsync(n,a){return tT(this,n,a)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(n){Ji(this,"spa",n)},validate(n,a){return Sz(this,n,a)},validateAsync(n,a){return _z(this,n,a)},encode:function n(a,r){return nT(this,a,r,{callee:n})},decode:function n(a,r){return aT(this,a,r,{callee:n})},encodeAsync:async function n(a,r){return await iT(this,a,r,{callee:n})},decodeAsync:async function n(a,r){return await lT(this,a,r,{callee:n})},safeEncode(n,a){return rT(this,n,a)},safeDecode(n,a){return sT(this,n,a)},async safeEncodeAsync(n,a){return oT(this,n,a)},async safeDecodeAsync(n,a){return cT(this,n,a)},toJSONSchema(n){return EC(this,{})(n)},get description(){var n;return(n=to.get(this))==null?void 0:n.description},get _def(){return this._zod.def}}),ES=le("_ZodString",(n,a)=>{Om.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>AC(n,r,s)},F1({format:n=>Sa(n).format??null,minLength:n=>Sa(n).minimum??null,maxLength:n=>Sa(n).maximum??null},{regex(...n){return this.check(fC(...n))},includes(...n){return this.check(mC(...n))},startsWith(...n){return this.check(pC(...n))},endsWith(...n){return this.check(gC(...n))},min(...n){return this.check(mu(...n))},max(...n){return this.check(hS(...n))},length(...n){return this.check(mS(...n))},nonempty(...n){return this.check(mu(1,...n))},lowercase(n){return this.check(dC(n))},uppercase(n){return this.check(hC(n))},trim(){return this.check(yC())},normalize(...n){return this.check(vC(...n))},toLowerCase(){return this.check(bC())},toUpperCase(){return this.check(SC())},slugify(){return this.check(xC())}})),fT=le("ZodString",(n,a)=>{Om.init(n,a),ES.init(n,a)},{email(n){return this.check(DE(gT,n))},url(n){return this.check(ZE(yT,n))},jwt(n){return this.check(tC(MT,n))},emoji(n){return this.check(HE(bT,n))},guid(n){return this.check(RE(vT,n))},uuid(n){return this.check(UE(Xc,n))},uuidv4(n){return this.check(LE(Xc,n))},uuidv6(n){return this.check($E(Xc,n))},uuidv7(n){return this.check(BE(Xc,n))},nanoid(n){return this.check(qE(ST,n))},cuid(n){return this.check(VE(xT,n))},cuid2(n){return this.check(YE(_T,n))},ulid(n){return this.check(IE(jT,n))},base64(n){return this.check(PE(AT,n))},base64url(n){return this.check(WE(OT,n))},xid(n){return this.check(GE(wT,n))},ksuid(n){return this.check(FE(zT,n))},ipv4(n){return this.check(KE(NT,n))},ipv6(n){return this.check(XE(ET,n))},cidrv4(n){return this.check(QE(CT,n))},cidrv6(n){return this.check(JE(TT,n))},e164(n){return this.check(eC(kT,n))},datetime(n){return this.check(nC(dT,n))},date(n){return this.check(aC(hT,n))},time(n){return this.check(iC(mT,n))},duration(n){return this.check(lC(pT,n))}});function We(n){return ME(fT,n)}const zt=le("ZodStringFormat",(n,a)=>{xt.init(n,a),ES.init(n,a)}),dT=le("ZodISODateTime",(n,a)=>{LN.init(n,a),zt.init(n,a)}),hT=le("ZodISODate",(n,a)=>{$N.init(n,a),zt.init(n,a)}),mT=le("ZodISOTime",(n,a)=>{BN.init(n,a),zt.init(n,a)}),pT=le("ZodISODuration",(n,a)=>{ZN.init(n,a),zt.init(n,a)}),gT=le("ZodEmail",(n,a)=>{jN.init(n,a),zt.init(n,a)}),vT=le("ZodGUID",(n,a)=>{xN.init(n,a),zt.init(n,a)}),Xc=le("ZodUUID",(n,a)=>{_N.init(n,a),zt.init(n,a)}),yT=le("ZodURL",(n,a)=>{TN.init(n,a),zt.init(n,a)}),bT=le("ZodEmoji",(n,a)=>{AN.init(n,a),zt.init(n,a)}),ST=le("ZodNanoID",(n,a)=>{ON.init(n,a),zt.init(n,a)}),xT=le("ZodCUID",(n,a)=>{kN.init(n,a),zt.init(n,a)}),_T=le("ZodCUID2",(n,a)=>{MN.init(n,a),zt.init(n,a)}),jT=le("ZodULID",(n,a)=>{DN.init(n,a),zt.init(n,a)}),wT=le("ZodXID",(n,a)=>{RN.init(n,a),zt.init(n,a)}),zT=le("ZodKSUID",(n,a)=>{UN.init(n,a),zt.init(n,a)}),NT=le("ZodIPv4",(n,a)=>{HN.init(n,a),zt.init(n,a)}),ET=le("ZodIPv6",(n,a)=>{VN.init(n,a),zt.init(n,a)}),CT=le("ZodCIDRv4",(n,a)=>{YN.init(n,a),zt.init(n,a)}),TT=le("ZodCIDRv6",(n,a)=>{GN.init(n,a),zt.init(n,a)}),AT=le("ZodBase64",(n,a)=>{FN.init(n,a),zt.init(n,a)}),OT=le("ZodBase64URL",(n,a)=>{XN.init(n,a),zt.init(n,a)}),kT=le("ZodE164",(n,a)=>{QN.init(n,a),zt.init(n,a)}),MT=le("ZodJWT",(n,a)=>{PN.init(n,a),zt.init(n,a)}),CS=le("ZodNumber",(n,a)=>{rS.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>OC(n,r,s,o),n.isFinite=!0},F1({minValue:n=>{const{minimum:a,exclusiveMinimum:r}=Sa(n);return Math.max(a??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:a,exclusiveMaximum:r}=Sa(n);return Math.min(a??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:a,multipleOf:r}=Sa(n);return!!a||!!(r!=null&&r.some(Number.isSafeInteger))},format:n=>Sa(n).format??null},{gt(n,a){return this.check(Zb(n,a))},gte(n,a){return this.check(Oh(n,a))},min(n,a){return this.check(Oh(n,a))},lt(n,a){return this.check(Bb(n,a))},lte(n,a){return this.check(Ah(n,a))},max(n,a){return this.check(Ah(n,a))},int(n){return this.check(Qb(n))},safe(n){return this.check(Qb(n))},positive(n){return this.check(Zb(0,n))},nonnegative(n){return this.check(Oh(0,n))},negative(n){return this.check(Bb(0,n))},nonpositive(n){return this.check(Ah(0,n))},multipleOf(n,a){return this.check(Hb(n,a))},step(n,a){return this.check(Hb(n,a))},finite(){return this}}));function In(n){return rC(CS,n)}const DT=le("ZodNumberFormat",(n,a)=>{WN.init(n,a),CS.init(n,a)});function Qb(n){return sC(DT,n)}const RT=le("ZodBoolean",(n,a)=>{eE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>kC(n,r,s)});function Gn(n){return oC(RT,n)}const UT=le("ZodUnknown",(n,a)=>{tE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>DC()});function am(){return cC(UT)}const LT=le("ZodNever",(n,a)=>{nE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>MC(n,r,s)});function $T(n){return uC(LT,n)}const BT=le("ZodArray",(n,a)=>{Nu(),lE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>$C(n,r,s,o),n.element=a.element},{min(n,a){return this.check(mu(n,a))},nonempty(n){return this.check(mu(1,n))},max(n,a){return this.check(hS(n,a))},length(n,a){return this.check(mS(n,a))},unwrap(){return this.element}});function ya(n,a){return _C(BT,n,a)}const ZT=le("ZodObject",(n,a)=>{Nu(),oE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>BC(n,r,s,o),rz(n,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Fn(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(Xn(this._zod.def,{catchall:n}))},passthrough(){return this.clone(Xn(this._zod.def,{catchall:am()}))},loose(){return this.clone(Xn(this._zod.def,{catchall:am()}))},strict(){return this.clone(Xn(this._zod.def,{catchall:$T()}))},strip(){return this.clone(Xn(this._zod.def,{catchall:void 0}))},extend(n){return Xw(this,n)},safeExtend(n){return Qw(this,n)},merge(n){return Jw(this,n)},pick(n){return Fw(this,n)},omit(n){return Kw(this,n)},partial(...n){return xb(TS,this,n[0])},exactPartial(...n){return xb(AS,this,n[0],"exactPartial")},required(...n){return Pw(OS,this,n[0])}});function bn(n,a){const r={type:"object",shape:n??{},...Ce(a)};return new ZT(r)}const HT=le("ZodUnion",(n,a)=>{cE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>ZC(n,r,s,o),n.options=a.options});function qT(n,a){return new HT({type:"union",options:n,...Ce(a)})}const VT=le("ZodIntersection",(n,a)=>{uE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>HC(n,r,s,o)});function YT(n,a){return new VT({type:"intersection",left:n,right:a})}const Jb=le("ZodRecord",(n,a)=>{Nu(),fE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>VC(n,r,s,o),n.keyType=a.keyType,n.valueType=a.valueType});function IT(n,a,r){return!a||!a._zod?new Jb({type:"record",keyType:We(),valueType:n,...Ce(a)}):new Jb({type:"record",keyType:n,valueType:a,...Ce(r)})}const im=le("ZodEnum",(n,a)=>{dE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(s,o,d)=>RC(n,s,o),n.enum=a.entries,n.options=[...n._zod.values];const r=new Set(Object.keys(a.entries));n.extract=(s,o)=>{const d={};for(const h of s)if(r.has(h))d[h]=a.entries[h];else throw new Error(`Key ${h} not found in enum`);return new im({...a,checks:[],...Ce(o),entries:d})},n.exclude=(s,o)=>{const d={...a.entries};for(const h of s)if(r.has(h))delete d[h];else throw new Error(`Key ${h} not found in enum`);return new im({...a,checks:[],...Ce(o),entries:d})}});function Fn(n,a){const r=Array.isArray(n)?Object.fromEntries(n.map(s=>[s,s])):n;return new im({type:"enum",entries:r,...Ce(a)})}const GT=le("ZodTransform",(n,a)=>{Nu(),hE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>LC(n,r,s,o),n._zod.parse=(r,s)=>{if(s.direction==="backward")throw new K1(n.constructor.name);r.addIssue=d=>{if(typeof d=="string")r.issues.push(mo(d,r.value,a));else{const h=d;h.fatal&&(h.continue=!1),h.code??(h.code="custom"),"input"in h||(h.input=r.value),h.inst??(h.inst=n),r.issues.push(mo(h))}};const o=a.transform(r.value,r);return o instanceof Promise?o.then(d=>(r.value=d,r)):(r.value=o,r)}});function FT(n){return new GT({type:"transform",transform:n})}const TS=le("ZodOptional",(n,a)=>{cS.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>NS(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function Pb(n){return new TS({type:"optional",innerType:n})}const AS=le("ZodExactOptional",(n,a)=>{mE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>NS(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function KT(n){return new AS({type:"optional",innerType:n})}const XT=le("ZodNullable",(n,a)=>{pE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>YC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function Wb(n){return new XT({type:"nullable",innerType:n})}const QT=le("ZodDefault",(n,a)=>{gE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>GC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function JT(n,a){return new QT({type:"default",innerType:n,get defaultValue(){return typeof a=="function"?a():q1(a)}})}const PT=le("ZodPrefault",(n,a)=>{vE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>FC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function WT(n,a){return new PT({type:"prefault",innerType:n,get defaultValue(){return typeof a=="function"?a():q1(a)}})}const OS=le("ZodNonOptional",(n,a)=>{yE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>IC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function e4(n,a){return new OS({type:"nonoptional",innerType:n,...Ce(a)})}const t4=le("ZodCatch",(n,a)=>{bE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>KC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function n4(n,a){return new t4({type:"catch",innerType:n,catchValue:typeof a=="function"?a:oz(a)})}const a4=le("ZodPipe",(n,a)=>{SE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>XC(n,r,s,o),n.in=a.in,n.out=a.out});function e0(n,a){return new a4({type:"pipe",in:n,out:a})}const i4=le("ZodReadonly",(n,a)=>{xE.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>QC(n,r,s,o),n.unwrap=()=>n._zod.def.innerType});function l4(n){return new i4({type:"readonly",innerType:n})}const r4=le("ZodCustom",(n,a)=>{_E.init(n,a),At.init(n,a),n._zod.processJSONSchema=(r,s,o)=>UC(n,r,s,o)});function s4(n,a={}){return jC(r4,n,a)}function o4(n,a){return wC(n,a)}class c4 extends Error{}Promise.resolve();const vu=[{id:"summary",zh:"总结要点",en:"Summarize",prompt:"Summarize the main points with specific supporting details."},{id:"translate",zh:"翻译全文",en:"Translate",prompt:"Translate the supplied page faithfully. Preserve headings and lists."},{id:"explain",zh:"解释概念",en:"Explain",prompt:"Explain the key concepts with concrete examples and distinguish claims from evidence."},{id:"followup",zh:"继续追问",en:"Explore further",prompt:"Suggest useful follow-up questions, and explain why each matters."},{id:"grammar",zh:"语法分析",en:"Analyze grammar",prompt:"Analyze important sentences, grammar and vocabulary in this text."},{id:"card",zh:"整理阅读卡",en:"Make reading notes",prompt:"Create a concise reading card in Markdown with a title, key quotation, interpretation and practical action. Only use the supplied source."}],kS=bn({id:We().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/),name:We().trim().min(1).max(100),prompt:We().trim().min(1).max(12e3),enabled:Gn(),order:In().int().min(0).max(1e4)}),Eu=ya(kS).max(100).refine(n=>new Set(n.map(a=>a.id)).size===n.length,"Reading presets must have unique IDs").refine(n=>n.filter(a=>!vu.some(r=>r.id===a.id)).length+vu.length<=100,"Reading presets are limited to 100 including built-ins");function Dm(n,a){const r=Eu.parse(n),s=new Set(vu.map(d=>d.id));return[...vu.map((d,h)=>{const m=r.find(y=>y.id===d.id);return{id:d.id,prompt:d.prompt,enabled:!0,order:h,...m,name:m&&![d.zh,d.en].some(y=>y===m.name)?m.name:a==="zh"?d.zh:d.en,isBuiltin:!0,isModified:!!m}}),...r.filter(d=>!s.has(d.id)).map(d=>({...d,isBuiltin:!1,isModified:!0}))].sort((d,h)=>d.order-h.order)}function t0(n,a){const r=kS.parse(a);return Eu.parse([...n.filter(s=>s.id!==r.id),r])}function n0(n,a,r,s){const o=Dm(n,a),d=o.findIndex(m=>m.id===r),h=d+s;return d<0||h<0||h>=o.length?n:([o[d],o[h]]=[o[h],o[d]],Eu.parse(o.map(({isBuiltin:m,isModified:y,...b},p)=>({...b,order:p}))))}const di=[{key:"title",name:"Title",type:"text",isBuiltin:!0,enabled:!0},{key:"source",name:"Url",type:"text",isBuiltin:!0,enabled:!0,visibleInSidepanel:!1},{key:"author",name:"Author",type:"text",isBuiltin:!0,enabled:!0},{key:"origin",name:"Origin",type:"select",isBuiltin:!0,enabled:!0},{key:"description",name:"Description",type:"text",isBuiltin:!0,enabled:!0},{key:"tags",name:"Tags",type:"multiselect",isBuiltin:!0,enabled:!0},{key:"created",name:"Created",type:"datetime",isBuiltin:!0,enabled:!0,visibleInSidepanel:!1},{key:"cover",name:"Cover",type:"text",isBuiltin:!0,enabled:!0}],Rm={fields:di.map(n=>({...n})),dateFormat:"YYYY-MM-DD HH:mm:ss"},Um=["text","select","multiselect","datetime","date","number","checkbox"],MS=new Set(["__proto__","prototype","constructor"]),DS=n=>typeof n=="string"&&n.length<=80&&/^[\p{L}_][\p{L}\p{N}_ -]*$/u.test(n)&&!MS.has(n),RS=n=>typeof n=="string"&&/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(n)&&!MS.has(n);function u4(n){const a=n&&typeof n=="object"?n:{},r=Array.isArray(a.fields)?a.fields.slice(0,64):[],s=new Set,o=[],d=new Map(di.map(S=>[S.key,S])),h=new Map(di.map(S=>[S.name,S.key]));for(const S of r){if(!S||typeof S!="object")continue;const j=typeof S.key=="string"?S.key.trim():"";if(!RS(j)||s.has(j))continue;const z=d.get(j),w=typeof S.name=="string"?S.name.trim():"",N=DS(w)&&(!h.has(w)||h.get(w)===j)?w:(z==null?void 0:z.name)||j;o.push({key:j,name:N,type:(z==null?void 0:z.type)||(Um.includes(S.type)?S.type:"text"),isBuiltin:!!z,enabled:S.enabled!==!1,visibleInSidepanel:typeof S.visibleInSidepanel=="boolean"?S.visibleInSidepanel:(z==null?void 0:z.visibleInSidepanel)??!0}),s.add(j)}const m=new Map(o.map(S=>[S.key,S])),y=new Set,b=di.map(S=>{const j={...m.get(S.key)||S};return y.has(j.name)&&(j.name=S.name),y.add(j.name),j}),p=o.filter(S=>S.isBuiltin||y.has(S.name)?!1:(y.add(S.name),!0)).slice(0,64-b.length),g=typeof a.dateFormat=="string"&&a.dateFormat.trim()&&a.dateFormat.length<=120&&!/[\u0000-\u001f\u007f]/.test(a.dateFormat)?a.dateFormat:Rm.dateFormat;return{fields:[...b,...p],dateFormat:g}}function lo(n,a){var r;return(r=(n||di).find(s=>s.key===a&&s.enabled))==null?void 0:r.name}function a0(n,a=!1){if(typeof n!="string")return"";const r=a&&/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d$/.test(n)?n.replace(" ","T"):n,s=r.match(/^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d):(\d\d)(?::(\d\d)(?:\.\d{1,3})?)?(?:Z|[+-]\d\d:\d\d)?)?$/);if(!s)return"";const[,o,d,h,m,y,b]=s,p=new Date(Date.UTC(Number(o),Number(d),0)).getUTCDate();if(Number(d)<1||Number(d)>12||Number(h)<1||Number(h)>p||Number(m||0)>23||Number(y||0)>59||Number(b||0)>59)return"";const g=new Date(r);return Number.isFinite(g.getTime())?r.length===10?r:g.toISOString():""}function f4(n){var s;const a=a0(n.createdAt);if(a)return a;const r=lo(n.frontMatterFields,"created");return r?a0((s=n.frontMatter)==null?void 0:s[r],!0):""}class d4 extends Error{constructor(r){super(`${r.zh} / ${r.en}`);Ly(this,"code","frontmatter-settings");this.localized=r,this.name="FrontMatterValidationError"}}function Yn(n,a){throw new d4({zh:n,en:a})}function US(n){(!n||typeof n!="object"||Array.isArray(n))&&Yn("属性设置必须是对象。","Front-matter settings must be an object.");const a=n;Object.keys(a).some(h=>!["fields","dateFormat"].includes(h))&&Yn("属性设置包含未知选项。","Front-matter settings contain an unknown option."),(!Array.isArray(a.fields)||a.fields.length>64)&&Yn("属性列表最多允许 64 个字段。","At most 64 front-matter fields are allowed."),(typeof a.dateFormat!="string"||!a.dateFormat.trim()||a.dateFormat.length>120||/[\u0000-\u001f\u007f]/.test(a.dateFormat))&&Yn("日期格式不能为空、不能含控制字符,且最多 120 个字符。","The date format must contain 1–120 characters and no control characters.");const r=new Map(di.map(h=>[h.key,h])),s=new Set,o=new Set;for(const h of a.fields){(!h||typeof h!="object"||Array.isArray(h)||Object.keys(h).some(b=>!["key","name","type","isBuiltin","enabled","visibleInSidepanel"].includes(b)))&&Yn("属性字段格式无效或包含未知选项。","A front-matter field has an invalid format or unknown option."),(!RS(h.key)||h.key.trim()!==h.key)&&Yn("字段标识须以英文字母开头,仅含字母、数字、下划线或连字符,最多 64 字符。","Field keys must start with a letter and contain only letters, numbers, underscores or hyphens, up to 64 characters."),(!DS(h.name)||h.name.trim()!==h.name)&&Yn("输出名称须以字母或下划线开头,仅含文字、数字、空格、下划线或连字符,最多 80 字符。","Output names must start with a letter or underscore and contain only letters, numbers, spaces, underscores or hyphens, up to 80 characters."),(s.has(h.key)||o.has(h.name))&&Yn("字段标识和输出名称不能重复。","Field keys and output names must be unique.");const m=r.get(h.key);(!Um.includes(h.type)||m&&h.type!==m.type)&&Yn("属性类型无效;内置字段的类型不可更改。","The field type is invalid; builtin field types cannot be changed."),(typeof h.enabled!="boolean"||h.visibleInSidepanel!==void 0&&typeof h.visibleInSidepanel!="boolean"||h.isBuiltin!==void 0&&(typeof h.isBuiltin!="boolean"||h.isBuiltin!==!!m))&&Yn("字段启用、可见性和内置标志无效。","Field enabled, visibility or builtin flags are invalid."),di.find(b=>b.name===h.name&&b.key!==h.key)&&Yn("输出名称与内置字段冲突,请使用另一个名称。","The output name conflicts with a builtin field; choose another name."),s.add(h.key),o.add(h.name)}const d=di.filter(h=>!s.has(h.key));return a.fields.length+d.length>64&&Yn("保留内置字段后,属性总数不能超过 64。","The total including builtin fields cannot exceed 64."),d.some(h=>o.has(h.name))&&Yn("输出名称与补回的内置字段冲突。","An output name conflicts with a restored builtin field."),u4(a)}var iu={exports:{}},h4=iu.exports,i0;function m4(){return i0||(i0=1,(function(n,a){(function(r,s){n.exports=s()})(h4,(function(){var r=1e3,s=6e4,o=36e5,d="millisecond",h="second",m="minute",y="hour",b="day",p="week",g="month",S="quarter",j="year",z="date",w="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ie){var G=["th","st","nd","rd"],C=ie%100;return"["+ie+(G[(C-20)%10]||G[C]||G[0])+"]"}},oe=function(ie,G,C){var R=String(ie);return!R||R.length>=G?ie:""+Array(G+1-R.length).join(C)+ie},I={s:oe,z:function(ie){var G=-ie.utcOffset(),C=Math.abs(G),R=Math.floor(C/60),B=C%60;return(G<=0?"+":"-")+oe(R,2,"0")+":"+oe(B,2,"0")},m:function ie(G,C){if(G.date()<C.date())return-ie(C,G);var R=12*(C.year()-G.year())+(C.month()-G.month()),B=G.clone().add(R,g),ce=C-B<0,ne=G.clone().add(R+(ce?-1:1),g);return+(-(R+(C-B)/(ce?B-ne:ne-B))||0)},a:function(ie){return ie<0?Math.ceil(ie)||0:Math.floor(ie)},p:function(ie){return{M:g,y:j,w:p,d:b,D:z,h:y,m,s:h,ms:d,Q:S}[ie]||String(ie||"").toLowerCase().replace(/s$/,"")},u:function(ie){return ie===void 0}},te="en",K={};K[te]=L;var q="$isDayjsObject",H=function(ie){return ie instanceof ge||!(!ie||!ie[q])},J=function ie(G,C,R){var B;if(!G)return te;if(typeof G=="string"){var ce=G.toLowerCase();K[ce]&&(B=ce),C&&(K[ce]=C,B=ce);var ne=G.split("-");if(!B&&ne.length>1)return ie(ne[0])}else{var xe=G.name;K[xe]=G,B=xe}return!R&&B&&(te=B),B||!R&&te},me=function(ie,G){if(H(ie))return ie.clone();var C=typeof G=="object"?G:{};return C.date=ie,C.args=arguments,new ge(C)},ae=I;ae.l=J,ae.i=H,ae.w=function(ie,G){return me(ie,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var ge=(function(){function ie(C){this.$L=J(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[q]=!0}var G=ie.prototype;return G.parse=function(C){this.$d=(function(R){var B=R.date,ce=R.utc;if(B===null)return new Date(NaN);if(ae.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var ne=B.match(N);if(ne){var xe=ne[2]-1||0,Te=(ne[7]||"0").substring(0,3);return ce?new Date(Date.UTC(ne[1],xe,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Te)):new Date(ne[1],xe,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Te)}}return new Date(B)})(C),this.init()},G.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},G.$utils=function(){return ae},G.isValid=function(){return this.$d.toString()!==w},G.isSame=function(C,R){var B=me(C);return this.startOf(R)<=B&&B<=this.endOf(R)},G.isAfter=function(C,R){return me(C)<this.startOf(R)},G.isBefore=function(C,R){return this.endOf(R)<me(C)},G.$g=function(C,R,B){return ae.u(C)?this[R]:this.set(B,C)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(C,R){var B=this,ce=!!ae.u(R)||R,ne=ae.p(C),xe=function(re,he){var de=ae.w(B.$u?Date.UTC(B.$y,he,re):new Date(B.$y,he,re),B);return ce?de:de.endOf(b)},Te=function(re,he){return ae.w(B.toDate()[re].apply(B.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(he)),B)},Me=this.$W,O=this.$M,X=this.$D,pe="set"+(this.$u?"UTC":"");switch(ne){case j:return ce?xe(1,0):xe(31,11);case g:return ce?xe(1,O):xe(0,O+1);case p:var ue=this.$locale().weekStart||0,ze=(Me<ue?Me+7:Me)-ue;return xe(ce?X-ze:X+(6-ze),O);case b:case z:return Te(pe+"Hours",0);case y:return Te(pe+"Minutes",1);case m:return Te(pe+"Seconds",2);case h:return Te(pe+"Milliseconds",3);default:return this.clone()}},G.endOf=function(C){return this.startOf(C,!1)},G.$set=function(C,R){var B,ce=ae.p(C),ne="set"+(this.$u?"UTC":""),xe=(B={},B[b]=ne+"Date",B[z]=ne+"Date",B[g]=ne+"Month",B[j]=ne+"FullYear",B[y]=ne+"Hours",B[m]=ne+"Minutes",B[h]=ne+"Seconds",B[d]=ne+"Milliseconds",B)[ce],Te=ce===b?this.$D+(R-this.$W):R;if(ce===g||ce===j){var Me=this.clone().set(z,1);Me.$d[xe](Te),Me.init(),this.$d=Me.set(z,Math.min(this.$D,Me.daysInMonth())).$d}else xe&&this.$d[xe](Te);return this.init(),this},G.set=function(C,R){return this.clone().$set(C,R)},G.get=function(C){return this[ae.p(C)]()},G.add=function(C,R){var B,ce=this;C=Number(C);var ne=ae.p(R),xe=function(O){var X=me(ce);return ae.w(X.date(X.date()+Math.round(O*C)),ce)};if(ne===g)return this.set(g,this.$M+C);if(ne===j)return this.set(j,this.$y+C);if(ne===b)return xe(1);if(ne===p)return xe(7);var Te=(B={},B[m]=s,B[y]=o,B[h]=r,B)[ne]||1,Me=this.$d.getTime()+C*Te;return ae.w(Me,this)},G.subtract=function(C,R){return this.add(-1*C,R)},G.format=function(C){var R=this,B=this.$locale();if(!this.isValid())return B.invalidDate||w;var ce=C||"YYYY-MM-DDTHH:mm:ssZ",ne=ae.z(this),xe=this.$H,Te=this.$m,Me=this.$M,O=B.weekdays,X=B.months,pe=B.meridiem,ue=function(he,de,ye,Ve){return he&&(he[de]||he(R,ce))||ye[de].slice(0,Ve)},ze=function(he){return ae.s(xe%12||12,he,"0")},re=pe||function(he,de,ye){var Ve=he<12?"AM":"PM";return ye?Ve.toLowerCase():Ve};return ce.replace(T,(function(he,de){return de||(function(ye){switch(ye){case"YY":return String(R.$y).slice(-2);case"YYYY":return ae.s(R.$y,4,"0");case"M":return Me+1;case"MM":return ae.s(Me+1,2,"0");case"MMM":return ue(B.monthsShort,Me,X,3);case"MMMM":return ue(X,Me);case"D":return R.$D;case"DD":return ae.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return ue(B.weekdaysMin,R.$W,O,2);case"ddd":return ue(B.weekdaysShort,R.$W,O,3);case"dddd":return O[R.$W];case"H":return String(xe);case"HH":return ae.s(xe,2,"0");case"h":return ze(1);case"hh":return ze(2);case"a":return re(xe,Te,!0);case"A":return re(xe,Te,!1);case"m":return String(Te);case"mm":return ae.s(Te,2,"0");case"s":return String(R.$s);case"ss":return ae.s(R.$s,2,"0");case"SSS":return ae.s(R.$ms,3,"0");case"Z":return ne}return null})(he)||ne.replace(":","")}))},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(C,R,B){var ce,ne=this,xe=ae.p(R),Te=me(C),Me=(Te.utcOffset()-this.utcOffset())*s,O=this-Te,X=function(){return ae.m(ne,Te)};switch(xe){case j:ce=X()/12;break;case g:ce=X();break;case S:ce=X()/3;break;case p:ce=(O-Me)/6048e5;break;case b:ce=(O-Me)/864e5;break;case y:ce=O/o;break;case m:ce=O/s;break;case h:ce=O/r;break;default:ce=O}return B?ce:ae.a(ce)},G.daysInMonth=function(){return this.endOf(g).$D},G.$locale=function(){return K[this.$L]},G.locale=function(C,R){if(!C)return this.$L;var B=this.clone(),ce=J(C,R,!0);return ce&&(B.$L=ce),B},G.clone=function(){return ae.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},ie})(),fe=ge.prototype;return me.prototype=fe,[["$ms",d],["$s",h],["$m",m],["$H",y],["$W",b],["$M",g],["$y",j],["$D",z]].forEach((function(ie){fe[ie[1]]=function(G){return this.$g(G,ie[0],ie[1])}})),me.extend=function(ie,G){return ie.$i||(ie(G,ge,me),ie.$i=!0),me},me.locale=J,me.isDayjs=H,me.unix=function(ie){return me(1e3*ie)},me.en=K[te],me.Ls=K,me.p={},me}))})(iu)),iu.exports}m4();const lu=["highlight","copy","save","save-all","flomo","translate","explain","grammar","mnemonic","vocabulary"],p4=["#F8F3DE","#FBE3E3","#E1F3E5","#DFEBFB","#EFE4FA"],LS={translateEnabled:!0,explainEnabled:!0,grammarEnabled:!0,mnemonicEnabled:!0,toolbarPosition:"above",rememberColor:!0,defaultColor:"#F8F3DE",showDestinationSelector:!0,autoAddVocabulary:!0,resultPosition:"top_left",resultX:16,resultY:16,targetLanguage:"zh-CN",translationProvider:"google",disabledSites:[],actions:[...lu],prompts:{explain:"",grammar:"",mnemonic:""}},$S={fontSize:16,width:760,fontFamily:"system",chineseFont:"system",lineHeight:1.75},ru=["save","panel","ai","vocab","toggle","region","highlights","hide"],BS={actions:[...ru],enabled:!0,side:"right",y:50,disabledSites:[]},ZS={concurrency:3,destinationConcurrency:3,maxRetries:3,retryDelayMs:1e3},Vs={frontmatter:structuredClone(Rm),readerPresets:[],preview:{...$S},floating:structuredClone(BS),queue:{...ZS},locale:typeof navigator<"u"&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en",theme:"system",defaultTarget:"download",targets:[{id:"download",enabled:!0,options:{}}],cloudVault:"default",cloudFolder:"Forsion Clip",desktopFolder:"Forsion Clip",provider:"forsion",providers:[{id:"forsion",name:"Forsion AI",kind:"forsion",endpoint:"",apiKey:"",model:""}],daily:{enabled:!1,hour:9,minute:0,urls:[]},imageHost:{enabled:!1,id:"s3",options:{}},mcp:{enabled:!1,endpoint:"ws://127.0.0.1:18365",token:""},autoClipSites:[],selection:structuredClone(LS)},l0=IT(We(),We().max(2e4)),HS=We().max(253).transform(n=>n.trim().toLowerCase().replace(/\.$/,"")).refine(n=>{try{return!/[\s/*?#@]/.test(n)&&new URL(`https://${n}`).hostname===n}catch{return!1}},"Enter an exact hostname without a URL, port or wildcard"),qS=bn({translateEnabled:Gn().default(!0),explainEnabled:Gn().default(!0),grammarEnabled:Gn().default(!0),mnemonicEnabled:Gn().default(!0),toolbarPosition:Fn(["above","below","hidden"]).default("above"),rememberColor:Gn().default(!0),defaultColor:Fn(p4).default("#F8F3DE"),showDestinationSelector:Gn().default(!0),autoAddVocabulary:Gn().default(!0),resultPosition:Fn(["top_left","top_right","below_selection","custom"]).default("top_left"),resultX:In().min(0).max(1e5).default(16),resultY:In().min(0).max(1e5).default(16),targetLanguage:We().regex(/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/).max(35).default("zh-CN"),translationProvider:Fn(["google","bing","ai"]).default("google"),disabledSites:ya(HS).max(200).transform(n=>[...new Set(n)]).default([]),actions:ya(Fn(lu)).max(lu.length).transform(n=>[...new Set(n)]).default([...lu]),prompts:bn({explain:We().max(8e3).default(""),grammar:We().max(8e3).default(""),mnemonic:We().max(8e3).default("")}).default({explain:"",grammar:"",mnemonic:""})}),g4=bn({readerPresets:Eu.default([]),frontmatter:am().transform(n=>US(n??Rm)),preview:bn({fontSize:In().min(12).max(28).default(16),width:In().min(360).max(1200).default(760),fontFamily:Fn(["system","serif","mono"]).default("system"),chineseFont:Fn(["system","serif"]).default("system"),lineHeight:In().min(1.2).max(2.4).default(1.75)}).default(()=>({...$S})),floating:bn({actions:ya(Fn(ru)).max(ru.length).transform(n=>[...new Set(n)]).default([...ru]),enabled:Gn().default(!0),side:Fn(["left","right"]).default("right"),y:In().min(0).max(100).default(50),disabledSites:ya(HS).max(200).default([])}).default(()=>structuredClone(BS)),queue:bn({concurrency:In().int().min(1).max(5).default(3),destinationConcurrency:In().int().min(1).max(6).default(3),maxRetries:In().int().min(0).max(5).default(3),retryDelayMs:In().int().min(1e3).max(6e4).default(1e3)}).default(()=>({...ZS})),locale:Fn(["zh","en"]),theme:Fn(["light","dark","system"]),defaultTarget:We().max(60),targets:ya(bn({id:We().max(60),enabled:Gn(),options:l0})).max(24),cloudVault:We().max(100),cloudFolder:We().max(500),desktopFolder:We().max(500),provider:We().max(100),providers:ya(bn({id:We().max(100),name:We().max(100),kind:Fn(["forsion","openai","anthropic","google","ollama"]),endpoint:We().max(2048),apiKey:We().max(1e4),model:We().max(200)})).max(30),daily:bn({enabled:Gn(),hour:In().int().min(0).max(23),minute:In().int().min(0).max(59),urls:ya(We().url()).max(200)}),imageHost:bn({enabled:Gn(),id:We().max(60),options:l0}),mcp:bn({enabled:Gn(),endpoint:We().max(2048),token:We().max(256)}),autoClipSites:ya(We().max(255)).max(100),selection:qS.default(()=>structuredClone(LS))});Promise.resolve();function Cu(n){const a=new URL(n);if(!["http:","https:"].includes(a.protocol)||a.username||a.password)throw new Error("Only HTTP(S) URLs without embedded credentials are supported");return a.href}function v4(n){const a=new URL(Cu(n));return a.hash="",a.href}function hi(n,a,r){return n==="zh"?a:r}const VS=["Key point","Question","Insight","Definition","Action"],YS=1e7,Ys=n=>n.reduce((a,r)=>a+r.highlights.length,0),r0=n=>n instanceof Error?n.message:String(n);function y4(n,a){const r=()=>new Error(a==="zh"?"备份格式无效,请选择 Forsion Clip 划线 JSON 备份。":"Invalid backup. Choose a Forsion Clip highlights JSON backup.");if(n.length>YS)throw r();let s;try{s=JSON.parse(n)}catch{throw r()}if(!Array.isArray(s)&&((s==null?void 0:s.format)!=="forsion-clip-highlights"||s.version!==1))throw r();const o=Array.isArray(s)?s:s.pages;if(!Array.isArray(o)||o.length>1e3)throw r();return o.map(d=>{if(!d||typeof d.url!="string"||!Array.isArray(d.highlights)||d.highlights.length>2e3)throw r();const h=v4(d.url);for(const m of d.highlights)if(!m||typeof m.id!="string"||!m.id||typeof m.text!="string"||typeof m.html!="string"||typeof m.xpath!="string"||typeof m.createdAt!="string"||!/^#[0-9a-f]{6}$/i.test(m.color)||!Number.isInteger(m.startOffset)||m.startOffset<0||!Number.isInteger(m.endOffset)||m.endOffset<0||m.note!==void 0&&(typeof m.note!="string"||m.note.length>2e4))throw r();return{url:h,highlights:d.highlights}})}async function s0(n,a,r){const s=URL.createObjectURL(new Blob([a],{type:`${r};charset=utf-8`}));try{await chrome.downloads.download({url:s,filename:n,saveAs:!0,conflictAction:"uniquify"}),setTimeout(()=>URL.revokeObjectURL(s),6e4)}catch(o){throw URL.revokeObjectURL(s),o}}function b4(n,a){const r=[`# ${a==="zh"?"划线与批注":"Highlights and annotations"}`,""];for(const s of n){r.push(`## ${new URL(s.url).hostname}`,"",`[${a==="zh"?"原网页":"Source page"}](<${s.url.replace(/[<>]/g,encodeURIComponent)}>)`,"");for(const o of s.highlights){if(o.type==="image"&&o.imageUrl){let h;try{h=Cu(o.imageUrl)}catch{}h&&r.push(`![${(o.imageAlt||o.text||"").replace(/[\[\]\r\n]/g," ")}](<${h.replace(/[<>]/g,encodeURIComponent)}>)`,"")}o.text&&r.push(...o.text.split(/\r?\n/).map(h=>`> ${h}`),""),o.note&&r.push(`**${a==="zh"?"批注":"Note"}**`,"",o.note,"");const d=Or.findIndex(h=>h.hex.toLowerCase()===o.color.toLowerCase());r.push(`${a==="zh"?"颜色":"Color"}: ${d<0?o.color:a==="zh"?Or[d].label:VS[d]}`,"","---","")}}return r.join(`
|
|
358
|
+
`)}function S4({pageUrl:n,highlight:a,locale:r,disabled:s,update:o}){const d=(T,L)=>r==="zh"?T:L,h=M.useId(),[m,y]=M.useState(a.note||""),[b,p]=M.useState(a.color),[g,S]=M.useState(!1);M.useEffect(()=>{y(a.note||""),p(a.color)},[a.note,a.color]);const j=m!==(a.note||"")||b!==a.color,z=Or.find(T=>T.hex.toLowerCase()===b.toLowerCase());let w;try{a.type==="image"&&a.imageUrl&&(w=Cu(a.imageUrl))}catch{}const N=new Date(a.createdAt);return u.jsxs("article",{className:"highlight",style:{borderLeftColor:/^#[0-9a-f]{6}$/i.test(b)?b:"var(--border)"},children:[a.type==="image"&&u.jsxs("p",{className:"caption",style:{marginBottom:8},children:[u.jsx(ow,{size:13,"aria-hidden":"true"})," ",a.imageAlt||d("图片批注","Image annotation")]}),w&&u.jsxs("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"caption",children:[d("打开图片","Open image")," ",u.jsx(xu,{size:12,"aria-hidden":"true"})]}),a.text&&u.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:a.text}),u.jsxs("label",{className:"field",htmlFor:h,style:{margin:"10px 0"},children:[u.jsx("span",{children:d("批注","Note")}),u.jsx("textarea",{id:h,value:m,maxLength:2e4,disabled:s,placeholder:d("留下你的想法…","Add your thoughts…"),onChange:T=>y(T.target.value)})]}),u.jsxs("footer",{className:"actions",style:{flexWrap:"wrap"},children:[u.jsxs("select",{"aria-label":d("划线颜色","Highlight color"),value:(z==null?void 0:z.hex)||b,disabled:s,onChange:T=>p(T.target.value),children:[!z&&u.jsxs("option",{value:b,children:[d("原颜色","Original color")," ",b]}),Or.map((T,L)=>u.jsx("option",{value:T.hex,children:r==="zh"?T.label:VS[L]},T.hex))]}),u.jsxs("button",{className:"btn",disabled:s||!j,onClick:()=>void o(n,a.id,{note:m,color:b}),children:[u.jsx(Su,{size:14}),d("保存","Save")]}),j&&u.jsx("button",{className:"btn",disabled:s,onClick:()=>{y(a.note||""),p(a.color)},children:d("还原","Revert")}),u.jsx("span",{className:"grow"}),Number.isFinite(N.getTime())&&u.jsx("time",{className:"caption",dateTime:a.createdAt,children:N.toLocaleDateString(r==="zh"?"zh-CN":"en-GB")}),u.jsx("button",{className:"btn",disabled:s,"aria-label":d("删除这条划线","Delete this highlight"),onClick:()=>S(!0),children:u.jsx(Xi,{size:14})})]}),g&&u.jsxs("div",{className:"card",role:"alertdialog","aria-label":d("确认删除划线","Confirm highlight deletion"),style:{marginBottom:0},children:[u.jsx("p",{children:d("删除这条划线及其批注?此操作不能撤销。","Delete this highlight and its note? This cannot be undone.")}),u.jsxs("div",{className:"actions",style:{marginTop:10},children:[u.jsx("button",{className:"btn",disabled:s,onClick:()=>S(!1),children:d("保留","Keep")}),u.jsxs("button",{className:"btn",style:{color:"var(--danger)"},disabled:s,onClick:()=>void o(n,a.id,{remove:!0}).then(T=>{T&&S(!1)}),children:[u.jsx(Xi,{size:14}),d("确认删除","Delete highlight")]})]})]})]})}function x4({locale:n}){const a=(fe,ie)=>n==="zh"?fe:ie,[r,s]=M.useState([]),[o,d]=M.useState(""),[h,m]=M.useState(50),[y,b]=M.useState(!0),[p,g]=M.useState(!1),[S,j]=M.useState(""),[z,w]=M.useState(""),[N,T]=M.useState(null),L=M.useRef(null),oe=M.useRef(0),I=M.useCallback(async()=>{const fe=++oe.current;b(!0);try{const ie=await Se("highlights-list");if(!Array.isArray(ie))throw new Error("Invalid annotation response");fe===oe.current&&s(ie.filter(G=>G.highlights.length).sort((G,C)=>G.url.localeCompare(C.url)))}finally{fe===oe.current&&b(!1)}},[]);M.useEffect(()=>(I().catch(fe=>j(r0(fe))),()=>{oe.current++}),[I]);const te=M.useMemo(()=>{const fe=o.trim().toLocaleLowerCase();return r.map(ie=>({...ie,highlights:!fe||ie.url.toLocaleLowerCase().includes(fe)?ie.highlights:ie.highlights.filter(G=>[G.text,G.note,G.imageAlt].some(C=>C==null?void 0:C.toLocaleLowerCase().includes(fe)))})).filter(ie=>ie.highlights.length)},[r,o]),K=M.useMemo(()=>{let fe=h;return te.map(ie=>{const G=ie.highlights.slice(0,Math.max(0,fe));return fe-=G.length,{...ie,highlights:G}}).filter(ie=>ie.highlights.length)},[te,h]),q=Ys(r),H=Ys(te),J=async(fe,ie)=>{g(!0),j(""),w("");try{return await fe(),w(ie),!0}catch(G){return j(r0(G)),!1}finally{g(!1)}},me=(fe,ie,G)=>J(async()=>{await Se("highlights-update",{url:fe,id:ie,...G}),s(C=>C.map(R=>R.url!==fe?R:{...R,highlights:G.remove?R.highlights.filter(B=>B.id!==ie):R.highlights.map(B=>B.id===ie?{...B,...G}:B)}).filter(R=>R.highlights.length))},G.remove?a("划线已删除。","Highlight deleted."):a("批注已保存。","Annotation saved.")),ae=async fe=>{fe&&await J(async()=>{if(fe.size>YS)throw new Error(a("备份不能超过 10 MB。","Backup must not exceed 10 MB."));T({name:fe.name,pages:y4(await fe.text(),n)})},"")},ge=()=>new Date().toISOString().slice(0,10);return u.jsxs("section",{"aria-label":a("全部划线","All highlights"),children:[u.jsxs("div",{className:"section-title",children:[u.jsx(a1,{size:18,"aria-hidden":"true"}),u.jsx("h3",{children:a("全部划线","All highlights")}),u.jsx("span",{className:"caption",children:a(`${q} 条 · ${r.length} 个网页`,`${q} highlights · ${r.length} pages`)})]}),u.jsxs("div",{className:"actions",style:{marginBottom:15},children:[u.jsxs("button",{className:"btn",disabled:p||y,onClick:()=>void J(I,""),children:[u.jsx(no,{size:14}),a("刷新","Refresh")]}),u.jsxs("button",{className:"btn",disabled:p||y||!q,onClick:()=>void J(async()=>{const fe={format:"forsion-clip-highlights",version:1,exportedAt:new Date().toISOString(),pages:r};await s0(`forsion-highlights-${ge()}.json`,JSON.stringify(fe,null,2),"application/json")},a("备份下载已开始。","Backup download started.")),children:[u.jsx(Ba,{size:14}),a("JSON 全量备份","JSON backup (all)")]}),u.jsxs("button",{className:"btn",disabled:p||y||!H,onClick:()=>void J(()=>s0(`forsion-highlights-${ge()}.md`,b4(te,n),"text/markdown"),a("Markdown 下载已开始。","Markdown download started.")),children:[u.jsx(Ba,{size:14}),a("导出筛选结果","Export results")]}),u.jsxs("button",{className:"btn",disabled:p||y,onClick:()=>{var fe;return(fe=L.current)==null?void 0:fe.click()},children:[u.jsx(C1,{size:14}),a("导入备份","Import backup")]}),u.jsx("input",{ref:L,type:"file",accept:"application/json,.json",hidden:!0,onChange:fe=>{var G;const ie=(G=fe.target.files)==null?void 0:G[0];fe.target.value="",ae(ie)}})]}),S&&u.jsx("div",{className:"error",role:"alert",children:S}),z&&u.jsx("p",{className:"notice-inline",role:"status",children:z}),N&&u.jsxs("section",{className:"card","aria-label":a("导入预览","Import preview"),children:[u.jsx("h3",{children:a("导入划线备份","Import highlights backup")}),u.jsxs("p",{className:"muted",style:{marginTop:8,overflowWrap:"anywhere"},children:[N.name," · ",a(`${Ys(N.pages)} 条划线,${N.pages.length} 个网页`,`${Ys(N.pages)} highlights, ${N.pages.length} pages`)]}),u.jsx("p",{className:"caption",style:{marginTop:8},children:a("按网页与划线 ID 合并;已有记录会保留。","Merge by page and highlight ID; existing records are kept.")}),u.jsxs("div",{className:"actions",style:{marginTop:12},children:[u.jsxs("button",{className:"btn primary",disabled:p||!Ys(N.pages),onClick:()=>void J(async()=>{try{await Se("highlights-import",{pages:N.pages}),T(null)}finally{await I()}},a("备份已合并。","Backup merged.")),children:[u.jsx(Su,{size:14}),a("确认导入","Import highlights")]}),u.jsxs("button",{className:"btn",disabled:p,onClick:()=>T(null),children:[u.jsx(Tr,{size:14}),a("取消","Cancel")]})]})]}),u.jsxs("label",{className:"search",style:{maxWidth:"100%"},children:[u.jsx(Sm,{size:15,"aria-hidden":"true"}),u.jsx("input",{type:"search","aria-label":a("搜索网址、划线和批注","Search URLs, highlights and notes"),placeholder:a("搜索网址、文字或批注","Search URL, text or note"),value:o,onChange:fe=>{d(fe.target.value),m(50)}})]}),o&&u.jsx("p",{className:"caption",role:"status",children:a(`找到 ${H} 条划线`,`${H} matching highlights`)}),y&&!q?u.jsx("div",{className:"empty",role:"status",children:a("正在读取划线…","Loading highlights…")}):H?K.map(fe=>u.jsxs("section",{className:"card",children:[u.jsxs("a",{href:Cu(fe.url),target:"_blank",rel:"noopener noreferrer",style:{display:"flex",gap:8,alignItems:"baseline",overflowWrap:"anywhere"},children:[u.jsx("span",{style:{minWidth:0,flex:1},children:fe.url}),u.jsx(xu,{size:14,style:{flexShrink:0},"aria-hidden":"true"})]}),fe.highlights.map(ie=>u.jsx(S4,{pageUrl:fe.url,highlight:ie,locale:n,disabled:p,update:me},ie.id))]},fe.url)):u.jsx("div",{className:"empty",children:o?a("没有匹配的划线。","No matching highlights."):a("还没有划线。选中网页文字或标注图片后,会在这里显示。","No highlights yet. Highlight text or annotate an image on a page to see it here.")}),H>h&&u.jsx("button",{className:"btn",onClick:()=>m(fe=>fe+50),children:a(`再显示 ${Math.min(50,H-h)} 条`,`Show ${Math.min(50,H-h)} more`)})]})}const o0=[{id:"highlight",zh:"划线",en:"Highlight"},{id:"copy",zh:"复制",en:"Copy"},{id:"save",zh:"剪藏选区",en:"Clip selection"},{id:"save-all",zh:"剪藏全文",en:"Clip full page"},{id:"flomo",zh:"发送到 flomo",en:"Send to flomo"},{id:"translate",zh:"翻译",en:"Translate",feature:"translateEnabled"},{id:"explain",zh:"解释",en:"Explain",feature:"explainEnabled"},{id:"grammar",zh:"语法分析",en:"Grammar",feature:"grammarEnabled"},{id:"mnemonic",zh:"助记",en:"Mnemonic",feature:"mnemonicEnabled"},{id:"vocabulary",zh:"加入生词本",en:"Add to vocabulary"}],c0=[{value:"zh-CN",zh:"简体中文",en:"Simplified Chinese"},{value:"zh-TW",zh:"繁体中文",en:"Traditional Chinese"},{value:"en",zh:"英语",en:"English"},{value:"ja",zh:"日语",en:"Japanese"},{value:"ko",zh:"韩语",en:"Korean"},{value:"fr",zh:"法语",en:"French"},{value:"de",zh:"德语",en:"German"},{value:"es",zh:"西班牙语",en:"Spanish"},{value:"it",zh:"意大利语",en:"Italian"},{value:"pt",zh:"葡萄牙语",en:"Portuguese"},{value:"ru",zh:"俄语",en:"Russian"},{value:"ar",zh:"阿拉伯语",en:"Arabic"}],u0={yellow:{zh:"黄色",en:"Yellow"},red:{zh:"红色",en:"Red"},green:{zh:"绿色",en:"Green"},blue:{zh:"蓝色",en:"Blue"},purple:{zh:"紫色",en:"Purple"}},_r=n=>({...n,actions:[...n.actions],disabledSites:[...n.disabledSites],prompts:{...n.prompts}}),Qc=({resultX:n,resultY:a,...r})=>JSON.stringify(r);function _4({locale:n,value:a,enabled:r,providerName:s,onChange:o,onEnabledChange:d,onOpenAiSettings:h}){const m=(C,R)=>n==="zh"?C:R,[y,b]=M.useState(()=>_r(a)),[p,g]=M.useState(()=>_r(a)),[S,j]=M.useState(()=>a.disabledSites.join(`
|
|
359
|
+
`)),[z,w]=M.useState(""),[N,T]=M.useState(""),[L,oe]=M.useState(!1),I=M.useRef(!1),te=Qc(a),K=Qc(y)!==Qc(p)||S!==p.disabledSites.join(`
|
|
360
|
+
`),q=te!==Qc(p);function H(){b(_r(a)),g(_r(a)),j(a.disabledSites.join(`
|
|
361
|
+
`)),w(""),T("")}M.useEffect(()=>{K||H()},[te]);function J(C){b(R=>({...R,...C})),T(""),w("")}async function me(C,R){if(!I.current){I.current=!0,oe(!0),w(""),T("");try{await C(),R()}catch(B){w(`${m("未能保存更改,请重试。","Could not save changes. Please retry.")} ${B instanceof Error?B.message:String(B)}`)}finally{I.current=!1,oe(!1)}}}function ae(){const C=[...new Set(S.split(/\r?\n/).map(ne=>ne.trim().toLowerCase().replace(/\.$/,"")).filter(Boolean))];if(C.length>200){w(m("最多可禁用 200 个站点。","You can disable up to 200 sites."));return}const R=C.find(ne=>{try{const xe=new URL(`https://${ne}`);return ne.length>253||/[\s/*?#@]/.test(ne)||xe.hostname!==ne||!!xe.port||xe.pathname!=="/"}catch{return!0}});if(R){w(m(`请输入精确域名,不含协议、路径或通配符:${R}`,`Enter an exact hostname without a protocol, path, or wildcard: ${R}`));return}const B=qS.safeParse({...y,disabledSites:C});if(!B.success){w(m("设置格式无效,请检查语言、站点和提示词长度。","Invalid settings. Check the language, sites, and prompt lengths."));return}const ce=B.data;me(()=>o(ce,p),()=>{b(_r(ce)),g(_r(ce)),j(C.join(`
|
|
362
|
+
`)),T(m("选区工具栏设置已保存。","Selection toolbar settings saved."))})}function ge(C,R){const B=[...y.actions],ce=B.indexOf(C),ne=ce+R;ce<0||ne<0||ne>=B.length||([B[ce],B[ne]]=[B[ne],B[ce]],J({actions:B}))}const fe=y.actions.map(C=>o0.find(R=>R.id===C)).filter(C=>!!C),ie=o0.filter(C=>!y.actions.includes(C.id)),G=[{key:"translateEnabled",zh:"翻译",en:"Translation",descZh:"使用下方选择的翻译服务。",descEn:"Use the translation service selected below."},{key:"explainEnabled",zh:"解释",en:"Explanation",descZh:"使用当前 AI 解释所选内容。",descEn:"Explain selected content with the current AI provider."},{key:"grammarEnabled",zh:"语法分析",en:"Grammar analysis",descZh:"使用当前 AI 分析句式和语法。",descEn:"Analyze sentence structure and grammar with the current AI provider."},{key:"mnemonicEnabled",zh:"助记",en:"Mnemonics",descZh:"使用当前 AI 生成帮助记忆的线索。",descEn:"Generate memory cues with the current AI provider."}];return u.jsxs("section",{className:"selection-settings",children:[u.jsx("h1",{children:m("选区工具栏","Selection toolbar")}),u.jsx("p",{className:"muted",children:m("选择网页文字后,按自己的阅读习惯安排操作。下方更改在保存后生效。","Arrange actions for selected web text to match the way you read. Save changes below to apply them.")}),u.jsx(yt,{label:m("显示选区工具栏","Show selection toolbar"),description:m("控制网页选区工具栏的总开关,切换后立即生效。","The main switch for the page selection toolbar. Applies immediately."),control:u.jsx(Kn,{checked:r,label:m("显示选区工具栏","Show selection toolbar"),disabled:L,onChange:C=>void me(()=>d(C),()=>T(m("工具栏开关已更新。","Toolbar switch updated.")))})}),!r&&u.jsx("p",{className:"caption",children:m("工具栏已关闭。仍可修改设置和恢复禁用站点。","The toolbar is off. You can still edit preferences and restore disabled sites.")}),u.jsx("h2",{children:m("工具栏与划线","Toolbar and highlighting")}),u.jsx(yt,{label:m("工具栏位置","Toolbar position"),description:y.toolbarPosition==="hidden"?m("不显示网页浮动工具栏。仍可在此修改设置和恢复禁用站点。","Hide the floating page toolbar. Preferences and site recovery remain available here."):m("选择浮动工具栏在所选文字上方或下方显示。","Show the floating toolbar above or below the selected text."),control:u.jsxs("select",{"aria-label":m("工具栏位置","Toolbar position"),value:y.toolbarPosition,disabled:L,onChange:C=>J({toolbarPosition:C.target.value}),children:[u.jsx("option",{value:"above",children:m("选区上方","Above selection")}),u.jsx("option",{value:"below",children:m("选区下方","Below selection")}),u.jsx("option",{value:"hidden",children:m("隐藏","Hidden")})]})}),u.jsx(yt,{label:m("记住划线颜色","Remember highlight color"),description:m("继续使用上次选择的划线颜色;关闭后使用下方默认颜色。","Reuse the last highlight color you chose. Turn off to use the default color below."),control:u.jsx(Kn,{checked:y.rememberColor,label:m("记住划线颜色","Remember highlight color"),disabled:L,onChange:C=>J({rememberColor:C})})}),u.jsx(yt,{label:m("默认划线颜色","Default highlight color"),description:m("首次划线或不记忆颜色时使用。","Used for the first highlight or when color memory is off."),control:u.jsxs("div",{className:"selection-color-control",children:[u.jsx("span",{className:"selection-color-preview",style:{backgroundColor:y.defaultColor},"aria-hidden":"true"}),u.jsx("select",{"aria-label":m("默认划线颜色","Default highlight color"),value:y.defaultColor,disabled:L,onChange:C=>J({defaultColor:C.target.value}),children:Or.map(C=>u.jsx("option",{value:C.hex,children:m(u0[C.name].zh,u0[C.name].en)},C.hex))})]})}),u.jsx(yt,{label:m("显示保存目标选择器","Show save destination selector"),description:m("启用至少两个保存目标时,在工具栏中选择本次剪藏的目标。","Choose the destination for each clip in the toolbar when at least two save destinations are enabled."),control:u.jsx(Kn,{checked:y.showDestinationSelector,label:m("显示保存目标选择器","Show save destination selector"),disabled:L,onChange:C=>J({showDestinationSelector:C})})}),u.jsx("h2",{children:m("语言与阅读","Language and reading")}),G.map(C=>u.jsx(yt,{label:m(C.zh,C.en),description:m(C.descZh,C.descEn),control:u.jsx(Kn,{checked:y[C.key],label:m(C.zh,C.en),disabled:L,onChange:R=>J({[C.key]:R})})},C.key)),u.jsx(yt,{label:m("翻译目标语言","Translate into"),control:u.jsxs("select",{"aria-label":m("翻译目标语言","Translate into"),value:y.targetLanguage,disabled:L,onChange:C=>J({targetLanguage:C.target.value}),children:[!c0.some(C=>C.value===y.targetLanguage)&&u.jsx("option",{value:y.targetLanguage,children:y.targetLanguage}),c0.map(C=>u.jsx("option",{value:C.value,children:m(C.zh,C.en)},C.value))]})}),u.jsx(yt,{label:m("翻译服务","Translation service"),description:m("Google 和 Bing 翻译无需配置 AI。其他阅读功能使用当前 AI。","Google and Bing translation do not require AI setup. Other reading actions use the current AI provider."),control:u.jsxs("select",{"aria-label":m("翻译服务","Translation service"),value:y.translationProvider,disabled:L,onChange:C=>J({translationProvider:C.target.value}),children:[u.jsx("option",{value:"google",children:"Google"}),u.jsx("option",{value:"bing",children:"Bing"}),u.jsx("option",{value:"ai",children:m("当前 AI","Current AI provider")})]})}),u.jsx(yt,{label:m("当前 AI","Current AI provider"),description:s||m("尚未选择","Not selected"),control:u.jsxs("button",{type:"button",className:"btn",disabled:L||K,onClick:h,children:[u.jsx(xu,{size:14}),m("配置 AI","Configure AI")]})}),u.jsx("p",{className:"caption",children:m("未配置 AI 时,划线、复制、剪藏和生词本仍可使用。","Highlighting, copying, clipping, and vocabulary remain available without AI setup.")}),u.jsx(yt,{label:m("自动加入生词本","Automatically add to vocabulary"),description:m("翻译成功后,将不超过 200 个字符的选词或短语连同释义和来源句保存到生词本。长段落不会自动加入。","After a successful translation, save selected words or phrases of up to 200 characters with their meaning and source sentence. Longer passages are not added automatically."),control:u.jsx(Kn,{checked:y.autoAddVocabulary,label:m("自动加入生词本","Automatically add to vocabulary"),disabled:L,onChange:C=>J({autoAddVocabulary:C})})}),u.jsx(yt,{label:m("结果面板位置","Result panel position"),description:y.resultPosition==="custom"?m("拖动结果面板来调整并保存自定义位置。","Drag the result panel to adjust and save its custom position."):m("选择翻译和 AI 结果面板的初始位置。","Choose where translation and AI results first appear."),control:u.jsxs("select",{"aria-label":m("结果面板位置","Result panel position"),disabled:L,value:y.resultPosition,onChange:C=>J({resultPosition:C.target.value}),children:[u.jsx("option",{value:"top_left",children:m("左上角","Top left")}),u.jsx("option",{value:"top_right",children:m("右上角","Top right")}),u.jsx("option",{value:"below_selection",children:m("选区下方","Below selection")}),u.jsx("option",{value:"custom",children:m("自定义位置","Custom position")})]})}),u.jsx("h2",{children:m("操作顺序与显示","Action order and visibility")}),u.jsx("p",{className:"muted",children:m("按上下箭头调整顺序,开关决定是否显示。关闭上方功能后,对应操作仍保留排序。","Use the arrows to change order and switches to show or hide actions. Turning a feature off above preserves its position.")}),u.jsx("ol",{className:"selection-action-list",children:[...fe,...ie].map(C=>{const R=y.actions.indexOf(C.id),B=R>=0,ce=m(C.zh,C.en);return u.jsx("li",{children:u.jsx(yt,{label:ce,description:B?C.feature&&!y[C.feature]?m("功能已关闭,开启后按此顺序显示。","Feature is off; this position is kept for when you turn it on."):m(`显示位置 ${R+1}`,`Position ${R+1}`):m("已隐藏","Hidden"),control:u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"button",className:"btn","aria-label":m(`上移${C.zh}`,`Move ${C.en.toLowerCase()} up`),title:m("上移","Move up"),disabled:L||!B||R===0,onClick:()=>ge(C.id,-1),children:u.jsx(bm,{size:14})}),u.jsx("button",{type:"button",className:"btn","aria-label":m(`下移${C.zh}`,`Move ${C.en.toLowerCase()} down`),title:m("下移","Move down"),disabled:L||!B||R===y.actions.length-1,onClick:()=>ge(C.id,1),children:u.jsx(ym,{size:14})}),u.jsx(Kn,{checked:B,label:m(`显示${C.zh}`,`Show ${C.en.toLowerCase()}`),disabled:L,onChange:ne=>J({actions:ne?[...y.actions,C.id]:y.actions.filter(xe=>xe!==C.id)})})]})})},C.id)})}),u.jsx(yt,{label:m("站点管理入口","Site management action"),description:m("始终保留,不能隐藏。可从工具栏禁用当前站点,并在下方恢复。","Always available and cannot be hidden. Disable the current site from the toolbar and restore it below."),control:u.jsx("span",{className:"caption",children:m("固定显示","Always shown")})}),u.jsx("h2",{children:m("禁用站点","Disabled sites")}),u.jsx("p",{className:"muted",children:m("仅匹配精确域名,每行一个。例如 example.com 不包含 news.example.com。不填写协议、路径或通配符。","Use one exact hostname per line. For example, example.com does not include news.example.com. Omit protocols, paths, and wildcards.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:m("不显示工具栏的站点","Sites without the toolbar")}),u.jsx("textarea",{rows:4,"aria-label":m("禁用站点列表","Disabled sites list"),value:S,spellCheck:!1,placeholder:"example.com",disabled:L,onChange:C=>{j(C.target.value),T(""),w("")}})]}),u.jsxs("button",{type:"button",className:"btn",disabled:L||!S.trim(),onClick:()=>{j(""),T("")},children:[u.jsx(hw,{size:14}),m("恢复所有站点","Restore all sites")]}),u.jsx("p",{className:"caption",children:m("从列表中移除域名并保存,即可恢复该站点;工具栏总开关关闭时也可操作。","Remove a hostname and save to restore that site. This remains available even when the main toolbar switch is off.")}),u.jsx("h2",{children:m("自定义提示词","Custom prompts")}),u.jsx("p",{className:"muted",children:m("留空使用默认提示词。可用 {text} 插入所选文字,也可直接填写自然语言指令。插件会同时提供所选文字及其上下文。","Leave empty to use the default prompt. Use {text} to insert the selection, or write a natural-language instruction. The plugin also provides the selected text and its context.")}),[{key:"explain",zh:"解释提示词",en:"Explanation prompt",placeholderZh:"用简洁的语言解释这段内容,补充理解所需的背景。",placeholderEn:"Explain the passage clearly and add any background needed to understand it."},{key:"grammar",zh:"语法分析提示词",en:"Grammar prompt",placeholderZh:"分析句子结构、重要语法点,并举一个相似例句。",placeholderEn:"Analyze the sentence structure and key grammar, then give a similar example."},{key:"mnemonic",zh:"助记提示词",en:"Mnemonic prompt",placeholderZh:"给出准确、简短且容易记忆的联想方法。",placeholderEn:"Suggest an accurate, concise, and memorable association."}].map(C=>u.jsxs("label",{className:"field",children:[u.jsx("span",{children:m(C.zh,C.en)}),u.jsx("textarea",{rows:4,maxLength:8e3,value:y.prompts[C.key],placeholder:m(C.placeholderZh,C.placeholderEn),disabled:L,onChange:R=>J({prompts:{...y.prompts,[C.key]:R.target.value}})}),u.jsxs("small",{children:[y.prompts[C.key].length," / 8000"]})]},C.key)),u.jsxs("div",{className:"selection-settings-footer",children:[z&&u.jsx("p",{role:"alert",className:"failed",children:z}),q&&K&&u.jsx("p",{role:"alert",className:"muted",children:m("设置已在其他页面更新。请先重新载入当前设置,再继续修改。","Settings changed in another page. Reload the current settings before editing further.")}),N&&u.jsx("p",{role:"status",className:"muted",children:N}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"button",className:"btn primary",disabled:L||!K||q,onClick:ae,children:L?m("正在保存…","Saving…"):m("保存更改","Save changes")}),u.jsxs("button",{type:"button",className:"btn",disabled:L||!K&&!q,onClick:H,children:[u.jsx(b1,{size:14}),q?m("重新载入设置","Reload settings"):m("放弃更改","Discard changes")]}),u.jsx("span",{className:"caption",children:K?m("有未保存的更改","Unsaved changes"):m("更改已保存","Changes saved")})]})]})]})}function j4({field:n,value:a,onChange:r}){const[s,o]=M.useState(a),d=M.useRef(!1),h=M.useRef(0),m=M.useRef(0);return M.useEffect(()=>{d.current||o(a)},[a]),u.jsx("input",{type:n.secret?"password":"text",autoComplete:"off",value:s,placeholder:n.placeholder,onChange:y=>{d.current=!0,h.current++,o(y.target.value)},onBlur:async()=>{if(s===a){m.current||(d.current=!1);return}const y=h.current;m.current++;try{await r(s)!==!1&&h.current===y&&(d.current=!1)}finally{m.current--}}})}function w4({fields:n,values:a,locale:r,onChange:s}){return u.jsx(u.Fragment,{children:n.filter(o=>o.key!=="fieldMappings").map(o=>{const d=a[o.key]??o.default??"",h=hi(r,o.label.zh,o.label.en),m=y=>s({...a,[o.key]:y});return u.jsxs("label",{className:"field",children:[u.jsxs("span",{children:[h,o.required?" *":""]}),o.choices?u.jsxs("select",{value:d,onChange:y=>m(y.target.value),children:[!o.choices.some(y=>y.value===d)&&u.jsx("option",{value:d,children:d||hi(r,"请选择","Choose an option")}),o.choices.map(y=>u.jsx("option",{value:y.value,children:hi(r,y.label.zh,y.label.en)},y.value))]}):o.commitOnBlur?u.jsx(j4,{field:o,value:d,onChange:m}):u.jsx("input",{type:o.secret?"password":"text",autoComplete:"off",value:d,placeholder:o.placeholder,onChange:y=>m(y.target.value)})]},o.key)})})}function z4(n,a,r,s){const o=M.useRef(0),d=M.useRef({setValue:n,save:a,reload:r,onError:s});return d.current={setValue:n,save:a,reload:r,onError:s},M.useCallback(async h=>{const m=++o.current,y=d.current;y.setValue(b=>({...b,...h}));try{const b=await y.save(h);return m===o.current&&y.setValue(b),!0}catch(b){if(y.onError(b),m!==o.current)return!1;try{const p=await y.reload();m===o.current&&y.setValue(p)}catch(p){y.onError(p)}return!1}},[])}const N4=["title","url","tags","createdAt","author","description","siteName","constant"],E4=["title","rich_text","url","multi_select","select","date","number","checkbox","email","phone_number"],Jc=n=>new Aj("configuration",{zh:`字段映射无效:${n}`,en:`Invalid property mapping: ${n}`});function f0(n=""){if(!n.trim())return[];let a;try{a=JSON.parse(n)}catch{throw Jc("JSON")}if(!Array.isArray(a)||a.length>50)throw Jc("Expected up to 50 rows.");const r=new Set;return a.map(s=>{if(!s||typeof s!="object"||typeof s.property!="string"||!s.property.trim()||/[\x00-\x1f]/.test(s.property)||["__proto__","prototype","constructor"].includes(s.property.trim())||!N4.includes(s.source)||!E4.includes(s.type)||s.value!==void 0&&typeof s.value!="string")throw Jc("Property, source or type.");const o=s.property.trim();if(r.has(o))throw Jc("Duplicate property.");return r.add(o),{property:o,source:s.source,type:s.type,...s.value===void 0?{}:{value:s.value}}})}const C4=[["title","标题","Title"],["url","来源网址","Source URL"],["tags","标签","Tags"],["createdAt","剪藏时间","Clipped at"],["author","作者","Author"],["description","摘要","Description"],["siteName","站点","Site"],["constant","固定值","Constant value"]],T4=[["title","标题","Title"],["rich_text","文本","Text"],["url","网址","URL"],["multi_select","多选","Multiple selection"],["select","单选","Single selection"],["date","日期","Date"],["number","数字","Number"],["checkbox","复选框","Checkbox"],["email","邮箱","Email"],["phone_number","电话号码","Phone number"]];function A4({value:n,locale:a,onSave:r}){const s=(I,te)=>hi(a,I,te),[o,d]=M.useState([]),[h,m]=M.useState(n),[y,b]=M.useState(!1),[p,g]=M.useState(!1),[S,j]=M.useState(!1),[z,w]=M.useState(""),N=()=>{try{d(f0(n)),g(!1)}catch{d([]),g(!0)}m(n),b(!1),w("")};M.useEffect(()=>{y||N()},[n]);const T=I=>{d(I),b(!0),w("")},L=o.some((I,te)=>o.some((K,q)=>q!==te&&K.property.trim()===I.property.trim())),oe=y&&h!==n;return u.jsxs("section",{className:"property-mappings",children:[u.jsx("h3",{children:s("属性映射","Property mappings")}),u.jsx("p",{className:"caption",children:s("将网页字段写入目标多维表的指定列。留空时沿用自动匹配;列名和类型须与目标一致。","Map page fields to columns in the destination database. Leave empty for automatic matching; column names and types must match the destination.")}),p?u.jsx("p",{role:"alert",className:"failed",children:s("已保存的映射格式无法识别。请检查导入的配置,原始内容仍被保留。","The saved mappings are invalid. Check the imported configuration; the original value is preserved.")}):u.jsxs(u.Fragment,{children:[o.map((I,te)=>u.jsxs("div",{className:"mapping-row",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("目标列名","Column name")}),u.jsx("input",{value:I.property,maxLength:200,onChange:K=>T(o.map((q,H)=>H===te?{...q,property:K.target.value}:q))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("字段来源","Value source")}),u.jsx("select",{value:I.source,onChange:K=>T(o.map((q,H)=>H===te?{...q,source:K.target.value}:q)),children:C4.map(([K,q,H])=>u.jsx("option",{value:K,children:s(q,H)},K))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("列类型","Column type")}),u.jsx("select",{value:I.type,onChange:K=>T(o.map((q,H)=>H===te?{...q,type:K.target.value}:q)),children:T4.map(([K,q,H])=>u.jsx("option",{value:K,children:s(q,H)},K))})]}),u.jsx("button",{type:"button",title:s("移除映射","Remove mapping"),onClick:()=>T(o.filter((K,q)=>q!==te)),children:u.jsx(Xi,{size:14})}),I.source==="constant"&&u.jsxs("label",{className:"field mapping-value",children:[u.jsx("span",{children:s("固定值","Constant value")}),u.jsx("input",{value:I.value||"",maxLength:2e3,placeholder:I.type==="checkbox"?"true / false":I.type==="multi_select"?s("用逗号分隔多个值","Separate values with commas"):"",onChange:K=>T(o.map((q,H)=>H===te?{...q,value:K.target.value}:q))})]})]},te)),(L||oe||z)&&u.jsx("p",{role:"alert",className:"failed",children:z||(oe?s("映射已被其他操作更新,请重新载入后再编辑。","Mappings changed elsewhere. Reload before editing."):s("每个目标列只能映射一次。","Each destination column can be mapped only once."))}),u.jsxs("div",{className:"actions",children:[u.jsxs("button",{type:"button",className:"btn",disabled:o.length>=50||S,onClick:()=>T([...o,{property:"",source:"title",type:"rich_text"}]),children:[u.jsx(Cl,{size:14}),s("添加映射","Add mapping")]}),y&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"btn",disabled:S,onClick:N,children:s("重新载入","Reload")}),u.jsx("button",{type:"button",className:"btn primary",disabled:S||L||oe||o.some(I=>!I.property.trim()),onClick:async()=>{j(!0),w("");try{await r(JSON.stringify(f0(JSON.stringify(o.map(I=>({...I,property:I.property.trim(),value:I.source==="constant"?I.value||"":void 0})))))),b(!1)}catch(I){w(I instanceof Error?I.message:String(I))}finally{j(!1)}},children:S?s("保存中…","Saving…"):s("保存映射","Save mappings")})]})]})]})]})}function O4({value:n,locale:a,onChange:r}){const s=(o,d)=>hi(a,o,d);return u.jsxs("details",{className:"queue-settings card",children:[u.jsx("summary",{children:s("并发与自动重试","Concurrency and automatic retries")}),u.jsx("p",{className:"caption",children:s("自动重试仅用于可确认未送达的暂时性错误,等待时间逐次加倍。已成功的目标不会重复保存;送达不明或已创建部分内容的任务需先检查目标。","Only transient failures confirmed not to have arrived are retried, with a doubling delay. Successful destinations are skipped. Uncertain deliveries or partially created content need a destination check first.")}),u.jsxs("div",{className:"queue-fields",children:[[["concurrency","同时剪藏网页","Concurrent pages",5],["destinationConcurrency","每页同时导出目标","Concurrent destinations per page",6],["maxRetries","自动重试次数","Automatic retries",5]].map(([o,d,h,m])=>u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s(d,h)}),u.jsx("select",{value:n[o],onChange:y=>r({[o]:Number(y.target.value)}),children:Array.from({length:o==="maxRetries"?m+1:m},(y,b)=>o==="maxRetries"?b:b+1).map(y=>u.jsx("option",{value:y,children:y===0?s("关闭","Off"):y},y))})]},o)),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("首次重试等待","Initial retry delay")}),u.jsx("select",{value:n.retryDelayMs,onChange:o=>r({retryDelayMs:Number(o.target.value)}),children:[...new Set([1e3,2e3,5e3,1e4,3e4,6e4,n.retryDelayMs])].sort((o,d)=>o-d).map(o=>u.jsxs("option",{value:o,children:[o/1e3," ",s("秒","seconds")]},o))})]})]})]})}function k4(n){const a=String(n||"").trim().match(/^tangu:(\d{2,5}):([0-9a-f]{16,})$/i);if(!a)return null;const r=Number(a[1]);return r>0&&r<65536?{port:r,token:a[2].toLowerCase()}:null}const d0={connected:["notice-inline","已连接","Connected"],connecting:["caption","正在连接…","Connecting…"],idle:["caption","正在连接…","Connecting…"],offline:["error","连不上 Forsion 桌面,确认它正在运行","Can't reach Forsion Desktop. Make sure it is running"],"bad-code":["error","连接码已失效,请到桌面复制新的","This connect code no longer works. Copy a new one from Desktop"],"not-paired":["caption","还没配对","Not paired yet"]};function M4({locale:n}){const a=(w,N)=>hi(n,w,N),[r,s]=M.useState("idle"),[o,d]=M.useState(""),[h,m]=M.useState(!1),[y,b]=M.useState(""),[p,g]=M.useState(!1);M.useEffect(()=>{const w=async()=>{const T=await chrome.storage.session.get(["tanguStatus","tanguEngine"]);s(String(T.tanguStatus||"idle")),d(String(T.tanguEngine||"")),m(!!(await chrome.storage.local.get("tanguPairing")).tanguPairing)},N=(T,L)=>{(L==="session"||L==="local")&&w()};return w(),chrome.storage.onChanged.addListener(N),()=>chrome.storage.onChanged.removeListener(N)},[]);const[S,j,z]=d0[r]||d0.idle;return u.jsxs(u.Fragment,{children:[u.jsx("h2",{children:a("Tangu 浏览器控制","Tangu browser control")}),u.jsx("p",{children:a("配对后,Forsion 桌面里的 Tangu 能看到你打开的标签页,并在自己的「Tangu」标签组里后台操作,不占用你正在看的页面。","Once paired, Tangu in Forsion Desktop can see your open tabs and work in its own “Tangu” tab group in the background, without taking over the page you are on.")}),u.jsx("div",{className:S,"data-testid":"tangu-status",children:r==="connected"&&o?`${a(j,z)} · ${o}`:a(j,z)}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:a("连接码","Connect code")}),u.jsx("input",{value:y,autoComplete:"off",spellCheck:!1,placeholder:"tangu:47654:…",onChange:w=>{b(w.target.value),g(!1)}})]}),p&&u.jsx("div",{className:"error",children:a("连接码格式不对,请从桌面整段复制","That doesn't look like a connect code. Copy the whole code from Desktop")}),u.jsx("p",{className:"caption",children:a("在 Forsion 桌面打开「设置 › 浏览器」复制连接码,只需要粘贴一次。","Copy the connect code from Settings › Browser in Forsion Desktop. You only need to do this once.")}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"btn primary",disabled:!y.trim(),onClick:()=>{const w=k4(y);g(!w),w&&(chrome.storage.local.set({tanguPairing:w}),b(""))},children:a("配对","Pair")}),h&&u.jsx("button",{className:"btn",onClick:()=>void chrome.storage.local.remove("tanguPairing"),children:a("取消配对","Unpair")})]})]})}const Mh=[["save","保存全文","Save article"],["panel","打开侧栏","Open side panel"],["ai","AI 阅读","AI reading"],["vocab","生词卡","Vocabulary cards"],["toggle","切换划词菜单","Toggle selection menu"],["region","选择区域","Select region"],["highlights","保存本页划线","Save page highlights"],["hide","在此网站隐藏","Hide on this site"]];function D4({value:n,locale:a,onChange:r}){const s=(w,N)=>hi(a,w,N),[o,d]=M.useState(n.disabledSites.join(`
|
|
363
|
+
`)),[h,m]=M.useState(!1),[y,b]=M.useState(!1),[p,g]=M.useState(""),S=n.actions||Mh.map(w=>w[0]),j=async w=>{b(!0),g("");try{await r({actions:w})}catch(N){g(String(N))}finally{b(!1)}},z=(w,N)=>{const T=[...S];[T[w],T[w+N]]=[T[w+N],T[w]],j(T)};return M.useEffect(()=>{h||d(n.disabledSites.join(`
|
|
364
|
+
`))},[n.disabledSites,h]),u.jsxs("section",{className:"floating-settings",children:[u.jsx("h2",{children:s("网页悬浮入口","Floating page launcher")}),u.jsx(yt,{label:s("显示悬浮入口","Show floating launcher"),description:s("从网页边缘打开剪藏、区域选择和划线入口。","Open clipping, region selection and highlights from the edge of a page."),control:u.jsx(Kn,{label:s("显示悬浮入口","Show floating launcher"),checked:n.enabled,onChange:()=>void r({enabled:!n.enabled}).catch(w=>g(String(w)))})}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("停靠位置","Dock position")}),u.jsxs("select",{value:n.side,onChange:w=>void r({side:w.target.value}).catch(N=>g(String(N))),children:[u.jsx("option",{value:"left",children:s("左侧","Left")}),u.jsx("option",{value:"right",children:s("右侧","Right")})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("在这些站点隐藏(每行一个域名)","Hide on these sites (one hostname per line)")}),u.jsx("textarea",{value:o,placeholder:"example.com",onChange:w=>{d(w.target.value),m(!0),g("")}})]}),u.jsx("p",{className:"caption",children:s("移除域名并保存,可恢复该站点的悬浮入口。","Remove a hostname and save to restore the launcher on that site.")}),u.jsx("h3",{children:s("菜单动作","Menu actions")}),u.jsx("ol",{className:"selection-action-list",children:[...S.map(w=>Mh.find(N=>N[0]===w)),...Mh.filter(w=>!S.includes(w[0]))].map(([w,N,T])=>{const L=S.indexOf(w),oe=L>=0;return u.jsx("li",{children:u.jsx(yt,{label:s(N,T),description:oe?s(`显示位置 ${L+1}`,`Position ${L+1}`):s("已隐藏","Hidden"),control:u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"btn","aria-label":s(`上移${N}`,`Move ${T.toLowerCase()} up`),disabled:y||L<=0,onClick:()=>z(L,-1),children:u.jsx(bm,{size:14})}),u.jsx("button",{className:"btn","aria-label":s(`下移${N}`,`Move ${T.toLowerCase()} down`),disabled:y||!oe||L===S.length-1,onClick:()=>z(L,1),children:u.jsx(ym,{size:14})}),u.jsx(Kn,{label:s(`显示${N}`,`Show ${T.toLowerCase()}`),checked:oe,disabled:y,onChange:I=>void j(I?[...S,w]:S.filter(te=>te!==w))})]})})},w)})}),p&&u.jsx("p",{role:"alert",className:"failed",children:p}),u.jsx("button",{type:"button",className:"btn",disabled:!h,onClick:async()=>{try{await r({disabledSites:o.split(`
|
|
365
|
+
`).map(w=>w.trim()).filter(Boolean)}),m(!1)}catch(w){g(w instanceof Error?w.message:String(w))}},children:s("保存隐藏站点","Save hidden sites")})]})}const R4={text:["文本","Text"],select:["选项","Select"],multiselect:["多选","Multi-select"],datetime:["日期时间","Date and time"],date:["日期","Date"],number:["数字","Number"],checkbox:["复选框","Checkbox"]},U4=(n,a)=>{if(n&&typeof n=="object"&&"localized"in n)return n.localized[a];const r=n instanceof Error?n.message:String(n),s=r.split(" / ");return s.length===2?s[a==="zh"?0:1]:r};function L4({value:n,locale:a,onSave:r}){const s=(N,T)=>a==="zh"?N:T,[o,d]=M.useState(n),[h,m]=M.useState(n),[y,b]=M.useState(!1),[p,g]=M.useState(!1),[S,j]=M.useState("");M.useEffect(()=>{y||(d(n),m(n))},[n,y]);const z=(N,T)=>{b(!0),d(L=>({...L,fields:L.fields.map(oe=>oe.key===N?{...oe,...T}:oe)}))},w=async()=>{j(""),g(!0);try{const N=US(o);await r(N,h),b(!1)}catch(N){j(U4(N,a))}finally{g(!1)}};return u.jsxs("section",{className:"frontmatter-settings",children:[u.jsx("h2",{children:s("文档属性","Document properties")}),u.jsx("p",{children:s("设置后续剪藏的字段名称、类型和日期格式。已有草稿保留剪藏时的字段。","Choose field names, types and date formatting for future captures. Existing drafts retain their captured fields.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("日期格式","Date format")}),u.jsx("input",{"aria-label":s("日期格式","Date format"),value:o.dateFormat,maxLength:120,disabled:p,onChange:N=>{b(!0),d({...o,dateFormat:N.target.value})}}),u.jsx("small",{children:"YYYY-MM-DD HH:mm:ss · YYYY/MM/DD · MMM D, YYYY"})]}),u.jsx("div",{className:"fm-fields",children:o.fields.map(N=>u.jsxs("fieldset",{className:"fm-field",disabled:p,children:[u.jsx("legend",{children:N.key}),u.jsxs("div",{className:"fm-field-row",children:[u.jsx(Kn,{label:s("启用字段","Enable field")+" "+N.key,checked:N.enabled,onChange:()=>z(N.key,{enabled:!N.enabled})}),u.jsx("input",{"aria-label":s("字段名称","Field name")+" "+N.key,value:N.name,maxLength:80,onChange:T=>z(N.key,{name:T.target.value})}),u.jsx("select",{"aria-label":s("字段类型","Field type")+" "+N.key,value:N.type,disabled:N.isBuiltin,onChange:T=>z(N.key,{type:T.target.value}),children:Um.map(T=>u.jsx("option",{value:T,children:R4[T][a==="zh"?0:1]},T))})]}),u.jsxs("div",{className:"fm-field-row",children:[u.jsxs("label",{children:[u.jsx("input",{type:"checkbox",checked:N.visibleInSidepanel!==!1,onChange:T=>z(N.key,{visibleInSidepanel:T.target.checked})}),s("显示在剪藏属性中","Show in clip properties")]}),!N.isBuiltin&&u.jsx("button",{className:"btn subtle",onClick:()=>{b(!0),d({...o,fields:o.fields.filter(T=>T.key!==N.key)})},children:s("移除字段","Remove field")})]})]},N.key))}),S&&u.jsx("p",{className:"error",role:"alert",children:S}),u.jsxs("div",{className:"button-row",children:[u.jsx("button",{className:"btn",disabled:p||o.fields.length>=64,onClick:()=>{let N=1;for(;o.fields.some(T=>T.key===`custom${N}`||T.name===`Custom ${N}`);)N++;b(!0),d({...o,fields:[...o.fields,{key:`custom${N}`,name:`Custom ${N}`,type:"text",enabled:!0,visibleInSidepanel:!0,isBuiltin:!1}]})},children:s("添加字段","Add field")}),u.jsx("button",{className:"btn primary",disabled:!y||p,onClick:()=>void w(),children:p?s("正在保存…","Saving…"):s("保存文档属性","Save document properties")}),y&&u.jsx("button",{className:"btn subtle",disabled:p,onClick:()=>{d(n),m(n),b(!1),j("")},children:s("放弃修改","Discard changes")})]})]})}function $4({clip:n,locale:a,onChange:r}){const s=n.frontMatterFields||di,o=(h,m)=>a==="zh"?h:m,d=s.filter(h=>h.enabled&&h.visibleInSidepanel!==!1&&!["title","tags"].includes(h.key));return u.jsx(u.Fragment,{children:d.map(h=>{const m=n.frontMatter[h.name],y=b=>r({...n.frontMatter,[h.name]:b});return u.jsxs("label",{className:"field",children:[u.jsx("span",{children:h.name}),h.type==="checkbox"?u.jsx("input",{type:"checkbox","aria-label":h.name,checked:m===!0,onChange:b=>y(b.target.checked)}):u.jsx("input",{"aria-label":h.name,type:h.type==="number"?"number":"text",step:h.type==="number"?"any":void 0,value:Array.isArray(m)?m.join(", "):String(m??""),onChange:b=>y(h.type==="number"?b.target.value===""?"":Number(b.target.value):h.type==="multiselect"?b.target.value.split(/[,,]/).map(p=>p.trim()).filter(Boolean):b.target.value)}),h.type==="multiselect"&&u.jsx("small",{children:o("用逗号分隔多个值","Separate values with commas")})]},h.key)})})}function B4({markdown:n,value:a,locale:r,onChange:s}){const o=(p,g)=>hi(r,p,g),d=M.useRef(null),[h,m]=M.useState([]);M.useEffect(()=>{var p;m(Array.from(((p=d.current)==null?void 0:p.querySelectorAll("h1,h2,h3,h4,h5,h6"))||[]).map(g=>({text:g.textContent||"",level:Number(g.tagName.slice(1))})))},[n]);const y=a.fontFamily==="serif"?'Georgia, "Times New Roman"':a.fontFamily==="mono"?"Menlo, Consolas":"Arial, Helvetica",b=a.chineseFont==="serif"?'"Songti SC", "Noto Serif CJK SC", serif':'"PingFang SC", "Microsoft YaHei", sans-serif';return u.jsxs(u.Fragment,{children:[u.jsxs("details",{className:"reading-tools",children:[u.jsx("summary",{children:o("阅读样式与提纲","Reading style and outline")}),u.jsxs("div",{className:"reading-fields",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("西文字体","Latin font")}),u.jsxs("select",{value:a.fontFamily,onChange:p=>s({fontFamily:p.target.value}),children:[u.jsx("option",{value:"system",children:o("无衬线","Sans serif")}),u.jsx("option",{value:"serif",children:o("衬线","Serif")}),u.jsx("option",{value:"mono",children:o("等宽","Monospace")})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("中文字体","Chinese font")}),u.jsxs("select",{value:a.chineseFont,onChange:p=>s({chineseFont:p.target.value}),children:[u.jsx("option",{value:"system",children:o("黑体","Sans serif")}),u.jsx("option",{value:"serif",children:o("宋体","Serif")})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("正文字号","Text size")}),u.jsx("select",{value:a.fontSize,onChange:p=>s({fontSize:Number(p.target.value)}),children:[...new Set([12,14,16,18,20,24,28,32,a.fontSize])].sort((p,g)=>p-g).map(p=>u.jsxs("option",{value:p,children:[p," px"]},p))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("阅读宽度","Reading width")}),u.jsx("select",{value:a.width,onChange:p=>s({width:Number(p.target.value)}),children:[...new Set([480,600,760,900,1100,a.width])].sort((p,g)=>p-g).map(p=>u.jsxs("option",{value:p,children:[p," px"]},p))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:o("行距","Line height")}),u.jsx("select",{value:a.lineHeight,onChange:p=>s({lineHeight:Number(p.target.value)}),children:[...new Set([1.4,1.6,1.75,2,2.25,a.lineHeight])].sort((p,g)=>p-g).map(p=>u.jsx("option",{value:p,children:p},p))})]})]}),u.jsx("nav",{className:"reading-outline","aria-label":o("文章提纲","Article outline"),children:h.length?h.map((p,g)=>u.jsx("button",{type:"button",style:{paddingInlineStart:8+Math.min(p.level-1,3)*12},onClick:()=>{var S,j;return(j=(S=d.current)==null?void 0:S.querySelectorAll("h1,h2,h3,h4,h5,h6")[g])==null?void 0:j.scrollIntoView({behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",block:"start"})},children:p.text},g)):u.jsx("p",{className:"caption",children:o("正文没有标题。可在 AI 阅读中生成提纲。","This article has no headings. You can generate an outline in AI reading.")})})]}),u.jsx("div",{ref:d,className:"markdown clip-preview reading-preview",style:{fontFamily:`${y}, ${b}`,fontSize:a.fontSize,lineHeight:a.lineHeight,maxWidth:a.width},dangerouslySetInnerHTML:{__html:Uh(n)}})]})}function Z4({value:n,locale:a,onSave:r}){const s=(K,q)=>a==="zh"?K:q,[o,d]=M.useState(null),[h,m]=M.useState(""),[y,b]=M.useState(!1),[p,g]=M.useState(""),[S,j]=M.useState(""),z=M.useRef(!1),w=M.useRef(n);w.current=n;const N=JSON.stringify(n),T=!!o&&h!==N,L=M.useMemo(()=>Dm(n,a),[n,a]),oe=M.useRef(null);M.useEffect(()=>{var K;o&&((K=oe.current)==null||K.focus())},[o==null?void 0:o.id]);async function I(K,q=!1){if(!z.current&&!(q&&h!==JSON.stringify(w.current))){z.current=!0,b(!0),g(""),j("");try{await r(K,q?JSON.parse(h):w.current),q&&d(null),j(s("阅读预设已保存。","Reading presets saved."))}catch(H){g(H instanceof Error?H.message:String(H))}finally{z.current=!1,b(!1)}}}function te(K){m(N),d({...K}),g(""),j("")}return u.jsxs("section",{className:"reader-preset-settings","aria-label":s("阅读预设","Reading presets"),children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h2",{children:s("阅读预设","Reading presets")}),u.jsx("p",{className:"caption",children:s("把常用问题保存为快捷操作。仅在点击预设时发送文章和指令。","Save frequent questions as quick actions. The article and instruction are sent only when you click a preset.")})]}),u.jsxs("button",{type:"button",className:"btn",disabled:y||!!o||L.length>=100,onClick:()=>te({id:`custom-${crypto.randomUUID()}`,name:"",prompt:"",enabled:!0,order:L.length}),children:[u.jsx(Cl,{size:14}),s("添加预设","Add preset")]})]}),p&&u.jsx("p",{role:"alert",className:"failed",children:p}),S&&u.jsx("p",{role:"status",className:"caption",children:S}),o&&u.jsxs("form",{className:"reader-preset-editor",onSubmit:K=>{K.preventDefault(),!(!o.name.trim()||!o.prompt.trim()||T)&&I(t0(w.current,o),!0)},children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("名称","Name")}),u.jsx("input",{ref:oe,"aria-label":s("预设名称","Preset name"),value:o.name,maxLength:100,disabled:y,onChange:K=>d({...o,name:K.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("阅读指令","Reading instruction")}),u.jsx("textarea",{"aria-label":s("阅读指令","Reading instruction"),value:o.prompt,maxLength:12e3,rows:6,disabled:y,onChange:K=>d({...o,prompt:K.target.value})})]}),T&&u.jsx("p",{role:"alert",className:"failed",children:s("预设已在其他窗口修改。草稿保留,请取消后重新打开条目再保存。","Presets changed in another window. Your draft is preserved; cancel and reopen the entry before saving.")}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"submit",className:"btn primary",disabled:y||T||!o.name.trim()||!o.prompt.trim(),children:s("保存预设","Save preset")}),u.jsx("button",{type:"button",className:"btn",disabled:y,onClick:()=>d(null),children:s("取消","Cancel")})]})]}),u.jsx("div",{className:"reader-preset-list",children:L.map((K,q)=>u.jsxs("div",{className:"reader-preset-row",children:[u.jsxs("label",{className:"reader-preset-name",children:[u.jsx("input",{type:"checkbox","aria-label":s(`启用 ${K.name}`,`Enable ${K.name}`),checked:K.enabled,disabled:y||!!o,onChange:H=>void I(t0(w.current,{...K,enabled:H.target.checked}))}),u.jsx("span",{children:K.name})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{type:"button",className:"icon-btn",disabled:y||!!o||q===0,"aria-label":s(`上移 ${K.name}`,`Move ${K.name} up`),onClick:()=>void I(n0(w.current,a,K.id,-1)),children:u.jsx(bm,{size:14})}),u.jsx("button",{type:"button",className:"icon-btn",disabled:y||!!o||q===L.length-1,"aria-label":s(`下移 ${K.name}`,`Move ${K.name} down`),onClick:()=>void I(n0(w.current,a,K.id,1)),children:u.jsx(ym,{size:14})}),u.jsx("button",{type:"button",className:"icon-btn",disabled:y||!!o,"aria-label":s(`编辑 ${K.name}`,`Edit ${K.name}`),onClick:()=>te(K),children:u.jsx(p1,{size:14})}),K.isBuiltin?u.jsx("button",{type:"button",className:"icon-btn",disabled:y||!!o||!K.isModified,"aria-label":s(`恢复 ${K.name} 默认值`,`Restore ${K.name} default`),onClick:()=>void I(w.current.filter(H=>H.id!==K.id)),children:u.jsx(b1,{size:14})}):u.jsx("button",{type:"button",className:"icon-btn",disabled:y||!!o,"aria-label":s(`移除 ${K.name}`,`Remove ${K.name}`),onClick:()=>void I(w.current.filter(H=>H.id!==K.id)),children:u.jsx(Xi,{size:14})})]})]},K.id))})]})}function Pc(n){if(typeof n=="boolean"||typeof n=="number"&&Number.isFinite(n))return String(n);const a=String(n),r=/^(?:null|true|false|yes|no|on|off|y|n|~|[-+]?(?:\.(?:inf|nan)|(?:\d[\d_]*(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?|0[xob][a-f0-9_]+))$/i.test(a)||/^\d{4}-\d{1,2}-\d{1,2}(?:$|[Tt\s])/.test(a);return!a||r||/^[\s]|[\s]$|[:#\-?{}\[\],&*!|<>'"%@`]|[\x00-\x1f\x7f\u0085\u2028\u2029]/.test(a)?JSON.stringify(a).replace(/[\u0085\u2028\u2029]/g,s=>`\\u${s.charCodeAt(0).toString(16).padStart(4,"0")}`):a}function H4(n){const a=[];for(const[r,s]of Object.entries(n))if(!(s==null||s===""||Array.isArray(s)&&s.length===0))if(Array.isArray(s)){a.push(`${Pc(r)}:`);for(const o of s)a.push(` - ${Pc(o)}`)}else a.push(`${Pc(r)}: ${Pc(s)}`);return a.length?`---
|
|
366
|
+
${a.join(`
|
|
367
|
+
`)}
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
`:""}function q4(n,a="zh"){const r=n.filter(s=>s.type==="image"?!!s.imageUrl:!!s.text).map(s=>{var h;const o=a==="zh"?Uw(s.color):{red:"Question",green:"Insight",blue:"Definition",purple:"Action"}[["#FBE3E3","#E1F3E5","#DFEBFB","#EFE4FA"].includes(s.color.toUpperCase())?{"#FBE3E3":"red","#E1F3E5":"green","#DFEBFB":"blue","#EFE4FA":"purple"}[s.color.toUpperCase()]:""];if(s.type==="image"&&s.imageUrl&&/^https?:\/\//i.test(s.imageUrl))return`> ![${(s.imageAlt||s.text||"").replace(/[\[\]\n]/g," ")}](<${s.imageUrl.replace(/[<>\s]/g,encodeURIComponent)}>)${s.note?`
|
|
371
|
+
> `+s.note.replace(/\n/g," "):""}`;let d="> "+(o?`**[${o}]** `:"")+s.text.replace(/\s*\n\s*/g," ").trim();return(h=s.note)!=null&&h.trim()&&(d+=(a==="zh"?`
|
|
372
|
+
> — 备注:`:`
|
|
373
|
+
> — Note: `)+s.note.replace(/\s*\n\s*/g," ").trim()),d});return r.length?`
|
|
374
|
+
|
|
375
|
+
## ${a==="zh"?"划线摘录":"Highlights"}
|
|
376
|
+
|
|
377
|
+
${r.join(`
|
|
378
|
+
>
|
|
379
|
+
`)}
|
|
380
|
+
`:""}function lm(n){const a=n.includeFrontMatter&&n.frontMatter?H4(n.frontMatter):"",r=(n.includeHighlights??!0)&&n.highlights?q4(n.highlights,n.locale):"";return a+n.body+r}function V4(n,a,r,s,o=!0){const d=r?new Set(r):void 0,h=a.filter(g=>(!d||d.has(g.id))&&g.content.trim());if(!h.length)throw new Error(s==="zh"?"没有可保存的消息。":"There are no messages to save.");const m=`${n.title} — ${s==="zh"?"阅读对话":"Reading conversation"}`,y=h.map(g=>`## ${g.role==="user"?s==="zh"?"提问":"Question":s==="zh"?"回答":"Answer"}
|
|
381
|
+
|
|
382
|
+
${g.content}`).join(`
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
`),b={...n.frontMatter},p=lo(n.frontMatterFields,"title");return p&&(b[p]=m),{...n,title:m,markdown:y,frontMatter:b,highlights:[],document:lm({frontMatter:b,body:y,includeFrontMatter:o,locale:s})}}var Sn=Uint8Array,Qn=Uint16Array,Lm=Int32Array,$m=new Sn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Bm=new Sn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),h0=new Sn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),IS=function(n,a){for(var r=new Qn(31),s=0;s<31;++s)r[s]=a+=1<<n[s-1];for(var o=new Lm(r[30]),s=1;s<30;++s)for(var d=r[s];d<r[s+1];++d)o[d]=d-r[s]<<5|s;return{b:r,r:o}},GS=IS($m,2),Y4=GS.b,rm=GS.r;Y4[28]=258,rm[258]=28;var I4=IS(Bm,0),m0=I4.r,sm=new Qn(32768);for(var bt=0;bt<32768;++bt){var Yi=(bt&43690)>>1|(bt&21845)<<1;Yi=(Yi&52428)>>2|(Yi&13107)<<2,Yi=(Yi&61680)>>4|(Yi&3855)<<4,sm[bt]=((Yi&65280)>>8|(Yi&255)<<8)>>1}var ro=(function(n,a,r){for(var s=n.length,o=0,d=new Qn(a);o<s;++o)n[o]&&++d[n[o]-1];var h=new Qn(a);for(o=1;o<a;++o)h[o]=h[o-1]+d[o-1]<<1;var m;if(r){m=new Qn(1<<a);var y=15-a;for(o=0;o<s;++o)if(n[o])for(var b=o<<4|n[o],p=a-n[o],g=h[n[o]-1]++<<p,S=g|(1<<p)-1;g<=S;++g)m[sm[g]>>y]=b}else for(m=new Qn(s),o=0;o<s;++o)n[o]&&(m[o]=sm[h[n[o]-1]++]>>15-n[o]);return m}),kl=new Sn(288);for(var bt=0;bt<144;++bt)kl[bt]=8;for(var bt=144;bt<256;++bt)kl[bt]=9;for(var bt=256;bt<280;++bt)kl[bt]=7;for(var bt=280;bt<288;++bt)kl[bt]=8;var yu=new Sn(32);for(var bt=0;bt<32;++bt)yu[bt]=5;var G4=ro(kl,9,0),F4=ro(yu,5,0),FS=function(n){return(n+7)/8|0},KS=function(n,a,r){return(r==null||r>n.length)&&(r=n.length),new Sn(n.subarray(a,r))},K4=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Tu=function(n,a,r){var s=new Error(a||K4[n]);if(s.code=n,Error.captureStackTrace&&Error.captureStackTrace(s,Tu),!r)throw s;return s},oi=function(n,a,r){r<<=a&7;var s=a/8|0;n[s]|=r,n[s+1]|=r>>8},Is=function(n,a,r){r<<=a&7;var s=a/8|0;n[s]|=r,n[s+1]|=r>>8,n[s+2]|=r>>16},Dh=function(n,a){for(var r=[],s=0;s<n.length;++s)n[s]&&r.push({s,f:n[s]});var o=r.length,d=r.slice();if(!o)return{t:QS,l:0};if(o==1){var h=new Sn(r[0].s+1);return h[r[0].s]=1,{t:h,l:1}}r.sort(function(te,K){return te.f-K.f}),r.push({s:-1,f:25001});var m=r[0],y=r[1],b=0,p=1,g=2;for(r[0]={s:-1,f:m.f+y.f,l:m,r:y};p!=o-1;)m=r[r[b].f<r[g].f?b++:g++],y=r[b!=p&&r[b].f<r[g].f?b++:g++],r[p++]={s:-1,f:m.f+y.f,l:m,r:y};for(var S=d[0].s,s=1;s<o;++s)d[s].s>S&&(S=d[s].s);var j=new Qn(S+1),z=om(r[p-1],j,0);if(z>a){var s=0,w=0,N=z-a,T=1<<N;for(d.sort(function(K,q){return j[q.s]-j[K.s]||K.f-q.f});s<o;++s){var L=d[s].s;if(j[L]>a)w+=T-(1<<z-j[L]),j[L]=a;else break}for(w>>=N;w>0;){var oe=d[s].s;j[oe]<a?w-=1<<a-j[oe]++-1:++s}for(;s>=0&&w;--s){var I=d[s].s;j[I]==a&&(--j[I],++w)}z=a}return{t:new Sn(j),l:z}},om=function(n,a,r){return n.s==-1?Math.max(om(n.l,a,r+1),om(n.r,a,r+1)):a[n.s]=r},p0=function(n){for(var a=n.length;a&&!n[--a];);for(var r=new Qn(++a),s=0,o=n[0],d=1,h=function(y){r[s++]=y},m=1;m<=a;++m)if(n[m]==o&&m!=a)++d;else{if(!o&&d>2){for(;d>138;d-=138)h(32754);d>2&&(h(d>10?d-11<<5|28690:d-3<<5|12305),d=0)}else if(d>3){for(h(o),--d;d>6;d-=6)h(8304);d>2&&(h(d-3<<5|8208),d=0)}for(;d--;)h(o);d=1,o=n[m]}return{c:r.subarray(0,s),n:a}},Gs=function(n,a){for(var r=0,s=0;s<a.length;++s)r+=n[s]*a[s];return r},XS=function(n,a,r){var s=r.length,o=FS(a+2);n[o]=s&255,n[o+1]=s>>8,n[o+2]=n[o]^255,n[o+3]=n[o+1]^255;for(var d=0;d<s;++d)n[o+d+4]=r[d];return(o+4+s)*8},g0=function(n,a,r,s,o,d,h,m,y,b,p){oi(a,p++,r),++o[256];for(var g=Dh(o,15),S=g.t,j=g.l,z=Dh(d,15),w=z.t,N=z.l,T=p0(S),L=T.c,oe=T.n,I=p0(w),te=I.c,K=I.n,q=new Qn(19),H=0;H<L.length;++H)++q[L[H]&31];for(var H=0;H<te.length;++H)++q[te[H]&31];for(var J=Dh(q,7),me=J.t,ae=J.l,ge=19;ge>4&&!me[h0[ge-1]];--ge);var fe=b+5<<3,ie=Gs(o,kl)+Gs(d,yu)+h,G=Gs(o,S)+Gs(d,w)+h+14+3*ge+Gs(q,me)+2*q[16]+3*q[17]+7*q[18];if(y>=0&&fe<=ie&&fe<=G)return XS(a,p,n.subarray(y,y+b));var C,R,B,ce;if(oi(a,p,1+(G<ie)),p+=2,G<ie){C=ro(S,j,0),R=S,B=ro(w,N,0),ce=w;var ne=ro(me,ae,0);oi(a,p,oe-257),oi(a,p+5,K-1),oi(a,p+10,ge-4),p+=14;for(var H=0;H<ge;++H)oi(a,p+3*H,me[h0[H]]);p+=3*ge;for(var xe=[L,te],Te=0;Te<2;++Te)for(var Me=xe[Te],H=0;H<Me.length;++H){var O=Me[H]&31;oi(a,p,ne[O]),p+=me[O],O>15&&(oi(a,p,Me[H]>>5&127),p+=Me[H]>>12)}}else C=G4,R=kl,B=F4,ce=yu;for(var H=0;H<m;++H){var X=s[H];if(X>255){var O=X>>18&31;Is(a,p,C[O+257]),p+=R[O+257],O>7&&(oi(a,p,X>>23&31),p+=$m[O]);var pe=X&31;Is(a,p,B[pe]),p+=ce[pe],pe>3&&(Is(a,p,X>>5&8191),p+=Bm[pe])}else Is(a,p,C[X]),p+=R[X]}return Is(a,p,C[256]),p+R[256]},X4=new Lm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),QS=new Sn(0),Q4=function(n,a,r,s,o,d){var h=d.z||n.length,m=new Sn(s+h+5*(1+Math.ceil(h/7e3))+o),y=m.subarray(s,m.length-o),b=d.l,p=(d.r||0)&7;if(a){p&&(y[0]=d.r>>3);for(var g=X4[a-1],S=g>>13,j=g&8191,z=(1<<r)-1,w=d.p||new Qn(32768),N=d.h||new Qn(z+1),T=Math.ceil(r/3),L=2*T,oe=function(xn){return(n[xn]^n[xn+1]<<T^n[xn+2]<<L)&z},I=new Lm(25e3),te=new Qn(288),K=new Qn(32),q=0,H=0,J=d.i||0,me=0,ae=d.w||0,ge=0;J+2<h;++J){var fe=oe(J),ie=J&32767,G=N[fe];if(w[ie]=G,N[fe]=ie,ae<=J){var C=h-J;if((q>7e3||me>24576)&&(C>423||!b)){p=g0(n,y,0,I,te,K,H,me,ge,J-ge,p),me=q=H=0,ge=J;for(var R=0;R<286;++R)te[R]=0;for(var R=0;R<30;++R)K[R]=0}var B=2,ce=0,ne=j,xe=ie-G&32767;if(C>2&&fe==oe(J-xe))for(var Te=Math.min(S,C)-1,Me=Math.min(32767,J),O=Math.min(258,C);xe<=Me&&--ne&&ie!=G;){if(n[J+B]==n[J+B-xe]){for(var X=0;X<O&&n[J+X]==n[J+X-xe];++X);if(X>B){if(B=X,ce=xe,X>Te)break;for(var pe=Math.min(xe,X-2),ue=0,R=0;R<pe;++R){var ze=J-xe+R&32767,re=w[ze],he=ze-re&32767;he>ue&&(ue=he,G=ze)}}}ie=G,G=w[ie],xe+=ie-G&32767}if(ce){I[me++]=268435456|rm[B]<<18|m0[ce];var de=rm[B]&31,ye=m0[ce]&31;H+=$m[de]+Bm[ye],++te[257+de],++K[ye],ae=J+B,++q}else I[me++]=n[J],++te[n[J]]}}for(J=Math.max(J,ae);J<h;++J)I[me++]=n[J],++te[n[J]];p=g0(n,y,b,I,te,K,H,me,ge,J-ge,p),b||(d.r=p&7|y[p/8|0]<<3,p-=7,d.h=N,d.p=w,d.i=J,d.w=ae)}else{for(var J=d.w||0;J<h+b;J+=65535){var Ve=J+65535;Ve>=h&&(y[p/8|0]=b,Ve=h),p=XS(y,p+1,n.subarray(J,Ve))}d.i=h}return KS(m,0,s+FS(p)+o)},J4=(function(){for(var n=new Int32Array(256),a=0;a<256;++a){for(var r=a,s=9;--s;)r=(r&1&&-306674912)^r>>>1;n[a]=r}return n})(),P4=function(){var n=-1;return{p:function(a){for(var r=n,s=0;s<a.length;++s)r=J4[r&255^a[s]]^r>>>8;n=r},d:function(){return~n}}},W4=function(n,a,r,s,o){if(!o&&(o={l:1},a.dictionary)){var d=a.dictionary.subarray(-32768),h=new Sn(d.length+n.length);h.set(d),h.set(n,d.length),n=h,o.w=d.length}return Q4(n,a.level==null?6:a.level,a.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+a.mem,r,s,o)},JS=function(n,a){var r={};for(var s in n)r[s]=n[s];for(var s in a)r[s]=a[s];return r},nn=function(n,a,r){for(;r;++a)n[a]=r,r>>>=8};function e3(n,a){return W4(n,a||{},0,0)}var PS=function(n,a,r,s){for(var o in n){var d=n[o],h=a+o,m=s;Array.isArray(d)&&(m=JS(s,d[1]),d=d[0]),ArrayBuffer.isView(d)?r[h]=[d,m]:(r[h+="/"]=[new Sn(0),m],PS(d,h,r,s))}},v0=typeof TextEncoder<"u"&&new TextEncoder,t3=typeof TextDecoder<"u"&&new TextDecoder,n3=0;try{t3.decode(QS,{stream:!0}),n3=1}catch{}function y0(n,a){var r;if(v0)return v0.encode(n);for(var s=n.length,o=new Sn(n.length+(n.length>>1)),d=0,h=function(b){o[d++]=b},r=0;r<s;++r){if(d+5>o.length){var m=new Sn(d+8+(s-r<<1));m.set(o),o=m}var y=n.charCodeAt(r);y<128||a?h(y):y<2048?(h(192|y>>6),h(128|y&63)):y>55295&&y<57344?(y=65536+(y&1047552)|n.charCodeAt(++r)&1023,h(240|y>>18),h(128|y>>12&63),h(128|y>>6&63),h(128|y&63)):(h(224|y>>12),h(128|y>>6&63),h(128|y&63))}return KS(o,0,d)}var cm=function(n){var a=0;if(n)for(var r in n){var s=n[r].length;s>65535&&Tu(9),a+=s+4}return a},b0=function(n,a,r,s,o,d,h,m){var y=s.length,b=r.extra,p=m&&m.length,g=cm(b);nn(n,a,h!=null?33639248:67324752),a+=4,h!=null&&(n[a++]=20,n[a++]=r.os),n[a]=20,a+=2,n[a++]=r.flag<<1|(d<0&&8),n[a++]=o&&8,n[a++]=r.compression&255,n[a++]=r.compression>>8;var S=new Date(r.mtime==null?Date.now():r.mtime),j=S.getFullYear()-1980;if((j<0||j>119)&&Tu(10),nn(n,a,j<<25|S.getMonth()+1<<21|S.getDate()<<16|S.getHours()<<11|S.getMinutes()<<5|S.getSeconds()>>1),a+=4,d!=-1&&(nn(n,a,r.crc),nn(n,a+4,d<0?-d-2:d),nn(n,a+8,r.size)),nn(n,a+12,y),nn(n,a+14,g),a+=16,h!=null&&(nn(n,a,p),nn(n,a+6,r.attrs),nn(n,a+10,h),a+=14),n.set(s,a),a+=y,g)for(var z in b){var w=b[z],N=w.length;nn(n,a,+z),nn(n,a+2,N),n.set(w,a+4),a+=4+N}return p&&(n.set(m,a),a+=p),a},a3=function(n,a,r,s,o){nn(n,a,101010256),nn(n,a+8,r),nn(n,a+10,r),nn(n,a+12,s),nn(n,a+16,o)};function i3(n,a){a||(a={});var r={},s=[];PS(n,"",r,a);var o=0,d=0;for(var h in r){var m=r[h],y=m[0],b=m[1],p=b.level==0?0:8,g=y0(h),S=g.length,j=b.comment,z=j&&y0(j),w=z&&z.length,N=cm(b.extra);S>65535&&Tu(11);var T=p?e3(y,b):y,L=T.length,oe=P4();oe.p(y),s.push(JS(b,{size:y.length,crc:oe.d(),c:T,f:g,m:z,u:S!=h.length||z&&j.length!=w,o,compression:p})),o+=30+S+N+L,d+=76+2*(S+N)+(w||0)+L}for(var I=new Sn(d+22),te=o,K=d-o,q=0;q<s.length;++q){var g=s[q];b0(I,g.o,g,g.f,g.u,g.c.length);var H=30+g.f.length+cm(g.extra);I.set(g.c,g.o+H),b0(I,o,g,g.f,g.u,g.c.length,g.o,g.m),o+=16+H+(g.m?g.m.length:0)}return a3(I,o,s.length,K,te),I}const xa=Object.freeze({cards:6,source:12e4,prompt:12e3,imageBytes:20*1024*1024,totalBytes:100*1024*1024,responseBytes:29*1024*1024}),l3=["1:1","2:3","3:2","16:9","9:16"];function um(n,a,r){if(!["png","jpg","webp","gif","zip"].includes(a))throw new Error("Unsupported image-card filename extension");let s=n.replace(/[\x00-\x1f\x7f<>:"/\\|?*]/g,"-").replace(/^[. ]+|[. ]+$/g,"").trim()||"Untitled";const o=r!==void 0?`${String(r).padStart(2,"0")}-`:/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(s)?"Clip-":"",d=`${a==="zip"?"-cards":""}.${a}`,h=200-Lh(o+d).length;let m="",y=0;for(const b of s){const p=Lh(b).length;if(y+p>h)break;m+=b,y+=p}return s=m.replace(/[. ]+$/g,"")||"Untitled",o+s+d}class po extends Error{constructor(a,r,s){super(s),this.code=a,this.zh=r,this.en=s}}const r3=()=>new po("plan","模型未返回完整且有效的图文卡提纲,请重新规划。","The model did not return a complete, valid card plan. Plan again."),so=()=>new po("image","生图服务未返回有效的 PNG、JPEG、WebP 或 GIF 图片。","The image service did not return a valid PNG, JPEG, WebP or GIF image.");function S0(n,a){return n instanceof po?a==="zh"?n.zh:n.en:n instanceof c4?a==="zh"?"请先登录 Forsion 账号。":"Sign in to Forsion first.":n instanceof DOMException&&n.name==="AbortError"?a==="zh"?"已停止;已生成的图片仍保留。":"Stopped; completed images are retained.":a==="zh"?"图文卡请求失败;已完成的图片仍保留,请检查模型与连接。":"The image-card request failed; completed images are retained. Check the model and connection."}bn({title:We().max(500),url:We().max(4e3),body:We().min(1).max(xa.source)}).strict();bn({title:We().trim().min(1).max(200),cards:ya(bn({title:We().trim().min(1).max(200),caption:We().max(2e3),prompt:We().trim().min(1).max(xa.prompt)}).strict()).min(1).max(xa.cards)}).strict();function s3(n){if(n.length<8)throw so();if([137,80,78,71,13,10,26,10].every((r,s)=>n[s]===r))return{mime:"image/png",extension:"png"};if(n[0]===255&&n[1]===216&&n[2]===255)return{mime:"image/jpeg",extension:"jpg"};const a=String.fromCharCode(...n.slice(0,12));if(/^GIF8[79]a/.test(a))return{mime:"image/gif",extension:"gif"};if(a.startsWith("RIFF")&&a.slice(8,12)==="WEBP")return{mime:"image/webp",extension:"webp"};throw so()}function o3(n){if(typeof n!="string"||!n||n.length%4!==0||n.length>Math.ceil(xa.imageBytes/3)*4||!/^[A-Za-z0-9+/]*={0,2}$/.test(n))throw so();let a;try{a=atob(n)}catch{throw so()}if(!a.length||a.length>xa.imageBytes)throw so();const r=Uint8Array.from(a,s=>s.charCodeAt(0));return{...s3(r),base64:n,bytes:r.length}}function c3(n,a,r){if(n.cards.length<1||n.cards.length>xa.cards)throw r3();const s=Object.create(null);let o=0,d=0;const h=n.cards.map((m,y)=>{const b=a.find(g=>g.cardId===m.id);let p;if(b!=null&&b.image){const g=o3(b.image.base64);if(o+=g.bytes,o>xa.totalBytes)throw new po("size","图片总量超过 100 MiB,请分别下载。","The images exceed 100 MiB in total. Download them individually.");p=um(m.title,g.extension,y+1),s[p]=[Uint8Array.from(atob(g.base64),S=>S.charCodeAt(0)),{level:0}],d++}return{...m,status:p?b!=null&&b.generatedPrompt&&b.generatedPrompt!==m.prompt?"previous-version":"generated":b!=null&&b.error?"failed":"pending",filename:p,...b!=null&&b.generatedPrompt?{generatedPrompt:b.generatedPrompt}:{},...b!=null&&b.error?{error:b.error}:{}}});if(!d)throw new po("empty","尚无可下载的图片。","No generated images are available to download.");return s["manifest.json"]=Lh(JSON.stringify({title:n.title,source:{title:r.title,url:r.url},cards:h},null,2)),{bytes:i3(s,{level:0}),filename:um(n.title,"zip"),count:d}}function x0(n,a,r){const s=URL.createObjectURL(new Blob([n],{type:r})),o=document.createElement("a");o.href=s,o.download=a,document.body.append(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(s),3e4)}function u3({locale:n,providers:a,defaultProviderId:r,source:s,onClose:o,session:d,onSessionChange:h}){var ca,qa,wa,el,rn;const m=(se,Ye)=>n==="zh"?se:Ye,y=a.filter(se=>["forsion","openai"].includes(se.kind)),[b,p]=M.useState((d==null?void 0:d.planner)||((ca=a.find(se=>se.id===r))==null?void 0:ca.id)||((qa=a[0])==null?void 0:qa.id)||""),[g,S]=M.useState((d==null?void 0:d.imageProvider)||((wa=y.find(se=>se.id===r))==null?void 0:wa.id)||((el=y[0])==null?void 0:el.id)||""),[j,z]=M.useState((d==null?void 0:d.model)||""),[w,N]=M.useState([]),[T,L]=M.useState(!1),[oe,I]=M.useState(""),[te,K]=M.useState((d==null?void 0:d.count)||3),[q,H]=M.useState((d==null?void 0:d.style)||""),[J,me]=M.useState((d==null?void 0:d.size)||"2:3"),[ae,ge]=M.useState((d==null?void 0:d.plan)||null),[fe,ie]=M.useState((d==null?void 0:d.planSource)||null),[G,C]=M.useState((d==null?void 0:d.results)||[]),[R,B]=M.useState(""),[ce,ne]=M.useState(""),[xe,Te]=M.useState(""),[Me,O]=M.useState(d!=null&&d.interrupted?m("上次请求因离开面板而停止;已完成图片保留。已提交给服务的请求仍可能计费。","The previous request stopped when the panel closed; completed images are retained. A request already submitted to the service may still incur a charge."):""),X=M.useRef(!1),pe=M.useRef(!1),ue=M.useRef(""),ze=M.useRef(!0),re=M.useRef({planner:b,imageProvider:g,model:j,count:te,style:q,size:J,plan:ae,planSource:fe,results:G}),he=M.useRef(h),de=M.useRef(g);he.current=h,re.current={planner:b,imageProvider:g,model:j,count:te,style:q,size:J,plan:ae,planSource:fe,results:G},M.useEffect(()=>{h==null||h(re.current)},[b,g,j,te,q,J,ae,fe,G,h]),M.useEffect(()=>(ze.current=!0,()=>{var se;ze.current=!1,pe.current=!0,(se=he.current)==null||se.call(he,{...re.current,interrupted:!!ue.current}),ue.current&&Se("image-card-cancel",{requestId:ue.current}).catch(()=>{})}),[]),M.useEffect(()=>{let se=!0;const Ye=de.current===g?re.current.model:"";de.current=g,N([]),z(Ye),I("");const Ae=y.find(ht=>ht.id===g);if(!Ae||Ae.kind!=="forsion"){L(!1);return}return L(!0),Se("image-card-models",{providerId:g}).then(ht=>{se&&(N(ht.models),z(ht.models.some(kt=>kt.id===Ye)?Ye:ht.defaultModelId||""),ht.models.length||I(m("当前 Forsion 账号没有可用生图模型。","No image models are available for this Forsion account.")))}).catch(ht=>{se&&I(ht instanceof Error?ht.message:m("无法读取生图模型。","Could not load image models."))}).finally(()=>{se&&L(!1)}),()=>{se=!1}},[g,n]);const ye=se=>X.current?!1:(X.current=!0,pe.current=!1,B(se),Te(""),O(""),!0),Ve=()=>{X.current=!1,ue.current="",ze.current&&(B(""),ne(""))},xn=se=>se instanceof Error?se.message:S0(se,n);async function ja(){if(ye("plan")){ue.current=crypto.randomUUID();try{const se=await Se("image-card-plan",{requestId:ue.current,providerId:b,source:s,count:te,style:q,locale:n});if(pe.current||!ze.current)return;ge(se),ie({...s}),C([]),O(m("提纲已完成。检查每张卡片的提示词,再开始生成图片。","The plan is ready. Review each card prompt before generating images."))}catch(se){ze.current&&Te(pe.current?m("规划已停止,原有结果仍保留。","Planning stopped; existing results are retained."):xn(se))}finally{Ve()}}}async function Xt(se){if(!(!ae||!se.length||!ye("generate")))try{for(const Ye of ae.cards.filter(Ae=>se.includes(Ae.id))){if(pe.current||!ze.current)break;ue.current=crypto.randomUUID(),ne(Ye.id);try{const Ae=await Se("image-card-generate",{requestId:ue.current,providerId:g,model:j,prompt:Ye.prompt,size:J});ze.current&&C(ht=>[...ht.filter(kt=>kt.cardId!==Ye.id),{cardId:Ye.id,image:Ae,generatedPrompt:Ye.prompt}])}catch(Ae){ze.current&&C(ht=>{const kt=ht.find(za=>za.cardId===Ye.id);return[...ht.filter(za=>za.cardId!==Ye.id),{...kt,cardId:Ye.id,error:pe.current?m("已停止;服务端已提交的请求可能仍会计费。","Stopped; a request already submitted to the service may still incur a charge."):xn(Ae)}]});break}}}finally{Ve()}}async function _t(){pe.current=!0,O(m("正在停止;已完成的图片仍保留。","Stopping; completed images are retained.")),ue.current&&await Se("image-card-cancel",{requestId:ue.current}).catch(se=>Te(xn(se)))}function et(se,Ye){ge(Ae=>Ae&&{...Ae,cards:Ae.cards.map(ht=>ht.id===se?{...ht,...Ye}:ht)})}function un(se,Ye){x0(Uint8Array.from(atob(Ye.base64),Ae=>Ae.charCodeAt(0)),um(se.title,Ye.extension),Ye.mime)}function an(){try{const se=c3(ae,G,fe);x0(se.bytes,se.filename,"application/zip"),O(m(`已交给浏览器下载 ${se.count} 张图片及提纲记录。`,`${se.count} images and the plan manifest were passed to browser downloads.`))}catch(se){Te(S0(se,n))}}const ln=G.filter(se=>se.image).length,kn=(ae==null?void 0:ae.cards.filter(se=>!G.some(Ye=>Ye.cardId===se.id&&Ye.image&&Ye.generatedPrompt===se.prompt)).map(se=>se.id))||[],Ha=!!fe&&(fe.title!==s.title||fe.url!==s.url||fe.body!==s.body),Zt=!R&&!!g&&!!j.trim()&&!T;return u.jsxs("section",{className:"image-card-studio","aria-label":m("图文卡工作室","Image card studio"),children:[u.jsxs("div",{className:"ics-heading",children:[u.jsxs("div",{children:[u.jsx("h2",{children:m("图文卡","Image cards")}),u.jsx("p",{className:"caption",children:m("先审提纲,再用生图模型绘制。","Review the outline, then render with an image model.")})]}),o&&u.jsx("button",{className:"icon-btn",onClick:o,"aria-label":m("关闭图文卡","Close image cards"),children:u.jsx(Tr,{size:17})})]}),u.jsxs("p",{className:"ics-source",children:[m("当前来源:","Current source: "),s.title||m("所选内容","Selected content")," · ",s.body.length.toLocaleString()," ",m("字符","characters")]}),u.jsxs("div",{className:"ics-controls",children:[u.jsxs("label",{children:[m("规划模型","Planning provider"),u.jsx("select",{value:b,disabled:!!R,onChange:se=>p(se.target.value),children:a.map(se=>u.jsxs("option",{value:se.id,children:[se.name,se.model?` · ${se.model}`:""]},se.id))})]}),u.jsxs("label",{children:[m("卡片数量","Number of cards"),u.jsx("select",{value:te,disabled:!!R,onChange:se=>K(Number(se.target.value)),children:Array.from({length:xa.cards},(se,Ye)=>u.jsx("option",{value:Ye+1,children:Ye+1},Ye))})]})]}),u.jsxs("label",{className:"ics-field",children:[m("风格与重点(可选)","Style and emphasis (optional)"),u.jsx("textarea",{rows:2,maxLength:1e3,value:q,disabled:!!R,placeholder:m("例如:简洁的科普插画,强调原文的三个结论","For example: simple educational illustrations emphasizing three conclusions"),onChange:se=>H(se.target.value)})]}),u.jsxs("div",{className:"ics-actions",children:[u.jsxs("button",{className:"btn primary",disabled:!!R||!b||!s.body.trim()||s.body.length>xa.source,onClick:()=>void ja(),children:[u.jsx(gw,{size:15}),R==="plan"?m("正在规划…","Planning…"):ae?m("重新规划(替换结果)","Plan again (replace results)"):m("生成提纲","Plan cards")]}),R&&u.jsxs("button",{className:"btn",onClick:()=>void _t(),children:[u.jsx(mw,{size:14}),m("停止","Stop")]})]}),s.body.length>xa.source&&u.jsx("p",{role:"alert",className:"ics-error",children:m("来源超过 120,000 字符,请先选取较小的片段。","The source exceeds 120,000 characters. Select a smaller passage first.")}),Ha&&u.jsx("p",{className:"caption",children:m("来源已变化。下方提纲与图片仍属于之前的来源;重新规划才会替换它们。","The source changed. The outline and images below still belong to the previous source; planning again replaces them.")}),ae&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ics-divider"}),u.jsx("h3",{children:ae.title}),u.jsxs("div",{className:"ics-controls",children:[u.jsxs("label",{children:[m("生图服务","Image provider"),u.jsx("select",{value:g,disabled:!!R,onChange:se=>S(se.target.value),children:y.map(se=>u.jsx("option",{value:se.id,children:se.name},se.id))})]}),u.jsxs("label",{children:[m("画面比例","Aspect ratio"),u.jsx("select",{value:J,disabled:!!R,onChange:se=>me(se.target.value),children:l3.map(se=>u.jsx("option",{children:se},se))})]})]}),u.jsxs("label",{className:"ics-field",children:[m("生图模型","Image model"),((rn=y.find(se=>se.id===g))==null?void 0:rn.kind)==="forsion"?u.jsxs("select",{value:j,disabled:!!R||T,onChange:se=>z(se.target.value),children:[u.jsx("option",{value:"",children:T?m("读取中…","Loading…"):m("选择生图模型","Choose an image model")}),w.map(se=>u.jsx("option",{value:se.id,children:se.name},se.id))]}):u.jsx("input",{value:j,maxLength:300,disabled:!!R,placeholder:m("输入该服务提供的生图模型 ID","Enter an image model ID supplied by this provider"),onChange:se=>z(se.target.value)})]}),oe&&u.jsx("p",{role:"alert",className:"ics-error",children:oe}),u.jsx("p",{className:"caption",children:m("生图使用所选服务的账号额度。停止不会撤回已提交的请求;失败后不会自动重试。兼容服务的竖图/横图尺寸由模型支持范围决定。","Generation uses the selected service’s quota. Stop does not retract submitted requests; failures are never retried automatically. Compatible services render portrait/landscape sizes supported by their models.")}),u.jsxs("div",{className:"ics-actions",children:[u.jsxs("button",{className:"btn primary",disabled:!Zt||!kn.length||ae.cards.some(se=>!se.prompt.trim()),onClick:()=>void Xt(kn),children:[u.jsx(sw,{size:15}),R==="generate"?m("正在生成…","Generating…"):m(`生成已审核的 ${kn.length} 张图`,`Generate ${kn.length} reviewed cards`)]}),u.jsxs("button",{className:"btn",disabled:!!R||!ln,onClick:an,children:[u.jsx(Ba,{size:15}),m(`下载 ZIP(${ln} 张)`,`Download ZIP (${ln})`)]})]}),u.jsx("p",{className:"caption",children:m("结果保存在当前扩展页面会话中;关闭或重载页面前请下载。","Results stay in this extension page’s session. Download them before closing or reloading the page.")}),u.jsx("div",{className:"ics-deck",children:ae.cards.map((se,Ye)=>{const Ae=G.find(kt=>kt.cardId===se.id),ht=!!(Ae!=null&&Ae.image)&&Ae.generatedPrompt!==se.prompt;return u.jsxs("article",{className:"ics-card",children:[u.jsxs("div",{className:"ics-card-label",children:[u.jsx("strong",{children:String(Ye+1).padStart(2,"0")}),u.jsx("span",{children:ce===se.id?m("生成中…","Generating…"):Ae!=null&&Ae.image?ht?m("保留上一版图片","Previous image retained"):m("已生成","Generated"):m("待生成","Ready to generate")})]}),u.jsxs("label",{children:[m("标题","Title"),u.jsx("input",{maxLength:200,value:se.title,disabled:!!R,onChange:kt=>et(se.id,{title:kt.target.value})})]}),u.jsxs("label",{children:[m("配文","Caption"),u.jsx("textarea",{rows:2,maxLength:2e3,value:se.caption,disabled:!!R,onChange:kt=>et(se.id,{caption:kt.target.value})})]}),u.jsxs("label",{children:[m("生图提示词(确认后发送)","Image prompt (sent after your review)"),u.jsx("textarea",{rows:6,maxLength:xa.prompt,value:se.prompt,disabled:!!R,onChange:kt=>et(se.id,{prompt:kt.target.value})})]}),(Ae==null?void 0:Ae.image)&&u.jsx("img",{className:"ics-image",src:`data:${Ae.image.mime};base64,${Ae.image.base64}`,alt:se.title}),(Ae==null?void 0:Ae.error)&&u.jsx("p",{role:"alert",className:"ics-error",children:Ae.error}),u.jsxs("div",{className:"ics-actions",children:[u.jsxs("button",{className:"btn",disabled:!Zt||!se.prompt.trim(),onClick:()=>void Xt([se.id]),children:[u.jsx(no,{size:14}),Ae!=null&&Ae.image?m("重新生成此图","Regenerate this card"):Ae!=null&&Ae.error?m("重试此图","Retry this card"):m("生成此图","Generate this card")]}),(Ae==null?void 0:Ae.image)&&u.jsxs("button",{className:"btn",onClick:()=>un(se,Ae.image),children:[u.jsx(Ba,{size:14}),m("下载图片","Download image")]})]})]},se.id)})})]}),xe&&u.jsx("p",{role:"alert",className:"ics-error",children:xe}),Me&&u.jsx("p",{role:"status",className:"caption",children:Me})]})}const ci=location.pathname.includes("options"),Wc=(n,a)=>"clip-draft-v2:"+n.split("#")[0]+":"+a,_0={clip:Ws,collection:Ps,tasks:s1,vocab:Gh,settings:Fh};function f3(){var Vr,Ea,Ga,_o,Yr,Ir,jo,Qe,Gr,al,il;const[n,a]=M.useState(Vs),[r,s]=M.useState(null),[o,d]=M.useState(ci?"collection":"clip"),[h,m]=M.useState("account"),[y,b]=M.useState("clip"),[p,g]=M.useState(!1),[S,j]=M.useState(null),[z,w]=M.useState(""),[N,T]=M.useState(""),[L,oe]=M.useState(""),[I,te]=M.useState("full"),[K,q]=M.useState(),[H,J]=M.useState(!1),[me,ae]=M.useState(!1),[ge,fe]=M.useState(!1),[ie,G]=M.useState(!0),[C,R]=M.useState(!0),[B,ce]=M.useState(!1),[ne,xe]=M.useState(!1),[Te,Me]=M.useState(""),[O,X]=M.useState(null),[pe,ue]=M.useState(""),[ze,re]=M.useState([]),[he,de]=M.useState([]),[ye,Ve]=M.useState([]),[xn,ja]=M.useState(""),[Xt,_t]=M.useState(""),[et,un]=M.useState(""),[an,ln]=M.useState([]),[kn,Ha]=M.useState(""),[Zt,ca]=M.useState(!1),[qa,wa]=M.useState([]),[el,rn]=M.useState([]),[se,Ye]=M.useState(null),[Ae,ht]=M.useState(null),[kt,za]=M.useState("http://127.0.0.1:8791"),[fn,Ml]=M.useState(null),[ua,Ht]=M.useState(null),[Au,go]=M.useState(!1),[je,rt]=M.useState(null),[Re,Mt]=M.useState(null),[Ou,ku]=M.useState([]),[Mn,sn]=M.useState(""),[Dn,on]=M.useState("clips"),pi=M.useRef({clip:S,title:z,body:N,tags:L,scope:I,sourceTab:K,dirty:me});pi.current={clip:S,title:z,body:N,tags:L,scope:I,sourceTab:K,dirty:me};const gi=M.useRef(null),Mu=M.useRef(!1),Va=M.useRef(""),E=(x,Q)=>hi(n.locale,x,Q),Jn=x=>typeof x=="string"?x:(x==null?void 0:x[n.locale])||(x==null?void 0:x.en)||"",Oe=async(x,Q)=>{sn(x),ue("");try{return await Q()}catch(F){return ue(F instanceof Error?F.message:String(F)),null}finally{sn("")}},_n=async()=>{const x=await Se("state");return s(x),a(x.settings),R(x.config.frontMatter),Ml(x.login),Ht(x.pair),za(x.desktop.endpoint),un(x.settings.daily.urls.join(`
|
|
387
|
+
`)),x},[Rn,$r]=M.useState([]),[Br,Zr]=M.useState(!1),[Dl,Ya]=M.useState(null),[Du,vo]=M.useState(null);async function Rl(x){if(S){Zr(!0),ue("");try{const Q=V4(fa(),an,x,n.locale,C),F=await Se("save",{clip:Q,targets:[n.defaultTarget],requestId:crypto.randomUUID()});if(X(F),!F.ok)throw new Error(Object.values(F.results).map($e=>$e.error).filter(Boolean).join(`
|
|
388
|
+
`));Me(E("对话保存结果已更新","Conversation save results updated")),await dn()}catch(Q){ue(String(Q))}finally{Zr(!1)}}}const ft=z4(a,x=>Se("settings",x),async()=>(await Se("state")).settings,x=>ue(String(x))),dn=async()=>{const[x,Q,F]=await Promise.all([Se("history"),Se("jobs"),Se("vocab")]);re(x),de(Q),Ve(F)};M.useEffect(()=>{(async()=>{try{const F=await _n();await dn(),Mu.current=!0;const $e=new URLSearchParams(location.search).get("page");["clip","collection","tasks","vocab","settings"].includes($e||"")&&d($e);const Ne=new URLSearchParams(location.search),Ze=Ne.get("section");["account","save","ai","selection","templates","images","desktop","general"].includes(Ze||"")&&m(Ze),Ne.get("welcome")==="1"&&Ru(F),ci||(await tl("full"),F.panelIntent&&F.panelIntent.nonce!==Va.current&&(Va.current=F.panelIntent.nonce,d(F.panelIntent.view==="vocab"?"vocab":"clip"),b(F.panelIntent.view==="ai"?"ai":"clip"))),F.local.forsionUser&&Se("me").then(()=>_n()).catch(()=>{})}catch(F){ue(String(F))}})();const x=F=>{var $e,Ne;if(!ci&&F.type==="clip-panel-intent"&&F.nonce!==Va.current&&(Va.current=F.nonce,d(F.view==="vocab"?"vocab":"clip"),b(F.view==="ai"?"ai":"clip")),F.type==="active-tab-changed"){const Ze=pi.current;(Ze.sourceTab!==F.tabId||F.url&&F.url!==(($e=Ze.clip)==null?void 0:$e.url))&&J(!0)}F.type==="region-clip-ready"&&qt(F.tabId),F.type==="clip-highlights-changed"&&F.url===((Ne=pi.current.clip)==null?void 0:Ne.url)&&Dt()};chrome.runtime.onMessage.addListener(x);const Q=F=>{var $e,Ne,Ze;(F.forsion_clip_jobs_v2||F.forsion_history||F.forsion_vocab)&&dn(),(Ne=($e=F.forsion_workbench_v2)==null?void 0:$e.newValue)!=null&&Ne.selection&&a(vt=>vt&&{...vt,selection:F.forsion_workbench_v2.newValue.selection}),(Ze=F.forsion_config)!=null&&Ze.newValue&&s(vt=>vt&&{...vt,config:F.forsion_config.newValue})};return chrome.storage.onChanged.addListener(Q),()=>{var F;chrome.runtime.onMessage.removeListener(x),chrome.storage.onChanged.removeListener(Q),(F=gi.current)==null||F.disconnect()}},[]),M.useEffect(()=>{const x=n.theme==="dark"||n.theme==="system"&&matchMedia("(prefers-color-scheme: dark)").matches,Q=document.documentElement;Q.dataset.theme="lovable",Q.dataset.skin="ink",Q.dataset.bg="ink",Q.dataset.mode=x?"dark":"light",Q.classList.toggle("dark",x),Q.lang=n.locale;const F=matchMedia("(prefers-color-scheme: dark)"),$e=()=>{n.theme==="system"&&(Q.dataset.mode=F.matches?"dark":"light",Q.classList.toggle("dark",F.matches))};return F.addEventListener("change",$e),()=>F.removeEventListener("change",$e)},[n.theme,n.locale]),M.useEffect(()=>{if(!S||!me)return;const x={fields:S.frontMatter,fieldDefinitions:S.frontMatterFields,createdAt:S.createdAt,title:z,body:N,tags:L,includeHighlights:ie,frontMatter:C,updatedAt:Date.now()},Q=setTimeout(()=>{chrome.storage.local.set({[Wc(S.url,I)]:x}).catch(F=>ue(String(F)))},180);return()=>clearTimeout(Q)},[S==null?void 0:S.url,S==null?void 0:S.frontMatter,z,N,L,ie,C,I,me]),M.useEffect(()=>{var Ne;if(!je)return;const x=document.activeElement,Q=document.querySelector('[role="dialog"]'),F=()=>Array.from((Q==null?void 0:Q.querySelectorAll("button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),a[href]"))||[]);(Ne=F()[0])==null||Ne.focus();const $e=Ze=>{if(Ze.key==="Escape")Ze.preventDefault(),rt(null);else if(Ze.key==="Tab"){const vt=F(),Je=vt[0],Vt=vt.at(-1);Ze.shiftKey&&document.activeElement===Je?(Ze.preventDefault(),Vt==null||Vt.focus()):!Ze.shiftKey&&document.activeElement===Vt&&(Ze.preventDefault(),Je==null||Je.focus())}};return document.addEventListener("keydown",$e),()=>{document.removeEventListener("keydown",$e),x!=null&&x.isConnected&&x.focus()}},[je==null?void 0:je.type]),M.useEffect(()=>{if(!fn)return;const x=setInterval(()=>void Oe("",async()=>{const Q=await Se("login-poll",{id:fn.id});Q.status!=="pending"&&(Ml(null),await _n(),Q.status==="approved"?Me(E("已登录 Forsion 账号","Signed in to Forsion")):ue(E("授权已结束,请重新登录","Authorization ended. Try signing in again.")))}),Math.max(2e3,fn.intervalMs));return()=>clearInterval(x)},[fn==null?void 0:fn.id]),M.useEffect(()=>{if(!ua)return;const x=setInterval(()=>void Oe("",async()=>{const Q=await Se("desktop-poll",{requestId:ua.requestId});Q.status!=="pending"&&(Ht(null),await _n(),Q.status==="approved"?await nl():ue(E("配对未完成","Pairing was not completed")))}),2e3);return()=>clearInterval(x)},[ua==null?void 0:ua.requestId]);async function Hr(){const x=pi.current;x.clip&&x.dirty&&await chrome.storage.local.set({[Wc(x.clip.url,x.scope)]:{fields:x.clip.frontMatter,fieldDefinitions:x.clip.frontMatterFields,createdAt:x.clip.createdAt,title:x.title,body:x.body,tags:x.tags,includeHighlights:ie,frontMatter:C,updatedAt:Date.now()}})}async function qr(x,Q,F){var Je;await Hr();const Ne=(await chrome.storage.local.get(Wc(x.url,Q)))[Wc(x.url,Q)],Ze={...x,frontMatter:(Ne==null?void 0:Ne.fields)??x.frontMatter,frontMatterFields:Ne!=null&&Ne.fields?Ne.fieldDefinitions:x.frontMatterFields,createdAt:Ne!=null&&Ne.fields?Ne.createdAt:x.createdAt};j({...Ze,createdAt:f4(Ze)||void 0}),w((Ne==null?void 0:Ne.title)??x.title),T((Ne==null?void 0:Ne.body)??x.markdown);const vt=(Je=x.frontMatter)==null?void 0:Je[lo(x.frontMatterFields,"tags")||""];oe((Ne==null?void 0:Ne.tags)??(Array.isArray(vt)?vt:[]).join(", ")),G((Ne==null?void 0:Ne.includeHighlights)??!0),(Ne==null?void 0:Ne.frontMatter)!==void 0&&R(Ne.frontMatter),te(Q),q(F),ae(!!Ne),J(!1),X(null),ln([]),$r([])}async function tl(x=I,Q){var F,$e,Ne;ce(!0),ue("");try{const Ze=await Se("tabs"),vt=Q??((F=Ze.find(Vt=>Vt.id===K))==null?void 0:F.id)??(($e=Ze.find(Vt=>Vt.active))==null?void 0:$e.id)??((Ne=Ze[0])==null?void 0:Ne.id);if(vt==null)throw new Error(E("打开一个网页后,再点击扩展图标。","Open a web page, then click the extension icon."));const Je=await Se("extract",{tabId:vt,scope:x});await qr(Je,x,vt)}catch(Ze){ue(String(Ze))}finally{ce(!1)}}async function Un(){var Q;const x=await chrome.tabs.query({active:!0,currentWindow:!0});await tl(I,(Q=x[0])==null?void 0:Q.id)}async function qt(x){const Q=x??pi.current.sourceTab;try{const F=await Se("content",{tabId:Q,message:{type:"get-pending-clip"}});F!=null&&F.ok&&(await qr(F,"selection",Q),d("clip"))}catch(F){ue(String(F))}}async function Dt(){const x=pi.current;if(!x.clip||!x.sourceTab)return;const Q=await Se("content",{tabId:x.sourceTab,message:{type:"get-highlights"}});Q!=null&&Q.highlights&&j(F=>F&&{...F,highlights:Q.highlights})}function fa(){if(!S)throw new Error("No clip");const x={...S.frontMatter},Q=lo(S.frontMatterFields,"title"),F=lo(S.frontMatterFields,"tags");return Q&&(x[Q]=z),F&&(x[F]=L.split(/[,,]/).map($e=>$e.trim()).filter(Boolean)),{...S,title:z,markdown:N,frontMatter:x,document:lm({frontMatter:x,body:N,highlights:S.highlights,includeFrontMatter:C,includeHighlights:ie,locale:n.locale})}}async function yo(x){xe(!0),ue("");try{const Q=await Se("save",{clip:fa(),targets:x||[n.defaultTarget,...n.targets.filter(F=>F.enabled&&F.id!==n.defaultTarget).map(F=>F.id)],requestId:crypto.randomUUID()});if(X(Q),!Q.ok)throw new Error(Object.values(Q.results).map(F=>F.error).join(`
|
|
389
|
+
`));Me(E("保存结果已更新","Save results updated")),await dn()}catch(Q){ue(String(Q))}finally{xe(!1)}}function bo(x,Q){if(!S||Zt||!x.trim())return;const F={id:crypto.randomUUID(),role:"user",content:x},$e={id:crypto.randomUUID(),role:"assistant",content:""},Ne=[...an,F];ln([...Ne,$e]),b("ai"),Ha(""),ca(!0),ue("");const Ze=chrome.runtime.connect({name:"reader-ai"});gi.current=Ze;let vt=!1;Ze.onMessage.addListener(Je=>{(Je.type==="text"||Je.type==="done")&&ln(Vt=>Vt.map(Fa=>Fa.id===$e.id?{...Fa,content:Je.text}:Fa)),(Je.type==="done"||Je.type==="error")&&(vt=!0,ca(!1),Je.type==="error"&&ue(Je.error),Ze.disconnect(),gi.current=null)}),Ze.onDisconnect.addListener(()=>{vt||(ca(!1),ue(E("阅读已停止。已收到的内容已保留。","Reading stopped. Received text has been preserved.")))}),Ze.postMessage({type:"read",title:z,url:S.url,body:N,messages:Ne.map(({role:Je,content:Vt})=>({role:Je,content:Vt})),preset:Q})}async function Ru(x){go(!0),!(x.desktop.paired||x.pair&&!String(x.pair.requestId).startsWith("starting:"))&&await Oe("pair",async()=>{const Q=await Se("desktop-status");ht(Q),Q.connected&&Ht(await Se("desktop-pair",{endpoint:x.desktop.endpoint}))})}async function nl(){const x=await Se("desktop-status");if(ht(x),x.connected&&x.paired){const Q=await Se("desktop-vault");Ye(Q),rn(await Se("desktop-folders"))}return x}async function vi(){rt({type:"destination"}),n.defaultTarget==="desktop"?await Oe("vault",nl):r!=null&&r.local.forsionUser&&await Oe("vault",async()=>{wa(await Se("cloud-vaults")),rn(await Se("cloud-folders",{vaultId:n.cloudVault}))})}async function Ul(){await Oe("chat-options",async()=>{var Q;const x=await Se("desktop-chat-options");rt({type:"desktop-chat",options:x,modelId:x.defaultModelId||((Q=x.models[0])==null?void 0:Q.id)||"",instruction:E("请概括这篇剪藏的要点,帮助我继续阅读和讨论。","Summarize this clip and help me continue reading and discussing it.")})})}async function Ll(){await Oe("chat",async()=>{const x=await Se("desktop-chat",{title:z,document:fa().document,modelId:je.modelId,instruction:je.instruction,locale:n.locale});if(rt({...je,result:x}),!x.ok)throw new Error(x.error);Me(E("已在桌面 Chat 发起阅读","Started reading in Desktop Chat"))})}const Pn=[{id:"clip",zh:"浏览器剪藏",en:"Web clipper"},{id:"collection",zh:"收藏集",en:"Collection"},{id:"tasks",zh:"批量任务",en:"Batch tasks"},{id:"vocab",zh:"生词本",en:"Vocabulary"}],Ia=[{id:"account",zh:"Forsion 账号",en:"Forsion account"},{id:"save",zh:"保存与同步",en:"Save & sync"},{id:"ai",zh:"AI 与模型",en:"AI & models"},{id:"selection",zh:"选区工具栏",en:"Selection toolbar"},{id:"templates",zh:"站点与模板",en:"Sites & templates"},{id:"images",zh:"图片与图床",en:"Images & hosting"},{id:"desktop",zh:"桌面联动与 MCP",en:"Desktop & MCP"},{id:"general",zh:"通用设置",en:"General"}],Na=(x,Q,F,$e,Ne,Ze)=>u.jsx(yt,{label:E(x,Q),description:E(F,$e),control:u.jsx(Kn,{checked:Ne,label:E(x,Q),onChange:()=>Ze(!Ne)})}),hn=x=>{var Q;return x==="cloud"?E("云端智库","Cloud vault"):x==="desktop"?E("桌面智库","Desktop vault"):Jn((Q=ih.find(F=>F.id===x))==null?void 0:Q.label)||x};function jt(x){d(x),ue(""),x!=="clip"&&dn()}const So=()=>chrome.tabs.create({url:chrome.runtime.getURL("options.html")});return u.jsxs("div",{className:`app-shell ${ci?"workbench":"sidepanel"} ${p?"collapsed":""}`,children:[ci&&u.jsxs("nav",{className:"ribbon","aria-label":E("视图切换","View switcher"),children:[u.jsx("button",{title:E("侧栏","Sidebar"),onClick:()=>g(!p),children:u.jsx(dw,{size:19})}),Pn.map(x=>{const Q=_0[x.id];return u.jsx("button",{title:E(x.zh,x.en),"aria-label":E(x.zh,x.en),className:o===x.id?"active":"",onClick:()=>jt(x.id),children:u.jsx(Q,{size:20})},x.id)}),u.jsx("span",{className:"grow"}),u.jsx("button",{title:E("切换明暗","Toggle theme"),onClick:()=>void ft({theme:document.documentElement.dataset.mode==="dark"?"light":"dark"}),children:n.theme==="dark"?u.jsx(pw,{size:19}):u.jsx(fw,{size:19})}),u.jsx("button",{title:E("设置","Settings"),onClick:()=>jt("settings"),children:u.jsx(Fh,{size:19})})]}),ci&&u.jsxs("aside",{className:"sidebar",children:[u.jsxs("div",{className:"brand",children:[u.jsx("img",{src:chrome.runtime.getURL("icon/32.png"),alt:""}),u.jsx("strong",{children:"Forsion Clip"})]}),o==="settings"?u.jsxs(u.Fragment,{children:[u.jsx("small",{children:E("设置","Settings")}),Ia.map(x=>u.jsx("button",{className:h===x.id?"active":"",onClick:()=>m(x.id),children:E(x.zh,x.en)},x.id))]}):u.jsxs(u.Fragment,{children:[Pn.map(x=>{const Q=_0[x.id];return u.jsxs("button",{className:o===x.id?"active":"",onClick:()=>jt(x.id),children:[u.jsx(Q,{size:17}),E(x.zh,x.en)]},x.id)}),u.jsx("small",{children:E("智库","Vault")}),u.jsxs("div",{className:"sidebar-vault",children:[u.jsx(yb,{size:17}),u.jsxs("div",{children:[hn(n.defaultTarget),u.jsx("small",{children:n.defaultTarget==="desktop"?n.desktopFolder:n.cloudFolder})]})]}),u.jsx("small",{children:E("最近剪藏","Recent clips")}),ze.slice(0,5).map(x=>u.jsxs("button",{title:x.title,onClick:()=>rt({type:"history",item:x}),children:[u.jsx(Ps,{size:15}),u.jsx("span",{className:"ellipsis",children:x.title})]},x.id))]}),u.jsx("span",{className:"grow"}),u.jsxs("button",{className:"account-link",onClick:()=>{d("settings"),m("account")},children:[u.jsx("span",{className:"avatar",children:(((Vr=r==null?void 0:r.local.forsionUser)==null?void 0:Vr.nickname)||((Ea=r==null?void 0:r.local.forsionUser)==null?void 0:Ea.username)||"F").slice(0,1)}),u.jsxs("span",{children:[((Ga=r==null?void 0:r.local.forsionUser)==null?void 0:Ga.nickname)||((_o=r==null?void 0:r.local.forsionUser)==null?void 0:_o.username)||E("登录 Forsion","Sign in to Forsion"),u.jsx("small",{children:E("账号与连接","Account & connections")})]})]})]}),u.jsxs("section",{className:"workspace",children:[u.jsxs("header",{className:"workspace-header",children:[u.jsxs("span",{children:[u.jsx(Ws,{size:15})," ",o==="settings"?E("设置","Settings"):E(((Yr=Pn.find(x=>x.id===o))==null?void 0:Yr.zh)||"剪藏",((Ir=Pn.find(x=>x.id===o))==null?void 0:Ir.en)||"Clip")]}),u.jsx("span",{className:"grow"}),!ci&&u.jsx("button",{title:E("打开收藏与设置","Open collection & settings"),onClick:So,children:u.jsx(zh,{size:16})}),u.jsx("button",{"aria-label":"Switch language",onClick:()=>void ft({locale:n.locale==="zh"?"en":"zh"}),children:n.locale==="zh"?"EN":"中文"}),!ci&&u.jsx("button",{title:E("设置","Settings"),onClick:()=>void chrome.tabs.create({url:chrome.runtime.getURL("options.html?page=settings")}),children:u.jsx(Fh,{size:16})})]}),u.jsxs("main",{className:o==="clip"?"clip-main":"page-main",children:[pe&&u.jsxs("div",{className:"error",role:"alert",children:[pe,u.jsx("button",{"aria-label":E("关闭错误","Dismiss error"),onClick:()=>ue(""),children:u.jsx(Tr,{size:14})})]}),o==="clip"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"panel-heading",children:[u.jsx("strong",{children:"Forsion Clip"}),u.jsx("span",{className:"grow"}),B?u.jsx("span",{className:"muted",children:E("正在提取…","Extracting…")}):u.jsx("button",{title:E("重新提取","Refresh extraction"),onClick:()=>void Un(),children:u.jsx(no,{size:15})})]}),u.jsx("div",{className:"panel-tabs",role:"tablist",children:[["clip","剪藏","Clip",Ws],["ai","AI 阅读","AI reading",Zs],["highlights","划线","Highlights",a1]].map(([x,Q,F,$e])=>{var Ne;return u.jsxs("button",{role:"tab","aria-selected":y===x,onClick:()=>b(x),className:y===x?"active":"",children:[u.jsx($e,{size:15}),E(Q,F),x==="highlights"&&((Ne=S==null?void 0:S.highlights)!=null&&Ne.length)?" "+S.highlights.length:""]},x)})}),H&&u.jsxs("div",{className:"notice-inline",children:[E("网页已切换。当前草稿仍然保留。","The active page changed. Your draft is preserved."),u.jsx("button",{onClick:()=>void Un(),children:E("剪藏当前页","Clip current page")})]}),S?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"panel-content",role:"tabpanel",children:[y==="clip"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"seg range",children:[["full","正文","Article"],["selection","选区","Selection"],["link","链接","Link"]].map(([x,Q,F])=>u.jsx("button",{className:I===x?"on":"","aria-pressed":I===x,disabled:B,onClick:()=>void tl(x,K),children:E(Q,F)},x))}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("标题","Title")}),u.jsx("input",{value:z,onChange:x=>{w(x.target.value),ae(!0),X(null)}})]}),u.jsxs("div",{className:"source",children:[u.jsx("span",{children:E("来源","Source")}),u.jsxs("a",{href:S.url,target:"_blank",rel:"noreferrer",children:[S.site,u.jsx(xu,{size:11})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("标签","Tags")}),u.jsx("input",{placeholder:E("用逗号分隔","Separate with commas"),value:L,onChange:x=>{oe(x.target.value),ae(!0)}})]}),u.jsxs("details",{className:"metadata-fields",children:[u.jsx("summary",{children:E("编辑网页属性","Edit page properties")}),u.jsx($4,{clip:S,locale:n.locale,onChange:x=>{j({...S,frontMatter:x}),ae(!0),X(null)}})]}),u.jsxs("section",{className:"preview",children:[u.jsxs("header",{children:[u.jsx("strong",{children:E("内容预览","Content preview")}),u.jsx("span",{className:"grow"}),u.jsx("button",{onClick:()=>fe(!ge),children:ge?E("预览","Preview"):E("编辑","Edit")}),u.jsx("button",{title:E("在网页中选择多个区域","Select multiple regions on the page"),onClick:()=>void Oe("regions",()=>Se("content",{tabId:K,message:{type:"start-region-pick"}})),children:u.jsx(Cl,{size:14})})]}),ge?u.jsx("textarea",{"aria-label":E("剪藏正文","Clip body"),className:"body-editor",value:N,onChange:x=>{T(x.target.value),ae(!0),X(null)}}):u.jsx(B4,{markdown:N,value:n.preview||Vs.preview,locale:n.locale,onChange:x=>void Oe("preview-settings",async()=>a(await Se("settings",{preview:x})))}),u.jsxs("footer",{children:[N.length.toLocaleString()," ",E("字符","characters"),u.jsx("span",{className:"grow"}),"Markdown"]})]}),u.jsx("div",{className:"actions document-export-actions",children:[["png","导出长图","Export long image"],["print","打印 / PDF","Print / PDF"]].map(([x,Q,F])=>u.jsxs("button",{className:"btn",disabled:!!Mn,onClick:()=>void Oe("document-export",async()=>{await Se("document-export",{clip:fa(),markdown:lm({body:N,highlights:S.highlights,includeFrontMatter:!1,includeHighlights:ie,locale:n.locale}),title:z,mode:x}),Me(E("已打开独立导出页","Opened export page"))}),children:[u.jsx(Ba,{size:14}),E(Q,F)]},x))}),u.jsxs("label",{className:"check",children:[u.jsx("input",{type:"checkbox",checked:ie,onChange:x=>{G(x.target.checked),ae(!0)}}),E("附带划线与批注","Include highlights & notes")," ·"," ",((jo=S.highlights)==null?void 0:jo.length)||0]}),u.jsxs("label",{className:"check",children:[u.jsx("input",{type:"checkbox",checked:C,onChange:x=>{R(x.target.checked),ae(!0)}}),E("保留来源与属性","Include source metadata")]}),u.jsxs("button",{className:"subtle",onClick:()=>{d("settings"),m("save")},children:[u.jsx(zh,{size:15}),E("同时导出","Additional destinations"),u.jsx("span",{className:"grow"}),n.targets.filter(x=>x.enabled).map(x=>hn(x.id)).join(", ")||E("无","None")]})]}),y==="highlights"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"section-title",children:[u.jsx("h3",{children:E("划线与批注","Highlights & notes")}),u.jsx("button",{title:E("刷新","Refresh"),onClick:()=>void Oe("highlights",Dt),children:u.jsx(no,{size:14})})]}),!((Qe=S.highlights)!=null&&Qe.length)&&u.jsx("p",{className:"muted",children:E("在网页中选中文字,或悬停图片添加批注。","Select text on the page, or hover an image to annotate it.")}),(Gr=S.highlights)==null?void 0:Gr.map(x=>u.jsxs("article",{className:"highlight",style:{borderLeftColor:x.color},children:[x.type==="image"&&x.imageUrl?u.jsx("img",{src:x.imageUrl,alt:x.imageAlt||""}):u.jsx("blockquote",{children:x.text}),u.jsx("textarea",{"aria-label":E("批注","Annotation"),placeholder:E("留下你的想法…","Add your thoughts…"),defaultValue:x.note||"",onBlur:Q=>void Oe("note",async()=>{await Se("content",{tabId:K,message:{type:"set-highlight-note",id:x.id,note:Q.target.value}}),await Dt()})}),u.jsxs("footer",{children:[u.jsx("select",{"aria-label":E("划线颜色","Highlight color"),value:x.color,onChange:Q=>void Oe("color",async()=>{await Se("content",{tabId:K,message:{type:"set-highlight-color",id:x.id,color:Q.target.value}}),await Dt()}),children:[["#F8F3DE","重点","Key point"],["#FBE3E3","疑问","Question"],["#E1F3E5","想法","Insight"],["#DFEBFB","定义","Definition"],["#EFE4FA","行动","Action"]].map(([Q,F,$e])=>u.jsx("option",{value:Q,children:E(F,$e)},Q))}),u.jsx("span",{className:"grow"}),u.jsx("button",{title:E("移除划线","Remove highlight"),onClick:()=>void Oe("remove",async()=>{await Se("content",{tabId:K,message:{type:"remove-highlight",id:x.id}}),await Dt()}),children:u.jsx(Xi,{size:14})})]})]},x.id))]}),y==="ai"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"context",children:[u.jsx(Ps,{size:13}),E("当前文章已附加","Current article attached")]}),u.jsx("h3",{children:E("读懂,然后继续想。","Understand, then explore.")}),u.jsx("p",{className:"muted",children:E("围绕原文提问,也可以把新想法写回剪藏。","Ask about the source and bring new ideas back into your note.")}),u.jsxs("div",{className:"presets",children:[Dm(n.readerPresets||[],n.locale).filter(x=>x.enabled).map(x=>u.jsxs("button",{disabled:Zt,onClick:()=>bo(x.prompt,x.id),children:[u.jsx(Zs,{size:13}),x.name]},x.id)),u.jsxs("button",{disabled:!N.trim(),onClick:()=>Ya({title:z,url:(S==null?void 0:S.url)||"",body:N}),children:[u.jsx(Zs,{size:13}),E("文章生成图文卡","Create illustrated cards")]}),an.some(x=>x.role==="assistant"&&x.content.trim())&&u.jsxs("button",{disabled:Zt,onClick:()=>Ya({title:z,url:(S==null?void 0:S.url)||"",body:an.filter(x=>x.content.trim()&&(!Rn.length||Rn.includes(x.id))).map(x=>`${x.role==="assistant"?E("回答","Answer"):E("问题","Question")}
|
|
390
|
+
${x.content}`).join(`
|
|
391
|
+
|
|
392
|
+
`)}),children:[u.jsx(Zs,{size:13}),E(Rn.length?"所选对话生成图文卡":"对话生成图文卡",Rn.length?"Cards from selected messages":"Cards from conversation")]})]}),Dl&&u.jsx(u3,{locale:n.locale,providers:n.providers,defaultProviderId:n.provider,source:Dl,session:Du,onSessionChange:vo,onClose:()=>Ya(null)}),an.some(x=>x.content.trim())&&u.jsxs("div",{className:"button-row",children:[u.jsx("button",{className:"btn",disabled:Zt||Br||!an.some(x=>x.content.trim()&&Rn.includes(x.id)),onClick:()=>void Rl(Rn),children:E("保存已选消息","Save selected messages")}),u.jsx("button",{className:"btn",disabled:Zt||Br,onClick:()=>void Rl(),children:E("保存全部对话","Save conversation")})]}),u.jsx("div",{className:"messages",children:an.map(x=>u.jsxs("article",{className:"message "+x.role,children:[x.content&&u.jsxs("div",{className:"chat-selection-row",children:[u.jsxs("label",{children:[u.jsx("input",{type:"checkbox","aria-label":E("选择消息","Select message")+" "+(an.indexOf(x)+1),checked:Rn.includes(x.id),onChange:Q=>$r(F=>Q.target.checked?[...F,x.id]:F.filter($e=>$e!==x.id))}),E("选择","Select")]}),u.jsx("button",{className:"btn subtle",disabled:Zt||Br,onClick:()=>void Rl([x.id]),children:E("保存这条消息","Save message")})]}),x.role==="assistant"?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:Uh(x.content)}}),x.content&&u.jsxs("div",{className:"actions",children:[u.jsxs("button",{onClick:()=>{T(Q=>Q+`
|
|
393
|
+
|
|
394
|
+
`+x.content),ae(!0),Me(E("已追加到剪藏草稿","Appended to clip draft"))},children:[u.jsx(Cl,{size:13}),E("写入剪藏","Append to clip")]}),u.jsx("button",{title:E("复制","Copy"),onClick:()=>void navigator.clipboard.writeText(x.content),children:u.jsx(rw,{size:13})})]})]}):x.content]},x.id))}),u.jsx(Ij,{value:kn,onValueChange:Ha,onSubmit:()=>bo(kn),submitLabel:E("发送","Send"),submitDisabled:Zt||!kn.trim(),inputProps:{placeholder:E("对这篇文章,你想了解什么?","What would you like to know?"),maxLength:12e3,"aria-label":E("提问","Ask a question")},beforeInput:u.jsxs("div",{className:"context",children:["↳ ",z]}),controls:u.jsxs(u.Fragment,{children:[u.jsx("select",{"aria-label":E("AI 服务","AI provider"),value:n.provider,disabled:Zt,onChange:x=>void ft({provider:x.target.value}),children:n.providers.map(x=>u.jsx("option",{value:x.id,children:x.name},x.id))}),Zt&&u.jsx("button",{"aria-label":E("停止生成","Stop generating"),onClick:()=>{var x,Q;(x=gi.current)==null||x.postMessage({type:"cancel"}),(Q=gi.current)==null||Q.disconnect(),gi.current=null,ca(!1)},children:u.jsx(lw,{size:17})})]})}),u.jsx("p",{className:"caption",children:E("发送时,文章内容与问题将交给所选 AI 服务。","When you send, the article and question go to the selected AI provider.")})]})]}),u.jsxs("footer",{className:"save-footer",children:[u.jsxs("button",{className:"destination",onClick:()=>void vi(),children:[n.defaultTarget==="desktop"?u.jsx(uw,{size:16}):u.jsx(yb,{size:16}),u.jsx("span",{children:hn(n.defaultTarget)}),u.jsx(vb,{size:13}),u.jsx("span",{className:"grow"}),u.jsx("small",{children:n.defaultTarget==="desktop"?n.desktopFolder:n.defaultTarget==="cloud"?n.cloudFolder:""})]}),O&&u.jsxs("div",{className:"save-results",children:[Object.entries(O.results).map(([x,Q])=>u.jsxs("div",{className:Q.status==="failed"?"failed":"",children:[Q.status==="failed"?u.jsx(Tr,{size:13}):u.jsx(Su,{size:13}),u.jsxs("span",{children:[hn(x)," ·"," ",Q.status==="failed"?Q.error:Q.status==="handed-off"?E("已交给应用,请在目标应用确认","Handed off; confirm in the target app"):Q.status==="downloaded"?E("已交给浏览器下载","Queued in browser downloads"):E("已保存","Saved")]}),Q.warning&&u.jsx("small",{children:Jn(Q.warning)}),Q.url&&u.jsx("button",{title:E("打开","Open"),onClick:()=>void chrome.tabs.create({url:Q.url}),children:u.jsx(zh,{size:13})})]},x)),(al=O.warnings)==null?void 0:al.map((x,Q)=>u.jsx("p",{children:x},Q)),((il=O.results.desktop)==null?void 0:il.status)==="saved"&&u.jsxs("div",{className:"actions",children:[u.jsxs("button",{onClick:()=>void Ul(),children:[u.jsx(Zs,{size:13}),E("在 Chat 继续","Continue in Chat")]}),u.jsxs("button",{onClick:()=>rt({type:"reading-todo",dueDate:new Date(Date.now()+864e5).toLocaleDateString("sv-SE"),requestId:crypto.randomUUID()}),children:[u.jsx(s1,{size:13}),E("添加阅读待办","Add reading task")]})]})]}),u.jsxs("button",{className:"btn primary save",disabled:ne||B,onClick:()=>void yo(),children:[u.jsx(Ws,{size:16}),ne?E("正在保存…","Saving…"):E("保存剪藏","Save clip")]}),u.jsx("small",{children:r!=null&&r.local.forsionUser?E("已连接 Forsion 账号","Forsion account connected"):E("本地功能无需登录","Local features work without signing in")})]})]}):u.jsxs("div",{className:"empty",children:[u.jsx(Ws,{size:30}),u.jsx("h2",{children:E("把发现带回 Forsion","Bring discoveries to Forsion")}),u.jsx("p",{children:E("打开网页,点击扩展图标开始剪藏。","Open a web page and click the extension icon to begin.")}),u.jsx("button",{className:"btn primary",disabled:B,onClick:()=>void Un(),children:E("提取当前网页","Extract current page")}),ci&&u.jsx("button",{className:"btn",onClick:()=>void Oe("tabs",async()=>rt({type:"tabs",items:await Se("tabs")})),children:E("选择打开的网页","Choose an open page")})]})]}),o==="collection"&&u.jsxs("div",{className:"panel-tabs",children:[u.jsx("button",{className:Dn==="clips"?"active":"",onClick:()=>on("clips"),children:E("剪藏记录","Saved clips")}),u.jsx("button",{className:Dn==="highlights"?"active":"",onClick:()=>on("highlights"),children:E("全部划线","All highlights")})]}),o==="collection"&&Dn==="highlights"&&u.jsx(x4,{locale:n.locale}),o==="collection"&&Dn==="clips"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:E("我的收藏集","My collection")}),u.jsx("p",{children:E("所有好想法,都有一个可以回去的地方。","A place to return to every good idea.")})]}),u.jsxs("button",{className:"btn",onClick:()=>jt("clip"),children:[u.jsx(Cl,{size:15}),E("继续剪藏","Keep clipping")]})]}),u.jsxs("div",{className:"search",children:[u.jsx(Sm,{size:16}),u.jsx("input",{"aria-label":E("搜索收藏","Search collection"),placeholder:E("搜索标题和正文","Search titles and content"),value:xn,onChange:x=>ja(x.target.value)})]}),u.jsxs("p",{className:"caption",children:[ze.length," ",E("条已保存记录 · 正文保存在本机","saved records · Content stored on this device")]}),!ze.length&&u.jsxs("div",{className:"empty",children:[u.jsx(Ps,{size:30}),u.jsx("h3",{children:E("从第一篇剪藏开始","Start with your first clip")}),u.jsx("p",{children:E("成功保存的内容会出现在这里。","Successfully saved clips will appear here.")})]}),ze.filter(x=>(x.title+" "+x.document).toLowerCase().includes(xn.toLowerCase())).map(x=>u.jsxs("article",{className:"collection-row",children:[u.jsxs("button",{onClick:()=>rt({type:"history",item:x}),children:[u.jsx(Ps,{size:22}),u.jsxs("span",{children:[u.jsx("strong",{children:x.title}),u.jsxs("small",{children:[x.site," · ",hn(x.dest)," ·"," ",new Date(x.at).toLocaleDateString(n.locale)]})]})]}),u.jsx("button",{title:E("下载 Markdown","Download Markdown"),onClick:()=>Rh(x.document,x.title+".md"),children:u.jsx(Ba,{size:16})}),u.jsx("button",{title:E("移除记录","Remove record"),onClick:()=>rt({type:"remove-history",item:x}),children:u.jsx(Xi,{size:15})})]},x.id))]}),o==="tasks"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-heading",children:u.jsxs("div",{children:[u.jsx("h1",{children:E("批量与每日任务","Batch & daily collection")}),u.jsx("p",{children:E("把多个来源,按你的节奏汇入智库。","Bring multiple sources into your vault at your own pace.")})]})}),u.jsxs("section",{className:"card",children:[u.jsxs("div",{className:"section-title",children:[u.jsx("h3",{children:E("添加链接","Add links")}),u.jsx("span",{className:"grow"}),u.jsx("button",{onClick:()=>void Oe("import",async()=>{const x=await Se("bookmarks");rt({type:"import-links",items:x,selected:new Set})}),children:E("书签导入","Import bookmarks")}),u.jsx("button",{onClick:()=>void Oe("import",async()=>{const x=await Se("tabs");rt({type:"import-links",items:x,selected:new Set})}),children:E("打开的网页","Open tabs")})]}),u.jsx("textarea",{className:"batch-input","aria-label":E("待剪藏链接","URLs to clip"),placeholder:"https://…",value:Xt,onChange:x=>_t(x.target.value)}),u.jsxs("div",{className:"actions",children:[u.jsx("span",{className:"caption",children:hn(n.defaultTarget)}),u.jsx("span",{className:"grow"}),u.jsx("button",{className:"btn primary",disabled:!Xt.trim()||Mn==="queue",onClick:()=>void Oe("queue",async()=>{await Se("queue",{urls:Xt.split(/\n/).map(x=>x.trim()).filter(Boolean),targets:[n.defaultTarget,...n.targets.filter(x=>x.enabled&&x.id!==n.defaultTarget).map(x=>x.id)]}),_t(""),await dn()}),children:E("开始剪藏","Start batch")})]})]}),u.jsxs("section",{className:"card daily",children:[Na("每日阅读收集","Daily reading collection","浏览器运行时,在指定时间处理以下链接。","Process these links at the selected time while the browser is running.",n.daily.enabled,x=>void ft({daily:{...n.daily,enabled:x}})),u.jsxs("div",{className:"actions",children:[u.jsx("input",{"aria-label":E("每日时间","Daily time"),type:"time",value:`${String(n.daily.hour).padStart(2,"0")}:${String(n.daily.minute).padStart(2,"0")}`,onChange:x=>{const[Q,F]=x.target.value.split(":").map(Number);ft({daily:{...n.daily,hour:Q,minute:F}})}}),u.jsx("span",{children:E("本地时间","Local time")})]}),u.jsx("textarea",{value:et,"aria-label":E("每日链接","Daily links"),placeholder:E("每行一条链接","One URL per line"),onChange:x=>un(x.target.value),onBlur:()=>void ft({daily:{...n.daily,urls:et.split(`
|
|
395
|
+
`).map(x=>x.trim()).filter(Boolean)}})})]}),u.jsx(O4,{value:n.queue||Vs.queue,locale:n.locale,onChange:x=>void Oe("queue-settings",async()=>a(await Se("settings",{queue:x})))}),u.jsxs("div",{className:"section-title queue-heading",children:[u.jsx("h3",{children:E("任务队列","Task queue")}),u.jsx("button",{onClick:()=>void Oe("clear-jobs",async()=>{await Se("clear-finished-jobs"),await dn()}),children:E("清理已完成和已取消记录","Clear finished and cancelled records")}),u.jsx("button",{onClick:()=>void Oe("cancel",async()=>{await Se("cancel-jobs"),await dn()}),children:E("取消等待与运行中的任务","Cancel pending & running")})]}),he.slice().reverse().map(x=>u.jsxs("article",{className:"job",children:[u.jsx("span",{className:"job-dot "+x.status}),u.jsxs("div",{children:[u.jsx("strong",{children:x.title||x.url}),u.jsxs("small",{children:[x.status==="queued"&&x.nextRetryAt?E("等待自动重试","Waiting to retry"):{queued:E("等待中","Queued"),running:E("运行中","Running"),saved:E("已保存","Saved"),failed:E("失败","Failed"),cancelled:E("已取消","Cancelled"),interrupted:E("已中断","Interrupted")}[x.status]," ","· ",x.attempts," ",E("次尝试","attempts")]}),x.status==="queued"&&x.nextRetryAt&&u.jsxs("small",{children:[E("下次尝试:","Next attempt: "),new Date(x.nextRetryAt).toLocaleString(n.locale)]}),x.error&&u.jsx("p",{className:"failed",children:x.error}),Object.entries(x.results).map(([Q,F])=>u.jsxs("div",{className:"job-result",children:[u.jsxs("small",{children:[hn(Q)," ·"," ",F.status==="saved"?E("已保存","Saved"):F.status==="downloaded"?E("已下载","Downloaded"):F.status==="handed-off"?E("已交接","Handed off"):E("失败","Failed")]}),F.warning&&u.jsx("p",{children:F.warning}),F.error&&u.jsx("p",{className:"failed",children:F.error}),F.deliveryUnknown&&u.jsx("p",{children:E("送达情况尚未确认,请先检查目标。","Delivery is unconfirmed. Check the destination first.")}),F.partial&&u.jsxs("p",{children:[E("已创建部分内容:","Partially created content: "),F.partial.url&&/^https?:\/\//.test(F.partial.url)?u.jsx("a",{href:F.partial.url,target:"_blank",rel:"noopener noreferrer",children:F.partial.id}):F.partial.id]}),(F.path||F.url)&&u.jsx("p",{children:F.path||F.url})]},Q))]}),u.jsx("span",{className:"grow"}),["failed","cancelled","interrupted"].includes(x.status)&&u.jsx("button",{className:"btn",onClick:()=>rt({type:"retry",item:x}),children:E("重试","Retry")})]},x.id))]}),o==="vocab"&&u.jsx(Dw,{locale:n.locale,words:ye,onRefresh:dn}),o==="settings"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"settings-mobile",children:u.jsx("select",{"aria-label":E("设置分类","Settings category"),value:h,onChange:x=>m(x.target.value),children:Ia.map(x=>u.jsx("option",{value:x.id,children:E(x.zh,x.en)},x.id))})}),u.jsx("div",{className:"settings-content",children:xo()})]})]}),u.jsxs("footer",{className:"status",children:[u.jsx("span",{children:Te||E("Forsion Clip · 保存在此浏览器","Forsion Clip · Stored in this browser")}),u.jsx("span",{className:"grow"}),Vy]})]}),je&&u.jsx("div",{className:"modal-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&rt(null)},children:u.jsxs("section",{className:"modal",role:"dialog","aria-modal":"true","aria-label":E("Forsion Clip 对话框","Forsion Clip dialog"),children:[u.jsxs("header",{children:[u.jsx("h2",{children:je.type==="desktop-chat"?E("在桌面 Chat 继续","Continue in Desktop Chat"):je.type==="reading-todo"?E("阅读待办","Reading task"):je.type==="destination"?E("保存位置","Save destination"):je.type==="history"?je.item.title:je.type==="import-links"?E("选择链接","Select links"):je.type==="retry"?E("重试任务","Retry task"):je.type==="remove-history"?E("移除收藏记录","Remove collection record"):E("选择网页","Choose a page")}),u.jsx("button",{"aria-label":E("关闭","Close"),onClick:()=>rt(null),children:u.jsx(Tr,{size:18})})]}),u.jsxs("div",{className:"modal-body",children:[je.type==="desktop-chat"&&u.jsx(u.Fragment,{children:je.options.enabled?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:E("将当前剪藏发送给桌面端所选模型,创建一个真实 Chat 会话。","Send this clip to the selected Desktop model and start a new Chat session.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("桌面模型","Desktop model")}),u.jsx("select",{disabled:!!je.result,value:je.modelId,onChange:x=>rt({...je,modelId:x.target.value}),children:je.options.models.map(x=>u.jsx("option",{value:x.id,children:x.name},x.id))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("想讨论什么?","What would you like to discuss?")}),u.jsx("textarea",{value:je.instruction,disabled:!!je.result,onChange:x=>rt({...je,instruction:x.target.value})})]}),je.result?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:je.result.ok?E("会话已启动。模型回答可在桌面端查看。","Session started. View the model response in Desktop."):je.result.error}),je.result.url&&u.jsx("button",{className:"btn primary",onClick:()=>void chrome.tabs.create({url:je.result.url}),children:E("打开会话检查结果","Open session and check")})]}):u.jsx("button",{className:"btn primary",disabled:!!Mn||!je.modelId,onClick:()=>void Ll(),children:E("发送到桌面 Chat","Send to Desktop Chat")})]}):u.jsx("p",{children:E("请先在 Forsion 桌面端设置中启用远程会话。","Enable remote sessions in Forsion Desktop settings first.")})}),je.type==="reading-todo"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:E("在同一智库中新建带日期的 Markdown 待办,并链接这篇剪藏。","Create a dated Markdown task in the same vault, linked to this clip.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("阅读日期","Reading date")}),u.jsx("input",{type:"date",value:je.dueDate,onChange:x=>rt({...je,dueDate:x.target.value})})]}),je.result?u.jsx("p",{children:je.result.ok?E("已创建阅读待办","Reading task created"):je.result.error}):u.jsx("button",{className:"btn primary",disabled:!!Mn||!je.dueDate,onClick:()=>void Oe("todo",async()=>{const x=await Se("desktop-todo",{title:z,notePath:O.results.desktop.path,vaultId:O.results.desktop.vaultId,dueDate:je.dueDate,requestId:je.requestId,locale:n.locale});if(rt({...je,result:x}),!x.ok)throw new Error(x.error)}),children:E("创建待办","Create task")})]}),je.type==="destination"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("保存到","Save to")}),u.jsxs("select",{value:n.defaultTarget,onChange:x=>void ft({defaultTarget:x.target.value}),children:[u.jsx("option",{value:"cloud",children:E("Forsion 云端智库","Forsion cloud vault")}),u.jsx("option",{value:"desktop",children:E("Forsion 桌面智库","Forsion Desktop vault")}),ih.map(x=>u.jsx("option",{value:x.id,children:Jn(x.label)},x.id))]})]}),n.defaultTarget==="cloud"?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"btn",onClick:()=>void Oe("vault",async()=>{wa(await Se("cloud-vaults")),rn(await Se("cloud-folders",{vaultId:n.cloudVault}))}),children:E("刷新云智库","Refresh cloud vaults")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("智库","Vault")}),u.jsxs("select",{value:n.cloudVault,onChange:x=>void Oe("folders",async()=>{await ft({cloudVault:x.target.value}),rn(await Se("cloud-folders",{vaultId:x.target.value}))}),children:[u.jsx("option",{value:"default",children:E("默认智库","Default vault")}),qa.map(x=>u.jsx("option",{value:x.id,disabled:x.role==="viewer",children:x.name},x.id))]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("文件夹","Folder")}),u.jsx("input",{list:"folders",value:n.cloudFolder,onChange:x=>void ft({cloudFolder:x.target.value})})]})]}):n.defaultTarget==="desktop"?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"btn",onClick:()=>void Oe("vault",nl),children:E("刷新桌面智库","Refresh Desktop vault")}),u.jsx("p",{children:(se==null?void 0:se.name)||(se==null?void 0:se.root)||E("先到设置配对桌面端","Pair with Desktop in settings first")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("文件夹","Folder")}),u.jsx("input",{list:"folders",value:n.desktopFolder,onChange:x=>void ft({desktopFolder:x.target.value})})]})]}):u.jsx("p",{children:E("连接参数可在“设置 → 保存与同步”中配置。","Configure connection details under Settings → Save & sync.")}),u.jsx("datalist",{id:"folders",children:el.map(x=>u.jsx("option",{value:x},x))})]}),je.type==="history"&&u.jsxs(u.Fragment,{children:[u.jsx("a",{href:je.item.url,target:"_blank",rel:"noreferrer",children:je.item.url}),u.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:Uh(je.item.document)}}),u.jsxs("button",{className:"btn",onClick:()=>Rh(je.item.document,je.item.title+".md"),children:[u.jsx(Ba,{size:15}),E("下载 Markdown","Download Markdown")]})]}),je.type==="import-links"&&u.jsxs(u.Fragment,{children:[je.items.map(x=>u.jsxs("label",{className:"import-row",children:[u.jsx("input",{type:"checkbox",checked:je.selected.has(x.url),onChange:Q=>{const F=new Set(je.selected);Q.target.checked?F.add(x.url):F.delete(x.url),rt({...je,selected:F})}}),u.jsxs("span",{children:[x.title||x.url,u.jsx("small",{children:x.url})]})]},x.url)),u.jsxs("button",{className:"btn primary",disabled:!je.selected.size,onClick:()=>{_t(x=>[x,...je.selected].filter(Boolean).join(`
|
|
396
|
+
`)),rt(null)},children:[E("添加所选链接","Add selected links")," (",je.selected.size,")"]})]}),je.type==="tabs"&&je.items.map(x=>u.jsx("button",{className:"import-row",onClick:()=>{rt(null),tl("full",x.id)},children:x.title},x.id)),je.type==="retry"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:E("中断或超时的任务可能已经送达。请先检查目标,避免重复保存。已确认成功的目标不会重跑。","Interrupted or timed-out exports may already have arrived. Check the destination to avoid duplicates. Confirmed successful targets will not run again.")}),u.jsx("button",{className:"btn primary",onClick:()=>void Oe("retry",async()=>{await Se("retry-job",{id:je.item.id}),rt(null),await dn()}),children:E("重试失败目标","Retry failed targets")})]}),je.type==="remove-history"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:E("仅移除此浏览器的收藏记录,不删除已保存到目标的文件。","Remove this browser’s record. Files already saved to destinations are kept.")}),u.jsx("button",{className:"btn",onClick:()=>void Oe("remove",async()=>{await Se("history-remove",{id:je.item.id}),rt(null),await dn()}),children:E("移除记录","Remove record")})]})]}),u.jsx("footer",{children:u.jsx("button",{className:"btn",onClick:()=>rt(null),children:E("完成","Done")})})]})})]});function xo(){var vt,Je,Vt,Fa,$l,Ka,Fr;const x=(r==null?void 0:r.local)||{templates:[],persistentSites:[],cloudOrigin:"https://api.forsion.net"},Q=async P=>{await Se("local-settings",P),await _n()},F=n.providers.find(P=>P.id===n.provider)||n.providers[0],$e=P=>void ft({providers:n.providers.map(be=>be.id===F.id?{...be,...P}:be)}),Ne=(P,be)=>{const it=n.targets.find(tt=>tt.id===P)||{id:P,enabled:!1,options:{}};return ft({targets:[...n.targets.filter(tt=>tt.id!==P),{...it,...be}]})},Ze=(P,be,it)=>u.jsx(w4,{fields:P,values:be,locale:n.locale,onChange:it});if(h==="selection")return u.jsxs(u.Fragment,{children:[u.jsx(_4,{locale:n.locale,value:n.selection,enabled:(r==null?void 0:r.config.selectionToolbar)!==!1,providerName:(F==null?void 0:F.name)||"",onChange:async(P,be)=>{const it=await Se("selection-settings",{selection:P,expected:be});a(it)},onEnabledChange:async P=>{await Se("config",{selectionToolbar:P}),await _n()},onOpenAiSettings:()=>m("ai")}),u.jsx(D4,{locale:n.locale,value:n.floating||Vs.floating,onChange:async P=>{const be=await Se("settings",{floating:P});a(be)}})]});if(h==="account")return u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("同一个 Forsion 账号","One Forsion account")}),u.jsx("p",{children:E("连接浏览器里的发现,和 Forsion 中正在进行的思考。","Connect discoveries in your browser with your work in Forsion.")}),u.jsxs("div",{className:"account-card",children:[u.jsx("span",{className:"avatar",children:(((vt=x.forsionUser)==null?void 0:vt.nickname)||((Je=x.forsionUser)==null?void 0:Je.username)||"F").slice(0,1)}),u.jsxs("div",{children:[u.jsx("strong",{children:((Vt=x.forsionUser)==null?void 0:Vt.nickname)||((Fa=x.forsionUser)==null?void 0:Fa.username)||E("尚未登录","Not signed in")}),u.jsx("small",{children:(($l=x.forsionUser)==null?void 0:$l.email)||E("本地剪藏和导出始终可用","Local clipping and export are always available")})]})]}),x.forsionUser?u.jsx(yt,{label:E("Forsion 账号","Forsion account"),description:E("退出不会删除本机剪藏。","Signing out keeps your local clips."),control:u.jsxs("button",{className:"btn",onClick:()=>void Oe("logout",async()=>{await Se("logout"),await _n(),wa([])}),children:[u.jsx(cw,{size:14}),E("退出登录","Sign out")]})}):u.jsx(yt,{label:E("安全登录","Sign in securely"),description:E("在 Forsion 官方页面确认设备授权。扩展不收集密码。","Approve device access on the official Forsion page. The extension never asks for your password."),control:u.jsx("button",{className:"btn primary",disabled:!!Mn||!!fn,onClick:()=>void Oe("login",async()=>{const P=await Se("login-start");Ml(P),await chrome.tabs.create({url:P.url})}),children:E("登录 Forsion","Sign in to Forsion")})})," ",fn&&u.jsxs("div",{className:"card auth-code",children:[u.jsx("h3",{children:E("等待你确认授权","Waiting for your approval")}),u.jsx("code",{children:fn.userCode}),u.jsx("p",{children:E("在打开的授权页核对代码,然后确认。","Check this code on the authorization page, then approve.")}),u.jsx("button",{className:"btn",onClick:()=>void chrome.tabs.create({url:fn.url}),children:E("重新打开授权页","Reopen authorization")}),u.jsx("button",{className:"btn",onClick:()=>void Oe("cancel",async()=>{await Se("login-cancel",{id:fn.id}),Ml(null)}),children:E("取消","Cancel")})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("Forsion 服务地址","Forsion service address")}),u.jsx("input",{defaultValue:x.cloudOrigin,onBlur:P=>{P.target.value!==x.cloudOrigin&&Oe("origin",()=>Q({cloudOrigin:P.target.value}))}})]}),u.jsx("p",{className:"caption",children:E("更换服务地址后需重新登录。云端权益沿用 Forsion 账号。","Changing the service requires signing in again. Your Forsion account determines cloud entitlements.")})]});if(h==="save")return u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("保存与同步","Save & sync")}),u.jsx(yt,{label:E("默认保存位置","Default destination"),description:E("每次剪藏仍可更换智库与文件夹。","You can change the vault and folder for each clip."),control:u.jsxs("button",{className:"btn",onClick:()=>void vi(),children:[hn(n.defaultTarget),u.jsx(vb,{size:13})]})}),Na("保留来源与属性","Include source metadata","将网页 URL、作者和标签写入 Markdown 属性。","Write source URL, author and tags into Markdown metadata.",C,P=>{R(P),Se("config",{frontMatter:P})}),u.jsx(L4,{locale:n.locale,value:n.frontmatter||Vs.frontmatter,onSave:async(P,be)=>{a(await Se("frontmatter-settings",{frontmatter:P,expected:be}))}}),u.jsx("h2",{children:E("额外导出目标","Additional destinations")}),u.jsx("p",{children:E("启用后,每次保存同时发送到这些目标。凭据仅存于本机扩展。","Enabled destinations receive each saved clip. Credentials stay in this extension on this device.")}),u.jsx("div",{className:"destination-settings",children:ih.map(P=>{var it;const be=n.targets.find(tt=>tt.id===P.id)||{id:P.id,enabled:!1,options:{}};return u.jsxs("details",{children:[u.jsxs("summary",{children:[u.jsx("span",{children:Jn(P.label)}),u.jsx("span",{className:"grow"}),u.jsx("span",{children:be.enabled?E("已启用","Enabled"):E("未启用","Disabled")})]}),u.jsx(yt,{label:E("同时保存到此目标","Also save to this destination"),control:u.jsx(Kn,{label:Jn(P.label),checked:be.enabled,onChange:()=>Ne(P.id,{enabled:!be.enabled})})}),P.note&&u.jsx("p",{className:"caption",children:Jn(P.note)}),Ze(P.fields||[],be.options,tt=>Ne(P.id,{options:tt})),["notion","wolai","flowus"].includes(P.id)&&(P.id==="wolai"||be.options.parentType!=="page"&&(P.id!=="flowus"||be.options.parentType==="database"))&&u.jsx(A4,{value:be.options.fieldMappings||"",locale:n.locale,onSave:async tt=>{const nt=await Se("settings",{}),ll=nt.targets.find(Kr=>Kr.id===P.id)||be;if((ll.options.fieldMappings||"")!==(be.options.fieldMappings||""))throw new Error(E("映射已被其他页面修改,请重新载入设置。","Mappings changed in another page. Reload settings."));const Uu=await Se("settings",{targets:[...nt.targets.filter(Kr=>Kr.id!==P.id),{...ll,options:{...ll.options,fieldMappings:tt}}]});a(Uu)}}),!((it=P.fields)!=null&&it.length)&&u.jsx("p",{className:"caption",children:E("无需额外配置。","No additional configuration needed.")})]},P.id)})})]});if(h==="ai")return u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("AI 与模型","AI & models")}),u.jsx(Z4,{value:n.readerPresets||[],locale:n.locale,onSave:async(P,be)=>{a(await Se("reader-presets-settings",{readerPresets:P,expected:be}))}}),u.jsx("p",{children:E("使用 Forsion AI,或连接自己的模型服务。只在你点击发送时传输阅读内容。","Use Forsion AI or connect your own model service. Reading content is sent only when you ask.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("当前服务","Current provider")}),u.jsx("select",{value:n.provider,onChange:P=>void ft({provider:P.target.value}),children:n.providers.map(P=>u.jsx("option",{value:P.id,children:P.name},P.id))})]}),u.jsxs("div",{className:"actions",children:[u.jsxs("button",{className:"btn",onClick:()=>{const P=crypto.randomUUID();ft({provider:P,providers:[...n.providers,{id:P,name:E("新模型服务","New provider"),kind:"openai",endpoint:"https://api.openai.com/v1",apiKey:"",model:""}]})},children:[u.jsx(Cl,{size:14}),E("添加服务","Add provider")]}),(F==null?void 0:F.kind)!=="forsion"&&u.jsx("button",{className:"btn",onClick:()=>void ft({provider:"forsion",providers:n.providers.filter(P=>P.id!==F.id)}),children:E("移除服务","Remove provider")})]}),F&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("名称","Name")}),u.jsx("input",{value:F.name,onChange:P=>$e({name:P.target.value})})]}),F.kind!=="forsion"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("接口类型","API type")}),u.jsxs("select",{value:F.kind,onChange:P=>{const be=P.target.value;$e({kind:be,endpoint:{openai:"https://api.openai.com/v1",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com",ollama:"http://127.0.0.1:11434"}[be]})},children:[u.jsx("option",{value:"openai",children:"OpenAI / OpenAI compatible"}),u.jsx("option",{value:"anthropic",children:"Anthropic"}),u.jsx("option",{value:"google",children:"Google Gemini"}),u.jsx("option",{value:"ollama",children:"Ollama"})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("接口地址","API endpoint")}),u.jsx("input",{value:F.endpoint,onChange:P=>$e({endpoint:P.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"API key"}),u.jsx("input",{type:"password",autoComplete:"off",value:F.apiKey,onChange:P=>$e({apiKey:P.target.value})})]})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("模型 ID","Model ID")}),u.jsx("input",{list:"models",value:F.model,placeholder:F.kind==="forsion"?E("使用账号默认模型","Use account default model"):"gpt-…",onChange:P=>$e({model:P.target.value})}),u.jsx("datalist",{id:"models",children:Ou.map(P=>u.jsx("option",{value:P.id,children:P.name},P.id))})]}),F.kind==="forsion"&&u.jsx("button",{className:"btn",onClick:()=>void Oe("models",async()=>ku((await Se("models")).models)),children:E("刷新可用模型","Refresh available models")})]})]});if(h==="templates")return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"section-title",children:[u.jsx("h1",{children:E("站点与模板","Sites & templates")}),u.jsxs("button",{className:"btn",onClick:()=>Mt({id:crypto.randomUUID(),name:"",pattern:"",enabled:!0,include:[],exclude:[]}),children:[u.jsx(Cl,{size:14}),E("新增","Add")]})]}),u.jsx("p",{children:E("用站点规则排除导航与广告,或只保留指定区域。","Remove navigation and ads, or include only specific regions.")}),x.templates.map(P=>u.jsxs("article",{className:"template-row",children:[u.jsxs("button",{onClick:()=>Mt(structuredClone(P)),children:[u.jsx("strong",{children:P.name}),u.jsx("small",{children:P.pattern})]}),u.jsx(Kn,{label:P.name,checked:P.enabled,onChange:()=>void Oe("template",()=>Q({templates:x.templates.map(be=>be.id===P.id?{...be,enabled:!be.enabled}:be)}))}),u.jsx("button",{title:E("移除模板","Remove template"),onClick:()=>void Oe("template",()=>Q({templates:x.templates.filter(be=>be.id!==P.id)})),children:u.jsx(Xi,{size:14})})]},P.id)),Re&&u.jsxs("section",{className:"card",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("模板名称","Template name")}),u.jsx("input",{value:Re.name,onChange:P=>Mt({...Re,name:P.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("网址匹配","URL pattern")}),u.jsx("input",{placeholder:"*.example.com/*",value:Re.pattern,onChange:P=>Mt({...Re,pattern:P.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("保留 CSS 选择器,每行一条","Include CSS selectors, one per line")}),u.jsx("textarea",{value:Re.include.join(`
|
|
397
|
+
`),onChange:P=>Mt({...Re,include:P.target.value.split(`
|
|
398
|
+
`)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("排除 CSS 选择器,每行一条","Exclude CSS selectors, one per line")}),u.jsx("textarea",{value:Re.exclude.join(`
|
|
399
|
+
`),onChange:P=>Mt({...Re,exclude:P.target.value.split(`
|
|
400
|
+
`)})})]}),u.jsxs("div",{className:"field",children:[u.jsx("span",{children:E("元数据选择器(可选)","Metadata selectors (optional)")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("标题选择器","Title selector")}),u.jsx("input",{value:((Ka=Re.metadataSelectors)==null?void 0:Ka.titleSelector)||"",onChange:P=>Mt({...Re,metadataSelectors:{...Re.metadataSelectors,titleSelector:P.target.value}})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("作者选择器","Author selector")}),u.jsx("input",{value:((Fr=Re.metadataSelectors)==null?void 0:Fr.authorSelector)||"",onChange:P=>Mt({...Re,metadataSelectors:{...Re.metadataSelectors,authorSelector:P.target.value}})})]})]}),u.jsx("h3",{children:E("重复内容块","Repeated content blocks")}),u.jsx("p",{className:"caption",children:E("为列表中的每条消息或卡片设置容器与保留区域。","Choose the container and included regions for each message or card in a list.")}),(Re.repeatedBlocks||[]).map((P,be)=>u.jsxs("div",{className:"card",children:[u.jsx(yt,{label:E("启用此规则","Enable this rule"),control:u.jsx(Kn,{label:E("启用此规则","Enable this rule"),checked:P.enabled!==!1,onChange:()=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.map((it,tt)=>tt===be?{...it,enabled:it.enabled===!1}:it)})})}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("规则名称","Rule name")}),u.jsx("input",{value:P.name||"",onChange:it=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.map((tt,nt)=>nt===be?{...tt,name:it.target.value}:tt)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("容器选择器","Container selector")}),u.jsx("input",{value:P.container,onChange:it=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.map((tt,nt)=>nt===be?{...tt,container:it.target.value}:tt)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("保留选择器,每行一条","Included selectors, one per line")}),u.jsx("textarea",{value:(P.include||[]).join(`
|
|
401
|
+
`),onChange:it=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.map((tt,nt)=>nt===be?{...tt,include:it.target.value.split(`
|
|
402
|
+
`)}:tt)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("排除选择器,每行一条","Excluded selectors, one per line")}),u.jsx("textarea",{value:(P.exclude||[]).join(`
|
|
403
|
+
`),onChange:it=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.map((tt,nt)=>nt===be?{...tt,exclude:it.target.value.split(`
|
|
404
|
+
`)}:tt)})})]}),u.jsx("button",{className:"btn",onClick:()=>Mt({...Re,repeatedBlocks:Re.repeatedBlocks.filter((it,tt)=>tt!==be)}),children:E("移除此规则","Remove rule")})]},be)),u.jsx("button",{className:"btn",onClick:()=>Mt({...Re,repeatedBlocks:[...Re.repeatedBlocks||[],{container:"",include:[],exclude:[],enabled:!0}]}),children:E("添加重复块规则","Add repeated block rule")}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"btn",onClick:()=>Mt(null),children:E("取消","Cancel")}),u.jsx("button",{className:"btn primary",disabled:!Re.name||!Re.pattern,onClick:()=>void Oe("template",async()=>{var be,it,tt;const P=[...Re.include,...Re.exclude,(be=Re.metadataSelectors)==null?void 0:be.titleSelector,(it=Re.metadataSelectors)==null?void 0:it.authorSelector,...(Re.repeatedBlocks||[]).flatMap(nt=>[nt.container,...nt.include||[],...nt.exclude||[]])];for(const nt of P)if(nt!=null&&nt.trim())try{document.createDocumentFragment().querySelector(nt)}catch{throw new Error(E("CSS 选择器无效:","Invalid CSS selector: ")+nt)}if((tt=Re.repeatedBlocks)!=null&&tt.some(nt=>nt.enabled!==!1&&!nt.container.trim()))throw new Error(E("已启用的重复块规则需要容器选择器。","Enabled repeated block rules require a container selector."));await Q({templates:[...x.templates.filter(nt=>nt.id!==Re.id),Re]}),Mt(null)}),children:E("保存模板","Save template")})]})]}),u.jsx("h2",{children:E("常驻站点","Persistent sites")}),u.jsx("p",{children:E("仅在这些站点自动恢复划线并显示选择工具条,每行一个域名。","Automatically restore highlights and show the selection toolbar on these domains, one per line.")}),u.jsx("textarea",{defaultValue:x.persistentSites.join(`
|
|
405
|
+
`),onBlur:P=>void Oe("sites",()=>Q({persistentSites:P.target.value.split(`
|
|
406
|
+
`).map(be=>be.trim()).filter(Boolean)}))}),u.jsx("h2",{children:E("自动剪藏站点","Auto-clip sites")}),u.jsx("p",{children:E("这些域名的网页载入完成后,自动加入默认保存队列。请仅填写希望自动保存的站点。","Pages on these exact domains are queued automatically after loading. Add only sites you want saved automatically.")}),u.jsx("textarea",{value:n.autoClipSites.join(`
|
|
407
|
+
`),onChange:P=>void ft({autoClipSites:P.target.value.split(`
|
|
408
|
+
`)})})]});if(h==="images"){const P=$y.find(be=>be.id===n.imageHost.id);return u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("图片与图床","Images & hosting")}),Na("保存时上传图片","Upload images on save","仅上传剪藏正文引用的图片。失败时保留原链接并显示错误。","Upload images referenced in the clip. Failed uploads keep the original URL and show an error.",n.imageHost.enabled,be=>void ft({imageHost:{...n.imageHost,enabled:be}})),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("图床","Image host")}),u.jsx("select",{value:n.imageHost.id,onChange:be=>void ft({imageHost:{...n.imageHost,id:be.target.value,options:{}}}),children:$y.map(be=>u.jsx("option",{value:be.id,children:Jn(be.label)},be.id))})]}),Ze((P==null?void 0:P.fields)||[],n.imageHost.options,be=>void ft({imageHost:{...n.imageHost,options:be}}))]})}return h==="desktop"?u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("桌面联动","Desktop connection")}),Au&&u.jsxs("div",{className:"card","data-testid":"clip-welcome",children:[u.jsx("h3",{children:E("Forsion Clip 装好了","Forsion Clip is installed")}),u.jsx("p",{children:r!=null&&r.desktop.paired?E("已连上本机的 Forsion:剪藏能存进本机智库。Tangu 浏览器控制的状态见本页下方。","Connected to Forsion on this computer. Clips can go into your local vault. Tangu browser control status is shown below."):Ae&&!Ae.connected?E("连不上本机的 Forsion。先打开 Forsion 再点下面的「请求配对」;还连不上就在 Forsion 的「设置 › 设备」里打开「允许其他设备连接本机」。不连 Forsion 也能剪藏:存到云端智库或下载。","Can't reach Forsion on this computer. Open Forsion, then click Request pairing below. If it still can't connect, turn on Settings › Devices › Allow other devices to connect in Forsion. You can still clip without Forsion: save to your cloud vault or download."):E("正在请求连接本机的 Forsion。在 Forsion 弹出的提示里点允许,剪藏和 Tangu 浏览器控制就一次配好了。","Asking Forsion on this computer to connect. Allow it in the prompt that Forsion shows, and clipping and Tangu browser control are set up in one go.")})]}),u.jsx("p",{children:E("配对后可保存到桌面端当前选择的本地智库。","Pair to save into the local vault currently selected in Forsion Desktop.")}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("桌面地址","Desktop address")}),u.jsx("input",{value:kt,onChange:P=>za(P.target.value)})]}),u.jsx("p",{className:"caption",children:E("这使用 Forsion 的设备配对。允许后,扩展将获得该设备的智库访问权限;你可以在桌面端撤销配对。","This uses Forsion device pairing. Approval grants vault access on that device; revoke the pairing in Desktop at any time.")}),u.jsxs("div",{className:"actions",children:[u.jsxs("button",{className:"btn",disabled:!!Mn,onClick:()=>void Oe("status",nl),children:[u.jsx(no,{size:14}),E("检查连接","Check connection")]}),u.jsx("button",{className:"btn primary",disabled:!!Mn||!!ua,onClick:()=>void Oe("pair",async()=>{const P=await Se("desktop-pair",{endpoint:kt});Ht(P)}),children:E("请求配对","Request pairing")}),(r==null?void 0:r.desktop.paired)&&u.jsx("button",{className:"btn",onClick:()=>void Oe("disconnect",async()=>{await Se("desktop-disconnect"),await _n(),ht(null),Ye(null)}),children:E("断开连接","Disconnect")})]}),Ae&&u.jsx("div",{className:Ae.connected?"notice-inline":"error",children:Ae.connected?`${Ae.name||"Forsion Desktop"} · ${Ae.paired?E("已配对","Paired"):E("尚未配对","Not paired")}`:Ae.error}),ua&&u.jsxs("div",{className:"card auth-code",children:[u.jsx("h3",{children:E("请在 Forsion 桌面端确认","Confirm in Forsion Desktop")}),u.jsx("code",{children:ua.code}),u.jsx("p",{children:ua.name}),u.jsx("button",{className:"btn",onClick:()=>void Oe("disconnect",async()=>{await Se("desktop-disconnect"),Ht(null)}),children:E("取消配对","Cancel pairing")})]}),se&&u.jsxs("p",{children:[E("已选择智库:","Selected vault: "),se.name||se.root]}),u.jsx("hr",{}),u.jsx(M4,{locale:n.locale}),u.jsx("hr",{}),u.jsx("h2",{children:"MCP"}),u.jsx("p",{children:E("让你授权的本机 AI 客户端列出网页、提取内容和保存剪藏。开启前,在本机启动随包提供的 MCP 服务。","Allow your local AI client to list pages, extract content and save clips. Start the included MCP service before enabling the connection.")}),Na("连接 MCP 服务","Connect MCP service","只连接本机地址,需填写双方一致的连接密钥。","Localhost only. Both sides must use the same connection key.",n.mcp.enabled,P=>void ft({mcp:{...n.mcp,enabled:P}})),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("服务地址","Service address")}),u.jsx("input",{value:n.mcp.endpoint,onChange:P=>void ft({mcp:{...n.mcp,endpoint:P.target.value}})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("连接密钥","Connection key")}),u.jsx("input",{type:"password",autoComplete:"off",value:n.mcp.token,onChange:P=>void ft({mcp:{...n.mcp,token:P.target.value}})})]}),u.jsx("button",{className:"btn",onClick:()=>void ft({mcp:{...n.mcp,token:crypto.randomUUID()+crypto.randomUUID()}}),children:E("生成连接密钥","Generate connection key")}),u.jsx("p",{className:"caption",children:E("MCP 客户端配置与启动方法见扩展包的 README。","See the extension package README for MCP client setup.")})]}):u.jsxs(u.Fragment,{children:[u.jsx("h1",{children:E("通用设置","General")}),u.jsx(yt,{label:E("界面语言","Language"),control:u.jsxs("select",{value:n.locale,onChange:P=>void ft({locale:P.target.value}),children:[u.jsx("option",{value:"zh",children:"中文"}),u.jsx("option",{value:"en",children:"English"})]})}),u.jsx(yt,{label:E("外观","Appearance"),control:u.jsxs("select",{value:n.theme,onChange:P=>void ft({theme:P.target.value}),children:[u.jsx("option",{value:"system",children:E("跟随系统","System")}),u.jsx("option",{value:"light",children:E("浅色","Light")}),u.jsx("option",{value:"dark",children:E("深色","Dark")})]})}),u.jsx(yt,{label:E("选区工具栏","Selection toolbar"),description:E("管理工具栏开关、翻译、阅读功能与禁用站点。","Manage the toolbar, translation, reading actions, and disabled sites."),control:u.jsxs("button",{type:"button",className:"btn",onClick:()=>m("selection"),children:[E("配置","Configure"),u.jsx(iw,{size:14})]})}),u.jsx(yt,{label:E("导出配置","Export preferences"),description:E("包含模板与偏好,不包含账号、密钥或配对令牌。","Includes templates and preferences, without credentials or pairing tokens."),control:u.jsxs("button",{className:"btn",onClick:()=>void Oe("export",async()=>Rh(JSON.stringify(await Se("preferences-export"),null,2),"forsion-clip-preferences.json","application/json")),children:[u.jsx(Ba,{size:14}),E("导出","Export")]})}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:E("导入配置","Import preferences")}),u.jsx("input",{type:"file",accept:"application/json,.json",onChange:P=>void Oe("import",async()=>{var nt;const be=(nt=P.target.files)==null?void 0:nt[0];if(!be)return;if(be.size>1e6)throw new Error("Configuration file too large");const it=JSON.parse(await be.text()),tt=g4.parse(it.settings);await Se("settings",tt),Array.isArray(it.templates)&&await Q({templates:it.templates}),await _n(),Me(E("已导入配置","Preferences imported"))})})]}),u.jsxs("p",{className:"caption",children:["Forsion Clip ",Vy," ·"," ",E("共享 Genesis UI 组件","Shared Genesis UI components")]})]})}}function Rh(n,a,r="text/markdown"){const s=new Blob([n],{type:r+";charset=utf-8"}),o=URL.createObjectURL(s);chrome.downloads.download({url:o,filename:a.replace(/[\\/:*?"<>|]/g,"-").slice(0,180),saveAs:!0}).finally(()=>setTimeout(()=>URL.revokeObjectURL(o),6e4))}Zj.createRoot(document.getElementById("app")).render(u.jsx(f3,{}));
|