@world-engines/project-host 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +46 -0
- package/assets/gui/WELogo-title.svg +11 -0
- package/assets/gui/app.js +1326 -0
- package/assets/gui/index.html +118 -0
- package/assets/gui/local-preview-asset-urls.js +61 -0
- package/assets/gui/local-preview-bridge.js +393 -0
- package/assets/gui/spatial-template-panel.js +233 -0
- package/assets/gui/styles.css +115 -0
- package/assets/gui/terrain-render.js +120 -0
- package/assets/gui/workspace-status.css +17 -0
- package/assets/gui/workspace-status.js +255 -0
- package/assets/gui/world-map-globe.js +187 -0
- package/assets/gui/world-map-worker.js +62 -0
- package/assets/gui/world-map.css +30 -0
- package/assets/gui/world-map.js +2466 -0
- package/dist/account-model-proxy.d.ts +21 -0
- package/dist/account-model-proxy.js +470 -0
- package/dist/authoring-browser-runtime.d.ts +7 -0
- package/dist/authoring-browser-runtime.js +110 -0
- package/dist/authoring-ingestion.d.ts +38 -0
- package/dist/authoring-ingestion.js +410 -0
- package/dist/authoring-model-connection.d.ts +166 -0
- package/dist/authoring-model-connection.js +757 -0
- package/dist/chinese-lexical.d.ts +152 -0
- package/dist/chinese-lexical.js +555 -0
- package/dist/chromium-preview-browser-driver.d.ts +43 -0
- package/dist/chromium-preview-browser-driver.js +575 -0
- package/dist/cli/download.d.ts +12 -0
- package/dist/cli/download.js +50 -0
- package/dist/cli/dump.d.ts +32 -0
- package/dist/cli/dump.js +91 -0
- package/dist/cli/ingest.d.ts +49 -0
- package/dist/cli/ingest.js +225 -0
- package/dist/cli/review.d.ts +10 -0
- package/dist/cli/review.js +44 -0
- package/dist/cli/upload.d.ts +57 -0
- package/dist/cli/upload.js +112 -0
- package/dist/cli-command.d.ts +60 -0
- package/dist/cli-command.js +613 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +182 -0
- package/dist/desktop-authoring-runtime.d.ts +88 -0
- package/dist/desktop-authoring-runtime.js +1602 -0
- package/dist/desktop-sidecar.d.ts +11 -0
- package/dist/desktop-sidecar.js +143 -0
- package/dist/document-dump.d.ts +113 -0
- package/dist/document-dump.js +431 -0
- package/dist/document-graph-extractor.d.ts +125 -0
- package/dist/document-graph-extractor.js +588 -0
- package/dist/document-ingestion-journal.d.ts +68 -0
- package/dist/document-ingestion-journal.js +471 -0
- package/dist/document-ingestion.d.ts +183 -0
- package/dist/document-ingestion.js +976 -0
- package/dist/document-query-path-proof.d.ts +30 -0
- package/dist/document-query-path-proof.js +34 -0
- package/dist/document-query-path-renderer.d.ts +50 -0
- package/dist/document-query-path-renderer.js +75 -0
- package/dist/document-query-proof-paths.d.ts +22 -0
- package/dist/document-query-proof-paths.js +71 -0
- package/dist/document-query.d.ts +97 -0
- package/dist/document-query.js +1106 -0
- package/dist/document-relation-role.d.ts +14 -0
- package/dist/document-relation-role.js +86 -0
- package/dist/document-source.d.ts +107 -0
- package/dist/document-source.js +255 -0
- package/dist/embedding-cache.d.ts +35 -0
- package/dist/embedding-cache.js +317 -0
- package/dist/frozen-review-local-pipeline.d.ts +88 -0
- package/dist/frozen-review-local-pipeline.js +609 -0
- package/dist/frozen-review-source-capture.d.ts +15 -0
- package/dist/frozen-review-source-capture.js +551 -0
- package/dist/frozen-review-wasm-encryptor.d.ts +16 -0
- package/dist/frozen-review-wasm-encryptor.js +72 -0
- package/dist/frozen-review.d.ts +131 -0
- package/dist/frozen-review.js +802 -0
- package/dist/graph-traversal.d.ts +23 -0
- package/dist/graph-traversal.js +100 -0
- package/dist/gui/graph-layout-worker.js +1 -0
- package/dist/gui/graph-layout.wasm +0 -0
- package/dist/gui/graph.css +1 -0
- package/dist/gui/graph.js +76 -0
- package/dist/gui/plane-generation.js +112 -0
- package/dist/gui/plane-generator.js +310 -0
- package/dist/gui/plane-generator_bg.wasm +0 -0
- package/dist/gui/procedural-city.js +595 -0
- package/dist/gui/road-generation.js +129 -0
- package/dist/gui/road-parcels.js +1584 -0
- package/dist/gui/score.css +1 -0
- package/dist/gui/score.js +54 -0
- package/dist/gui/spatial-runtime.js +1231 -0
- package/dist/gui/spatial-templates.js +200 -0
- package/dist/gui/trigger.css +1 -0
- package/dist/gui/trigger.js +142 -0
- package/dist/harness-callback-transport.d.ts +17 -0
- package/dist/harness-callback-transport.js +128 -0
- package/dist/harness-document-ingestion.d.ts +77 -0
- package/dist/harness-document-ingestion.js +343 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +43 -0
- package/dist/ingestion-source-reconciliation.d.ts +88 -0
- package/dist/ingestion-source-reconciliation.js +253 -0
- package/dist/ladybug-runtime.d.ts +117 -0
- package/dist/ladybug-runtime.js +886 -0
- package/dist/local-account-embedding.d.ts +34 -0
- package/dist/local-account-embedding.js +294 -0
- package/dist/local-gallery.d.ts +35 -0
- package/dist/local-gallery.js +227 -0
- package/dist/local-gui-auth.d.ts +96 -0
- package/dist/local-gui-auth.js +703 -0
- package/dist/local-gui-contract.d.ts +53 -0
- package/dist/local-gui-contract.js +5 -0
- package/dist/local-gui-image-assets.d.ts +17 -0
- package/dist/local-gui-image-assets.js +96 -0
- package/dist/local-gui-preview-client.d.ts +3 -0
- package/dist/local-gui-preview-client.js +111 -0
- package/dist/local-gui-score.d.ts +72 -0
- package/dist/local-gui-score.js +184 -0
- package/dist/local-gui-server.d.ts +10 -0
- package/dist/local-gui-server.js +987 -0
- package/dist/local-gui-version.d.ts +17 -0
- package/dist/local-gui-version.js +147 -0
- package/dist/local-gui-workspace.d.ts +14 -0
- package/dist/local-gui-workspace.js +171 -0
- package/dist/local-model-settings.d.ts +28 -0
- package/dist/local-model-settings.js +124 -0
- package/dist/local-preview-assets.d.ts +28 -0
- package/dist/local-preview-assets.js +124 -0
- package/dist/local-preview-bound-resources.d.ts +12 -0
- package/dist/local-preview-bound-resources.js +80 -0
- package/dist/local-preview-message-store.d.ts +63 -0
- package/dist/local-preview-message-store.js +214 -0
- package/dist/local-preview-player-read-models.d.ts +47 -0
- package/dist/local-preview-player-read-models.js +90 -0
- package/dist/local-preview-projections.d.ts +61 -0
- package/dist/local-preview-projections.js +117 -0
- package/dist/local-preview-runtime.d.ts +105 -0
- package/dist/local-preview-runtime.js +553 -0
- package/dist/local-preview-session.d.ts +73 -0
- package/dist/local-preview-session.js +395 -0
- package/dist/local-preview-source.d.ts +40 -0
- package/dist/local-preview-source.js +192 -0
- package/dist/local-preview-view-events.d.ts +101 -0
- package/dist/local-preview-view-events.js +179 -0
- package/dist/local-preview-view-state-sqlite.d.ts +24 -0
- package/dist/local-preview-view-state-sqlite.js +263 -0
- package/dist/local-preview-view-state.d.ts +93 -0
- package/dist/local-preview-view-state.js +108 -0
- package/dist/local-preview-vite-config.d.ts +6 -0
- package/dist/local-preview-vite-config.js +122 -0
- package/dist/local-preview-world-effects.d.ts +9 -0
- package/dist/local-preview-world-effects.js +55 -0
- package/dist/local-preview-worldline-store.d.ts +47 -0
- package/dist/local-preview-worldline-store.js +282 -0
- package/dist/local-preview-worldlines.d.ts +95 -0
- package/dist/local-preview-worldlines.js +136 -0
- package/dist/mcp-async-dispatcher.d.ts +3 -0
- package/dist/mcp-async-dispatcher.js +129 -0
- package/dist/mcp-line-queue.d.ts +14 -0
- package/dist/mcp-line-queue.js +184 -0
- package/dist/mcp-pipe-internal.d.ts +6 -0
- package/dist/mcp-pipe-internal.js +151 -0
- package/dist/mcp-pipe-response.d.ts +14 -0
- package/dist/mcp-pipe-response.js +50 -0
- package/dist/mcp-stdio-response.d.ts +12 -0
- package/dist/mcp-stdio-response.js +27 -0
- package/dist/mcp.d.ts +27 -0
- package/dist/mcp.js +194 -0
- package/dist/prepared-embedding-cache.d.ts +38 -0
- package/dist/prepared-embedding-cache.js +238 -0
- package/dist/preview-browser-adapter.d.ts +53 -0
- package/dist/preview-browser-adapter.js +171 -0
- package/dist/preview-runtime.d.ts +67 -0
- package/dist/preview-runtime.js +460 -0
- package/dist/project-auth-transport.d.ts +27 -0
- package/dist/project-auth-transport.js +121 -0
- package/dist/project-auth.d.ts +51 -0
- package/dist/project-auth.js +108 -0
- package/dist/project-git-capture-recovery.d.ts +16 -0
- package/dist/project-git-capture-recovery.js +347 -0
- package/dist/project-git-cli.d.ts +5 -0
- package/dist/project-git-cli.js +40 -0
- package/dist/project-git-scenario-source.d.ts +10 -0
- package/dist/project-git-scenario-source.js +240 -0
- package/dist/project-git-view-source.d.ts +13 -0
- package/dist/project-git-view-source.js +134 -0
- package/dist/project-git.d.ts +97 -0
- package/dist/project-git.js +656 -0
- package/dist/project-host.d.ts +59 -0
- package/dist/project-host.js +471 -0
- package/dist/project-writer-lease.d.ts +18 -0
- package/dist/project-writer-lease.js +430 -0
- package/dist/public-error.d.ts +7 -0
- package/dist/public-error.js +61 -0
- package/dist/retrieval-benchmark.d.ts +46 -0
- package/dist/retrieval-benchmark.js +58 -0
- package/dist/safe-project-path.d.ts +8 -0
- package/dist/safe-project-path.js +93 -0
- package/dist/scenario-writer.d.ts +32 -0
- package/dist/scenario-writer.js +191 -0
- package/dist/transfer/download.d.ts +159 -0
- package/dist/transfer/download.js +598 -0
- package/dist/transfer/transport.d.ts +26 -0
- package/dist/transfer/transport.js +1 -0
- package/dist/transfer/upload.d.ts +162 -0
- package/dist/transfer/upload.js +354 -0
- package/dist/transfer-types.d.ts +95 -0
- package/dist/transfer-types.js +1 -0
- package/dist/transfer.d.ts +18 -0
- package/dist/transfer.js +273 -0
- package/dist/trigger-runtime.d.ts +121 -0
- package/dist/trigger-runtime.js +153 -0
- package/dist/vendor/wasm-core/asset-hashes.json +5 -0
- package/dist/vendor/wasm-core/wasm_core.d.ts +490 -0
- package/dist/vendor/wasm-core/wasm_core.js +1 -0
- package/dist/vendor/wasm-core/wasm_core_bg.wasm +0 -0
- package/dist/view-watcher.d.ts +9 -0
- package/dist/view-watcher.js +34 -0
- package/package.json +110 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var yw=Object.create;var Ep=Object.defineProperty;var vw=Object.getOwnPropertyDescriptor;var xw=Object.getOwnPropertyNames;var ww=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var Dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Sw=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xw(t))!_w.call(e,o)&&o!==n&&Ep(e,o,{get:()=>t[o],enumerable:!(r=vw(t,o))||r.enumerable});return e};var We=(e,t,n)=>(n=e!=null?yw(ww(e)):{},Sw(t||!e||!e.__esModule?Ep(n,"default",{value:e,enumerable:!0}):n,e));var zp=Dt(se=>{"use strict";var ai=Symbol.for("react.element"),Ew=Symbol.for("react.portal"),Nw=Symbol.for("react.fragment"),kw=Symbol.for("react.strict_mode"),Cw=Symbol.for("react.profiler"),bw=Symbol.for("react.provider"),Pw=Symbol.for("react.context"),Iw=Symbol.for("react.forward_ref"),Mw=Symbol.for("react.suspense"),Rw=Symbol.for("react.memo"),Aw=Symbol.for("react.lazy"),Np=Symbol.iterator;function Dw(e){return e===null||typeof e!="object"?null:(e=Np&&e[Np]||e["@@iterator"],typeof e=="function"?e:null)}var bp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pp=Object.assign,Ip={};function ao(e,t,n){this.props=e,this.context=t,this.refs=Ip,this.updater=n||bp}ao.prototype.isReactComponent={};ao.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ao.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mp(){}Mp.prototype=ao.prototype;function Pu(e,t,n){this.props=e,this.context=t,this.refs=Ip,this.updater=n||bp}var Iu=Pu.prototype=new Mp;Iu.constructor=Pu;Pp(Iu,ao.prototype);Iu.isPureReactComponent=!0;var kp=Array.isArray,Rp=Object.prototype.hasOwnProperty,Mu={current:null},Ap={key:!0,ref:!0,__self:!0,__source:!0};function Dp(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Rp.call(t,r)&&!Ap.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){for(var a=Array(s),u=0;u<s;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:ai,type:e,key:i,ref:l,props:o,_owner:Mu.current}}function Tw(e,t){return{$$typeof:ai,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ru(e){return typeof e=="object"&&e!==null&&e.$$typeof===ai}function zw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Cp=/\/+/g;function bu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zw(""+e.key):t.toString(36)}function Kl(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case ai:case Ew:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+bu(l,0):r,kp(o)?(n="",e!=null&&(n=e.replace(Cp,"$&/")+"/"),Kl(o,t,n,"",function(u){return u})):o!=null&&(Ru(o)&&(o=Tw(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(Cp,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",kp(e))for(var s=0;s<e.length;s++){i=e[s];var a=r+bu(i,s);l+=Kl(i,t,n,a,o)}else if(a=Dw(e),typeof a=="function")for(e=a.call(e),s=0;!(i=e.next()).done;)i=i.value,a=r+bu(i,s++),l+=Kl(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Wl(e,t,n){if(e==null)return e;var r=[],o=0;return Kl(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Ow(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pt={current:null},Zl={transition:null},Lw={ReactCurrentDispatcher:pt,ReactCurrentBatchConfig:Zl,ReactCurrentOwner:Mu};function Tp(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:Wl,forEach:function(e,t,n){Wl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wl(e,function(){t++}),t},toArray:function(e){return Wl(e,function(t){return t})||[]},only:function(e){if(!Ru(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=ao;se.Fragment=Nw;se.Profiler=Cw;se.PureComponent=Pu;se.StrictMode=kw;se.Suspense=Mw;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lw;se.act=Tp;se.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Pp({},e.props),o=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=Mu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in t)Rp.call(t,a)&&!Ap.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&s!==void 0?s[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){s=Array(a);for(var u=0;u<a;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:ai,type:e.type,key:o,ref:i,props:r,_owner:l}};se.createContext=function(e){return e={$$typeof:Pw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:bw,_context:e},e.Consumer=e};se.createElement=Dp;se.createFactory=function(e){var t=Dp.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:Iw,render:e}};se.isValidElement=Ru;se.lazy=function(e){return{$$typeof:Aw,_payload:{_status:-1,_result:e},_init:Ow}};se.memo=function(e,t){return{$$typeof:Rw,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Zl.transition;Zl.transition={};try{e()}finally{Zl.transition=t}};se.unstable_act=Tp;se.useCallback=function(e,t){return pt.current.useCallback(e,t)};se.useContext=function(e){return pt.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return pt.current.useDeferredValue(e)};se.useEffect=function(e,t){return pt.current.useEffect(e,t)};se.useId=function(){return pt.current.useId()};se.useImperativeHandle=function(e,t,n){return pt.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return pt.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return pt.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return pt.current.useMemo(e,t)};se.useReducer=function(e,t,n){return pt.current.useReducer(e,t,n)};se.useRef=function(e){return pt.current.useRef(e)};se.useState=function(e){return pt.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return pt.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return pt.current.useTransition()};se.version="18.3.1"});var nn=Dt((Ob,Op)=>{"use strict";Op.exports=zp()});var jp=Dt(ve=>{"use strict";function zu(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<Ql(o,t))e[r]=t,e[n]=o,n=r;else break e}}function rn(e){return e.length===0?null:e[0]}function Jl(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var l=2*(r+1)-1,s=e[l],a=l+1,u=e[a];if(0>Ql(s,n))a<o&&0>Ql(u,s)?(e[r]=u,e[a]=n,r=a):(e[r]=s,e[l]=n,r=l);else if(a<o&&0>Ql(u,n))e[r]=u,e[a]=n,r=a;else break e}}return t}function Ql(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Lp=performance,ve.unstable_now=function(){return Lp.now()}):(Au=Date,$p=Au.now(),ve.unstable_now=function(){return Au.now()-$p});var Lp,Au,$p,wn=[],Zn=[],$w=1,Vt=null,ot=3,es=!1,Ir=!1,ci=!1,Gp=typeof setTimeout=="function"?setTimeout:null,Vp=typeof clearTimeout=="function"?clearTimeout:null,Fp=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ou(e){for(var t=rn(Zn);t!==null;){if(t.callback===null)Jl(Zn);else if(t.startTime<=e)Jl(Zn),t.sortIndex=t.expirationTime,zu(wn,t);else break;t=rn(Zn)}}function Lu(e){if(ci=!1,Ou(e),!Ir)if(rn(wn)!==null)Ir=!0,Fu($u);else{var t=rn(Zn);t!==null&&Hu(Lu,t.startTime-e)}}function $u(e,t){Ir=!1,ci&&(ci=!1,Vp(di),di=-1),es=!0;var n=ot;try{for(Ou(t),Vt=rn(wn);Vt!==null&&(!(Vt.expirationTime>t)||e&&!Up());){var r=Vt.callback;if(typeof r=="function"){Vt.callback=null,ot=Vt.priorityLevel;var o=r(Vt.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?Vt.callback=o:Vt===rn(wn)&&Jl(wn),Ou(t)}else Jl(wn);Vt=rn(wn)}if(Vt!==null)var i=!0;else{var l=rn(Zn);l!==null&&Hu(Lu,l.startTime-t),i=!1}return i}finally{Vt=null,ot=n,es=!1}}var ts=!1,ql=null,di=-1,Bp=5,Yp=-1;function Up(){return!(ve.unstable_now()-Yp<Bp)}function Du(){if(ql!==null){var e=ve.unstable_now();Yp=e;var t=!0;try{t=ql(!0,e)}finally{t?ui():(ts=!1,ql=null)}}else ts=!1}var ui;typeof Fp=="function"?ui=function(){Fp(Du)}:typeof MessageChannel<"u"?(Tu=new MessageChannel,Hp=Tu.port2,Tu.port1.onmessage=Du,ui=function(){Hp.postMessage(null)}):ui=function(){Gp(Du,0)};var Tu,Hp;function Fu(e){ql=e,ts||(ts=!0,ui())}function Hu(e,t){di=Gp(function(){e(ve.unstable_now())},t)}ve.unstable_IdlePriority=5;ve.unstable_ImmediatePriority=1;ve.unstable_LowPriority=4;ve.unstable_NormalPriority=3;ve.unstable_Profiling=null;ve.unstable_UserBlockingPriority=2;ve.unstable_cancelCallback=function(e){e.callback=null};ve.unstable_continueExecution=function(){Ir||es||(Ir=!0,Fu($u))};ve.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Bp=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return ot};ve.unstable_getFirstCallbackNode=function(){return rn(wn)};ve.unstable_next=function(e){switch(ot){case 1:case 2:case 3:var t=3;break;default:t=ot}var n=ot;ot=t;try{return e()}finally{ot=n}};ve.unstable_pauseExecution=function(){};ve.unstable_requestPaint=function(){};ve.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=ot;ot=e;try{return t()}finally{ot=n}};ve.unstable_scheduleCallback=function(e,t,n){var r=ve.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:$w++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,zu(Zn,e),rn(wn)===null&&e===rn(Zn)&&(ci?(Vp(di),di=-1):ci=!0,Hu(Lu,n-r))):(e.sortIndex=o,zu(wn,e),Ir||es||(Ir=!0,Fu($u))),e};ve.unstable_shouldYield=Up;ve.unstable_wrapCallback=function(e){var t=ot;return function(){var n=ot;ot=t;try{return e.apply(this,arguments)}finally{ot=n}}}});var Wp=Dt(($b,Xp)=>{"use strict";Xp.exports=jp()});var qg=Dt(Ft=>{"use strict";var Fw=nn(),Lt=Wp();function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var tm=new Set,Di={};function Vr(e,t){Mo(e,t),Mo(e+"Capture",t)}function Mo(e,t){for(Di[e]=t,e=0;e<t.length;e++)tm.add(t[e])}var On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uc=Object.prototype.hasOwnProperty,Hw=/^[: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]*$/,Kp={},Zp={};function Gw(e){return uc.call(Zp,e)?!0:uc.call(Kp,e)?!1:Hw.test(e)?Zp[e]=!0:(Kp[e]=!0,!1)}function Vw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Bw(e,t,n,r){if(t===null||typeof t>"u"||Vw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gt(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new gt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new gt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new gt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new gt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qe[e]=new gt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new gt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new gt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new gt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new gt(e,5,!1,e.toLowerCase(),null,!1,!1)});var td=/[\-:]([a-z])/g;function nd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(td,nd);Qe[t]=new gt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(td,nd);Qe[t]=new gt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(td,nd);Qe[t]=new gt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new gt(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new gt(e,1,!1,e.toLowerCase(),null,!0,!0)});function rd(e,t,n,r){var o=Qe.hasOwnProperty(t)?Qe[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Bw(t,n,o,r)&&(n=null),r||o===null?Gw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Hn=Fw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ns=Symbol.for("react.element"),fo=Symbol.for("react.portal"),po=Symbol.for("react.fragment"),od=Symbol.for("react.strict_mode"),cc=Symbol.for("react.profiler"),nm=Symbol.for("react.provider"),rm=Symbol.for("react.context"),id=Symbol.for("react.forward_ref"),dc=Symbol.for("react.suspense"),fc=Symbol.for("react.suspense_list"),ld=Symbol.for("react.memo"),qn=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var om=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Qp=Symbol.iterator;function fi(e){return e===null||typeof e!="object"?null:(e=Qp&&e[Qp]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Object.assign,Gu;function wi(e){if(Gu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Gu=t&&t[1]||""}return`
|
|
2
|
+
`+Gu+e}var Vu=!1;function Bu(e,t){if(!e||Vu)return"";Vu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
3
|
+
`),i=r.stack.split(`
|
|
4
|
+
`),l=o.length-1,s=i.length-1;1<=l&&0<=s&&o[l]!==i[s];)s--;for(;1<=l&&0<=s;l--,s--)if(o[l]!==i[s]){if(l!==1||s!==1)do if(l--,s--,0>s||o[l]!==i[s]){var a=`
|
|
5
|
+
`+o[l].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{Vu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wi(e):""}function Yw(e){switch(e.tag){case 5:return wi(e.type);case 16:return wi("Lazy");case 13:return wi("Suspense");case 19:return wi("SuspenseList");case 0:case 2:case 15:return e=Bu(e.type,!1),e;case 11:return e=Bu(e.type.render,!1),e;case 1:return e=Bu(e.type,!0),e;default:return""}}function pc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case po:return"Fragment";case fo:return"Portal";case cc:return"Profiler";case od:return"StrictMode";case dc:return"Suspense";case fc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case rm:return(e.displayName||"Context")+".Consumer";case nm:return(e._context.displayName||"Context")+".Provider";case id:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ld:return t=e.displayName||null,t!==null?t:pc(e.type)||"Memo";case qn:t=e._payload,e=e._init;try{return pc(e(t))}catch{}}return null}function Uw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pc(t);case 8:return t===od?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function im(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jw(e){var t=im(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rs(e){e._valueTracker||(e._valueTracker=jw(e))}function lm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=im(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rs(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 hc(e,t){var n=t.checked;return Ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sm(e,t){t=t.checked,t!=null&&rd(e,"checked",t,!1)}function mc(e,t){sm(e,t);var n=fr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gc(e,t.type,n):t.hasOwnProperty("defaultValue")&&gc(e,t.type,fr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function gc(e,t,n){(t!=="number"||Rs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _i=Array.isArray;function No(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function yc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Ce({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function eh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(_i(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fr(n)}}function am(e,t){var n=fr(t.value),r=fr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function th(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function um(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?um(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var os,cm=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(os=os||document.createElement("div"),os.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=os.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ti(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ni={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xw=["Webkit","ms","Moz","O"];Object.keys(Ni).forEach(function(e){Xw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ni[t]=Ni[e]})});function dm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ni.hasOwnProperty(e)&&Ni[e]?(""+t).trim():t+"px"}function fm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=dm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Ww=Ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xc(e,t){if(t){if(Ww[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function wc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 _c=null;function sd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sc=null,ko=null,Co=null;function nh(e){if(e=qi(e)){if(typeof Sc!="function")throw Error(B(280));var t=e.stateNode;t&&(t=ia(t),Sc(e.stateNode,e.type,t))}}function pm(e){ko?Co?Co.push(e):Co=[e]:ko=e}function hm(){if(ko){var e=ko,t=Co;if(Co=ko=null,nh(e),t)for(e=0;e<t.length;e++)nh(t[e])}}function mm(e,t){return e(t)}function gm(){}var Yu=!1;function ym(e,t,n){if(Yu)return e(t,n);Yu=!0;try{return mm(e,t,n)}finally{Yu=!1,(ko!==null||Co!==null)&&(gm(),hm())}}function zi(e,t){var n=e.stateNode;if(n===null)return null;var r=ia(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Ec=!1;if(On)try{uo={},Object.defineProperty(uo,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",uo,uo),window.removeEventListener("test",uo,uo)}catch{Ec=!1}var uo;function Kw(e,t,n,r,o,i,l,s,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var ki=!1,As=null,Ds=!1,Nc=null,Zw={onError:function(e){ki=!0,As=e}};function Qw(e,t,n,r,o,i,l,s,a){ki=!1,As=null,Kw.apply(Zw,arguments)}function qw(e,t,n,r,o,i,l,s,a){if(Qw.apply(this,arguments),ki){if(ki){var u=As;ki=!1,As=null}else throw Error(B(198));Ds||(Ds=!0,Nc=u)}}function Br(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function vm(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 rh(e){if(Br(e)!==e)throw Error(B(188))}function Jw(e){var t=e.alternate;if(!t){if(t=Br(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return rh(o),e;if(i===r)return rh(o),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=i;else{for(var l=!1,s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l){for(s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function xm(e){return e=Jw(e),e!==null?wm(e):null}function wm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=wm(e);if(t!==null)return t;e=e.sibling}return null}var _m=Lt.unstable_scheduleCallback,oh=Lt.unstable_cancelCallback,e1=Lt.unstable_shouldYield,t1=Lt.unstable_requestPaint,Ae=Lt.unstable_now,n1=Lt.unstable_getCurrentPriorityLevel,ad=Lt.unstable_ImmediatePriority,Sm=Lt.unstable_UserBlockingPriority,Ts=Lt.unstable_NormalPriority,r1=Lt.unstable_LowPriority,Em=Lt.unstable_IdlePriority,ta=null,Nn=null;function o1(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(ta,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:s1,i1=Math.log,l1=Math.LN2;function s1(e){return e>>>=0,e===0?32:31-(i1(e)/l1|0)|0}var is=64,ls=4194304;function Si(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=Si(s):(i&=l,i!==0&&(r=Si(i)))}else l=n&~o,l!==0?r=Si(l):i!==0&&(r=Si(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-un(t),o=1<<n,r|=e[n],t&=~o;return r}function a1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function u1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-un(i),s=1<<l,a=o[l];a===-1?(!(s&n)||s&r)&&(o[l]=a1(s,t)):a<=t&&(e.expiredLanes|=s),i&=~s}}function kc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Nm(){var e=is;return is<<=1,!(is&4194240)&&(is=64),e}function Uu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=n}function c1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-un(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ud(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-un(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var me=0;function km(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Cm,cd,bm,Pm,Im,Cc=!1,ss=[],or=null,ir=null,lr=null,Oi=new Map,Li=new Map,er=[],d1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ih(e,t){switch(e){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":Oi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(t.pointerId)}}function pi(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=qi(t),t!==null&&cd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function f1(e,t,n,r,o){switch(t){case"focusin":return or=pi(or,e,t,n,r,o),!0;case"dragenter":return ir=pi(ir,e,t,n,r,o),!0;case"mouseover":return lr=pi(lr,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Oi.set(i,pi(Oi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Li.set(i,pi(Li.get(i)||null,e,t,n,r,o)),!0}return!1}function Mm(e){var t=Ar(e.target);if(t!==null){var n=Br(t);if(n!==null){if(t=n.tag,t===13){if(t=vm(n),t!==null){e.blockedOn=t,Im(e.priority,function(){bm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_c=r,n.target.dispatchEvent(r),_c=null}else return t=qi(n),t!==null&&cd(t),e.blockedOn=n,!1;t.shift()}return!0}function lh(e,t,n){_s(e)&&n.delete(t)}function p1(){Cc=!1,or!==null&&_s(or)&&(or=null),ir!==null&&_s(ir)&&(ir=null),lr!==null&&_s(lr)&&(lr=null),Oi.forEach(lh),Li.forEach(lh)}function hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Cc||(Cc=!0,Lt.unstable_scheduleCallback(Lt.unstable_NormalPriority,p1)))}function $i(e){function t(o){return hi(o,e)}if(0<ss.length){hi(ss[0],e);for(var n=1;n<ss.length;n++){var r=ss[n];r.blockedOn===e&&(r.blockedOn=null)}}for(or!==null&&hi(or,e),ir!==null&&hi(ir,e),lr!==null&&hi(lr,e),Oi.forEach(t),Li.forEach(t),n=0;n<er.length;n++)r=er[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<er.length&&(n=er[0],n.blockedOn===null);)Mm(n),n.blockedOn===null&&er.shift()}var bo=Hn.ReactCurrentBatchConfig,Os=!0;function h1(e,t,n,r){var o=me,i=bo.transition;bo.transition=null;try{me=1,dd(e,t,n,r)}finally{me=o,bo.transition=i}}function m1(e,t,n,r){var o=me,i=bo.transition;bo.transition=null;try{me=4,dd(e,t,n,r)}finally{me=o,bo.transition=i}}function dd(e,t,n,r){if(Os){var o=bc(e,t,n,r);if(o===null)qu(e,t,r,Ls,n),ih(e,r);else if(f1(o,e,t,n,r))r.stopPropagation();else if(ih(e,r),t&4&&-1<d1.indexOf(e)){for(;o!==null;){var i=qi(o);if(i!==null&&Cm(i),i=bc(e,t,n,r),i===null&&qu(e,t,r,Ls,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else qu(e,t,r,null,n)}}var Ls=null;function bc(e,t,n,r){if(Ls=null,e=sd(r),e=Ar(e),e!==null)if(t=Br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vm(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ls=e,null}function Rm(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(n1()){case ad:return 1;case Sm:return 4;case Ts:case r1:return 16;case Em:return 536870912;default:return 16}default:return 16}}var nr=null,fd=null,Ss=null;function Am(){if(Ss)return Ss;var e,t=fd,n=t.length,r,o="value"in nr?nr.value:nr.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===o[i-r];r++);return Ss=o.slice(e,1<r?1-r:void 0)}function Es(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 as(){return!0}function sh(){return!1}function $t(e){function t(n,r,o,i,l){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(i):i[s]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?as:sh,this.isPropagationStopped=sh,this}return Ce(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=as)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=as)},persist:function(){},isPersistent:as}),t}var Lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pd=$t(Lo),Qi=Ce({},Lo,{view:0,detail:0}),g1=$t(Qi),ju,Xu,mi,na=Ce({},Qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hd,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!==mi&&(mi&&e.type==="mousemove"?(ju=e.screenX-mi.screenX,Xu=e.screenY-mi.screenY):Xu=ju=0,mi=e),ju)},movementY:function(e){return"movementY"in e?e.movementY:Xu}}),ah=$t(na),y1=Ce({},na,{dataTransfer:0}),v1=$t(y1),x1=Ce({},Qi,{relatedTarget:0}),Wu=$t(x1),w1=Ce({},Lo,{animationName:0,elapsedTime:0,pseudoElement:0}),_1=$t(w1),S1=Ce({},Lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E1=$t(S1),N1=Ce({},Lo,{data:0}),uh=$t(N1),k1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C1={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"},b1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=b1[e])?!!t[e]:!1}function hd(){return P1}var I1=Ce({},Qi,{key:function(e){if(e.key){var t=k1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Es(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?C1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hd,charCode:function(e){return e.type==="keypress"?Es(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Es(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),M1=$t(I1),R1=Ce({},na,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ch=$t(R1),A1=Ce({},Qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hd}),D1=$t(A1),T1=Ce({},Lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),z1=$t(T1),O1=Ce({},na,{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}),L1=$t(O1),$1=[9,13,27,32],md=On&&"CompositionEvent"in window,Ci=null;On&&"documentMode"in document&&(Ci=document.documentMode);var F1=On&&"TextEvent"in window&&!Ci,Dm=On&&(!md||Ci&&8<Ci&&11>=Ci),dh=" ",fh=!1;function Tm(e,t){switch(e){case"keyup":return $1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ho=!1;function H1(e,t){switch(e){case"compositionend":return zm(t);case"keypress":return t.which!==32?null:(fh=!0,dh);case"textInput":return e=t.data,e===dh&&fh?null:e;default:return null}}function G1(e,t){if(ho)return e==="compositionend"||!md&&Tm(e,t)?(e=Am(),Ss=fd=nr=null,ho=!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 Dm&&t.locale!=="ko"?null:t.data;default:return null}}var V1={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 ph(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!V1[e.type]:t==="textarea"}function Om(e,t,n,r){pm(r),t=$s(t,"onChange"),0<t.length&&(n=new pd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var bi=null,Fi=null;function B1(e){Xm(e,0)}function ra(e){var t=yo(e);if(lm(t))return e}function Y1(e,t){if(e==="change")return t}var Lm=!1;On&&(On?(cs="oninput"in document,cs||(Ku=document.createElement("div"),Ku.setAttribute("oninput","return;"),cs=typeof Ku.oninput=="function"),us=cs):us=!1,Lm=us&&(!document.documentMode||9<document.documentMode));var us,cs,Ku;function hh(){bi&&(bi.detachEvent("onpropertychange",$m),Fi=bi=null)}function $m(e){if(e.propertyName==="value"&&ra(Fi)){var t=[];Om(t,Fi,e,sd(e)),ym(B1,t)}}function U1(e,t,n){e==="focusin"?(hh(),bi=t,Fi=n,bi.attachEvent("onpropertychange",$m)):e==="focusout"&&hh()}function j1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ra(Fi)}function X1(e,t){if(e==="click")return ra(t)}function W1(e,t){if(e==="input"||e==="change")return ra(t)}function K1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:K1;function Hi(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!uc.call(t,o)||!dn(e[o],t[o]))return!1}return!0}function mh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gh(e,t){var n=mh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mh(n)}}function Fm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hm(){for(var e=window,t=Rs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function gd(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")}function Z1(e){var t=Hm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Fm(n.ownerDocument.documentElement,n)){if(r!==null&&gd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=gh(n,i);var l=gh(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Q1=On&&"documentMode"in document&&11>=document.documentMode,mo=null,Pc=null,Pi=null,Ic=!1;function yh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ic||mo==null||mo!==Rs(r)||(r=mo,"selectionStart"in r&&gd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pi&&Hi(Pi,r)||(Pi=r,r=$s(Pc,"onSelect"),0<r.length&&(t=new pd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mo)))}function ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var go={animationend:ds("Animation","AnimationEnd"),animationiteration:ds("Animation","AnimationIteration"),animationstart:ds("Animation","AnimationStart"),transitionend:ds("Transition","TransitionEnd")},Zu={},Gm={};On&&(Gm=document.createElement("div").style,"AnimationEvent"in window||(delete go.animationend.animation,delete go.animationiteration.animation,delete go.animationstart.animation),"TransitionEvent"in window||delete go.transitionend.transition);function oa(e){if(Zu[e])return Zu[e];if(!go[e])return e;var t=go[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gm)return Zu[e]=t[n];return e}var Vm=oa("animationend"),Bm=oa("animationiteration"),Ym=oa("animationstart"),Um=oa("transitionend"),jm=new Map,vh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function hr(e,t){jm.set(e,t),Vr(t,[e])}for(fs=0;fs<vh.length;fs++)ps=vh[fs],xh=ps.toLowerCase(),wh=ps[0].toUpperCase()+ps.slice(1),hr(xh,"on"+wh);var ps,xh,wh,fs;hr(Vm,"onAnimationEnd");hr(Bm,"onAnimationIteration");hr(Ym,"onAnimationStart");hr("dblclick","onDoubleClick");hr("focusin","onFocus");hr("focusout","onBlur");hr(Um,"onTransitionEnd");Mo("onMouseEnter",["mouseout","mouseover"]);Mo("onMouseLeave",["mouseout","mouseover"]);Mo("onPointerEnter",["pointerout","pointerover"]);Mo("onPointerLeave",["pointerout","pointerover"]);Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ei="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(" "),q1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ei));function _h(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,qw(r,t,void 0,e),e.currentTarget=null}function Xm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],a=s.instance,u=s.currentTarget;if(s=s.listener,a!==i&&o.isPropagationStopped())break e;_h(o,s,u),i=a}else for(l=0;l<r.length;l++){if(s=r[l],a=s.instance,u=s.currentTarget,s=s.listener,a!==i&&o.isPropagationStopped())break e;_h(o,s,u),i=a}}}if(Ds)throw e=Nc,Ds=!1,Nc=null,e}function we(e,t){var n=t[Tc];n===void 0&&(n=t[Tc]=new Set);var r=e+"__bubble";n.has(r)||(Wm(t,e,2,!1),n.add(r))}function Qu(e,t,n){var r=0;t&&(r|=4),Wm(n,e,r,t)}var hs="_reactListening"+Math.random().toString(36).slice(2);function Gi(e){if(!e[hs]){e[hs]=!0,tm.forEach(function(n){n!=="selectionchange"&&(q1.has(n)||Qu(n,!1,e),Qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hs]||(t[hs]=!0,Qu("selectionchange",!1,t))}}function Wm(e,t,n,r){switch(Rm(t)){case 1:var o=h1;break;case 4:o=m1;break;default:o=dd}n=o.bind(null,t,n,e),o=void 0,!Ec||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function qu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===o||s.nodeType===8&&s.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var a=l.tag;if((a===3||a===4)&&(a=l.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;l=l.return}for(;s!==null;){if(l=Ar(s),l===null)return;if(a=l.tag,a===5||a===6){r=i=l;continue e}s=s.parentNode}}r=r.return}ym(function(){var u=i,c=sd(n),d=[];e:{var f=jm.get(e);if(f!==void 0){var m=pd,v=e;switch(e){case"keypress":if(Es(n)===0)break e;case"keydown":case"keyup":m=M1;break;case"focusin":v="focus",m=Wu;break;case"focusout":v="blur",m=Wu;break;case"beforeblur":case"afterblur":m=Wu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=ah;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=v1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=D1;break;case Vm:case Bm:case Ym:m=_1;break;case Um:m=z1;break;case"scroll":m=g1;break;case"wheel":m=L1;break;case"copy":case"cut":case"paste":m=E1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=ch}var g=(t&4)!==0,E=!g&&e==="scroll",p=g?f!==null?f+"Capture":null:f;g=[];for(var h=u,y;h!==null;){y=h;var x=y.stateNode;if(y.tag===5&&x!==null&&(y=x,p!==null&&(x=zi(h,p),x!=null&&g.push(Vi(h,x,y)))),E)break;h=h.return}0<g.length&&(f=new m(f,v,null,n,c),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==_c&&(v=n.relatedTarget||n.fromElement)&&(Ar(v)||v[Ln]))break e;if((m||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=u,v=v?Ar(v):null,v!==null&&(E=Br(v),v!==E||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=ah,x="onMouseLeave",p="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(g=ch,x="onPointerLeave",p="onPointerEnter",h="pointer"),E=m==null?f:yo(m),y=v==null?f:yo(v),f=new g(x,h+"leave",m,n,c),f.target=E,f.relatedTarget=y,x=null,Ar(c)===u&&(g=new g(p,h+"enter",v,n,c),g.target=y,g.relatedTarget=E,x=g),E=x,m&&v)t:{for(g=m,p=v,h=0,y=g;y;y=co(y))h++;for(y=0,x=p;x;x=co(x))y++;for(;0<h-y;)g=co(g),h--;for(;0<y-h;)p=co(p),y--;for(;h--;){if(g===p||p!==null&&g===p.alternate)break t;g=co(g),p=co(p)}g=null}else g=null;m!==null&&Sh(d,f,m,g,!1),v!==null&&E!==null&&Sh(d,E,v,g,!0)}}e:{if(f=u?yo(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var N=Y1;else if(ph(f))if(Lm)N=W1;else{N=j1;var k=U1}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=X1);if(N&&(N=N(e,u))){Om(d,N,n,c);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&gc(f,"number",f.value)}switch(k=u?yo(u):window,e){case"focusin":(ph(k)||k.contentEditable==="true")&&(mo=k,Pc=u,Pi=null);break;case"focusout":Pi=Pc=mo=null;break;case"mousedown":Ic=!0;break;case"contextmenu":case"mouseup":case"dragend":Ic=!1,yh(d,n,c);break;case"selectionchange":if(Q1)break;case"keydown":case"keyup":yh(d,n,c)}var P;if(md)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else ho?Tm(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(Dm&&n.locale!=="ko"&&(ho||I!=="onCompositionStart"?I==="onCompositionEnd"&&ho&&(P=Am()):(nr=c,fd="value"in nr?nr.value:nr.textContent,ho=!0)),k=$s(u,I),0<k.length&&(I=new uh(I,e,null,n,c),d.push({event:I,listeners:k}),P?I.data=P:(P=zm(n),P!==null&&(I.data=P)))),(P=F1?H1(e,n):G1(e,n))&&(u=$s(u,"onBeforeInput"),0<u.length&&(c=new uh("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=P))}Xm(d,t)})}function Vi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $s(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zi(e,n),i!=null&&r.unshift(Vi(e,i,o)),i=zi(e,t),i!=null&&r.push(Vi(e,i,o))),e=e.return}return r}function co(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sh(e,t,n,r,o){for(var i=t._reactName,l=[];n!==null&&n!==r;){var s=n,a=s.alternate,u=s.stateNode;if(a!==null&&a===r)break;s.tag===5&&u!==null&&(s=u,o?(a=zi(n,i),a!=null&&l.unshift(Vi(n,a,s))):o||(a=zi(n,i),a!=null&&l.push(Vi(n,a,s)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var J1=/\r\n?/g,e_=/\u0000|\uFFFD/g;function Eh(e){return(typeof e=="string"?e:""+e).replace(J1,`
|
|
6
|
+
`).replace(e_,"")}function ms(e,t,n){if(t=Eh(t),Eh(e)!==t&&n)throw Error(B(425))}function Fs(){}var Mc=null,Rc=null;function Ac(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Dc=typeof setTimeout=="function"?setTimeout:void 0,t_=typeof clearTimeout=="function"?clearTimeout:void 0,Nh=typeof Promise=="function"?Promise:void 0,n_=typeof queueMicrotask=="function"?queueMicrotask:typeof Nh<"u"?function(e){return Nh.resolve(null).then(e).catch(r_)}:Dc;function r_(e){setTimeout(function(){throw e})}function Ju(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),$i(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);$i(t)}function sr(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==="$?")break;if(t==="/$")return null}}return e}function kh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $o=Math.random().toString(36).slice(2),En="__reactFiber$"+$o,Bi="__reactProps$"+$o,Ln="__reactContainer$"+$o,Tc="__reactEvents$"+$o,o_="__reactListeners$"+$o,i_="__reactHandles$"+$o;function Ar(e){var t=e[En];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[En]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kh(e);e!==null;){if(n=e[En])return n;e=kh(e)}return t}e=n,n=e.parentNode}return null}function qi(e){return e=e[En]||e[Ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function yo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function ia(e){return e[Bi]||null}var zc=[],vo=-1;function mr(e){return{current:e}}function _e(e){0>vo||(e.current=zc[vo],zc[vo]=null,vo--)}function xe(e,t){vo++,zc[vo]=e.current,e.current=t}var pr={},at=mr(pr),Nt=mr(!1),Lr=pr;function Ro(e,t){var n=e.type.contextTypes;if(!n)return pr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function kt(e){return e=e.childContextTypes,e!=null}function Hs(){_e(Nt),_e(at)}function Ch(e,t,n){if(at.current!==pr)throw Error(B(168));xe(at,t),xe(Nt,n)}function Km(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,Uw(e)||"Unknown",o));return Ce({},n,r)}function Gs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pr,Lr=at.current,xe(at,e),xe(Nt,Nt.current),!0}function bh(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Km(e,t,Lr),r.__reactInternalMemoizedMergedChildContext=e,_e(Nt),_e(at),xe(at,e)):_e(Nt),xe(Nt,n)}var An=null,la=!1,ec=!1;function Zm(e){An===null?An=[e]:An.push(e)}function l_(e){la=!0,Zm(e)}function gr(){if(!ec&&An!==null){ec=!0;var e=0,t=me;try{var n=An;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}An=null,la=!1}catch(o){throw An!==null&&(An=An.slice(e+1)),_m(ad,gr),o}finally{me=t,ec=!1}}return null}var xo=[],wo=0,Vs=null,Bs=0,Bt=[],Yt=0,$r=null,Dn=1,Tn="";function Mr(e,t){xo[wo++]=Bs,xo[wo++]=Vs,Vs=e,Bs=t}function Qm(e,t,n){Bt[Yt++]=Dn,Bt[Yt++]=Tn,Bt[Yt++]=$r,$r=e;var r=Dn;e=Tn;var o=32-un(r)-1;r&=~(1<<o),n+=1;var i=32-un(t)+o;if(30<i){var l=o-o%5;i=(r&(1<<l)-1).toString(32),r>>=l,o-=l,Dn=1<<32-un(t)+o|n<<o|r,Tn=i+e}else Dn=1<<i|n<<o|r,Tn=e}function yd(e){e.return!==null&&(Mr(e,1),Qm(e,1,0))}function vd(e){for(;e===Vs;)Vs=xo[--wo],xo[wo]=null,Bs=xo[--wo],xo[wo]=null;for(;e===$r;)$r=Bt[--Yt],Bt[Yt]=null,Tn=Bt[--Yt],Bt[Yt]=null,Dn=Bt[--Yt],Bt[Yt]=null}var Ot=null,zt=null,Se=!1,an=null;function qm(e,t){var n=Ut(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ph(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ot=e,zt=sr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ot=e,zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$r!==null?{id:Dn,overflow:Tn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ut(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ot=e,zt=null,!0):!1;default:return!1}}function Oc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Lc(e){if(Se){var t=zt;if(t){var n=t;if(!Ph(e,t)){if(Oc(e))throw Error(B(418));t=sr(n.nextSibling);var r=Ot;t&&Ph(e,t)?qm(r,n):(e.flags=e.flags&-4097|2,Se=!1,Ot=e)}}else{if(Oc(e))throw Error(B(418));e.flags=e.flags&-4097|2,Se=!1,Ot=e}}}function Ih(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ot=e}function gs(e){if(e!==Ot)return!1;if(!Se)return Ih(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ac(e.type,e.memoizedProps)),t&&(t=zt)){if(Oc(e))throw Jm(),Error(B(418));for(;t;)qm(e,t),t=sr(t.nextSibling)}if(Ih(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){zt=sr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}zt=null}}else zt=Ot?sr(e.stateNode.nextSibling):null;return!0}function Jm(){for(var e=zt;e;)e=sr(e.nextSibling)}function Ao(){zt=Ot=null,Se=!1}function xd(e){an===null?an=[e]:an.push(e)}var s_=Hn.ReactCurrentBatchConfig;function gi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var s=o.refs;l===null?delete s[i]:s[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function ys(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Mh(e){var t=e._init;return t(e._payload)}function eg(e){function t(p,h){if(e){var y=p.deletions;y===null?(p.deletions=[h],p.flags|=16):y.push(h)}}function n(p,h){if(!e)return null;for(;h!==null;)t(p,h),h=h.sibling;return null}function r(p,h){for(p=new Map;h!==null;)h.key!==null?p.set(h.key,h):p.set(h.index,h),h=h.sibling;return p}function o(p,h){return p=dr(p,h),p.index=0,p.sibling=null,p}function i(p,h,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<h?(p.flags|=2,h):y):(p.flags|=2,h)):(p.flags|=1048576,h)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function s(p,h,y,x){return h===null||h.tag!==6?(h=sc(y,p.mode,x),h.return=p,h):(h=o(h,y),h.return=p,h)}function a(p,h,y,x){var N=y.type;return N===po?c(p,h,y.props.children,x,y.key):h!==null&&(h.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===qn&&Mh(N)===h.type)?(x=o(h,y.props),x.ref=gi(p,h,y),x.return=p,x):(x=Ms(y.type,y.key,y.props,null,p.mode,x),x.ref=gi(p,h,y),x.return=p,x)}function u(p,h,y,x){return h===null||h.tag!==4||h.stateNode.containerInfo!==y.containerInfo||h.stateNode.implementation!==y.implementation?(h=ac(y,p.mode,x),h.return=p,h):(h=o(h,y.children||[]),h.return=p,h)}function c(p,h,y,x,N){return h===null||h.tag!==7?(h=Or(y,p.mode,x,N),h.return=p,h):(h=o(h,y),h.return=p,h)}function d(p,h,y){if(typeof h=="string"&&h!==""||typeof h=="number")return h=sc(""+h,p.mode,y),h.return=p,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ns:return y=Ms(h.type,h.key,h.props,null,p.mode,y),y.ref=gi(p,null,h),y.return=p,y;case fo:return h=ac(h,p.mode,y),h.return=p,h;case qn:var x=h._init;return d(p,x(h._payload),y)}if(_i(h)||fi(h))return h=Or(h,p.mode,y,null),h.return=p,h;ys(p,h)}return null}function f(p,h,y,x){var N=h!==null?h.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:s(p,h,""+y,x);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ns:return y.key===N?a(p,h,y,x):null;case fo:return y.key===N?u(p,h,y,x):null;case qn:return N=y._init,f(p,h,N(y._payload),x)}if(_i(y)||fi(y))return N!==null?null:c(p,h,y,x,null);ys(p,y)}return null}function m(p,h,y,x,N){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(y)||null,s(h,p,""+x,N);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ns:return p=p.get(x.key===null?y:x.key)||null,a(h,p,x,N);case fo:return p=p.get(x.key===null?y:x.key)||null,u(h,p,x,N);case qn:var k=x._init;return m(p,h,y,k(x._payload),N)}if(_i(x)||fi(x))return p=p.get(y)||null,c(h,p,x,N,null);ys(h,x)}return null}function v(p,h,y,x){for(var N=null,k=null,P=h,I=h=0,D=null;P!==null&&I<y.length;I++){P.index>I?(D=P,P=null):D=P.sibling;var T=f(p,P,y[I],x);if(T===null){P===null&&(P=D);break}e&&P&&T.alternate===null&&t(p,P),h=i(T,h,I),k===null?N=T:k.sibling=T,k=T,P=D}if(I===y.length)return n(p,P),Se&&Mr(p,I),N;if(P===null){for(;I<y.length;I++)P=d(p,y[I],x),P!==null&&(h=i(P,h,I),k===null?N=P:k.sibling=P,k=P);return Se&&Mr(p,I),N}for(P=r(p,P);I<y.length;I++)D=m(P,p,I,y[I],x),D!==null&&(e&&D.alternate!==null&&P.delete(D.key===null?I:D.key),h=i(D,h,I),k===null?N=D:k.sibling=D,k=D);return e&&P.forEach(function($){return t(p,$)}),Se&&Mr(p,I),N}function g(p,h,y,x){var N=fi(y);if(typeof N!="function")throw Error(B(150));if(y=N.call(y),y==null)throw Error(B(151));for(var k=N=null,P=h,I=h=0,D=null,T=y.next();P!==null&&!T.done;I++,T=y.next()){P.index>I?(D=P,P=null):D=P.sibling;var $=f(p,P,T.value,x);if($===null){P===null&&(P=D);break}e&&P&&$.alternate===null&&t(p,P),h=i($,h,I),k===null?N=$:k.sibling=$,k=$,P=D}if(T.done)return n(p,P),Se&&Mr(p,I),N;if(P===null){for(;!T.done;I++,T=y.next())T=d(p,T.value,x),T!==null&&(h=i(T,h,I),k===null?N=T:k.sibling=T,k=T);return Se&&Mr(p,I),N}for(P=r(p,P);!T.done;I++,T=y.next())T=m(P,p,I,T.value,x),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?I:T.key),h=i(T,h,I),k===null?N=T:k.sibling=T,k=T);return e&&P.forEach(function(F){return t(p,F)}),Se&&Mr(p,I),N}function E(p,h,y,x){if(typeof y=="object"&&y!==null&&y.type===po&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ns:e:{for(var N=y.key,k=h;k!==null;){if(k.key===N){if(N=y.type,N===po){if(k.tag===7){n(p,k.sibling),h=o(k,y.props.children),h.return=p,p=h;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===qn&&Mh(N)===k.type){n(p,k.sibling),h=o(k,y.props),h.ref=gi(p,k,y),h.return=p,p=h;break e}n(p,k);break}else t(p,k);k=k.sibling}y.type===po?(h=Or(y.props.children,p.mode,x,y.key),h.return=p,p=h):(x=Ms(y.type,y.key,y.props,null,p.mode,x),x.ref=gi(p,h,y),x.return=p,p=x)}return l(p);case fo:e:{for(k=y.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(p,h.sibling),h=o(h,y.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=ac(y,p.mode,x),h.return=p,p=h}return l(p);case qn:return k=y._init,E(p,h,k(y._payload),x)}if(_i(y))return v(p,h,y,x);if(fi(y))return g(p,h,y,x);ys(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(n(p,h.sibling),h=o(h,y),h.return=p,p=h):(n(p,h),h=sc(y,p.mode,x),h.return=p,p=h),l(p)):n(p,h)}return E}var Do=eg(!0),tg=eg(!1),Ys=mr(null),Us=null,_o=null,wd=null;function _d(){wd=_o=Us=null}function Sd(e){var t=Ys.current;_e(Ys),e._currentValue=t}function $c(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Po(e,t){Us=e,wd=_o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Et=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(wd!==e)if(e={context:e,memoizedValue:t,next:null},_o===null){if(Us===null)throw Error(B(308));_o=e,Us.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var Dr=null;function Ed(e){Dr===null?Dr=[e]:Dr.push(e)}function ng(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ed(t)):(n.next=o.next,o.next=n),t.interleaved=n,$n(e,r)}function $n(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Jn=!1;function Nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,$n(e,n)}return o=r.interleaved,o===null?(t.next=t,Ed(r)):(t.next=o.next,o.next=t),r.interleaved=t,$n(e,n)}function Ns(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ud(e,n)}}function Rh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function js(e,t,n,r){var o=e.updateQueue;Jn=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?i=u:l.next=u,l=a;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;l=0,c=u=a=null,s=i;do{var f=s.lane,m=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,g=s;switch(f=t,m=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){d=v.call(m,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,f=typeof v=="function"?v.call(m,d,f):v,f==null)break e;d=Ce({},d,f);break e;case 2:Jn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[s]:f.push(s))}else m={eventTime:m,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,a=d):c=c.next=m,l|=f;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Hr|=l,e.lanes=l,e.memoizedState=d}}function Ah(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(B(191,o));o.call(r)}}}var Ji={},kn=mr(Ji),Yi=mr(Ji),Ui=mr(Ji);function Tr(e){if(e===Ji)throw Error(B(174));return e}function kd(e,t){switch(xe(Ui,t),xe(Yi,e),xe(kn,Ji),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vc(t,e)}_e(kn),xe(kn,t)}function To(){_e(kn),_e(Yi),_e(Ui)}function og(e){Tr(Ui.current);var t=Tr(kn.current),n=vc(t,e.type);t!==n&&(xe(Yi,e),xe(kn,n))}function Cd(e){Yi.current===e&&(_e(kn),_e(Yi))}var Ne=mr(0);function Xs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 tc=[];function bd(){for(var e=0;e<tc.length;e++)tc[e]._workInProgressVersionPrimary=null;tc.length=0}var ks=Hn.ReactCurrentDispatcher,nc=Hn.ReactCurrentBatchConfig,Fr=0,ke=null,Oe=null,Ge=null,Ws=!1,Ii=!1,ji=0,a_=0;function it(){throw Error(B(321))}function Pd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function Id(e,t,n,r,o,i){if(Fr=i,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ks.current=e===null||e.memoizedState===null?f_:p_,e=n(r,o),Ii){i=0;do{if(Ii=!1,ji=0,25<=i)throw Error(B(301));i+=1,Ge=Oe=null,t.updateQueue=null,ks.current=h_,e=n(r,o)}while(Ii)}if(ks.current=Ks,t=Oe!==null&&Oe.next!==null,Fr=0,Ge=Oe=ke=null,Ws=!1,t)throw Error(B(300));return e}function Md(){var e=ji!==0;return ji=0,e}function Sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?ke.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Wt(){if(Oe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Ge===null?ke.memoizedState:Ge.next;if(t!==null)Ge=t,Oe=e;else{if(e===null)throw Error(B(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Ge===null?ke.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function Xi(e,t){return typeof t=="function"?t(e):t}function rc(e){var t=Wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Oe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var l=o.next;o.next=i.next,i.next=l}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var s=l=null,a=null,u=i;do{var c=u.lane;if((Fr&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(s=a=d,l=r):a=a.next=d,ke.lanes|=c,Hr|=c}u=u.next}while(u!==null&&u!==i);a===null?l=r:a.next=s,dn(r,t.memoizedState)||(Et=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ke.lanes|=i,Hr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function oc(e){var t=Wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var l=o=o.next;do i=e(i,l.action),l=l.next;while(l!==o);dn(i,t.memoizedState)||(Et=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ig(){}function lg(e,t){var n=ke,r=Wt(),o=t(),i=!dn(r.memoizedState,o);if(i&&(r.memoizedState=o,Et=!0),r=r.queue,Rd(ug.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ge!==null&&Ge.memoizedState.tag&1){if(n.flags|=2048,Wi(9,ag.bind(null,n,r,o,t),void 0,null),Ve===null)throw Error(B(349));Fr&30||sg(n,t,o)}return o}function sg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ag(e,t,n,r){t.value=n,t.getSnapshot=r,cg(t)&&dg(e)}function ug(e,t,n){return n(function(){cg(t)&&dg(e)})}function cg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function dg(e){var t=$n(e,1);t!==null&&cn(t,e,1,-1)}function Dh(e){var t=Sn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xi,lastRenderedState:e},t.queue=e,e=e.dispatch=d_.bind(null,ke,e),[t.memoizedState,e]}function Wi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function fg(){return Wt().memoizedState}function Cs(e,t,n,r){var o=Sn();ke.flags|=e,o.memoizedState=Wi(1|t,n,void 0,r===void 0?null:r)}function sa(e,t,n,r){var o=Wt();r=r===void 0?null:r;var i=void 0;if(Oe!==null){var l=Oe.memoizedState;if(i=l.destroy,r!==null&&Pd(r,l.deps)){o.memoizedState=Wi(t,n,i,r);return}}ke.flags|=e,o.memoizedState=Wi(1|t,n,i,r)}function Th(e,t){return Cs(8390656,8,e,t)}function Rd(e,t){return sa(2048,8,e,t)}function pg(e,t){return sa(4,2,e,t)}function hg(e,t){return sa(4,4,e,t)}function mg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gg(e,t,n){return n=n!=null?n.concat([e]):null,sa(4,4,mg.bind(null,t,e),n)}function Ad(){}function yg(e,t){var n=Wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vg(e,t){var n=Wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function xg(e,t,n){return Fr&21?(dn(n,t)||(n=Nm(),ke.lanes|=n,Hr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Et=!0),e.memoizedState=n)}function u_(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=nc.transition;nc.transition={};try{e(!1),t()}finally{me=n,nc.transition=r}}function wg(){return Wt().memoizedState}function c_(e,t,n){var r=cr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_g(e))Sg(t,n);else if(n=ng(e,t,n,r),n!==null){var o=mt();cn(n,e,r,o),Eg(n,t,r)}}function d_(e,t,n){var r=cr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_g(e))Sg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,dn(s,l)){var a=t.interleaved;a===null?(o.next=o,Ed(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=ng(e,t,o,r),n!==null&&(o=mt(),cn(n,e,r,o),Eg(n,t,r))}}function _g(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Sg(e,t){Ii=Ws=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Eg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ud(e,n)}}var Ks={readContext:Xt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},f_={readContext:Xt,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Th,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Cs(4194308,4,mg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cs(4,2,e,t)},useMemo:function(e,t){var n=Sn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Sn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=c_.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:Dh,useDebugValue:Ad,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=Dh(!1),t=e[0];return e=u_.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ke,o=Sn();if(Se){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ve===null)throw Error(B(349));Fr&30||sg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Th(ug.bind(null,r,i,e),[e]),r.flags|=2048,Wi(9,ag.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Sn(),t=Ve.identifierPrefix;if(Se){var n=Tn,r=Dn;n=(r&~(1<<32-un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ji++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=a_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},p_={readContext:Xt,useCallback:yg,useContext:Xt,useEffect:Rd,useImperativeHandle:gg,useInsertionEffect:pg,useLayoutEffect:hg,useMemo:vg,useReducer:rc,useRef:fg,useState:function(){return rc(Xi)},useDebugValue:Ad,useDeferredValue:function(e){var t=Wt();return xg(t,Oe.memoizedState,e)},useTransition:function(){var e=rc(Xi)[0],t=Wt().memoizedState;return[e,t]},useMutableSource:ig,useSyncExternalStore:lg,useId:wg,unstable_isNewReconciler:!1},h_={readContext:Xt,useCallback:yg,useContext:Xt,useEffect:Rd,useImperativeHandle:gg,useInsertionEffect:pg,useLayoutEffect:hg,useMemo:vg,useReducer:oc,useRef:fg,useState:function(){return oc(Xi)},useDebugValue:Ad,useDeferredValue:function(e){var t=Wt();return Oe===null?t.memoizedState=e:xg(t,Oe.memoizedState,e)},useTransition:function(){var e=oc(Xi)[0],t=Wt().memoizedState;return[e,t]},useMutableSource:ig,useSyncExternalStore:lg,useId:wg,unstable_isNewReconciler:!1};function ln(e,t){if(e&&e.defaultProps){t=Ce({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ce({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var aa={isMounted:function(e){return(e=e._reactInternals)?Br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mt(),o=cr(e),i=zn(r,o);i.payload=t,n!=null&&(i.callback=n),t=ar(e,i,o),t!==null&&(cn(t,e,o,r),Ns(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mt(),o=cr(e),i=zn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ar(e,i,o),t!==null&&(cn(t,e,o,r),Ns(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mt(),r=cr(e),o=zn(n,r);o.tag=2,t!=null&&(o.callback=t),t=ar(e,o,r),t!==null&&(cn(t,e,r,n),Ns(t,e,r))}};function zh(e,t,n,r,o,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,l):t.prototype&&t.prototype.isPureReactComponent?!Hi(n,r)||!Hi(o,i):!0}function Ng(e,t,n){var r=!1,o=pr,i=t.contextType;return typeof i=="object"&&i!==null?i=Xt(i):(o=kt(t)?Lr:at.current,r=t.contextTypes,i=(r=r!=null)?Ro(e,o):pr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=aa,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Oh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&aa.enqueueReplaceState(t,t.state,null)}function Hc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Nd(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Xt(i):(i=kt(t)?Lr:at.current,o.context=Ro(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Fc(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&aa.enqueueReplaceState(o,o.state,null),js(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function zo(e,t){try{var n="",r=t;do n+=Yw(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
7
|
+
Error generating stack: `+i.message+`
|
|
8
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function ic(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var m_=typeof WeakMap=="function"?WeakMap:Map;function kg(e,t,n){n=zn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Qs||(Qs=!0,Qc=r),Gc(e,t)},n}function Cg(e,t,n){n=zn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Gc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gc(e,t),typeof r!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Lh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new m_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=I_.bind(null,e,t,n),t.then(e,e))}function $h(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Fh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=zn(-1,1),t.tag=2,ar(n,t,1))),n.lanes|=1),e)}var g_=Hn.ReactCurrentOwner,Et=!1;function ht(e,t,n,r){t.child=e===null?tg(t,null,n,r):Do(t,e.child,n,r)}function Hh(e,t,n,r,o){n=n.render;var i=t.ref;return Po(t,o),r=Id(e,t,n,r,i,o),n=Md(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fn(e,t,o)):(Se&&n&&yd(t),t.flags|=1,ht(e,t,r,o),t.child)}function Gh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Hd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,bg(e,t,i,r,o)):(e=Ms(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hi,n(l,r)&&e.ref===t.ref)return Fn(e,t,o)}return t.flags|=1,e=dr(i,r),e.ref=t.ref,e.return=t,t.child=e}function bg(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Hi(i,r)&&e.ref===t.ref)if(Et=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Et=!0);else return t.lanes=e.lanes,Fn(e,t,o)}return Vc(e,t,n,r,o)}function Pg(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(Eo,Tt),Tt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(Eo,Tt),Tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,xe(Eo,Tt),Tt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,xe(Eo,Tt),Tt|=r;return ht(e,t,o,n),t.child}function Ig(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vc(e,t,n,r,o){var i=kt(n)?Lr:at.current;return i=Ro(t,i),Po(t,o),n=Id(e,t,n,r,i,o),r=Md(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fn(e,t,o)):(Se&&r&&yd(t),t.flags|=1,ht(e,t,n,o),t.child)}function Vh(e,t,n,r,o){if(kt(n)){var i=!0;Gs(t)}else i=!1;if(Po(t,o),t.stateNode===null)bs(e,t),Ng(t,n,r),Hc(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var a=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Xt(u):(u=kt(n)?Lr:at.current,u=Ro(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||a!==u)&&Oh(t,l,r,u),Jn=!1;var f=t.memoizedState;l.state=f,js(t,r,l,o),a=t.memoizedState,s!==r||f!==a||Nt.current||Jn?(typeof c=="function"&&(Fc(t,n,c,r),a=t.memoizedState),(s=Jn||zh(t,n,s,r,f,a,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),l.props=r,l.state=a,l.context=u,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,rg(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:ln(t.type,s),l.props=u,d=t.pendingProps,f=l.context,a=n.contextType,typeof a=="object"&&a!==null?a=Xt(a):(a=kt(n)?Lr:at.current,a=Ro(t,a));var m=n.getDerivedStateFromProps;(c=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==d||f!==a)&&Oh(t,l,r,a),Jn=!1,f=t.memoizedState,l.state=f,js(t,r,l,o);var v=t.memoizedState;s!==d||f!==v||Nt.current||Jn?(typeof m=="function"&&(Fc(t,n,m,r),v=t.memoizedState),(u=Jn||zh(t,n,u,r,f,v,a)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,v,a),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,v,a)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),l.props=r,l.state=v,l.context=a,r=u):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Bc(e,t,n,r,i,o)}function Bc(e,t,n,r,o,i){Ig(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&bh(t,n,!1),Fn(e,t,i);r=t.stateNode,g_.current=t;var s=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Do(t,e.child,null,i),t.child=Do(t,null,s,i)):ht(e,t,s,i),t.memoizedState=r.state,o&&bh(t,n,!0),t.child}function Mg(e){var t=e.stateNode;t.pendingContext?Ch(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ch(e,t.context,!1),kd(e,t.containerInfo)}function Bh(e,t,n,r,o){return Ao(),xd(o),t.flags|=256,ht(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0};function Uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rg(e,t,n){var r=t.pendingProps,o=Ne.current,i=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),xe(Ne,o&1),e===null)return Lc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=da(l,r,0,null),e=Or(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Uc(n),t.memoizedState=Yc,e):Dd(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return y_(e,t,l,r,s,o,n);if(i){i=r.fallback,l=t.mode,o=e.child,s=o.sibling;var a={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=dr(o,a),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?i=dr(s,i):(i=Or(i,l,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?Uc(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=Yc,r}return i=e.child,e=i.sibling,r=dr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Dd(e,t){return t=da({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vs(e,t,n,r){return r!==null&&xd(r),Do(t,e.child,null,n),e=Dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function y_(e,t,n,r,o,i,l){if(n)return t.flags&256?(t.flags&=-257,r=ic(Error(B(422))),vs(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=da({mode:"visible",children:r.children},o,0,null),i=Or(i,o,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Do(t,e.child,null,l),t.child.memoizedState=Uc(l),t.memoizedState=Yc,i);if(!(t.mode&1))return vs(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,i=Error(B(419)),r=ic(i,r,void 0),vs(e,t,l,r)}if(s=(l&e.childLanes)!==0,Et||s){if(r=Ve,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,$n(e,o),cn(r,e,o,-1))}return Fd(),r=ic(Error(B(421))),vs(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=M_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,zt=sr(o.nextSibling),Ot=t,Se=!0,an=null,e!==null&&(Bt[Yt++]=Dn,Bt[Yt++]=Tn,Bt[Yt++]=$r,Dn=e.id,Tn=e.overflow,$r=t),t=Dd(t,r.children),t.flags|=4096,t)}function Yh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$c(e.return,t,n)}function lc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Ag(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ht(e,t,r.children,n),r=Ne.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yh(e,n,t);else if(e.tag===19)Yh(e,n,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}r&=1}if(xe(Ne,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Xs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),lc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Xs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}lc(t,!0,n,null,i);break;case"together":lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=dr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function v_(e,t,n){switch(t.tag){case 3:Mg(t),Ao();break;case 5:og(t);break;case 1:kt(t.type)&&Gs(t);break;case 4:kd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;xe(Ys,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?Rg(e,t,n):(xe(Ne,Ne.current&1),e=Fn(e,t,n),e!==null?e.sibling:null);xe(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ag(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),xe(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,Pg(e,t,n)}return Fn(e,t,n)}var Dg,jc,Tg,zg;Dg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};jc=function(){};Tg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Tr(kn.current);var i=null;switch(n){case"input":o=hc(e,o),r=hc(e,r),i=[];break;case"select":o=Ce({},o,{value:void 0}),r=Ce({},r,{value:void 0}),i=[];break;case"textarea":o=yc(e,o),r=yc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Fs)}xc(n,r);var l;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var s=o[u];for(l in s)s.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Di.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(s=o?.[u],r.hasOwnProperty(u)&&a!==s&&(a!=null||s!=null))if(u==="style")if(s){for(l in s)!s.hasOwnProperty(l)||a&&a.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in a)a.hasOwnProperty(l)&&s[l]!==a[l]&&(n||(n={}),n[l]=a[l])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Di.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&we("scroll",e),i||s===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};zg=function(e,t,n,r){n!==r&&(t.flags|=4)};function yi(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function x_(e,t,n){var r=t.pendingProps;switch(vd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return kt(t.type)&&Hs(),lt(t),null;case 3:return r=t.stateNode,To(),_e(Nt),_e(at),bd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,an!==null&&(ed(an),an=null))),jc(e,t),lt(t),null;case 5:Cd(t);var o=Tr(Ui.current);if(n=t.type,e!==null&&t.stateNode!=null)Tg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return lt(t),null}if(e=Tr(kn.current),gs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[En]=t,r[Bi]=i,e=(t.mode&1)!==0,n){case"dialog":we("cancel",r),we("close",r);break;case"iframe":case"object":case"embed":we("load",r);break;case"video":case"audio":for(o=0;o<Ei.length;o++)we(Ei[o],r);break;case"source":we("error",r);break;case"img":case"image":case"link":we("error",r),we("load",r);break;case"details":we("toggle",r);break;case"input":qp(r,i),we("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},we("invalid",r);break;case"textarea":eh(r,i),we("invalid",r)}xc(n,i),o=null;for(var l in i)if(i.hasOwnProperty(l)){var s=i[l];l==="children"?typeof s=="string"?r.textContent!==s&&(i.suppressHydrationWarning!==!0&&ms(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(i.suppressHydrationWarning!==!0&&ms(r.textContent,s,e),o=["children",""+s]):Di.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&we("scroll",r)}switch(n){case"input":rs(r),Jp(r,i,!0);break;case"textarea":rs(r),th(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Fs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=um(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[En]=t,e[Bi]=r,Dg(e,t,!1,!1),t.stateNode=e;e:{switch(l=wc(n,r),n){case"dialog":we("cancel",e),we("close",e),o=r;break;case"iframe":case"object":case"embed":we("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ei.length;o++)we(Ei[o],e);o=r;break;case"source":we("error",e),o=r;break;case"img":case"image":case"link":we("error",e),we("load",e),o=r;break;case"details":we("toggle",e),o=r;break;case"input":qp(e,r),o=hc(e,r),we("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ce({},r,{value:void 0}),we("invalid",e);break;case"textarea":eh(e,r),o=yc(e,r),we("invalid",e);break;default:o=r}xc(n,o),s=o;for(i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="style"?fm(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&cm(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ti(e,a):typeof a=="number"&&Ti(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Di.hasOwnProperty(i)?a!=null&&i==="onScroll"&&we("scroll",e):a!=null&&rd(e,i,a,l))}switch(n){case"input":rs(e),Jp(e,r,!1);break;case"textarea":rs(e),th(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?No(e,!!r.multiple,i,!1):r.defaultValue!=null&&No(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Fs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lt(t),null;case 6:if(e&&t.stateNode!=null)zg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Tr(Ui.current),Tr(kn.current),gs(t)){if(r=t.stateNode,n=t.memoizedProps,r[En]=t,(i=r.nodeValue!==n)&&(e=Ot,e!==null))switch(e.tag){case 3:ms(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ms(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[En]=t,t.stateNode=r}return lt(t),null;case 13:if(_e(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&zt!==null&&t.mode&1&&!(t.flags&128))Jm(),Ao(),t.flags|=98560,i=!1;else if(i=gs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[En]=t}else Ao(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),i=!1}else an!==null&&(ed(an),an=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?Le===0&&(Le=3):Fd())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return To(),jc(e,t),e===null&&Gi(t.stateNode.containerInfo),lt(t),null;case 10:return Sd(t.type._context),lt(t),null;case 17:return kt(t.type)&&Hs(),lt(t),null;case 19:if(_e(Ne),i=t.memoizedState,i===null)return lt(t),null;if(r=(t.flags&128)!==0,l=i.rendering,l===null)if(r)yi(i,!1);else{if(Le!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Xs(e),l!==null){for(t.flags|=128,yi(i,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(Ne,Ne.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ae()>Oo&&(t.flags|=128,r=!0,yi(i,!1),t.lanes=4194304)}else{if(!r)if(e=Xs(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),yi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Se)return lt(t),null}else 2*Ae()-i.renderingStartTime>Oo&&n!==1073741824&&(t.flags|=128,r=!0,yi(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ae(),t.sibling=null,n=Ne.current,xe(Ne,r?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return $d(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Tt&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function w_(e,t){switch(vd(t),t.tag){case 1:return kt(t.type)&&Hs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return To(),_e(Nt),_e(at),bd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cd(t),null;case 13:if(_e(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(Ne),null;case 4:return To(),null;case 10:return Sd(t.type._context),null;case 22:case 23:return $d(),null;case 24:return null;default:return null}}var xs=!1,st=!1,__=typeof WeakSet=="function"?WeakSet:Set,Z=null;function So(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function Xc(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var Uh=!1;function S_(e,t){if(Mc=Os,e=Hm(),gd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var m;d!==n||o!==0&&d.nodeType!==3||(s=l+o),d!==i||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++u===o&&(s=l),f===i&&++c===r&&(a=l),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},Os=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,E=v.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?g:ln(t.type,g),E);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(x){Ie(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return v=Uh,Uh=!1,v}function Mi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Xc(t,n,i)}o=o.next}while(o!==r)}}function ua(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Og(e){var t=e.alternate;t!==null&&(e.alternate=null,Og(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[En],delete t[Bi],delete t[Tc],delete t[o_],delete t[i_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lg(e){return e.tag===5||e.tag===3||e.tag===4}function jh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lg(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.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 Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fs));else if(r!==4&&(e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}var Ke=null,sn=!1;function Qn(e,t,n){for(n=n.child;n!==null;)$g(e,t,n),n=n.sibling}function $g(e,t,n){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(ta,n)}catch{}switch(n.tag){case 5:st||So(n,t);case 6:var r=Ke,o=sn;Ke=null,Qn(e,t,n),Ke=r,sn=o,Ke!==null&&(sn?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(sn?(e=Ke,n=n.stateNode,e.nodeType===8?Ju(e.parentNode,n):e.nodeType===1&&Ju(e,n),$i(e)):Ju(Ke,n.stateNode));break;case 4:r=Ke,o=sn,Ke=n.stateNode.containerInfo,sn=!0,Qn(e,t,n),Ke=r,sn=o;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Xc(n,t,l),o=o.next}while(o!==r)}Qn(e,t,n);break;case 1:if(!st&&(So(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ie(n,t,s)}Qn(e,t,n);break;case 21:Qn(e,t,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Qn(e,t,n),st=r):Qn(e,t,n);break;default:Qn(e,t,n)}}function Xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new __),t.forEach(function(r){var o=R_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function on(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ke=s.stateNode,sn=!1;break e;case 3:Ke=s.stateNode.containerInfo,sn=!0;break e;case 4:Ke=s.stateNode.containerInfo,sn=!0;break e}s=s.return}if(Ke===null)throw Error(B(160));$g(i,l,o),Ke=null,sn=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Ie(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fg(t,e),t=t.sibling}function Fg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(on(t,e),_n(e),r&4){try{Mi(3,e,e.return),ua(3,e)}catch(g){Ie(e,e.return,g)}try{Mi(5,e,e.return)}catch(g){Ie(e,e.return,g)}}break;case 1:on(t,e),_n(e),r&512&&n!==null&&So(n,n.return);break;case 5:if(on(t,e),_n(e),r&512&&n!==null&&So(n,n.return),e.flags&32){var o=e.stateNode;try{Ti(o,"")}catch(g){Ie(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,l=n!==null?n.memoizedProps:i,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&i.type==="radio"&&i.name!=null&&sm(o,i),wc(s,l);var u=wc(s,i);for(l=0;l<a.length;l+=2){var c=a[l],d=a[l+1];c==="style"?fm(o,d):c==="dangerouslySetInnerHTML"?cm(o,d):c==="children"?Ti(o,d):rd(o,c,d,u)}switch(s){case"input":mc(o,i);break;case"textarea":am(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?No(o,!!i.multiple,m,!1):f!==!!i.multiple&&(i.defaultValue!=null?No(o,!!i.multiple,i.defaultValue,!0):No(o,!!i.multiple,i.multiple?[]:"",!1))}o[Bi]=i}catch(g){Ie(e,e.return,g)}}break;case 6:if(on(t,e),_n(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){Ie(e,e.return,g)}}break;case 3:if(on(t,e),_n(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$i(t.containerInfo)}catch(g){Ie(e,e.return,g)}break;case 4:on(t,e),_n(e);break;case 13:on(t,e),_n(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Od=Ae())),r&4&&Xh(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(st=(u=st)||c,on(t,e),st=u):on(t,e),_n(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Z=e,c=e.child;c!==null;){for(d=Z=c;Z!==null;){switch(f=Z,m=f.child,f.tag){case 0:case 11:case 14:case 15:Mi(4,f,f.return);break;case 1:So(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){Ie(r,n,g)}}break;case 5:So(f,f.return);break;case 22:if(f.memoizedState!==null){Kh(d);continue}}m!==null?(m.return=f,Z=m):Kh(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(s=d.stateNode,a=d.memoizedProps.style,l=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=dm("display",l))}catch(g){Ie(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){Ie(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:on(t,e),_n(e),r&4&&Xh(e);break;case 21:break;default:on(t,e),_n(e)}}function _n(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Lg(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Ti(o,""),r.flags&=-33);var i=jh(e);Zc(e,i,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=jh(e);Kc(e,s,l);break;default:throw Error(B(161))}}catch(a){Ie(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function E_(e,t,n){Z=e,Hg(e,t,n)}function Hg(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var o=Z,i=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||xs;if(!l){var s=o.alternate,a=s!==null&&s.memoizedState!==null||st;s=xs;var u=st;if(xs=l,(st=a)&&!u)for(Z=o;Z!==null;)l=Z,a=l.child,l.tag===22&&l.memoizedState!==null?Zh(o):a!==null?(a.return=l,Z=a):Zh(o);for(;i!==null;)Z=i,Hg(i,t,n),i=i.sibling;Z=o,xs=s,st=u}Wh(e,t,n)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Z=i):Wh(e,t,n)}}function Wh(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:st||ua(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!st)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ln(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ah(t,i,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ah(t,l,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&$i(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}st||t.flags&512&&Wc(t)}catch(f){Ie(t,t.return,f)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Kh(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Zh(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ua(4,t)}catch(a){Ie(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Ie(t,o,a)}}var i=t.return;try{Wc(t)}catch(a){Ie(t,i,a)}break;case 5:var l=t.return;try{Wc(t)}catch(a){Ie(t,l,a)}}}catch(a){Ie(t,t.return,a)}if(t===e){Z=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Z=s;break}Z=t.return}}var N_=Math.ceil,Zs=Hn.ReactCurrentDispatcher,Td=Hn.ReactCurrentOwner,jt=Hn.ReactCurrentBatchConfig,ce=0,Ve=null,ze=null,Ze=0,Tt=0,Eo=mr(0),Le=0,Ki=null,Hr=0,ca=0,zd=0,Ri=null,St=null,Od=0,Oo=1/0,Rn=null,Qs=!1,Qc=null,ur=null,ws=!1,rr=null,qs=0,Ai=0,qc=null,Ps=-1,Is=0;function mt(){return ce&6?Ae():Ps!==-1?Ps:Ps=Ae()}function cr(e){return e.mode&1?ce&2&&Ze!==0?Ze&-Ze:s_.transition!==null?(Is===0&&(Is=Nm()),Is):(e=me,e!==0||(e=window.event,e=e===void 0?16:Rm(e.type)),e):1}function cn(e,t,n,r){if(50<Ai)throw Ai=0,qc=null,Error(B(185));Zi(e,n,r),(!(ce&2)||e!==Ve)&&(e===Ve&&(!(ce&2)&&(ca|=n),Le===4&&tr(e,Ze)),Ct(e,r),n===1&&ce===0&&!(t.mode&1)&&(Oo=Ae()+500,la&&gr()))}function Ct(e,t){var n=e.callbackNode;u1(e,t);var r=zs(e,e===Ve?Ze:0);if(r===0)n!==null&&oh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&oh(n),t===1)e.tag===0?l_(Qh.bind(null,e)):Zm(Qh.bind(null,e)),n_(function(){!(ce&6)&&gr()}),n=null;else{switch(km(r)){case 1:n=ad;break;case 4:n=Sm;break;case 16:n=Ts;break;case 536870912:n=Em;break;default:n=Ts}n=Wg(n,Gg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Gg(e,t){if(Ps=-1,Is=0,ce&6)throw Error(B(327));var n=e.callbackNode;if(Io()&&e.callbackNode!==n)return null;var r=zs(e,e===Ve?Ze:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Js(e,r);else{t=r;var o=ce;ce|=2;var i=Bg();(Ve!==e||Ze!==t)&&(Rn=null,Oo=Ae()+500,zr(e,t));do try{b_();break}catch(s){Vg(e,s)}while(!0);_d(),Zs.current=i,ce=o,ze!==null?t=0:(Ve=null,Ze=0,t=Le)}if(t!==0){if(t===2&&(o=kc(e),o!==0&&(r=o,t=Jc(e,o))),t===1)throw n=Ki,zr(e,0),tr(e,r),Ct(e,Ae()),n;if(t===6)tr(e,r);else{if(o=e.current.alternate,!(r&30)&&!k_(o)&&(t=Js(e,r),t===2&&(i=kc(e),i!==0&&(r=i,t=Jc(e,i))),t===1))throw n=Ki,zr(e,0),tr(e,r),Ct(e,Ae()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Rr(e,St,Rn);break;case 3:if(tr(e,r),(r&130023424)===r&&(t=Od+500-Ae(),10<t)){if(zs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){mt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Dc(Rr.bind(null,e,St,Rn),t);break}Rr(e,St,Rn);break;case 4:if(tr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-un(r);i=1<<l,l=t[l],l>o&&(o=l),r&=~i}if(r=o,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*N_(r/1960))-r,10<r){e.timeoutHandle=Dc(Rr.bind(null,e,St,Rn),r);break}Rr(e,St,Rn);break;case 5:Rr(e,St,Rn);break;default:throw Error(B(329))}}}return Ct(e,Ae()),e.callbackNode===n?Gg.bind(null,e):null}function Jc(e,t){var n=Ri;return e.current.memoizedState.isDehydrated&&(zr(e,t).flags|=256),e=Js(e,t),e!==2&&(t=St,St=n,t!==null&&ed(t)),e}function ed(e){St===null?St=e:St.push.apply(St,e)}function k_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!dn(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 tr(e,t){for(t&=~zd,t&=~ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-un(t),r=1<<n;e[n]=-1,t&=~r}}function Qh(e){if(ce&6)throw Error(B(327));Io();var t=zs(e,0);if(!(t&1))return Ct(e,Ae()),null;var n=Js(e,t);if(e.tag!==0&&n===2){var r=kc(e);r!==0&&(t=r,n=Jc(e,r))}if(n===1)throw n=Ki,zr(e,0),tr(e,t),Ct(e,Ae()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rr(e,St,Rn),Ct(e,Ae()),null}function Ld(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(Oo=Ae()+500,la&&gr())}}function Gr(e){rr!==null&&rr.tag===0&&!(ce&6)&&Io();var t=ce;ce|=1;var n=jt.transition,r=me;try{if(jt.transition=null,me=1,e)return e()}finally{me=r,jt.transition=n,ce=t,!(ce&6)&&gr()}}function $d(){Tt=Eo.current,_e(Eo)}function zr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,t_(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(vd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hs();break;case 3:To(),_e(Nt),_e(at),bd();break;case 5:Cd(r);break;case 4:To();break;case 13:_e(Ne);break;case 19:_e(Ne);break;case 10:Sd(r.type._context);break;case 22:case 23:$d()}n=n.return}if(Ve=e,ze=e=dr(e.current,null),Ze=Tt=t,Le=0,Ki=null,zd=ca=Hr=0,St=Ri=null,Dr!==null){for(t=0;t<Dr.length;t++)if(n=Dr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var l=i.next;i.next=o,r.next=l}n.pending=r}Dr=null}return e}function Vg(e,t){do{var n=ze;try{if(_d(),ks.current=Ks,Ws){for(var r=ke.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ws=!1}if(Fr=0,Ge=Oe=ke=null,Ii=!1,ji=0,Td.current=null,n===null||n.return===null){Le=1,Ki=t,ze=null;break}e:{var i=e,l=n.return,s=n,a=t;if(t=Ze,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var m=$h(l);if(m!==null){m.flags&=-257,Fh(m,l,s,i,t),m.mode&1&&Lh(i,u,t),t=m,a=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(a),t.updateQueue=g}else v.add(a);break e}else{if(!(t&1)){Lh(i,u,t),Fd();break e}a=Error(B(426))}}else if(Se&&s.mode&1){var E=$h(l);if(E!==null){!(E.flags&65536)&&(E.flags|=256),Fh(E,l,s,i,t),xd(zo(a,s));break e}}i=a=zo(a,s),Le!==4&&(Le=2),Ri===null?Ri=[i]:Ri.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=kg(i,a,t);Rh(i,p);break e;case 1:s=a;var h=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ur===null||!ur.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=Cg(i,s,t);Rh(i,x);break e}}i=i.return}while(i!==null)}Ug(n)}catch(N){t=N,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function Bg(){var e=Zs.current;return Zs.current=Ks,e===null?Ks:e}function Fd(){(Le===0||Le===3||Le===2)&&(Le=4),Ve===null||!(Hr&268435455)&&!(ca&268435455)||tr(Ve,Ze)}function Js(e,t){var n=ce;ce|=2;var r=Bg();(Ve!==e||Ze!==t)&&(Rn=null,zr(e,t));do try{C_();break}catch(o){Vg(e,o)}while(!0);if(_d(),ce=n,Zs.current=r,ze!==null)throw Error(B(261));return Ve=null,Ze=0,Le}function C_(){for(;ze!==null;)Yg(ze)}function b_(){for(;ze!==null&&!e1();)Yg(ze)}function Yg(e){var t=Xg(e.alternate,e,Tt);e.memoizedProps=e.pendingProps,t===null?Ug(e):ze=t,Td.current=null}function Ug(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=w_(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Le=6,ze=null;return}}else if(n=x_(n,t,Tt),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Le===0&&(Le=5)}function Rr(e,t,n){var r=me,o=jt.transition;try{jt.transition=null,me=1,P_(e,t,n,r)}finally{jt.transition=o,me=r}return null}function P_(e,t,n,r){do Io();while(rr!==null);if(ce&6)throw Error(B(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(c1(e,i),e===Ve&&(ze=Ve=null,Ze=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ws||(ws=!0,Wg(Ts,function(){return Io(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=jt.transition,jt.transition=null;var l=me;me=1;var s=ce;ce|=4,Td.current=null,S_(e,n),Fg(n,e),Z1(Rc),Os=!!Mc,Rc=Mc=null,e.current=n,E_(n,e,o),t1(),ce=s,me=l,jt.transition=i}else e.current=n;if(ws&&(ws=!1,rr=e,qs=o),i=e.pendingLanes,i===0&&(ur=null),o1(n.stateNode,r),Ct(e,Ae()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Qs)throw Qs=!1,e=Qc,Qc=null,e;return qs&1&&e.tag!==0&&Io(),i=e.pendingLanes,i&1?e===qc?Ai++:(Ai=0,qc=e):Ai=0,gr(),null}function Io(){if(rr!==null){var e=km(qs),t=jt.transition,n=me;try{if(jt.transition=null,me=16>e?16:e,rr===null)var r=!1;else{if(e=rr,rr=null,qs=0,ce&6)throw Error(B(331));var o=ce;for(ce|=4,Z=e.current;Z!==null;){var i=Z,l=i.child;if(Z.flags&16){var s=i.deletions;if(s!==null){for(var a=0;a<s.length;a++){var u=s[a];for(Z=u;Z!==null;){var c=Z;switch(c.tag){case 0:case 11:case 15:Mi(8,c,i)}var d=c.child;if(d!==null)d.return=c,Z=d;else for(;Z!==null;){c=Z;var f=c.sibling,m=c.return;if(Og(c),c===u){Z=null;break}if(f!==null){f.return=m,Z=f;break}Z=m}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var E=g.sibling;g.sibling=null,g=E}while(g!==null)}}Z=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,Z=l;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Mi(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,Z=p;break e}Z=i.return}}var h=e.current;for(Z=h;Z!==null;){l=Z;var y=l.child;if(l.subtreeFlags&2064&&y!==null)y.return=l,Z=y;else e:for(l=h;Z!==null;){if(s=Z,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:ua(9,s)}}catch(N){Ie(s,s.return,N)}if(s===l){Z=null;break e}var x=s.sibling;if(x!==null){x.return=s.return,Z=x;break e}Z=s.return}}if(ce=o,gr(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(ta,e)}catch{}r=!0}return r}finally{me=n,jt.transition=t}}return!1}function qh(e,t,n){t=zo(n,t),t=kg(e,t,1),e=ar(e,t,1),t=mt(),e!==null&&(Zi(e,1,t),Ct(e,t))}function Ie(e,t,n){if(e.tag===3)qh(e,e,n);else for(;t!==null;){if(t.tag===3){qh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ur===null||!ur.has(r))){e=zo(n,e),e=Cg(t,e,1),t=ar(t,e,1),e=mt(),t!==null&&(Zi(t,1,e),Ct(t,e));break}}t=t.return}}function I_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Ze&n)===n&&(Le===4||Le===3&&(Ze&130023424)===Ze&&500>Ae()-Od?zr(e,0):zd|=n),Ct(e,t)}function jg(e,t){t===0&&(e.mode&1?(t=ls,ls<<=1,!(ls&130023424)&&(ls=4194304)):t=1);var n=mt();e=$n(e,t),e!==null&&(Zi(e,t,n),Ct(e,n))}function M_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jg(e,n)}function R_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),jg(e,n)}var Xg;Xg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)Et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Et=!1,v_(e,t,n);Et=!!(e.flags&131072)}else Et=!1,Se&&t.flags&1048576&&Qm(t,Bs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bs(e,t),e=t.pendingProps;var o=Ro(t,at.current);Po(t,n),o=Id(null,t,r,e,o,n);var i=Md();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(i=!0,Gs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Nd(t),o.updater=aa,t.stateNode=o,o._reactInternals=t,Hc(t,r,e,n),t=Bc(null,t,r,!0,i,n)):(t.tag=0,Se&&i&&yd(t),ht(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=D_(r),e=ln(r,e),o){case 0:t=Vc(null,t,r,e,n);break e;case 1:t=Vh(null,t,r,e,n);break e;case 11:t=Hh(null,t,r,e,n);break e;case 14:t=Gh(null,t,r,ln(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),Vc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),Vh(e,t,r,o,n);case 3:e:{if(Mg(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,rg(e,t),js(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=zo(Error(B(423)),t),t=Bh(e,t,r,n,o);break e}else if(r!==o){o=zo(Error(B(424)),t),t=Bh(e,t,r,n,o);break e}else for(zt=sr(t.stateNode.containerInfo.firstChild),Ot=t,Se=!0,an=null,n=tg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ao(),r===o){t=Fn(e,t,n);break e}ht(e,t,r,n)}t=t.child}return t;case 5:return og(t),e===null&&Lc(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Ac(r,o)?l=null:i!==null&&Ac(r,i)&&(t.flags|=32),Ig(e,t),ht(e,t,l,n),t.child;case 6:return e===null&&Lc(t),null;case 13:return Rg(e,t,n);case 4:return kd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Do(t,null,r,n):ht(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),Hh(e,t,r,o,n);case 7:return ht(e,t,t.pendingProps,n),t.child;case 8:return ht(e,t,t.pendingProps.children,n),t.child;case 12:return ht(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,xe(Ys,r._currentValue),r._currentValue=l,i!==null)if(dn(i.value,l)){if(i.children===o.children&&!Nt.current){t=Fn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=zn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),$c(i.return,n,t),s.lanes|=n;break}a=a.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(B(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),$c(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}ht(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Po(t,n),o=Xt(o),r=r(o),t.flags|=1,ht(e,t,r,n),t.child;case 14:return r=t.type,o=ln(r,t.pendingProps),o=ln(r.type,o),Gh(e,t,r,o,n);case 15:return bg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),bs(e,t),t.tag=1,kt(r)?(e=!0,Gs(t)):e=!1,Po(t,n),Ng(t,r,o),Hc(t,r,o,n),Bc(null,t,r,!0,e,n);case 19:return Ag(e,t,n);case 22:return Pg(e,t,n)}throw Error(B(156,t.tag))};function Wg(e,t){return _m(e,t)}function A_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(e,t,n,r){return new A_(e,t,n,r)}function Hd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function D_(e){if(typeof e=="function")return Hd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===id)return 11;if(e===ld)return 14}return 2}function dr(e,t){var n=e.alternate;return n===null?(n=Ut(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ms(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Hd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case po:return Or(n.children,o,i,t);case od:l=8,o|=8;break;case cc:return e=Ut(12,n,t,o|2),e.elementType=cc,e.lanes=i,e;case dc:return e=Ut(13,n,t,o),e.elementType=dc,e.lanes=i,e;case fc:return e=Ut(19,n,t,o),e.elementType=fc,e.lanes=i,e;case om:return da(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case nm:l=10;break e;case rm:l=9;break e;case id:l=11;break e;case ld:l=14;break e;case qn:l=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Ut(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Or(e,t,n,r){return e=Ut(7,e,r,t),e.lanes=n,e}function da(e,t,n,r){return e=Ut(22,e,r,t),e.elementType=om,e.lanes=n,e.stateNode={isHidden:!1},e}function sc(e,t,n){return e=Ut(6,e,null,t),e.lanes=n,e}function ac(e,t,n){return t=Ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function T_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Gd(e,t,n,r,o,i,l,s,a){return e=new T_(e,t,n,s,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ut(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nd(i),e}function z_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Kg(e){if(!e)return pr;e=e._reactInternals;e:{if(Br(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(kt(n))return Km(e,n,t)}return t}function Zg(e,t,n,r,o,i,l,s,a){return e=Gd(n,r,!0,e,o,i,l,s,a),e.context=Kg(null),n=e.current,r=mt(),o=cr(n),i=zn(r,o),i.callback=t??null,ar(n,i,o),e.current.lanes=o,Zi(e,o,r),Ct(e,r),e}function fa(e,t,n,r){var o=t.current,i=mt(),l=cr(o);return n=Kg(n),t.context===null?t.context=n:t.pendingContext=n,t=zn(i,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ar(o,t,l),e!==null&&(cn(e,o,l,i),Ns(e,o,l)),l}function ea(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vd(e,t){Jh(e,t),(e=e.alternate)&&Jh(e,t)}function O_(){return null}var Qg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bd(e){this._internalRoot=e}pa.prototype.render=Bd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));fa(e,t,null,null)};pa.prototype.unmount=Bd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gr(function(){fa(null,e,null,null)}),t[Ln]=null}};function pa(e){this._internalRoot=e}pa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<er.length&&t!==0&&t<er[n].priority;n++);er.splice(n,0,e),n===0&&Mm(e)}};function Yd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ha(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function em(){}function L_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=ea(l);i.call(u)}}var l=Zg(t,r,e,0,null,!1,!1,"",em);return e._reactRootContainer=l,e[Ln]=l.current,Gi(e.nodeType===8?e.parentNode:e),Gr(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var u=ea(a);s.call(u)}}var a=Gd(e,0,!1,null,null,!1,!1,"",em);return e._reactRootContainer=a,e[Ln]=a.current,Gi(e.nodeType===8?e.parentNode:e),Gr(function(){fa(t,a,n,r)}),a}function ma(e,t,n,r,o){var i=n._reactRootContainer;if(i){var l=i;if(typeof o=="function"){var s=o;o=function(){var a=ea(l);s.call(a)}}fa(t,l,e,o)}else l=L_(n,t,e,o,r);return ea(l)}Cm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Si(t.pendingLanes);n!==0&&(ud(t,n|1),Ct(t,Ae()),!(ce&6)&&(Oo=Ae()+500,gr()))}break;case 13:Gr(function(){var r=$n(e,1);if(r!==null){var o=mt();cn(r,e,1,o)}}),Vd(e,1)}};cd=function(e){if(e.tag===13){var t=$n(e,134217728);if(t!==null){var n=mt();cn(t,e,134217728,n)}Vd(e,134217728)}};bm=function(e){if(e.tag===13){var t=cr(e),n=$n(e,t);if(n!==null){var r=mt();cn(n,e,t,r)}Vd(e,t)}};Pm=function(){return me};Im=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};Sc=function(e,t,n){switch(t){case"input":if(mc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=ia(r);if(!o)throw Error(B(90));lm(r),mc(r,o)}}}break;case"textarea":am(e,n);break;case"select":t=n.value,t!=null&&No(e,!!n.multiple,t,!1)}};mm=Ld;gm=Gr;var $_={usingClientEntryPoint:!1,Events:[qi,yo,ia,pm,hm,Ld]},vi={findFiberByHostInstance:Ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},F_={bundleType:vi.bundleType,version:vi.version,rendererPackageName:vi.rendererPackageName,rendererConfig:vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Hn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=xm(e),e===null?null:e.stateNode},findFiberByHostInstance:vi.findFiberByHostInstance||O_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(xi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!xi.isDisabled&&xi.supportsFiber))try{ta=xi.inject(F_),Nn=xi}catch{}var xi;Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$_;Ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yd(t))throw Error(B(200));return z_(e,t,null,n)};Ft.createRoot=function(e,t){if(!Yd(e))throw Error(B(299));var n=!1,r="",o=Qg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Gd(e,1,!1,null,null,n,!1,r,o),e[Ln]=t.current,Gi(e.nodeType===8?e.parentNode:e),new Bd(t)};Ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=xm(t),e=e===null?null:e.stateNode,e};Ft.flushSync=function(e){return Gr(e)};Ft.hydrate=function(e,t,n){if(!ha(t))throw Error(B(200));return ma(null,e,t,!0,n)};Ft.hydrateRoot=function(e,t,n){if(!Yd(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",l=Qg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=Zg(t,null,e,1,n??null,o,!1,i,l),e[Ln]=t.current,Gi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new pa(t)};Ft.render=function(e,t,n){if(!ha(t))throw Error(B(200));return ma(null,e,t,!1,n)};Ft.unmountComponentAtNode=function(e){if(!ha(e))throw Error(B(40));return e._reactRootContainer?(Gr(function(){ma(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0):!1};Ft.unstable_batchedUpdates=Ld;Ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ha(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return ma(e,t,n,!1,r)};Ft.version="18.3.1-next-f1338f8080-20240426"});var ga=Dt((Hb,ey)=>{"use strict";function Jg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jg)}catch(e){console.error(e)}}Jg(),ey.exports=qg()});var jd=Dt(Ud=>{"use strict";var ty=ga();Ud.createRoot=ty.createRoot,Ud.hydrateRoot=ty.hydrateRoot;var Gb});var ry=Dt(ya=>{"use strict";var H_=nn(),G_=Symbol.for("react.element"),V_=Symbol.for("react.fragment"),B_=Object.prototype.hasOwnProperty,Y_=H_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U_={key:!0,ref:!0,__self:!0,__source:!0};function ny(e,t,n){var r,o={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)B_.call(t,r)&&!U_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:G_,type:e,key:i,ref:l,props:o,_owner:Y_.current}}ya.Fragment=V_;ya.jsx=ny;ya.jsxs=ny});var Yr=Dt((Yb,oy)=>{"use strict";oy.exports=ry()});var ly=Dt(iy=>{"use strict";var Fo=nn();function j_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var X_=typeof Object.is=="function"?Object.is:j_,W_=Fo.useState,K_=Fo.useEffect,Z_=Fo.useLayoutEffect,Q_=Fo.useDebugValue;function q_(e,t){var n=t(),r=W_({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Z_(function(){o.value=n,o.getSnapshot=t,Xd(o)&&i({inst:o})},[e,n,t]),K_(function(){return Xd(o)&&i({inst:o}),e(function(){Xd(o)&&i({inst:o})})},[e]),Q_(n),n}function Xd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!X_(e,n)}catch{return!0}}function J_(e,t){return t()}var eS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?J_:q_;iy.useSyncExternalStore=Fo.useSyncExternalStore!==void 0?Fo.useSyncExternalStore:eS});var ay=Dt((Xb,sy)=>{"use strict";sy.exports=ly()});var cy=Dt(uy=>{"use strict";var va=nn(),tS=ay();function nS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rS=typeof Object.is=="function"?Object.is:nS,oS=tS.useSyncExternalStore,iS=va.useRef,lS=va.useEffect,sS=va.useMemo,aS=va.useDebugValue;uy.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=iS(null);if(i.current===null){var l={hasValue:!1,value:null};i.current=l}else l=i.current;i=sS(function(){function a(m){if(!u){if(u=!0,c=m,m=r(m),o!==void 0&&l.hasValue){var v=l.value;if(o(v,m))return d=v}return d=m}if(v=d,rS(c,m))return v;var g=r(m);return o!==void 0&&o(v,g)?(c=m,v):(c=m,d=g)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var s=oS(e,i[0],i[1]);return lS(function(){l.hasValue=!0,l.value=s},[s]),aS(s),s}});var fy=Dt((Kb,dy)=>{"use strict";dy.exports=cy()});var mw=We(jd(),1);var W=We(Yr(),1),z=We(nn(),1);var _=We(nn(),1);function qe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=qe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var gy=We(nn(),1),yy=We(fy(),1);var py=e=>{let t,n=new Set,r=(c,d)=>{let f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){let m=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(v=>v(t,m))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},hy=e=>e?py(e):py;var{useDebugValue:uS}=gy.default,{useSyncExternalStoreWithSelector:cS}=yy.default,dS=e=>e;function Wd(e,t=dS,n){let r=cS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return uS(r),r}var my=(e,t)=>{let n=hy(e),r=(o,i=t)=>Wd(n,o,i);return Object.assign(r,n),r},vy=(e,t)=>e?my(e,t):my;function Je(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var fS={value:()=>{}};function wy(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new xa(n)}function xa(e){this._=e}function pS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}xa.prototype=wy.prototype={constructor:xa,on:function(e,t){var n=this._,r=pS(e+"",n),o,i=-1,l=r.length;if(arguments.length<2){for(;++i<l;)if((o=(e=r[i]).type)&&(o=hS(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(o=(e=r[i]).type)n[o]=xy(n[o],e.name,t);else if(t==null)for(o in n)n[o]=xy(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new xa(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function hS(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function xy(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=fS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ur=wy;var wa="http://www.w3.org/1999/xhtml",Kd={svg:"http://www.w3.org/2000/svg",xhtml:wa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Kd.hasOwnProperty(t)?{space:Kd[t],local:e}:e}function mS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===wa&&t.documentElement.namespaceURI===wa?t.createElement(e):t.createElementNS(n,e)}}function gS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _a(e){var t=Gn(e);return(t.local?gS:mS)(t)}function yS(){}function jr(e){return e==null?yS:function(){return this.querySelector(e)}}function _y(e){typeof e!="function"&&(e=jr(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,s=r[o]=new Array(l),a,u,c=0;c<l;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),s[c]=u);return new Me(r,this._parents)}function Zd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vS(){return[]}function el(e){return e==null?vS:function(){return this.querySelectorAll(e)}}function xS(e){return function(){return Zd(e.apply(this,arguments))}}function Sy(e){typeof e=="function"?e=xS(e):e=el(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var l=t[i],s=l.length,a,u=0;u<s;++u)(a=l[u])&&(r.push(e.call(a,a.__data__,u,l)),o.push(a));return new Me(r,o)}function tl(e){return function(){return this.matches(e)}}function Sa(e){return function(t){return t.matches(e)}}var wS=Array.prototype.find;function _S(e){return function(){return wS.call(this.children,e)}}function SS(){return this.firstElementChild}function Ey(e){return this.select(e==null?SS:_S(typeof e=="function"?e:Sa(e)))}var ES=Array.prototype.filter;function NS(){return Array.from(this.children)}function kS(e){return function(){return ES.call(this.children,e)}}function Ny(e){return this.selectAll(e==null?NS:kS(typeof e=="function"?e:Sa(e)))}function ky(e){typeof e!="function"&&(e=tl(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,s=r[o]=[],a,u=0;u<l;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&s.push(a);return new Me(r,this._parents)}function Ea(e){return new Array(e.length)}function Cy(){return new Me(this._enter||this._groups.map(Ea),this._parents)}function nl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}nl.prototype={constructor:nl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function by(e){return function(){return e}}function CS(e,t,n,r,o,i){for(var l=0,s,a=t.length,u=i.length;l<u;++l)(s=t[l])?(s.__data__=i[l],r[l]=s):n[l]=new nl(e,i[l]);for(;l<a;++l)(s=t[l])&&(o[l]=s)}function bS(e,t,n,r,o,i,l){var s,a,u=new Map,c=t.length,d=i.length,f=new Array(c),m;for(s=0;s<c;++s)(a=t[s])&&(f[s]=m=l.call(a,a.__data__,s,t)+"",u.has(m)?o[s]=a:u.set(m,a));for(s=0;s<d;++s)m=l.call(e,i[s],s,i)+"",(a=u.get(m))?(r[s]=a,a.__data__=i[s],u.delete(m)):n[s]=new nl(e,i[s]);for(s=0;s<c;++s)(a=t[s])&&u.get(f[s])===a&&(o[s]=a)}function PS(e){return e.__data__}function Py(e,t){if(!arguments.length)return Array.from(this,PS);var n=t?bS:CS,r=this._parents,o=this._groups;typeof e!="function"&&(e=by(e));for(var i=o.length,l=new Array(i),s=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,m=IS(e.call(c,c&&c.__data__,u,r)),v=m.length,g=s[u]=new Array(v),E=l[u]=new Array(v),p=a[u]=new Array(f);n(c,d,g,E,p,m,t);for(var h=0,y=0,x,N;h<v;++h)if(x=g[h]){for(h>=y&&(y=h+1);!(N=E[y])&&++y<v;);x._next=N||null}}return l=new Me(l,r),l._enter=s,l._exit=a,l}function IS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Iy(){return new Me(this._exit||this._groups.map(Ea),this._parents)}function My(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Ry(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,l=Math.min(o,i),s=new Array(o),a=0;a<l;++a)for(var u=n[a],c=r[a],d=u.length,f=s[a]=new Array(d),m,v=0;v<d;++v)(m=u[v]||c[v])&&(f[v]=m);for(;a<o;++a)s[a]=n[a];return new Me(s,this._parents)}function Ay(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],l;--o>=0;)(l=r[o])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Dy(e){e||(e=MS);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var l=n[i],s=l.length,a=o[i]=new Array(s),u,c=0;c<s;++c)(u=l[c])&&(a[c]=u);a.sort(t)}return new Me(o,this._parents).order()}function MS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ty(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zy(){return Array.from(this)}function Oy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var l=r[o];if(l)return l}return null}function Ly(){let e=0;for(let t of this)++e;return e}function $y(){return!this.node()}function Fy(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,l=o.length,s;i<l;++i)(s=o[i])&&e.call(s,s.__data__,i,o);return this}function RS(e){return function(){this.removeAttribute(e)}}function AS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DS(e,t){return function(){this.setAttribute(e,t)}}function TS(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function zS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function OS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Hy(e,t){var n=Gn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?AS:RS:typeof t=="function"?n.local?OS:zS:n.local?TS:DS)(n,t))}function Na(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function LS(e){return function(){this.style.removeProperty(e)}}function $S(e,t,n){return function(){this.style.setProperty(e,t,n)}}function FS(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gy(e,t,n){return arguments.length>1?this.each((t==null?LS:typeof t=="function"?FS:$S)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||Na(e).getComputedStyle(e,null).getPropertyValue(t)}function HS(e){return function(){delete this[e]}}function GS(e,t){return function(){this[e]=t}}function VS(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vy(e,t){return arguments.length>1?this.each((t==null?HS:typeof t=="function"?VS:GS)(e,t)):this.node()[e]}function By(e){return e.trim().split(/^|\s+/)}function Qd(e){return e.classList||new Yy(e)}function Yy(e){this._node=e,this._names=By(e.getAttribute("class")||"")}Yy.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Uy(e,t){for(var n=Qd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function jy(e,t){for(var n=Qd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function BS(e){return function(){Uy(this,e)}}function YS(e){return function(){jy(this,e)}}function US(e,t){return function(){(t.apply(this,arguments)?Uy:jy)(this,e)}}function Xy(e,t){var n=By(e+"");if(arguments.length<2){for(var r=Qd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?US:t?BS:YS)(n,t))}function jS(){this.textContent=""}function XS(e){return function(){this.textContent=e}}function WS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Wy(e){return arguments.length?this.each(e==null?jS:(typeof e=="function"?WS:XS)(e)):this.node().textContent}function KS(){this.innerHTML=""}function ZS(e){return function(){this.innerHTML=e}}function QS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ky(e){return arguments.length?this.each(e==null?KS:(typeof e=="function"?QS:ZS)(e)):this.node().innerHTML}function qS(){this.nextSibling&&this.parentNode.appendChild(this)}function Zy(){return this.each(qS)}function JS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qy(){return this.each(JS)}function qy(e){var t=typeof e=="function"?e:_a(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function eE(){return null}function Jy(e,t){var n=typeof e=="function"?e:_a(e),r=t==null?eE:typeof t=="function"?t:jr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function tE(){var e=this.parentNode;e&&e.removeChild(this)}function e0(){return this.each(tE)}function nE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t0(e){return this.select(e?rE:nE)}function n0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function oE(e){return function(t){e.call(this,t,this.__data__)}}function iE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function lE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function sE(e,t,n){return function(){var r=this.__on,o,i=oE(t);if(r){for(var l=0,s=r.length;l<s;++l)if((o=r[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function r0(e,t,n){var r=iE(e+""),o,i=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,u=s.length,c;a<u;++a)for(o=0,c=s[a];o<i;++o)if((l=r[o]).type===c.type&&l.name===c.name)return c.value}return}for(s=t?sE:lE,o=0;o<i;++o)this.each(s(r[o],t,n));return this}function o0(e,t,n){var r=Na(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function aE(e,t){return function(){return o0(this,e,t)}}function uE(e,t){return function(){return o0(this,e,t.apply(this,arguments))}}function i0(e,t){return this.each((typeof t=="function"?uE:aE)(e,t))}function*l0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,l;o<i;++o)(l=r[o])&&(yield l)}var qd=[null];function Me(e,t){this._groups=e,this._parents=t}function s0(){return new Me([[document.documentElement]],qd)}function cE(){return this}Me.prototype=s0.prototype={constructor:Me,select:_y,selectAll:Sy,selectChild:Ey,selectChildren:Ny,filter:ky,data:Py,enter:Cy,exit:Iy,join:My,merge:Ry,selection:cE,order:Ay,sort:Dy,call:Ty,nodes:zy,node:Oy,size:Ly,empty:$y,each:Fy,attr:Hy,style:Gy,property:Vy,classed:Xy,text:Wy,html:Ky,raise:Zy,lower:Qy,append:qy,insert:Jy,remove:e0,clone:t0,datum:n0,on:r0,dispatch:i0,[Symbol.iterator]:l0};var Vn=s0;function ut(e){return typeof e=="string"?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],qd)}function a0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bt(e,t){if(e=a0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}var u0={passive:!1},Xr={capture:!0,passive:!1};function ka(e){e.stopImmediatePropagation()}function vr(e){e.preventDefault(),e.stopImmediatePropagation()}function rl(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",vr,Xr);"onselectstart"in t?n.on("selectstart.drag",vr,Xr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ol(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",vr,Xr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var il=e=>()=>e;function ll(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:l,y:s,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}ll.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dE(e){return!e.ctrlKey&&!e.button}function fE(){return this.parentNode}function pE(e,t){return t??{x:e.x,y:e.y}}function hE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jd(){var e=dE,t=fE,n=pE,r=hE,o={},i=Ur("start","drag","end"),l=0,s,a,u,c,d=0;function f(x){x.on("mousedown.drag",m).filter(r).on("touchstart.drag",E).on("touchmove.drag",p,u0).on("touchend.drag touchcancel.drag",h).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(x,N){if(!(c||!e.call(this,x,N))){var k=y(this,t.call(this,x,N),x,N,"mouse");k&&(ut(x.view).on("mousemove.drag",v,Xr).on("mouseup.drag",g,Xr),rl(x.view),ka(x),u=!1,s=x.clientX,a=x.clientY,k("start",x))}}function v(x){if(vr(x),!u){var N=x.clientX-s,k=x.clientY-a;u=N*N+k*k>d}o.mouse("drag",x)}function g(x){ut(x.view).on("mousemove.drag mouseup.drag",null),ol(x.view,u),vr(x),o.mouse("end",x)}function E(x,N){if(e.call(this,x,N)){var k=x.changedTouches,P=t.call(this,x,N),I=k.length,D,T;for(D=0;D<I;++D)(T=y(this,P,x,N,k[D].identifier,k[D]))&&(ka(x),T("start",x,k[D]))}}function p(x){var N=x.changedTouches,k=N.length,P,I;for(P=0;P<k;++P)(I=o[N[P].identifier])&&(vr(x),I("drag",x,N[P]))}function h(x){var N=x.changedTouches,k=N.length,P,I;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),P=0;P<k;++P)(I=o[N[P].identifier])&&(ka(x),I("end",x,N[P]))}function y(x,N,k,P,I,D){var T=i.copy(),$=bt(D||k,N),F,Y,w;if((w=n.call(x,new ll("beforestart",{sourceEvent:k,target:f,identifier:I,active:l,x:$[0],y:$[1],dx:0,dy:0,dispatch:T}),P))!=null)return F=w.x-$[0]||0,Y=w.y-$[1]||0,function R(C,O,V){var b=$,L;switch(C){case"start":o[I]=R,L=l++;break;case"end":delete o[I],--l;case"drag":$=bt(V||O,N),L=l;break}T.call(C,x,new ll(C,{sourceEvent:O,subject:w,target:f,identifier:I,active:L,x:$[0]+F,y:$[1]+Y,dx:$[0]-b[0],dy:$[1]-b[1],dispatch:T}),P)}}return f.filter=function(x){return arguments.length?(e=typeof x=="function"?x:il(!!x),f):e},f.container=function(x){return arguments.length?(t=typeof x=="function"?x:il(x),f):t},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:il(x),f):n},f.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:il(!!x),f):r},f.on=function(){var x=i.on.apply(i,arguments);return x===i?f:x},f.clickDistance=function(x){return arguments.length?(d=(x=+x)*x,f):Math.sqrt(d)},f}function Ca(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ef(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ul(){}var sl=.7,Ia=1/sl,Ho="\\s*([+-]?\\d+)\\s*",al="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mE=/^#([0-9a-f]{3,8})$/,gE=new RegExp(`^rgb\\(${Ho},${Ho},${Ho}\\)$`),yE=new RegExp(`^rgb\\(${Cn},${Cn},${Cn}\\)$`),vE=new RegExp(`^rgba\\(${Ho},${Ho},${Ho},${al}\\)$`),xE=new RegExp(`^rgba\\(${Cn},${Cn},${Cn},${al}\\)$`),wE=new RegExp(`^hsl\\(${al},${Cn},${Cn}\\)$`),_E=new RegExp(`^hsla\\(${al},${Cn},${Cn},${al}\\)$`),c0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ca(ul,xr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:d0,formatHex:d0,formatHex8:SE,formatHsl:EE,formatRgb:f0,toString:f0});function d0(){return this.rgb().formatHex()}function SE(){return this.rgb().formatHex8()}function EE(){return v0(this).formatHsl()}function f0(){return this.rgb().formatRgb()}function xr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?p0(t):n===3?new Pt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ba(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gE.exec(e))?new Pt(t[1],t[2],t[3],1):(t=yE.exec(e))?new Pt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=vE.exec(e))?ba(t[1],t[2],t[3],t[4]):(t=xE.exec(e))?ba(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wE.exec(e))?g0(t[1],t[2]/100,t[3]/100,1):(t=_E.exec(e))?g0(t[1],t[2]/100,t[3]/100,t[4]):c0.hasOwnProperty(e)?p0(c0[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function p0(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function ba(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pt(e,t,n,r)}function NE(e){return e instanceof ul||(e=xr(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function Go(e,t,n,r){return arguments.length===1?NE(e):new Pt(e,t,n,r??1)}function Pt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ca(Pt,Go,ef(ul,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sl:Math.pow(sl,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(Kr(this.r),Kr(this.g),Kr(this.b),Ma(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:h0,formatHex:h0,formatHex8:kE,formatRgb:m0,toString:m0}));function h0(){return`#${Wr(this.r)}${Wr(this.g)}${Wr(this.b)}`}function kE(){return`#${Wr(this.r)}${Wr(this.g)}${Wr(this.b)}${Wr((isNaN(this.opacity)?1:this.opacity)*255)}`}function m0(){let e=Ma(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function Ma(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function g0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fn(e,t,n,r)}function v0(e){if(e instanceof fn)return new fn(e.h,e.s,e.l,e.opacity);if(e instanceof ul||(e=xr(e)),!e)return new fn;if(e instanceof fn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,s=i-o,a=(i+o)/2;return s?(t===i?l=(n-r)/s+(n<r)*6:n===i?l=(r-t)/s+2:l=(t-n)/s+4,s/=a<.5?i+o:2-i-o,l*=60):s=a>0&&a<1?0:l,new fn(l,s,a,e.opacity)}function x0(e,t,n,r){return arguments.length===1?v0(e):new fn(e,t,n,r??1)}function fn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ca(fn,x0,ef(ul,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sl:Math.pow(sl,e),new fn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Pt(tf(e>=240?e-240:e+120,o,r),tf(e,o,r),tf(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new fn(y0(this.h),Pa(this.s),Pa(this.l),Ma(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Ma(this.opacity);return`${e===1?"hsl(":"hsla("}${y0(this.h)}, ${Pa(this.s)*100}%, ${Pa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function y0(e){return e=(e||0)%360,e<0?e+360:e}function Pa(e){return Math.max(0,Math.min(1,e||0))}function tf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function nf(e,t,n,r,o){var i=e*e,l=i*e;return((1-3*e+3*i-l)*t+(4-6*i+3*l)*n+(1+3*e+3*i-3*l)*r+l*o)/6}function w0(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],l=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return nf((n-r/t)*t,l,o,i,s)}}function _0(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],l=e[(r+1)%t],s=e[(r+2)%t];return nf((n-r/t)*t,o,i,l,s)}}var rf=e=>()=>e;function CE(e,t){return function(n){return e+n*t}}function bE(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function S0(e){return(e=+e)==1?Ra:function(t,n){return n-t?bE(t,n,e):rf(isNaN(t)?n:t)}}function Ra(e,t){var n=t-e;return n?CE(e,n):rf(isNaN(e)?t:e)}var Aa=function e(t){var n=S0(t);function r(o,i){var l=n((o=Go(o)).r,(i=Go(i)).r),s=n(o.g,i.g),a=n(o.b,i.b),u=Ra(o.opacity,i.opacity);return function(c){return o.r=l(c),o.g=s(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function E0(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),l,s;for(l=0;l<n;++l)s=Go(t[l]),r[l]=s.r||0,o[l]=s.g||0,i[l]=s.b||0;return r=e(r),o=e(o),i=e(i),s.opacity=1,function(a){return s.r=r(a),s.g=o(a),s.b=i(a),s+""}}}var PE=E0(w0),IE=E0(_0);function Kt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,of=new RegExp(lf.source,"g");function ME(e){return function(){return e}}function RE(e){return function(t){return e(t)+""}}function sf(e,t){var n=lf.lastIndex=of.lastIndex=0,r,o,i,l=-1,s=[],a=[];for(e=e+"",t=t+"";(r=lf.exec(e))&&(o=of.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),s[l]?s[l]+=i:s[++l]=i),(r=r[0])===(o=o[0])?s[l]?s[l]+=o:s[++l]=o:(s[++l]=null,a.push({i:l,x:Kt(r,o)})),n=of.lastIndex;return n<t.length&&(i=t.slice(n),s[l]?s[l]+=i:s[++l]=i),s.length<2?a[0]?RE(a[0].x):ME(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)s[(d=a[c]).i]=d.x(u);return s.join("")})}var N0=180/Math.PI,Da={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function af(e,t,n,r,o,i){var l,s,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,a/=s),e*r<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*N0,skewX:Math.atan(a)*N0,scaleX:l,scaleY:s}}var Ta;function k0(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Da:af(t.a,t.b,t.c,t.d,t.e,t.f)}function C0(e){return e==null?Da:(Ta||(Ta=document.createElementNS("http://www.w3.org/2000/svg","g")),Ta.setAttribute("transform",e),(e=Ta.transform.baseVal.consolidate())?(e=e.matrix,af(e.a,e.b,e.c,e.d,e.e,e.f)):Da)}function b0(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,m,v){if(u!==d||c!==f){var g=m.push("translate(",null,t,null,n);v.push({i:g-4,x:Kt(u,d)},{i:g-2,x:Kt(c,f)})}else(d||f)&&m.push("translate("+d+t+f+n)}function l(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Kt(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function s(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Kt(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,m,v){if(u!==d||c!==f){var g=m.push(o(m)+"scale(",null,",",null,")");v.push({i:g-4,x:Kt(u,d)},{i:g-2,x:Kt(c,f)})}else(d!==1||f!==1)&&m.push(o(m)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),l(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(m){for(var v=-1,g=f.length,E;++v<g;)d[(E=f[v]).i]=E.x(m);return d.join("")}}}var uf=b0(k0,"px, ","px)","deg)"),cf=b0(C0,", ",")",")");var AE=1e-12;function P0(e){return((e=Math.exp(e))+1/e)/2}function DE(e){return((e=Math.exp(e))-1/e)/2}function TE(e){return((e=Math.exp(2*e))-1)/(e+1)}var df=function e(t,n,r){function o(i,l){var s=i[0],a=i[1],u=i[2],c=l[0],d=l[1],f=l[2],m=c-s,v=d-a,g=m*m+v*v,E,p;if(g<AE)p=Math.log(f/u)/t,E=function(P){return[s+P*m,a+P*v,u*Math.exp(t*P*p)]};else{var h=Math.sqrt(g),y=(f*f-u*u+r*g)/(2*u*n*h),x=(f*f-u*u-r*g)/(2*f*n*h),N=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(x*x+1)-x);p=(k-N)/t,E=function(P){var I=P*p,D=P0(N),T=u/(n*h)*(D*TE(t*I+N)-DE(N));return[s+T*m,a+T*v,u*D/P0(t*I+N)]}}return E.duration=p*1e3*t/Math.SQRT2,E}return o.rho=function(i){var l=Math.max(.001,+i),s=l*l,a=s*s;return e(l,s,a)},o}(Math.SQRT2,2,4);var Vo=0,dl=0,cl=0,M0=1e3,za,fl,Oa=0,Zr=0,La=0,pl=typeof performance=="object"&&performance.now?performance:Date,R0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ml(){return Zr||(R0(zE),Zr=pl.now()+La)}function zE(){Zr=0}function hl(){this._call=this._time=this._next=null}hl.prototype=$a.prototype={constructor:hl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ml():+n)+(t==null?0:+t),!this._next&&fl!==this&&(fl?fl._next=this:za=this,fl=this),this._call=e,this._time=n,ff()},stop:function(){this._call&&(this._call=null,this._time=1/0,ff())}};function $a(e,t,n){var r=new hl;return r.restart(e,t,n),r}function A0(){ml(),++Vo;for(var e=za,t;e;)(t=Zr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vo}function I0(){Zr=(Oa=pl.now())+La,Vo=dl=0;try{A0()}finally{Vo=0,LE(),Zr=0}}function OE(){var e=pl.now(),t=e-Oa;t>M0&&(La-=t,Oa=e)}function LE(){for(var e,t=za,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:za=n);fl=e,ff(r)}function ff(e){if(!Vo){dl&&(dl=clearTimeout(dl));var t=e-Zr;t>24?(e<1/0&&(dl=setTimeout(I0,e-pl.now()-La)),cl&&(cl=clearInterval(cl))):(cl||(Oa=pl.now(),cl=setInterval(OE,M0)),Vo=1,R0(I0))}}function Fa(e,t,n){var r=new hl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var $E=Ur("start","end","cancel","interrupt"),FE=[],z0=0,D0=1,Ga=2,Ha=3,T0=4,Va=5,gl=6;function wr(e,t,n,r,o,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;HE(e,n,{name:t,index:r,group:o,on:$E,tween:FE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:z0})}function yl(e,t){var n=$e(e,t);if(n.state>z0)throw new Error("too late; already scheduled");return n}function et(e,t){var n=$e(e,t);if(n.state>Ha)throw new Error("too late; already running");return n}function $e(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function HE(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=$a(i,0,n.time);function i(u){n.state=D0,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var c,d,f,m;if(n.state!==D0)return a();for(c in r)if(m=r[c],m.name===n.name){if(m.state===Ha)return Fa(l);m.state===T0?(m.state=gl,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[c]):+c<t&&(m.state=gl,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[c])}if(Fa(function(){n.state===Ha&&(n.state=T0,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Ga,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ga){for(n.state=Ha,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(m=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=m);o.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Va,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Va&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=gl,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Qr(e,t){var n=e.__transition,r,o,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){i=!1;continue}o=r.state>Ga&&r.state<Va,r.state=gl,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}i&&delete e.__transition}}function O0(e){return this.each(function(){Qr(this,e)})}function GE(e,t){var n,r;return function(){var o=et(this,e),i=o.tween;if(i!==n){r=n=i;for(var l=0,s=r.length;l<s;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}o.tween=r}}function VE(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=et(this,e),l=i.tween;if(l!==r){o=(r=l).slice();for(var s={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=s;break}a===u&&o.push(s)}i.tween=o}}function L0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$e(this.node(),n).tween,o=0,i=r.length,l;o<i;++o)if((l=r[o]).name===e)return l.value;return null}return this.each((t==null?GE:VE)(n,e,t))}function Bo(e,t,n){var r=e._id;return e.each(function(){var o=et(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return $e(o,r).value[t]}}function Ba(e,t){var n;return(typeof t=="number"?Kt:t instanceof xr?Aa:(n=xr(t))?(t=n,Aa):sf)(e,t)}function BE(e){return function(){this.removeAttribute(e)}}function YE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UE(e,t,n){var r,o=n+"",i;return function(){var l=this.getAttribute(e);return l===o?null:l===r?i:i=t(r=l,n)}}function jE(e,t,n){var r,o=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===r?i:i=t(r=l,n)}}function XE(e,t,n){var r,o,i;return function(){var l,s=n(this),a;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=s+"",l===a?null:l===r&&a===o?i:(o=a,i=t(r=l,s)))}}function WE(e,t,n){var r,o,i;return function(){var l,s=n(this),a;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=s+"",l===a?null:l===r&&a===o?i:(o=a,i=t(r=l,s)))}}function $0(e,t){var n=Gn(e),r=n==="transform"?cf:Ba;return this.attrTween(e,typeof t=="function"?(n.local?WE:XE)(n,r,Bo(this,"attr."+e,t)):t==null?(n.local?YE:BE)(n):(n.local?jE:UE)(n,r,t))}function KE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ZE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function QE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ZE(e,i)),n}return o._value=t,o}function qE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&KE(e,i)),n}return o._value=t,o}function F0(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Gn(e);return this.tween(n,(r.local?QE:qE)(r,t))}function JE(e,t){return function(){yl(this,e).delay=+t.apply(this,arguments)}}function eN(e,t){return t=+t,function(){yl(this,e).delay=t}}function H0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?JE:eN)(t,e)):$e(this.node(),t).delay}function tN(e,t){return function(){et(this,e).duration=+t.apply(this,arguments)}}function nN(e,t){return t=+t,function(){et(this,e).duration=t}}function G0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tN:nN)(t,e)):$e(this.node(),t).duration}function rN(e,t){if(typeof t!="function")throw new Error;return function(){et(this,e).ease=t}}function V0(e){var t=this._id;return arguments.length?this.each(rN(t,e)):$e(this.node(),t).ease}function oN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,e).ease=n}}function B0(e){if(typeof e!="function")throw new Error;return this.each(oN(this._id,e))}function Y0(e){typeof e!="function"&&(e=tl(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,s=r[o]=[],a,u=0;u<l;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&s.push(a);return new yt(r,this._parents,this._name,this._id)}function U0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),l=new Array(r),s=0;s<i;++s)for(var a=t[s],u=n[s],c=a.length,d=l[s]=new Array(c),f,m=0;m<c;++m)(f=a[m]||u[m])&&(d[m]=f);for(;s<r;++s)l[s]=t[s];return new yt(l,this._parents,this._name,this._id)}function iN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function lN(e,t,n){var r,o,i=iN(t)?yl:et;return function(){var l=i(this,e),s=l.on;s!==r&&(o=(r=s).copy()).on(t,n),l.on=o}}function j0(e,t){var n=this._id;return arguments.length<2?$e(this.node(),n).on.on(e):this.each(lN(n,e,t))}function sN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function X0(){return this.on("end.remove",sN(this._id))}function W0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jr(e));for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l)for(var s=r[l],a=s.length,u=i[l]=new Array(a),c,d,f=0;f<a;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,wr(u[f],t,n,f,u,$e(c,n)));return new yt(i,this._parents,t,n)}function K0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=el(e));for(var r=this._groups,o=r.length,i=[],l=[],s=0;s<o;++s)for(var a=r[s],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),m,v=$e(c,n),g=0,E=f.length;g<E;++g)(m=f[g])&&wr(m,t,n,g,f,v);i.push(f),l.push(c)}return new yt(i,l,t,n)}var aN=Vn.prototype.constructor;function Z0(){return new aN(this._groups,this._parents)}function uN(e,t){var n,r,o;return function(){var i=yr(this,e),l=(this.style.removeProperty(e),yr(this,e));return i===l?null:i===n&&l===r?o:o=t(n=i,r=l)}}function Q0(e){return function(){this.style.removeProperty(e)}}function cN(e,t,n){var r,o=n+"",i;return function(){var l=yr(this,e);return l===o?null:l===r?i:i=t(r=l,n)}}function dN(e,t,n){var r,o,i;return function(){var l=yr(this,e),s=n(this),a=s+"";return s==null&&(a=s=(this.style.removeProperty(e),yr(this,e))),l===a?null:l===r&&a===o?i:(o=a,i=t(r=l,s))}}function fN(e,t){var n,r,o,i="style."+t,l="end."+i,s;return function(){var a=et(this,e),u=a.on,c=a.value[i]==null?s||(s=Q0(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(l,o=c),a.on=r}}function q0(e,t,n){var r=(e+="")=="transform"?uf:Ba;return t==null?this.styleTween(e,uN(e,r)).on("end.style."+e,Q0(e)):typeof t=="function"?this.styleTween(e,dN(e,r,Bo(this,"style."+e,t))).each(fN(this._id,e)):this.styleTween(e,cN(e,r,t),n).on("end.style."+e,null)}function pN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function hN(e,t,n){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&pN(e,l,n)),r}return i._value=t,i}function J0(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,hN(e,t,n??""))}function mN(e){return function(){this.textContent=e}}function gN(e){return function(){var t=e(this);this.textContent=t??""}}function ev(e){return this.tween("text",typeof e=="function"?gN(Bo(this,"text",e)):mN(e==null?"":e+""))}function yN(e){return function(t){this.textContent=e.call(this,t)}}function vN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&yN(o)),t}return r._value=e,r}function tv(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,vN(e))}function nv(){for(var e=this._name,t=this._id,n=Ya(),r=this._groups,o=r.length,i=0;i<o;++i)for(var l=r[i],s=l.length,a,u=0;u<s;++u)if(a=l[u]){var c=$e(a,t);wr(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new yt(r,this._parents,e,n)}function rv(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,l){var s={value:l},a={value:function(){--o===0&&i()}};n.each(function(){var u=et(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(a)),u.on=t}),o===0&&i()})}var xN=0;function yt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ov(e){return Vn().transition(e)}function Ya(){return++xN}var Bn=Vn.prototype;yt.prototype=ov.prototype={constructor:yt,select:W0,selectAll:K0,selectChild:Bn.selectChild,selectChildren:Bn.selectChildren,filter:Y0,merge:U0,selection:Z0,transition:nv,call:Bn.call,nodes:Bn.nodes,node:Bn.node,size:Bn.size,empty:Bn.empty,each:Bn.each,on:j0,attr:$0,attrTween:F0,style:q0,styleTween:J0,text:ev,textTween:tv,remove:X0,tween:L0,delay:H0,duration:G0,ease:V0,easeVarying:B0,end:rv,[Symbol.iterator]:Bn[Symbol.iterator]};function Ua(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wN={time:null,delay:0,duration:250,ease:Ua};function _N(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function iv(e){var t,n;e instanceof yt?(t=e._id,e=e._name):(t=Ya(),(n=wN).time=ml(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var l=r[i],s=l.length,a,u=0;u<s;++u)(a=l[u])&&wr(a,e,t,u,l,n||_N(a,t));return new yt(r,this._parents,e,t)}Vn.prototype.interrupt=O0;Vn.prototype.transition=iv;var vl=e=>()=>e;function pf(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function pn(e,t,n){this.k=e,this.x=t,this.y=n}pn.prototype={constructor:pn,scale:function(e){return e===1?this:new pn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new pn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Zt=new pn(1,0,0);hf.prototype=pn.prototype;function hf(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zt;return e.__zoom}function ja(e){e.stopImmediatePropagation()}function Yo(e){e.preventDefault(),e.stopImmediatePropagation()}function SN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function EN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function lv(){return this.__zoom||Zt}function NN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function kN(){return navigator.maxTouchPoints||"ontouchstart"in this}function CN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function mf(){var e=SN,t=EN,n=CN,r=NN,o=kN,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,a=df,u=Ur("start","zoom","end"),c,d,f,m=500,v=150,g=0,E=10;function p(w){w.property("__zoom",lv).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",T).filter(o).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(w,R,C,O){var V=w.selection?w.selection():w;V.property("__zoom",lv),w!==V?N(w,R,C,O):V.interrupt().each(function(){k(this,arguments).event(O).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},p.scaleBy=function(w,R,C,O){p.scaleTo(w,function(){var V=this.__zoom.k,b=typeof R=="function"?R.apply(this,arguments):R;return V*b},C,O)},p.scaleTo=function(w,R,C,O){p.transform(w,function(){var V=t.apply(this,arguments),b=this.__zoom,L=C==null?x(V):typeof C=="function"?C.apply(this,arguments):C,G=b.invert(L),U=typeof R=="function"?R.apply(this,arguments):R;return n(y(h(b,U),L,G),V,l)},C,O)},p.translateBy=function(w,R,C,O){p.transform(w,function(){return n(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),l)},null,O)},p.translateTo=function(w,R,C,O,V){p.transform(w,function(){var b=t.apply(this,arguments),L=this.__zoom,G=O==null?x(b):typeof O=="function"?O.apply(this,arguments):O;return n(Zt.translate(G[0],G[1]).scale(L.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof C=="function"?-C.apply(this,arguments):-C),b,l)},O,V)};function h(w,R){return R=Math.max(i[0],Math.min(i[1],R)),R===w.k?w:new pn(R,w.x,w.y)}function y(w,R,C){var O=R[0]-C[0]*w.k,V=R[1]-C[1]*w.k;return O===w.x&&V===w.y?w:new pn(w.k,O,V)}function x(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function N(w,R,C,O){w.on("start.zoom",function(){k(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(O).end()}).tween("zoom",function(){var V=this,b=arguments,L=k(V,b).event(O),G=t.apply(V,b),U=C==null?x(G):typeof C=="function"?C.apply(V,b):C,Q=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),K=V.__zoom,ne=typeof R=="function"?R.apply(V,b):R,ae=a(K.invert(U).concat(Q/K.k),ne.invert(U).concat(Q/ne.k));return function(te){if(te===1)te=ne;else{var fe=ae(te),oe=Q/fe[2];te=new pn(oe,U[0]-fe[0]*oe,U[1]-fe[1]*oe)}L.zoom(null,te)}})}function k(w,R,C){return!C&&w.__zooming||new P(w,R)}function P(w,R){this.that=w,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,R),this.taps=0}P.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,R){return this.mouse&&w!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var R=ut(this.that).datum();u.call(w,this.that,new pf(w,{sourceEvent:this.sourceEvent,target:p,type:w,transform:this.that.__zoom,dispatch:u}),R)}};function I(w,...R){if(!e.apply(this,arguments))return;var C=k(this,R).event(w),O=this.__zoom,V=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,r.apply(this,arguments)))),b=bt(w);if(C.wheel)(C.mouse[0][0]!==b[0]||C.mouse[0][1]!==b[1])&&(C.mouse[1]=O.invert(C.mouse[0]=b)),clearTimeout(C.wheel);else{if(O.k===V)return;C.mouse=[b,O.invert(b)],Qr(this),C.start()}Yo(w),C.wheel=setTimeout(L,v),C.zoom("mouse",n(y(h(O,V),C.mouse[0],C.mouse[1]),C.extent,l));function L(){C.wheel=null,C.end()}}function D(w,...R){if(f||!e.apply(this,arguments))return;var C=w.currentTarget,O=k(this,R,!0).event(w),V=ut(w.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",Q,!0),b=bt(w,C),L=w.clientX,G=w.clientY;rl(w.view),ja(w),O.mouse=[b,this.__zoom.invert(b)],Qr(this),O.start();function U(K){if(Yo(K),!O.moved){var ne=K.clientX-L,ae=K.clientY-G;O.moved=ne*ne+ae*ae>g}O.event(K).zoom("mouse",n(y(O.that.__zoom,O.mouse[0]=bt(K,C),O.mouse[1]),O.extent,l))}function Q(K){V.on("mousemove.zoom mouseup.zoom",null),ol(K.view,O.moved),Yo(K),O.event(K).end()}}function T(w,...R){if(e.apply(this,arguments)){var C=this.__zoom,O=bt(w.changedTouches?w.changedTouches[0]:w,this),V=C.invert(O),b=C.k*(w.shiftKey?.5:2),L=n(y(h(C,b),O,V),t.apply(this,R),l);Yo(w),s>0?ut(this).transition().duration(s).call(N,L,O,w):ut(this).call(p.transform,L,O,w)}}function $(w,...R){if(e.apply(this,arguments)){var C=w.touches,O=C.length,V=k(this,R,w.changedTouches.length===O).event(w),b,L,G,U;for(ja(w),L=0;L<O;++L)G=C[L],U=bt(G,this),U=[U,this.__zoom.invert(U),G.identifier],V.touch0?!V.touch1&&V.touch0[2]!==U[2]&&(V.touch1=U,V.taps=0):(V.touch0=U,b=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),b&&(V.taps<2&&(d=U[0],c=setTimeout(function(){c=null},m)),Qr(this),V.start())}}function F(w,...R){if(this.__zooming){var C=k(this,R).event(w),O=w.changedTouches,V=O.length,b,L,G,U;for(Yo(w),b=0;b<V;++b)L=O[b],G=bt(L,this),C.touch0&&C.touch0[2]===L.identifier?C.touch0[0]=G:C.touch1&&C.touch1[2]===L.identifier&&(C.touch1[0]=G);if(L=C.that.__zoom,C.touch1){var Q=C.touch0[0],K=C.touch0[1],ne=C.touch1[0],ae=C.touch1[1],te=(te=ne[0]-Q[0])*te+(te=ne[1]-Q[1])*te,fe=(fe=ae[0]-K[0])*fe+(fe=ae[1]-K[1])*fe;L=h(L,Math.sqrt(te/fe)),G=[(Q[0]+ne[0])/2,(Q[1]+ne[1])/2],U=[(K[0]+ae[0])/2,(K[1]+ae[1])/2]}else if(C.touch0)G=C.touch0[0],U=C.touch0[1];else return;C.zoom("touch",n(y(L,G,U),C.extent,l))}}function Y(w,...R){if(this.__zooming){var C=k(this,R).event(w),O=w.changedTouches,V=O.length,b,L;for(ja(w),f&&clearTimeout(f),f=setTimeout(function(){f=null},m),b=0;b<V;++b)L=O[b],C.touch0&&C.touch0[2]===L.identifier?delete C.touch0:C.touch1&&C.touch1[2]===L.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(L=bt(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<E)){var G=ut(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return p.wheelDelta=function(w){return arguments.length?(r=typeof w=="function"?w:vl(+w),p):r},p.filter=function(w){return arguments.length?(e=typeof w=="function"?w:vl(!!w),p):e},p.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:vl(!!w),p):o},p.extent=function(w){return arguments.length?(t=typeof w=="function"?w:vl([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),p):t},p.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],p):[i[0],i[1]]},p.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],p):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},p.constrain=function(w){return arguments.length?(n=w,p):n},p.duration=function(w){return arguments.length?(s=+w,p):s},p.interpolate=function(w){return arguments.length?(a=w,p):a},p.on=function(){var w=u.on.apply(u,arguments);return w===u?p:w},p.clickDistance=function(w){return arguments.length?(g=(w=+w)*w,p):Math.sqrt(g)},p.tapDistance=function(w){return arguments.length?(E=+w,p):E},p}var Mv=We(ga(),1),eu=(0,_.createContext)(null),bN=eu.Provider,bn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Rv=bn.error001();function Ee(e,t){let n=(0,_.useContext)(eu);if(n===null)throw new Error(Rv);return Wd(n,e,t)}var Be=()=>{let e=(0,_.useContext)(eu);if(e===null)throw new Error(Rv);return(0,_.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},PN=e=>e.userSelectionActive?"none":"all";function IN({position:e,children:t,className:n,style:r,...o}){let i=Ee(PN),l=`${e}`.split("-");return _.default.createElement("div",{className:qe(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},...o},t)}function MN({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:_.default.createElement(IN,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},_.default.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var RN=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:l=[2,4],labelBgBorderRadius:s=2,children:a,className:u,...c})=>{let d=(0,_.useRef)(null),[f,m]=(0,_.useState)({x:0,y:0,width:0,height:0}),v=qe(["react-flow__edge-textwrapper",u]);return(0,_.useEffect)(()=>{if(d.current){let g=d.current.getBBox();m({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:_.default.createElement("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:v,visibility:f.width?"visible":"hidden",...c},o&&_.default.createElement("rect",{width:f.width+2*l[0],x:-l[0],y:-l[1],height:f.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:s,ry:s}),_.default.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r},n),a)},AN=(0,_.memo)(RN),If=e=>({width:e.offsetWidth,height:e.offsetHeight}),qo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Mf=(e={x:0,y:0},t)=>({x:qo(e.x,t[0][0],t[1][0]),y:qo(e.y,t[0][1],t[1][1])}),sv=(e,t,n)=>e<t?qo(Math.abs(e-t),1,50)/50:e>n?-qo(Math.abs(e-n),1,50)/50:0,Av=(e,t)=>{let n=sv(e.x,35,t.width-35)*20,r=sv(e.y,35,t.height-35)*20;return[n,r]},Dv=e=>e.getRootNode?.()||window?.document,DN=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Rf=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),TN=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),av=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0});var _f=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},zN=e=>Qt(e.width)&&Qt(e.height)&&Qt(e.x)&&Qt(e.y),Qt=e=>!isNaN(e)&&isFinite(e),Re=Symbol.for("internals"),Tv=["Enter"," ","Escape"],zv=(e,t)=>{},ON=e=>"nativeEvent"in e;function Sf(e){let n=(ON(e)?e.nativeEvent:e).composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}var Ov=e=>"clientX"in e,Nr=(e,t)=>{let n=Ov(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},Qa=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,Nl=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:m=20})=>_.default.createElement(_.default.Fragment,null,_.default.createElement("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),m&&_.default.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),o&&Qt(n)&&Qt(r)?_.default.createElement(AN,{x:n,y:r,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u}):null);Nl.displayName="BaseEdge";function xl(e,t,n){return n===void 0?n:r=>{let o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Lv({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=n<e?n+o:n-o,l=Math.abs(r-t)/2,s=r<t?r+l:r-l;return[i,s,o,l]}function $v({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:l,targetControlY:s}){let a=e*.125+o*.375+l*.375+n*.125,u=t*.125+i*.375+s*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}var eo;(function(e){e.Strict="strict",e.Loose="loose"})(eo||(eo={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var Sl;(function(e){e.Partial="partial",e.Full="full"})(Sl||(Sl={}));var Er;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Er||(Er={}));var qa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qa||(qa={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));function uv({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===J.Left||e===J.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Fv({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:o,targetPosition:i=J.Top}){let[l,s]=uv({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=uv({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,m]=$v({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${s} ${a},${u} ${r},${o}`,c,d,f,m]}var Af=(0,_.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=J.Bottom,targetPosition:i=J.Top,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,interactionWidth:g})=>{let[E,p,h]=Fv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return _.default.createElement(Nl,{path:E,labelX:p,labelY:h,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,interactionWidth:g})});Af.displayName="SimpleBezierEdge";var cv={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},LN=({source:e,sourcePosition:t=J.Bottom,target:n})=>t===J.Left||t===J.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},dv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function $N({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:o,offset:i}){let l=cv[t],s=cv[r],a={x:e.x+l.x*i,y:e.y+l.y*i},u={x:n.x+s.x*i,y:n.y+s.y*i},c=LN({source:a,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d],m=[],v,g,E={x:0,y:0},p={x:0,y:0},[h,y,x,N]=Lv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*s[d]===-1){v=o.x??h,g=o.y??y;let P=[{x:v,y:a.y},{x:v,y:u.y}],I=[{x:a.x,y:g},{x:u.x,y:g}];l[d]===f?m=d==="x"?P:I:m=d==="x"?I:P}else{let P=[{x:a.x,y:u.y}],I=[{x:u.x,y:a.y}];if(d==="x"?m=l.x===f?I:P:m=l.y===f?P:I,t===r){let Y=Math.abs(e[d]-n[d]);if(Y<=i){let w=Math.min(i-1,i-Y);l[d]===f?E[d]=(a[d]>e[d]?-1:1)*w:p[d]=(u[d]>n[d]?-1:1)*w}}if(t!==r){let Y=d==="x"?"y":"x",w=l[d]===s[Y],R=a[Y]>u[Y],C=a[Y]<u[Y];(l[d]===1&&(!w&&R||w&&C)||l[d]!==1&&(!w&&C||w&&R))&&(m=d==="x"?P:I)}let D={x:a.x+E.x,y:a.y+E.y},T={x:u.x+p.x,y:u.y+p.y},$=Math.max(Math.abs(D.x-m[0].x),Math.abs(T.x-m[0].x)),F=Math.max(Math.abs(D.y-m[0].y),Math.abs(T.y-m[0].y));$>=F?(v=(D.x+T.x)/2,g=m[0].y):(v=m[0].x,g=(D.y+T.y)/2)}return[[e,{x:a.x+E.x,y:a.y+E.y},...m,{x:u.x+p.x,y:u.y+p.y},n],v,g,x,N]}function FN(e,t,n,r){let o=Math.min(dv(e,t)/2,dv(t,n)/2,r),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){let u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${l}Q ${i},${l} ${i},${l+o*c}`}let s=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${l+o*a}Q ${i},${l} ${i+o*s},${l}`}function Ef({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:o,targetPosition:i=J.Top,borderRadius:l=5,centerX:s,centerY:a,offset:u=20}){let[c,d,f,m,v]=$N({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:a},offset:u});return[c.reduce((E,p,h)=>{let y="";return h>0&&h<c.length-1?y=FN(c[h-1],p,c[h+1],l):y=`${h===0?"M":"L"}${p.x} ${p.y}`,E+=y,E},""),d,f,m,v]}var tu=(0,_.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,sourcePosition:d=J.Bottom,targetPosition:f=J.Top,markerEnd:m,markerStart:v,pathOptions:g,interactionWidth:E})=>{let[p,h,y]=Ef({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:g?.borderRadius,offset:g?.offset});return _.default.createElement(Nl,{path:p,labelX:h,labelY:y,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:m,markerStart:v,interactionWidth:E})});tu.displayName="SmoothStepEdge";var Df=(0,_.memo)(e=>_.default.createElement(tu,{...e,pathOptions:(0,_.useMemo)(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Df.displayName="StepEdge";function HN({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,l,s]=Lv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,l,s]}var Tf=(0,_.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:m})=>{let[v,g,E]=HN({sourceX:e,sourceY:t,targetX:n,targetY:r});return _.default.createElement(Nl,{path:v,labelX:g,labelY:E,label:o,labelStyle:i,labelShowBg:l,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:m})});Tf.displayName="StraightEdge";function Xa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function fv({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case J.Left:return[t-Xa(t-r,i),n];case J.Right:return[t+Xa(r-t,i),n];case J.Top:return[t,n-Xa(n-o,i)];case J.Bottom:return[t,n+Xa(o-n,i)]}}function Hv({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:o,targetPosition:i=J.Top,curvature:l=.25}){let[s,a]=fv({pos:n,x1:e,y1:t,x2:r,y2:o,c:l}),[u,c]=fv({pos:i,x1:r,y1:o,x2:e,y2:t,c:l}),[d,f,m,v]=$v({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${r},${o}`,d,f,m,v]}var Ja=(0,_.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=J.Bottom,targetPosition:i=J.Top,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,pathOptions:g,interactionWidth:E})=>{let[p,h,y]=Hv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:g?.curvature});return _.default.createElement(Nl,{path:p,labelX:h,labelY:y,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,interactionWidth:E})});Ja.displayName="BezierEdge";var zf=(0,_.createContext)(null),GN=zf.Provider;zf.Consumer;var VN=()=>(0,_.useContext)(zf),BN=e=>"id"in e&&"source"in e&&"target"in e;var YN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Nf=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,UN=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),jN=(e,t)=>{if(!e.source||!e.target)return zv("006",bn.error006()),t;let n;return BN(e)?n={...e}:n={...e,id:YN(e)},UN(n,t)?t:t.concat(n)};var kf=({x:e,y:t},[n,r,o],i,[l,s])=>{let a={x:(e-n)/o,y:(t-r)/o};return i?{x:l*Math.round(a.x/l),y:s*Math.round(a.y/s)}:a},Gv=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Zo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};let n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Of=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,o)=>{let{x:i,y:l}=Zo(o,t).positionAbsolute;return DN(r,Rf({x:i,y:l,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return TN(n)};var Vv=(e,t,[n,r,o]=[0,0,1],i=!1,l=!1,s=[0,0])=>{let a={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{let{width:d,height:f,selectable:m=!0,hidden:v=!1}=c;if(l&&!m||v)return!1;let{positionAbsolute:g}=Zo(c,s),E={x:g.x,y:g.y,width:d||0,height:f||0},p=_f(a,E),h=typeof d>"u"||typeof f>"u"||d===null||f===null,y=i&&p>0,x=(d||0)*(f||0);(h||y||p>=x||c.dragging)&&u.push(c)}),u},Bv=(e,t)=>{let n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))};var Yv=(e,t,n,r,o,i=.1)=>{let l=t/(e.width*(1+i)),s=n/(e.height*(1+i)),a=Math.min(l,s),u=qo(a,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,m=n/2-d*u;return{x:f,y:m,zoom:u}},qr=(e,t=0)=>e.transition().duration(t);function pv(e,t,n,r){return(t[n]||[]).reduce((o,i)=>(`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+i.x+i.width/2,y:(e.positionAbsolute?.y??0)+i.y+i.height/2}),o),[])}function XN(e,t,n,r,o,i){let{x:l,y:s}=Nr(e),u=t.elementsFromPoint(l,s).find(v=>v.classList.contains("react-flow__handle"));if(u){let v=u.getAttribute("data-nodeid");if(v){let g=Lf(void 0,u),E=u.getAttribute("data-handleid"),p=i({nodeId:v,id:E,type:g});if(p){let h=o.find(y=>y.nodeId===v&&y.type===g&&y.id===E);return{handle:{id:E,type:g,nodeId:v,x:h?.x||n.x,y:h?.y||n.y},validHandleResult:p}}}}let c=[],d=1/0;if(o.forEach(v=>{let g=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(g<=r){let E=i(v);g<=d&&(g<d?c=[{handle:v,validHandleResult:E}]:g===d&&c.push({handle:v,validHandleResult:E}),d=g)}}),!c.length)return{handle:null,validHandleResult:Uv()};if(c.length===1)return c[0];let f=c.some(({validHandleResult:v})=>v.isValid),m=c.some(({handle:v})=>v.type==="target");return c.find(({handle:v,validHandleResult:g})=>m?v.type==="target":f?g.isValid:!0)||c[0]}var WN={source:null,target:null,sourceHandle:null,targetHandle:null},Uv=()=>({handleDomNode:null,isValid:!1,connection:WN,endHandle:null});function jv(e,t,n,r,o,i,l){let s=o==="target",a=l.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),u={...Uv(),handleDomNode:a};if(a){let c=Lf(void 0,a),d=a.getAttribute("data-nodeid"),f=a.getAttribute("data-handleid"),m=a.classList.contains("connectable"),v=a.classList.contains("connectableend"),g={source:s?d:n,sourceHandle:s?f:r,target:s?n:d,targetHandle:s?r:f};u.connection=g,m&&v&&(t===eo.Strict?s&&c==="source"||!s&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=i(g))}return u}function KN({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[Re]){let{handleBounds:l}=i[Re],s=[],a=[];l&&(s=pv(i,l,"source",`${t}-${n}-${r}`),a=pv(i,l,"target",`${t}-${n}-${r}`)),o.push(...s,...a)}return o},[])}function Lf(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function gf(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function ZN(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Xv({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:l,isValidConnection:s,edgeUpdaterType:a,onReconnectEnd:u}){let c=Dv(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:m,connectionRadius:v,onConnectStart:g,panBy:E,getNodes:p,cancelConnection:h}=i(),y=0,x,{x:N,y:k}=Nr(e),P=c?.elementFromPoint(N,k),I=Lf(a,P),D=f?.getBoundingClientRect();if(!D||!I)return;let T,$=Nr(e,D),F=!1,Y=null,w=!1,R=null,C=KN({nodes:p(),nodeId:n,handleId:t,handleType:I}),O=()=>{if(!m)return;let[L,G]=Av($,D);E({x:L,y:G}),y=requestAnimationFrame(O)};l({connectionPosition:$,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:I,connectionStartHandle:{nodeId:n,handleId:t,type:I},connectionEndHandle:null}),g?.(e,{nodeId:n,handleId:t,handleType:I});function V(L){let{transform:G}=i();$=Nr(L,D);let{handle:U,validHandleResult:Q}=XN(L,c,kf($,G,!1,[1,1]),v,C,K=>jv(K,d,n,t,o?"target":"source",s,c));if(x=U,F||(O(),F=!0),R=Q.handleDomNode,Y=Q.connection,w=Q.isValid,l({connectionPosition:x&&w?Gv({x:x.x,y:x.y},G):$,connectionStatus:ZN(!!x,w),connectionEndHandle:Q.endHandle}),!x&&!w&&!R)return gf(T);Y.source!==Y.target&&R&&(gf(T),T=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",w),R.classList.toggle("react-flow__handle-valid",w))}function b(L){(x||R)&&Y&&w&&r?.(Y),i().onConnectEnd?.(L),a&&u?.(L),gf(T),h(),cancelAnimationFrame(y),F=!1,w=!1,Y=null,R=null,c.removeEventListener("mousemove",V),c.removeEventListener("mouseup",b),c.removeEventListener("touchmove",V),c.removeEventListener("touchend",b)}c.addEventListener("mousemove",V),c.addEventListener("mouseup",b),c.addEventListener("touchmove",V),c.addEventListener("touchend",b)}var hv=()=>!0,QN=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),qN=(e,t,n)=>r=>{let{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:l}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:l?.nodeId===e&&l?.handleId===t&&l?.type===n}},Wv=(0,_.forwardRef)(({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:l,onConnect:s,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},m)=>{let v=l||null,g=e==="target",E=Be(),p=VN(),{connectOnClick:h,noPanClassName:y}=Ee(QN,Je),{connecting:x,clickConnecting:N}=Ee(qN(p,v,e),Je);p||E.getState().onError?.("010",bn.error010());let k=D=>{let{defaultEdgeOptions:T,onConnect:$,hasDefaultEdges:F}=E.getState(),Y={...T,...D};if(F){let{edges:w,setEdges:R}=E.getState();R(jN(Y,w))}$?.(Y),s?.(Y)},P=D=>{if(!p)return;let T=Ov(D);o&&(T&&D.button===0||!T)&&Xv({event:D,handleId:v,nodeId:p,onConnect:k,isTarget:g,getState:E.getState,setState:E.setState,isValidConnection:n||E.getState().isValidConnection||hv}),T?c?.(D):d?.(D)},I=D=>{let{onClickConnectStart:T,onClickConnectEnd:$,connectionClickStartHandle:F,connectionMode:Y,isValidConnection:w}=E.getState();if(!p||!F&&!o)return;if(!F){T?.(D,{nodeId:p,handleId:v,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:v}});return}let R=Dv(D.target),C=n||w||hv,{connection:O,isValid:V}=jv({nodeId:p,id:v,type:e},Y,F.nodeId,F.handleId||null,F.type,C,R);V&&k(O),$?.(D),E.setState({connectionClickStartHandle:null})};return _.default.createElement("div",{"data-handleid":v,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${v}-${e}`,className:qe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!g,target:g,connectable:r,connectablestart:o,connectableend:i,connecting:N,connectionindicator:r&&(o&&!x||i&&x)}]),onMouseDown:P,onTouchStart:P,onClick:h?I:void 0,ref:m,...f},a)});Wv.displayName="Handle";var to=(0,_.memo)(Wv),Kv=({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:r=J.Bottom})=>_.default.createElement(_.default.Fragment,null,_.default.createElement(to,{type:"target",position:n,isConnectable:t}),e?.label,_.default.createElement(to,{type:"source",position:r,isConnectable:t}));Kv.displayName="DefaultNode";var Cf=(0,_.memo)(Kv),Zv=({data:e,isConnectable:t,sourcePosition:n=J.Bottom})=>_.default.createElement(_.default.Fragment,null,e?.label,_.default.createElement(to,{type:"source",position:n,isConnectable:t}));Zv.displayName="InputNode";var Qv=(0,_.memo)(Zv),qv=({data:e,isConnectable:t,targetPosition:n=J.Top})=>_.default.createElement(_.default.Fragment,null,_.default.createElement(to,{type:"target",position:n,isConnectable:t}),e?.label);qv.displayName="OutputNode";var Jv=(0,_.memo)(qv),$f=()=>null;$f.displayName="GroupNode";var JN=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Wa=e=>e.id;function ek(e,t){return Je(e.selectedNodes.map(Wa),t.selectedNodes.map(Wa))&&Je(e.selectedEdges.map(Wa),t.selectedEdges.map(Wa))}var ex=(0,_.memo)(({onSelectionChange:e})=>{let t=Be(),{selectedNodes:n,selectedEdges:r}=Ee(JN,ek);return(0,_.useEffect)(()=>{let o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(i=>i(o))},[n,r,e]),null});ex.displayName="SelectionListener";var tk=e=>!!e.onSelectionChange;function nk({onSelectionChange:e}){let t=Ee(tk);return e||t?_.default.createElement(ex,{onSelectionChange:e}):null}var rk=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Uo(e,t){(0,_.useEffect)(()=>{typeof e<"u"&&t(e)},[e])}function ie(e,t,n){(0,_.useEffect)(()=>{typeof t<"u"&&n({[e]:t})},[t])}var ok=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:l,onClickConnectStart:s,onClickConnectEnd:a,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:v,minZoom:g,maxZoom:E,nodeExtent:p,onNodesChange:h,onEdgesChange:y,elementsSelectable:x,connectionMode:N,snapGrid:k,snapToGrid:P,translateExtent:I,connectOnClick:D,defaultEdgeOptions:T,fitView:$,fitViewOptions:F,onNodesDelete:Y,onEdgesDelete:w,onNodeDrag:R,onNodeDragStart:C,onNodeDragStop:O,onSelectionDrag:V,onSelectionDragStart:b,onSelectionDragStop:L,noPanClassName:G,nodeOrigin:U,rfId:Q,autoPanOnConnect:K,autoPanOnNodeDrag:ne,onError:ae,connectionRadius:te,isValidConnection:fe,nodeDragThreshold:oe})=>{let{setNodes:ue,setEdges:ft,setDefaultNodesAndEdges:Ue,setMinZoom:xt,setMaxZoom:be,setTranslateExtent:de,setNodeExtent:Fe,reset:pe}=Ee(rk,Je),ee=Be();return(0,_.useEffect)(()=>{let ge=r?.map(gn=>({...gn,...T}));return Ue(n,ge),()=>{pe()}},[]),ie("defaultEdgeOptions",T,ee.setState),ie("connectionMode",N,ee.setState),ie("onConnect",o,ee.setState),ie("onConnectStart",i,ee.setState),ie("onConnectEnd",l,ee.setState),ie("onClickConnectStart",s,ee.setState),ie("onClickConnectEnd",a,ee.setState),ie("nodesDraggable",u,ee.setState),ie("nodesConnectable",c,ee.setState),ie("nodesFocusable",d,ee.setState),ie("edgesFocusable",f,ee.setState),ie("edgesUpdatable",m,ee.setState),ie("elementsSelectable",x,ee.setState),ie("elevateNodesOnSelect",v,ee.setState),ie("snapToGrid",P,ee.setState),ie("snapGrid",k,ee.setState),ie("onNodesChange",h,ee.setState),ie("onEdgesChange",y,ee.setState),ie("connectOnClick",D,ee.setState),ie("fitViewOnInit",$,ee.setState),ie("fitViewOnInitOptions",F,ee.setState),ie("onNodesDelete",Y,ee.setState),ie("onEdgesDelete",w,ee.setState),ie("onNodeDrag",R,ee.setState),ie("onNodeDragStart",C,ee.setState),ie("onNodeDragStop",O,ee.setState),ie("onSelectionDrag",V,ee.setState),ie("onSelectionDragStart",b,ee.setState),ie("onSelectionDragStop",L,ee.setState),ie("noPanClassName",G,ee.setState),ie("nodeOrigin",U,ee.setState),ie("rfId",Q,ee.setState),ie("autoPanOnConnect",K,ee.setState),ie("autoPanOnNodeDrag",ne,ee.setState),ie("onError",ae,ee.setState),ie("connectionRadius",te,ee.setState),ie("isValidConnection",fe,ee.setState),ie("nodeDragThreshold",oe,ee.setState),Uo(e,ue),Uo(t,ft),Uo(g,xt),Uo(E,be),Uo(I,de),Uo(p,Fe),null},mv={display:"none"},ik={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},tx="react-flow__node-desc",nx="react-flow__edge-desc",lk="react-flow__aria-live",sk=e=>e.ariaLiveMessage;function ak({rfId:e}){let t=Ee(sk);return _.default.createElement("div",{id:`${lk}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ik},t)}function uk({rfId:e,disableKeyboardA11y:t}){return _.default.createElement(_.default.Fragment,null,_.default.createElement("div",{id:`${tx}-${e}`,style:mv},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),_.default.createElement("div",{id:`${nx}-${e}`,style:mv},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&_.default.createElement(ak,{rfId:e}))}var El=(e=null,t={actInsideInputWithModifier:!0})=>{let[n,r]=(0,_.useState)(!1),o=(0,_.useRef)(!1),i=(0,_.useRef)(new Set([])),[l,s]=(0,_.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return(0,_.useEffect)(()=>{let a=typeof document<"u"?document:null,u=t?.target||a;if(e!==null){let c=m=>{if(o.current=m.ctrlKey||m.metaKey||m.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&Sf(m))return!1;let g=yv(m.code,s);i.current.add(m[g]),gv(l,i.current,!1)&&(m.preventDefault(),r(!0))},d=m=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&Sf(m))return!1;let g=yv(m.code,s);gv(l,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[g]),m.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return u?.addEventListener("keydown",c),u?.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{u?.removeEventListener("keydown",c),u?.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function gv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function yv(e,t){return t.includes(e)?"code":"key"}function rx(e,t,n,r){let o=e.parentNode||e.parentId;if(!o)return n;let i=t.get(o),l=Zo(i,r);return rx(i,t,{x:(n.x??0)+l.x,y:(n.y??0)+l.y,z:(i[Re]?.z??0)>(n.z??0)?i[Re]?.z??0:n.z??0},r)}function ox(e,t,n){e.forEach(r=>{let o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){let{x:i,y:l,z:s}=rx(r,e,{...r.position,z:r[Re]?.z??0},t);r.positionAbsolute={x:i,y:l},r[Re].z=s,n?.[r.id]&&(r[Re].isParent=!0)}})}function yf(e,t,n,r){let o=new Map,i={},l=r?1e3:0;return e.forEach(s=>{let a=(Qt(s.zIndex)?s.zIndex:0)+(s.selected?l:0),u=t.get(s.id),c={...s,positionAbsolute:{x:s.position.x,y:s.position.y}},d=s.parentNode||s.parentId;d&&(i[d]=!0);let f=u?.type&&u?.type!==s.type;Object.defineProperty(c,Re,{enumerable:!1,value:{handleBounds:f?void 0:u?.[Re]?.handleBounds,z:a}}),o.set(s.id,c)}),ox(o,n,i),o}function ix(e,t={}){let{getNodes:n,width:r,height:o,minZoom:i,maxZoom:l,d3Zoom:s,d3Selection:a,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(s&&a&&(f||!t.initial)){let v=n().filter(E=>{let p=t.includeHiddenNodes?E.width&&E.height:!E.hidden;return t.nodes?.length?p&&t.nodes.some(h=>h.id===E.id):p}),g=v.every(E=>E.width&&E.height);if(v.length>0&&g){let E=Of(v,d),{x:p,y:h,zoom:y}=Yv(E,r,o,t.minZoom??i,t.maxZoom??l,t.padding??.1),x=Zt.translate(p,h).scale(y);return typeof t.duration=="number"&&t.duration>0?s.transform(qr(a,t.duration),x):s.transform(a,x),!0}}return!1}function ck(e,t){return e.forEach(n=>{let r=t.get(n.id);r&&t.set(r.id,{...r,[Re]:r[Re],selected:n.selected})}),new Map(t)}function dk(e,t){return t.map(n=>{let r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function Ka({changedNodes:e,changedEdges:t,get:n,set:r}){let{nodeInternals:o,edges:i,onNodesChange:l,onEdgesChange:s,hasDefaultNodes:a,hasDefaultEdges:u}=n();e?.length&&(a&&r({nodeInternals:ck(e,o)}),l?.(e)),t?.length&&(u&&r({edges:dk(t,i)}),s?.(t))}var jo=()=>{},fk={zoomIn:jo,zoomOut:jo,zoomTo:jo,getZoom:()=>1,setViewport:jo,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:jo,fitBounds:jo,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},pk=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),hk=()=>{let e=Be(),{d3Zoom:t,d3Selection:n}=Ee(pk,Je);return(0,_.useMemo)(()=>n&&t?{zoomIn:o=>t.scaleBy(qr(n,o?.duration),1.2),zoomOut:o=>t.scaleBy(qr(n,o?.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(qr(n,i?.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{let[l,s,a]=e.getState().transform,u=Zt.translate(o.x??l,o.y??s).scale(o.zoom??a);t.transform(qr(n,i?.duration),u)},getViewport:()=>{let[o,i,l]=e.getState().transform;return{x:o,y:i,zoom:l}},fitView:o=>ix(e.getState,o),setCenter:(o,i,l)=>{let{width:s,height:a,maxZoom:u}=e.getState(),c=typeof l?.zoom<"u"?l.zoom:u,d=s/2-o*c,f=a/2-i*c,m=Zt.translate(d,f).scale(c);t.transform(qr(n,l?.duration),m)},fitBounds:(o,i)=>{let{width:l,height:s,minZoom:a,maxZoom:u}=e.getState(),{x:c,y:d,zoom:f}=Yv(o,l,s,a,u,i?.padding??.1),m=Zt.translate(c,d).scale(f);t.transform(qr(n,i?.duration),m)},project:o=>{let{transform:i,snapToGrid:l,snapGrid:s}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),kf(o,i,l,s)},screenToFlowPosition:o=>{let{transform:i,snapToGrid:l,snapGrid:s,domNode:a}=e.getState();if(!a)return o;let{x:u,y:c}=a.getBoundingClientRect(),d={x:o.x-u,y:o.y-c};return kf(d,i,l,s)},flowToScreenPosition:o=>{let{transform:i,domNode:l}=e.getState();if(!l)return o;let{x:s,y:a}=l.getBoundingClientRect(),u=Gv(o,i);return{x:u.x+s,y:u.y+a}},viewportInitialized:!0}:fk,[t,n])};function kl(){let e=hk(),t=Be(),n=(0,_.useCallback)(()=>t.getState().getNodes().map(g=>({...g})),[]),r=(0,_.useCallback)(g=>t.getState().nodeInternals.get(g),[]),o=(0,_.useCallback)(()=>{let{edges:g=[]}=t.getState();return g.map(E=>({...E}))},[]),i=(0,_.useCallback)(g=>{let{edges:E=[]}=t.getState();return E.find(p=>p.id===g)},[]),l=(0,_.useCallback)(g=>{let{getNodes:E,setNodes:p,hasDefaultNodes:h,onNodesChange:y}=t.getState(),x=E(),N=typeof g=="function"?g(x):g;if(h)p(N);else if(y){let k=N.length===0?x.map(P=>({type:"remove",id:P.id})):N.map(P=>({item:P,type:"reset"}));y(k)}},[]),s=(0,_.useCallback)(g=>{let{edges:E=[],setEdges:p,hasDefaultEdges:h,onEdgesChange:y}=t.getState(),x=typeof g=="function"?g(E):g;if(h)p(x);else if(y){let N=x.length===0?E.map(k=>({type:"remove",id:k.id})):x.map(k=>({item:k,type:"reset"}));y(N)}},[]),a=(0,_.useCallback)(g=>{let E=Array.isArray(g)?g:[g],{getNodes:p,setNodes:h,hasDefaultNodes:y,onNodesChange:x}=t.getState();if(y){let k=[...p(),...E];h(k)}else if(x){let N=E.map(k=>({item:k,type:"add"}));x(N)}},[]),u=(0,_.useCallback)(g=>{let E=Array.isArray(g)?g:[g],{edges:p=[],setEdges:h,hasDefaultEdges:y,onEdgesChange:x}=t.getState();if(y)h([...p,...E]);else if(x){let N=E.map(k=>({item:k,type:"add"}));x(N)}},[]),c=(0,_.useCallback)(()=>{let{getNodes:g,edges:E=[],transform:p}=t.getState(),[h,y,x]=p;return{nodes:g().map(N=>({...N})),edges:E.map(N=>({...N})),viewport:{x:h,y,zoom:x}}},[]),d=(0,_.useCallback)(({nodes:g,edges:E})=>{let{nodeInternals:p,getNodes:h,edges:y,hasDefaultNodes:x,hasDefaultEdges:N,onNodesDelete:k,onEdgesDelete:P,onNodesChange:I,onEdgesChange:D}=t.getState(),T=(g||[]).map(R=>R.id),$=(E||[]).map(R=>R.id),F=h().reduce((R,C)=>{let O=C.parentNode||C.parentId,V=!T.includes(C.id)&&O&&R.find(L=>L.id===O);return(typeof C.deletable=="boolean"?C.deletable:!0)&&(T.includes(C.id)||V)&&R.push(C),R},[]),Y=y.filter(R=>typeof R.deletable=="boolean"?R.deletable:!0),w=Y.filter(R=>$.includes(R.id));if(F||w){let R=Bv(F,Y),C=[...w,...R],O=C.reduce((V,b)=>(V.includes(b.id)||V.push(b.id),V),[]);if((N||x)&&(N&&t.setState({edges:y.filter(V=>!O.includes(V.id))}),x&&(F.forEach(V=>{p.delete(V.id)}),t.setState({nodeInternals:new Map(p)}))),O.length>0&&(P?.(C),D&&D(O.map(V=>({id:V,type:"remove"})))),F.length>0&&(k?.(F),I)){let V=F.map(b=>({id:b.id,type:"remove"}));I(V)}}},[]),f=(0,_.useCallback)(g=>{let E=zN(g),p=E?null:t.getState().nodeInternals.get(g.id);return!E&&!p?[null,null,E]:[E?g:av(p),p,E]},[]),m=(0,_.useCallback)((g,E=!0,p)=>{let[h,y,x]=f(g);return h?(p||t.getState().getNodes()).filter(N=>{if(!x&&(N.id===y.id||!N.positionAbsolute))return!1;let k=av(N),P=_f(k,h);return E&&P>0||P>=h.width*h.height}):[]},[]),v=(0,_.useCallback)((g,E,p=!0)=>{let[h]=f(g);if(!h)return!1;let y=_f(h,E);return p&&y>0||y>=h.width*h.height},[]);return(0,_.useMemo)(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:l,setEdges:s,addNodes:a,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:m,isNodeIntersecting:v}),[e,n,r,o,i,l,s,a,u,c,d,m,v])}var mk={actInsideInputWithModifier:!1},gk=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{let n=Be(),{deleteElements:r}=kl(),o=El(e,mk),i=El(t);(0,_.useEffect)(()=>{if(o){let{edges:l,getNodes:s}=n.getState(),a=s().filter(c=>c.selected),u=l.filter(c=>c.selected);r({nodes:a,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),(0,_.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])};function yk(e){let t=Be();(0,_.useEffect)(()=>{let n,r=()=>{if(!e.current)return;let o=If(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",bn.error004()),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}var Ff={position:"absolute",width:"100%",height:"100%",top:0,left:0},vk=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Za=e=>({x:e.x,y:e.y,zoom:e.k}),Xo=(e,t)=>e.target.closest(`.${t}`),vv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),xv=e=>{let t=e.ctrlKey&&Qa()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},xk=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),wk=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:l=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Jr.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:m,minZoom:v,maxZoom:g,zoomActivationKeyCode:E,preventScrolling:p=!0,children:h,noWheelClassName:y,noPanClassName:x})=>{let N=(0,_.useRef)(),k=Be(),P=(0,_.useRef)(!1),I=(0,_.useRef)(!1),D=(0,_.useRef)(null),T=(0,_.useRef)({x:0,y:0,zoom:0}),{d3Zoom:$,d3Selection:F,d3ZoomHandler:Y,userSelectionActive:w}=Ee(xk,Je),R=El(E),C=(0,_.useRef)(0),O=(0,_.useRef)(!1),V=(0,_.useRef)();return yk(D),(0,_.useEffect)(()=>{if(D.current){let b=D.current.getBoundingClientRect(),L=mf().scaleExtent([v,g]).translateExtent(m),G=ut(D.current).call(L),U=Zt.translate(f.x,f.y).scale(qo(f.zoom,v,g)),Q=[[0,0],[b.width,b.height]],K=L.constrain()(U,Q,m);L.transform(G,K),L.wheelDelta(xv),k.setState({d3Zoom:L,d3Selection:G,d3ZoomHandler:G.on("wheel.zoom"),transform:[K.x,K.y,K.k],domNode:D.current.closest(".react-flow")})}},[]),(0,_.useEffect)(()=>{F&&$&&(l&&!R&&!w?F.on("wheel.zoom",b=>{if(Xo(b,y))return!1;b.preventDefault(),b.stopImmediatePropagation();let L=F.property("__zoom").k||1;if(b.ctrlKey&&i){let fe=bt(b),oe=xv(b),ue=L*Math.pow(2,oe);$.scaleTo(F,ue,fe,b);return}let G=b.deltaMode===1?20:1,U=a===Jr.Vertical?0:b.deltaX*G,Q=a===Jr.Horizontal?0:b.deltaY*G;!Qa()&&b.shiftKey&&a!==Jr.Vertical&&(U=b.deltaY*G,Q=0),$.translateBy(F,-(U/L)*s,-(Q/L)*s,{internal:!0});let K=Za(F.property("__zoom")),{onViewportChangeStart:ne,onViewportChange:ae,onViewportChangeEnd:te}=k.getState();clearTimeout(V.current),O.current||(O.current=!0,t?.(b,K),ne?.(K)),O.current&&(e?.(b,K),ae?.(K),V.current=setTimeout(()=>{n?.(b,K),te?.(K),O.current=!1},150))},{passive:!1}):typeof Y<"u"&&F.on("wheel.zoom",function(b,L){if(!p&&b.type==="wheel"&&!b.ctrlKey||Xo(b,y))return null;b.preventDefault(),Y.call(this,b,L)},{passive:!1}))},[w,l,a,F,$,Y,R,i,p,y,t,e,n]),(0,_.useEffect)(()=>{$&&$.on("start",b=>{if(!b.sourceEvent||b.sourceEvent.internal)return null;C.current=b.sourceEvent?.button;let{onViewportChangeStart:L}=k.getState(),G=Za(b.transform);P.current=!0,T.current=G,b.sourceEvent?.type==="mousedown"&&k.setState({paneDragging:!0}),L?.(G),t?.(b.sourceEvent,G)})},[$,t]),(0,_.useEffect)(()=>{$&&(w&&!P.current?$.on("zoom",null):w||$.on("zoom",b=>{let{onViewportChange:L}=k.getState();if(k.setState({transform:[b.transform.x,b.transform.y,b.transform.k]}),I.current=!!(r&&vv(d,C.current??0)),(e||L)&&!b.sourceEvent?.internal){let G=Za(b.transform);L?.(G),e?.(b.sourceEvent,G)}}))},[w,$,e,d,r]),(0,_.useEffect)(()=>{$&&$.on("end",b=>{if(!b.sourceEvent||b.sourceEvent.internal)return null;let{onViewportChangeEnd:L}=k.getState();if(P.current=!1,k.setState({paneDragging:!1}),r&&vv(d,C.current??0)&&!I.current&&r(b.sourceEvent),I.current=!1,(n||L)&&vk(T.current,b.transform)){let G=Za(b.transform);T.current=G,clearTimeout(N.current),N.current=setTimeout(()=>{L?.(G),n?.(b.sourceEvent,G)},l?150:0)}})},[$,l,d,n,r]),(0,_.useEffect)(()=>{$&&$.filter(b=>{let L=R||o,G=i&&b.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&b.button===1&&b.type==="mousedown"&&(Xo(b,"react-flow__node")||Xo(b,"react-flow__edge")))return!0;if(!d&&!L&&!l&&!u&&!i||w||!u&&b.type==="dblclick"||Xo(b,y)&&b.type==="wheel"||Xo(b,x)&&(b.type!=="wheel"||l&&b.type==="wheel"&&!R)||!i&&b.ctrlKey&&b.type==="wheel"||!L&&!l&&!G&&b.type==="wheel"||!d&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(d)&&!d.includes(b.button)&&b.type==="mousedown")return!1;let U=Array.isArray(d)&&d.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||b.type==="wheel")&&U})},[w,$,o,i,l,u,d,c,R]),_.default.createElement("div",{className:"react-flow__renderer",ref:D,style:Ff},h)},_k=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Sk(){let{userSelectionActive:e,userSelectionRect:t}=Ee(_k,Je);return e&&t?_.default.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function wv(e,t){let n=t.parentNode||t.parentId,r=e.find(o=>o.id===n);if(r){let o=t.position.x+t.width-r.width,i=t.position.y+t.height-r.height;if(o>0||i>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,o>0&&(r.style.width+=o),i>0&&(r.style.height+=i),t.position.x<0){let l=Math.abs(t.position.x);r.position.x=r.position.x-l,r.style.width+=l,t.position.x=0}if(t.position.y<0){let l=Math.abs(t.position.y);r.position.y=r.position.y-l,r.style.height+=l,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function lx(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);let n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{let i=e.filter(s=>s.id===o.id);if(i.length===0)return r.push(o),r;let l={...o};for(let s of i)if(s)switch(s.type){case"select":{l.selected=s.selected;break}case"position":{typeof s.position<"u"&&(l.position=s.position),typeof s.positionAbsolute<"u"&&(l.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(l.dragging=s.dragging),l.expandParent&&wv(r,l);break}case"dimensions":{typeof s.dimensions<"u"&&(l.width=s.dimensions.width,l.height=s.dimensions.height),typeof s.updateStyle<"u"&&(l.style={...l.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(l.resizing=s.resizing),l.expandParent&&wv(r,l);break}case"remove":return r}return r.push(l),r},n)}function sx(e,t){return lx(e,t)}function Ek(e,t){return lx(e,t)}var Sr=(e,t)=>({id:e,type:"select",selected:t});function Ko(e,t){return e.reduce((n,r)=>{let o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Sr(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Sr(r.id,!1))),n},[])}var vf=(e,t)=>n=>{n.target===t.current&&e?.(n)},Nk=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ax=(0,_.memo)(({isSelecting:e,selectionMode:t=Sl.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:l,onPaneScroll:s,onPaneMouseEnter:a,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{let f=(0,_.useRef)(null),m=Be(),v=(0,_.useRef)(0),g=(0,_.useRef)(0),E=(0,_.useRef)(),{userSelectionActive:p,elementsSelectable:h,dragging:y}=Ee(Nk,Je),x=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,g.current=0},N=Y=>{i?.(Y),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},k=Y=>{if(Array.isArray(n)&&n?.includes(2)){Y.preventDefault();return}l?.(Y)},P=s?Y=>s(Y):void 0,I=Y=>{let{resetSelectedElements:w,domNode:R}=m.getState();if(E.current=R?.getBoundingClientRect(),!h||!e||Y.button!==0||Y.target!==f.current||!E.current)return;let{x:C,y:O}=Nr(Y,E.current);w(),m.setState({userSelectionRect:{width:0,height:0,startX:C,startY:O,x:C,y:O}}),r?.(Y)},D=Y=>{let{userSelectionRect:w,nodeInternals:R,edges:C,transform:O,onNodesChange:V,onEdgesChange:b,nodeOrigin:L,getNodes:G}=m.getState();if(!e||!E.current||!w)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});let U=Nr(Y,E.current),Q=w.startX??0,K=w.startY??0,ne={...w,x:U.x<Q?U.x:Q,y:U.y<K?U.y:K,width:Math.abs(U.x-Q),height:Math.abs(U.y-K)},ae=G(),te=Vv(R,ne,O,t===Sl.Partial,!0,L),fe=Bv(te,C).map(ue=>ue.id),oe=te.map(ue=>ue.id);if(v.current!==oe.length){v.current=oe.length;let ue=Ko(ae,oe);ue.length&&V?.(ue)}if(g.current!==fe.length){g.current=fe.length;let ue=Ko(C,fe);ue.length&&b?.(ue)}m.setState({userSelectionRect:ne})},T=Y=>{if(Y.button!==0)return;let{userSelectionRect:w}=m.getState();!p&&w&&Y.target===f.current&&N?.(Y),m.setState({nodesSelectionActive:v.current>0}),x(),o?.(Y)},$=Y=>{p&&(m.setState({nodesSelectionActive:v.current>0}),o?.(Y)),x()},F=h&&(e||p);return _.default.createElement("div",{className:qe(["react-flow__pane",{dragging:y,selection:e}]),onClick:F?void 0:vf(N,f),onContextMenu:vf(k,f),onWheel:vf(P,f),onMouseEnter:F?void 0:a,onMouseDown:F?I:void 0,onMouseMove:F?D:u,onMouseUp:F?T:void 0,onMouseLeave:F?$:c,ref:f,style:Ff},d,_.default.createElement(Sk,null))});ax.displayName="Pane";function ux(e,t){let n=e.parentNode||e.parentId;if(!n)return!1;let r=t.get(n);return r?r.selected?!0:ux(r,t):!1}function _v(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function kk(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||o.parentId||!ux(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>({id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(o.positionAbsolute?.x??0),y:n.y-(o.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}))}function Ck(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function cx(e,t,n,r,o=[0,0],i){let l=Ck(e,e.extent||r),s=l,a=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(a&&e.width&&e.height){let d=n.get(a),{x:f,y:m}=Zo(d,o).positionAbsolute;s=d&&Qt(f)&&Qt(m)&&Qt(d.width)&&Qt(d.height)?[[f+e.width*o[0],m+e.height*o[1]],[f+d.width-e.width+e.width*o[0],m+d.height-e.height+e.height*o[1]]]:s}else i?.("005",bn.error005()),s=l;else if(e.extent&&a&&e.extent!=="parent"){let d=n.get(a),{x:f,y:m}=Zo(d,o).positionAbsolute;s=[[e.extent[0][0]+f,e.extent[0][1]+m],[e.extent[1][0]+f,e.extent[1][1]+m]]}let u={x:0,y:0};if(a){let d=n.get(a);u=Zo(d,o).positionAbsolute}let c=s&&s!=="parent"?Mf(t,s):t;return{position:{x:c.x-u.x,y:c.y-u.y},positionAbsolute:c}}function xf({nodeId:e,dragItems:t,nodeInternals:n}){let r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}var Sv=(e,t,n,r)=>{let o=t.querySelectorAll(e);if(!o||!o.length)return null;let i=Array.from(o),l=t.getBoundingClientRect(),s={x:l.width*r[0],y:l.height*r[1]};return i.map(a=>{let u=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(u.left-l.left-s.x)/n,y:(u.top-l.top-s.y)/n,...If(a)}})};function wl(e,t,n){return n===void 0?n:r=>{let o=t().nodeInternals.get(e);o&&n(r,{...o})}}function bf({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:l,nodeInternals:s,onError:a}=t.getState(),u=s.get(e);if(!u){a?.("012",bn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])}function bk(){let e=Be();return(0,_.useCallback)(({sourceEvent:n})=>{let{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),l=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,a={x:(l-r[0])/r[2],y:(s-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:i?o[1]*Math.round(a.y/o[1]):a.y,...a}},[])}function wf(e){return(t,n,r)=>e?.(t,r)}function dx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:l}){let s=Be(),[a,u]=(0,_.useState)(!1),c=(0,_.useRef)([]),d=(0,_.useRef)({x:null,y:null}),f=(0,_.useRef)(0),m=(0,_.useRef)(null),v=(0,_.useRef)({x:0,y:0}),g=(0,_.useRef)(null),E=(0,_.useRef)(!1),p=(0,_.useRef)(!1),h=(0,_.useRef)(!1),y=bk();return(0,_.useEffect)(()=>{if(e?.current){let x=ut(e.current),N=({x:I,y:D})=>{let{nodeInternals:T,onNodeDrag:$,onSelectionDrag:F,updateNodePositions:Y,nodeExtent:w,snapGrid:R,snapToGrid:C,nodeOrigin:O,onError:V}=s.getState();d.current={x:I,y:D};let b=!1,L={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&w){let U=Of(c.current,O);L=Rf(U)}if(c.current=c.current.map(U=>{let Q={x:I-U.distance.x,y:D-U.distance.y};C&&(Q.x=R[0]*Math.round(Q.x/R[0]),Q.y=R[1]*Math.round(Q.y/R[1]));let K=[[w[0][0],w[0][1]],[w[1][0],w[1][1]]];c.current.length>1&&w&&!U.extent&&(K[0][0]=U.positionAbsolute.x-L.x+w[0][0],K[1][0]=U.positionAbsolute.x+(U.width??0)-L.x2+w[1][0],K[0][1]=U.positionAbsolute.y-L.y+w[0][1],K[1][1]=U.positionAbsolute.y+(U.height??0)-L.y2+w[1][1]);let ne=cx(U,Q,T,K,O,V);return b=b||U.position.x!==ne.position.x||U.position.y!==ne.position.y,U.position=ne.position,U.positionAbsolute=ne.positionAbsolute,U}),!b)return;Y(c.current,!0,!0),u(!0);let G=o?$:wf(F);if(G&&g.current){let[U,Q]=xf({nodeId:o,dragItems:c.current,nodeInternals:T});G(g.current,U,Q)}},k=()=>{if(!m.current)return;let[I,D]=Av(v.current,m.current);if(I!==0||D!==0){let{transform:T,panBy:$}=s.getState();d.current.x=(d.current.x??0)-I/T[2],d.current.y=(d.current.y??0)-D/T[2],$({x:I,y:D})&&N(d.current)}f.current=requestAnimationFrame(k)},P=I=>{let{nodeInternals:D,multiSelectionActive:T,nodesDraggable:$,unselectNodesAndEdges:F,onNodeDragStart:Y,onSelectionDragStart:w}=s.getState();p.current=!0;let R=o?Y:wf(w);(!l||!i)&&!T&&o&&(D.get(o)?.selected||F()),o&&i&&l&&bf({id:o,store:s,nodeRef:e});let C=y(I);if(d.current=C,c.current=kk(D,$,C,o),R&&c.current){let[O,V]=xf({nodeId:o,dragItems:c.current,nodeInternals:D});R(I.sourceEvent,O,V)}};if(t)x.on(".drag",null);else{let I=Jd().on("start",D=>{let{domNode:T,nodeDragThreshold:$}=s.getState();$===0&&P(D),h.current=!1;let F=y(D);d.current=F,m.current=T?.getBoundingClientRect()||null,v.current=Nr(D.sourceEvent,m.current)}).on("drag",D=>{let T=y(D),{autoPanOnNodeDrag:$,nodeDragThreshold:F}=s.getState();if(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1&&(h.current=!0),!h.current){if(!E.current&&p.current&&$&&(E.current=!0,k()),!p.current){let Y=T.xSnapped-(d?.current?.x??0),w=T.ySnapped-(d?.current?.y??0);Math.sqrt(Y*Y+w*w)>F&&P(D)}(d.current.x!==T.xSnapped||d.current.y!==T.ySnapped)&&c.current&&p.current&&(g.current=D.sourceEvent,v.current=Nr(D.sourceEvent,m.current),N(T))}}).on("end",D=>{if(!(!p.current||h.current)&&(u(!1),E.current=!1,p.current=!1,cancelAnimationFrame(f.current),c.current)){let{updateNodePositions:T,nodeInternals:$,onNodeDragStop:F,onSelectionDragStop:Y}=s.getState(),w=o?F:wf(Y);if(T(c.current,!1,!1),w){let[R,C]=xf({nodeId:o,dragItems:c.current,nodeInternals:$});w(D.sourceEvent,R,C)}}}).filter(D=>{let T=D.target;return!D.button&&(!n||!_v(T,`.${n}`,e))&&(!r||_v(T,r,e))});return x.call(I),()=>{x.on(".drag",null)}}}},[e,t,n,r,i,s,o,l,y]),a}function fx(){let e=Be();return(0,_.useCallback)(n=>{let{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:l,snapToGrid:s,snapGrid:a,onError:u,nodesDraggable:c}=e.getState(),d=l().filter(h=>h.selected&&(h.draggable||c&&typeof h.draggable>"u")),f=s?a[0]:5,m=s?a[1]:5,v=n.isShiftPressed?4:1,g=n.x*f*v,E=n.y*m*v,p=d.map(h=>{if(h.positionAbsolute){let y={x:h.positionAbsolute.x+g,y:h.positionAbsolute.y+E};s&&(y.x=a[0]*Math.round(y.x/a[0]),y.y=a[1]*Math.round(y.y/a[1]));let{positionAbsolute:x,position:N}=cx(h,y,r,o,void 0,u);h.position=N,h.positionAbsolute=x}return h});i(p,!0,!1)},[])}var Qo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},_l=e=>{let t=({id:n,type:r,data:o,xPos:i,yPos:l,xPosOrigin:s,yPosOrigin:a,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:m,onContextMenu:v,onDoubleClick:g,style:E,className:p,isDraggable:h,isSelectable:y,isConnectable:x,isFocusable:N,selectNodesOnDrag:k,sourcePosition:P,targetPosition:I,hidden:D,resizeObserver:T,dragHandle:$,zIndex:F,isParent:Y,noDragClassName:w,noPanClassName:R,initialized:C,disableKeyboardA11y:O,ariaLabel:V,rfId:b,hasHandleBounds:L})=>{let G=Be(),U=(0,_.useRef)(null),Q=(0,_.useRef)(null),K=(0,_.useRef)(P),ne=(0,_.useRef)(I),ae=(0,_.useRef)(r),te=y||h||c||d||f||m,fe=fx(),oe=wl(n,G.getState,d),ue=wl(n,G.getState,f),ft=wl(n,G.getState,m),Ue=wl(n,G.getState,v),xt=wl(n,G.getState,g),be=pe=>{let{nodeDragThreshold:ee}=G.getState();if(y&&(!k||!h||ee>0)&&bf({id:n,store:G,nodeRef:U}),c){let ge=G.getState().nodeInternals.get(n);ge&&c(pe,{...ge})}},de=pe=>{if(!Sf(pe)&&!O)if(Tv.includes(pe.key)&&y){let ee=pe.key==="Escape";bf({id:n,store:G,unselect:ee,nodeRef:U})}else h&&u&&Object.prototype.hasOwnProperty.call(Qo,pe.key)&&(G.setState({ariaLiveMessage:`Moved selected node ${pe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~l}`}),fe({x:Qo[pe.key].x,y:Qo[pe.key].y,isShiftPressed:pe.shiftKey}))};(0,_.useEffect)(()=>()=>{Q.current&&(T?.unobserve(Q.current),Q.current=null)},[]),(0,_.useEffect)(()=>{if(U.current&&!D){let pe=U.current;(!C||!L||Q.current!==pe)&&(Q.current&&T?.unobserve(Q.current),T?.observe(pe),Q.current=pe)}},[D,C,L]),(0,_.useEffect)(()=>{let pe=ae.current!==r,ee=K.current!==P,ge=ne.current!==I;U.current&&(pe||ee||ge)&&(pe&&(ae.current=r),ee&&(K.current=P),ge&&(ne.current=I),G.getState().updateNodeDimensions([{id:n,nodeElement:U.current,forceUpdate:!0}]))},[n,r,P,I]);let Fe=dx({nodeRef:U,disabled:D||!h,noDragClassName:w,handleSelector:$,nodeId:n,isSelectable:y,selectNodesOnDrag:k});return D?null:_.default.createElement("div",{className:qe(["react-flow__node",`react-flow__node-${r}`,{[R]:h},p,{selected:u,selectable:y,parent:Y,dragging:Fe}]),ref:U,style:{zIndex:F,transform:`translate(${s}px,${a}px)`,pointerEvents:te?"all":"none",visibility:C?"visible":"hidden",...E},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:oe,onMouseMove:ue,onMouseLeave:ft,onContextMenu:Ue,onClick:be,onDoubleClick:xt,onKeyDown:N?de:void 0,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-describedby":O?void 0:`${tx}-${b}`,"aria-label":V},_.default.createElement(GN,{value:n},_.default.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:l,selected:u,isConnectable:x,sourcePosition:P,targetPosition:I,dragging:Fe,dragHandle:$,zIndex:F})))};return t.displayName="NodeWrapper",(0,_.memo)(t)},Pk=e=>{let t=e.getNodes().filter(n=>n.selected);return{...Of(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Ik({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Be(),{width:o,height:i,x:l,y:s,transformString:a,userSelectionActive:u}=Ee(Pk,Je),c=fx(),d=(0,_.useRef)(null);if((0,_.useEffect)(()=>{n||d.current?.focus({preventScroll:!0})},[n]),dx({nodeRef:d}),u||!o||!i)return null;let f=e?v=>{let g=r.getState().getNodes().filter(E=>E.selected);e(v,g)}:void 0,m=v=>{Object.prototype.hasOwnProperty.call(Qo,v.key)&&c({x:Qo[v.key].x,y:Qo[v.key].y,isShiftPressed:v.shiftKey})};return _.default.createElement("div",{className:qe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a}},_.default.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:o,height:i,top:s,left:l}}))}var Mk=(0,_.memo)(Ik),Rk=e=>e.nodesSelectionActive,px=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,deleteKeyCode:s,onMove:a,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:m,onSelectionStart:v,onSelectionEnd:g,multiSelectionKeyCode:E,panActivationKeyCode:p,zoomActivationKeyCode:h,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:N,panOnScroll:k,panOnScrollSpeed:P,panOnScrollMode:I,zoomOnDoubleClick:D,panOnDrag:T,defaultViewport:$,translateExtent:F,minZoom:Y,maxZoom:w,preventScrolling:R,onSelectionContextMenu:C,noWheelClassName:O,noPanClassName:V,disableKeyboardA11y:b})=>{let L=Ee(Rk),G=El(d),U=El(p),Q=U||T,K=U||k,ne=G||f&&Q!==!0;return gk({deleteKeyCode:s,multiSelectionKeyCode:E}),_.default.createElement(wk,{onMove:a,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:N,panOnScroll:K,panOnScrollSpeed:P,panOnScrollMode:I,zoomOnDoubleClick:D,panOnDrag:!G&&Q,defaultViewport:$,translateExtent:F,minZoom:Y,maxZoom:w,zoomActivationKeyCode:h,preventScrolling:R,noWheelClassName:O,noPanClassName:V},_.default.createElement(ax,{onSelectionStart:v,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:Q,isSelecting:!!ne,selectionMode:m},e,L&&_.default.createElement(Mk,{onSelectionContextMenu:C,noPanClassName:V,disableKeyboardA11y:b})))};px.displayName="FlowRenderer";var Ak=(0,_.memo)(px);function Dk(e){return Ee((0,_.useCallback)(n=>e?Vv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Tk(e){let t={input:_l(e.input||Qv),default:_l(e.default||Cf),output:_l(e.output||Jv),group:_l(e.group||$f)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=_l(e[i]||Cf),o),n);return{...t,...r}}var zk=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},Ok=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),hx=e=>{let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:l}=Ee(Ok,Je),s=Dk(e.onlyRenderVisibleElements),a=(0,_.useRef)(),u=(0,_.useMemo)(()=>{if(typeof ResizeObserver>"u")return null;let c=new ResizeObserver(d=>{let f=d.map(m=>({id:m.target.getAttribute("data-id"),nodeElement:m.target,forceUpdate:!0}));i(f)});return a.current=c,c},[]);return(0,_.useEffect)(()=>()=>{a?.current?.disconnect()},[]),_.default.createElement("div",{className:"react-flow__nodes",style:Ff},s.map(c=>{let d=c.type||"default";e.nodeTypes[d]||(l?.("003",bn.error003(d)),d="default");let f=e.nodeTypes[d]||e.nodeTypes.default,m=!!(c.draggable||t&&typeof c.draggable>"u"),v=!!(c.selectable||o&&typeof c.selectable>"u"),g=!!(c.connectable||n&&typeof c.connectable>"u"),E=!!(c.focusable||r&&typeof c.focusable>"u"),p=e.nodeExtent?Mf(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,h=p?.x??0,y=p?.y??0,x=zk({x:h,y,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return _.default.createElement(f,{key:c.id,id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||J.Bottom,targetPosition:c.targetPosition||J.Top,hidden:c.hidden,xPos:h,yPos:y,xPosOrigin:x.x,yPosOrigin:x.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:m,isSelectable:v,isConnectable:g,isFocusable:E,resizeObserver:u,dragHandle:c.dragHandle,zIndex:c[Re]?.z??0,isParent:!!c[Re]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel,hasHandleBounds:!!c[Re]?.handleBounds})}))};hx.displayName="NodeRenderer";var Lk=(0,_.memo)(hx),$k=(e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,Fk=(e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,Ev="react-flow__edgeupdater",Nv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:l,type:s})=>_.default.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:l,className:qe([Ev,`${Ev}-${s}`]),cx:$k(t,r,e),cy:Fk(n,r,e),r,stroke:"transparent",fill:"transparent"}),Hk=()=>!0,Wo=e=>{let t=({id:n,className:r,type:o,data:i,onClick:l,onEdgeDoubleClick:s,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:g,style:E,source:p,target:h,sourceX:y,sourceY:x,targetX:N,targetY:k,sourcePosition:P,targetPosition:I,elementsSelectable:D,hidden:T,sourceHandleId:$,targetHandleId:F,onContextMenu:Y,onMouseEnter:w,onMouseMove:R,onMouseLeave:C,reconnectRadius:O,onReconnect:V,onReconnectStart:b,onReconnectEnd:L,markerEnd:G,markerStart:U,rfId:Q,ariaLabel:K,isFocusable:ne,isReconnectable:ae,pathOptions:te,interactionWidth:fe,disableKeyboardA11y:oe})=>{let ue=(0,_.useRef)(null),[ft,Ue]=(0,_.useState)(!1),[xt,be]=(0,_.useState)(!1),de=Be(),Fe=(0,_.useMemo)(()=>`url('#${Nf(U,Q)}')`,[U,Q]),pe=(0,_.useMemo)(()=>`url('#${Nf(G,Q)}')`,[G,Q]);if(T)return null;let ee=De=>{let{edges:He,addSelectedEdges:Jt,unselectNodesAndEdges:wt,multiSelectionActive:en}=de.getState(),tt=He.find(tn=>tn.id===n);tt&&(D&&(de.setState({nodesSelectionActive:!1}),tt.selected&&en?(wt({nodes:[],edges:[tt]}),ue.current?.blur()):Jt([n])),l&&l(De,tt))},ge=xl(n,de.getState,s),gn=xl(n,de.getState,Y),jn=xl(n,de.getState,w),Pn=xl(n,de.getState,R),yn=xl(n,de.getState,C),Mt=(De,He)=>{if(De.button!==0)return;let{edges:Jt,isValidConnection:wt}=de.getState(),en=He?h:p,tt=(He?F:$)||null,tn=He?"target":"source",oi=wt||Hk,Pr=He,At=Jt.find(vn=>vn.id===n);be(!0),b?.(De,At,tn);let lo=vn=>{be(!1),L?.(vn,At,tn)};Xv({event:De,handleId:tt,nodeId:en,onConnect:vn=>V?.(At,vn),isTarget:Pr,getState:de.getState,setState:de.setState,isValidConnection:oi,edgeUpdaterType:tn,onReconnectEnd:lo})},Xn=De=>Mt(De,!0),je=De=>Mt(De,!1),Pe=()=>Ue(!0),Xe=()=>Ue(!1),In=!D&&!l,Rt=De=>{if(!oe&&Tv.includes(De.key)&&D){let{unselectNodesAndEdges:He,addSelectedEdges:Jt,edges:wt}=de.getState();De.key==="Escape"?(ue.current?.blur(),He({edges:[wt.find(tt=>tt.id===n)]})):Jt([n])}};return _.default.createElement("g",{className:qe(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:a,animated:u,inactive:In,updating:ft}]),onClick:ee,onDoubleClick:ge,onContextMenu:gn,onMouseEnter:jn,onMouseMove:Pn,onMouseLeave:yn,onKeyDown:ne?Rt:void 0,tabIndex:ne?0:void 0,role:ne?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":K===null?void 0:K||`Edge from ${p} to ${h}`,"aria-describedby":ne?`${nx}-${Q}`:void 0,ref:ue},!xt&&_.default.createElement(e,{id:n,source:p,target:h,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:g,data:i,style:E,sourceX:y,sourceY:x,targetX:N,targetY:k,sourcePosition:P,targetPosition:I,sourceHandleId:$,targetHandleId:F,markerStart:Fe,markerEnd:pe,pathOptions:te,interactionWidth:fe}),ae&&_.default.createElement(_.default.Fragment,null,(ae==="source"||ae===!0)&&_.default.createElement(Nv,{position:P,centerX:y,centerY:x,radius:O,onMouseDown:Xn,onMouseEnter:Pe,onMouseOut:Xe,type:"source"}),(ae==="target"||ae===!0)&&_.default.createElement(Nv,{position:I,centerX:N,centerY:k,radius:O,onMouseDown:je,onMouseEnter:Pe,onMouseOut:Xe,type:"target"})))};return t.displayName="EdgeWrapper",(0,_.memo)(t)};function Gk(e){let t={default:Wo(e.default||Ja),straight:Wo(e.bezier||Tf),step:Wo(e.step||Df),smoothstep:Wo(e.step||tu),simplebezier:Wo(e.simplebezier||Af)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Wo(e[i]||Ja),o),n);return{...t,...r}}function kv(e,t,n=null){let r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,l=n?.height||t.height;switch(e){case J.Top:return{x:r+i/2,y:o};case J.Right:return{x:r+i,y:o+l/2};case J.Bottom:return{x:r+i/2,y:o+l};case J.Left:return{x:r,y:o+l/2}}}function Cv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}var Vk=(e,t,n,r,o,i)=>{let l=kv(n,e,t),s=kv(i,r,o);return{sourceX:l.x,sourceY:l.y,targetX:s.x,targetY:s.y}};function Bk({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:l,height:s,transform:a}){let u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);let c=Rf({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:l/a[2],height:s/a[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function bv(e){let t=e?.[Re]?.handleBounds||null,n=t&&e?.width&&e?.height&&typeof e?.positionAbsolute?.x<"u"&&typeof e?.positionAbsolute?.y<"u";return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}var Yk=[{level:0,isMaxLevel:!0,edges:[]}];function Uk(e,t,n=!1){let r=-1,o=e.reduce((l,s)=>{let a=Qt(s.zIndex),u=a?s.zIndex:0;if(n){let c=t.get(s.target),d=t.get(s.source),f=s.selected||c?.selected||d?.selected,m=Math.max(d?.[Re]?.z||0,c?.[Re]?.z||0,1e3);u=(a?s.zIndex:0)+(f?m:0)}return l[u]?l[u].push(s):l[u]=[s],r=u>r?u:r,l},{}),i=Object.entries(o).map(([l,s])=>{let a=+l;return{edges:s,level:a,isMaxLevel:a===r}});return i.length===0?Yk:i}function jk(e,t,n){let r=Ee((0,_.useCallback)(o=>e?o.edges.filter(i=>{let l=t.get(i.source),s=t.get(i.target);return l?.width&&l?.height&&s?.width&&s?.height&&Bk({sourcePos:l.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:l.width,sourceHeight:l.height,targetWidth:s.width,targetHeight:s.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return Uk(r,t,n)}var Xk=({color:e="none",strokeWidth:t=1})=>_.default.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Wk=({color:e="none",strokeWidth:t=1})=>_.default.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Pv={[qa.Arrow]:Xk,[qa.ArrowClosed]:Wk};function Kk(e){let t=Be();return(0,_.useMemo)(()=>Object.prototype.hasOwnProperty.call(Pv,e)?Pv[e]:(t.getState().onError?.("009",bn.error009(e)),null),[e])}var Zk=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:s="auto-start-reverse"})=>{let a=Kk(t);return a?_.default.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:s,refX:"0",refY:"0"},_.default.createElement(a,{color:n,strokeWidth:l})):null},Qk=({defaultColor:e,rfId:t})=>n=>{let r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(l=>{if(l&&typeof l=="object"){let s=Nf(l,t);r.includes(s)||(o.push({id:s,color:l.color||e,...l}),r.push(s))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},mx=({defaultColor:e,rfId:t})=>{let n=Ee((0,_.useCallback)(Qk({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,l)=>i.id!==o[l].id)));return _.default.createElement("defs",null,n.map(r=>_.default.createElement(Zk,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};mx.displayName="MarkerDefinitions";var qk=(0,_.memo)(mx),Jk=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),gx=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:l,onEdgeMouseEnter:s,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,onEdgeDoubleClick:d,onReconnect:f,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:g,children:E,disableKeyboardA11y:p})=>{let{edgesFocusable:h,edgesUpdatable:y,elementsSelectable:x,width:N,height:k,connectionMode:P,nodeInternals:I,onError:D}=Ee(Jk,Je),T=jk(t,I,n);return N?_.default.createElement(_.default.Fragment,null,T.map(({level:$,edges:F,isMaxLevel:Y})=>_.default.createElement("svg",{key:$,style:{zIndex:$},width:N,height:k,className:"react-flow__edges react-flow__container"},Y&&_.default.createElement(qk,{defaultColor:e,rfId:r}),_.default.createElement("g",null,F.map(w=>{let[R,C,O]=bv(I.get(w.source)),[V,b,L]=bv(I.get(w.target));if(!O||!L)return null;let G=w.type||"default";o[G]||(D?.("011",bn.error011(G)),G="default");let U=o[G]||o.default,Q=P===eo.Strict?b.target:(b.target??[]).concat(b.source??[]),K=Cv(C.source,w.sourceHandle),ne=Cv(Q,w.targetHandle),ae=K?.position||J.Bottom,te=ne?.position||J.Top,fe=!!(w.focusable||h&&typeof w.focusable>"u"),oe=w.reconnectable||w.updatable,ue=typeof f<"u"&&(oe||y&&typeof oe>"u");if(!K||!ne)return D?.("008",bn.error008(K,w)),null;let{sourceX:ft,sourceY:Ue,targetX:xt,targetY:be}=Vk(R,K,ae,V,ne,te);return _.default.createElement(U,{key:w.id,id:w.id,className:qe([w.className,i]),type:G,data:w.data,selected:!!w.selected,animated:!!w.animated,hidden:!!w.hidden,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,style:w.style,source:w.source,target:w.target,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerEnd:w.markerEnd,markerStart:w.markerStart,sourceX:ft,sourceY:Ue,targetX:xt,targetY:be,sourcePosition:ae,targetPosition:te,elementsSelectable:x,onContextMenu:l,onMouseEnter:s,onMouseMove:a,onMouseLeave:u,onClick:c,onEdgeDoubleClick:d,onReconnect:f,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:g,rfId:r,ariaLabel:w.ariaLabel,isFocusable:fe,isReconnectable:ue,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth,disableKeyboardA11y:p})})))),E):null};gx.displayName="EdgeRenderer";var eC=(0,_.memo)(gx),tC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function nC({children:e}){let t=Ee(tC);return _.default.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function rC(e){let t=kl(),n=(0,_.useRef)(!1);(0,_.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var oC={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top},yx=({nodeId:e,handleType:t,style:n,type:r=Er.Bezier,CustomComponent:o,connectionStatus:i})=>{let{fromNode:l,handleId:s,toX:a,toY:u,connectionMode:c}=Ee((0,_.useCallback)(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),Je),d=l?.[Re]?.handleBounds,f=d?.[t];if(c===eo.Loose&&(f=f||d?.[t==="source"?"target":"source"]),!l||!f)return null;let m=s?f.find(k=>k.id===s):f[0],v=m?m.x+m.width/2:(l.width??0)/2,g=m?m.y+m.height/2:l.height??0,E=(l.positionAbsolute?.x??0)+v,p=(l.positionAbsolute?.y??0)+g,h=m?.position,y=h?oC[h]:null;if(!h||!y)return null;if(o)return _.default.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:l,fromHandle:m,fromX:E,fromY:p,toX:a,toY:u,fromPosition:h,toPosition:y,connectionStatus:i});let x="",N={sourceX:E,sourceY:p,sourcePosition:h,targetX:a,targetY:u,targetPosition:y};return r===Er.Bezier?[x]=Hv(N):r===Er.Step?[x]=Ef({...N,borderRadius:0}):r===Er.SmoothStep?[x]=Ef(N):r===Er.SimpleBezier?[x]=Fv(N):x=`M${E},${p} ${a},${u}`,_.default.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:n})};yx.displayName="ConnectionLine";var iC=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function lC({containerStyle:e,style:t,type:n,component:r}){let{nodeId:o,handleType:i,nodesConnectable:l,width:s,height:a,connectionStatus:u}=Ee(iC,Je);return!(o&&i&&s&&l)?null:_.default.createElement("svg",{style:e,width:s,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container"},_.default.createElement("g",{className:qe(["react-flow__connection",u])},_.default.createElement(yx,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function Iv(e,t){let n=(0,_.useRef)(null),r=Be();return(0,_.useMemo)(()=>t(e),[e])}var vx=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:l,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:v,onSelectionStart:g,onSelectionEnd:E,connectionLineType:p,connectionLineStyle:h,connectionLineComponent:y,connectionLineContainerStyle:x,selectionKeyCode:N,selectionOnDrag:k,selectionMode:P,multiSelectionKeyCode:I,panActivationKeyCode:D,zoomActivationKeyCode:T,deleteKeyCode:$,onlyRenderVisibleElements:F,elementsSelectable:Y,selectNodesOnDrag:w,defaultViewport:R,translateExtent:C,minZoom:O,maxZoom:V,preventScrolling:b,defaultMarkerColor:L,zoomOnScroll:G,zoomOnPinch:U,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:ne,zoomOnDoubleClick:ae,panOnDrag:te,onPaneClick:fe,onPaneMouseEnter:oe,onPaneMouseMove:ue,onPaneMouseLeave:ft,onPaneScroll:Ue,onPaneContextMenu:xt,onEdgeContextMenu:be,onEdgeMouseEnter:de,onEdgeMouseMove:Fe,onEdgeMouseLeave:pe,onReconnect:ee,onReconnectStart:ge,onReconnectEnd:gn,reconnectRadius:jn,noDragClassName:Pn,noWheelClassName:yn,noPanClassName:Mt,elevateEdgesOnSelect:Xn,disableKeyboardA11y:je,nodeOrigin:Pe,nodeExtent:Xe,rfId:In})=>{let Rt=Iv(e,Tk),De=Iv(t,Gk);return rC(i),_.default.createElement(Ak,{onPaneClick:fe,onPaneMouseEnter:oe,onPaneMouseMove:ue,onPaneMouseLeave:ft,onPaneContextMenu:xt,onPaneScroll:Ue,deleteKeyCode:$,selectionKeyCode:N,selectionOnDrag:k,selectionMode:P,onSelectionStart:g,onSelectionEnd:E,multiSelectionKeyCode:I,panActivationKeyCode:D,zoomActivationKeyCode:T,elementsSelectable:Y,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:G,zoomOnPinch:U,zoomOnDoubleClick:ae,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:ne,panOnDrag:te,defaultViewport:R,translateExtent:C,minZoom:O,maxZoom:V,onSelectionContextMenu:v,preventScrolling:b,noDragClassName:Pn,noWheelClassName:yn,noPanClassName:Mt,disableKeyboardA11y:je},_.default.createElement(nC,null,_.default.createElement(eC,{edgeTypes:De,onEdgeClick:s,onEdgeDoubleClick:u,onlyRenderVisibleElements:F,onEdgeContextMenu:be,onEdgeMouseEnter:de,onEdgeMouseMove:Fe,onEdgeMouseLeave:pe,onReconnect:ee,onReconnectStart:ge,onReconnectEnd:gn,reconnectRadius:jn,defaultMarkerColor:L,noPanClassName:Mt,elevateEdgesOnSelect:!!Xn,disableKeyboardA11y:je,rfId:In},_.default.createElement(lC,{style:h,type:p,component:y,containerStyle:x})),_.default.createElement("div",{className:"react-flow__edgelabel-renderer"}),_.default.createElement(Lk,{nodeTypes:Rt,onNodeClick:l,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:w,onlyRenderVisibleElements:F,noPanClassName:Mt,noDragClassName:Pn,disableKeyboardA11y:je,nodeOrigin:Pe,nodeExtent:Xe,rfId:In})))};vx.displayName="GraphView";var sC=(0,_.memo)(vx),Pf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_r={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Pf,nodeExtent:Pf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:zv,isValidConnection:void 0},aC=()=>vy((e,t)=>({..._r,setNodes:n=>{let{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:yf(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{let{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{let o=typeof n<"u",i=typeof r<"u",l=o?yf(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:l,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{let{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:l,fitViewOnInitOptions:s,domNode:a,nodeOrigin:u}=t(),c=a?.querySelector(".react-flow__viewport");if(!c)return;let d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),m=n.reduce((g,E)=>{let p=o.get(E.id);if(p?.hidden)o.set(p.id,{...p,[Re]:{...p[Re],handleBounds:void 0}});else if(p){let h=If(E.nodeElement);!!(h.width&&h.height&&(p.width!==h.width||p.height!==h.height||E.forceUpdate))&&(o.set(p.id,{...p,[Re]:{...p[Re],handleBounds:{source:Sv(".source",E.nodeElement,f,u),target:Sv(".target",E.nodeElement,f,u)}},...h}),g.push({id:p.id,type:"dimensions",dimensions:h}))}return g},[]);ox(o,u);let v=l||i&&!l&&ix(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:v}),m?.length>0&&r?.(m)},updateNodePositions:(n,r=!0,o=!1)=>{let{triggerNodeChanges:i}=t(),l=n.map(s=>{let a={id:s.id,type:"position",dragging:o};return r&&(a.positionAbsolute=s.positionAbsolute,a.position=s.position),a});i(l)},triggerNodeChanges:n=>{let{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:l,getNodes:s,elevateNodesOnSelect:a}=t();if(n?.length){if(i){let u=sx(n,s()),c=yf(u,o,l,a);e({nodeInternals:c})}r?.(n)}},addSelectedNodes:n=>{let{multiSelectionActive:r,edges:o,getNodes:i}=t(),l,s=null;r?l=n.map(a=>Sr(a,!0)):(l=Ko(i(),n),s=Ko(o,[])),Ka({changedNodes:l,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{let{multiSelectionActive:r,edges:o,getNodes:i}=t(),l,s=null;r?l=n.map(a=>Sr(a,!0)):(l=Ko(o,n),s=Ko(i(),[])),Ka({changedNodes:s,changedEdges:l,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{let{edges:o,getNodes:i}=t(),l=n||i(),s=r||o,a=l.map(c=>(c.selected=!1,Sr(c.id,!1))),u=s.map(c=>Sr(c.id,!1));Ka({changedNodes:a,changedEdges:u,get:t,set:e})},setMinZoom:n=>{let{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{let{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{let{edges:n,getNodes:r}=t(),i=r().filter(s=>s.selected).map(s=>Sr(s.id,!1)),l=n.filter(s=>s.selected).map(s=>Sr(s.id,!1));Ka({changedNodes:i,changedEdges:l,get:t,set:e})},setNodeExtent:n=>{let{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=Mf(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{let{transform:r,width:o,height:i,d3Zoom:l,d3Selection:s,translateExtent:a}=t();if(!l||!s||!n.x&&!n.y)return!1;let u=Zt.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],d=l?.constrain()(u,c,a);return l.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:_r.connectionNodeId,connectionHandleId:_r.connectionHandleId,connectionHandleType:_r.connectionHandleType,connectionStatus:_r.connectionStatus,connectionStartHandle:_r.connectionStartHandle,connectionEndHandle:_r.connectionEndHandle}),reset:()=>e({..._r})}),Object.is),nu=({children:e})=>{let t=(0,_.useRef)(null);return t.current||(t.current=aC()),_.default.createElement(bN,{value:t.current},e)};nu.displayName="ReactFlowProvider";var xx=({children:e})=>(0,_.useContext)(eu)?_.default.createElement(_.default.Fragment,null,e):_.default.createElement(nu,null,e);xx.displayName="ReactFlowWrapper";var uC={input:Qv,default:Cf,output:Jv,group:$f},cC={default:Ja,straight:Tf,step:Df,smoothstep:tu,simplebezier:Af},dC=[0,0],fC=[15,15],pC={x:0,y:0,zoom:1},hC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ru=(0,_.forwardRef)(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=uC,edgeTypes:l=cC,onNodeClick:s,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:E,onClickConnectEnd:p,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:D,onNodesDelete:T,onEdgesDelete:$,onSelectionChange:F,onSelectionDragStart:Y,onSelectionDrag:w,onSelectionDragStop:R,onSelectionContextMenu:C,onSelectionStart:O,onSelectionEnd:V,connectionMode:b=eo.Strict,connectionLineType:L=Er.Bezier,connectionLineStyle:G,connectionLineComponent:U,connectionLineContainerStyle:Q,deleteKeyCode:K="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:ae=!1,selectionMode:te=Sl.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:oe=Qa()?"Meta":"Control",zoomActivationKeyCode:ue=Qa()?"Meta":"Control",snapToGrid:ft=!1,snapGrid:Ue=fC,onlyRenderVisibleElements:xt=!1,selectNodesOnDrag:be=!0,nodesDraggable:de,nodesConnectable:Fe,nodesFocusable:pe,nodeOrigin:ee=dC,edgesFocusable:ge,edgesUpdatable:gn,elementsSelectable:jn,defaultViewport:Pn=pC,minZoom:yn=.5,maxZoom:Mt=2,translateExtent:Xn=Pf,preventScrolling:je=!0,nodeExtent:Pe,defaultMarkerColor:Xe="#b1b1b7",zoomOnScroll:In=!0,zoomOnPinch:Rt=!0,panOnScroll:De=!1,panOnScrollSpeed:He=.5,panOnScrollMode:Jt=Jr.Free,zoomOnDoubleClick:wt=!0,panOnDrag:en=!0,onPaneClick:tt,onPaneMouseEnter:tn,onPaneMouseMove:oi,onPaneMouseLeave:Pr,onPaneScroll:At,onPaneContextMenu:lo,children:Mn,onEdgeContextMenu:vn,onEdgeDoubleClick:Fl,onEdgeMouseEnter:xu,onEdgeMouseMove:Wn,onEdgeMouseLeave:Hl,onEdgeUpdate:Kn,onEdgeUpdateStart:Gl,onEdgeUpdateEnd:Vl,onReconnect:Bl,onReconnectStart:Yl,onReconnectEnd:Ul,reconnectRadius:jl=10,edgeUpdaterRadius:wu=10,onNodesChange:_u,onEdgesChange:ii,noDragClassName:li="nodrag",noWheelClassName:si="nowheel",noPanClassName:so="nopan",fitView:Su=!1,fitViewOptions:Eu,connectOnClick:Nu=!0,attributionPosition:ku,proOptions:S,defaultEdgeOptions:M,elevateNodesOnSelect:A=!0,elevateEdgesOnSelect:j=!1,disableKeyboardA11y:q=!1,autoPanOnConnect:X=!0,autoPanOnNodeDrag:re=!0,connectionRadius:he=20,isValidConnection:ye,onError:_t,style:nt,id:Te,nodeDragThreshold:xn,...rt},Xl)=>{let Cu=Te||"1";return _.default.createElement("div",{...rt,style:{...nt,...hC},ref:Xl,className:qe(["react-flow",o]),"data-testid":"rf__wrapper",id:Te},_.default.createElement(xx,null,_.default.createElement(sC,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:s,onEdgeClick:a,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:l,connectionLineType:L,connectionLineStyle:G,connectionLineComponent:U,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:ae,selectionMode:te,deleteKeyCode:K,multiSelectionKeyCode:oe,panActivationKeyCode:fe,zoomActivationKeyCode:ue,onlyRenderVisibleElements:xt,selectNodesOnDrag:be,defaultViewport:Pn,translateExtent:Xn,minZoom:yn,maxZoom:Mt,preventScrolling:je,zoomOnScroll:In,zoomOnPinch:Rt,zoomOnDoubleClick:wt,panOnScroll:De,panOnScrollSpeed:He,panOnScrollMode:Jt,panOnDrag:en,onPaneClick:tt,onPaneMouseEnter:tn,onPaneMouseMove:oi,onPaneMouseLeave:Pr,onPaneScroll:At,onPaneContextMenu:lo,onSelectionContextMenu:C,onSelectionStart:O,onSelectionEnd:V,onEdgeContextMenu:vn,onEdgeDoubleClick:Fl,onEdgeMouseEnter:xu,onEdgeMouseMove:Wn,onEdgeMouseLeave:Hl,onReconnect:Bl??Kn,onReconnectStart:Yl??Gl,onReconnectEnd:Ul??Vl,reconnectRadius:jl??wu,defaultMarkerColor:Xe,noDragClassName:li,noWheelClassName:si,noPanClassName:so,elevateEdgesOnSelect:j,rfId:Cu,disableKeyboardA11y:q,nodeOrigin:ee,nodeExtent:Pe}),_.default.createElement(ok,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:E,onClickConnectEnd:p,nodesDraggable:de,nodesConnectable:Fe,nodesFocusable:pe,edgesFocusable:ge,edgesUpdatable:gn,elementsSelectable:jn,elevateNodesOnSelect:A,minZoom:yn,maxZoom:Mt,nodeExtent:Pe,onNodesChange:_u,onEdgesChange:ii,snapToGrid:ft,snapGrid:Ue,connectionMode:b,translateExtent:Xn,connectOnClick:Nu,defaultEdgeOptions:M,fitView:Su,fitViewOptions:Eu,onNodesDelete:T,onEdgesDelete:$,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:D,onSelectionDrag:w,onSelectionDragStart:Y,onSelectionDragStop:R,noPanClassName:so,nodeOrigin:ee,rfId:Cu,autoPanOnConnect:X,autoPanOnNodeDrag:re,onError:_t,connectionRadius:he,isValidConnection:ye,nodeDragThreshold:xn}),_.default.createElement(nk,{onSelectionChange:F}),Mn,_.default.createElement(MN,{proOptions:S,position:ku}),_.default.createElement(uk,{rfId:Cu,disableKeyboardA11y:q})))});ru.displayName="ReactFlow";var mC=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function wx({children:e}){let t=Ee(mC);return t?(0,Mv.createPortal)(e,t):null}function _x(){let e=Be();return(0,_.useCallback)(t=>{let{domNode:n,updateNodeDimensions:r}=e.getState(),i=(Array.isArray(t)?t:[t]).reduce((l,s)=>{let a=n?.querySelector(`.react-flow__node[data-id="${s}"]`);return a&&l.push({id:s,nodeElement:a,forceUpdate:!0}),l},[]);requestAnimationFrame(()=>r(i))},[])}function Sx(e){return t=>{let[n,r]=(0,_.useState)(t),o=(0,_.useCallback)(i=>r(l=>e(i,l)),[]);return[n,r,o]}}var PA=Sx(sx),IA=Sx(Ek);var qt=We(nn(),1);var hn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(hn||(hn={}));function gC({color:e,dimensions:t,lineWidth:n}){return qt.default.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function yC({color:e,radius:t}){return qt.default.createElement("circle",{cx:t,cy:t,r:t,fill:e})}var vC={[hn.Dots]:"#91919a",[hn.Lines]:"#eee",[hn.Cross]:"#e2e2e2"},xC={[hn.Dots]:1,[hn.Lines]:1,[hn.Cross]:6},wC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ex({id:e,variant:t=hn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:l,style:s,className:a}){let u=(0,qt.useRef)(null),{transform:c,patternId:d}=Ee(wC,Je),f=l||vC[t],m=r||xC[t],v=t===hn.Dots,g=t===hn.Cross,E=Array.isArray(n)?n:[n,n],p=[E[0]*c[2]||1,E[1]*c[2]||1],h=m*c[2],y=g?[h,h]:p,x=v?[h/i,h/i]:[y[0]/i,y[1]/i];return qt.default.createElement("svg",{className:qe(["react-flow__background",a]),style:{...s,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},qt.default.createElement("pattern",{id:d+e,x:c[0]%p[0],y:c[1]%p[1],width:p[0],height:p[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`},v?qt.default.createElement(yC,{color:f,radius:h/i}):qt.default.createElement(gC,{dimensions:y,color:f,lineWidth:o})),qt.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+e})`}))}Ex.displayName="Background";var Nx=(0,qt.memo)(Ex);var kx=We(nn(),1);var _C=We(ga(),1);var kr=We(Yr(),1);var SC=Math.PI*2,ou=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:24,mn=(e,t)=>{let n=ou(e),r=ou(t);return n+r+3*Math.max(n,r)},EC=(e,t,n)=>n!==void 0&&Number.isFinite(n)&&n>=0?n:mn(e.radius,t.radius),Cx=(e,t,n)=>{for(let r of t){let o=e.x-r.x,i=e.y-r.y,l=EC(e,r,n);if(o*o+i*i<l*l)return!0}return!1};var iu=(e,t)=>{if(e.length===0)return[];let n=e.reduce((a,u)=>Math.max(a,ou(u.radius??u.position.radius)),24),r=t===void 0?mn(n,n):Math.max(1,t),o=e.reduce((a,u)=>Math.max(a,u.position.x),Number.NEGATIVE_INFINITY),i=new Map,l=a=>{let u=[],c=Math.floor(a.x/r),d=Math.floor(a.y/r);for(let f=-1;f<=1;f+=1){let m=i.get(c+f);if(m!==void 0)for(let v=-1;v<=1;v+=1){let g=m.get(d+v);g!==void 0&&u.push(...g)}}return u},s=a=>{o=Math.max(o,a.x);let u=Math.floor(a.x/r),c=Math.floor(a.y/r),d=i.get(u);d===void 0&&(d=new Map,i.set(u,d));let f=d.get(c);f===void 0?d.set(c,[a]):f.push(a)};return e.map(a=>{let u=ou(a.radius??a.position.radius),c={...a.position,radius:u},d={x:c.x,y:c.y};if(Cx(c,l(c),t)){let f=t??mn(u,n),m=f/2,v=!1;for(let g=1;g<=20&&!v;g+=1){let E=f+(g-1)*m;for(let p=0;p<8;p+=1){let h=p/8*SC,y={x:Math.round(c.x+Math.cos(h)*E),y:Math.round(c.y+Math.sin(h)*E),radius:u};if(!Cx(y,l(y),t)){d={x:y.x,y:y.y},v=!0;break}}}v||(d={x:Math.round(o+r),y:Math.round(c.y)})}return s({...d,radius:u}),d.x===a.position.x&&d.y===a.position.y?a:{...a,position:{x:d.x,y:d.y}}})};var UA=120*120*6;var NC=18,kC=16,Hf=.001,Gf=(e,t)=>e!==void 0&&Number.isFinite(e)&&e>0?e:t,Ye=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)},CC=(e,t)=>{let n=Number.isInteger(t)&&(t??0)>0?t:1;return(Number.isInteger(e)&&(e??-1)>=0?Math.min(e,n-1):0)-(n-1)/2};function Cl(e){let t=Gf(e.fallbackRadius,24),n=Gf(e.sourceRadius,t),r=Gf(e.targetRadius,t),o=e.targetX-e.sourceX,i=e.targetY-e.sourceY,l=Math.hypot(o,i),s=CC(e.parallelIndex,e.parallelCount);if(l<Hf){let k=Math.max(n,r),P=Math.SQRT1_2,I=-Math.SQRT1_2,D=e.sourceX-k*P,T=e.sourceY+k*I,$=e.targetX+k*P,F=e.targetY+k*I,Y=k*1.8+kC*(s+((e.parallelCount??1)-1)/2),w=e.sourceX-Y,R=e.sourceY-Y,C=e.targetX+Y,O=e.targetY-Y;return{path:`M${Ye(D)} ${Ye(T)}C${Ye(w)} ${Ye(R)} ${Ye(C)} ${Ye(O)} ${Ye($)} ${Ye(F)}`,labelX:e.sourceX,labelY:e.sourceY-Y,selfLoop:!0}}let a=o/l,u=i/l,c=o>0||Math.abs(o)<Hf&&i>=0?1:-1,d=-u*c,f=a*c,m=s*NC;if(Math.abs(m)<Hf){let k=e.sourceX+a*n,P=e.sourceY+u*n,I=e.targetX-a*r,D=e.targetY-u*r;return{path:`M${Ye(k)} ${Ye(P)}L${Ye(I)} ${Ye(D)}`,labelX:(k+I)/2,labelY:(P+D)/2,selfLoop:!1}}let v=(e.sourceX+e.targetX)/2+d*m*2,g=(e.sourceY+e.targetY)/2+f*m*2,E=Math.hypot(v-e.sourceX,g-e.sourceY),p=Math.hypot(v-e.targetX,g-e.targetY),h=e.sourceX+(v-e.sourceX)/E*n,y=e.sourceY+(g-e.sourceY)/E*n,x=e.targetX+(v-e.targetX)/p*r,N=e.targetY+(g-e.targetY)/p*r;return{path:`M${Ye(h)} ${Ye(y)}Q${Ye(v)} ${Ye(g)} ${Ye(x)} ${Ye(N)}`,labelX:(h+2*v+x)/4,labelY:(y+2*g+N)/4,selfLoop:!1}}function Vf(e,t,n,r){let o=Number.isFinite(r)&&r>0?r:1;return{x:t,y:n,width:Math.max(18,e.length*8+10)/o,height:18/o}}var bx=(e,t)=>`${e}:${t}`;function Bf(e,t=6){let r=e.reduce((i,l)=>Math.max(i,l.radius+t),1)*2,o=new Map;for(let i of e){let l=bx(Math.floor(i.x/r),Math.floor(i.y/r)),s=o.get(l);s===void 0?o.set(l,[i]):s.push(i)}return{cellSize:r,cells:o}}function Yf(e,t,n=6){let r=t.width/2,o=t.height/2,i=Math.floor(t.x/e.cellSize),l=Math.floor(t.y/e.cellSize);for(let s=-1;s<=1;s+=1)for(let a=-1;a<=1;a+=1){let u=e.cells.get(bx(i+s,l+a));if(u!==void 0)for(let c of u){let d=Math.max(t.x-r,Math.min(c.x,t.x+r)),f=Math.max(t.y-o,Math.min(c.y,t.y+o)),m=d-c.x,v=f-c.y,g=c.radius+n;if(m*m+v*v<=g*g)return!0}}return!1}function Uf({sourceX:e,sourceY:t,targetX:n,targetY:r,data:o}){let i=o?.state??"committed",l=o?.markerId,s=Cl({sourceX:e,sourceY:t,targetX:n,targetY:r,...o?.sourceRadius===void 0?{}:{sourceRadius:o.sourceRadius},...o?.targetRadius===void 0?{}:{targetRadius:o.targetRadius},...o?.parallelIndex===void 0?{}:{parallelIndex:o.parallelIndex},...o?.parallelCount===void 0?{}:{parallelCount:o.parallelCount}}),a=()=>o?.onSelect?.(),u=o?.emphasized===!0,c=o?.label??"0",d=!u&&o?.occlusionIndex!==void 0&&Yf(o.occlusionIndex,Vf(c,s.labelX,s.labelY,o.occlusionZoom??1)),f=["shared-graph-edge",`shared-graph-edge--${i}`,o?.emphasized===!0?"is-emphasized":"",o?.muted===!0?"is-muted":""].filter(Boolean).join(" ");return(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)("path",{className:f,d:s.path,fill:"none",markerEnd:l===void 0?void 0:`url(#${l})`,mask:!u&&o?.maskId!==void 0?`url(#${o.maskId})`:void 0,onClick:a,onContextMenu:m=>{m.preventDefault(),o?.onContextMenu?.(m)}}),d?null:(0,kr.jsx)(wx,{children:(0,kr.jsx)("button",{"aria-label":`${c} \u6761\u5173\u7CFB`,className:`shared-graph-edge__label${u?" is-emphasized":""}`,disabled:i==="disabled"||o?.onSelect===void 0,onClick:m=>{m.stopPropagation(),a()},onContextMenu:m=>{m.preventDefault(),o?.onContextMenu?.(m)},style:{position:"absolute",transform:`translate(-50%, -50%) translate(${s.labelX}px, ${s.labelY}px)`},type:"button",children:c})})]})}var Cr=48/2,su=mn(Cr,Cr),ct=Cr,Mx=Cr*5,Rx=6e4,Ax=.06,Pl=Cr,jf=60,Il=4;var no=.001,bC=su*su,Dx=su*2;var Tx=24*3,PC=Mx-48,IC=40,MC=48,RC=10,AC=8,DC=.75,TC=Math.PI*2,zC=2.399963,Xf=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:Cr;var Wf=(e,t)=>{let n=new Map;for(let r of t)n.set(r.from,(n.get(r.from)??0)+1),n.set(r.to,(n.get(r.to)??0)+1);return e.map(r=>({id:r.id,x:r.x,y:r.y,vx:0,vy:0,mass:1+(n.get(r.id)??0),radius:Xf(r.radius)}))},Px=e=>e>Pl?Pl:e<-Pl?-Pl:e,OC=(e,t)=>{let n=new Map;for(let r=0;r<e.length;r+=1){let o=e[r],i=Math.floor(o.x/t),l=Math.floor(o.y/t),s=n.get(i);s||(s=new Map,n.set(i,s));let a=s.get(l);a||(a=[],s.set(l,a)),a.push(r)}return{cellSize:t,cells:n}},LC=(e,t,n,r,o)=>{let i=0,l=Math.floor(t/e.cellSize),s=Math.floor(n/e.cellSize);for(let a=-1;a<=1;a+=1){let u=e.cells.get(l+a);if(u)for(let c=-1;c<=1;c+=1){let d=u.get(s+c);if(!d)continue;let f=0,m=d.length;for(;f<m;){let v=f+Math.floor((m-f)/2);d[v]<=r?f=v+1:m=v}for(let v=f;v<d.length;v+=1)if(o(d[v]),i+=1,i>=MC)return}}},Kf=(e,t,n)=>{let r=e.length;if(r===0)return;let o=new Array(r).fill(0),i=new Array(r).fill(0),l=new Array(r).fill(0),s=new Array(r).fill(0),a=e.reduce((v,g)=>Math.max(v,Xf(g.radius)),Cr),u=Math.max(Dx,(a*2+Tx)*2),c=OC(e,u);for(let v=0;v<r;v+=1){let g=e[v];LC(c,g.x,g.y,v,E=>{let p=e[E],h=g.x-p.x,y=g.y-p.y,x=h*h+y*y;if(x<no){let Y=(v*zC+E)%TC;h=Math.cos(Y)*no,y=Math.sin(Y)*no,x=no*no}let N=Math.sqrt(x),k=mn(g.radius,p.radius);if(N<k){let Y=h/N,w=y/N,C=Math.max(0,k-N-DC)*AC*.5;l[v]+=Y*C,s[v]+=w*C,l[E]-=Y*C,s[E]-=w*C;return}let P=k*2;if(N>=P)return;let I=Rx*g.mass*p.mass/x,D=(P-N)/(P-k),T=I*D*D,$=h/N,F=y/N;o[v]+=$*T,i[v]+=F*T,o[E]-=$*T,i[E]-=F*T})}let d=new Map;for(let v=0;v<r;v+=1)d.set(e[v].id,v);for(let v of t){let g=d.get(v.from),E=d.get(v.to);if(g===void 0||E===void 0||g===E)continue;let p=e[g],h=e[E],y=h.x-p.x,x=h.y-p.y,N=y*y+x*x;if(N<no)continue;let k=Math.sqrt(N),P=mn(p.radius,h.radius),I=Ax*(k-P),D=y/k,T=x/k;o[g]+=D*I,i[g]+=T*I,o[E]-=D*I,i[E]-=T*I}let f=Math.max(0,n),m=1-Math.exp(-RC*f);for(let v=0;v<r;v+=1){let g=e[v],E=o[v]/g.mass,p=i[v]/g.mass,h=E*jf+l[v],y=p*jf+s[v];g.vx+=(h-g.vx)*m,g.vy+=(y-g.vy)*m;let x=Math.hypot(h,y),N=Math.hypot(g.vx,g.vy);if(x<Il&&N<Il){g.vx=0,g.vy=0;continue}g.x+=Px(g.vx*f),g.y+=Px(g.vy*f)}},Jo=(e,t)=>({x:Math.round(e/ct)*ct,y:Math.round(t/ct)*ct}),bl=(e,t)=>{for(let n of t){let r=e.x-n.x,o=e.y-n.y,i=mn(e.radius,n.radius);if(r*r+o*o<i*i)return!0}return!1},Zf=(e,t)=>{let n=Jo(e.x,e.y),r=o=>({...o,radius:Xf(e.radius)});if(!bl(r(n),t))return n;for(let o=1;o<=IC;o+=1){let i=o*ct;for(let l=-o;l<=o;l+=1){let s=l*ct,a={x:n.x+s,y:n.y-i};if(!bl(r(a),t))return a;let u={x:n.x+s,y:n.y+i};if(!bl(r(u),t))return u}for(let l=-o+1;l<=o-1;l+=1){let s=l*ct,a={x:n.x-i,y:n.y+s};if(!bl(r(a),t))return a;let u={x:n.x+i,y:n.y+s};if(!bl(r(u),t))return u}}return null};var ro=96,au=40,ep=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`hsl(${(t>>>0)%360} 64% 54%)`},uu=e=>{let t=e.trim().slice(0,au);return t.length===0?null:t},oo=e=>Number.isFinite(e),Qf=e=>oo(e.x)&&oo(e.y)&&oo(e.width)&&oo(e.height)&&e.width>=0&&e.height>=0,ei=(e,t)=>{if(!Qf(e))throw new TypeError(`${t} \u5FC5\u987B\u4F7F\u7528\u6709\u9650\u5750\u6807\u548C\u975E\u8D1F\u5C3A\u5BF8`)},tp=(e,t)=>{if(!oo(e.x)||!oo(e.y))throw new TypeError(`${t} \u5FC5\u987B\u4F7F\u7528\u6709\u9650\u5750\u6807`)},$x=e=>{for(let t of e)ei(t,`\u5206\u7EC4 ${t.id}`)},qf=e=>{if(!oo(e))throw new TypeError("\u7F51\u683C\u5750\u6807\u5FC5\u987B\u662F\u6709\u9650\u6570");let t=Math.round(e/ct)*ct;return Object.is(t,-0)?0:t},Jf=e=>(tp(e,"\u7F51\u683C\u70B9"),{x:qf(e.x),y:qf(e.y)});var Fx=(e,t)=>{let n=Jf(e),r=Jf(t);return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),width:Math.abs(r.x-n.x),height:Math.abs(r.y-n.y)}},Hx=(e,t)=>(ei(e,"\u5DE6\u4FA7\u5206\u7EC4"),ei(t,"\u53F3\u4FA7\u5206\u7EC4"),e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y),Ml=(e,t,n)=>!Qf(e)||e.width<ro||e.height<ro||t.some(r=>!Qf(r))?!1:t.every(r=>r.id===n||!Hx(e,r));var np=(e,t)=>{ei(e,"\u6210\u5458\u5206\u7EC4");for(let[n,r]of Object.entries(t))tp(r,`\u8282\u70B9 ${n}`);return Object.entries(t).filter(([,n])=>n.x>=e.x&&n.x<e.x+e.width&&n.y>=e.y&&n.y<e.y+e.height).map(([n])=>n)},zx=(e,t,n,r,o)=>o>0?{entry:(n-t)/o,exit:(r-e)/o}:o<0?{entry:(r-e)/o,exit:(n-t)/o}:e<r&&t>n?{entry:Number.NEGATIVE_INFINITY,exit:Number.POSITIVE_INFINITY}:null,$C=(e,t,n)=>{let r=zx(e.x,e.x+e.width,n.x,n.x+n.width,t.x),o=zx(e.y,e.y+e.height,n.y,n.y+n.height,t.y);if(r===null||o===null)return null;let i=Math.max(r.entry,o.entry,0),l=Math.min(r.exit,o.exit,1);return i<l&&i<=1&&l>=0?i:null},Ox=(e,t)=>{let n=e/ct;return t>0?Math.floor(n+1e-9)*ct:t<0?Math.ceil(n-1e-9)*ct:e},Gx=(e,t,n,r)=>{ei(e,"\u5F85\u79FB\u52A8\u5206\u7EC4"),tp(t,"\u79FB\u52A8\u8DDD\u79BB"),$x(n);let o=Jf({x:e.x+t.x,y:e.y+t.y}),i={x:o.x-e.x,y:o.y-e.y},l=1;for(let a of n){if(a.id===r)continue;let u=$C(e,i,a);u!==null&&(l=Math.min(l,u))}let s=l<1?{x:Ox(e.x+i.x*l,i.x)-e.x,y:Ox(e.y+i.y*l,i.y)-e.y}:i;return{bounds:{x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height},delta:s}},Lx=(e,t,n,r)=>e<r&&t>n,rp=(e,t,n,r,o)=>{ei(e,"\u5F85\u7F29\u653E\u5206\u7EC4"),$x(r);let i=qf(n),l=e.x+e.width,s=e.y+e.height,a=t==="left"?Math.min(i,l-ro):t==="right"?Math.max(i,e.x+ro):t==="top"?Math.min(i,s-ro):Math.max(i,e.y+ro);for(let u of r){if(u.id===o)continue;let c=u.x+u.width,d=u.y+u.height;(t==="left"||t==="right")&&!Lx(e.y,s,u.y,d)||(t==="top"||t==="bottom")&&!Lx(e.x,l,u.x,c)||(t==="left"&&a<e.x&&c<=e.x&&c>a?a=c:t==="right"&&a>l&&u.x>=l&&u.x<a?a=u.x:t==="top"&&a<e.y&&d<=e.y&&d>a?a=d:t==="bottom"&&a>s&&u.y>=s&&u.y<a&&(a=u.y))}return t==="left"?{x:a,y:e.y,width:l-a,height:e.height}:t==="right"?{x:e.x,y:e.y,width:a-e.x,height:e.height}:t==="top"?{x:e.x,y:a,width:e.width,height:s-a}:{x:e.x,y:e.y,width:e.width,height:a-e.y}};var dt=Object.freeze({minDiameter:48,maxDiameter:48*1.5,pixelsPerSqrtCharacter:3,maxContentLength:4096,maxTraversalDepth:8,maxVisitedContainers:2048,maxVisitedEntries:4096});function cu(e){let t=Number.isFinite(e.contentLength)?Math.max(0,Math.floor(e.contentLength)):0,n=Math.min(dt.maxContentLength,t),r=Number.isFinite(e.diameter)?e.diameter:dt.minDiameter,o=Math.min(dt.maxDiameter,Math.max(dt.minDiameter,r));return Object.freeze({contentLength:n,diameter:o,radius:o/2,truncated:e.truncated||t>dt.maxContentLength,saturated:e.saturated||o===dt.maxDiameter})}var br=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Rl=e=>e.visitedEntries>=dt.maxVisitedEntries?(e.truncated=!0,!1):(e.visitedEntries+=1,!0),op=(e,t)=>{for(let n of e){if(t.length>=dt.maxContentLength){t.truncated=!0;return}t.length+=1}},ip=(e,t,n)=>{if(n>dt.maxTraversalDepth){t.truncated=!0;return}if(typeof e=="string"){op(e,t);return}if(e===null||typeof e!="object")return;if(t.seen.has(e)){t.truncated=!0;return}if(t.visitedContainers>=dt.maxVisitedContainers){t.truncated=!0;return}t.seen.add(e),t.visitedContainers+=1;let r=e;if(!(br(r,"$ref")||br(r,"$asset"))){if(br(r,"$rich")){let o=r.$rich;if(!Array.isArray(o))return;for(let i=0;i<o.length;i+=1){if(!Rl(t))return;let l=o[i];if(l!==null&&typeof l=="object"&&br(l,"text")&&typeof l.text=="string"&&op(l.text,t),t.truncated)return}return}if(Array.isArray(e)){for(let o=0;o<e.length;o+=1){if(!Rl(t))return;let i=e[o];if(i!==null&&typeof i=="object"&&br(i,"value")&&ip(i.value,t,n+1),t.truncated)return}return}for(let o in r){if(!br(r,o))continue;if(!Rl(t))return;let i=r[o];if(i!==null&&typeof i=="object"&&br(i,"value")&&ip(i.value,t,n+1),t.truncated)return}}},FC=(e,t)=>{let n={length:0,visitedContainers:0,visitedEntries:0,truncated:!1,seen:new WeakSet},r=typeof e.name=="string"?[e.name]:Array.isArray(e.name)?e.name:[];for(let o=0;o<r.length;o+=1){if(!Rl(n))return n;let i=r[o];if(typeof i=="string"&&op(i,n),n.truncated)return n}for(let o in e.props)if(br(e.props,o)){if(!Rl(n))return n;if(!(t(o)&&r.length>0)&&(ip(e.props[o]?.value,n,0),n.truncated))return n}return n},HC=e=>e==="name";function lp(e,t=HC){let n=FC(e,t),r=Math.min(dt.maxDiameter,Math.max(dt.minDiameter,dt.minDiameter+dt.pixelsPerSqrtCharacter*Math.sqrt(n.length)));return cu({contentLength:n.length,diameter:r,radius:r/2,truncated:n.truncated,saturated:r===dt.maxDiameter})}var Vx=e=>{let t=[],n=new Map,r=new Float64Array(e.nodes.length*3);e.nodes.forEach((l,s)=>{if(l.id.length===0||n.has(l.id))throw new TypeError(`\u56FE\u5E03\u5C40\u8282\u70B9 id \u5FC5\u987B\u975E\u7A7A\u4E14\u552F\u4E00: ${l.id}`);if(!Number.isFinite(l.x)||!Number.isFinite(l.y))throw new TypeError(`\u56FE\u5E03\u5C40\u8282\u70B9\u5750\u6807\u5FC5\u987B\u662F\u6709\u9650\u6570: ${l.id}`);if(!Number.isFinite(l.radius)||l.radius<=0)throw new TypeError(`\u56FE\u5E03\u5C40\u8282\u70B9\u534A\u5F84\u5FC5\u987B\u662F\u6B63\u6709\u9650\u6570: ${l.id}`);t.push(l.id),n.set(l.id,s);let a=s*3;r[a]=l.x,r[a+1]=l.y,r[a+2]=l.radius});let o=new Uint32Array(e.edges.length*2);e.edges.forEach((l,s)=>{let a=n.get(l.from),u=n.get(l.to);if(a===void 0||u===void 0)throw new TypeError(`\u56FE\u5E03\u5C40\u5173\u7CFB\u5F15\u7528\u4E86\u672A\u77E5\u8282\u70B9: ${l.from} -> ${l.to}`);o[s*2]=a,o[s*2+1]=u});let i=-1;if(e.fixedNodeId!==void 0&&(i=n.get(e.fixedNodeId)??-1,i<0))throw new TypeError(`\u56FE\u5E03\u5C40 fixedNodeId \u5F15\u7528\u4E86\u672A\u77E5\u8282\u70B9: ${e.fixedNodeId}`);return{nodeIds:t,nodes:r,edges:o,fixedIndex:i}},Bx=(e,t)=>{if(t.length!==e.length*2)throw new Error("WASM \u56FE\u5E03\u5C40\u8FD4\u56DE\u7684 position \u957F\u5EA6\u4E0D\u5339\u914D");let n={};return e.forEach((r,o)=>{let i=t[o*2],l=t[o*2+1];if(i===void 0||l===void 0||!Number.isFinite(i)||!Number.isFinite(l))throw new Error(`WASM \u56FE\u5E03\u5C40\u8FD4\u56DE\u4E86\u975E\u6CD5\u5750\u6807: ${r}`);n[r]={x:i,y:l}}),n};var du=e=>Object.assign(new Error(e),{name:"AbortError"}),GC=()=>new Worker(new URL("./graph-layout-worker.js",import.meta.url),{name:"worldengine-graph-layout",type:"module"}),VC=e=>{let t=e(),n=0,r,o=!1,i=s=>{let a=r;r=void 0,a!==void 0&&(a.removeAbortListener(),a.reject(s))};t.onmessage=s=>{if(o)return;let a=s.data,u=r;if(!(u===void 0||a.generation!==u.generation||a.generation!==n)){if(r=void 0,u.removeAbortListener(),a.kind==="error"){u.reject(new Error(a.message));return}try{u.resolve(Bx(u.nodeIds,new Float64Array(a.positions)))}catch(c){u.reject(c)}}},t.onerror=s=>{o||i(new Error(s.message||"\u56FE\u5E03\u5C40 worker \u6267\u884C\u5931\u8D25"))};let l=(s,a)=>{if(o)return Promise.reject(new Error("\u56FE\u5E03\u5C40 solver \u5DF2\u91CA\u653E"));if(a?.aborted===!0)return Promise.reject(du("\u56FE\u5E03\u5C40\u8BF7\u6C42\u5DF2\u53D6\u6D88"));let u=Vx(s);i(du("\u56FE\u5E03\u5C40\u8BF7\u6C42\u5DF2\u88AB\u66F4\u65B0\u5E27\u53D6\u4EE3")),n+=1;let c=n;return new Promise((d,f)=>{let m=()=>{r?.generation===c&&i(du("\u56FE\u5E03\u5C40\u8BF7\u6C42\u5DF2\u53D6\u6D88"))};a?.addEventListener("abort",m,{once:!0}),r={generation:c,nodeIds:u.nodeIds,resolve:d,reject:f,removeAbortListener:()=>a?.removeEventListener("abort",m)};let v={kind:"solve",generation:c,nodes:u.nodes.buffer,edges:u.edges.buffer,fixedIndex:u.fixedIndex};try{t.postMessage(v,[u.nodes.buffer,u.edges.buffer])}catch(g){i(g)}})};return l.dispose=()=>{o||(o=!0,i(du("\u56FE\u5E03\u5C40 solver \u5DF2\u91CA\u653E")),t.onmessage=null,t.onerror=null,t.terminate())},l},Al=()=>VC(GC);var le=48/2,BC=4,pu=.5,Yx=.28,Ux=Object.freeze({top:"calc(50% + 0.5px)",right:"auto",bottom:"auto",left:"50%",width:"1px",height:"1px",minWidth:0,minHeight:0,border:0,opacity:0,pointerEvents:"none",transform:"translate(-50%, -50%)"}),dp=Object.freeze({contentLength:0,diameter:48,radius:48/2,truncated:!1,saturated:!1}),Xx=(e,t)=>e.metrics!==void 0?cu(e.metrics):e.content===void 0?dp:lp(e.content,t),Wx=(e,t)=>`${e} \xB7 ${t.truncated?"\u81F3\u5C11 ":""}${t.contentLength} \u5B57\u7B26${t.saturated?" \xB7 \u5C3A\u5BF8\u5DF2\u8FBE\u4E0A\u9650":""}`,Kx=e=>{switch(e.trim().toLocaleLowerCase()){case"character":case"person":case"npc":return"person";case"location":case"place":return"place";case"faction":return"faction";case"item":return"item";case"event":return"event";default:return"neutral"}};function YC({kind:e}){let t=Kx(e);return(0,W.jsxs)("svg",{"aria-hidden":"true",className:"shared-graph-node__glyph","data-graph-glyph":t,viewBox:"0 0 24 24",children:[t==="person"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("circle",{cx:"12",cy:"8",r:"3"}),(0,W.jsx)("path",{d:"M5.5 20c.7-4 3-6 6.5-6s5.8 2 6.5 6"})]}):null,t==="place"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("path",{d:"M12 21s6-5.3 6-11a6 6 0 1 0-12 0c0 5.7 6 11 6 11Z"}),(0,W.jsx)("circle",{cx:"12",cy:"10",r:"2"})]}):null,t==="faction"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("path",{d:"M12 3 19 6v5c0 4.6-2.7 7.8-7 10-4.3-2.2-7-5.4-7-10V6l7-3Z"}),(0,W.jsx)("path",{d:"M9 12h6M12 9v6"})]}):null,t==="item"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("path",{d:"m12 3 7 4-7 4-7-4 7-4Z"}),(0,W.jsx)("path",{d:"m5 7v9l7 5 7-5V7M12 11v10"})]}):null,t==="event"?(0,W.jsx)("path",{d:"m13.5 2-7 11H12l-1.5 9 7-12H12l1.5-8Z"}):null,t==="neutral"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("circle",{cx:"12",cy:"12",r:"7"}),(0,W.jsx)("path",{d:"M8.5 12h7M12 8.5v7"})]}):null]})}var UC=(0,z.memo)(function({data:t,selected:n}){let r=n||t.selected,o=["shared-graph-node",`shared-graph-node--kind-${t.kind}`,t.vector===void 0?"":`shared-graph-node--vec-${t.vector}`,r?"is-selected":"",t.adjacent?"is-adjacent":"",t.muted?"is-muted":"",t.searchMatch?"is-search-match":"",t.highlighted?"is-highlighted":"",t.remoteHighlighted?"is-remote-highlighted":"",t.disabled?"is-disabled":"",t.pending?"is-pending":""].filter(Boolean).join(" "),i=t.resolvedMetrics;return(0,W.jsxs)("div",{"aria-disabled":t.disabled,"aria-label":`${t.label} \xB7 ${t.kind}`,className:o,"data-graph-node-id":t.id,onClick:()=>{t.interactionDisabled||t.onSelect()},onContextMenu:l=>{l.preventDefault(),t.interactionDisabled||t.onContextMenu?.(l)},onKeyDown:l=>{!t.interactionDisabled&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onSelect())},onPointerDown:l=>{l.button===2&&!t.interactionDisabled&&t.onRightPointerDown?.(l)},role:"button",style:{"--we-graph-node-size":`${i.diameter}px`,"--we-graph-node-radius":`${i.radius}px`},tabIndex:t.interactionDisabled?-1:0,title:Wx(t.label,i),children:[(0,W.jsx)(to,{className:"shared-graph-node__handle",isConnectable:!1,position:J.Top,style:Ux,type:"target"}),(0,W.jsx)("span",{className:"shared-graph-node__circle",children:(0,W.jsx)(YC,{kind:t.kind})}),(0,W.jsx)("span",{className:"shared-graph-node__label",children:t.label}),(0,W.jsx)(to,{className:"shared-graph-node__handle",isConnectable:!1,position:J.Top,style:Ux,type:"source"})]})},(e,t)=>{let n=e.data,r=t.data;return e.selected===t.selected&&n.id===r.id&&n.label===r.label&&n.kind===r.kind&&n.disabled===r.disabled&&n.interactionDisabled===r.interactionDisabled&&n.pending===r.pending&&n.vector===r.vector&&n.selected===r.selected&&n.adjacent===r.adjacent&&n.muted===r.muted&&n.searchMatch===r.searchMatch&&n.highlighted===r.highlighted&&n.remoteHighlighted===r.remoteHighlighted&&n.resolvedMetrics.contentLength===r.resolvedMetrics.contentLength&&n.resolvedMetrics.diameter===r.resolvedMetrics.diameter&&n.resolvedMetrics.truncated===r.resolvedMetrics.truncated&&n.resolvedMetrics.saturated===r.resolvedMetrics.saturated&&n.onContextMenu===void 0==(r.onContextMenu===void 0)&&n.onRightPointerDown===void 0==(r.onRightPointerDown===void 0)}),jC={sharedGraphEdge:Uf},cp="__we_graph_group__:",XC=(0,z.memo)(function({data:t}){let n=t.group.label?.trim()||t.group.id,[r,o]=(0,z.useState)(!1),[i,l]=(0,z.useState)(n),s=(0,z.useRef)(null),a=(0,z.useRef)(!1);(0,z.useEffect)(()=>{a.current||l(n)},[n]),(0,z.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]),(0,z.useEffect)(()=>{t.renameRequest!==void 0&&u()},[t.renameRequest]);let u=()=>{t.onRename===void 0||t.draft||(a.current=!0,l(n),o(!0))},c=f=>{if(!a.current)return;if(a.current=!1,o(!1),!f){l(n);return}let m=uu(i);if(m===null||m===n){l(n);return}t.onRename?.(m)},d=["shared-graph-group",t.selected?"is-selected":"",t.draft?"is-draft":"",t.blocked?"is-blocked":"",t.dropTarget?"is-drop-target":"",r?"is-renaming":""].filter(Boolean).join(" ");return(0,W.jsxs)("div",{"aria-label":`\u5206\u7EC4\uFF1A${n}`,"aria-pressed":t.selected,className:d,"data-graph-group-height":t.group.height,"data-graph-group-id":t.group.id,"data-graph-group-width":t.group.width,"data-graph-group-x":t.group.x,"data-graph-group-y":t.group.y,onClick:f=>{f.stopPropagation(),t.onSelect?.()},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t.onSelect?.())},onContextMenu:f=>{f.preventDefault(),f.stopPropagation(),t.onContextMenu?.(f)},role:"button",style:{"--we-graph-group-color":t.color},tabIndex:t.draft?-1:0,children:[r?(0,W.jsx)("input",{"aria-label":`\u91CD\u547D\u540D\u5206\u7EC4${n}`,className:"shared-graph-group__name-input nodrag nopan",maxLength:au,onBlur:()=>c(!0),onChange:f=>l(f.currentTarget.value),onClick:f=>f.stopPropagation(),onDoubleClick:f=>f.stopPropagation(),onKeyDown:f=>{f.stopPropagation(),f.key==="Enter"?(f.preventDefault(),c(!0)):f.key==="Escape"&&(f.preventDefault(),c(!1))},onPointerDown:f=>f.stopPropagation(),ref:s,value:i}):(0,W.jsx)("span",{className:"shared-graph-group__label nodrag nopan",onClick:f=>f.stopPropagation(),onDoubleClick:f=>{f.preventDefault(),f.stopPropagation(),u()},children:n}),t.selected&&!t.draft?["top","right","bottom","left"].map(f=>(0,W.jsx)("span",{"aria-label":`\u8C03\u6574\u5206\u7EC4${n}${f==="top"?"\u4E0A\u8FB9":f==="right"?"\u53F3\u8FB9":f==="bottom"?"\u4E0B\u8FB9":"\u5DE6\u8FB9"}`,className:`shared-graph-group__resize shared-graph-group__resize--${f} nodrag nopan`,onPointerDown:m=>{m.preventDefault(),m.stopPropagation(),t.onResizePointerDown?.(f,m)},role:"separator"},f)):null]})}),WC={sharedGraphNode:UC,sharedGraphGroup:XC},fu=e=>({x:72+e%5*168,y:64+Math.floor(e/5)*144}),KC=e=>e.trim().toLocaleLowerCase(),hu=e=>({x:e.x+le,y:e.y+le}),jx=e=>({x:e.x-le,y:e.y-le}),ZC=e=>`${cp}${e}`,ti=e=>e.startsWith(cp)?e.slice(cp.length):null,sp=(e,t)=>Math.abs(e.x-t.x)<pu&&Math.abs(e.y-t.y)<pu,QC=e=>{let t=new Set(e.map(r=>r.id)),n=e.length+1;for(;t.has(`group-${n}`);)n+=1;return`group-${n}`},qC=(e,t,n,r)=>{if(t.length===0)return e;let o=new Set(t),i=Math.max(1,Math.ceil(Math.max(Math.abs(e.x),Math.abs(e.y))/ct)),l={x:0,y:0};for(let s=1;s<=i;s+=1){let a={x:e.x*s/i,y:e.y*s/i},u=Jo(a.x,a.y),c=!0;for(let d of t){let f=n[d];if(f===void 0)continue;let m=hu(f),v=r.get(d)?.radius??le;for(let[g,E]of Object.entries(n)){if(o.has(g))continue;let p=hu(E),h=r.get(g)?.radius??le,y=mn(v,h);if(Math.hypot(m.x+u.x-p.x,m.y+u.y-p.y)<y){c=!1;break}}if(!c)break}if(!c)return l;l=u}return l};function Zx(e){let t=new Map;for(let n of e){let r=n.source<=n.target?n.source:n.target,o=n.source<=n.target?n.target:n.source,i=`pair:${JSON.stringify([r,o])}`,l=t.get(i);l===void 0?t.set(i,{pairId:i,source:r,target:o,relations:[n]}):l.relations.push(n)}return[...t.values()].map(n=>({pairId:n.pairId,source:n.source,target:n.target,relationIds:n.relations.map(r=>r.id),relations:n.relations}))}var ap=(e,t)=>e!==null&&e.x===t.x&&e.y===t.y&&e.zoom===t.zoom;function JC({actions:e,clientX:t,clientY:n,onClose:r}){let o=(0,z.useRef)(null);if((0,z.useEffect)(()=>{o.current?.querySelector("[role='menuitem']")?.focus();let u=d=>{o.current?.contains(d.target)||r()},c=d=>{d.key==="Escape"&&r()};return window.addEventListener("pointerdown",u,!0),window.addEventListener("keydown",c),window.addEventListener("resize",r),()=>{window.removeEventListener("pointerdown",u,!0),window.removeEventListener("keydown",c),window.removeEventListener("resize",r)}},[r]),e.length===0)return null;let i=184,l=e.length*34+12,s=Math.max(8,Math.min(t,window.innerWidth-i-8)),a=Math.max(8,Math.min(n,window.innerHeight-l-8));return(0,W.jsx)("div",{"aria-label":"\u56FE\u8C31\u64CD\u4F5C\u83DC\u5355",className:"shared-graph-context-menu","data-graph-context-menu":"true",onContextMenu:u=>u.preventDefault(),onKeyDown:u=>{if(u.key!=="ArrowDown"&&u.key!=="ArrowUp"&&u.key!=="Home"&&u.key!=="End")return;u.preventDefault();let c=[...u.currentTarget.querySelectorAll("[role='menuitem']")];if(c.length===0)return;let d=c.indexOf(document.activeElement),f=u.key==="Home"?0:u.key==="End"?c.length-1:u.key==="ArrowDown"?(d+1+c.length)%c.length:(d-1+c.length)%c.length;c[f]?.focus()},ref:o,role:"menu",style:{left:s,top:a},children:e.map(u=>(0,W.jsx)("button",{className:u.danger?"is-danger":void 0,onClick:()=>{r(),u.run()},role:"menuitem",type:"button",children:u.label},u.id))})}function Qx(e,t,n=[],r){let o=new Map(e.map(u=>[u.id,Xx(u,r)])),i=n.map(u=>({from:u.source,to:u.target})),l=Wf(e.map((u,c)=>{let d=o.get(u.id)??dp,f=t[u.id]??fu(c);return{id:u.id,x:f.x+le,y:f.y+le,radius:d.radius}}),i),s=0;for(let u=0;u<240&&s<12;u+=1)Kf(l,i,.032),s=l.some(d=>Math.hypot(d.vx,d.vy)>=Il)?0:s+1;let a=iu(l.map(u=>({id:u.id,position:{x:Math.round(u.x-le),y:Math.round(u.y-le)},...u.radius===void 0?{}:{radius:u.radius}})));return Object.fromEntries(a.map(u=>[u.id,u.position]))}function Dl({kind:e}){return(0,W.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:(0,W.jsx)("path",{d:e==="plus"?"M12 5v14M5 12h14":e==="minus"?"M5 12h14":e==="fit"?"M9 5H5v4M15 5h4v4M9 19H5v-4M15 19h4v-4":e==="force"?"M6 7l6-3 6 3v10l-6 3-6-3V7Zm0 0 6 3 6-3M12 10v10":"M5 7V5h4M15 5h4v4M19 15v4h-4M9 19H5v-4",fill:"none"})})}function eb({canCommit:e,canCreateGroup:t,drawingGroup:n,onForce:r,onToggleGroup:o}){let i=kl();return(0,W.jsxs)("div",{"aria-label":"\u56FE\u8C31\u89C6\u56FE\u63A7\u5236",className:"shared-graph-controls",children:[(0,W.jsx)("button",{"aria-label":"\u653E\u5927",onClick:()=>{i.zoomIn({duration:160})},type:"button",children:(0,W.jsx)(Dl,{kind:"plus"})}),(0,W.jsx)("button",{"aria-label":"\u7F29\u5C0F",onClick:()=>{i.zoomOut({duration:160})},type:"button",children:(0,W.jsx)(Dl,{kind:"minus"})}),(0,W.jsx)("button",{"aria-label":"\u9002\u5408\u89C6\u56FE",onClick:()=>{i.fitView({padding:.16,duration:200})},type:"button",children:(0,W.jsx)(Dl,{kind:"fit"})}),(0,W.jsx)("button",{"aria-label":"\u81EA\u52A8\u5E03\u5C40",disabled:!e,onClick:r,type:"button",children:(0,W.jsx)(Dl,{kind:"force"})}),(0,W.jsx)("button",{"aria-label":n?"\u53D6\u6D88\u65B0\u5EFA\u5206\u7EC4":"\u65B0\u5EFA\u5206\u7EC4","aria-pressed":n,disabled:!t,onClick:o,type:"button",children:(0,W.jsx)(Dl,{kind:"group"})})]})}function tb(e){let t=kl(),n=_x(),r=`we-graph-edge-mask-${(0,z.useId)().replaceAll(":","")}`,o=(0,z.useRef)(new Map),i=(0,z.useRef)(null),l=e.viewport?.zoom!==void 0&&Number.isFinite(e.viewport.zoom)&&e.viewport.zoom>0?e.viewport.zoom:1,s=(0,z.useRef)(l),[a,u]=(0,z.useState)(l),c=(0,z.useCallback)(S=>{!Number.isFinite(S)||S<=0||i.current===null||(s.current=S,i.current.style.setProperty("--we-graph-zoom",String(S)),i.current.style.setProperty("--we-graph-inverse-zoom",String(1/S)),i.current.dataset.weGraphDistant=String(S<Yx))},[]);(0,z.useEffect)(()=>c(l),[l,c]),(0,z.useEffect)(()=>u(l),[l]);let d=(0,z.useRef)(e.onSelectNode);d.current=e.onSelectNode;let f=(0,z.useRef)(e.onNodeContextMenu);f.current=e.onNodeContextMenu;let m=(0,z.useRef)(e.onLayoutError);m.current=e.onLayoutError;let[v,g]=(0,z.useState)(null),E=(0,z.useCallback)(S=>{let M=S instanceof Error?S:new Error(String(S));g(M.message||"\u56FE\u5E03\u5C40\u5931\u8D25"),m.current?.(M)},[]),p=(0,z.useRef)(null),h=(0,z.useRef)(e.createLayoutSolver??Al);h.current=e.createLayoutSolver??Al;let y=(0,z.useCallback)(()=>{if(p.current!==null)return p.current;if(typeof Worker>"u"&&e.createLayoutSolver===void 0){if(typeof window<"u")throw new Error("\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 GraphLayout Worker\uFF0C\u5DF2\u62D2\u7EDD\u4E3B\u7EBF\u7A0B\u5E03\u5C40 fallback");return null}return p.current=h.current(),p.current},[e.createLayoutSolver]),[x,N]=(0,z.useState)(null),[k,P]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(x===null)return;let S=0,M=()=>{if(x.viewportInitialized){P(!0);return}S=window.requestAnimationFrame(M)};return M(),()=>{S!==0&&window.cancelAnimationFrame(S)}},[x]);let[I,D]=(0,z.useState)(()=>({...e.positions}));(0,z.useEffect)(()=>D({...e.positions}),[e.positions]);let[T,$]=(0,z.useState)(()=>[...e.groups??[]]),F=(0,z.useRef)(T);F.current=T,(0,z.useEffect)(()=>{let S=[...e.groups??[]];F.current=S,$(S)},[e.groups]);let[Y,w]=(0,z.useState)(null),[R,C]=(0,z.useState)(null),[O,V]=(0,z.useState)(null),[b,L]=(0,z.useState)(!1),[G,U]=(0,z.useState)(null),Q=(0,z.useRef)(G);Q.current=G;let K=(0,z.useRef)(null),ne=(0,z.useRef)(null),ae=(0,z.useRef)(null);(0,z.useEffect)(()=>{e.disabled&&C(null)},[e.disabled]);let te=(0,z.useMemo)(()=>new Map(e.nodes.map(S=>[S.id,Xx(S,e.isNameAttrKey)])),[e.isNameAttrKey,e.nodes]),fe=(0,z.useMemo)(()=>e.nodes.reduce((S,M,A)=>(S[M.id]=I[M.id]??fu(A),S),{}),[I,e.nodes]),oe=(0,z.useMemo)(()=>Object.fromEntries(iu(e.nodes.map(S=>({id:S.id,position:fe[S.id],radius:te.get(S.id)?.radius??le}))).map(S=>[S.id,S.position])),[te,e.nodes,fe]),ue=(0,z.useRef)(oe);ue.current=oe;let ft=(0,z.useRef)(e.nodes);ft.current=e.nodes;let Ue=(0,z.useRef)(te);Ue.current=te;let xt=(0,z.useRef)(e.relations);xt.current=e.relations;let be=(0,z.useRef)(0),de=(0,z.useRef)(0),Fe=(0,z.useRef)(null),pe=(0,z.useMemo)(()=>e.graphIdentity??e.nodes.map(S=>S.id).join("\0"),[e.graphIdentity,e.nodes]),ee=(0,z.useRef)(pe);(0,z.useEffect)(()=>{ee.current!==pe&&(ee.current=pe,be.current+=1,Fe.current=null,de.current!==0&&(window.cancelAnimationFrame(de.current),de.current=0),p.current?.dispose(),p.current=null)},[pe]),(0,z.useEffect)(()=>()=>{be.current+=1,Fe.current=null,de.current!==0&&window.cancelAnimationFrame(de.current),p.current?.dispose(),p.current=null},[]);let ge=(0,z.useCallback)((S,M=F.current)=>{let A={...S},j=[...M];D(A),F.current=j,$(j),e.onCommitLayout!==void 0?e.onCommitLayout({positions:A,groups:j}):e.onCommitPositions?.(A)},[e.onCommitLayout,e.onCommitPositions]),gn=(0,z.useCallback)(S=>{let M=Fe.current,A;try{A=y()}catch(X){E(X);return}if(M===null||A===null)return;g(null);let j=++be.current,q={...ue.current,[M.id]:{x:M.x,y:M.y}};A({nodes:ft.current.map(X=>{let re=q[X.id]??{x:0,y:0};return{id:X.id,x:re.x+le,y:re.y+le,radius:Ue.current.get(X.id)?.radius??le}}),edges:xt.current.map(X=>({from:X.source,to:X.target})),fixedNodeId:M.id}).then(X=>{if(j!==be.current)return;let re=Object.fromEntries(Object.entries(X).map(([he,ye])=>[he,{x:ye.x-le,y:ye.y-le}]));D(re),g(null),S&&ge(re)}).catch(X=>{j===be.current&&X?.name!=="AbortError"&&E(X)})},[ge,y,E]),jn=(0,z.useRef)(null);(0,z.useEffect)(()=>{let S=new Map,M=[];for(let j of e.nodes){let q=te.get(j.id)?.diameter??48;S.set(j.id,q);let X=jn.current?.get(j.id);X!==void 0&&X!==q&&M.push(j.id)}if(jn.current=S,M.length===0)return;let A=window.requestAnimationFrame(()=>{for(let j of M)n(j)});return()=>window.cancelAnimationFrame(A)},[te,e.nodes,n]);let Pn=(0,z.useRef)(null),yn=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(!k||!t.viewportInitialized)return;let S=e.focusRequest;if(S!=null&&Pn.current!==S.requestId){let A=e.positions?.[S.nodeId]??oe[S.nodeId];if(A!==void 0){Pn.current=S.requestId,yn.current=e.viewport??null,t.setCenter(A.x+le,A.y+le,{zoom:S.zoom??t.getZoom(),duration:S.durationMs??220});return}}let M=e.viewport;M===void 0||ap(yn.current,M)||(yn.current=M,ap(t.getViewport(),M)||t.setViewport(M))},[t,oe,e.focusRequest,e.positions,e.viewport,k]);let Mt=(0,z.useRef)(e.viewport??null);(0,z.useEffect)(()=>{e.viewport!==void 0&&(Mt.current=e.viewport)},[e.viewport]);let Xn=(0,z.useCallback)(S=>{ap(Mt.current,S)||(Mt.current=S,e.onViewportChange?.(S))},[e.onViewportChange]),je=!e.disabled&&(e.onCommitLayout!==void 0||e.onCommitPositions!==void 0),Pe=!e.disabled&&e.onCommitLayout!==void 0,Xe=!e.disabled&&e.onRelationDragIntent!==void 0,In=(0,z.useRef)(Xe);In.current=Xe;let[Rt,De]=(0,z.useState)(null),He=(0,z.useRef)(null),Jt=(0,z.useRef)(0),[wt,en]=(0,z.useState)(null),tt=(0,z.useRef)(null),[tn,oi]=(0,z.useState)(null),Pr=(0,z.useCallback)(()=>en(null),[]),At=(0,z.useCallback)((S,M)=>{S.preventDefault(),S.stopPropagation(),en({clientX:S.clientX,clientY:S.clientY,target:M})},[]),lo=(0,z.useMemo)(()=>new Map(e.nodes.map(S=>[S.id,e.disabled||(S.interactionDisabled??S.disabled??!1)])),[e.disabled,e.nodes]),Mn=(0,z.useRef)(lo);Mn.current=lo;let vn=(0,z.useCallback)((S,M)=>{if(!Xe||Mn.current.get(S)===!0)return;tt.current=null,en(null),M.stopPropagation();let A={sourceId:S,startClientX:M.clientX,startClientY:M.clientY,clientX:M.clientX,clientY:M.clientY,moved:!1};He.current=A,De(A)},[Xe]);(0,z.useEffect)(()=>{let S=A=>{let j=He.current;if(j===null)return;let q=j.moved||Math.hypot(A.clientX-j.startClientX,A.clientY-j.startClientY)>=4;q&&A.preventDefault();let X={...j,clientX:A.clientX,clientY:A.clientY,moved:q};He.current=X,De(X)},M=A=>{let j=He.current;if(j===null||A.button!==2)return;if(He.current=null,De(null),!j.moved){let he=tt.current;tt.current=null,he?.nodeId===j.sourceId&&Mn.current.get(j.sourceId)===!1&&en({clientX:he.clientX,clientY:he.clientY,target:{kind:"node",nodeId:j.sourceId}});return}if(tt.current=null,Jt.current=Date.now()+500,!In.current||Mn.current.get(j.sourceId)!==!1)return;let re=(typeof document.elementFromPoint=="function"?document.elementFromPoint(A.clientX,A.clientY):null)?.closest("[data-graph-node-id]")?.dataset.graphNodeId;re===void 0||re===j.sourceId||Mn.current.get(re)!==!1||e.onRelationDragIntent?.(j.sourceId,re)};return window.addEventListener("pointermove",S,{passive:!1}),window.addEventListener("pointerup",M),()=>{window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",M)}},[e.onRelationDragIntent]);let Fl=(0,z.useMemo)(()=>{if(Rt===null||!Rt.moved||!t.viewportInitialized)return null;let S=oe[Rt.sourceId];if(S===void 0)return null;let M=t.flowToScreenPosition({x:S.x+le,y:S.y+le}),A=t.getZoom();return Cl({sourceX:M.x,sourceY:M.y,targetX:Rt.clientX,targetY:Rt.clientY,sourceRadius:(te.get(Rt.sourceId)?.radius??le)*A,targetRadius:1,fallbackRadius:1})},[t,te,oe,Rt]),xu=e.showToolbar??!0,Wn=KC(e.searchQuery),Hl=(0,z.useMemo)(()=>{let S=new Set;if(e.selectedNodeId===null)return S;for(let M of e.relations)M.source===e.selectedNodeId&&S.add(M.target),M.target===e.selectedNodeId&&S.add(M.source);return S},[e.relations,e.selectedNodeId]),Kn=(0,z.useMemo)(()=>e.nodes.map(S=>({id:S.id,x:(oe[S.id]?.x??0)+le,y:(oe[S.id]?.y??0)+le,radius:te.get(S.id)?.radius??le})),[te,oe,e.nodes]),Gl=(0,z.useMemo)(()=>Bf(Kn),[Kn]),Vl=(0,z.useMemo)(()=>{if(Kn.length===0)return{x:-1,y:-1,width:2,height:2};let S=Number.POSITIVE_INFINITY,M=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let X of Kn){let re=X.radius+6;S=Math.min(S,X.x-re),M=Math.min(M,X.y-re),A=Math.max(A,X.x+re),j=Math.max(j,X.y+re)}let q=256;return{x:S-q,y:M-q,width:A-S+q*2,height:j-M+q*2}},[Kn]),Bl=(0,z.useCallback)((S,M,A)=>{Pe&&(ae.current={groupId:S.id,side:M,source:S,groups:F.current,changed:!1},A.currentTarget.setPointerCapture?.(A.pointerId))},[Pe]),Yl=(0,z.useCallback)((S,M)=>{if(!Pe)return;let A=uu(M);if(A===null)return;let j=F.current,q=j.find(re=>re.id===S);if(q===void 0||q.label===A)return;let X=j.map(re=>re.id===S?{...re,label:A}:re);ge(ue.current,X)},[Pe,ge]),Ul=(0,z.useMemo)(()=>e.nodes.map((S,M)=>{let A=te.get(S.id)??dp,j=S.id===e.selectedNodeId,q=Hl.has(S.id),X=S.searchMatch??(Wn!==""&&`${S.label} ${S.kind}`.toLocaleLowerCase().includes(Wn)),re=e.disabled||(S.interactionDisabled??S.disabled??!1);return{id:S.id,type:"sharedGraphNode",position:{x:(oe[S.id]??fu(M)).x+le-A.radius,y:(oe[S.id]??fu(M)).y+le-A.radius},data:{...S,disabled:!!(e.disabled||S.disabled),interactionDisabled:re,selected:j,adjacent:q,muted:e.selectedNodeId!==null&&!j&&!q,searchMatch:X,remoteHighlighted:S.id===e.highlightNodeId,resolvedMetrics:A,onSelect:()=>{re||d.current(S.id)},onContextMenu:he=>{if(Date.now()<=Jt.current||He.current?.moved===!0){Jt.current=0;return}if(!re){if(f.current?.(S.id,he),He.current!==null){tt.current={nodeId:S.id,clientX:he.clientX,clientY:he.clientY};return}At(he,{kind:"node",nodeId:S.id})}},...Xe&&!re?{onRightPointerDown:he=>{vn(S.id,he)}}:{}},draggable:je&&!re,style:{width:A.diameter,height:A.diameter}}}),[Hl,je,Xe,te,Wn,At,oe,e.disabled,e.highlightNodeId,e.nodes,e.onNodeContextMenu,e.onSelectNode,e.selectedNodeId,vn]),jl=(0,z.useMemo)(()=>[...T,...G===null?[]:[G]].map(S=>({id:ZC(S.id),type:"sharedGraphGroup",position:{x:S.x,y:S.y},data:{group:S,color:ep(S.id),selected:!S.id.startsWith("__draft__")&&S.id===Y,draft:S.id.startsWith("__draft__"),blocked:S.id===O||"blocked"in S&&S.blocked===!0,dropTarget:!S.id.startsWith("__draft__")&&S.id===R,...tn?.groupId===S.id?{renameRequest:tn.serial}:{},...S.id.startsWith("__draft__")?{}:{onSelect:()=>w(S.id),onRename:M=>Yl(S.id,M),onContextMenu:M=>{(Pe||e.onRequestUngroup!==void 0)&&At(M,{kind:"group",groupId:S.id})},onResizePointerDown:(M,A)=>{Bl(S,M,A)}}},draggable:Pe&&!S.id.startsWith("__draft__"),selectable:!1,zIndex:-1,style:{width:S.width,height:S.height}})),[O,Pe,G,R,tn,T,At,e.onRequestUngroup,Yl,Y,Bl]),wu=(0,z.useMemo)(()=>[...jl,...Ul],[Ul,jl]),_u=(0,z.useMemo)(()=>Zx(e.relations).map(S=>{let M=S.relationIds,A=e.selectedRelationId!==void 0&&e.selectedRelationId!==null&&M.includes(e.selectedRelationId),j=e.selectedNodeId!==null&&(S.source===e.selectedNodeId||S.target===e.selectedNodeId),q=A||j,X=S.relations.some(rt=>rt.searchMatch??(Wn!==""&&`${rt.label} ${rt.id}`.toLocaleLowerCase().includes(Wn))),re=S.relations.every(rt=>rt.disabled===!0),he=S.relations.some(rt=>rt.pending===!0),ye=S.relations[0],_t=S.relations.every(rt=>rt.source===ye.source&&rt.target===ye.target),nt=_t?ye.source:S.source,Te=_t?ye.target:S.target,xn=e.onSelectRelationGroup!==void 0||e.onSelectRelation!==void 0;return{id:S.pairId,source:nt,target:Te,type:"sharedGraphEdge",selected:q,zIndex:q?1e3:0,data:{label:String(M.length),relationIds:M,state:re?"disabled":he?"pending":X?"search":"committed",sourceRadius:te.get(nt)?.radius??48/2,targetRadius:te.get(Te)?.radius??48/2,emphasized:q,maskId:r,occlusionIndex:Gl,occlusionZoom:a,muted:(e.selectedNodeId!==null||e.selectedRelationId!=null)&&!q,onContextMenu:rt=>{!e.disabled&&(xn||e.onEditRelationGroup!==void 0||e.onRequestDeleteRelationGroup!==void 0)&&At(rt,{kind:"relation",selection:S})},...xn?{onSelect:()=>{if(!(e.disabled||re)){if(e.onSelectRelationGroup!==void 0){e.onSelectRelationGroup(S);return}e.onSelectRelation?.(M[0])}}}:{}}}}),[r,Gl,a,te,Wn,At,e.disabled,e.onEditRelationGroup,e.onRequestDeleteRelationGroup,e.onSelectRelation,e.onSelectRelationGroup,e.relations,e.selectedNodeId,e.selectedRelationId]),ii=(0,z.useCallback)(S=>{ge(S)},[ge]),li=(0,z.useCallback)(()=>{if(!je)return;let S;try{S=y()}catch(A){E(A);return}if(S===null){ii(Qx(e.nodes,oe,e.relations,e.isNameAttrKey));return}g(null);let M=++be.current;S({nodes:e.nodes.map(A=>{let j=oe[A.id]??{x:0,y:0};return{id:A.id,x:j.x+le,y:j.y+le,radius:te.get(A.id)?.radius??le}}),edges:e.relations.map(A=>({from:A.source,to:A.target}))}).then(A=>{M===be.current&&(g(null),ii(Object.fromEntries(Object.entries(A).map(([j,q])=>[j,{x:q.x-le,y:q.y-le}]))))}).catch(A=>{A?.name!=="AbortError"&&E(A)})},[je,ii,y,te,oe,e.isNameAttrKey,e.nodes,e.relations,E]),si=(0,z.useCallback)(S=>{let M=ti(S.id);if(M===null||!Pe)return;let A=F.current.find(q=>q.id===M);if(A===void 0)return;let j=ue.current;ne.current={groupId:M,source:A,groups:F.current,positions:j,memberIds:np(A,Object.fromEntries(Object.entries(j).map(([q,X])=>[q,hu(X)]))),changed:!1},w(M),V(null)},[Pe]),so=(0,z.useCallback)(S=>{let M=ti(S.id);if(M===null)return;ne.current===null&&si(S);let A=ne.current;if(A===null||A.groupId!==M)return;let j={x:S.position.x-A.source.x,y:S.position.y-A.source.y},q=Gx(A.source,j,A.groups,M),X=qC(q.delta,A.memberIds,A.positions,Ue.current),re={...A.source,x:A.source.x+X.x,y:A.source.y+X.y},he=A.groups.map(nt=>nt.id===M?re:nt),ye=new Set(A.memberIds),_t=Object.fromEntries(Object.entries(A.positions).map(([nt,Te])=>[nt,ye.has(nt)?{x:Te.x+X.x,y:Te.y+X.y}:Te]));A.changed=!sp(X,{x:0,y:0}),F.current=he,ue.current=_t,$(he),D(_t),V(sp(X,j)?null:M)},[si]),Su=(0,z.useCallback)(S=>{let M=ti(S.id);if(M===null)return;so(S);let A=ne.current;ne.current=null,V(null),A?.groupId===M&&A.changed&&ge(ue.current,F.current)},[ge,so]);(0,z.useEffect)(()=>{let S=A=>{let j=K.current;if(j!==null&&A.pointerId===j.pointerId){A.preventDefault();let Te=t.screenToFlowPosition({x:A.clientX,y:A.clientY}),xn=Fx(j.start,Te),rt=!Ml(xn,F.current),Xl={id:"__draft__group",label:"\u65B0\u5206\u7EC4",...xn,blocked:rt};Q.current=Xl,U(Xl)}let q=ae.current;if(q===null)return;A.preventDefault();let X=t.screenToFlowPosition({x:A.clientX,y:A.clientY}),re=q.side==="left"||q.side==="right"?X.x:X.y,he=rp(q.source,q.side,re,[],q.groupId),ye=rp(q.source,q.side,re,q.groups,q.groupId),_t={...q.source,...ye},nt=q.groups.map(Te=>Te.id===q.groupId?_t:Te);q.changed=ye.x!==q.source.x||ye.y!==q.source.y||ye.width!==q.source.width||ye.height!==q.source.height,F.current=nt,$(nt),V(ye.x===he.x&&ye.y===he.y&&ye.width===he.width&&ye.height===he.height?null:q.groupId)},M=A=>{let j=K.current;if(j!==null&&A.pointerId===j.pointerId){K.current=null;let X=Q.current;if(Q.current=null,U(null),L(!1),X!==null&&!X.blocked&&Ml(X,F.current)){let re={id:QC(F.current),label:`\u7EC4 ${F.current.length+1}`,x:X.x,y:X.y,width:X.width,height:X.height},he=[...F.current,re];F.current=he,$(he),w(re.id),ge(ue.current,he)}}let q=ae.current;q!==null&&(ae.current=null,V(null),q.changed&&ge(ue.current,F.current))};return window.addEventListener("pointermove",S,{passive:!1}),window.addEventListener("pointerup",M),()=>{window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",M)}},[ge,t]);let Eu=(0,z.useCallback)(S=>{if(!b||!Pe||S.button!==0||S.target.closest(".react-flow__pane")===null)return;S.preventDefault(),S.stopPropagation();let A=t.screenToFlowPosition({x:S.clientX,y:S.clientY});K.current={pointerId:S.pointerId,start:A};let j={id:"__draft__group",label:"\u65B0\u5206\u7EC4",x:A.x,y:A.y,width:0,height:0,blocked:!0};Q.current=j,U(j)},[Pe,b,t]),Nu=(0,z.useCallback)(S=>{let M=ft.current.find(X=>X.id===S.id);if(e.disabled||M?.disabled===!0||Mn.current.get(S.id)!==!1){C(null);return}let A=Ue.current.get(S.id)?.radius??le,j={x:S.position.x+A,y:S.position.y+A},q=F.current.find(X=>j.x>=X.x&&j.x<X.x+X.width&&j.y>=X.y&&j.y<X.y+X.height);C(X=>X===q?.id?X:q?.id??null)},[e.disabled]),ku=(0,z.useMemo)(()=>{if(wt===null)return[];let S=wt.target;if(S.kind==="pane")return[...!e.disabled&&e.onCreateNodeAt!==void 0?[{id:"create-node",label:"\u65B0\u5EFA\u8282\u70B9",run:()=>e.onCreateNodeAt?.(S.position)}]:[],{id:"fit-view",label:"\u9002\u5408\u89C6\u56FE",run:()=>{t.fitView({padding:.16,duration:200})}},...je?[{id:"force-layout",label:"\u81EA\u52A8\u5E03\u5C40",run:li}]:[]];if(e.disabled)return[];if(S.kind==="node")return[{id:"view-node",label:"\u67E5\u770B\u8282\u70B9",run:()=>e.onSelectNode(S.nodeId)},...e.onEditNode===void 0?[]:[{id:"edit-node",label:"\u7F16\u8F91\u8282\u70B9",run:()=>e.onEditNode?.(S.nodeId)}],...e.onCreateRelationFromNode===void 0?[]:[{id:"create-relation",label:"\u65B0\u5EFA\u5173\u7CFB",run:()=>e.onCreateRelationFromNode?.(S.nodeId)}],...e.onRequestDeleteNode===void 0?[]:[{id:"delete-node",label:"\u5220\u9664\u8282\u70B9",danger:!0,run:()=>e.onRequestDeleteNode?.(S.nodeId)}]];if(S.kind==="relation"){let A=e.onSelectRelationGroup!==void 0?()=>e.onSelectRelationGroup?.(S.selection):e.onSelectRelation!==void 0?()=>e.onSelectRelation?.(S.selection.relationIds[0]):null;return[...A===null?[]:[{id:"view-relation",label:"\u67E5\u770B\u5173\u7CFB",run:A}],...e.onEditRelationGroup===void 0?[]:[{id:"edit-relation",label:"\u7F16\u8F91\u5173\u7CFB",run:()=>e.onEditRelationGroup?.(S.selection)}],...e.onRequestDeleteRelationGroup===void 0?[]:[{id:"delete-relation",label:"\u5220\u9664\u5173\u7CFB",danger:!0,run:()=>e.onRequestDeleteRelationGroup?.(S.selection)}]]}let M=T.find(A=>A.id===S.groupId);return M===void 0?[]:[...Pe?[{id:"rename-group",label:"\u91CD\u547D\u540D\u5206\u7EC4",run:()=>{oi(A=>({groupId:M.id,serial:(A?.serial??0)+1}))}}]:[],...e.onRequestUngroup===void 0?[]:[{id:"ungroup",label:"\u89E3\u9664\u5206\u7EC4",danger:!0,run:()=>e.onRequestUngroup?.(M)}]]},[je,Pe,wt,t,li,T,e.disabled,e.onCreateNodeAt,e.onCreateRelationFromNode,e.onEditNode,e.onEditRelationGroup,e.onRequestDeleteNode,e.onRequestDeleteRelationGroup,e.onRequestUngroup,e.onSelectNode,e.onSelectRelation,e.onSelectRelationGroup]);return(0,W.jsxs)("section",{"aria-label":"\u5171\u4EAB GraphCanvas",className:"shared-graph-canvas","data-testid":"shared-graph-canvas","data-we-graph-group-drawing":String(b),"data-we-graph-distant":String(s.current<Yx),ref:i,onPointerDownCapture:Eu,style:{"--we-graph-zoom":s.current,"--we-graph-inverse-zoom":1/s.current},children:[xu?(0,W.jsxs)("div",{className:"shared-graph-canvas__toolbar",children:[(0,W.jsx)("span",{children:e.searchQuery?`\u641C\u7D22\uFF1A${e.searchQuery}`:`${e.nodes.length} \u8282\u70B9 \xB7 ${e.relations.length} \u5173\u7CFB`}),(0,W.jsx)("span",{"aria-live":"polite","data-relation-capability":Xe?"enabled":"unavailable",children:Xe?"\u5173\u7CFB\u62D6\u62FD\u5DF2\u542F\u7528":"\u5173\u7CFB\u7F16\u8F91\u672A\u914D\u7F6E"})]}):null,v===null?null:(0,W.jsxs)("div",{className:"shared-graph-canvas__error",role:"alert",children:["\u56FE\u5E03\u5C40\u5931\u8D25\uFF1A",v]}),(0,W.jsx)("div",{className:"shared-graph-canvas__flow",children:(0,W.jsxs)(ru,{edges:_u,edgeTypes:jC,elevateEdgesOnSelect:!0,fitView:e.viewport===void 0,maxZoom:4,minZoom:.15,nodes:wu,nodeDragThreshold:BC,nodeTypes:WC,onInit:N,onlyRenderVisibleElements:e.onlyRenderVisibleElements??!1,onConnect:S=>{Xe&&S.source&&S.target&&e.onRelationDragIntent?.(S.source,S.target)},onNodeDragStart:(S,M)=>{Pr(),ti(M.id)!==null&&si(M)},onNodeDrag:(S,M)=>{if(ti(M.id)!==null){C(null),so(M);return}Nu(M);let A=te.get(M.id)?.radius??le,j=o.current.get(M.id);j!==void 0&&(j.setAttribute("cx",String(M.position.x+A)),j.setAttribute("cy",String(M.position.y+A))),Fe.current={id:M.id,...jx(Jo(M.position.x+A,M.position.y+A))},de.current===0&&(de.current=window.requestAnimationFrame(()=>{de.current=0,gn(!1)}))},onNodeDragStop:(S,M)=>{if(C(null),ti(M.id)!==null){Su(M);return}if(!je)return;de.current!==0&&(window.cancelAnimationFrame(de.current),de.current=0);let A=te.get(M.id)?.radius??le,j=oe[M.id],q={x:M.position.x+A-le,y:M.position.y+A-le};if(j!==void 0&&sp(q,j)){Fe.current=null,be.current+=1;return}let X=Jo(M.position.x+A,M.position.y+A),re=e.nodes.flatMap(Te=>{if(Te.id===M.id)return[];let xn=oe[Te.id];return xn===void 0?[]:[{...hu(xn),radius:te.get(Te.id)?.radius??le}]}),he=Zf({...X,radius:A},re)??X,ye=jx(he);if(j!==void 0&&Math.abs(ye.x-j.x)<pu&&Math.abs(ye.y-j.y)<pu){Fe.current=null,be.current+=1;return}let _t={...oe,[M.id]:{x:Math.round(ye.x),y:Math.round(ye.y)}};D(_t),Fe.current={id:M.id,x:_t[M.id].x,y:_t[M.id].y};let nt;try{nt=y()}catch(Te){E(Te);return}if(nt===null){ge(_t);return}gn(!0)},onNodeDoubleClick:(S,M)=>{let A=te.get(M.id)?.radius??le;t.setCenter(M.position.x+A,M.position.y+A,{zoom:Math.max(t.getZoom(),1),duration:220}),e.onNodeDoubleClick?.(M.id)},onMove:(S,M)=>c(M.zoom),onMoveEnd:(S,M)=>{c(M.zoom),u(A=>A===M.zoom?A:M.zoom),Xn(M)},onPaneClick:()=>{Pr(),e.disabled||e.onClearSelection?.()},onPaneContextMenu:S=>{At(S,{kind:"pane",position:t.screenToFlowPosition({x:S.clientX,y:S.clientY})})},nodesConnectable:Xe,nodesDraggable:je,panOnDrag:!b,...e.viewport===void 0?{}:{defaultViewport:e.viewport},children:[(0,W.jsx)("svg",{"aria-hidden":"true",className:"shared-graph-mask-defs",children:(0,W.jsx)("defs",{children:(0,W.jsxs)("mask",{id:r,maskUnits:"userSpaceOnUse",...Vl,children:[(0,W.jsx)("rect",{...Vl,fill:"white"}),Kn.map(S=>(0,W.jsx)("circle",{cx:S.x,cy:S.y,fill:"black",r:S.radius+6,ref:M=>{M===null?o.current.delete(S.id):o.current.set(S.id,M)}},S.id))]})})}),(0,W.jsx)(Nx,{gap:18,size:1}),(0,W.jsx)(eb,{canCommit:je,canCreateGroup:Pe,drawingGroup:b,onForce:li,onToggleGroup:()=>{K.current=null,Q.current=null,U(null),L(S=>!S)}})]})}),Fl===null?null:(0,W.jsx)("svg",{"aria-hidden":"true",className:"shared-graph-relation-drag",children:(0,W.jsx)("path",{d:Fl.path,fill:"none"})}),wt===null?null:(0,W.jsx)(JC,{actions:ku,clientX:wt.clientX,clientY:wt.clientY,onClose:Pr})]})}function fp(e){return(0,W.jsx)(nu,{children:(0,W.jsx)(tb,{...e})})}var Gt=We(nn(),1),lw=We(jd(),1);var Tl="_system_prop_envelope_v1",nb=Object.freeze(["initial_available","source_refs","states","title","trigger","view_access"]),rb=Object.freeze([Tl,"value",...nb]),ob=new Set(rb),ib=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),qx=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),lb=e=>ob.has(e),Jx=e=>{if(!ib(e)||!qx(e,Tl))return!1;if(e[Tl]!==!0||!qx(e,"value"))throw new Error("entity_prop_envelope_marker_invalid");for(let t of Reflect.ownKeys(e))if(typeof t!="string"||!lb(t))throw new Error(`entity_prop_envelope_unknown_field:${String(t)}`);return!0};var vt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),yu=e=>typeof e=="string",gu=e=>{if(!vt(e)||!vt(e.$ref))return!1;let t=e.$ref;return t.kind!=="node"&&t.kind!=="edge"&&t.kind!=="attr"||typeof t.id!="string"||t.id.length===0?!1:t.kind==="attr"?typeof t.attr_key=="string"&&t.attr_key.length>0:t.attr_key===void 0},ni=e=>vt(e)&&Object.keys(e).length===1&&typeof e.$asset=="string"&&/^asset:[0-9a-f]{32}$/.test(e.$asset),io=e=>Array.isArray(e),zl=e=>gu(e),Ol=e=>vt(e)&&Array.isArray(e.$rich)&&e.$rich.every(t=>vt(t)&&typeof t.text=="string"||gu(t)),Ll=e=>!yu(e)&&!io(e)&&!zl(e)&&!ni(e)&&!Ol(e);var sb=e=>{if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return""}},ab=e=>{if(e!==void 0){if(!vt(e))throw new Error("entity_prop_trigger_invalid");if(typeof e.id!="string"||e.id.length===0)throw new Error("entity_prop_trigger_invalid");if(!vt(e.tree)&&!(typeof e.tree=="object"&&e.tree!==null))throw new Error("entity_prop_trigger_invalid");return e}},ub=e=>{if(e.length===0||e[0]!=="{")return null;try{let t=JSON.parse(e);return vt(t)?t:null}catch{return null}},mu=e=>{if(typeof e=="string")return e;if(Array.isArray(e))return e.map(pp);if(ni(e)||gu(e))return e;if(vt(e)&&Array.isArray(e.$rich)){let t=[];for(let n of e.$rich)vt(n)&&typeof n.text=="string"?t.push({text:n.text}):gu(n)&&t.push(n);return{$rich:t}}if(vt(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=pp(r);return t}return sb(e)},cb=e=>{if(!vt(e)||typeof e.id!="string"||e.id==="")return null;let t=mu(e.value),n={id:e.id,value:t};return typeof e.enter_when_trigger_id=="string"&&(n.enter_when_trigger_id=e.enter_when_trigger_id),typeof e.locked_until_trigger_id=="string"&&(n.locked_until_trigger_id=e.locked_until_trigger_id),e.dead===!0&&(n.dead=!0),e.disabled===!0&&(n.disabled=!0),n},db=e=>{if(!Array.isArray(e))return;let t=[];for(let n of e){let r=cb(n);r&&t.push(r)}return t.length>0?t:void 0},fb=e=>{if(e===void 0)return;if(!Array.isArray(e))throw new Error("entity_prop_source_refs_invalid");let t=[];for(let n of e){if(!vt(n))throw new Error("entity_prop_source_ref_invalid");if(typeof n.document_entity_id!="string"||typeof n.chunk_entity_id!="string"||typeof n.chunk_sha256!="string"||!Number.isInteger(n.source_start)||!Number.isInteger(n.source_end)||n.source_start<0||n.source_end<n.source_start)throw new Error("entity_prop_source_ref_invalid");t.push({document_entity_id:n.document_entity_id,chunk_entity_id:n.chunk_entity_id,chunk_sha256:n.chunk_sha256,source_start:n.source_start,source_end:n.source_end})}return t.length>0?t:void 0},ew=(e,t,n,r,o,i,l)=>{let s=ab(t),a=db(n),u={value:e};s&&(u.trigger=s),a&&(u.states=a),typeof r=="string"&&(u.title=r),typeof o=="boolean"&&(u.initial_available=o);let c=fb(i);if(c!==void 0&&(u.source_refs=c),l==="inherit"||l==="deny"||l==="read"||l==="read_write")u.view_access=l;else if(l!==void 0)throw new Error("entity_prop_view_access_invalid");return u},tw=e=>Jx(e),pp=e=>{if(typeof e=="string"){let t=ub(e);return t&&tw(t)?ew(mu(t.value),t.trigger,t.states,t.title,t.initial_available,t.source_refs,t.view_access):{value:e}}return vt(e)&&tw(e)?ew(mu(e.value),e.trigger,e.states,e.title,e.initial_available,e.source_refs,e.view_access):{value:mu(e)}},nw=e=>{if(!vt(e))return{};let t={};for(let[n,r]of Object.entries(e))t[n]=pp(r);return t};var rw=e=>{if(yu(e)||ni(e)||zl(e)||Ol(e))return e;if(io(e))return e.map(hp);let t={};for(let[n,r]of Object.entries(e))t[n]=hp(r);return t},pb=e=>{let t={id:e.id,value:rw(e.value)};return e.enter_when_trigger_id!==void 0&&(t.enter_when_trigger_id=e.enter_when_trigger_id),e.locked_until_trigger_id!==void 0&&(t.locked_until_trigger_id=e.locked_until_trigger_id),e.dead===!0&&(t.dead=!0),e.disabled===!0&&(t.disabled=!0),t},hp=e=>{let t=rw(e.value),n=e.trigger!==void 0,r=e.states!==void 0&&e.states.length>0,o=e.title!==void 0||e.initial_available!==void 0||e.view_access!==void 0||e.source_refs!==void 0&&e.source_refs.length>0;if(!n&&!r&&!o)return t;let i={[Tl]:!0,value:t};return n&&(i.trigger=e.trigger),r&&(i.states=e.states.map(pb)),e.title!==void 0&&(i.title=e.title),e.initial_available!==void 0&&(i.initial_available=e.initial_available),e.source_refs!==void 0&&e.source_refs.length>0&&(i.source_refs=e.source_refs),e.view_access!==void 0&&(i.view_access=e.view_access),i},ow=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=hp(r);return t};var H=We(Yr(),1),Un="_system_prop_envelope_v1",hb=4,ri=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),It=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$l=e=>ri(e)&&e[Un]===!0&&It(e,"value"),Sp=e=>$l(e)?e.value:e,mb=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),sw=(e,t)=>t.length<=e.length&&t.every((n,r)=>n===e[r]),gb=e=>e===null||typeof e=="number"||typeof e=="boolean",iw=e=>ri(e)&&(It(e,"$ref")||It(e,"$asset")||It(e,"$rich")),aw=(e,t)=>{if(!ri(e)||t.length===0)return;let n=e[t[0]];for(let r=1;r<t.length;r+=1){let o=Sp(n),i=t[r];if(Array.isArray(o)){let l=Number(i);if(!Number.isInteger(l)||l<0)return;n=o[l]}else if(ri(o))n=o[i];else return}return n},yb=(e,t)=>{let n;for(let r of t)sw(e,r.to)&&(n===void 0||r.to.length>n.to.length)&&(n=r);return n===void 0?e:[...n.from,...e.slice(n.to.length)]},vb=e=>$l(e)?e.value:e,mp=(e,t)=>$l(e)?{...e,value:t}:t,xb=(e,t)=>{if(!$l(e))return t;let n=["trigger","states","source_refs"];if(!n.some(i=>It(e,i)))return t;let o=$l(t)?{...t}:{[Un]:!0,value:t};for(let i of n)It(e,i)?o[i]=e[i]:delete o[i];return o},gp=(e,t,n,r,o)=>{let i=yb(n,o),l=aw(e,i),s=Sp(l),a=r.some(c=>sw(n,c)),u=t;if(!a&&gb(s))u=mp(u,s);else if(!a){let c=vb(u);if(Array.isArray(s)&&Array.isArray(c))u=mp(u,c.map((d,f)=>gp(e,d,[...n,String(f)],r,o)));else if(ri(s)&&!iw(s)&&ri(c)&&!iw(c)){let d={};for(let[f,m]of Object.entries(c))f!==Un&&(d[f]=gp(e,m,[...n,f],r,o));u=mp(u,d)}}return xb(l,u)};function wb(e,t,n=[],r=[]){let o=ow(t),i={};for(let[l,s]of Object.entries(o))l!==Un&&(i[l]=gp(e,s,[l],n,r));return i}function uw(e,t,n){if(t.length===0)return e;let r=(o,i)=>{let l=t[i],s=o[l];if(s===void 0)return o;if(i===t.length-1)return{...o,[l]:n(s)};let a=t[i+1];if(io(s.value)){let c=Number(a);if(!Number.isInteger(c)||c<0||c>=s.value.length)return o;let d=[...s.value],f=d[c];if(f===void 0)return o;if(i+1===t.length-1)d[c]=n(f);else{let m=r({[a]:f},i+1)[a];if(m===void 0)return o;d[c]=m}return{...o,[l]:{...s,value:d}}}if(!Ll(s.value))return o;let u=r(s.value,i+1);return u===s.value?o:{...o,[l]:{...s,value:u}}};return r(e,0)}var _b=(e,t)=>{if(t.length===0)return e;if(t.length===1){let o={...e};return delete o[t[0]],o}let n=t.slice(0,-1),r=t[t.length-1];return uw(e,n,o=>{if(io(o.value)){let l=Number(r);return!Number.isInteger(l)||l<0||l>=o.value.length?o:{...o,value:o.value.filter((s,a)=>a!==l)}}if(!Ll(o.value)||!It(o.value,r))return o;let i={...o.value};return delete i[r],{...o,value:i}})};function Sb(e,t,n){let r=n.trim();if(t.length===0||r===""||r===Un)return e;let o=t[t.length-1];if(o===r)return e;if(t.length===1){if(It(e,r))return e;let l={};for(let[s,a]of Object.entries(e))l[s===o?r:s]=a;return l}let i=t.slice(0,-1);return uw(e,i,l=>{if(!Ll(l.value)||It(l.value,r))return l;let s={};for(let[a,u]of Object.entries(l.value))s[a===o?r:a]=u;return{...l,value:s}})}var cw=e=>{let t="\u65B0\u5B57\u6BB5",n=1;for(;It(e,t)||t===Un;)n+=1,t=`\u65B0\u5B57\u6BB5${n}`;return t},vu=e=>e==="object"?{}:e==="list"?[]:e==="reference"?{$ref:{kind:"node",id:"entity.id"}}:e==="asset"?{$asset:`asset:${"0".repeat(32)}`}:e==="richtext"?{$rich:[{text:""}]}:"",Eb=e=>ni(e)?"asset":zl(e)?"reference":Ol(e)?"richtext":io(e)?"list":Ll(e)?"object":"text",Yn=e=>e.join(" / "),Nb=({open:e})=>(0,H.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:(0,H.jsx)("path",{d:e?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})}),kb=()=>(0,H.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:(0,H.jsx)("path",{d:"M6.5 9.5l3-3M5.2 11.8H4a3 3 0 010-6h2M10 5.8h2a3 3 0 010 6h-1.2"})}),yp=()=>(0,H.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:(0,H.jsx)("path",{d:"M8 3v10M3 8h10"})}),dw=()=>(0,H.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,H.jsx)("path",{d:"M3.5 4.5h9M6 4.5V3h4v1.5M5 6.5l.5 6h5l.5-6"})}),vp=class extends Gt.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){t.resetKey!==this.props.resetKey&&this.state.error!==null&&this.setState({error:null})}render(){return this.state.error!==null?(0,H.jsxs)("section",{className:"world-property-tree__error",role:"alert","data-testid":"world-property-render-error",children:[(0,H.jsx)("strong",{children:"\u5C5E\u6027\u6811\u6682\u65F6\u65E0\u6CD5\u6E32\u67D3"}),(0,H.jsx)("div",{children:"\u8349\u7A3F\u4ECD\u7531\u5BBF\u4E3B\u4FDD\u7559\uFF1B\u66F4\u65B0\u6570\u636E\u540E\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"})]}):this.props.children}};function Cb(e){let[t,n]=(0,Gt.useState)(e.value);(0,Gt.useEffect)(()=>n(e.value),[e.value]);let r=()=>{let o=t.trim();o===""||o===Un?n(e.value):e.onCommit(o)};return(0,H.jsx)("input",{className:"world-property-key","aria-label":`\u5B57\u6BB5\u540D ${e.value}`,value:t,disabled:e.disabled,onChange:o=>n(o.currentTarget.value),onBlur:r,onKeyDown:o=>{o.key==="Enter"&&o.currentTarget.blur()}})}function xp(e){let[t,n]=(0,Gt.useState)(e.value),[r,o]=(0,Gt.useState)(!1);(0,Gt.useEffect)(()=>{n(e.value),o(!1)},[e.value]);let i=()=>{e.valid(t)?(e.onCommit(t),o(!1)):o(!0)};return(0,H.jsxs)("span",{className:`world-property-validated${r?" is-invalid":""}`,children:[(0,H.jsx)("input",{"aria-label":e.label,"aria-invalid":r,value:t,disabled:e.disabled,onChange:l=>n(l.currentTarget.value),onBlur:i,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()}}),r?(0,H.jsx)("small",{children:"\u683C\u5F0F\u65E0\u6548\uFF0C\u5C1A\u672A\u5199\u5165\u8349\u7A3F"}):null]})}function wp({disabled:e,noun:t,onAdd:n}){let[r,o]=(0,Gt.useState)("text"),i=`\u65B0\u589E${t}`;return(0,H.jsxs)("div",{className:"world-property-add",children:[(0,H.jsx)("select",{"aria-label":`\u65B0${t}\u7C7B\u578B`,value:r,disabled:e,onChange:l=>o(l.currentTarget.value),children:(0,H.jsx)(fw,{})}),(0,H.jsx)("button",{className:"world-property-fab is-primary",type:"button","aria-label":i,title:i,disabled:e,onClick:()=>n(r),children:(0,H.jsx)(yp,{})})]})}function fw(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("option",{value:"text",children:"\u6587\u5B57"}),(0,H.jsx)("option",{value:"object",children:"\u5BF9\u8C61"}),(0,H.jsx)("option",{value:"list",children:"\u5217\u8868"}),(0,H.jsx)("option",{value:"reference",children:"\u5F15\u7528"}),(0,H.jsx)("option",{value:"asset",children:"\u8D44\u6E90"}),(0,H.jsx)("option",{value:"richtext",children:"\u5BCC\u6587\u672C"})]})}var bb=(e,t)=>e.find(n=>mb(n.path,t)),pw={valuePaths:[],remaps:[]};function Pb(e,t){let n={...e,...t};return It(t,"title")&&t.title===""&&delete n.title,It(t,"initial_available")&&t.initial_available===!0&&delete n.initial_available,It(t,"view_access")&&t.view_access===void 0&&delete n.view_access,n}function _p(e){let[t,n]=(0,Gt.useState)(!0),r=Eb(e.prop.value),o=bb(e.bindings,e.path),i=Sp(aw(e.rawRoot,e.path)),l=i===null?"null":typeof i=="number"||typeof i=="boolean"?typeof i:null,s=r==="object"||r==="list",a=g=>e.onChange(Pb(e.prop,g),pw),u=g=>e.onChange({...e.prop,value:g},{valuePaths:[e.path],remaps:[]}),c=[];e.prop.source_refs!==void 0&&c.push(`\u6765\u6E90 ${e.prop.source_refs.length}`),e.prop.states!==void 0&&c.push(`\u72B6\u6001 ${e.prop.states.length}`),e.prop.trigger!==void 0&&c.push("\u89E6\u53D1\u5668 1");let d=`${t?"\u6536\u8D77":"\u5C55\u5F00"} ${Yn(e.path)}`,f=e.canEditCg(e.path),m=`\u7F16\u8F91 ${Yn(e.path)} \u7684 CG \u7ED1\u5B9A`,v=`\u5220\u9664 ${Yn(e.path)}`;return(0,H.jsxs)("article",{className:"world-property-card","data-prop-path":JSON.stringify(e.path),"data-prop-depth":e.depth,children:[(0,H.jsxs)("header",{className:"world-property-card__head",children:[(0,H.jsxs)("div",{className:"world-property-card__identity",children:[s?(0,H.jsx)("button",{className:"world-property-fab",type:"button","aria-label":d,title:d,onClick:()=>n(g=>!g),children:(0,H.jsx)(Nb,{open:t})}):(0,H.jsx)("span",{className:"world-property-fab-spacer"}),e.canRename?(0,H.jsx)(Cb,{value:e.propKey,disabled:e.disabled,onCommit:e.onRename}):(0,H.jsx)("strong",{className:"world-property-fixed-key",children:e.propKey}),(0,H.jsx)("select",{className:"world-property-type","aria-label":`${Yn(e.path)} \u7C7B\u578B`,value:r,disabled:e.disabled,onChange:g=>u(vu(g.currentTarget.value)),children:(0,H.jsx)(fw,{})})]}),(0,H.jsx)("div",{className:"world-property-card__metadata",children:(0,H.jsxs)("button",{className:"world-property-switch",type:"button",role:"switch","aria-checked":e.prop.initial_available!==!1,"aria-label":`${Yn(e.path)} \u521D\u59CB\u53EF\u7528`,title:"\u8FDB\u5165\u573A\u666F\u65F6\u6B64\u5C5E\u6027\u662F\u5426\u7ACB\u5373\u53EF\u7528",disabled:e.disabled,onClick:()=>a({initial_available:e.prop.initial_available===!1}),children:[(0,H.jsx)("span",{"aria-hidden":"true"}),(0,H.jsx)("b",{children:"\u521D\u59CB\u53EF\u7528"})]})}),(0,H.jsxs)("div",{className:"world-property-card__actions",children:[(0,H.jsx)("button",{className:"world-property-fab is-primary",type:"button","aria-label":m,disabled:e.disabled||!f,onClick:()=>e.onEditCg([...e.path]),title:f?m:"\u5F53\u524D Host \u4EC5\u652F\u6301\u9876\u5C42\u5C5E\u6027 CG \u7ED1\u5B9A",children:(0,H.jsx)(kb,{})}),(0,H.jsx)("span",{className:"world-property-cg-summary",children:f?`CG ${o?.count??0}${o?.entry?` \xB7 ${o.entry}`:""}`:"\u6DF1\u5C42 CG \u6682\u4E0D\u53EF\u7528\uFF0C\u4E0D\u4F1A\u7ED1\u5B9A\u7236\u5C5E\u6027"}),(0,H.jsx)("button",{className:"world-property-fab is-danger",type:"button","aria-label":v,title:v,disabled:e.disabled,onClick:e.onDelete,children:(0,H.jsx)(dw,{})})]}),l===null&&c.length===0?null:(0,H.jsxs)("div",{className:"world-property-card__badges",children:[l===null?null:(0,H.jsxs)("span",{children:["\u65E7 ",l," \xB7 \u672A\u7F16\u8F91\u539F\u6837\u4FDD\u7559"]}),c.map(g=>(0,H.jsx)("span",{children:g},g))]})]}),(0,H.jsx)(Mb,{...e,open:t,setValue:u})]})}function hw(e){let t=e.value.$ref,n=r=>e.onChange({$ref:r==="attr"?{kind:r,id:t.id,attr_key:t.attr_key??"attribute"}:{kind:r,id:t.id}});return(0,H.jsxs)("div",{className:"world-property-reference",children:[(0,H.jsxs)("select",{"aria-label":`${e.label} \u5F15\u7528\u7C7B\u578B`,value:t.kind,disabled:e.disabled,onChange:r=>n(r.currentTarget.value),children:[(0,H.jsx)("option",{value:"node",children:"\u8282\u70B9"}),(0,H.jsx)("option",{value:"edge",children:"\u5173\u7CFB"}),(0,H.jsx)("option",{value:"attr",children:"\u5C5E\u6027"})]}),(0,H.jsx)(xp,{label:`${e.label} \u5F15\u7528 ID`,value:t.id,disabled:e.disabled,valid:r=>r.trim()!=="",onCommit:r=>e.onChange({$ref:{...t,id:r}})}),t.kind==="attr"?(0,H.jsx)(xp,{label:`${e.label} \u5C5E\u6027 key`,value:t.attr_key??"",disabled:e.disabled,valid:r=>r.trim()!=="",onCommit:r=>e.onChange({$ref:{...t,attr_key:r}})}):null]})}function Ib(e){let t=(r,o)=>e.onChange({$rich:e.value.$rich.map((i,l)=>l===r?o:i)}),n=r=>e.onChange({$rich:e.value.$rich.filter((o,i)=>i!==r)});return(0,H.jsxs)("div",{className:"world-property-children world-property-rich",children:[e.value.$rich.map((r,o)=>(0,H.jsxs)("div",{className:"world-property-rich__row",children:["text"in r?(0,H.jsx)("input",{"aria-label":`${e.label} \u5BCC\u6587\u672C ${o+1}`,value:r.text,disabled:e.disabled,onChange:i=>t(o,{text:i.currentTarget.value})}):(0,H.jsx)(hw,{value:r,disabled:e.disabled,label:`${e.label} \u5BCC\u6587\u672C ${o+1}`,onChange:i=>t(o,i)}),(0,H.jsx)("button",{className:"world-property-fab is-danger",type:"button","aria-label":`\u5220\u9664\u5BCC\u6587\u672C\u7247\u6BB5 ${o+1}`,title:`\u5220\u9664\u5BCC\u6587\u672C\u7247\u6BB5 ${o+1}`,disabled:e.disabled,onClick:()=>n(o),children:(0,H.jsx)(dw,{})})]},o)),(0,H.jsxs)("div",{className:"world-property-rich__add",children:[(0,H.jsxs)("button",{className:"world-property-chip-button",type:"button","aria-label":"\u65B0\u589E\u6587\u5B57\u7247\u6BB5",title:"\u65B0\u589E\u6587\u5B57\u7247\u6BB5",disabled:e.disabled,onClick:()=>e.onChange({$rich:[...e.value.$rich,{text:""}]}),children:[(0,H.jsx)(yp,{}),"\u65B0\u589E\u6587\u5B57\u7247\u6BB5"]}),(0,H.jsxs)("button",{className:"world-property-chip-button",type:"button","aria-label":"\u65B0\u589E\u5F15\u7528\u7247\u6BB5",title:"\u65B0\u589E\u5F15\u7528\u7247\u6BB5",disabled:e.disabled,onClick:()=>e.onChange({$rich:[...e.value.$rich,{$ref:{kind:"node",id:"entity.id"}}]}),children:[(0,H.jsx)(yp,{}),"\u65B0\u589E\u5F15\u7528\u7247\u6BB5"]})]})]})}function Mb(e){let{prop:t,path:n,depth:r,depthLimit:o,disabled:i,open:l,setValue:s}=e;if(yu(t.value))return(0,H.jsx)("input",{className:"world-property-value","aria-label":`${Yn(n)} \u6587\u5B57`,value:t.value,disabled:i,onChange:u=>s(u.currentTarget.value)});if(ni(t.value))return(0,H.jsx)("div",{className:"world-property-value",children:(0,H.jsx)(xp,{label:`${Yn(n)} \u8D44\u6E90`,value:t.value.$asset,disabled:i,valid:u=>/^asset:[0-9a-f]{32}$/.test(u),onCommit:u=>s({$asset:u})})});if(zl(t.value))return(0,H.jsx)("div",{className:"world-property-value",children:(0,H.jsx)(hw,{value:t.value,disabled:i,label:Yn(n),onChange:s})});if(Ol(t.value))return(0,H.jsx)("div",{className:"world-property-value",children:(0,H.jsx)(Ib,{value:t.value,disabled:i,label:Yn(n),onChange:s})});if(!l)return null;if(r>=o)return(0,H.jsxs)("p",{className:"world-property-depth-note",children:["\u5DF2\u8FBE\u5230\u65E7\u6811\u6DF1\u5EA6 ",o,"\uFF1B\u66F4\u6DF1\u5185\u5BB9\u539F\u6837\u4FDD\u7559\u3002"]});if(io(t.value)){let u=t.value;return(0,H.jsxs)("div",{className:"world-property-children",children:[u.map((c,d)=>{let f=[...n,String(d)];return(0,H.jsx)(_p,{propKey:`\u7B2C ${d+1} \u9879`,path:f,prop:c,depth:r+1,depthLimit:o,disabled:i,rawRoot:e.rawRoot,bindings:e.bindings,canRename:!1,onChange:(m,v)=>{let g=[...u];g[d]=m,e.onChange({...t,value:g},v)},onRename:()=>{},onDelete:()=>{let m=u.filter((g,E)=>E!==d),v=[];for(let g=d;g<m.length;g+=1)v.push({from:[...n,String(g+1)],to:[...n,String(g)]});e.onChange({...t,value:m},{valuePaths:[],remaps:v})},onEditCg:e.onEditCg,canEditCg:e.canEditCg},d)}),(0,H.jsx)(wp,{disabled:i,noun:"\u5217\u8868\u9879",onAdd:c=>e.onChange({...t,value:[...u,{value:vu(c)}]},{valuePaths:[[...n,String(u.length)]],remaps:[]})})]})}let a=t.value;return(0,H.jsxs)("div",{className:"world-property-children",children:[Object.entries(a).filter(([u])=>u!==Un).map(([u,c])=>{let d=[...n,u];return(0,H.jsx)(_p,{propKey:u,path:d,prop:c,depth:r+1,depthLimit:o,disabled:i,rawRoot:e.rawRoot,bindings:e.bindings,canRename:!0,onChange:(f,m)=>e.onChange({...t,value:{...a,[u]:f}},m),onRename:f=>{if(f===u||It(a,f))return;let m={};for(let[v,g]of Object.entries(a))m[v===u?f:v]=g;e.onChange({...t,value:m},{valuePaths:[],remaps:[{from:d,to:[...n,f]}]})},onDelete:()=>{let f={...a};delete f[u],e.onChange({...t,value:f},pw)},onEditCg:e.onEditCg,canEditCg:e.canEditCg},u)}),(0,H.jsx)(wp,{disabled:i,noun:"\u5B50\u5B57\u6BB5",onAdd:u=>{let c=cw(a);e.onChange({...t,value:{...a,[c]:{value:vu(u)}}},{valuePaths:[[...n,c]],remaps:[]})}})]})}function Rb(e){let t=(0,Gt.useMemo)(()=>{let l=nw(e.value);return delete l[Un],l},[e.value]),n=e.cgBindings??[],r=Math.max(1,Math.floor(e.depthLimit??hb)),o=e.canEditCg??(()=>!0),i=(l,s=[],a=[])=>e.onDraftChange(wb(e.value,l,s,a));return(0,H.jsxs)("section",{className:"world-property-tree","aria-label":"\u4E16\u754C\u5C5E\u6027\u6811","data-testid":"world-property-tree",children:[(0,H.jsx)("header",{className:"world-property-tree__header",children:(0,H.jsx)("strong",{children:"\u4E16\u754C\u5C5E\u6027"})}),Object.entries(t).map(([l,s])=>(0,H.jsx)(_p,{propKey:l,path:[l],prop:s,depth:1,depthLimit:r,disabled:e.disabled===!0,rawRoot:e.value,bindings:n,canRename:!0,onChange:(a,u)=>i({...t,[l]:a},u.valuePaths,u.remaps),onRename:a=>{let u=Sb(t,[l],a);u!==t&&i(u,[],[{from:[l],to:[a]}])},onDelete:()=>i(_b(t,[l])),onEditCg:e.onEditCg,canEditCg:o},l)),(0,H.jsx)(wp,{disabled:e.disabled===!0,noun:"\u5C5E\u6027",onAdd:l=>{let s=cw(t);i({...t,[s]:{value:vu(l)}},[[s]])}})]})}function Ab(e){return(0,H.jsx)(vp,{resetKey:e.value,children:(0,H.jsx)(Rb,{...e})})}function Db(e,t){let n=(0,lw.createRoot)(e),r=o=>n.render((0,H.jsx)(Ab,{...o}));return r(t),{update:r,destroy:()=>n.unmount()}}var gw=We(Yr(),1);function rT(e,t){let n=(0,mw.createRoot)(e),r=o=>{n.render((0,gw.jsx)(fp,{...o}))};return r(t),{update:r,destroy:()=>n.unmount()}}export{Ml as isGraphGroupBoundsValid,rT as mountLocalGraph,Db as mountLocalWorldPropertyTree};
|
|
9
|
+
/*! Bundled license information:
|
|
10
|
+
|
|
11
|
+
react/cjs/react.production.min.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license React
|
|
14
|
+
* react.production.min.js
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*)
|
|
21
|
+
|
|
22
|
+
scheduler/cjs/scheduler.production.min.js:
|
|
23
|
+
(**
|
|
24
|
+
* @license React
|
|
25
|
+
* scheduler.production.min.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*)
|
|
32
|
+
|
|
33
|
+
react-dom/cjs/react-dom.production.min.js:
|
|
34
|
+
(**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom.production.min.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*)
|
|
43
|
+
|
|
44
|
+
react/cjs/react-jsx-runtime.production.min.js:
|
|
45
|
+
(**
|
|
46
|
+
* @license React
|
|
47
|
+
* react-jsx-runtime.production.min.js
|
|
48
|
+
*
|
|
49
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the MIT license found in the
|
|
52
|
+
* LICENSE file in the root directory of this source tree.
|
|
53
|
+
*)
|
|
54
|
+
|
|
55
|
+
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
|
|
56
|
+
(**
|
|
57
|
+
* @license React
|
|
58
|
+
* use-sync-external-store-shim.production.js
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE file in the root directory of this source tree.
|
|
64
|
+
*)
|
|
65
|
+
|
|
66
|
+
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
|
|
67
|
+
(**
|
|
68
|
+
* @license React
|
|
69
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
70
|
+
*
|
|
71
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the MIT license found in the
|
|
74
|
+
* LICENSE file in the root directory of this source tree.
|
|
75
|
+
*)
|
|
76
|
+
*/
|