datadoom 0.1.0.dev0__py3-none-any.whl

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.
Files changed (122) hide show
  1. datadoom/__init__.py +23 -0
  2. datadoom/adapters/__init__.py +29 -0
  3. datadoom/adapters/frameworks.py +94 -0
  4. datadoom/adapters/loaders.py +72 -0
  5. datadoom/api/__init__.py +11 -0
  6. datadoom/api/app.py +109 -0
  7. datadoom/api/deps.py +30 -0
  8. datadoom/api/errors.py +89 -0
  9. datadoom/api/estimate.py +82 -0
  10. datadoom/api/routes/__init__.py +7 -0
  11. datadoom/api/routes/artifacts.py +147 -0
  12. datadoom/api/routes/datasets.py +180 -0
  13. datadoom/api/routes/meta.py +45 -0
  14. datadoom/api/routes/plugins.py +22 -0
  15. datadoom/api/routes/runs.py +144 -0
  16. datadoom/api/routes/specs.py +73 -0
  17. datadoom/api/routes/templates.py +30 -0
  18. datadoom/api/schemas.py +230 -0
  19. datadoom/api/serializers.py +143 -0
  20. datadoom/api/state.py +24 -0
  21. datadoom/api/store_helpers.py +56 -0
  22. datadoom/api/ws.py +72 -0
  23. datadoom/cli/__init__.py +1 -0
  24. datadoom/cli/main.py +313 -0
  25. datadoom/config.py +108 -0
  26. datadoom/engine/__init__.py +38 -0
  27. datadoom/engine/advice.py +289 -0
  28. datadoom/engine/audit.py +290 -0
  29. datadoom/engine/causal/__init__.py +15 -0
  30. datadoom/engine/causal/execute.py +116 -0
  31. datadoom/engine/causal/functions.py +116 -0
  32. datadoom/engine/causal/graph.py +54 -0
  33. datadoom/engine/difficulty/__init__.py +36 -0
  34. datadoom/engine/difficulty/calibrate.py +235 -0
  35. datadoom/engine/difficulty/knobs.py +171 -0
  36. datadoom/engine/difficulty/probes.py +181 -0
  37. datadoom/engine/dist/__init__.py +35 -0
  38. datadoom/engine/dist/base.py +46 -0
  39. datadoom/engine/dist/builtins.py +172 -0
  40. datadoom/engine/dist/compliance.py +344 -0
  41. datadoom/engine/dist/providers.py +117 -0
  42. datadoom/engine/errors.py +32 -0
  43. datadoom/engine/export/__init__.py +27 -0
  44. datadoom/engine/export/base.py +49 -0
  45. datadoom/engine/export/checksums.py +18 -0
  46. datadoom/engine/export/csv_exporter.py +34 -0
  47. datadoom/engine/export/json_exporter.py +67 -0
  48. datadoom/engine/export/metadata.py +58 -0
  49. datadoom/engine/export/parquet_exporter.py +45 -0
  50. datadoom/engine/failure/__init__.py +18 -0
  51. datadoom/engine/failure/apply.py +37 -0
  52. datadoom/engine/failure/base.py +116 -0
  53. datadoom/engine/failure/modes.py +442 -0
  54. datadoom/engine/pipeline.py +418 -0
  55. datadoom/engine/profile.py +327 -0
  56. datadoom/engine/progress.py +14 -0
  57. datadoom/engine/reference.py +338 -0
  58. datadoom/engine/reports.py +206 -0
  59. datadoom/engine/rng.py +79 -0
  60. datadoom/engine/spec/__init__.py +45 -0
  61. datadoom/engine/spec/hashing.py +57 -0
  62. datadoom/engine/spec/models.py +238 -0
  63. datadoom/engine/spec/validate.py +345 -0
  64. datadoom/engine/timeseries.py +88 -0
  65. datadoom/jobs/__init__.py +14 -0
  66. datadoom/jobs/progress.py +155 -0
  67. datadoom/jobs/worker.py +162 -0
  68. datadoom/plugin.py +35 -0
  69. datadoom/plugins/__init__.py +47 -0
  70. datadoom/plugins/contracts.py +72 -0
  71. datadoom/plugins/loader.py +125 -0
  72. datadoom/plugins/registry.py +214 -0
  73. datadoom/plugins/scaffold.py +434 -0
  74. datadoom/store/__init__.py +47 -0
  75. datadoom/store/artifacts.py +67 -0
  76. datadoom/store/db.py +104 -0
  77. datadoom/store/migrations/__init__.py +0 -0
  78. datadoom/store/migrations/env.py +53 -0
  79. datadoom/store/migrations/script.py.mako +24 -0
  80. datadoom/store/migrations/versions/0001_init.py +149 -0
  81. datadoom/store/migrations/versions/0002_report_mutual_information.py +23 -0
  82. datadoom/store/migrations/versions/0003_run_name.py +23 -0
  83. datadoom/store/migrations/versions/0004_report_profile.py +24 -0
  84. datadoom/store/models.py +170 -0
  85. datadoom/store/repositories.py +279 -0
  86. datadoom/templates/__init__.py +239 -0
  87. datadoom/templates/ab_test.datadoom.yaml +46 -0
  88. datadoom/templates/clinical_deterioration.datadoom.yaml +124 -0
  89. datadoom/templates/credit_default_challenge.datadoom.yaml +147 -0
  90. datadoom/templates/customer_churn.datadoom.yaml +60 -0
  91. datadoom/templates/ecommerce_orders.datadoom.yaml +46 -0
  92. datadoom/templates/fraud_detection.datadoom.yaml +57 -0
  93. datadoom/templates/hospital_readmission.datadoom.yaml +61 -0
  94. datadoom/templates/insurance_claims.datadoom.yaml +43 -0
  95. datadoom/templates/iot_sensors.datadoom.yaml +44 -0
  96. datadoom/templates/people_directory.datadoom.yaml +56 -0
  97. datadoom/templates/predictive_maintenance.datadoom.yaml +107 -0
  98. datadoom/templates/telecom_churn_challenge.datadoom.yaml +125 -0
  99. datadoom/version.py +3 -0
  100. datadoom/webdist/assets/index-V8VAuTJG.js +445 -0
  101. datadoom/webdist/assets/index-doRjyG5s.css +1 -0
  102. datadoom/webdist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  103. datadoom/webdist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  104. datadoom/webdist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  105. datadoom/webdist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  106. datadoom/webdist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  107. datadoom/webdist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  108. datadoom/webdist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  109. datadoom/webdist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  110. datadoom/webdist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  111. datadoom/webdist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  112. datadoom/webdist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  113. datadoom/webdist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  114. datadoom/webdist/assets/space-grotesk-latin-ext-wght-normal-D9tNdqV9.woff2 +0 -0
  115. datadoom/webdist/assets/space-grotesk-latin-wght-normal-BhU9QXUp.woff2 +0 -0
  116. datadoom/webdist/assets/space-grotesk-vietnamese-wght-normal-D0rl6rjA.woff2 +0 -0
  117. datadoom/webdist/index.html +15 -0
  118. datadoom-0.1.0.dev0.dist-info/METADATA +143 -0
  119. datadoom-0.1.0.dev0.dist-info/RECORD +122 -0
  120. datadoom-0.1.0.dev0.dist-info/WHEEL +4 -0
  121. datadoom-0.1.0.dev0.dist-info/entry_points.txt +2 -0
  122. datadoom-0.1.0.dev0.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,445 @@
1
+ var _w=Object.defineProperty;var Yh=e=>{throw TypeError(e)};var Mw=(e,t,n)=>t in e?_w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zi=(e,t,n)=>Mw(e,typeof t!="symbol"?t+"":t,n),Uc=(e,t,n)=>t.has(e)||Yh("Cannot "+n);var _=(e,t,n)=>(Uc(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?Yh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),K=(e,t,n,r)=>(Uc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ae=(e,t,n)=>(Uc(e,t,"access private method"),n);var ko=(e,t,n,r)=>({set _(s){K(e,t,s,n)},get _(){return _(e,t,r)}});function Pw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Gx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xx={exports:{}},sc={},Yx={exports:{}},ce={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var fo=Symbol.for("react.element"),zw=Symbol.for("react.portal"),$w=Symbol.for("react.fragment"),Tw=Symbol.for("react.strict_mode"),Rw=Symbol.for("react.profiler"),Dw=Symbol.for("react.provider"),Ow=Symbol.for("react.context"),Aw=Symbol.for("react.forward_ref"),Fw=Symbol.for("react.suspense"),Lw=Symbol.for("react.memo"),Iw=Symbol.for("react.lazy"),Zh=Symbol.iterator;function Uw(e){return e===null||typeof e!="object"?null:(e=Zh&&e[Zh]||e["@@iterator"],typeof e=="function"?e:null)}var Zx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jx=Object.assign,eg={};function Hi(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Zx}Hi.prototype.isReactComponent={};Hi.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")};Hi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tg(){}tg.prototype=Hi.prototype;function hf(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Zx}var mf=hf.prototype=new tg;mf.constructor=hf;Jx(mf,Hi.prototype);mf.isPureReactComponent=!0;var Jh=Array.isArray,ng=Object.prototype.hasOwnProperty,pf={current:null},rg={key:!0,ref:!0,__self:!0,__source:!0};function sg(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)ng.call(t,r)&&!rg.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:fo,type:e,key:i,ref:o,props:s,_owner:pf.current}}function Bw(e,t){return{$$typeof:fo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xf(e){return typeof e=="object"&&e!==null&&e.$$typeof===fo}function Hw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var em=/\/+/g;function Bc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Hw(""+e.key):t.toString(36)}function el(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case fo:case zw:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Bc(o,0):r,Jh(s)?(n="",e!=null&&(n=e.replace(em,"$&/")+"/"),el(s,t,n,"",function(u){return u})):s!=null&&(xf(s)&&(s=Bw(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(em,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Jh(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Bc(i,l);o+=el(i,t,n,c,s)}else if(c=Uw(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Bc(i,l++),o+=el(i,t,n,c,s);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 o}function So(e,t,n){if(e==null)return e;var r=[],s=0;return el(e,r,"","",function(i){return t.call(n,i,s++)}),r}function Vw(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 bt={current:null},tl={transition:null},Ww={ReactCurrentDispatcher:bt,ReactCurrentBatchConfig:tl,ReactCurrentOwner:pf};function ig(){throw Error("act(...) is not supported in production builds of React.")}ce.Children={map:So,forEach:function(e,t,n){So(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return So(e,function(){t++}),t},toArray:function(e){return So(e,function(t){return t})||[]},only:function(e){if(!xf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ce.Component=Hi;ce.Fragment=$w;ce.Profiler=Rw;ce.PureComponent=hf;ce.StrictMode=Tw;ce.Suspense=Fw;ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ww;ce.act=ig;ce.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=Jx({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=pf.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)ng.call(t,c)&&!rg.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:fo,type:e.type,key:s,ref:i,props:r,_owner:o}};ce.createContext=function(e){return e={$$typeof:Ow,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Dw,_context:e},e.Consumer=e};ce.createElement=sg;ce.createFactory=function(e){var t=sg.bind(null,e);return t.type=e,t};ce.createRef=function(){return{current:null}};ce.forwardRef=function(e){return{$$typeof:Aw,render:e}};ce.isValidElement=xf;ce.lazy=function(e){return{$$typeof:Iw,_payload:{_status:-1,_result:e},_init:Vw}};ce.memo=function(e,t){return{$$typeof:Lw,type:e,compare:t===void 0?null:t}};ce.startTransition=function(e){var t=tl.transition;tl.transition={};try{e()}finally{tl.transition=t}};ce.unstable_act=ig;ce.useCallback=function(e,t){return bt.current.useCallback(e,t)};ce.useContext=function(e){return bt.current.useContext(e)};ce.useDebugValue=function(){};ce.useDeferredValue=function(e){return bt.current.useDeferredValue(e)};ce.useEffect=function(e,t){return bt.current.useEffect(e,t)};ce.useId=function(){return bt.current.useId()};ce.useImperativeHandle=function(e,t,n){return bt.current.useImperativeHandle(e,t,n)};ce.useInsertionEffect=function(e,t){return bt.current.useInsertionEffect(e,t)};ce.useLayoutEffect=function(e,t){return bt.current.useLayoutEffect(e,t)};ce.useMemo=function(e,t){return bt.current.useMemo(e,t)};ce.useReducer=function(e,t,n){return bt.current.useReducer(e,t,n)};ce.useRef=function(e){return bt.current.useRef(e)};ce.useState=function(e){return bt.current.useState(e)};ce.useSyncExternalStore=function(e,t,n){return bt.current.useSyncExternalStore(e,t,n)};ce.useTransition=function(){return bt.current.useTransition()};ce.version="18.3.1";Yx.exports=ce;var b=Yx.exports;const O=Gx(b),Qw=Pw({__proto__:null,default:O},[b]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Kw=b,qw=Symbol.for("react.element"),Gw=Symbol.for("react.fragment"),Xw=Object.prototype.hasOwnProperty,Yw=Kw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Zw={key:!0,ref:!0,__self:!0,__source:!0};function ag(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Xw.call(t,r)&&!Zw.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:qw,type:e,key:i,ref:o,props:s,_owner:Yw.current}}sc.Fragment=Gw;sc.jsx=ag;sc.jsxs=ag;Xx.exports=sc;var a=Xx.exports,Tu={},og={exports:{}},It={},lg={exports:{}},cg={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(C,k){var z=C.length;C.push(k);e:for(;0<z;){var A=z-1>>>1,F=C[A];if(0<s(F,k))C[A]=k,C[z]=F,z=A;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var k=C[0],z=C.pop();if(z!==k){C[0]=z;e:for(var A=0,F=C.length,Q=F>>>1;A<Q;){var W=2*(A+1)-1,Z=C[W],re=W+1,ie=C[re];if(0>s(Z,z))re<F&&0>s(ie,Z)?(C[A]=ie,C[re]=z,A=re):(C[A]=Z,C[W]=z,A=W);else if(re<F&&0>s(ie,z))C[A]=ie,C[re]=z,A=re;else break e}}return k}function s(C,k){var z=C.sortIndex-k.sortIndex;return z!==0?z:C.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],f=1,d=null,h=3,x=!1,w=!1,v=!1,j=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(C){for(var k=n(u);k!==null;){if(k.callback===null)r(u);else if(k.startTime<=C)r(u),k.sortIndex=k.expirationTime,t(c,k);else break;k=n(u)}}function g(C){if(v=!1,y(C),!w)if(n(c)!==null)w=!0,T(N);else{var k=n(u);k!==null&&I(g,k.startTime-C)}}function N(C,k){w=!1,v&&(v=!1,p(M),M=-1),x=!0;var z=h;try{for(y(k),d=n(c);d!==null&&(!(d.expirationTime>k)||C&&!L());){var A=d.callback;if(typeof A=="function"){d.callback=null,h=d.priorityLevel;var F=A(d.expirationTime<=k);k=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(c)&&r(c),y(k)}else r(c);d=n(c)}if(d!==null)var Q=!0;else{var W=n(u);W!==null&&I(g,W.startTime-k),Q=!1}return Q}finally{d=null,h=z,x=!1}}var E=!1,P=null,M=-1,$=5,R=-1;function L(){return!(e.unstable_now()-R<$)}function U(){if(P!==null){var C=e.unstable_now();R=C;var k=!0;try{k=P(!0,C)}finally{k?H():(E=!1,P=null)}}else E=!1}var H;if(typeof m=="function")H=function(){m(U)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,D=S.port2;S.port1.onmessage=U,H=function(){D.postMessage(null)}}else H=function(){j(U,0)};function T(C){P=C,E||(E=!0,H())}function I(C,k){M=j(function(){C(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,T(N))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var k=3;break;default:k=h}var z=h;h=k;try{return C()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,k){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var z=h;h=C;try{return k()}finally{h=z}},e.unstable_scheduleCallback=function(C,k,z){var A=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?A+z:A):z=A,C){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=z+F,C={id:f++,callback:k,priorityLevel:C,startTime:z,expirationTime:F,sortIndex:-1},z>A?(C.sortIndex=z,t(u,C),n(c)===null&&C===n(u)&&(v?(p(M),M=-1):v=!0,I(g,z-A))):(C.sortIndex=F,t(c,C),w||x||(w=!0,T(N))),C},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(C){var k=h;return function(){var z=h;h=k;try{return C.apply(this,arguments)}finally{h=z}}}})(cg);lg.exports=cg;var Jw=lg.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var eb=b,Ft=Jw;function V(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 ug=new Set,$a={};function Ts(e,t){Mi(e,t),Mi(e+"Capture",t)}function Mi(e,t){for($a[e]=t,e=0;e<t.length;e++)ug.add(t[e])}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ru=Object.prototype.hasOwnProperty,tb=/^[: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]*$/,tm={},nm={};function nb(e){return Ru.call(nm,e)?!0:Ru.call(tm,e)?!1:tb.test(e)?nm[e]=!0:(tm[e]=!0,!1)}function rb(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 sb(e,t,n,r){if(t===null||typeof t>"u"||rb(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 jt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ot[e]=new jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ot[t]=new jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ot[e]=new jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ot[e]=new jt(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){ot[e]=new jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ot[e]=new jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ot[e]=new jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ot[e]=new jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ot[e]=new jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var gf=/[\-:]([a-z])/g;function yf(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(gf,yf);ot[t]=new jt(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(gf,yf);ot[t]=new jt(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(gf,yf);ot[t]=new jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ot[e]=new jt(e,1,!1,e.toLowerCase(),null,!1,!1)});ot.xlinkHref=new jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ot[e]=new jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function vf(e,t,n,r){var s=ot.hasOwnProperty(t)?ot[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(sb(t,n,s,r)&&(n=null),r||s===null?nb(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Zn=eb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Co=Symbol.for("react.element"),Vs=Symbol.for("react.portal"),Ws=Symbol.for("react.fragment"),wf=Symbol.for("react.strict_mode"),Du=Symbol.for("react.profiler"),dg=Symbol.for("react.provider"),fg=Symbol.for("react.context"),bf=Symbol.for("react.forward_ref"),Ou=Symbol.for("react.suspense"),Au=Symbol.for("react.suspense_list"),jf=Symbol.for("react.memo"),ar=Symbol.for("react.lazy"),hg=Symbol.for("react.offscreen"),rm=Symbol.iterator;function Ji(e){return e===null||typeof e!="object"?null:(e=rm&&e[rm]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Object.assign,Hc;function ha(e){if(Hc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Hc=t&&t[1]||""}return`
34
+ `+Hc+e}var Vc=!1;function Wc(e,t){if(!e||Vc)return"";Vc=!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 s=u.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=`
37
+ `+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Vc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ha(e):""}function ib(e){switch(e.tag){case 5:return ha(e.type);case 16:return ha("Lazy");case 13:return ha("Suspense");case 19:return ha("SuspenseList");case 0:case 2:case 15:return e=Wc(e.type,!1),e;case 11:return e=Wc(e.type.render,!1),e;case 1:return e=Wc(e.type,!0),e;default:return""}}function Fu(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 Ws:return"Fragment";case Vs:return"Portal";case Du:return"Profiler";case wf:return"StrictMode";case Ou:return"Suspense";case Au:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fg:return(e.displayName||"Context")+".Consumer";case dg:return(e._context.displayName||"Context")+".Provider";case bf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jf:return t=e.displayName||null,t!==null?t:Fu(e.type)||"Memo";case ar:t=e._payload,e=e._init;try{return Fu(e(t))}catch{}}return null}function ab(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 Fu(t);case 8:return t===wf?"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 mg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ob(e){var t=mg(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Eo(e){e._valueTracker||(e._valueTracker=ob(e))}function pg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vl(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 Lu(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sm(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 xg(e,t){t=t.checked,t!=null&&vf(e,"checked",t,!1)}function Iu(e,t){xg(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")?Uu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Uu(e,t.type,Fr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function im(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 Uu(e,t,n){(t!=="number"||vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ma=Array.isArray;function si(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Bu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function am(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(ma(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fr(n)}}function gg(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 om(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function yg(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 Hu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?yg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _o,vg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_o=_o||document.createElement("div"),_o.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_o.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Na={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},lb=["Webkit","ms","Moz","O"];Object.keys(Na).forEach(function(e){lb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Na[t]=Na[e]})});function wg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Na.hasOwnProperty(e)&&Na[e]?(""+t).trim():t+"px"}function bg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=wg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var cb=Ae({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 Vu(e,t){if(t){if(cb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Wu(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 Qu=null;function Nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ku=null,ii=null,ai=null;function lm(e){if(e=po(e)){if(typeof Ku!="function")throw Error(V(280));var t=e.stateNode;t&&(t=cc(t),Ku(e.stateNode,e.type,t))}}function jg(e){ii?ai?ai.push(e):ai=[e]:ii=e}function Ng(){if(ii){var e=ii,t=ai;if(ai=ii=null,lm(e),t)for(e=0;e<t.length;e++)lm(t[e])}}function kg(e,t){return e(t)}function Sg(){}var Qc=!1;function Cg(e,t,n){if(Qc)return e(t,n);Qc=!0;try{return kg(e,t,n)}finally{Qc=!1,(ii!==null||ai!==null)&&(Sg(),Ng())}}function Ra(e,t){var n=e.stateNode;if(n===null)return null;var r=cc(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(V(231,t,typeof n));return n}var qu=!1;if(Wn)try{var ea={};Object.defineProperty(ea,"passive",{get:function(){qu=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch{qu=!1}function ub(e,t,n,r,s,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var ka=!1,wl=null,bl=!1,Gu=null,db={onError:function(e){ka=!0,wl=e}};function fb(e,t,n,r,s,i,o,l,c){ka=!1,wl=null,ub.apply(db,arguments)}function hb(e,t,n,r,s,i,o,l,c){if(fb.apply(this,arguments),ka){if(ka){var u=wl;ka=!1,wl=null}else throw Error(V(198));bl||(bl=!0,Gu=u)}}function Rs(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 Eg(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 cm(e){if(Rs(e)!==e)throw Error(V(188))}function mb(e){var t=e.alternate;if(!t){if(t=Rs(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return cm(s),e;if(i===r)return cm(s),t;i=i.sibling}throw Error(V(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function _g(e){return e=mb(e),e!==null?Mg(e):null}function Mg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mg(e);if(t!==null)return t;e=e.sibling}return null}var Pg=Ft.unstable_scheduleCallback,um=Ft.unstable_cancelCallback,pb=Ft.unstable_shouldYield,xb=Ft.unstable_requestPaint,He=Ft.unstable_now,gb=Ft.unstable_getCurrentPriorityLevel,kf=Ft.unstable_ImmediatePriority,zg=Ft.unstable_UserBlockingPriority,jl=Ft.unstable_NormalPriority,yb=Ft.unstable_LowPriority,$g=Ft.unstable_IdlePriority,ic=null,jn=null;function vb(e){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(ic,e,void 0,(e.current.flags&128)===128)}catch{}}var cn=Math.clz32?Math.clz32:jb,wb=Math.log,bb=Math.LN2;function jb(e){return e>>>=0,e===0?32:31-(wb(e)/bb|0)|0}var Mo=64,Po=4194304;function pa(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 Nl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=pa(l):(i&=o,i!==0&&(r=pa(i)))}else o=n&~s,o!==0?r=pa(o):i!==0&&(r=pa(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===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-cn(t),s=1<<n,r|=e[n],t&=~s;return r}function Nb(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 kb(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-cn(i),l=1<<o,c=s[o];c===-1?(!(l&n)||l&r)&&(s[o]=Nb(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Xu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tg(){var e=Mo;return Mo<<=1,!(Mo&4194240)&&(Mo=64),e}function Kc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ho(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=n}function Sb(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 s=31-cn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Sf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-cn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var be=0;function Rg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dg,Cf,Og,Ag,Fg,Yu=!1,zo=[],Cr=null,Er=null,_r=null,Da=new Map,Oa=new Map,ur=[],Cb="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 dm(e,t){switch(e){case"focusin":case"focusout":Cr=null;break;case"dragenter":case"dragleave":Er=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":Da.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oa.delete(t.pointerId)}}function ta(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=po(t),t!==null&&Cf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Eb(e,t,n,r,s){switch(t){case"focusin":return Cr=ta(Cr,e,t,n,r,s),!0;case"dragenter":return Er=ta(Er,e,t,n,r,s),!0;case"mouseover":return _r=ta(_r,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Da.set(i,ta(Da.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Oa.set(i,ta(Oa.get(i)||null,e,t,n,r,s)),!0}return!1}function Lg(e){var t=rs(e.target);if(t!==null){var n=Rs(t);if(n!==null){if(t=n.tag,t===13){if(t=Eg(n),t!==null){e.blockedOn=t,Fg(e.priority,function(){Og(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 nl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qu=r,n.target.dispatchEvent(r),Qu=null}else return t=po(n),t!==null&&Cf(t),e.blockedOn=n,!1;t.shift()}return!0}function fm(e,t,n){nl(e)&&n.delete(t)}function _b(){Yu=!1,Cr!==null&&nl(Cr)&&(Cr=null),Er!==null&&nl(Er)&&(Er=null),_r!==null&&nl(_r)&&(_r=null),Da.forEach(fm),Oa.forEach(fm)}function na(e,t){e.blockedOn===t&&(e.blockedOn=null,Yu||(Yu=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,_b)))}function Aa(e){function t(s){return na(s,e)}if(0<zo.length){na(zo[0],e);for(var n=1;n<zo.length;n++){var r=zo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Cr!==null&&na(Cr,e),Er!==null&&na(Er,e),_r!==null&&na(_r,e),Da.forEach(t),Oa.forEach(t),n=0;n<ur.length;n++)r=ur[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ur.length&&(n=ur[0],n.blockedOn===null);)Lg(n),n.blockedOn===null&&ur.shift()}var oi=Zn.ReactCurrentBatchConfig,kl=!0;function Mb(e,t,n,r){var s=be,i=oi.transition;oi.transition=null;try{be=1,Ef(e,t,n,r)}finally{be=s,oi.transition=i}}function Pb(e,t,n,r){var s=be,i=oi.transition;oi.transition=null;try{be=4,Ef(e,t,n,r)}finally{be=s,oi.transition=i}}function Ef(e,t,n,r){if(kl){var s=Zu(e,t,n,r);if(s===null)ru(e,t,r,Sl,n),dm(e,r);else if(Eb(s,e,t,n,r))r.stopPropagation();else if(dm(e,r),t&4&&-1<Cb.indexOf(e)){for(;s!==null;){var i=po(s);if(i!==null&&Dg(i),i=Zu(e,t,n,r),i===null&&ru(e,t,r,Sl,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else ru(e,t,r,null,n)}}var Sl=null;function Zu(e,t,n,r){if(Sl=null,e=Nf(r),e=rs(e),e!==null)if(t=Rs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Eg(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 Sl=e,null}function Ig(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(gb()){case kf:return 1;case zg:return 4;case jl:case yb:return 16;case $g:return 536870912;default:return 16}default:return 16}}var jr=null,_f=null,rl=null;function Ug(){if(rl)return rl;var e,t=_f,n=t.length,r,s="value"in jr?jr.value:jr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return rl=s.slice(e,1<r?1-r:void 0)}function sl(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 $o(){return!0}function hm(){return!1}function Ut(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$o:hm,this.isPropagationStopped=hm,this}return Ae(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=$o)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$o)},persist:function(){},isPersistent:$o}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mf=Ut(Vi),mo=Ae({},Vi,{view:0,detail:0}),zb=Ut(mo),qc,Gc,ra,ac=Ae({},mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pf,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!==ra&&(ra&&e.type==="mousemove"?(qc=e.screenX-ra.screenX,Gc=e.screenY-ra.screenY):Gc=qc=0,ra=e),qc)},movementY:function(e){return"movementY"in e?e.movementY:Gc}}),mm=Ut(ac),$b=Ae({},ac,{dataTransfer:0}),Tb=Ut($b),Rb=Ae({},mo,{relatedTarget:0}),Xc=Ut(Rb),Db=Ae({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ob=Ut(Db),Ab=Ae({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fb=Ut(Ab),Lb=Ae({},Vi,{data:0}),pm=Ut(Lb),Ib={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ub={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"},Bb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bb[e])?!!t[e]:!1}function Pf(){return Hb}var Vb=Ae({},mo,{key:function(e){if(e.key){var t=Ib[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ub[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pf,charCode:function(e){return e.type==="keypress"?sl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wb=Ut(Vb),Qb=Ae({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xm=Ut(Qb),Kb=Ae({},mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pf}),qb=Ut(Kb),Gb=Ae({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xb=Ut(Gb),Yb=Ae({},ac,{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}),Zb=Ut(Yb),Jb=[9,13,27,32],zf=Wn&&"CompositionEvent"in window,Sa=null;Wn&&"documentMode"in document&&(Sa=document.documentMode);var e2=Wn&&"TextEvent"in window&&!Sa,Bg=Wn&&(!zf||Sa&&8<Sa&&11>=Sa),gm=" ",ym=!1;function Hg(e,t){switch(e){case"keyup":return Jb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qs=!1;function t2(e,t){switch(e){case"compositionend":return Vg(t);case"keypress":return t.which!==32?null:(ym=!0,gm);case"textInput":return e=t.data,e===gm&&ym?null:e;default:return null}}function n2(e,t){if(Qs)return e==="compositionend"||!zf&&Hg(e,t)?(e=Ug(),rl=_f=jr=null,Qs=!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 Bg&&t.locale!=="ko"?null:t.data;default:return null}}var r2={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 vm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!r2[e.type]:t==="textarea"}function Wg(e,t,n,r){jg(r),t=Cl(t,"onChange"),0<t.length&&(n=new Mf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ca=null,Fa=null;function s2(e){ny(e,0)}function oc(e){var t=Gs(e);if(pg(t))return e}function i2(e,t){if(e==="change")return t}var Qg=!1;if(Wn){var Yc;if(Wn){var Zc="oninput"in document;if(!Zc){var wm=document.createElement("div");wm.setAttribute("oninput","return;"),Zc=typeof wm.oninput=="function"}Yc=Zc}else Yc=!1;Qg=Yc&&(!document.documentMode||9<document.documentMode)}function bm(){Ca&&(Ca.detachEvent("onpropertychange",Kg),Fa=Ca=null)}function Kg(e){if(e.propertyName==="value"&&oc(Fa)){var t=[];Wg(t,Fa,e,Nf(e)),Cg(s2,t)}}function a2(e,t,n){e==="focusin"?(bm(),Ca=t,Fa=n,Ca.attachEvent("onpropertychange",Kg)):e==="focusout"&&bm()}function o2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oc(Fa)}function l2(e,t){if(e==="click")return oc(t)}function c2(e,t){if(e==="input"||e==="change")return oc(t)}function u2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:u2;function La(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 s=n[r];if(!Ru.call(t,s)||!dn(e[s],t[s]))return!1}return!0}function jm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nm(e,t){var n=jm(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=jm(n)}}function qg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gg(){for(var e=window,t=vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vl(e.document)}return t}function $f(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 d2(e){var t=Gg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qg(n.ownerDocument.documentElement,n)){if(r!==null&&$f(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Nm(n,i);var o=Nm(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 f2=Wn&&"documentMode"in document&&11>=document.documentMode,Ks=null,Ju=null,Ea=null,ed=!1;function km(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ed||Ks==null||Ks!==vl(r)||(r=Ks,"selectionStart"in r&&$f(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}),Ea&&La(Ea,r)||(Ea=r,r=Cl(Ju,"onSelect"),0<r.length&&(t=new Mf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ks)))}function To(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qs={animationend:To("Animation","AnimationEnd"),animationiteration:To("Animation","AnimationIteration"),animationstart:To("Animation","AnimationStart"),transitionend:To("Transition","TransitionEnd")},Jc={},Xg={};Wn&&(Xg=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function lc(e){if(Jc[e])return Jc[e];if(!qs[e])return e;var t=qs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xg)return Jc[e]=t[n];return e}var Yg=lc("animationend"),Zg=lc("animationiteration"),Jg=lc("animationstart"),ey=lc("transitionend"),ty=new Map,Sm="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 Br(e,t){ty.set(e,t),Ts(t,[e])}for(var eu=0;eu<Sm.length;eu++){var tu=Sm[eu],h2=tu.toLowerCase(),m2=tu[0].toUpperCase()+tu.slice(1);Br(h2,"on"+m2)}Br(Yg,"onAnimationEnd");Br(Zg,"onAnimationIteration");Br(Jg,"onAnimationStart");Br("dblclick","onDoubleClick");Br("focusin","onFocus");Br("focusout","onBlur");Br(ey,"onTransitionEnd");Mi("onMouseEnter",["mouseout","mouseover"]);Mi("onMouseLeave",["mouseout","mouseover"]);Mi("onPointerEnter",["pointerout","pointerover"]);Mi("onPointerLeave",["pointerout","pointerover"]);Ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ts("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="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(" "),p2=new Set("cancel close invalid load scroll toggle".split(" ").concat(xa));function Cm(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hb(r,t,void 0,e),e.currentTarget=null}function ny(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;Cm(s,l,u),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;Cm(s,l,u),i=c}}}if(bl)throw e=Gu,bl=!1,Gu=null,e}function Ce(e,t){var n=t[id];n===void 0&&(n=t[id]=new Set);var r=e+"__bubble";n.has(r)||(ry(t,e,2,!1),n.add(r))}function nu(e,t,n){var r=0;t&&(r|=4),ry(n,e,r,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function Ia(e){if(!e[Ro]){e[Ro]=!0,ug.forEach(function(n){n!=="selectionchange"&&(p2.has(n)||nu(n,!1,e),nu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ro]||(t[Ro]=!0,nu("selectionchange",!1,t))}}function ry(e,t,n,r){switch(Ig(t)){case 1:var s=Mb;break;case 4:s=Pb;break;default:s=Ef}n=s.bind(null,t,n,e),s=void 0,!qu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function ru(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=rs(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}Cg(function(){var u=i,f=Nf(n),d=[];e:{var h=ty.get(e);if(h!==void 0){var x=Mf,w=e;switch(e){case"keypress":if(sl(n)===0)break e;case"keydown":case"keyup":x=Wb;break;case"focusin":w="focus",x=Xc;break;case"focusout":w="blur",x=Xc;break;case"beforeblur":case"afterblur":x=Xc;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":x=mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=qb;break;case Yg:case Zg:case Jg:x=Ob;break;case ey:x=Xb;break;case"scroll":x=zb;break;case"wheel":x=Zb;break;case"copy":case"cut":case"paste":x=Fb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=xm}var v=(t&4)!==0,j=!v&&e==="scroll",p=v?h!==null?h+"Capture":null:h;v=[];for(var m=u,y;m!==null;){y=m;var g=y.stateNode;if(y.tag===5&&g!==null&&(y=g,p!==null&&(g=Ra(m,p),g!=null&&v.push(Ua(m,g,y)))),j)break;m=m.return}0<v.length&&(h=new x(h,w,null,n,f),d.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",h&&n!==Qu&&(w=n.relatedTarget||n.fromElement)&&(rs(w)||w[Qn]))break e;if((x||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,x?(w=n.relatedTarget||n.toElement,x=u,w=w?rs(w):null,w!==null&&(j=Rs(w),w!==j||w.tag!==5&&w.tag!==6)&&(w=null)):(x=null,w=u),x!==w)){if(v=mm,g="onMouseLeave",p="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=xm,g="onPointerLeave",p="onPointerEnter",m="pointer"),j=x==null?h:Gs(x),y=w==null?h:Gs(w),h=new v(g,m+"leave",x,n,f),h.target=j,h.relatedTarget=y,g=null,rs(f)===u&&(v=new v(p,m+"enter",w,n,f),v.target=y,v.relatedTarget=j,g=v),j=g,x&&w)t:{for(v=x,p=w,m=0,y=v;y;y=Ls(y))m++;for(y=0,g=p;g;g=Ls(g))y++;for(;0<m-y;)v=Ls(v),m--;for(;0<y-m;)p=Ls(p),y--;for(;m--;){if(v===p||p!==null&&v===p.alternate)break t;v=Ls(v),p=Ls(p)}v=null}else v=null;x!==null&&Em(d,h,x,v,!1),w!==null&&j!==null&&Em(d,j,w,v,!0)}}e:{if(h=u?Gs(u):window,x=h.nodeName&&h.nodeName.toLowerCase(),x==="select"||x==="input"&&h.type==="file")var N=i2;else if(vm(h))if(Qg)N=c2;else{N=o2;var E=a2}else(x=h.nodeName)&&x.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=l2);if(N&&(N=N(e,u))){Wg(d,N,n,f);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Uu(h,"number",h.value)}switch(E=u?Gs(u):window,e){case"focusin":(vm(E)||E.contentEditable==="true")&&(Ks=E,Ju=u,Ea=null);break;case"focusout":Ea=Ju=Ks=null;break;case"mousedown":ed=!0;break;case"contextmenu":case"mouseup":case"dragend":ed=!1,km(d,n,f);break;case"selectionchange":if(f2)break;case"keydown":case"keyup":km(d,n,f)}var P;if(zf)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Qs?Hg(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Bg&&n.locale!=="ko"&&(Qs||M!=="onCompositionStart"?M==="onCompositionEnd"&&Qs&&(P=Ug()):(jr=f,_f="value"in jr?jr.value:jr.textContent,Qs=!0)),E=Cl(u,M),0<E.length&&(M=new pm(M,e,null,n,f),d.push({event:M,listeners:E}),P?M.data=P:(P=Vg(n),P!==null&&(M.data=P)))),(P=e2?t2(e,n):n2(e,n))&&(u=Cl(u,"onBeforeInput"),0<u.length&&(f=new pm("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=P))}ny(d,t)})}function Ua(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Ra(e,n),i!=null&&r.unshift(Ua(e,i,s)),i=Ra(e,t),i!=null&&r.push(Ua(e,i,s))),e=e.return}return r}function Ls(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Em(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=Ra(n,i),c!=null&&o.unshift(Ua(n,c,l))):s||(c=Ra(n,i),c!=null&&o.push(Ua(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var x2=/\r\n?/g,g2=/\u0000|\uFFFD/g;function _m(e){return(typeof e=="string"?e:""+e).replace(x2,`
38
+ `).replace(g2,"")}function Do(e,t,n){if(t=_m(t),_m(e)!==t&&n)throw Error(V(425))}function El(){}var td=null,nd=null;function rd(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 sd=typeof setTimeout=="function"?setTimeout:void 0,y2=typeof clearTimeout=="function"?clearTimeout:void 0,Mm=typeof Promise=="function"?Promise:void 0,v2=typeof queueMicrotask=="function"?queueMicrotask:typeof Mm<"u"?function(e){return Mm.resolve(null).then(e).catch(w2)}:sd;function w2(e){setTimeout(function(){throw e})}function su(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Aa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Aa(t)}function Mr(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 Pm(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 Wi=Math.random().toString(36).slice(2),bn="__reactFiber$"+Wi,Ba="__reactProps$"+Wi,Qn="__reactContainer$"+Wi,id="__reactEvents$"+Wi,b2="__reactListeners$"+Wi,j2="__reactHandles$"+Wi;function rs(e){var t=e[bn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qn]||n[bn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pm(e);e!==null;){if(n=e[bn])return n;e=Pm(e)}return t}e=n,n=e.parentNode}return null}function po(e){return e=e[bn]||e[Qn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function cc(e){return e[Ba]||null}var ad=[],Xs=-1;function Hr(e){return{current:e}}function Ee(e){0>Xs||(e.current=ad[Xs],ad[Xs]=null,Xs--)}function Se(e,t){Xs++,ad[Xs]=e.current,e.current=t}var Lr={},ht=Hr(Lr),_t=Hr(!1),Ns=Lr;function Pi(e,t){var n=e.type.contextTypes;if(!n)return Lr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Mt(e){return e=e.childContextTypes,e!=null}function _l(){Ee(_t),Ee(ht)}function zm(e,t,n){if(ht.current!==Lr)throw Error(V(168));Se(ht,t),Se(_t,n)}function sy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(V(108,ab(e)||"Unknown",s));return Ae({},n,r)}function Ml(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lr,Ns=ht.current,Se(ht,e),Se(_t,_t.current),!0}function $m(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=sy(e,t,Ns),r.__reactInternalMemoizedMergedChildContext=e,Ee(_t),Ee(ht),Se(ht,e)):Ee(_t),Se(_t,n)}var Rn=null,uc=!1,iu=!1;function iy(e){Rn===null?Rn=[e]:Rn.push(e)}function N2(e){uc=!0,iy(e)}function Vr(){if(!iu&&Rn!==null){iu=!0;var e=0,t=be;try{var n=Rn;for(be=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Rn=null,uc=!1}catch(s){throw Rn!==null&&(Rn=Rn.slice(e+1)),Pg(kf,Vr),s}finally{be=t,iu=!1}}return null}var Ys=[],Zs=0,Pl=null,zl=0,Ht=[],Vt=0,ks=null,In=1,Un="";function es(e,t){Ys[Zs++]=zl,Ys[Zs++]=Pl,Pl=e,zl=t}function ay(e,t,n){Ht[Vt++]=In,Ht[Vt++]=Un,Ht[Vt++]=ks,ks=e;var r=In;e=Un;var s=32-cn(r)-1;r&=~(1<<s),n+=1;var i=32-cn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,In=1<<32-cn(t)+s|n<<s|r,Un=i+e}else In=1<<i|n<<s|r,Un=e}function Tf(e){e.return!==null&&(es(e,1),ay(e,1,0))}function Rf(e){for(;e===Pl;)Pl=Ys[--Zs],Ys[Zs]=null,zl=Ys[--Zs],Ys[Zs]=null;for(;e===ks;)ks=Ht[--Vt],Ht[Vt]=null,Un=Ht[--Vt],Ht[Vt]=null,In=Ht[--Vt],Ht[Vt]=null}var Ot=null,Dt=null,ze=!1,on=null;function oy(e,t){var n=Kt(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 Tm(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,Dt=Mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ot=e,Dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ks!==null?{id:In,overflow:Un}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ot=e,Dt=null,!0):!1;default:return!1}}function od(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ld(e){if(ze){var t=Dt;if(t){var n=t;if(!Tm(e,t)){if(od(e))throw Error(V(418));t=Mr(n.nextSibling);var r=Ot;t&&Tm(e,t)?oy(r,n):(e.flags=e.flags&-4097|2,ze=!1,Ot=e)}}else{if(od(e))throw Error(V(418));e.flags=e.flags&-4097|2,ze=!1,Ot=e}}}function Rm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ot=e}function Oo(e){if(e!==Ot)return!1;if(!ze)return Rm(e),ze=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rd(e.type,e.memoizedProps)),t&&(t=Dt)){if(od(e))throw ly(),Error(V(418));for(;t;)oy(e,t),t=Mr(t.nextSibling)}if(Rm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Dt=Mr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Dt=null}}else Dt=Ot?Mr(e.stateNode.nextSibling):null;return!0}function ly(){for(var e=Dt;e;)e=Mr(e.nextSibling)}function zi(){Dt=Ot=null,ze=!1}function Df(e){on===null?on=[e]:on.push(e)}var k2=Zn.ReactCurrentBatchConfig;function sa(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(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function Ao(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dm(e){var t=e._init;return t(e._payload)}function cy(e){function t(p,m){if(e){var y=p.deletions;y===null?(p.deletions=[m],p.flags|=16):y.push(m)}}function n(p,m){if(!e)return null;for(;m!==null;)t(p,m),m=m.sibling;return null}function r(p,m){for(p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function s(p,m){return p=Tr(p,m),p.index=0,p.sibling=null,p}function i(p,m,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<m?(p.flags|=2,m):y):(p.flags|=2,m)):(p.flags|=1048576,m)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,m,y,g){return m===null||m.tag!==6?(m=fu(y,p.mode,g),m.return=p,m):(m=s(m,y),m.return=p,m)}function c(p,m,y,g){var N=y.type;return N===Ws?f(p,m,y.props.children,g,y.key):m!==null&&(m.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ar&&Dm(N)===m.type)?(g=s(m,y.props),g.ref=sa(p,m,y),g.return=p,g):(g=dl(y.type,y.key,y.props,null,p.mode,g),g.ref=sa(p,m,y),g.return=p,g)}function u(p,m,y,g){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=hu(y,p.mode,g),m.return=p,m):(m=s(m,y.children||[]),m.return=p,m)}function f(p,m,y,g,N){return m===null||m.tag!==7?(m=vs(y,p.mode,g,N),m.return=p,m):(m=s(m,y),m.return=p,m)}function d(p,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=fu(""+m,p.mode,y),m.return=p,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Co:return y=dl(m.type,m.key,m.props,null,p.mode,y),y.ref=sa(p,null,m),y.return=p,y;case Vs:return m=hu(m,p.mode,y),m.return=p,m;case ar:var g=m._init;return d(p,g(m._payload),y)}if(ma(m)||Ji(m))return m=vs(m,p.mode,y,null),m.return=p,m;Ao(p,m)}return null}function h(p,m,y,g){var N=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:l(p,m,""+y,g);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Co:return y.key===N?c(p,m,y,g):null;case Vs:return y.key===N?u(p,m,y,g):null;case ar:return N=y._init,h(p,m,N(y._payload),g)}if(ma(y)||Ji(y))return N!==null?null:f(p,m,y,g,null);Ao(p,y)}return null}function x(p,m,y,g,N){if(typeof g=="string"&&g!==""||typeof g=="number")return p=p.get(y)||null,l(m,p,""+g,N);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Co:return p=p.get(g.key===null?y:g.key)||null,c(m,p,g,N);case Vs:return p=p.get(g.key===null?y:g.key)||null,u(m,p,g,N);case ar:var E=g._init;return x(p,m,y,E(g._payload),N)}if(ma(g)||Ji(g))return p=p.get(y)||null,f(m,p,g,N,null);Ao(m,g)}return null}function w(p,m,y,g){for(var N=null,E=null,P=m,M=m=0,$=null;P!==null&&M<y.length;M++){P.index>M?($=P,P=null):$=P.sibling;var R=h(p,P,y[M],g);if(R===null){P===null&&(P=$);break}e&&P&&R.alternate===null&&t(p,P),m=i(R,m,M),E===null?N=R:E.sibling=R,E=R,P=$}if(M===y.length)return n(p,P),ze&&es(p,M),N;if(P===null){for(;M<y.length;M++)P=d(p,y[M],g),P!==null&&(m=i(P,m,M),E===null?N=P:E.sibling=P,E=P);return ze&&es(p,M),N}for(P=r(p,P);M<y.length;M++)$=x(P,p,M,y[M],g),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?M:$.key),m=i($,m,M),E===null?N=$:E.sibling=$,E=$);return e&&P.forEach(function(L){return t(p,L)}),ze&&es(p,M),N}function v(p,m,y,g){var N=Ji(y);if(typeof N!="function")throw Error(V(150));if(y=N.call(y),y==null)throw Error(V(151));for(var E=N=null,P=m,M=m=0,$=null,R=y.next();P!==null&&!R.done;M++,R=y.next()){P.index>M?($=P,P=null):$=P.sibling;var L=h(p,P,R.value,g);if(L===null){P===null&&(P=$);break}e&&P&&L.alternate===null&&t(p,P),m=i(L,m,M),E===null?N=L:E.sibling=L,E=L,P=$}if(R.done)return n(p,P),ze&&es(p,M),N;if(P===null){for(;!R.done;M++,R=y.next())R=d(p,R.value,g),R!==null&&(m=i(R,m,M),E===null?N=R:E.sibling=R,E=R);return ze&&es(p,M),N}for(P=r(p,P);!R.done;M++,R=y.next())R=x(P,p,M,R.value,g),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?M:R.key),m=i(R,m,M),E===null?N=R:E.sibling=R,E=R);return e&&P.forEach(function(U){return t(p,U)}),ze&&es(p,M),N}function j(p,m,y,g){if(typeof y=="object"&&y!==null&&y.type===Ws&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Co:e:{for(var N=y.key,E=m;E!==null;){if(E.key===N){if(N=y.type,N===Ws){if(E.tag===7){n(p,E.sibling),m=s(E,y.props.children),m.return=p,p=m;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ar&&Dm(N)===E.type){n(p,E.sibling),m=s(E,y.props),m.ref=sa(p,E,y),m.return=p,p=m;break e}n(p,E);break}else t(p,E);E=E.sibling}y.type===Ws?(m=vs(y.props.children,p.mode,g,y.key),m.return=p,p=m):(g=dl(y.type,y.key,y.props,null,p.mode,g),g.ref=sa(p,m,y),g.return=p,p=g)}return o(p);case Vs:e:{for(E=y.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(p,m.sibling),m=s(m,y.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=hu(y,p.mode,g),m.return=p,p=m}return o(p);case ar:return E=y._init,j(p,m,E(y._payload),g)}if(ma(y))return w(p,m,y,g);if(Ji(y))return v(p,m,y,g);Ao(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(p,m.sibling),m=s(m,y),m.return=p,p=m):(n(p,m),m=fu(y,p.mode,g),m.return=p,p=m),o(p)):n(p,m)}return j}var $i=cy(!0),uy=cy(!1),$l=Hr(null),Tl=null,Js=null,Of=null;function Af(){Of=Js=Tl=null}function Ff(e){var t=$l.current;Ee($l),e._currentValue=t}function cd(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 li(e,t){Tl=e,Of=Js=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ct=!0),e.firstContext=null)}function Zt(e){var t=e._currentValue;if(Of!==e)if(e={context:e,memoizedValue:t,next:null},Js===null){if(Tl===null)throw Error(V(308));Js=e,Tl.dependencies={lanes:0,firstContext:e}}else Js=Js.next=e;return t}var ss=null;function Lf(e){ss===null?ss=[e]:ss.push(e)}function dy(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Lf(t)):(n.next=s.next,s.next=n),t.interleaved=n,Kn(e,r)}function Kn(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 or=!1;function If(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fy(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 Hn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Kn(e,n)}return s=r.interleaved,s===null?(t.next=t,Lf(r)):(t.next=s.next,s.next=t),r.interleaved=t,Kn(e,n)}function il(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,Sf(e,n)}}function Om(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,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 Rl(e,t,n,r){var s=e.updateQueue;or=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;o=0,f=u=c=null,l=i;do{var h=l.lane,x=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,v=l;switch(h=t,x=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(x,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,h=typeof w=="function"?w.call(x,d,h):w,h==null)break e;d=Ae({},d,h);break e;case 2:or=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else x={eventTime:x,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=x,c=d):f=f.next=x,o|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Cs|=o,e.lanes=o,e.memoizedState=d}}function Am(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(V(191,s));s.call(r)}}}var xo={},Nn=Hr(xo),Ha=Hr(xo),Va=Hr(xo);function is(e){if(e===xo)throw Error(V(174));return e}function Uf(e,t){switch(Se(Va,t),Se(Ha,e),Se(Nn,xo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hu(t,e)}Ee(Nn),Se(Nn,t)}function Ti(){Ee(Nn),Ee(Ha),Ee(Va)}function hy(e){is(Va.current);var t=is(Nn.current),n=Hu(t,e.type);t!==n&&(Se(Ha,e),Se(Nn,n))}function Bf(e){Ha.current===e&&(Ee(Nn),Ee(Ha))}var Re=Hr(0);function Dl(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 au=[];function Hf(){for(var e=0;e<au.length;e++)au[e]._workInProgressVersionPrimary=null;au.length=0}var al=Zn.ReactCurrentDispatcher,ou=Zn.ReactCurrentBatchConfig,Ss=0,De=null,Ke=null,et=null,Ol=!1,_a=!1,Wa=0,S2=0;function ct(){throw Error(V(321))}function Vf(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 Wf(e,t,n,r,s,i){if(Ss=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,al.current=e===null||e.memoizedState===null?M2:P2,e=n(r,s),_a){i=0;do{if(_a=!1,Wa=0,25<=i)throw Error(V(301));i+=1,et=Ke=null,t.updateQueue=null,al.current=z2,e=n(r,s)}while(_a)}if(al.current=Al,t=Ke!==null&&Ke.next!==null,Ss=0,et=Ke=De=null,Ol=!1,t)throw Error(V(300));return e}function Qf(){var e=Wa!==0;return Wa=0,e}function xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?De.memoizedState=et=e:et=et.next=e,et}function Jt(){if(Ke===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=et===null?De.memoizedState:et.next;if(t!==null)et=t,Ke=e;else{if(e===null)throw Error(V(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},et===null?De.memoizedState=et=e:et=et.next=e}return et}function Qa(e,t){return typeof t=="function"?t(e):t}function lu(e){var t=Jt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=Ke,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=o=null,c=null,u=i;do{var f=u.lane;if((Ss&f)===f)c!==null&&(c=c.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:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=r):c=c.next=d,De.lanes|=f,Cs|=f}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=l,dn(r,t.memoizedState)||(Ct=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,De.lanes|=i,Cs|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function cu(e){var t=Jt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);dn(i,t.memoizedState)||(Ct=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function my(){}function py(e,t){var n=De,r=Jt(),s=t(),i=!dn(r.memoizedState,s);if(i&&(r.memoizedState=s,Ct=!0),r=r.queue,Kf(yy.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,Ka(9,gy.bind(null,n,r,s,t),void 0,null),nt===null)throw Error(V(349));Ss&30||xy(n,t,s)}return s}function xy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gy(e,t,n,r){t.value=n,t.getSnapshot=r,vy(t)&&wy(e)}function yy(e,t,n){return n(function(){vy(t)&&wy(e)})}function vy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function wy(e){var t=Kn(e,1);t!==null&&un(t,e,1,-1)}function Fm(e){var t=xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:e},t.queue=e,e=e.dispatch=_2.bind(null,De,e),[t.memoizedState,e]}function Ka(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.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 by(){return Jt().memoizedState}function ol(e,t,n,r){var s=xn();De.flags|=e,s.memoizedState=Ka(1|t,n,void 0,r===void 0?null:r)}function dc(e,t,n,r){var s=Jt();r=r===void 0?null:r;var i=void 0;if(Ke!==null){var o=Ke.memoizedState;if(i=o.destroy,r!==null&&Vf(r,o.deps)){s.memoizedState=Ka(t,n,i,r);return}}De.flags|=e,s.memoizedState=Ka(1|t,n,i,r)}function Lm(e,t){return ol(8390656,8,e,t)}function Kf(e,t){return dc(2048,8,e,t)}function jy(e,t){return dc(4,2,e,t)}function Ny(e,t){return dc(4,4,e,t)}function ky(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 Sy(e,t,n){return n=n!=null?n.concat([e]):null,dc(4,4,ky.bind(null,t,e),n)}function qf(){}function Cy(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ey(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _y(e,t,n){return Ss&21?(dn(n,t)||(n=Tg(),De.lanes|=n,Cs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=n)}function C2(e,t){var n=be;be=n!==0&&4>n?n:4,e(!0);var r=ou.transition;ou.transition={};try{e(!1),t()}finally{be=n,ou.transition=r}}function My(){return Jt().memoizedState}function E2(e,t,n){var r=$r(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Py(e))zy(t,n);else if(n=dy(e,t,n,r),n!==null){var s=wt();un(n,e,r,s),$y(n,t,r)}}function _2(e,t,n){var r=$r(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Py(e))zy(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(s.hasEagerState=!0,s.eagerState=l,dn(l,o)){var c=t.interleaved;c===null?(s.next=s,Lf(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=dy(e,t,s,r),n!==null&&(s=wt(),un(n,e,r,s),$y(n,t,r))}}function Py(e){var t=e.alternate;return e===De||t!==null&&t===De}function zy(e,t){_a=Ol=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $y(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sf(e,n)}}var Al={readContext:Zt,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},M2={readContext:Zt,useCallback:function(e,t){return xn().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Lm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ol(4194308,4,ky.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ol(4194308,4,e,t)},useInsertionEffect:function(e,t){return ol(4,2,e,t)},useMemo:function(e,t){var n=xn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xn();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=E2.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=xn();return e={current:e},t.memoizedState=e},useState:Fm,useDebugValue:qf,useDeferredValue:function(e){return xn().memoizedState=e},useTransition:function(){var e=Fm(!1),t=e[0];return e=C2.bind(null,e[1]),xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,s=xn();if(ze){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),nt===null)throw Error(V(349));Ss&30||xy(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Lm(yy.bind(null,r,i,e),[e]),r.flags|=2048,Ka(9,gy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xn(),t=nt.identifierPrefix;if(ze){var n=Un,r=In;n=(r&~(1<<32-cn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=S2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},P2={readContext:Zt,useCallback:Cy,useContext:Zt,useEffect:Kf,useImperativeHandle:Sy,useInsertionEffect:jy,useLayoutEffect:Ny,useMemo:Ey,useReducer:lu,useRef:by,useState:function(){return lu(Qa)},useDebugValue:qf,useDeferredValue:function(e){var t=Jt();return _y(t,Ke.memoizedState,e)},useTransition:function(){var e=lu(Qa)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:my,useSyncExternalStore:py,useId:My,unstable_isNewReconciler:!1},z2={readContext:Zt,useCallback:Cy,useContext:Zt,useEffect:Kf,useImperativeHandle:Sy,useInsertionEffect:jy,useLayoutEffect:Ny,useMemo:Ey,useReducer:cu,useRef:by,useState:function(){return cu(Qa)},useDebugValue:qf,useDeferredValue:function(e){var t=Jt();return Ke===null?t.memoizedState=e:_y(t,Ke.memoizedState,e)},useTransition:function(){var e=cu(Qa)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:my,useSyncExternalStore:py,useId:My,unstable_isNewReconciler:!1};function rn(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ud(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fc={isMounted:function(e){return(e=e._reactInternals)?Rs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wt(),s=$r(e),i=Hn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Pr(e,i,s),t!==null&&(un(t,e,s,r),il(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wt(),s=$r(e),i=Hn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pr(e,i,s),t!==null&&(un(t,e,s,r),il(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),r=$r(e),s=Hn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Pr(e,s,r),t!==null&&(un(t,e,r,n),il(t,e,r))}};function Im(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!La(n,r)||!La(s,i):!0}function Ty(e,t,n){var r=!1,s=Lr,i=t.contextType;return typeof i=="object"&&i!==null?i=Zt(i):(s=Mt(t)?Ns:ht.current,r=t.contextTypes,i=(r=r!=null)?Pi(e,s):Lr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Um(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&&fc.enqueueReplaceState(t,t.state,null)}function dd(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},If(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Zt(i):(i=Mt(t)?Ns:ht.current,s.context=Pi(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ud(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&fc.enqueueReplaceState(s,s.state,null),Rl(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ri(e,t){try{var n="",r=t;do n+=ib(r),r=r.return;while(r);var s=n}catch(i){s=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:s,digest:null}}function uu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $2=typeof WeakMap=="function"?WeakMap:Map;function Ry(e,t,n){n=Hn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ll||(Ll=!0,jd=r),fd(e,t)},n}function Dy(e,t,n){n=Hn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){fd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){fd(e,t),typeof r!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Bm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $2;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Q2.bind(null,e,t,n),t.then(e,e))}function Hm(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 Vm(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Hn(-1,1),t.tag=2,Pr(n,t,1))),n.lanes|=1),e)}var T2=Zn.ReactCurrentOwner,Ct=!1;function gt(e,t,n,r){t.child=e===null?uy(t,null,n,r):$i(t,e.child,n,r)}function Wm(e,t,n,r,s){n=n.render;var i=t.ref;return li(t,s),r=Wf(e,t,n,r,i,s),n=Qf(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,qn(e,t,s)):(ze&&n&&Tf(t),t.flags|=1,gt(e,t,r,s),t.child)}function Qm(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!nh(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Oy(e,t,i,r,s)):(e=dl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:La,n(o,r)&&e.ref===t.ref)return qn(e,t,s)}return t.flags|=1,e=Tr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Oy(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(La(i,r)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ct=!0);else return t.lanes=e.lanes,qn(e,t,s)}return hd(e,t,n,r,s)}function Ay(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Se(ti,$t),$t|=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,Se(ti,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Se(ti,$t),$t|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Se(ti,$t),$t|=r;return gt(e,t,s,n),t.child}function Fy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function hd(e,t,n,r,s){var i=Mt(n)?Ns:ht.current;return i=Pi(t,i),li(t,s),n=Wf(e,t,n,r,i,s),r=Qf(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,qn(e,t,s)):(ze&&r&&Tf(t),t.flags|=1,gt(e,t,n,s),t.child)}function Km(e,t,n,r,s){if(Mt(n)){var i=!0;Ml(t)}else i=!1;if(li(t,s),t.stateNode===null)ll(e,t),Ty(t,n,r),dd(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Zt(u):(u=Mt(n)?Ns:ht.current,u=Pi(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&Um(t,o,r,u),or=!1;var h=t.memoizedState;o.state=h,Rl(t,r,o,s),c=t.memoizedState,l!==r||h!==c||_t.current||or?(typeof f=="function"&&(ud(t,n,f,r),c=t.memoizedState),(l=or||Im(t,n,l,r,h,c,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,fy(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:rn(t.type,l),o.props=u,d=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Zt(c):(c=Mt(n)?Ns:ht.current,c=Pi(t,c));var x=n.getDerivedStateFromProps;(f=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||h!==c)&&Um(t,o,r,c),or=!1,h=t.memoizedState,o.state=h,Rl(t,r,o,s);var w=t.memoizedState;l!==d||h!==w||_t.current||or?(typeof x=="function"&&(ud(t,n,x,r),w=t.memoizedState),(u=or||Im(t,n,u,r,h,w,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return md(e,t,n,r,i,s)}function md(e,t,n,r,s,i){Fy(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&$m(t,n,!1),qn(e,t,i);r=t.stateNode,T2.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=$i(t,e.child,null,i),t.child=$i(t,null,l,i)):gt(e,t,l,i),t.memoizedState=r.state,s&&$m(t,n,!0),t.child}function Ly(e){var t=e.stateNode;t.pendingContext?zm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zm(e,t.context,!1),Uf(e,t.containerInfo)}function qm(e,t,n,r,s){return zi(),Df(s),t.flags|=256,gt(e,t,n,r),t.child}var pd={dehydrated:null,treeContext:null,retryLane:0};function xd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Iy(e,t,n){var r=t.pendingProps,s=Re.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Se(Re,s&1),e===null)return ld(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=pc(o,r,0,null),e=vs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=xd(n),t.memoizedState=pd,e):Gf(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return R2(e,t,o,r,l,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Tr(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Tr(l,i):(i=vs(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?xd(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=pd,r}return i=e.child,e=i.sibling,r=Tr(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 Gf(e,t){return t=pc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fo(e,t,n,r){return r!==null&&Df(r),$i(t,e.child,null,n),e=Gf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function R2(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=uu(Error(V(422))),Fo(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=pc({mode:"visible",children:r.children},s,0,null),i=vs(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&$i(t,e.child,null,o),t.child.memoizedState=xd(o),t.memoizedState=pd,i);if(!(t.mode&1))return Fo(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(V(419)),r=uu(i,r,void 0),Fo(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ct||l){if(r=nt,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Kn(e,s),un(r,e,s,-1))}return th(),r=uu(Error(V(421))),Fo(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=K2.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Dt=Mr(s.nextSibling),Ot=t,ze=!0,on=null,e!==null&&(Ht[Vt++]=In,Ht[Vt++]=Un,Ht[Vt++]=ks,In=e.id,Un=e.overflow,ks=t),t=Gf(t,r.children),t.flags|=4096,t)}function Gm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),cd(e.return,t,n)}function du(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Uy(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(gt(e,t,r.children,n),r=Re.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&&Gm(e,n,t);else if(e.tag===19)Gm(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(Se(Re,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Dl(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),du(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Dl(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}du(t,!0,n,null,i);break;case"together":du(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ll(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=Tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function D2(e,t,n){switch(t.tag){case 3:Ly(t),zi();break;case 5:hy(t);break;case 1:Mt(t.type)&&Ml(t);break;case 4:Uf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Se($l,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Se(Re,Re.current&1),t.flags|=128,null):n&t.child.childLanes?Iy(e,t,n):(Se(Re,Re.current&1),e=qn(e,t,n),e!==null?e.sibling:null);Se(Re,Re.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Uy(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Se(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,Ay(e,t,n)}return qn(e,t,n)}var By,gd,Hy,Vy;By=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}};gd=function(){};Hy=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,is(Nn.current);var i=null;switch(n){case"input":s=Lu(e,s),r=Lu(e,r),i=[];break;case"select":s=Ae({},s,{value:void 0}),r=Ae({},r,{value:void 0}),i=[];break;case"textarea":s=Bu(e,s),r=Bu(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=El)}Vu(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&($a.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&($a.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ce("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Vy=function(e,t,n,r){n!==r&&(t.flags|=4)};function ia(e,t){if(!ze)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 ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function O2(e,t,n){var r=t.pendingProps;switch(Rf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return Mt(t.type)&&_l(),ut(t),null;case 3:return r=t.stateNode,Ti(),Ee(_t),Ee(ht),Hf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Oo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,on!==null&&(Sd(on),on=null))),gd(e,t),ut(t),null;case 5:Bf(t);var s=is(Va.current);if(n=t.type,e!==null&&t.stateNode!=null)Hy(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return ut(t),null}if(e=is(Nn.current),Oo(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[bn]=t,r[Ba]=i,e=(t.mode&1)!==0,n){case"dialog":Ce("cancel",r),Ce("close",r);break;case"iframe":case"object":case"embed":Ce("load",r);break;case"video":case"audio":for(s=0;s<xa.length;s++)Ce(xa[s],r);break;case"source":Ce("error",r);break;case"img":case"image":case"link":Ce("error",r),Ce("load",r);break;case"details":Ce("toggle",r);break;case"input":sm(r,i),Ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ce("invalid",r);break;case"textarea":am(r,i),Ce("invalid",r)}Vu(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Do(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Do(r.textContent,l,e),s=["children",""+l]):$a.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ce("scroll",r)}switch(n){case"input":Eo(r),im(r,i,!0);break;case"textarea":Eo(r),om(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=El)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=yg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[bn]=t,e[Ba]=r,By(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wu(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),s=r;break;case"iframe":case"object":case"embed":Ce("load",e),s=r;break;case"video":case"audio":for(s=0;s<xa.length;s++)Ce(xa[s],e);s=r;break;case"source":Ce("error",e),s=r;break;case"img":case"image":case"link":Ce("error",e),Ce("load",e),s=r;break;case"details":Ce("toggle",e),s=r;break;case"input":sm(e,r),s=Lu(e,r),Ce("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ae({},r,{value:void 0}),Ce("invalid",e);break;case"textarea":am(e,r),s=Bu(e,r),Ce("invalid",e);break;default:s=r}Vu(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?bg(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&vg(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ta(e,c):typeof c=="number"&&Ta(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($a.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Ce("scroll",e):c!=null&&vf(e,i,c,o))}switch(n){case"input":Eo(e),im(e,r,!1);break;case"textarea":Eo(e),om(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?si(e,!!r.multiple,i,!1):r.defaultValue!=null&&si(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=El)}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 ut(t),null;case 6:if(e&&t.stateNode!=null)Vy(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=is(Va.current),is(Nn.current),Oo(t)){if(r=t.stateNode,n=t.memoizedProps,r[bn]=t,(i=r.nodeValue!==n)&&(e=Ot,e!==null))switch(e.tag){case 3:Do(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Do(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[bn]=t,t.stateNode=r}return ut(t),null;case 13:if(Ee(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ze&&Dt!==null&&t.mode&1&&!(t.flags&128))ly(),zi(),t.flags|=98560,i=!1;else if(i=Oo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[bn]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),i=!1}else on!==null&&(Sd(on),on=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||Re.current&1?Ge===0&&(Ge=3):th())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return Ti(),gd(e,t),e===null&&Ia(t.stateNode.containerInfo),ut(t),null;case 10:return Ff(t.type._context),ut(t),null;case 17:return Mt(t.type)&&_l(),ut(t),null;case 19:if(Ee(Re),i=t.memoizedState,i===null)return ut(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ia(i,!1);else{if(Ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Dl(e),o!==null){for(t.flags|=128,ia(i,!1),r=o.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,o=i.alternate,o===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=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Se(Re,Re.current&1|2),t.child}e=e.sibling}i.tail!==null&&He()>Di&&(t.flags|=128,r=!0,ia(i,!1),t.lanes=4194304)}else{if(!r)if(e=Dl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ia(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ze)return ut(t),null}else 2*He()-i.renderingStartTime>Di&&n!==1073741824&&(t.flags|=128,r=!0,ia(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=He(),t.sibling=null,n=Re.current,Se(Re,r?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return eh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$t&1073741824&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function A2(e,t){switch(Rf(t),t.tag){case 1:return Mt(t.type)&&_l(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ti(),Ee(_t),Ee(ht),Hf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bf(t),null;case 13:if(Ee(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Re),null;case 4:return Ti(),null;case 10:return Ff(t.type._context),null;case 22:case 23:return eh(),null;case 24:return null;default:return null}}var Lo=!1,ft=!1,F2=typeof WeakSet=="function"?WeakSet:Set,G=null;function ei(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(e,t,r)}else n.current=null}function yd(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var Xm=!1;function L2(e,t){if(td=kl,e=Gg(),$f(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(l=o+s),d!==i||r!==0&&d.nodeType!==3||(c=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)h=d,d=x;for(;;){if(d===e)break t;if(h===n&&++u===s&&(l=o),h===i&&++f===r&&(c=o),(x=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(nd={focusedElem:e,selectionRange:n},kl=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,j=w.memoizedState,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:rn(t.type,v),j);p.__reactInternalSnapshotBeforeUpdate=m}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(V(163))}}catch(g){Ue(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=Xm,Xm=!1,w}function Ma(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&yd(t,n,i)}s=s.next}while(s!==r)}}function hc(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 vd(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 Wy(e){var t=e.alternate;t!==null&&(e.alternate=null,Wy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bn],delete t[Ba],delete t[id],delete t[b2],delete t[j2])),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 Qy(e){return e.tag===5||e.tag===3||e.tag===4}function Ym(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qy(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 wd(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=El));else if(r!==4&&(e=e.child,e!==null))for(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}function bd(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(bd(e,t,n),e=e.sibling;e!==null;)bd(e,t,n),e=e.sibling}var it=null,an=!1;function nr(e,t,n){for(n=n.child;n!==null;)Ky(e,t,n),n=n.sibling}function Ky(e,t,n){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(ic,n)}catch{}switch(n.tag){case 5:ft||ei(n,t);case 6:var r=it,s=an;it=null,nr(e,t,n),it=r,an=s,it!==null&&(an?(e=it,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):it.removeChild(n.stateNode));break;case 18:it!==null&&(an?(e=it,n=n.stateNode,e.nodeType===8?su(e.parentNode,n):e.nodeType===1&&su(e,n),Aa(e)):su(it,n.stateNode));break;case 4:r=it,s=an,it=n.stateNode.containerInfo,an=!0,nr(e,t,n),it=r,an=s;break;case 0:case 11:case 14:case 15:if(!ft&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&yd(n,t,o),s=s.next}while(s!==r)}nr(e,t,n);break;case 1:if(!ft&&(ei(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ue(n,t,l)}nr(e,t,n);break;case 21:nr(e,t,n);break;case 22:n.mode&1?(ft=(r=ft)||n.memoizedState!==null,nr(e,t,n),ft=r):nr(e,t,n);break;default:nr(e,t,n)}}function Zm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new F2),t.forEach(function(r){var s=q2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:it=l.stateNode,an=!1;break e;case 3:it=l.stateNode.containerInfo,an=!0;break e;case 4:it=l.stateNode.containerInfo,an=!0;break e}l=l.return}if(it===null)throw Error(V(160));Ky(i,o,s),it=null,an=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Ue(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qy(t,e),t=t.sibling}function qy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nn(t,e),mn(e),r&4){try{Ma(3,e,e.return),hc(3,e)}catch(v){Ue(e,e.return,v)}try{Ma(5,e,e.return)}catch(v){Ue(e,e.return,v)}}break;case 1:nn(t,e),mn(e),r&512&&n!==null&&ei(n,n.return);break;case 5:if(nn(t,e),mn(e),r&512&&n!==null&&ei(n,n.return),e.flags&32){var s=e.stateNode;try{Ta(s,"")}catch(v){Ue(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&xg(s,i),Wu(l,o);var u=Wu(l,i);for(o=0;o<c.length;o+=2){var f=c[o],d=c[o+1];f==="style"?bg(s,d):f==="dangerouslySetInnerHTML"?vg(s,d):f==="children"?Ta(s,d):vf(s,f,d,u)}switch(l){case"input":Iu(s,i);break;case"textarea":gg(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var x=i.value;x!=null?si(s,!!i.multiple,x,!1):h!==!!i.multiple&&(i.defaultValue!=null?si(s,!!i.multiple,i.defaultValue,!0):si(s,!!i.multiple,i.multiple?[]:"",!1))}s[Ba]=i}catch(v){Ue(e,e.return,v)}}break;case 6:if(nn(t,e),mn(e),r&4){if(e.stateNode===null)throw Error(V(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(v){Ue(e,e.return,v)}}break;case 3:if(nn(t,e),mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Aa(t.containerInfo)}catch(v){Ue(e,e.return,v)}break;case 4:nn(t,e),mn(e);break;case 13:nn(t,e),mn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Zf=He())),r&4&&Zm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ft=(u=ft)||f,nn(t,e),ft=u):nn(t,e),mn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(G=e,f=e.child;f!==null;){for(d=G=f;G!==null;){switch(h=G,x=h.child,h.tag){case 0:case 11:case 14:case 15:Ma(4,h,h.return);break;case 1:ei(h,h.return);var w=h.stateNode;if(typeof w.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){Ue(r,n,v)}}break;case 5:ei(h,h.return);break;case 22:if(h.memoizedState!==null){ep(d);continue}}x!==null?(x.return=h,G=x):ep(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=wg("display",o))}catch(v){Ue(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Ue(e,e.return,v)}}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;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:nn(t,e),mn(e),r&4&&Zm(e);break;case 21:break;default:nn(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qy(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ta(s,""),r.flags&=-33);var i=Ym(e);bd(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Ym(e);wd(e,l,o);break;default:throw Error(V(161))}}catch(c){Ue(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function I2(e,t,n){G=e,Gy(e)}function Gy(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var s=G,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Lo;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||ft;l=Lo;var u=ft;if(Lo=o,(ft=c)&&!u)for(G=s;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?tp(s):c!==null?(c.return=o,G=c):tp(s);for(;i!==null;)G=i,Gy(i),i=i.sibling;G=s,Lo=l,ft=u}Jm(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,G=i):Jm(e)}}function Jm(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ft||hc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ft)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:rn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Am(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Am(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.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 f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Aa(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}ft||t.flags&512&&vd(t)}catch(h){Ue(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function ep(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function tp(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{hc(4,t)}catch(c){Ue(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Ue(t,s,c)}}var i=t.return;try{vd(t)}catch(c){Ue(t,i,c)}break;case 5:var o=t.return;try{vd(t)}catch(c){Ue(t,o,c)}}}catch(c){Ue(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var U2=Math.ceil,Fl=Zn.ReactCurrentDispatcher,Xf=Zn.ReactCurrentOwner,Xt=Zn.ReactCurrentBatchConfig,he=0,nt=null,We=null,at=0,$t=0,ti=Hr(0),Ge=0,qa=null,Cs=0,mc=0,Yf=0,Pa=null,St=null,Zf=0,Di=1/0,Tn=null,Ll=!1,jd=null,zr=null,Io=!1,Nr=null,Il=0,za=0,Nd=null,cl=-1,ul=0;function wt(){return he&6?He():cl!==-1?cl:cl=He()}function $r(e){return e.mode&1?he&2&&at!==0?at&-at:k2.transition!==null?(ul===0&&(ul=Tg()),ul):(e=be,e!==0||(e=window.event,e=e===void 0?16:Ig(e.type)),e):1}function un(e,t,n,r){if(50<za)throw za=0,Nd=null,Error(V(185));ho(e,n,r),(!(he&2)||e!==nt)&&(e===nt&&(!(he&2)&&(mc|=n),Ge===4&&dr(e,at)),Pt(e,r),n===1&&he===0&&!(t.mode&1)&&(Di=He()+500,uc&&Vr()))}function Pt(e,t){var n=e.callbackNode;kb(e,t);var r=Nl(e,e===nt?at:0);if(r===0)n!==null&&um(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&um(n),t===1)e.tag===0?N2(np.bind(null,e)):iy(np.bind(null,e)),v2(function(){!(he&6)&&Vr()}),n=null;else{switch(Rg(r)){case 1:n=kf;break;case 4:n=zg;break;case 16:n=jl;break;case 536870912:n=$g;break;default:n=jl}n=r0(n,Xy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Xy(e,t){if(cl=-1,ul=0,he&6)throw Error(V(327));var n=e.callbackNode;if(ci()&&e.callbackNode!==n)return null;var r=Nl(e,e===nt?at:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ul(e,r);else{t=r;var s=he;he|=2;var i=Zy();(nt!==e||at!==t)&&(Tn=null,Di=He()+500,ys(e,t));do try{V2();break}catch(l){Yy(e,l)}while(!0);Af(),Fl.current=i,he=s,We!==null?t=0:(nt=null,at=0,t=Ge)}if(t!==0){if(t===2&&(s=Xu(e),s!==0&&(r=s,t=kd(e,s))),t===1)throw n=qa,ys(e,0),dr(e,r),Pt(e,He()),n;if(t===6)dr(e,r);else{if(s=e.current.alternate,!(r&30)&&!B2(s)&&(t=Ul(e,r),t===2&&(i=Xu(e),i!==0&&(r=i,t=kd(e,i))),t===1))throw n=qa,ys(e,0),dr(e,r),Pt(e,He()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:ts(e,St,Tn);break;case 3:if(dr(e,r),(r&130023424)===r&&(t=Zf+500-He(),10<t)){if(Nl(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){wt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=sd(ts.bind(null,e,St,Tn),t);break}ts(e,St,Tn);break;case 4:if(dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-cn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*U2(r/1960))-r,10<r){e.timeoutHandle=sd(ts.bind(null,e,St,Tn),r);break}ts(e,St,Tn);break;case 5:ts(e,St,Tn);break;default:throw Error(V(329))}}}return Pt(e,He()),e.callbackNode===n?Xy.bind(null,e):null}function kd(e,t){var n=Pa;return e.current.memoizedState.isDehydrated&&(ys(e,t).flags|=256),e=Ul(e,t),e!==2&&(t=St,St=n,t!==null&&Sd(t)),e}function Sd(e){St===null?St=e:St.push.apply(St,e)}function B2(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!dn(i(),s))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 dr(e,t){for(t&=~Yf,t&=~mc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-cn(t),r=1<<n;e[n]=-1,t&=~r}}function np(e){if(he&6)throw Error(V(327));ci();var t=Nl(e,0);if(!(t&1))return Pt(e,He()),null;var n=Ul(e,t);if(e.tag!==0&&n===2){var r=Xu(e);r!==0&&(t=r,n=kd(e,r))}if(n===1)throw n=qa,ys(e,0),dr(e,t),Pt(e,He()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ts(e,St,Tn),Pt(e,He()),null}function Jf(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(Di=He()+500,uc&&Vr())}}function Es(e){Nr!==null&&Nr.tag===0&&!(he&6)&&ci();var t=he;he|=1;var n=Xt.transition,r=be;try{if(Xt.transition=null,be=1,e)return e()}finally{be=r,Xt.transition=n,he=t,!(he&6)&&Vr()}}function eh(){$t=ti.current,Ee(ti)}function ys(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,y2(n)),We!==null)for(n=We.return;n!==null;){var r=n;switch(Rf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_l();break;case 3:Ti(),Ee(_t),Ee(ht),Hf();break;case 5:Bf(r);break;case 4:Ti();break;case 13:Ee(Re);break;case 19:Ee(Re);break;case 10:Ff(r.type._context);break;case 22:case 23:eh()}n=n.return}if(nt=e,We=e=Tr(e.current,null),at=$t=t,Ge=0,qa=null,Yf=mc=Cs=0,St=Pa=null,ss!==null){for(t=0;t<ss.length;t++)if(n=ss[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ss=null}return e}function Yy(e,t){do{var n=We;try{if(Af(),al.current=Al,Ol){for(var r=De.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ol=!1}if(Ss=0,et=Ke=De=null,_a=!1,Wa=0,Xf.current=null,n===null||n.return===null){Ge=1,qa=t,We=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=at,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var x=Hm(o);if(x!==null){x.flags&=-257,Vm(x,o,l,i,t),x.mode&1&&Bm(i,u,t),t=x,c=u;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){Bm(i,u,t),th();break e}c=Error(V(426))}}else if(ze&&l.mode&1){var j=Hm(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Vm(j,o,l,i,t),Df(Ri(c,l));break e}}i=c=Ri(c,l),Ge!==4&&(Ge=2),Pa===null?Pa=[i]:Pa.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Ry(i,c,t);Om(i,p);break e;case 1:l=c;var m=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(zr===null||!zr.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var g=Dy(i,l,t);Om(i,g);break e}}i=i.return}while(i!==null)}e0(n)}catch(N){t=N,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function Zy(){var e=Fl.current;return Fl.current=Al,e===null?Al:e}function th(){(Ge===0||Ge===3||Ge===2)&&(Ge=4),nt===null||!(Cs&268435455)&&!(mc&268435455)||dr(nt,at)}function Ul(e,t){var n=he;he|=2;var r=Zy();(nt!==e||at!==t)&&(Tn=null,ys(e,t));do try{H2();break}catch(s){Yy(e,s)}while(!0);if(Af(),he=n,Fl.current=r,We!==null)throw Error(V(261));return nt=null,at=0,Ge}function H2(){for(;We!==null;)Jy(We)}function V2(){for(;We!==null&&!pb();)Jy(We)}function Jy(e){var t=n0(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?e0(e):We=t,Xf.current=null}function e0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=A2(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ge=6,We=null;return}}else if(n=O2(n,t,$t),n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Ge===0&&(Ge=5)}function ts(e,t,n){var r=be,s=Xt.transition;try{Xt.transition=null,be=1,W2(e,t,n,r)}finally{Xt.transition=s,be=r}return null}function W2(e,t,n,r){do ci();while(Nr!==null);if(he&6)throw Error(V(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Sb(e,i),e===nt&&(We=nt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Io||(Io=!0,r0(jl,function(){return ci(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Xt.transition,Xt.transition=null;var o=be;be=1;var l=he;he|=4,Xf.current=null,L2(e,n),qy(n,e),d2(nd),kl=!!td,nd=td=null,e.current=n,I2(n),xb(),he=l,be=o,Xt.transition=i}else e.current=n;if(Io&&(Io=!1,Nr=e,Il=s),i=e.pendingLanes,i===0&&(zr=null),vb(n.stateNode),Pt(e,He()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Ll)throw Ll=!1,e=jd,jd=null,e;return Il&1&&e.tag!==0&&ci(),i=e.pendingLanes,i&1?e===Nd?za++:(za=0,Nd=e):za=0,Vr(),null}function ci(){if(Nr!==null){var e=Rg(Il),t=Xt.transition,n=be;try{if(Xt.transition=null,be=16>e?16:e,Nr===null)var r=!1;else{if(e=Nr,Nr=null,Il=0,he&6)throw Error(V(331));var s=he;for(he|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:Ma(8,f,i)}var d=f.child;if(d!==null)d.return=f,G=d;else for(;G!==null;){f=G;var h=f.sibling,x=f.return;if(Wy(f),f===u){G=null;break}if(h!==null){h.return=x,G=h;break}G=x}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var j=v.sibling;v.sibling=null,v=j}while(v!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ma(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,G=p;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){o=G;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,G=y;else e:for(o=m;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:hc(9,l)}}catch(N){Ue(l,l.return,N)}if(l===o){G=null;break e}var g=l.sibling;if(g!==null){g.return=l.return,G=g;break e}G=l.return}}if(he=s,Vr(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(ic,e)}catch{}r=!0}return r}finally{be=n,Xt.transition=t}}return!1}function rp(e,t,n){t=Ri(n,t),t=Ry(e,t,1),e=Pr(e,t,1),t=wt(),e!==null&&(ho(e,1,t),Pt(e,t))}function Ue(e,t,n){if(e.tag===3)rp(e,e,n);else for(;t!==null;){if(t.tag===3){rp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zr===null||!zr.has(r))){e=Ri(n,e),e=Dy(t,e,1),t=Pr(t,e,1),e=wt(),t!==null&&(ho(t,1,e),Pt(t,e));break}}t=t.return}}function Q2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(at&n)===n&&(Ge===4||Ge===3&&(at&130023424)===at&&500>He()-Zf?ys(e,0):Yf|=n),Pt(e,t)}function t0(e,t){t===0&&(e.mode&1?(t=Po,Po<<=1,!(Po&130023424)&&(Po=4194304)):t=1);var n=wt();e=Kn(e,t),e!==null&&(ho(e,t,n),Pt(e,n))}function K2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),t0(e,n)}function q2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),t0(e,n)}var n0;n0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)Ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ct=!1,D2(e,t,n);Ct=!!(e.flags&131072)}else Ct=!1,ze&&t.flags&1048576&&ay(t,zl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ll(e,t),e=t.pendingProps;var s=Pi(t,ht.current);li(t,n),s=Wf(null,t,r,e,s,n);var i=Qf();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Mt(r)?(i=!0,Ml(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,If(t),s.updater=fc,t.stateNode=s,s._reactInternals=t,dd(t,r,e,n),t=md(null,t,r,!0,i,n)):(t.tag=0,ze&&i&&Tf(t),gt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ll(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=X2(r),e=rn(r,e),s){case 0:t=hd(null,t,r,e,n);break e;case 1:t=Km(null,t,r,e,n);break e;case 11:t=Wm(null,t,r,e,n);break e;case 14:t=Qm(null,t,r,rn(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rn(r,s),hd(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rn(r,s),Km(e,t,r,s,n);case 3:e:{if(Ly(t),e===null)throw Error(V(387));r=t.pendingProps,i=t.memoizedState,s=i.element,fy(e,t),Rl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Ri(Error(V(423)),t),t=qm(e,t,r,n,s);break e}else if(r!==s){s=Ri(Error(V(424)),t),t=qm(e,t,r,n,s);break e}else for(Dt=Mr(t.stateNode.containerInfo.firstChild),Ot=t,ze=!0,on=null,n=uy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zi(),r===s){t=qn(e,t,n);break e}gt(e,t,r,n)}t=t.child}return t;case 5:return hy(t),e===null&&ld(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,rd(r,s)?o=null:i!==null&&rd(r,i)&&(t.flags|=32),Fy(e,t),gt(e,t,o,n),t.child;case 6:return e===null&&ld(t),null;case 13:return Iy(e,t,n);case 4:return Uf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$i(t,null,r,n):gt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rn(r,s),Wm(e,t,r,s,n);case 7:return gt(e,t,t.pendingProps,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Se($l,r._currentValue),r._currentValue=o,i!==null)if(dn(i.value,o)){if(i.children===s.children&&!_t.current){t=qn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Hn(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),cd(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(V(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),cd(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}gt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,li(t,n),s=Zt(s),r=r(s),t.flags|=1,gt(e,t,r,n),t.child;case 14:return r=t.type,s=rn(r,t.pendingProps),s=rn(r.type,s),Qm(e,t,r,s,n);case 15:return Oy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rn(r,s),ll(e,t),t.tag=1,Mt(r)?(e=!0,Ml(t)):e=!1,li(t,n),Ty(t,r,s),dd(t,r,s,n),md(null,t,r,!0,e,n);case 19:return Uy(e,t,n);case 22:return Ay(e,t,n)}throw Error(V(156,t.tag))};function r0(e,t){return Pg(e,t)}function G2(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 Kt(e,t,n,r){return new G2(e,t,n,r)}function nh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X2(e){if(typeof e=="function")return nh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bf)return 11;if(e===jf)return 14}return 2}function Tr(e,t){var n=e.alternate;return n===null?(n=Kt(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 dl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")nh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ws:return vs(n.children,s,i,t);case wf:o=8,s|=8;break;case Du:return e=Kt(12,n,t,s|2),e.elementType=Du,e.lanes=i,e;case Ou:return e=Kt(13,n,t,s),e.elementType=Ou,e.lanes=i,e;case Au:return e=Kt(19,n,t,s),e.elementType=Au,e.lanes=i,e;case hg:return pc(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dg:o=10;break e;case fg:o=9;break e;case bf:o=11;break e;case jf:o=14;break e;case ar:o=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Kt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function vs(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function pc(e,t,n,r){return e=Kt(22,e,r,t),e.elementType=hg,e.lanes=n,e.stateNode={isHidden:!1},e}function fu(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function hu(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y2(e,t,n,r,s){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=Kc(0),this.expirationTimes=Kc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kc(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function rh(e,t,n,r,s,i,o,l,c){return e=new Y2(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},If(i),e}function Z2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function s0(e){if(!e)return Lr;e=e._reactInternals;e:{if(Rs(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(Mt(n))return sy(e,n,t)}return t}function i0(e,t,n,r,s,i,o,l,c){return e=rh(n,r,!0,e,s,i,o,l,c),e.context=s0(null),n=e.current,r=wt(),s=$r(n),i=Hn(r,s),i.callback=t??null,Pr(n,i,s),e.current.lanes=s,ho(e,s,r),Pt(e,r),e}function xc(e,t,n,r){var s=t.current,i=wt(),o=$r(s);return n=s0(n),t.context===null?t.context=n:t.pendingContext=n,t=Hn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Pr(s,t,o),e!==null&&(un(e,s,o,i),il(e,s,o)),o}function Bl(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 sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sh(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function J2(){return null}var a0=typeof reportError=="function"?reportError:function(e){console.error(e)};function ih(e){this._internalRoot=e}gc.prototype.render=ih.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));xc(e,t,null,null)};gc.prototype.unmount=ih.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){xc(null,e,null,null)}),t[Qn]=null}};function gc(e){this._internalRoot=e}gc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ag();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ur.length&&t!==0&&t<ur[n].priority;n++);ur.splice(n,0,e),n===0&&Lg(e)}};function ah(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ip(){}function ej(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=Bl(o);i.call(u)}}var o=i0(t,r,e,0,null,!1,!1,"",ip);return e._reactRootContainer=o,e[Qn]=o.current,Ia(e.nodeType===8?e.parentNode:e),Es(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=Bl(c);l.call(u)}}var c=rh(e,0,!1,null,null,!1,!1,"",ip);return e._reactRootContainer=c,e[Qn]=c.current,Ia(e.nodeType===8?e.parentNode:e),Es(function(){xc(t,c,n,r)}),c}function vc(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=Bl(o);l.call(c)}}xc(t,o,e,s)}else o=ej(n,t,e,s,r);return Bl(o)}Dg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=pa(t.pendingLanes);n!==0&&(Sf(t,n|1),Pt(t,He()),!(he&6)&&(Di=He()+500,Vr()))}break;case 13:Es(function(){var r=Kn(e,1);if(r!==null){var s=wt();un(r,e,1,s)}}),sh(e,1)}};Cf=function(e){if(e.tag===13){var t=Kn(e,134217728);if(t!==null){var n=wt();un(t,e,134217728,n)}sh(e,134217728)}};Og=function(e){if(e.tag===13){var t=$r(e),n=Kn(e,t);if(n!==null){var r=wt();un(n,e,t,r)}sh(e,t)}};Ag=function(){return be};Fg=function(e,t){var n=be;try{return be=e,t()}finally{be=n}};Ku=function(e,t,n){switch(t){case"input":if(Iu(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 s=cc(r);if(!s)throw Error(V(90));pg(r),Iu(r,s)}}}break;case"textarea":gg(e,n);break;case"select":t=n.value,t!=null&&si(e,!!n.multiple,t,!1)}};kg=Jf;Sg=Es;var tj={usingClientEntryPoint:!1,Events:[po,Gs,cc,jg,Ng,Jf]},aa={findFiberByHostInstance:rs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nj={bundleType:aa.bundleType,version:aa.version,rendererPackageName:aa.rendererPackageName,rendererConfig:aa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Zn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_g(e),e===null?null:e.stateNode},findFiberByHostInstance:aa.findFiberByHostInstance||J2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uo.isDisabled&&Uo.supportsFiber)try{ic=Uo.inject(nj),jn=Uo}catch{}}It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tj;It.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ah(t))throw Error(V(200));return Z2(e,t,null,n)};It.createRoot=function(e,t){if(!ah(e))throw Error(V(299));var n=!1,r="",s=a0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=rh(e,1,!1,null,null,n,!1,r,s),e[Qn]=t.current,Ia(e.nodeType===8?e.parentNode:e),new ih(t)};It.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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=_g(t),e=e===null?null:e.stateNode,e};It.flushSync=function(e){return Es(e)};It.hydrate=function(e,t,n){if(!yc(t))throw Error(V(200));return vc(null,e,t,!0,n)};It.hydrateRoot=function(e,t,n){if(!ah(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=a0;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=i0(t,null,e,1,n??null,s,!1,i,o),e[Qn]=t.current,Ia(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new gc(t)};It.render=function(e,t,n){if(!yc(t))throw Error(V(200));return vc(null,e,t,!1,n)};It.unmountComponentAtNode=function(e){if(!yc(e))throw Error(V(40));return e._reactRootContainer?(Es(function(){vc(null,null,e,!1,function(){e._reactRootContainer=null,e[Qn]=null})}),!0):!1};It.unstable_batchedUpdates=Jf;It.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!yc(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return vc(e,t,n,!1,r)};It.version="18.3.1-next-f1338f8080-20240426";function o0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o0)}catch(e){console.error(e)}}o0(),og.exports=It;var l0=og.exports,ap=l0;Tu.createRoot=ap.createRoot,Tu.hydrateRoot=ap.hydrateRoot;var Qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cs,hr,xi,Fx,rj=(Fx=class extends Qi{constructor(){super();te(this,cs);te(this,hr);te(this,xi);K(this,xi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,hr)||this.setEventListener(_(this,xi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,hr))==null||t.call(this),K(this,hr,void 0))}setEventListener(t){var n;K(this,xi,t),(n=_(this,hr))==null||n.call(this),K(this,hr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,cs)!==t&&(K(this,cs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,cs)=="boolean"?_(this,cs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},cs=new WeakMap,hr=new WeakMap,xi=new WeakMap,Fx),oh=new rj,sj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mr,ff,Lx,ij=(Lx=class{constructor(){te(this,mr,sj);te(this,ff,!1)}setTimeoutProvider(e){K(this,mr,e)}setTimeout(e,t){return _(this,mr).setTimeout(e,t)}clearTimeout(e){_(this,mr).clearTimeout(e)}setInterval(e,t){return _(this,mr).setInterval(e,t)}clearInterval(e){_(this,mr).clearInterval(e)}},mr=new WeakMap,ff=new WeakMap,Lx),as=new ij;function aj(e){setTimeout(e,0)}var oj=typeof window>"u"||"Deno"in globalThis;function yt(){}function lj(e,t){return typeof e=="function"?e(t):e}function Cd(e){return typeof e=="number"&&e>=0&&e!==1/0}function c0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rr(e,t){return typeof e=="function"?e(t):e}function Rt(e,t){return typeof e=="function"?e(t):e}function op(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==lh(o,t.options))return!1}else if(!Ga(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function lp(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(_s(t.options.mutationKey)!==_s(i))return!1}else if(!Ga(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function lh(e,t){return((t==null?void 0:t.queryKeyHashFn)||_s)(e)}function _s(e){return JSON.stringify(e,(t,n)=>Ed(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ga(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ga(e[n],t[n])):!1}var cj=Object.prototype.hasOwnProperty;function u0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=cp(e)&&cp(t);if(!r&&!(Ed(e)&&Ed(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let u=0;for(let f=0;f<l;f++){const d=r?f:o[f],h=e[d],x=t[d];if(h===x){c[d]=h,(r?f<i:cj.call(e,d))&&u++;continue}if(h===null||x===null||typeof h!="object"||typeof x!="object"){c[d]=x;continue}const w=u0(h,x,n+1);c[d]=w,w===h&&u++}return i===l&&u===i?e:c}function Hl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function cp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ed(e){if(!up(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!up(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function up(e){return Object.prototype.toString.call(e)==="[object Object]"}function uj(e){return new Promise(t=>{as.setTimeout(t,e)})}function _d(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?u0(e,t):t}function dj(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function fj(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ch=Symbol();function d0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ch?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uh(e,t){return typeof e=="function"?e(...t):!!e}function hj(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Xa=(()=>{let e=()=>oj;return{isServer(){return e()},setIsServer(t){e=t}}})();function Md(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var mj=aj;function pj(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=mj;const i=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var qe=pj(),gi,pr,yi,Ix,xj=(Ix=class extends Qi{constructor(){super();te(this,gi,!0);te(this,pr);te(this,yi);K(this,yi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,pr)||this.setEventListener(_(this,yi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,pr))==null||t.call(this),K(this,pr,void 0))}setEventListener(t){var n;K(this,yi,t),(n=_(this,pr))==null||n.call(this),K(this,pr,t(this.setOnline.bind(this)))}setOnline(t){_(this,gi)!==t&&(K(this,gi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,gi)}},gi=new WeakMap,pr=new WeakMap,yi=new WeakMap,Ix),Vl=new xj;function gj(e){return Math.min(1e3*2**e,3e4)}function f0(e){return(e??"online")==="online"?Vl.isOnline():!0}var Pd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function h0(e){let t=!1,n=0,r;const s=Md(),i=()=>s.status!=="pending",o=v=>{var j;if(!i()){const p=new Pd(v);h(p),(j=e.onCancel)==null||j.call(e,p)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>oh.isFocused()&&(e.networkMode==="always"||Vl.isOnline())&&e.canRun(),f=()=>f0(e.networkMode)&&e.canRun(),d=v=>{i()||(r==null||r(),s.resolve(v))},h=v=>{i()||(r==null||r(),s.reject(v))},x=()=>new Promise(v=>{var j;r=p=>{(i()||u())&&v(p)},(j=e.onPause)==null||j.call(e)}).then(()=>{var v;r=void 0,i()||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(i())return;let v;const j=n===0?e.initialPromise:void 0;try{v=j??e.fn()}catch(p){v=Promise.reject(p)}Promise.resolve(v).then(d).catch(p=>{var E;if(i())return;const m=e.retry??(Xa.isServer()?0:3),y=e.retryDelay??gj,g=typeof y=="function"?y(n,p):y,N=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,p);if(t||!N){h(p);return}n++,(E=e.onFail)==null||E.call(e,n,p),uj(g).then(()=>u()?void 0:x()).then(()=>{t?h(p):w()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?w():x().then(w),s)}}var us,Ux,m0=(Ux=class{constructor(){te(this,us)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cd(this.gcTime)&&K(this,us,as.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xa.isServer()?1/0:5*60*1e3))}clearGcTimeout(){_(this,us)!==void 0&&(as.clearTimeout(_(this,us)),K(this,us,void 0))}},us=new WeakMap,Ux);function yj(e){return{onFetch:(t,n)=>{var f,d,h,x,w;const r=t.options,s=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((x=t.state.data)==null?void 0:x.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const j=y=>{hj(y,()=>t.signal,()=>v=!0)},p=d0(t.options,t.fetchOptions),m=async(y,g,N)=>{if(v)return Promise.reject(t.signal.reason);if(g==null&&y.pages.length)return Promise.resolve(y);const P=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:g,direction:N?"backward":"forward",meta:t.options.meta};return j(L),L})(),M=await p(P),{maxPages:$}=t.options,R=N?fj:dj;return{pages:R(y.pages,M,$),pageParams:R(y.pageParams,g,$)}};if(s&&i.length){const y=s==="backward",g=y?vj:dp,N={pages:i,pageParams:o},E=g(r,N);l=await m(N,E,y)}else{const y=e??i.length;do{const g=c===0?o[0]??r.initialPageParam:dp(r,l);if(c>0&&g==null)break;l=await m(l,g),c++}while(c<y)}return l};t.options.persister?t.fetchFn=()=>{var v,j;return(j=(v=t.options).persister)==null?void 0:j.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function dp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vj(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var vi,ds,wi,Bt,fs,Je,ao,hs,Tt,p0,$n,Bx,wj=(Bx=class extends m0{constructor(t){super();te(this,Tt);te(this,vi);te(this,ds);te(this,wi);te(this,Bt);te(this,fs);te(this,Je);te(this,ao);te(this,hs);K(this,hs,!1),K(this,ao,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,fs,t.client),K(this,Bt,_(this,fs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,ds,hp(this.options)),this.state=t.state??_(this,ds),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return _(this,vi)}get promise(){var t;return(t=_(this,Je))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,ao),...t},t!=null&&t._type&&K(this,vi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=hp(this.options);n.data!==void 0&&(this.setState(fp(n.data,n.dataUpdatedAt)),K(this,ds,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Bt).remove(this)}setData(t,n){const r=_d(this.state.data,t,this.options);return ae(this,Tt,$n).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ae(this,Tt,$n).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=_(this,Je))==null?void 0:r.promise;return(s=_(this,Je))==null||s.cancel(t),n?n.then(yt).catch(yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,ds)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ch||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!c0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Je))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Je))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,Je)&&(_(this,hs)||ae(this,Tt,p0).call(this)?_(this,Je).cancel({revert:!0}):_(this,Je).cancelRetry()),this.scheduleGc()),_(this,Bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ae(this,Tt,$n).call(this,{type:"invalidate"})}async fetch(t,n){var u,f,d,h,x,w,v,j,p,m,y;if(this.state.fetchStatus!=="idle"&&((u=_(this,Je))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Je))return _(this,Je).continueRetry(),_(this,Je).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(N=>N.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(K(this,hs,!0),r.signal)})},i=()=>{const g=d0(this.options,n),E=(()=>{const P={client:_(this,fs),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return K(this,hs,!1),this.options.persister?this.options.persister(g,E,this):g(E)},l=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,fs),state:this.state,fetchFn:i};return s(g),g})(),c=_(this,vi)==="infinite"?yj(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),K(this,wi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&ae(this,Tt,$n).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),K(this,Je,h0({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:g=>{g instanceof Pd&&g.revert&&this.setState({..._(this,wi),fetchStatus:"idle"}),r.abort()},onFail:(g,N)=>{ae(this,Tt,$n).call(this,{type:"failed",failureCount:g,error:N})},onPause:()=>{ae(this,Tt,$n).call(this,{type:"pause"})},onContinue:()=>{ae(this,Tt,$n).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const g=await _(this,Je).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(x=(h=_(this,Bt).config).onSuccess)==null||x.call(h,g,this),(v=(w=_(this,Bt).config).onSettled)==null||v.call(w,g,this.state.error,this),g}catch(g){if(g instanceof Pd){if(g.silent)return _(this,Je).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw ae(this,Tt,$n).call(this,{type:"error",error:g}),(p=(j=_(this,Bt).config).onError)==null||p.call(j,g,this),(y=(m=_(this,Bt).config).onSettled)==null||y.call(m,this.state.data,g,this),g}finally{this.scheduleGc()}}},vi=new WeakMap,ds=new WeakMap,wi=new WeakMap,Bt=new WeakMap,fs=new WeakMap,Je=new WeakMap,ao=new WeakMap,hs=new WeakMap,Tt=new WeakSet,p0=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$n=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...x0(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...fp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return K(this,wi,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),qe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Bt).notify({query:this,type:"updated",action:t})})},Bx);function x0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Nt,ue,oo,xt,ms,bi,Dn,xr,lo,ji,Ni,ps,xs,gr,ki,ve,ga,zd,$d,Td,Rd,Dd,Od,Ad,g0,Hx,bj=(Hx=class extends Qi{constructor(t,n){super();te(this,ve);te(this,Nt);te(this,ue);te(this,oo);te(this,xt);te(this,ms);te(this,bi);te(this,Dn);te(this,xr);te(this,lo);te(this,ji);te(this,Ni);te(this,ps);te(this,xs);te(this,gr);te(this,ki,new Set);this.options=n,K(this,Nt,t),K(this,xr,null),K(this,Dn,Md()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,ue).addObserver(this),mp(_(this,ue),this.options)?ae(this,ve,ga).call(this):this.updateResult(),ae(this,ve,Rd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fd(_(this,ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fd(_(this,ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ae(this,ve,Dd).call(this),ae(this,ve,Od).call(this),_(this,ue).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,ue);if(this.options=_(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rt(this.options.enabled,_(this,ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ae(this,ve,Ad).call(this),_(this,ue).setOptions(this.options),n._defaulted&&!Hl(this.options,n)&&_(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,ue),observer:this});const s=this.hasListeners();s&&pp(_(this,ue),r,this.options,n)&&ae(this,ve,ga).call(this),this.updateResult(),s&&(_(this,ue)!==r||Rt(this.options.enabled,_(this,ue))!==Rt(n.enabled,_(this,ue))||Rr(this.options.staleTime,_(this,ue))!==Rr(n.staleTime,_(this,ue)))&&ae(this,ve,zd).call(this);const i=ae(this,ve,$d).call(this);s&&(_(this,ue)!==r||Rt(this.options.enabled,_(this,ue))!==Rt(n.enabled,_(this,ue))||i!==_(this,gr))&&ae(this,ve,Td).call(this,i)}getOptimisticResult(t){const n=_(this,Nt).getQueryCache().build(_(this,Nt),t),r=this.createResult(n,t);return Nj(this,r)&&(K(this,xt,r),K(this,bi,this.options),K(this,ms,_(this,ue).state)),r}getCurrentResult(){return _(this,xt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,Dn).status==="pending"&&_(this,Dn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){_(this,ki).add(t)}getCurrentQuery(){return _(this,ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Nt).defaultQueryOptions(t),r=_(this,Nt).getQueryCache().build(_(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ae(this,ve,ga).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,xt)))}createResult(t,n){var $;const r=_(this,ue),s=this.options,i=_(this,xt),o=_(this,ms),l=_(this,bi),u=t!==r?t.state:_(this,oo),{state:f}=t;let d={...f},h=!1,x;if(n._optimisticResults){const R=this.hasListeners(),L=!R&&mp(t,n),U=R&&pp(t,r,n,s);(L||U)&&(d={...d,...x0(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:w,errorUpdatedAt:v,status:j}=d;x=d.data;let p=!1;if(n.placeholderData!==void 0&&x===void 0&&j==="pending"){let R;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(R=i.data,p=!0):R=typeof n.placeholderData=="function"?n.placeholderData(($=_(this,Ni))==null?void 0:$.state.data,_(this,Ni)):n.placeholderData,R!==void 0&&(j="success",x=_d(i==null?void 0:i.data,R,n),h=!0)}if(n.select&&x!==void 0&&!p)if(i&&x===(o==null?void 0:o.data)&&n.select===_(this,lo))x=_(this,ji);else try{K(this,lo,n.select),x=n.select(x),x=_d(i==null?void 0:i.data,x,n),K(this,ji,x),K(this,xr,null)}catch(R){K(this,xr,R)}_(this,xr)&&(w=_(this,xr),x=_(this,ji),v=Date.now(),j="error");const m=d.fetchStatus==="fetching",y=j==="pending",g=j==="error",N=y&&m,E=x!==void 0,M={status:j,fetchStatus:d.fetchStatus,isPending:y,isSuccess:j==="success",isError:g,isInitialLoading:N,isLoading:N,data:x,dataUpdatedAt:d.dataUpdatedAt,error:w,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:g&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:g&&E,isStale:dh(t,n),refetch:this.refetch,promise:_(this,Dn),isEnabled:Rt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=M.data!==void 0,L=M.status==="error"&&!R,U=D=>{L?D.reject(M.error):R&&D.resolve(M.data)},H=()=>{const D=K(this,Dn,M.promise=Md());U(D)},S=_(this,Dn);switch(S.status){case"pending":t.queryHash===r.queryHash&&U(S);break;case"fulfilled":(L||M.data!==S.value)&&H();break;case"rejected":(!L||M.error!==S.reason)&&H();break}}return M}updateResult(){const t=_(this,xt),n=this.createResult(_(this,ue),this.options);if(K(this,ms,_(this,ue).state),K(this,bi,this.options),_(this,ms).data!==void 0&&K(this,Ni,_(this,ue)),Hl(n,t))return;K(this,xt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!_(this,ki).size)return!0;const o=new Set(i??_(this,ki));return this.options.throwOnError&&o.add("error"),Object.keys(_(this,xt)).some(l=>{const c=l;return _(this,xt)[c]!==t[c]&&o.has(c)})};ae(this,ve,g0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ae(this,ve,Rd).call(this)}},Nt=new WeakMap,ue=new WeakMap,oo=new WeakMap,xt=new WeakMap,ms=new WeakMap,bi=new WeakMap,Dn=new WeakMap,xr=new WeakMap,lo=new WeakMap,ji=new WeakMap,Ni=new WeakMap,ps=new WeakMap,xs=new WeakMap,gr=new WeakMap,ki=new WeakMap,ve=new WeakSet,ga=function(t){ae(this,ve,Ad).call(this);let n=_(this,ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(yt)),n},zd=function(){ae(this,ve,Dd).call(this);const t=Rr(this.options.staleTime,_(this,ue));if(Xa.isServer()||_(this,xt).isStale||!Cd(t))return;const r=c0(_(this,xt).dataUpdatedAt,t)+1;K(this,ps,as.setTimeout(()=>{_(this,xt).isStale||this.updateResult()},r))},$d=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,ue)):this.options.refetchInterval)??!1},Td=function(t){ae(this,ve,Od).call(this),K(this,gr,t),!(Xa.isServer()||Rt(this.options.enabled,_(this,ue))===!1||!Cd(_(this,gr))||_(this,gr)===0)&&K(this,xs,as.setInterval(()=>{(this.options.refetchIntervalInBackground||oh.isFocused())&&ae(this,ve,ga).call(this)},_(this,gr)))},Rd=function(){ae(this,ve,zd).call(this),ae(this,ve,Td).call(this,ae(this,ve,$d).call(this))},Dd=function(){_(this,ps)!==void 0&&(as.clearTimeout(_(this,ps)),K(this,ps,void 0))},Od=function(){_(this,xs)!==void 0&&(as.clearInterval(_(this,xs)),K(this,xs,void 0))},Ad=function(){const t=_(this,Nt).getQueryCache().build(_(this,Nt),this.options);if(t===_(this,ue))return;const n=_(this,ue);K(this,ue,t),K(this,oo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},g0=function(t){qe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,xt))}),_(this,Nt).getQueryCache().notify({query:_(this,ue),type:"observerResultsUpdated"})})},Hx);function jj(e,t){return Rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Rt(t.retryOnMount,e)===!1)}function mp(e,t){return jj(e,t)||e.state.data!==void 0&&Fd(e,t,t.refetchOnMount)}function Fd(e,t,n){if(Rt(t.enabled,e)!==!1&&Rr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dh(e,t)}return!1}function pp(e,t,n,r){return(e!==t||Rt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dh(e,n)}function dh(e,t){return Rt(t.enabled,e)!==!1&&e.isStaleByTime(Rr(t.staleTime,e))}function Nj(e,t){return!Hl(e.getCurrentResult(),t)}var co,yn,dt,gs,vn,ir,Vx,kj=(Vx=class extends m0{constructor(t){super();te(this,vn);te(this,co);te(this,yn);te(this,dt);te(this,gs);K(this,co,t.client),this.mutationId=t.mutationId,K(this,dt,t.mutationCache),K(this,yn,[]),this.state=t.state||y0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,yn).includes(t)||(_(this,yn).push(t),this.clearGcTimeout(),_(this,dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,yn,_(this,yn).filter(n=>n!==t)),this.scheduleGc(),_(this,dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,yn).length||(this.state.status==="pending"?this.scheduleGc():_(this,dt).remove(this))}continue(){var t;return((t=_(this,gs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,u,f,d,h,x,w,v,j,p,m,y,g,N,E,P;const n=()=>{ae(this,vn,ir).call(this,{type:"continue"})},r={client:_(this,co),meta:this.options.meta,mutationKey:this.options.mutationKey};K(this,gs,h0({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,$)=>{ae(this,vn,ir).call(this,{type:"failed",failureCount:M,error:$})},onPause:()=>{ae(this,vn,ir).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,dt).canRun(this)}));const s=this.state.status==="pending",i=!_(this,gs).canStart();try{if(s)n();else{ae(this,vn,ir).call(this,{type:"pending",variables:t,isPaused:i}),_(this,dt).config.onMutate&&await _(this,dt).config.onMutate(t,this,r);const $=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));$!==this.state.context&&ae(this,vn,ir).call(this,{type:"pending",context:$,variables:t,isPaused:i})}const M=await _(this,gs).start();return await((u=(c=_(this,dt).config).onSuccess)==null?void 0:u.call(c,M,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,M,t,this.state.context,r)),await((x=(h=_(this,dt).config).onSettled)==null?void 0:x.call(h,M,null,this.state.variables,this.state.context,this,r)),await((v=(w=this.options).onSettled)==null?void 0:v.call(w,M,null,t,this.state.context,r)),ae(this,vn,ir).call(this,{type:"success",data:M}),M}catch(M){try{await((p=(j=_(this,dt).config).onError)==null?void 0:p.call(j,M,t,this.state.context,this,r))}catch($){Promise.reject($)}try{await((y=(m=this.options).onError)==null?void 0:y.call(m,M,t,this.state.context,r))}catch($){Promise.reject($)}try{await((N=(g=_(this,dt).config).onSettled)==null?void 0:N.call(g,void 0,M,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((P=(E=this.options).onSettled)==null?void 0:P.call(E,void 0,M,t,this.state.context,r))}catch($){Promise.reject($)}throw ae(this,vn,ir).call(this,{type:"error",error:M}),M}finally{_(this,dt).runNext(this)}}},co=new WeakMap,yn=new WeakMap,dt=new WeakMap,gs=new WeakMap,vn=new WeakSet,ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qe.batch(()=>{_(this,yn).forEach(r=>{r.onMutationUpdate(t)}),_(this,dt).notify({mutation:this,type:"updated",action:t})})},Vx);function y0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var On,sn,uo,Wx,Sj=(Wx=class extends Qi{constructor(t={}){super();te(this,On);te(this,sn);te(this,uo);this.config=t,K(this,On,new Set),K(this,sn,new Map),K(this,uo,0)}build(t,n,r){const s=new kj({client:t,mutationCache:this,mutationId:++ko(this,uo)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){_(this,On).add(t);const n=Bo(t);if(typeof n=="string"){const r=_(this,sn).get(n);r?r.push(t):_(this,sn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,On).delete(t)){const n=Bo(t);if(typeof n=="string"){const r=_(this,sn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&_(this,sn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Bo(t);if(typeof n=="string"){const r=_(this,sn).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Bo(t);if(typeof n=="string"){const s=(r=_(this,sn).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qe.batch(()=>{_(this,On).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,On).clear(),_(this,sn).clear()})}getAll(){return Array.from(_(this,On))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>lp(n,r))}findAll(t={}){return this.getAll().filter(n=>lp(t,n))}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qe.batch(()=>Promise.all(t.map(n=>n.continue().catch(yt))))}},On=new WeakMap,sn=new WeakMap,uo=new WeakMap,Wx);function Bo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var An,yr,kt,Fn,Vn,fl,Ld,Qx,Cj=(Qx=class extends Qi{constructor(n,r){super();te(this,Vn);te(this,An);te(this,yr);te(this,kt);te(this,Fn);K(this,An,n),this.setOptions(r),this.bindMethods(),ae(this,Vn,fl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=_(this,An).defaultMutationOptions(n),Hl(this.options,r)||_(this,An).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,kt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&_s(r.mutationKey)!==_s(this.options.mutationKey)?this.reset():((s=_(this,kt))==null?void 0:s.state.status)==="pending"&&_(this,kt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,kt))==null||n.removeObserver(this)}onMutationUpdate(n){ae(this,Vn,fl).call(this),ae(this,Vn,Ld).call(this,n)}getCurrentResult(){return _(this,yr)}reset(){var n;(n=_(this,kt))==null||n.removeObserver(this),K(this,kt,void 0),ae(this,Vn,fl).call(this),ae(this,Vn,Ld).call(this)}mutate(n,r){var s;return K(this,Fn,r),(s=_(this,kt))==null||s.removeObserver(this),K(this,kt,_(this,An).getMutationCache().build(_(this,An),this.options)),_(this,kt).addObserver(this),_(this,kt).execute(n)}},An=new WeakMap,yr=new WeakMap,kt=new WeakMap,Fn=new WeakMap,Vn=new WeakSet,fl=function(){var r;const n=((r=_(this,kt))==null?void 0:r.state)??y0();K(this,yr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ld=function(n){qe.batch(()=>{var r,s,i,o,l,c,u,f;if(_(this,Fn)&&this.hasListeners()){const d=_(this,yr).variables,h=_(this,yr).context,x={client:_(this,An),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=_(this,Fn)).onSuccess)==null||s.call(r,n.data,d,h,x)}catch(w){Promise.reject(w)}try{(o=(i=_(this,Fn)).onSettled)==null||o.call(i,n.data,null,d,h,x)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=_(this,Fn)).onError)==null||c.call(l,n.error,d,h,x)}catch(w){Promise.reject(w)}try{(f=(u=_(this,Fn)).onSettled)==null||f.call(u,void 0,n.error,d,h,x)}catch(w){Promise.reject(w)}}}this.listeners.forEach(d=>{d(_(this,yr))})})},Qx),wn,Kx,Ej=(Kx=class extends Qi{constructor(t={}){super();te(this,wn);this.config=t,K(this,wn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??lh(s,n);let o=this.get(i);return o||(o=new wj({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){_(this,wn).has(t.queryHash)||(_(this,wn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,wn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,wn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,wn).get(t)}getAll(){return[..._(this,wn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>op(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>op(t,r)):n}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},wn=new WeakMap,Kx),Ie,vr,wr,Si,Ci,br,Ei,_i,qx,_j=(qx=class{constructor(e={}){te(this,Ie);te(this,vr);te(this,wr);te(this,Si);te(this,Ci);te(this,br);te(this,Ei);te(this,_i);K(this,Ie,e.queryCache||new Ej),K(this,vr,e.mutationCache||new Sj),K(this,wr,e.defaultOptions||{}),K(this,Si,new Map),K(this,Ci,new Map),K(this,br,0)}mount(){ko(this,br)._++,_(this,br)===1&&(K(this,Ei,oh.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ie).onFocus())})),K(this,_i,Vl.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ie).onOnline())})))}unmount(){var e,t;ko(this,br)._--,_(this,br)===0&&((e=_(this,Ei))==null||e.call(this),K(this,Ei,void 0),(t=_(this,_i))==null||t.call(this),K(this,_i,void 0))}isFetching(e){return _(this,Ie).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,vr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ie).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,Ie).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,Ie).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=_(this,Ie).get(r.queryHash),i=s==null?void 0:s.state.data,o=lj(t,i);if(o!==void 0)return _(this,Ie).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return qe.batch(()=>_(this,Ie).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ie).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,Ie);qe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,Ie);return qe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qe.batch(()=>_(this,Ie).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(yt).catch(yt)}invalidateQueries(e,t={}){return qe.batch(()=>(_(this,Ie).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=qe.batch(()=>_(this,Ie).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(yt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,Ie).build(this,t);return n.isStaleByTime(Rr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yt).catch(yt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yt).catch(yt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Vl.isOnline()?_(this,vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ie)}getMutationCache(){return _(this,vr)}getDefaultOptions(){return _(this,wr)}setDefaultOptions(e){K(this,wr,e)}setQueryDefaults(e,t){_(this,Si).set(_s(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Si).values()],n={};return t.forEach(r=>{Ga(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,Ci).set(_s(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Ci).values()],n={};return t.forEach(r=>{Ga(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lh(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ch&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ie).clear(),_(this,vr).clear()}},Ie=new WeakMap,vr=new WeakMap,wr=new WeakMap,Si=new WeakMap,Ci=new WeakMap,br=new WeakMap,Ei=new WeakMap,_i=new WeakMap,qx),v0=b.createContext(void 0),Ds=e=>{const t=b.useContext(v0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Mj=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(v0.Provider,{value:e,children:t})),w0=b.createContext(!1),Pj=()=>b.useContext(w0);w0.Provider;function zj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $j=b.createContext(zj()),Tj=()=>b.useContext($j),Rj=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?uh(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Dj=e=>{b.useEffect(()=>{e.clearReset()},[e])},Oj=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||uh(n,[e.error,r])),Aj=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Fj=(e,t)=>e.isLoading&&e.isFetching&&!t,Lj=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,xp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ij(e,t,n){var x,w,v,j;const r=Pj(),s=Tj(),i=Ds(),o=i.defaultQueryOptions(e);(w=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||w.call(x,o);const l=i.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Aj(o),Rj(o,s,l),Dj(s);const u=!i.getQueryCache().get(o.queryHash),[f]=b.useState(()=>new t(i,o)),d=f.getOptimisticResult(o),h=!r&&c;if(b.useSyncExternalStore(b.useCallback(p=>{const m=h?f.subscribe(qe.batchCalls(p)):yt;return f.updateResult(),m},[f,h]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(o)},[o,f]),Lj(o,d))throw xp(o,f,s);if(Oj({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((j=(v=i.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||j.call(v,o,d),o.experimental_prefetchInRender&&!Xa.isServer()&&Fj(d,r)){const p=u?xp(o,f,s):l==null?void 0:l.promise;p==null||p.catch(yt).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?d:f.trackResult(d)}function Wt(e,t){return Ij(e,bj)}function Yt(e,t){const n=Ds(),[r]=b.useState(()=>new Cj(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(qe.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((o,l)=>{r.mutate(o,l).catch(yt)},[r]);if(s.error&&uh(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/**
41
+ * @remix-run/router v1.23.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function Ya(){return Ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ya.apply(null,arguments)}var kr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(kr||(kr={}));const gp="popstate";function Uj(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:l}=r.location;return Id("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Wl(s)}return Hj(t,n,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Bj(){return Math.random().toString(36).substr(2,8)}function yp(e,t){return{usr:e.state,key:e.key,idx:t}}function Id(e,t,n,r){return n===void 0&&(n=null),Ya({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ki(t):t,{state:n,key:t&&t.key||r||Bj()})}function Wl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ki(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Hj(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,l=kr.Pop,c=null,u=f();u==null&&(u=0,o.replaceState(Ya({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){l=kr.Pop;let j=f(),p=j==null?null:j-u;u=j,c&&c({action:l,location:v.location,delta:p})}function h(j,p){l=kr.Push;let m=Id(v.location,j,p);u=f()+1;let y=yp(m,u),g=v.createHref(m);try{o.pushState(y,"",g)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(g)}i&&c&&c({action:l,location:v.location,delta:1})}function x(j,p){l=kr.Replace;let m=Id(v.location,j,p);u=f();let y=yp(m,u),g=v.createHref(m);o.replaceState(y,"",g),i&&c&&c({action:l,location:v.location,delta:0})}function w(j){let p=s.location.origin!=="null"?s.location.origin:s.location.href,m=typeof j=="string"?j:Wl(j);return m=m.replace(/ $/,"%20"),Oe(p,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,p)}let v={get action(){return l},get location(){return e(s,o)},listen(j){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(gp,d),c=j,()=>{s.removeEventListener(gp,d),c=null}},createHref(j){return t(s,j)},createURL:w,encodeLocation(j){let p=w(j);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:h,replace:x,go(j){return o.go(j)}};return v}var vp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vp||(vp={}));function Vj(e,t,n){return n===void 0&&(n="/"),Wj(e,t,n)}function Wj(e,t,n,r){let s=typeof t=="string"?Ki(t):t,i=Oi(s.pathname||"/",n);if(i==null)return null;let o=b0(e);Qj(o);let l=null,c=rN(i);for(let u=0;l==null&&u<o.length;++u)l=tN(o[u],c);return l}function b0(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Oe(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Dr([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),b0(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Jj(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of j0(i.path))s(i,o,c)}),t}function j0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=j0(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Qj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:eN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Kj=/^:[\w-]+$/,qj=3,Gj=2,Xj=1,Yj=10,Zj=-2,wp=e=>e==="*";function Jj(e,t){let n=e.split("/"),r=n.length;return n.some(wp)&&(r+=Zj),t&&(r+=Gj),n.filter(s=>!wp(s)).reduce((s,i)=>s+(Kj.test(i)?qj:i===""?Xj:Yj),r)}function eN(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function tN(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,f=i==="/"?t:t.slice(i.length)||"/",d=Ud({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),h=c.route;if(!d)return null;Object.assign(s,d.params),o.push({params:s,pathname:Dr([i,d.pathname]),pathnameBase:lN(Dr([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=Dr([i,d.pathnameBase]))}return o}function Ud(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=nN(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,f,d)=>{let{paramName:h,isOptional:x}=f;if(h==="*"){let v=l[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[d];return x&&!w?u[h]=void 0:u[h]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function nN(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),fh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function rN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Oi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const sN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iN=e=>sN.test(e);function aN(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ki(e):e,i;if(n)if(iN(n))i=n;else{if(n.includes("//")){let o=n;n=N0(n),fh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=bp(n.substring(1),"/"):i=bp(n,t)}else i=t;return{pathname:i,search:cN(r),hash:uN(s)}}function bp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function mu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function oN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hh(e,t){let n=oN(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function mh(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ki(e):(s=Ya({},e),Oe(!s.pathname||!s.pathname.includes("?"),mu("?","pathname","search",s)),Oe(!s.pathname||!s.pathname.includes("#"),mu("#","pathname","hash",s)),Oe(!s.search||!s.search.includes("#"),mu("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;s.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=aN(s,l),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const N0=e=>e.replace(/\/\/+/g,"/"),Dr=e=>N0(e.join("/")),lN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),cN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,uN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function dN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const k0=["post","put","patch","delete"];new Set(k0);const fN=["get",...k0];new Set(fN);/**
50
+ * React Router v6.30.4
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Za.apply(null,arguments)}const wc=b.createContext(null),S0=b.createContext(null),Jn=b.createContext(null),bc=b.createContext(null),er=b.createContext({outlet:null,matches:[],isDataRoute:!1}),C0=b.createContext(null);function hN(e,t){let{relative:n}=t===void 0?{}:t;qi()||Oe(!1);let{basename:r,navigator:s}=b.useContext(Jn),{hash:i,pathname:o,search:l}=jc(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Dr([r,o])),s.createHref({pathname:c,search:l,hash:i})}function qi(){return b.useContext(bc)!=null}function Os(){return qi()||Oe(!1),b.useContext(bc).location}function E0(e){b.useContext(Jn).static||b.useLayoutEffect(e)}function As(){let{isDataRoute:e}=b.useContext(er);return e?CN():mN()}function mN(){qi()||Oe(!1);let e=b.useContext(wc),{basename:t,future:n,navigator:r}=b.useContext(Jn),{matches:s}=b.useContext(er),{pathname:i}=Os(),o=JSON.stringify(hh(s,n.v7_relativeSplatPath)),l=b.useRef(!1);return E0(()=>{l.current=!0}),b.useCallback(function(u,f){if(f===void 0&&(f={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=mh(u,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Dr([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,o,i,e])}function ph(){let{matches:e}=b.useContext(er),t=e[e.length-1];return t?t.params:{}}function jc(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Jn),{matches:s}=b.useContext(er),{pathname:i}=Os(),o=JSON.stringify(hh(s,r.v7_relativeSplatPath));return b.useMemo(()=>mh(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function pN(e,t){return xN(e,t)}function xN(e,t,n,r){qi()||Oe(!1);let{navigator:s}=b.useContext(Jn),{matches:i}=b.useContext(er),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Os(),f;if(t){var d;let j=typeof t=="string"?Ki(t):t;c==="/"||(d=j.pathname)!=null&&d.startsWith(c)||Oe(!1),f=j}else f=u;let h=f.pathname||"/",x=h;if(c!=="/"){let j=c.replace(/^\//,"").split("/");x="/"+h.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Vj(e,{pathname:x}),v=bN(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:Dr([c,s.encodeLocation?s.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:Dr([c,s.encodeLocation?s.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),i,n,r);return t&&v?b.createElement(bc.Provider,{value:{location:Za({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:kr.Pop}},v):v}function gN(){let e=SN(),t=dN(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,null)}const yN=b.createElement(gN,null);class vN extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(er.Provider,{value:this.props.routeContext},b.createElement(C0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function wN(e){let{routeContext:t,match:n,children:r}=e,s=b.useContext(wc);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(er.Provider,{value:t},r)}function bN(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let f=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);f>=0||Oe(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<o.length;f++){let d=o[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:x}=n,w=d.route.loader&&h[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let x,w=!1,v=null,j=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||yN,c&&(u<0&&h===0?(EN("route-fallback"),w=!0,j=null):u===h&&(w=!0,j=d.route.hydrateFallbackElement||null)));let p=t.concat(o.slice(0,h+1)),m=()=>{let y;return x?y=v:w?y=j:d.route.Component?y=b.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=f,b.createElement(wN,{match:d,routeContext:{outlet:f,matches:p,isDataRoute:n!=null},children:y})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?b.createElement(vN,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var _0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_0||{}),M0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(M0||{});function jN(e){let t=b.useContext(wc);return t||Oe(!1),t}function NN(e){let t=b.useContext(S0);return t||Oe(!1),t}function kN(e){let t=b.useContext(er);return t||Oe(!1),t}function P0(e){let t=kN(),n=t.matches[t.matches.length-1];return n.route.id||Oe(!1),n.route.id}function SN(){var e;let t=b.useContext(C0),n=NN(),r=P0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function CN(){let{router:e}=jN(_0.UseNavigateStable),t=P0(M0.UseNavigateStable),n=b.useRef(!1);return E0(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Za({fromRouteId:t},i)))},[e,t])}const jp={};function EN(e,t,n){jp[e]||(jp[e]=!0)}function _N(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Np(e){let{to:t,replace:n,state:r,relative:s}=e;qi()||Oe(!1);let{future:i,static:o}=b.useContext(Jn),{matches:l}=b.useContext(er),{pathname:c}=Os(),u=As(),f=mh(t,hh(l,i.v7_relativeSplatPath),c,s==="path"),d=JSON.stringify(f);return b.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:s}),[u,d,s,n,r]),null}function pn(e){Oe(!1)}function MN(e){let{basename:t="/",children:n=null,location:r,navigationType:s=kr.Pop,navigator:i,static:o=!1,future:l}=e;qi()&&Oe(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:i,static:o,future:Za({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=Ki(r));let{pathname:f="/",search:d="",hash:h="",state:x=null,key:w="default"}=r,v=b.useMemo(()=>{let j=Oi(f,c);return j==null?null:{location:{pathname:j,search:d,hash:h,state:x,key:w},navigationType:s}},[c,f,d,h,x,w,s]);return v==null?null:b.createElement(Jn.Provider,{value:u},b.createElement(bc.Provider,{children:n,value:v}))}function PN(e){let{children:t,location:n}=e;return pN(Bd(t),n)}new Promise(()=>{});function Bd(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let i=[...t,s];if(r.type===b.Fragment){n.push.apply(n,Bd(r.props.children,i));return}r.type!==pn&&Oe(!1),!r.props.index||!r.props.children||Oe(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Bd(r.props.children,i)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.4
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ql.apply(null,arguments)}function z0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $N(e,t){return e.button===0&&(!t||t==="_self")&&!zN(e)}const TN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],RN=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],DN="6";try{window.__reactRouterVersion=DN}catch{}const ON=b.createContext({isTransitioning:!1}),AN="startTransition",kp=Qw[AN];function FN(e){let{basename:t,children:n,future:r,window:s}=e,i=b.useRef();i.current==null&&(i.current=Uj({window:s,v5Compat:!0}));let o=i.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},f=b.useCallback(d=>{u&&kp?kp(()=>c(d)):c(d)},[c,u]);return b.useLayoutEffect(()=>o.listen(f),[o,f]),b.useEffect(()=>_N(r),[r]),b.createElement(MN,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const LN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",IN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kl=b.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:f,viewTransition:d}=t,h=z0(t,TN),{basename:x}=b.useContext(Jn),w,v=!1;if(typeof u=="string"&&IN.test(u)&&(w=u,LN))try{let y=new URL(window.location.href),g=u.startsWith("//")?new URL(y.protocol+u):new URL(u),N=Oi(g.pathname,x);g.origin===y.origin&&N!=null?u=N+g.search+g.hash:v=!0}catch{}let j=hN(u,{relative:s}),p=BN(u,{replace:o,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:d});function m(y){r&&r(y),y.defaultPrevented||p(y)}return b.createElement("a",Ql({},h,{href:w||j,onClick:v||i?r:m,ref:n,target:c}))}),Sp=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:u,children:f}=t,d=z0(t,RN),h=jc(c,{relative:d.relative}),x=Os(),w=b.useContext(S0),{navigator:v,basename:j}=b.useContext(Jn),p=w!=null&&HN(h)&&u===!0,m=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,y=x.pathname,g=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;s||(y=y.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase()),g&&j&&(g=Oi(g,j)||g);const N=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let E=y===m||!o&&y.startsWith(m)&&y.charAt(N)==="/",P=g!=null&&(g===m||!o&&g.startsWith(m)&&g.charAt(m.length)==="/"),M={isActive:E,isPending:P,isTransitioning:p},$=E?r:void 0,R;typeof i=="function"?R=i(M):R=[i,E?"active":null,P?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(M):l;return b.createElement(Kl,Ql({},d,{"aria-current":$,className:R,ref:n,style:L,to:c,viewTransition:u}),typeof f=="function"?f(M):f)});var Hd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Hd||(Hd={}));var Cp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cp||(Cp={}));function UN(e){let t=b.useContext(wc);return t||Oe(!1),t}function BN(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=As(),u=Os(),f=jc(e,{relative:o});return b.useCallback(d=>{if($N(d,n)){d.preventDefault();let h=r!==void 0?r:Wl(u)===Wl(f);c(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,f,r,s,n,e,i,o,l])}function HN(e,t){t===void 0&&(t={});let n=b.useContext(ON);n==null&&Oe(!1);let{basename:r}=UN(Hd.useViewTransitionState),s=jc(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Oi(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Oi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ud(s.pathname,o)!=null||Ud(s.pathname,i)!=null}/**
68
+ * @license lucide-react v0.408.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const VN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$0=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
73
+ * @license lucide-react v0.408.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */var WN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
78
+ * @license lucide-react v0.408.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const QN=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...l},c)=>b.createElement("svg",{ref:c,...WN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$0("lucide",s),...l},[...o.map(([u,f])=>b.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
83
+ * @license lucide-react v0.408.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const X=(e,t)=>{const n=b.forwardRef(({className:r,...s},i)=>b.createElement(QN,{ref:i,iconNode:t,className:$0(`lucide-${VN(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
88
+ * @license lucide-react v0.408.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const KN=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
93
+ * @license lucide-react v0.408.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const T0=X("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
98
+ * @license lucide-react v0.408.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const Nc=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
103
+ * @license lucide-react v0.408.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const R0=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
108
+ * @license lucide-react v0.408.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const qN=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
113
+ * @license lucide-react v0.408.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const GN=X("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
118
+ * @license lucide-react v0.408.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const XN=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
123
+ * @license lucide-react v0.408.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const YN=X("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
128
+ * @license lucide-react v0.408.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const ZN=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
133
+ * @license lucide-react v0.408.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const JN=X("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
138
+ * @license lucide-react v0.408.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const D0=X("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
143
+ * @license lucide-react v0.408.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const O0=X("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/**
148
+ * @license lucide-react v0.408.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const xh=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
153
+ * @license lucide-react v0.408.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const gh=X("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/**
158
+ * @license lucide-react v0.408.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const A0=X("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
163
+ * @license lucide-react v0.408.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const ek=X("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
168
+ * @license lucide-react v0.408.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const F0=X("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
173
+ * @license lucide-react v0.408.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const tk=X("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
178
+ * @license lucide-react v0.408.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const nk=X("FileCheck2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]]);/**
183
+ * @license lucide-react v0.408.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const rk=X("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
188
+ * @license lucide-react v0.408.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const sk=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
193
+ * @license lucide-react v0.408.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const ik=X("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
198
+ * @license lucide-react v0.408.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const ak=X("FolderClock",[["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["path",{d:"M16 14v2l1 1",key:"xth2jh"}]]);/**
203
+ * @license lucide-react v0.408.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const L0=X("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
208
+ * @license lucide-react v0.408.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const ok=X("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
213
+ * @license lucide-react v0.408.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const I0=X("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
218
+ * @license lucide-react v0.408.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const lk=X("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
223
+ * @license lucide-react v0.408.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const ck=X("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
228
+ * @license lucide-react v0.408.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const uk=X("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
233
+ * @license lucide-react v0.408.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const dk=X("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
238
+ * @license lucide-react v0.408.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const U0=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
243
+ * @license lucide-react v0.408.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const fk=X("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
248
+ * @license lucide-react v0.408.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const B0=X("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
253
+ * @license lucide-react v0.408.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const hk=X("MoveHorizontal",[["polyline",{points:"18 8 22 12 18 16",key:"1hqrds"}],["polyline",{points:"6 8 2 12 6 16",key:"f0ernq"}],["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}]]);/**
258
+ * @license lucide-react v0.408.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const mk=X("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
263
+ * @license lucide-react v0.408.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const pk=X("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
268
+ * @license lucide-react v0.408.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const xk=X("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
273
+ * @license lucide-react v0.408.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const gk=X("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
278
+ * @license lucide-react v0.408.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const yk=X("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
283
+ * @license lucide-react v0.408.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const H0=X("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
288
+ * @license lucide-react v0.408.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const V0=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
293
+ * @license lucide-react v0.408.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const W0=X("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
298
+ * @license lucide-react v0.408.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const Ms=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
303
+ * @license lucide-react v0.408.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const vk=X("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
308
+ * @license lucide-react v0.408.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const wk=X("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
313
+ * @license lucide-react v0.408.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const bk=X("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
318
+ * @license lucide-react v0.408.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const jk=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
323
+ * @license lucide-react v0.408.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const Nk=X("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
328
+ * @license lucide-react v0.408.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const kk=X("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
333
+ * @license lucide-react v0.408.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const Sk=X("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
338
+ * @license lucide-react v0.408.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const Q0=X("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/**
343
+ * @license lucide-react v0.408.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const Ck=X("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
348
+ * @license lucide-react v0.408.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const yh=X("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
353
+ * @license lucide-react v0.408.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const Ek=X("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
358
+ * @license lucide-react v0.408.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const _k=X("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
363
+ * @license lucide-react v0.408.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const Mk=X("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
368
+ * @license lucide-react v0.408.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const tr=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
373
+ * @license lucide-react v0.408.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const Pk=X("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
378
+ * @license lucide-react v0.408.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const go=X("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
383
+ * @license lucide-react v0.408.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const zk=X("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
388
+ * @license lucide-react v0.408.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const $k=X("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
393
+ * @license lucide-react v0.408.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const Tk=X("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
398
+ * @license lucide-react v0.408.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const Rk=X("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
403
+ * @license lucide-react v0.408.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const Sn=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
408
+ * @license lucide-react v0.408.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const K0=X("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
413
+ * @license lucide-react v0.408.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const q0=X("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function ee(...e){return e.filter(Boolean).join(" ")}const Dk={},Ep=e=>{let t;const n=new Set,r=(f,d)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const x=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(w=>w(t,x))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Dk?"production":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,s,c);return c},G0=e=>e?Ep(e):Ep;var X0={exports:{}},Y0={},Z0={exports:{}},J0={};/**
418
+ * @license React
419
+ * use-sync-external-store-shim.production.js
420
+ *
421
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
422
+ *
423
+ * This source code is licensed under the MIT license found in the
424
+ * LICENSE file in the root directory of this source tree.
425
+ */var Ai=b;function Ok(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ak=typeof Object.is=="function"?Object.is:Ok,Fk=Ai.useState,Lk=Ai.useEffect,Ik=Ai.useLayoutEffect,Uk=Ai.useDebugValue;function Bk(e,t){var n=t(),r=Fk({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Ik(function(){s.value=n,s.getSnapshot=t,pu(s)&&i({inst:s})},[e,n,t]),Lk(function(){return pu(s)&&i({inst:s}),e(function(){pu(s)&&i({inst:s})})},[e]),Uk(n),n}function pu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ak(e,n)}catch{return!0}}function Hk(e,t){return t()}var Vk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Hk:Bk;J0.useSyncExternalStore=Ai.useSyncExternalStore!==void 0?Ai.useSyncExternalStore:Vk;Z0.exports=J0;var Wk=Z0.exports;/**
426
+ * @license React
427
+ * use-sync-external-store-shim/with-selector.production.js
428
+ *
429
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
430
+ *
431
+ * This source code is licensed under the MIT license found in the
432
+ * LICENSE file in the root directory of this source tree.
433
+ */var kc=b,Qk=Wk;function Kk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qk=typeof Object.is=="function"?Object.is:Kk,Gk=Qk.useSyncExternalStore,Xk=kc.useRef,Yk=kc.useEffect,Zk=kc.useMemo,Jk=kc.useDebugValue;Y0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Xk(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=Zk(function(){function c(x){if(!u){if(u=!0,f=x,x=r(x),s!==void 0&&o.hasValue){var w=o.value;if(s(w,x))return d=w}return d=x}if(w=d,qk(f,x))return w;var v=r(x);return s!==void 0&&s(w,v)?(f=x,w):(f=x,d=v)}var u=!1,f,d,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,s]);var l=Gk(e,i[0],i[1]);return Yk(function(){o.hasValue=!0,o.value=l},[l]),Jk(l),l};X0.exports=Y0;var eS=X0.exports;const ev=Gx(eS),tv={},{useDebugValue:tS}=O,{useSyncExternalStoreWithSelector:nS}=ev;let _p=!1;const rS=e=>e;function sS(e,t=rS,n){(tv?"production":void 0)!=="production"&&n&&!_p&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),_p=!0);const r=nS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tS(r),r}const Mp=e=>{(tv?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?G0(e):e,n=(r,s)=>sS(t,r,s);return Object.assign(n,t),n},Sc=e=>e?Mp(e):Mp,nv="datadoom-sidebar";function iS(){try{return localStorage.getItem(nv)==="1"}catch{return!1}}const Pp=Sc((e,t)=>({sidebarCollapsed:iS(),toggleSidebar:()=>t().setSidebar(!t().sidebarCollapsed),setSidebar:n=>{try{localStorage.setItem(nv,n?"1":"0")}catch{}e({sidebarCollapsed:n})}})),Wr=Sc(e=>({crumbs:[],setCrumbs:t=>e({crumbs:t})}));let aS=0;const Vd=Sc(e=>({toasts:[],push:(t,n="info")=>{const r=++aS;e(s=>({toasts:[...s.toasts,{id:r,message:t,tone:n}]})),window.setTimeout(()=>e(s=>({toasts:s.toasts.filter(i=>i.id!==r)})),2600)},dismiss:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))})),Cn=(e,t)=>Vd.getState().push(e,t),oS={info:{icon:ck,cls:"text-text",dot:"text-primary"},success:{icon:Nc,cls:"text-text",dot:"text-success"},error:{icon:Sn,cls:"text-text",dot:"text-hazard"}};function lS(){const e=Vd(n=>n.toasts),t=Vd(n=>n.dismiss);return a.jsx("div",{className:"pointer-events-none fixed bottom-5 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center gap-2",children:e.map(n=>{const{icon:r,dot:s}=oS[n.tone];return a.jsxs("div",{className:"pointer-events-auto flex animate-slide-up items-center gap-2.5 rounded-pill border border-border bg-surface-1 py-2 pl-3 pr-2 text-sm text-text shadow-pop",children:[a.jsx(r,{size:15,className:ee("shrink-0",s)}),a.jsx("span",{children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"ring-focus rounded-full p-1 text-text-faint hover:text-text",children:a.jsx(Sn,{size:13})})]},n.id)})})}const cS={primary:"bg-primary text-white shadow-soft hover:bg-primary-hover focus-visible:ring-primary active:translate-y-px",secondary:"bg-surface-1 text-text border border-border hover:border-border-strong hover:bg-surface-2 focus-visible:ring-primary",ghost:"text-text-muted hover:text-text hover:bg-surface-2 focus-visible:ring-primary",destructive:"bg-hazard text-white hover:opacity-90 focus-visible:ring-hazard active:translate-y-px"};function me({variant:e="secondary",className:t,...n}){return a.jsx("button",{className:ee("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control px-3.5 py-2 text-sm font-medium","transition-all duration-150 outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:opacity-50 disabled:pointer-events-none",cS[e],t),...n})}function ni({className:e,active:t,...n}){return a.jsx("button",{className:ee("ring-focus inline-flex h-8 w-8 items-center justify-center rounded-control text-text-muted transition-colors","hover:bg-surface-2 hover:text-text disabled:opacity-40 disabled:pointer-events-none",t&&"bg-primary-tint text-primary",e),...n})}function uS({value:e,onChange:t,options:n}){return a.jsx("div",{className:"inline-flex items-center rounded-control border border-border bg-surface-2 p-0.5",children:n.map(r=>a.jsx("button",{onClick:()=>t(r.value),className:ee("ring-focus inline-flex items-center gap-1.5 rounded-[7px] px-3 py-1.5 text-xs font-medium transition-colors",e===r.value?"bg-surface-1 text-primary shadow-soft":"text-text-faint hover:text-text"),children:r.label},r.value))})}function Cc({trigger:e,children:t,align:n="right",fullWidth:r=!1}){const[s,i]=b.useState(!1),[o,l]=b.useState(null),c=b.useRef(null),u=b.useRef(null),f=()=>{if(s){i(!1);return}c.current&&l(c.current.getBoundingClientRect()),i(!0)};return b.useEffect(()=>{if(!s)return;const d=v=>{var p,m;const j=v.target;(p=u.current)!=null&&p.contains(j)||(m=c.current)!=null&&m.contains(j)||i(!1)},h=v=>v.key==="Escape"&&i(!1),x=v=>{var j;(j=u.current)!=null&&j.contains(v.target)||i(!1)},w=()=>i(!1);return window.addEventListener("mousedown",d),window.addEventListener("keydown",h),window.addEventListener("resize",w),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("keydown",h),window.removeEventListener("resize",w),window.removeEventListener("scroll",x,!0)}},[s]),a.jsxs("div",{ref:c,className:ee("relative",r?"block w-full":"inline-flex"),children:[e({open:s,toggle:f}),s&&o&&(()=>{const d=window.innerHeight-o.bottom,h=o.top,x=d<220&&h>d,w=Math.max(120,(x?h:d)-12);return l0.createPortal(a.jsx("div",{ref:u,style:{position:"fixed",top:x?void 0:o.bottom+4,bottom:x?window.innerHeight-o.top+4:void 0,left:n==="left"?o.left:void 0,right:n==="right"?Math.max(8,window.innerWidth-o.right):void 0,maxHeight:w},className:ee("z-[60] min-w-[180px] animate-scale-in overflow-auto rounded-control border border-border bg-surface-1 p-1 shadow-pop",x?n==="right"?"origin-bottom-right":"origin-bottom-left":n==="right"?"origin-top-right":"origin-top-left"),children:t(()=>i(!1))}),document.body)})()]})}function ws({children:e,onClick:t,danger:n,icon:r,disabled:s,title:i}){return a.jsxs("button",{onClick:t,disabled:s,title:i,className:ee("ring-focus flex w-full items-center gap-2.5 rounded-[7px] px-2.5 py-2 text-left text-sm transition-colors","disabled:pointer-events-none disabled:opacity-40",n?"text-hazard hover:bg-hazard-tint":"text-text-muted hover:bg-surface-2 hover:text-text"),children:[r&&a.jsx("span",{className:"shrink-0",children:r}),e]})}function fe({className:e,...t}){return a.jsx("div",{className:ee("rounded-card border border-border bg-surface-1 shadow-card",e),...t})}function se({children:e,className:t}){return a.jsx("div",{className:ee("kicker",t),children:e})}function tt({value:e,label:t,tone:n="text"}){const r={text:"text-text",success:"text-success",warning:"text-warning",hazard:"text-hazard",primary:"text-primary"}[n];return a.jsxs("div",{children:[a.jsx("div",{className:ee("font-display text-[40px] font-semibold leading-none tnum",r),children:e}),a.jsx("div",{className:"kicker mt-2",children:t})]})}const zp={draft:{dot:"bg-text-faint",label:"Draft",cls:"text-text-muted bg-surface-2"},running:{dot:"bg-primary animate-pulse",label:"Running",cls:"text-primary bg-primary-tint"},queued:{dot:"bg-primary animate-pulse",label:"Queued",cls:"text-primary bg-primary-tint"},completed:{dot:"bg-success",label:"Completed",cls:"text-success bg-success-tint"},failed:{dot:"bg-hazard",label:"Failed",cls:"text-hazard bg-hazard-tint"},cancelled:{dot:"bg-text-faint",label:"Cancelled",cls:"text-text-muted bg-surface-2"}};function rv({status:e}){const t=zp[e]??zp.draft;return a.jsxs("span",{className:ee("inline-flex items-center gap-1.5 rounded-pill px-2.5 py-1 text-xs font-medium",t.cls),children:[a.jsx("span",{className:ee("h-1.5 w-1.5 rounded-full",t.dot)}),t.label]})}const hl={numeric:"var(--primary)",categorical:"var(--info)",boolean:"var(--warning)",datetime:"var(--success)",text:"var(--hazard)",timeseries:"var(--accent, var(--primary))"};function yo({type:e}){return a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-[11px] font-semibold",style:{color:hl[e]??"var(--text-muted)",background:`color-mix(in srgb, ${hl[e]??"var(--text-muted)"} 12%, transparent)`},children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-[2px]",style:{background:hl[e]??"var(--text-muted)"}}),e]})}function Fi({label:e,value:t}){const n=String(t),[r,s]=b.useState(!1);return a.jsxs("button",{onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(n),s(!0),window.setTimeout(()=>s(!1),1200)},title:"Click to copy",className:"ring-focus group inline-flex items-center gap-2 rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-xs transition-colors hover:border-border-strong",children:[a.jsx("span",{className:"kicker",children:e}),a.jsx("span",{className:"font-mono text-text-muted group-hover:text-text",children:r?"copied!":n.length>18?`${n.slice(0,10)}…${n.slice(-6)}`:n})]})}function Ec({kicker:e,title:t,children:n}){return a.jsxs("div",{className:"dotgrid flex min-h-[42vh] flex-col items-center justify-center rounded-card border border-dashed border-border p-12 text-center",children:[a.jsx(se,{children:e}),a.jsx("h3",{className:"mt-3 font-display text-2xl font-semibold text-text",children:t}),a.jsx("div",{className:"mt-5 flex gap-3",children:n})]})}function Gn({className:e}){return a.jsx("span",{className:ee("inline-block h-4 w-4 animate-spin rounded-full border-2 border-border-strong border-t-primary",e)})}function Fs({open:e,onClose:t,kicker:n,title:r,children:s,footer:i}){return b.useEffect(()=>{if(!e)return;const o=l=>l.key==="Escape"&&t();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,t]),e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 animate-fade-in bg-black/30 backdrop-blur-[3px]",onClick:t,"aria-hidden":!0}),a.jsxs("div",{className:"relative z-10 flex max-h-[90vh] w-full max-w-lg flex-col animate-scale-in rounded-modal border border-border bg-surface-1 p-6 shadow-pop",children:[a.jsx("button",{onClick:t,className:"ring-focus absolute right-4 top-4 rounded-control p-1 text-text-faint hover:bg-surface-2 hover:text-text","aria-label":"Close",children:a.jsx(Sn,{size:18})}),a.jsx(se,{children:n}),a.jsx("h2",{className:"mt-2 shrink-0 pr-8 font-display text-2xl font-semibold tracking-tight",children:r}),a.jsx("div",{className:"mt-5 min-h-0 flex-1 overflow-y-auto",children:s}),i&&a.jsx("div",{className:"mt-6 flex shrink-0 justify-end gap-3",children:i})]})]}):null}function Sr({label:e,hint:t,children:n}){return a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-sm font-medium text-text",children:e}),n,t&&a.jsx("span",{className:"mt-1 block text-xs text-text-faint",children:t})]})}function bs(e){return a.jsx("input",{...e,className:"mt-1.5 w-full rounded-control border border-border bg-surface-2 px-3 py-2 text-sm text-text outline-none focus:border-primary "+(e.className??"")})}let dS=0;const Wd=Sc((e,t)=>({current:null,open:n=>new Promise(r=>{const s=t().current;s&&s.resolve(!1),e({current:{...n,id:++dS,resolve:r}})}),respond:n=>{const r=t().current;r&&r.resolve(n),e({current:null})}})),sv=e=>Wd.getState().open(e);function fS(){const e=Wd(r=>r.current),t=Wd(r=>r.respond);if(b.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Enter"&&t(!0)};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t]),!e)return null;const n=e.tone==="danger";return a.jsx(Fs,{open:!0,onClose:()=>t(!1),kicker:n?"Confirm action":"Confirm",title:e.title,footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{variant:"ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),a.jsx(me,{variant:n?"destructive":"primary",onClick:()=>t(!0),autoFocus:!0,children:e.confirmLabel??"Confirm"})]}),children:e.message?a.jsx("p",{className:"text-sm text-text-muted",children:e.message}):a.jsx("p",{className:"text-sm text-text-muted",children:"This action cannot be undone."})})}class hS extends b.Component{constructor(){super(...arguments);Zi(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){console.error("View error:",n)}componentDidUpdate(n){this.state.error&&n.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-10 text-center",children:[a.jsx("div",{className:"kicker",children:"Something went sideways"}),a.jsx("h2",{className:"font-display text-2xl font-semibold tracking-tight",children:"This view hit an error"}),a.jsx("p",{className:"max-w-md text-sm text-text-muted",children:"The rest of DataDoom is fine — your data is safe. Reset this view to continue."}),a.jsx("pre",{className:"max-w-lg overflow-auto rounded-control border border-border bg-surface-2 p-3 text-left font-mono text-xs text-text-faint",children:this.state.error.message}),a.jsxs("button",{onClick:()=>this.setState({error:null}),className:"ring-focus inline-flex items-center gap-2 rounded-control bg-primary px-3.5 py-2 text-sm font-medium text-white hover:bg-primary-hover",children:[a.jsx(bk,{size:15})," Reset view"]})]}):this.props.children}}const mS=[{to:"/datasets",label:"Datasets",icon:uk,section:"Workspace"},{to:"/templates",label:"Templates",icon:T0,section:"Library"},{to:"/plugins",label:"Plugins",icon:W0,section:"Library"}],pS=["Workspace","Library"];function xS({children:e}){const t=Pp(i=>i.sidebarCollapsed),n=Pp(i=>i.toggleSidebar),r=Wr(i=>i.crumbs),s=Os();return a.jsxs("div",{className:"flex h-full bg-bg",children:[a.jsxs("aside",{className:ee("hidden shrink-0 flex-col border-r border-border bg-surface-1 transition-[width] duration-300 ease-out md:flex",t?"w-[68px]":"w-[244px]"),children:[a.jsx("div",{className:ee("flex h-16 items-center",t?"justify-center px-2":"px-5"),children:a.jsx(Kl,{to:"/datasets",className:"ring-focus flex items-center rounded-control",title:"DataDoom",children:t?a.jsxs("span",{className:"wordmark text-xl text-text",children:["DD",a.jsx("span",{className:"wordmark-dot",children:"."})]}):a.jsxs("span",{className:"leading-none",children:[a.jsxs("span",{className:"wordmark text-[22px] text-text",children:["DataDoom",a.jsx("span",{className:"wordmark-dot",children:"."})]}),a.jsx("span",{className:"kicker mt-1 block",children:"synthetic data lab"})]})})}),a.jsx("nav",{className:"mt-2 flex flex-1 flex-col gap-5 px-3",children:pS.map(i=>a.jsxs("div",{children:[!t&&a.jsx("div",{className:"kicker mb-1.5 px-2.5",children:i}),a.jsx("div",{className:"flex flex-col gap-0.5",children:mS.filter(o=>o.section===i).map(({to:o,label:l,icon:c})=>a.jsx(Sp,{to:o,title:t?l:void 0,className:({isActive:u})=>ee("ring-focus group relative flex items-center gap-3 rounded-control py-2 text-sm font-medium transition-colors",t?"justify-center px-0":"px-2.5",u?"bg-primary-tint text-primary":"text-text-muted hover:bg-surface-2 hover:text-text"),children:({isActive:u})=>a.jsxs(a.Fragment,{children:[u&&a.jsx("span",{className:"absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-primary"}),a.jsx(c,{size:18,strokeWidth:2}),!t&&l]})},o))})]},i))}),a.jsxs("div",{className:"flex flex-col gap-1 border-t border-border px-3 py-3",children:[a.jsxs(Sp,{to:"/settings",title:t?"Settings":void 0,className:({isActive:i})=>ee("ring-focus flex items-center gap-3 rounded-control py-2 text-sm font-medium transition-colors",t?"justify-center px-0":"px-2.5",i?"bg-primary-tint text-primary":"text-text-muted hover:bg-surface-2 hover:text-text"),children:[a.jsx(Nk,{size:18}),!t&&"Settings"]}),!t&&a.jsxs("div",{className:"flex items-center gap-2 px-2.5 pt-1 text-xs text-text-faint",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"}),"local · offline",a.jsx("span",{className:"ml-auto rounded-pill bg-surface-2 px-1.5 py-0.5 font-mono text-[10px]",children:"v0.1"})]}),a.jsxs("button",{onClick:n,title:t?"Expand sidebar":"Collapse sidebar",className:ee("ring-focus mt-1 flex items-center gap-2 rounded-control py-2 text-xs text-text-faint transition-colors hover:bg-surface-2 hover:text-text",t?"justify-center px-0":"px-2.5"),children:[t?a.jsx(xk,{size:18}):a.jsx(pk,{size:16}),!t&&"Collapse"]})]})]}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-3 border-b border-border bg-surface-1/80 px-6 backdrop-blur",children:[a.jsxs(Kl,{to:"/datasets",className:"wordmark text-lg text-text md:hidden",children:["DataDoom",a.jsx("span",{className:"wordmark-dot",children:"."})]}),a.jsx(gS,{crumbs:r}),a.jsx("div",{className:"ml-auto flex items-center gap-3",children:a.jsxs("span",{title:"All data stays on this machine",className:"hidden items-center gap-2 rounded-pill border border-border bg-surface-2 px-3 py-1.5 text-xs text-text-muted sm:inline-flex",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"})," local"]})})]}),a.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:a.jsx(hS,{resetKey:s.pathname,children:e})})]}),a.jsx(lS,{}),a.jsx(fS,{})]})}function gS({crumbs:e}){return e.length===0?a.jsx("div",{className:"hidden md:block"}):a.jsx("nav",{className:"hidden min-w-0 items-center gap-1.5 text-sm md:flex",children:e.map((t,n)=>{const r=n===e.length-1;return a.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[n>0&&a.jsx(qN,{size:14,className:"shrink-0 text-text-faint"}),t.to&&!r?a.jsx(Kl,{to:t.to,className:"ring-focus truncate rounded text-text-muted transition-colors hover:text-text",children:t.label}):a.jsx("span",{className:ee("truncate",r?"font-medium text-text":"text-text-muted"),children:t.label})]},n)})})}class yS extends Error{constructor(n,r,s,i){super(s);Zi(this,"code");Zi(this,"locator");Zi(this,"status");this.status=n,this.code=r,this.locator=i}}async function Me(e,t){const n=await fetch(`/api${e}`,{headers:{"Content-Type":"application/json",...(t==null?void 0:t.headers)||{}},...t});if(n.status===204)return;const r=await n.text(),s=r?JSON.parse(r):void 0;if(!n.ok){const i=(s==null?void 0:s.error)??{};throw new yS(n.status,i.code??"error",i.message??n.statusText,i.locator)}return s}const pe={version:()=>Me("/version"),validate:e=>Me("/specs/validate",{method:"POST",body:JSON.stringify(e)}),estimate:e=>Me("/specs/estimate",{method:"POST",body:JSON.stringify(e)}),parseYaml:e=>Me("/specs/parse",{method:"POST",body:JSON.stringify({text:e})}),listDatasets:e=>Me(`/datasets${e?`?q=${encodeURIComponent(e)}`:""}`),getDataset:e=>Me(`/datasets/${e}`),createDataset:e=>Me("/datasets",{method:"POST",body:JSON.stringify(e)}),deleteDataset:e=>Me(`/datasets/${e}`,{method:"DELETE"}),duplicateDataset:e=>Me(`/datasets/${e}/duplicate`,{method:"POST"}),updateDataset:(e,t)=>Me(`/datasets/${e}`,{method:"PATCH",body:JSON.stringify(t)}),listRuns:e=>Me(`/datasets/${e}/runs`),saveSpec:(e,t)=>Me(`/datasets/${e}/spec`,{method:"PUT",body:JSON.stringify(t)}),getSpec:e=>Me(`/datasets/${e}/spec`),createRun:(e,t)=>Me(`/datasets/${e}/runs`,{method:"POST",body:JSON.stringify({seed:(t==null?void 0:t.seed)??null,name:(t==null?void 0:t.name)??null})}),getRun:e=>Me(`/runs/${e}`),renameRun:(e,t)=>Me(`/runs/${e}`,{method:"PATCH",body:JSON.stringify({name:t})}),deleteRun:e=>Me(`/runs/${e}`,{method:"DELETE"}),cancelRun:e=>Me(`/runs/${e}/cancel`,{method:"POST"}),artifacts:e=>Me(`/runs/${e}/artifacts`),report:e=>Me(`/runs/${e}/report`),preview:(e,t=50,n="clean")=>Me(`/runs/${e}/preview?limit=${t}&version=${n}`),downloadUrl:e=>`/api/artifacts/${e}/download`,bundleUrl:e=>`/api/runs/${e}/bundle`,specYamlUrl:e=>`/api/runs/${e}/spec.yaml`,listPlugins:()=>Me("/plugins"),listTemplates:()=>Me("/templates"),getTemplate:e=>Me(`/templates/${e}`)};function vS(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"dataset"}function Qd(){return{type:"numeric",dist:"normal",params:{mean:0,std:1},dtype:"float"}}function wS(e,t,n){return{datadoom_version:"1",name:vS(e),rows:t,...n!=null?{seed:n}:{},features:{feature_1:Qd()}}}const _c={normal:{mean:0,std:1},lognormal:{mu:0,sigma:1},poisson:{lam:3},pareto:{alpha:3,xm:1},uniform:{low:0,high:1},exponential:{scale:1}},iv=Object.keys(_c);function bS(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(2)} GB`}function jS(){const e=Ds(),t=As(),[n,r]=b.useState(""),[s,i]=b.useState(!1),[o,l]=b.useState(!1),[c,u]=b.useState(null),f=Wr(j=>j.setCrumbs);b.useEffect(()=>f([{label:"Datasets"}]),[f]);const{data:d,isLoading:h}=Wt({queryKey:["datasets",n],queryFn:()=>pe.listDatasets(n||void 0)}),x=Yt({mutationFn:j=>pe.deleteDataset(j),onSuccess:()=>{e.invalidateQueries({queryKey:["datasets"]}),Cn("Dataset deleted","success")}}),w=Yt({mutationFn:j=>pe.duplicateDataset(j),onSuccess:()=>{e.invalidateQueries({queryKey:["datasets"]}),Cn("Dataset duplicated","success")}}),v=(d==null?void 0:d.items)??[];return a.jsxs("div",{className:"h-full overflow-y-auto",children:[a.jsxs("div",{className:"mx-auto max-w-6xl px-8 py-12",children:[a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-5",children:[a.jsxs("div",{children:[a.jsx(se,{children:"Your laboratory"}),a.jsx("h1",{className:"mt-2 font-display text-[40px] font-semibold leading-none tracking-tight",children:"Datasets"}),a.jsx("p",{className:"mt-2.5 max-w-md text-sm text-text-muted",children:"Design a dataset once, regenerate it identically forever from its spec and seed."})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx(jk,{size:15,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-faint"}),a.jsx("input",{value:n,onChange:j=>r(j.target.value),placeholder:"Search datasets…",className:"ring-focus w-52 rounded-control border border-border bg-surface-1 py-2.5 pl-9 pr-3 text-sm shadow-soft outline-none transition-colors focus:border-primary"})]}),a.jsxs(me,{onClick:()=>l(!0),children:[a.jsx(ik,{size:16})," From YAML"]}),a.jsxs(me,{variant:"primary",onClick:()=>i(!0),children:[a.jsx(Ms,{size:16})," Create Dataset"]})]})]}),a.jsx("hr",{className:"my-8 border-border"}),h?a.jsx("div",{className:"flex justify-center py-24",children:a.jsx(Gn,{className:"h-6 w-6"})}):v.length===0?a.jsx(Ec,{kicker:n?"No matches":"Empty laboratory",title:n?`Nothing matches "${n}"`:"Nothing in the lab yet",children:!n&&a.jsxs(me,{variant:"primary",onClick:()=>i(!0),children:[a.jsx(yh,{size:16})," Create your first dataset"]})}):a.jsx("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3",children:v.map(j=>a.jsx(NS,{d:j,onOpen:()=>t(`/datasets/${j.dataset_id}`),onRename:()=>u(j),onDuplicate:()=>w.mutate(j.dataset_id),onDelete:async()=>{await sv({title:`Delete "${j.name}"?`,message:"This permanently removes the dataset along with its runs and artifacts.",confirmLabel:"Delete",tone:"danger"})&&x.mutate(j.dataset_id)}},j.dataset_id))})]}),a.jsx(SS,{open:s,onClose:()=>i(!1),onCreated:j=>t(`/datasets/${j}`)}),a.jsx(ES,{open:o,onClose:()=>l(!1),onCreated:j=>t(`/datasets/${j}`)}),a.jsx(kS,{dataset:c,onClose:()=>u(null)})]})}function NS({d:e,onOpen:t,onRename:n,onDuplicate:r,onDelete:s}){return a.jsxs(fe,{className:"group relative flex flex-col p-5 transition-all duration-200 hover:-translate-y-1 hover:border-border-strong hover:shadow-lift",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("button",{onClick:t,className:"ring-focus min-w-0 rounded text-left",children:a.jsx("h3",{className:"truncate font-display text-xl font-semibold leading-tight tracking-tight text-text transition-colors group-hover:text-primary",children:e.name})}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx(rv,{status:e.status}),a.jsx(Cc,{trigger:({toggle:i})=>a.jsx(ni,{onClick:i,className:"h-7 w-7",children:a.jsx(A0,{size:16})}),children:i=>a.jsxs(a.Fragment,{children:[a.jsx(ws,{icon:a.jsx(H0,{size:14}),onClick:()=>{i(),n()},children:"Rename"}),a.jsx(ws,{icon:a.jsx(D0,{size:14}),onClick:()=>{i(),r()},children:"Duplicate"}),a.jsx(ws,{icon:a.jsx(tr,{size:14}),danger:!0,onClick:()=>{i(),s()},children:"Delete"})]})})]})]}),e.description&&a.jsx("p",{className:"mt-1.5 line-clamp-2 text-sm text-text-muted",children:e.description}),a.jsxs("div",{className:"mt-5 flex items-end justify-between",children:[a.jsxs("div",{className:"flex gap-6",children:[a.jsx($p,{label:"Rows",value:e.rows!=null?e.rows.toLocaleString():"—"}),a.jsx($p,{label:"Features",value:e.features!=null?String(e.features):"—"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"font-display text-2xl font-semibold tnum text-text",children:e.compliance_score!=null?`${Math.round(e.compliance_score*100)}%`:"—"}),a.jsx("div",{className:"kicker mt-0.5",children:"Compliance"})]})]}),a.jsx("button",{onClick:t,className:"ring-focus mt-5 w-full rounded-control border border-border bg-surface-1 py-2 text-sm font-medium text-text-muted transition-colors hover:border-primary hover:bg-primary-tint hover:text-primary",children:"Open Canvas →"})]})}function $p({label:e,value:t}){return a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-sm tnum text-text",children:t}),a.jsx("div",{className:"kicker mt-0.5",children:e})]})}function kS({dataset:e,onClose:t}){const n=Ds(),[r,s]=b.useState(""),[i,o]=b.useState(""),[l,c]=b.useState(null);b.useEffect(()=>{e&&(s(e.name),o(e.description??""),c(null))},[e]);const u=Yt({mutationFn:()=>pe.updateDataset(e.dataset_id,{name:r,description:i||null}),onSuccess:()=>{n.invalidateQueries({queryKey:["datasets"]}),Cn("Dataset renamed","success"),t()},onError:f=>c(f.message)});return a.jsx(Fs,{open:!!e,onClose:t,kicker:"Edit details",title:"Rename dataset",footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:t,children:"Cancel"}),a.jsx(me,{variant:"primary",disabled:!r||u.isPending,onClick:()=>u.mutate(),children:u.isPending?"Saving…":"Save changes"})]}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Sr,{label:"Name",hint:"Slug-friendly: letters, numbers, _ and -.",children:a.jsx(bs,{autoFocus:!0,value:r,onChange:f=>s(f.target.value)})}),a.jsx(Sr,{label:"Description (optional)",children:a.jsx(bs,{value:i,onChange:f=>o(f.target.value)})}),l&&a.jsx("p",{className:"text-sm text-hazard",children:l})]})})}function SS({open:e,onClose:t,onCreated:n}){const[r,s]=b.useState(""),[i,o]=b.useState(""),[l,c]=b.useState(1e4),[u,f]=b.useState(""),[d,h]=b.useState(null),x=Yt({mutationFn:()=>pe.createDataset({name:r,description:i||void 0,spec:wS(r,l,u?Number(u):void 0)}),onSuccess:m=>{w(),n(m.dataset_id)},onError:m=>h(m.message)});function w(){s(""),o(""),c(1e4),f(""),h(null)}const v=m=>Math.round(1e3*Math.pow(1e3,m/100)),j=m=>Math.round(Math.log(m/1e3)/Math.log(1e3)*100),p=l*24;return a.jsx(Fs,{open:e,onClose:t,kicker:"New experiment",title:"Create dataset",footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:t,children:"Cancel"}),a.jsx(me,{variant:"primary",disabled:!r||x.isPending,onClick:()=>x.mutate(),children:x.isPending?"Creating…":"Create & open Canvas"})]}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Sr,{label:"Name",hint:"Slug-friendly: letters, numbers, _ and -.",children:a.jsx(bs,{autoFocus:!0,value:r,onChange:m=>s(m.target.value),placeholder:"fraud-demo"})}),a.jsx(Sr,{label:"Description (optional)",children:a.jsx(bs,{value:i,onChange:m=>o(m.target.value)})}),a.jsx(Sr,{label:`Rows — ${l.toLocaleString()}`,hint:`estimate · ~${bS(p)} CSV`,children:a.jsx("input",{type:"range",min:0,max:100,value:j(l),onChange:m=>c(v(Number(m.target.value))),className:"mt-2 w-full accent-[var(--primary)]"})}),a.jsx(Sr,{label:"Seed (optional)",hint:"Leave blank for a recorded deterministic seed.",children:a.jsx(bs,{value:u,onChange:m=>f(m.target.value.replace(/[^0-9]/g,"")),placeholder:"auto"})}),d&&a.jsx("p",{className:"text-sm text-hazard",children:d})]})})}const CS=`datadoom_version: "1"
434
+ name: my-dataset
435
+ rows: 10000
436
+ seed: 42
437
+ features:
438
+ age:
439
+ type: numeric
440
+ dist: normal
441
+ params: { mean: 40, std: 12 }`;function ES({open:e,onClose:t,onCreated:n}){const[r,s]=b.useState(""),[i,o]=b.useState(null),[l,c]=b.useState(null),[u,f]=b.useState(!1),d=b.useRef(null);function h(){s(""),o(null),c(null)}const x=Yt({mutationFn:async()=>{const{spec:p}=await pe.parseYaml(r);return pe.createDataset({name:p.name,description:p.description??void 0,spec:p})},onSuccess:p=>{h(),n(p.dataset_id)},onError:p=>{o({message:p.message,locator:p.locator}),c(null)}}),w=Yt({mutationFn:()=>pe.parseYaml(r),onSuccess:p=>{c(`Valid · ${p.spec_hash.slice(0,12)}…`),o(null)},onError:p=>{o({message:p.message,locator:p.locator}),c(null)}});async function v(p){p&&(s(await p.text()),o(null),c(null))}const j=x.isPending||w.isPending;return a.jsx(Fs,{open:e,onClose:()=>{h(),t()},kicker:"New experiment",title:"Import from YAML",footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:()=>{h(),t()},children:"Cancel"}),a.jsx(me,{disabled:!r.trim()||j,onClick:()=>w.mutate(),children:w.isPending?"Checking…":"Validate"}),a.jsx(me,{variant:"primary",disabled:!r.trim()||j,onClick:()=>x.mutate(),children:x.isPending?"Importing…":"Import & open Canvas"})]}),children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"text-sm text-text-muted",children:["Paste a ",a.jsx("span",{className:"font-mono text-xs",children:".datadoom.yaml"})," spec (or upload one). It is parsed and validated by the same engine as ",a.jsx("span",{className:"font-mono text-xs",children:"datadoom run"}),"; then open it in the Canvas and Generate."]}),a.jsx("div",{onDragOver:p=>{p.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:p=>{p.preventDefault(),f(!1),v(p.dataTransfer.files[0])},className:ee("rounded-control border transition-colors",u?"border-primary bg-primary-tint":"border-border"),children:a.jsx("textarea",{value:r,onChange:p=>{s(p.target.value),o(null),c(null)},spellCheck:!1,rows:12,placeholder:CS,className:"ring-focus block w-full resize-y rounded-control bg-surface-2 p-3 font-mono text-xs leading-relaxed outline-none focus:ring-1 focus:ring-primary"})}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("button",{onClick:()=>{var p;return(p=d.current)==null?void 0:p.click()},className:"ring-focus inline-flex items-center gap-1.5 rounded-control border border-border px-2.5 py-1.5 text-xs font-medium text-text-muted transition-colors hover:text-text",children:[a.jsx(Tk,{size:13})," Upload .yaml / .json"]}),a.jsx("span",{className:"text-xs text-text-faint",children:"…or drag a file onto the box"}),a.jsx("input",{ref:d,type:"file",accept:".yaml,.yml,.json,application/json,text/yaml",className:"hidden",onChange:p=>{var m;return void v((m=p.target.files)==null?void 0:m[0])}})]}),l&&a.jsxs("p",{className:"text-sm text-success",children:["✓ ",l]}),i&&a.jsxs("p",{className:"text-sm text-hazard",children:["✗ ",i.message,i.locator&&a.jsxs("span",{className:"ml-2 font-mono text-xs",children:["@ ",i.locator]})]})]})})}function _S(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function xu(e){let t=0,n=0;for(;t===0;)t=e();for(;n===0;)n=e();return Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*n)}function av(e,t,n=2e3){const r=_S(1234567),s=[];for(let i=0;i<n;i++){let o=0;switch(e){case"normal":o=(t.mean??0)+(t.std??1)*xu(r);break;case"lognormal":o=Math.exp((t.mu??0)+(t.sigma??1)*xu(r));break;case"uniform":o=(t.low??0)+((t.high??1)-(t.low??0))*r();break;case"exponential":o=-(t.scale??1)*Math.log(1-r());break;case"poisson":{const l=Math.exp(-(t.lam??3));let c=0,u=1;do c++,u*=r();while(u>l);o=c-1;break}case"pareto":o=(t.xm??1)*1/Math.pow(1-r(),1/(t.alpha??3));break;default:o=xu(r)}s.push(o)}return s}function MS(e,t=28){if(e.length===0)return[];const n=Math.min(...e),s=Math.max(...e)-n||1,i=new Array(t).fill(0);for(const o of e){const l=Math.min(t-1,Math.floor((o-n)/s*t));i[l]++}return i.map((o,l)=>({x:n+l/t*s,count:o}))}function vh({values:e,height:t=120,color:n="var(--primary)"}){const r=MS(e,28),s=Math.max(1,...r.map(l=>l.count)),i=100,o=i/r.length;return a.jsx("svg",{viewBox:`0 0 ${i} ${t}`,preserveAspectRatio:"none",className:"h-[120px] w-full",children:r.map((l,c)=>{const u=l.count/s*(t-4);return a.jsx("rect",{x:c*o+.4,y:t-u,width:o-.8,height:u,rx:.6,fill:n,opacity:.85},c)})})}const PS=[{group:"Filler",keys:["lorem"]},{group:"People",keys:["name","first_name","last_name","email","username","phone","occupation","title","nationality"]},{group:"Places",keys:["address","street","city","state","country","postal_code"]},{group:"Business",keys:["company","currency","price"]},{group:"Internet",keys:["url","hostname","ipv4"]},{group:"Generic text",keys:["word","sentence","color"]}],zS=["en","de","fr","es","it","pt","ru","nl","pl","sv","ja","zh"],$S=["numeric","categorical","boolean","datetime","text","timeseries"];function TS({name:e,feature:t,siblingNames:n,onChange:r,onRename:s,onChangeType:i,onDelete:o,locatorError:l}){return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-border p-4",children:[a.jsx(se,{children:"Column inspector"}),a.jsx(RS,{name:e,siblingNames:n,onRename:s}),a.jsx("div",{className:"mt-3 flex flex-wrap gap-1",children:$S.map(c=>a.jsx("button",{onClick:()=>i(c),className:"ring-focus rounded-pill px-2.5 py-1 text-[11px] font-medium capitalize transition-colors "+(t.type===c?"bg-primary-tint text-primary":"text-text-faint hover:bg-surface-2 hover:text-text"),children:c},c))})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[t.type==="numeric"&&a.jsx(OS,{f:t,onChange:r}),t.type==="categorical"&&a.jsx(AS,{f:t,onChange:r}),t.type==="boolean"&&a.jsx(FS,{f:t,onChange:r}),t.type==="datetime"&&a.jsx(LS,{f:t,onChange:r}),t.type==="text"&&a.jsx(IS,{f:t,onChange:r}),t.type==="timeseries"&&a.jsx(US,{f:t,onChange:r}),l&&a.jsx("div",{className:"mt-4 rounded-control border border-hazard bg-hazard-tint px-3 py-2 text-xs text-hazard",children:l}),a.jsx(DS,{feature:t,onChange:r})]}),a.jsx("div",{className:"border-t border-border p-4",children:a.jsxs("button",{onClick:o,className:"ring-focus inline-flex items-center gap-1.5 rounded-control px-2 py-1.5 text-xs font-medium text-text-faint transition-colors hover:bg-hazard-tint hover:text-hazard",children:[a.jsx(tr,{size:14})," Delete column"]})})]})}function RS({name:e,siblingNames:t,onRename:n}){const[r,s]=b.useState(e),[i,o]=b.useState(null);b.useEffect(()=>{s(e),o(null)},[e]);function l(){const c=r.trim();if(c===e){o(null);return}if(!c){o("Name can't be empty"),s(e);return}if(t.includes(c)){o("A column with that name already exists");return}o(null),n(c)}return a.jsxs("div",{className:"mt-1.5",children:[a.jsx("input",{value:r,onChange:c=>s(c.target.value),onBlur:l,onKeyDown:c=>{c.key==="Enter"&&c.target.blur(),c.key==="Escape"&&(s(e),o(null),c.target.blur())},spellCheck:!1,className:"ring-focus w-full rounded-control bg-transparent font-display text-xl font-semibold tracking-tight outline-none focus:bg-surface-2 focus:px-2 focus:py-1"}),i&&a.jsx("p",{className:"mt-1 text-xs text-hazard",children:i})]})}function DS({feature:e,onChange:t}){const n=e.emit===!1;return a.jsxs("label",{className:"mt-5 flex cursor-pointer items-start gap-2.5 rounded-control border border-border bg-surface-2 px-3 py-2.5",children:[a.jsx("input",{type:"checkbox",checked:n,onChange:r=>t({...e,emit:r.target.checked?!1:void 0}),className:"mt-0.5 h-4 w-4 accent-[var(--primary)]"}),a.jsxs("span",{className:"text-xs",children:[a.jsx("span",{className:"font-medium text-text",children:"Latent (not exported)"}),a.jsxs("span",{className:"mt-0.5 block leading-snug text-text-faint",children:["Drives sampling / the causal graph but is ",a.jsx("strong",{children:"not shipped"})," — excluded from the data, the difficulty probe, and compliance. Use for hidden confounders or a latent score behind a label."]})]})]})}function Pe({label:e,children:t}){return a.jsxs("label",{className:"mb-3 block",children:[a.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function vt({value:e,onChange:t}){return a.jsx("input",{type:"number",value:e??"",onChange:n=>t(Number(n.target.value)),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}function OS({f:e,onChange:t}){const n=e.dist==null,r=e.dist??"normal",s=e.params??{},i=av(r,s);return n?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"rounded-control border border-dashed border-border bg-surface-2 p-3 text-sm text-text-muted",children:["This column is ",a.jsx("strong",{className:"text-text",children:"derived"})," — its values come from its parents in the causal graph, not a sampled distribution. Edit its structural function in the Graph view, or detach its parents to make it samplable again."]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"min (clamp)",children:a.jsx(vt,{value:e.min??void 0,onChange:o=>t({...e,min:o})})}),a.jsx(Pe,{label:"max (clamp)",children:a.jsx(vt,{value:e.max??void 0,onChange:o=>t({...e,max:o})})})]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{label:"Distribution",children:a.jsx("select",{value:r,onChange:o=>t({...e,dist:o.target.value,params:_c[o.target.value]}),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:iv.map(o=>a.jsx("option",{value:o,children:o},o))})}),a.jsxs("div",{className:"mb-3 rounded-control border border-border bg-surface-2 p-2",children:[a.jsx(vh,{values:i}),a.jsx("div",{className:"kicker mt-1 text-center",children:"preview · client-sampled"})]}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(s).map(o=>a.jsx(Pe,{label:o,children:a.jsx(vt,{value:s[o],onChange:l=>t({...e,params:{...s,[o]:l}})})},o))}),a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"min (clamp)",children:a.jsx(vt,{value:e.min??void 0,onChange:o=>t({...e,min:o})})}),a.jsx(Pe,{label:"max (clamp)",children:a.jsx(vt,{value:e.max??void 0,onChange:o=>t({...e,max:o})})})]}),a.jsx(Pe,{label:"dtype",children:a.jsx("div",{className:"mt-1 inline-flex rounded-control border border-border p-0.5",children:["float","int"].map(o=>a.jsx("button",{onClick:()=>t({...e,dtype:o}),className:"ring-focus rounded-[7px] px-3 py-1 text-xs "+((e.dtype??"float")===o?"bg-primary-tint text-primary":"text-text-muted"),children:o},o))})})]})}function AS({f:e,onChange:t}){const n=e.categories??[],r=e.weights??n.map(()=>1),s=r.reduce((i,o)=>i+o,0)||1;return a.jsxs(a.Fragment,{children:[a.jsx(se,{children:"Categories & weights"}),a.jsx("div",{className:"mt-2 space-y-1.5",children:n.map((i,o)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{value:i,onChange:l=>{const c=[...n];c[o]=l.target.value,t({...e,categories:c})},className:"ring-focus flex-1 rounded-control border border-border bg-surface-2 px-2 py-1 text-sm outline-none focus:border-primary"}),a.jsx("input",{type:"number",value:r[o],onChange:l=>{const c=[...r];c[o]=Number(l.target.value),t({...e,weights:c})},className:"ring-focus w-16 rounded-control border border-border bg-surface-2 px-2 py-1 font-mono text-xs outline-none focus:border-primary"}),a.jsxs("span",{className:"w-10 text-right font-mono text-[11px] text-text-faint tnum",children:[Math.round(r[o]/s*100),"%"]}),a.jsx("button",{onClick:()=>t({...e,categories:n.filter((l,c)=>c!==o),weights:r.filter((l,c)=>c!==o)}),className:"ring-focus rounded text-text-faint hover:text-hazard",children:a.jsx(Sn,{size:14})})]},o))}),a.jsxs("button",{onClick:()=>t({...e,categories:[...n,`cat_${n.length+1}`],weights:[...r,1]}),className:"ring-focus mt-2 inline-flex items-center gap-1 rounded text-xs font-medium text-primary hover:underline",children:[a.jsx(Ms,{size:13})," Add category"]}),a.jsx("div",{className:"mt-3 flex h-2 overflow-hidden rounded-pill",children:r.map((i,o)=>a.jsx("div",{style:{width:`${i/s*100}%`,background:["var(--primary)","var(--info)","var(--warning)","var(--success)","var(--hazard)"][o%5]}},o))})]})}function FS({f:e,onChange:t}){return a.jsx(Pe,{label:`Base rate · P(true) = ${(e.rate??.5).toFixed(2)}`,children:a.jsx("input",{type:"range",min:0,max:1,step:.01,value:e.rate??.5,onChange:n=>t({...e,rate:Number(n.target.value)}),className:"mt-2 w-full accent-[var(--primary)]"})})}function LS({f:e,onChange:t}){return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{label:"start",children:a.jsx("input",{value:e.start??"",onChange:n=>t({...e,start:n.target.value}),placeholder:"2020-01-01",className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}),a.jsx(Pe,{label:"end",children:a.jsx("input",{value:e.end??"",onChange:n=>t({...e,end:n.target.value}),placeholder:"2024-12-31",className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}),a.jsx(Pe,{label:"granularity",children:a.jsx("select",{value:e.granularity??"day",onChange:n=>t({...e,granularity:n.target.value}),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:["second","minute","hour","day"].map(n=>a.jsx("option",{children:n},n))})})]})}function IS({f:e,onChange:t}){const n=e.generator??"lorem",r=e.length??{min:5,max:30};return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{label:"Generator",children:a.jsx(Tp,{value:n,groups:PS,onChange:s=>t({...e,generator:s})})}),n==="lorem"?a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"min tokens",children:a.jsx(vt,{value:r.min,onChange:s=>t({...e,length:{...r,min:s}})})}),a.jsx(Pe,{label:"max tokens",children:a.jsx(vt,{value:r.max,onChange:s=>t({...e,length:{...r,max:s}})})})]}):a.jsx(Pe,{label:"Locale",children:a.jsx(Tp,{value:e.locale??"en",groups:[{keys:zS}],onChange:s=>t({...e,locale:s})})}),a.jsx("p",{className:"mt-3 text-xs italic text-text-faint",children:"Realistic generators emit genuine-looking values (names, emails, addresses…) via mimesis, seeded from this column's stream — so the same spec + seed still reproduces byte-identical data."})]})}function US({f:e,onChange:t}){const n=e.trend??{slope:0,intercept:0},r=e.seasonality??[],s=e.ar??[],i=s.reduce((o,l)=>o+Math.abs(l),0);return a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"mb-3 text-xs italic text-text-faint",children:["An ordered series ",a.jsx("span",{className:"not-italic font-mono",children:"Xt = trend + Σ seasonality + AR(p) + noise"})," ","over the row index — row order is the time axis. May be a causal parent; never a target."]}),a.jsx(se,{children:"Trend"}),a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"slope (per row)",children:a.jsx(vt,{value:n.slope,onChange:o=>t({...e,trend:{...n,slope:o}})})}),a.jsx(Pe,{label:"intercept",children:a.jsx(vt,{value:n.intercept,onChange:o=>t({...e,trend:{...n,intercept:o}})})})]}),a.jsx(se,{children:"Seasonality"}),a.jsx("div",{className:"mt-2 space-y-2",children:r.map((o,l)=>a.jsxs("div",{className:"rounded-control border border-border bg-surface-2 p-2",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsx(Pe,{label:"amplitude",children:a.jsx(vt,{value:o.amplitude,onChange:c=>{const u=[...r];u[l]={...o,amplitude:c},t({...e,seasonality:u})}})}),a.jsx(Pe,{label:"period",children:a.jsx(vt,{value:o.period,onChange:c=>{const u=[...r];u[l]={...o,period:c},t({...e,seasonality:u})}})}),a.jsx(Pe,{label:"phase",children:a.jsx(vt,{value:o.phase??0,onChange:c=>{const u=[...r];u[l]={...o,phase:c},t({...e,seasonality:u})}})})]}),a.jsxs("button",{onClick:()=>t({...e,seasonality:r.filter((c,u)=>u!==l)}),className:"ring-focus inline-flex items-center gap-1 text-[11px] text-text-faint hover:text-hazard",children:[a.jsx(Sn,{size:12})," remove season"]})]},l))}),a.jsxs("button",{onClick:()=>t({...e,seasonality:[...r,{amplitude:1,period:24,phase:0}]}),className:"ring-focus mt-2 inline-flex items-center gap-1 rounded text-xs font-medium text-primary hover:underline",children:[a.jsx(Ms,{size:13})," Add season"]}),a.jsxs("div",{className:"mt-4",children:[a.jsx(se,{children:"Autoregression (AR)"}),a.jsx("div",{className:"mt-2 space-y-1.5",children:s.map((o,l)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"w-10 font-mono text-[11px] text-text-faint",children:["φ",l+1]}),a.jsx("input",{type:"number",value:o,onChange:c=>{const u=[...s];u[l]=Number(c.target.value),t({...e,ar:u})},className:"ring-focus flex-1 rounded-control border border-border bg-surface-2 px-2 py-1 font-mono text-xs outline-none focus:border-primary"}),a.jsx("button",{onClick:()=>t({...e,ar:s.filter((c,u)=>u!==l)}),className:"ring-focus rounded text-text-faint hover:text-hazard",children:a.jsx(Sn,{size:14})})]},l))}),a.jsxs("button",{onClick:()=>t({...e,ar:[...s,.3]}),className:"ring-focus mt-2 inline-flex items-center gap-1 rounded text-xs font-medium text-primary hover:underline",children:[a.jsx(Ms,{size:13})," Add AR term"]}),s.length>0&&a.jsxs("p",{className:"mt-1.5 text-[11px] "+(i<1?"text-text-faint":"text-hazard"),children:["Σ|φ| = ",i.toFixed(2)," ",i<1?"(stationary ✓)":"(must be < 1)"]})]}),a.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"noise σ",children:a.jsx(vt,{value:e.noise_std??1,onChange:o=>t({...e,noise_std:o})})}),a.jsx(Pe,{label:"dtype",children:a.jsx("div",{className:"mt-1 inline-flex rounded-control border border-border p-0.5",children:["float","int"].map(o=>a.jsx("button",{onClick:()=>t({...e,dtype:o}),className:"ring-focus rounded-[7px] px-3 py-1 text-xs "+((e.dtype??"float")===o?"bg-primary-tint text-primary":"text-text-muted"),children:o},o))})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Pe,{label:"min (clamp)",children:a.jsx(vt,{value:e.min??void 0,onChange:o=>t({...e,min:o})})}),a.jsx(Pe,{label:"max (clamp)",children:a.jsx(vt,{value:e.max??void 0,onChange:o=>t({...e,max:o})})})]})]})}function Tp({value:e,groups:t,onChange:n}){return a.jsx(Cc,{align:"right",fullWidth:!0,trigger:({open:r,toggle:s})=>a.jsxs("button",{type:"button",onClick:s,className:"ring-focus mt-1 flex w-full items-center justify-between rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-left text-sm outline-none focus:border-primary",children:[a.jsx("span",{className:"truncate",children:e}),a.jsx(R0,{size:14,className:ee("ml-2 shrink-0 text-text-faint transition-transform",r&&"rotate-180")})]}),children:r=>a.jsx("div",{className:"w-[240px] max-w-[calc(100vw-1rem)]",children:t.map((s,i)=>a.jsxs("div",{className:"mb-1 last:mb-0",children:[s.group&&a.jsx("div",{className:"px-2.5 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-wider text-text-faint",children:s.group}),s.keys.map(o=>a.jsx(ws,{onClick:()=>{n(o),r()},icon:a.jsx(Nc,{size:14,className:ee("text-primary",o!==e&&"opacity-0")}),children:a.jsx("span",{className:"truncate",children:o})},o))]},s.group??i))})})}const Ps={mcar:{type:"mcar",label:"Missing completely at random",category:"Missingness",blurb:"Blank out cells at random, independent of the data.",math:"mᵢ ~ Bernoulli(rate); value set to NaN where mᵢ = 1.",accent:"var(--info)"},mar:{type:"mar",label:"Missing at random",category:"Missingness",blurb:"Missingness depends on another observed column.",math:"P(missing | driver) = σ(a + strength·z(driver)); the intercept a is calibrated so the expected rate matches.",accent:"var(--info)"},mnar:{type:"mnar",label:"Missing not at random",category:"Missingness",blurb:"Missingness depends on the value itself (or a hidden driver).",math:"P(missing | X) = σ(a + strength·z(X)); higher |value| ⇒ more likely missing.",accent:"var(--info)"},label_noise:{type:"label_noise",label:"Label noise",category:"Noise",blurb:"Flip booleans / reassign categories to a different class.",math:"With probability rate: boolean flips; categorical is reassigned uniformly to one of the other classes.",accent:"var(--warning)"},feature_noise:{type:"feature_noise",label:"Feature noise",category:"Noise",blurb:"Add measurement jitter to a numeric column.",math:"x' = x + ε, ε ~ dist(params). Independent of x.",accent:"var(--warning)"},drift:{type:"drift",label:"Concept drift",category:"Shift",blurb:"A column's values ramp over the row index.",math:"x'[i] = x[i] + magnitude·g(i); g linear i/(n-1) ∈ [0,1] or a step.",accent:"var(--primary)"},covariate_shift:{type:"covariate_shift",label:"Covariate shift",category:"Shift",blurb:"Move a column's distribution toward target moments.",math:"Affine x' = (x-μ)(σₜ/σ) + μₜ — hits the target mean/std exactly while preserving shape.",accent:"var(--primary)"},leakage:{type:"leakage",label:"Target leakage",category:"Leakage",blurb:"Plant a near-perfect proxy column for the label.",math:"into = target + N(0, noise·σ); corr(into, target) = 1/√(1+noise²).",accent:"var(--hazard)"}},BS=["mcar","mar","mnar","label_noise","feature_noise","drift","covariate_shift","leakage"],HS=["Missingness","Noise","Shift","Leakage"];function wh(e){const t=Object.entries(e.features);return{all:t.map(([n])=>n),numeric:t.filter(([,n])=>n.type==="numeric").map(([n])=>n),numericOrBool:t.filter(([,n])=>n.type==="numeric"||n.type==="boolean").map(([n])=>n),labelable:t.filter(([,n])=>n.type==="boolean"||n.type==="categorical").map(([n])=>n)}}function VS(e,t){const n=wh(t),r=s=>s[0]??"";switch(e){case"mcar":return{type:e,columns:n.all.length?[r(n.all)]:[],rate:.05};case"mar":return{type:e,column:r(n.all),driver:r(n.numericOrBool),rate:.15,strength:2};case"mnar":return{type:e,column:r(n.numericOrBool),rate:.15,strength:2};case"label_noise":return{type:e,column:r(n.labelable),rate:.05};case"feature_noise":return{type:e,column:r(n.numeric),dist:"normal",params:{mean:0,std:1}};case"drift":return{type:e,column:r(n.numeric),schedule:{kind:"linear",magnitude:1}};case"covariate_shift":return{type:e,column:r(n.numeric),target:{mean:0}};case"leakage":return{type:e,target:r(n.numericOrBool),into:WS(t),noise:.05}}}function WS(e){const t=new Set(Object.keys(e.features));for(const s of e.failures??[])s.type==="leakage"&&s.into&&t.add(s.into);let n="leak",r=1;for(;t.has(n);)n=`leak_${++r}`;return n}function Gi(e){return typeof e.target=="string"?e.target:""}function vo(e){return e.target&&typeof e.target=="object"?e.target:{}}function qt(e){return`${Math.round((e??0)*100)}%`}function Ln(e){return e==null||!Number.isFinite(e)?"—":Number.isInteger(e)?String(e):e.toFixed(2)}function QS(e){var t;switch(e.type){case"mcar":return`${(e.columns??[]).join(", ")||"—"} · ${qt(e.rate)}`;case"mar":return`${e.column||"—"} · ${qt(e.rate)} ← ${e.driver||"?"}`;case"mnar":return`${e.column||"—"} · ${qt(e.rate)} self`;case"label_noise":return`${e.column||"—"} · ${qt(e.rate)}`;case"feature_noise":return`${e.column||"—"} · +${e.dist??"noise"}`;case"drift":return`${e.column||"—"} · ${((t=e.schedule)==null?void 0:t.kind)??"linear"} ${Ln(bh(e))}`;case"covariate_shift":return`${e.column||"—"} → μ ${Ln(vo(e).mean)}`;case"leakage":return`${e.into||"leak"} ≈ ${Gi(e)||"?"}`}}function bh(e){const t=e.schedule??{};return t.magnitude!=null?t.magnitude:t.rate!=null?t.rate:0}function ov(e,t){var n,r;switch(e.type){case"mcar":{const s=(e.columns??[]).length;return{line:`Blank ≈${qt(e.rate)} of ${s||"—"} column${s===1?"":"s"}, at random.`,metric:`≈${Math.round((e.rate??0)*t).toLocaleString()} cells/col`}}case"mar":return{line:`≈${qt(e.rate)} of ${e.column||"—"} goes missing, more often when ${e.driver||"the driver"} is high.`,metric:`≈${Math.round((e.rate??0)*t).toLocaleString()} rows`};case"mnar":return{line:`≈${qt(e.rate)} of ${e.column||"—"} goes missing, biased toward its own extreme values.`,metric:`≈${Math.round((e.rate??0)*t).toLocaleString()} rows`};case"label_noise":return{line:`Flip ≈${qt(e.rate)} of ${e.column||"—"} labels to a different class.`,metric:`≈${Math.round((e.rate??0)*t).toLocaleString()} rows`};case"feature_noise":return{line:`Add ${e.dist??"noise"}(${Object.entries(e.params??{}).map(([s,i])=>`${s}=${Ln(i)}`).join(", ")}) jitter to ${e.column||"—"}.`};case"drift":{const s=bh(e),i=((n=e.schedule)==null?void 0:n.magnitude)!=null?s:s*Math.max(0,t-1);return{line:`${e.column||"—"} ramps by up to ${Ln(i)} across the dataset (${((r=e.schedule)==null?void 0:r.kind)??"linear"}).`,metric:`Δ ${Ln(i)}`}}case"covariate_shift":{const s=vo(e);return{line:`Shift ${e.column||"—"} to mean ${Ln(s.mean)}${s.std!=null?`, std ${Ln(s.std)}`:""} (exact moment-match).`}}case"leakage":{const s=e.noise??.05,i=1/Math.sqrt(1+s*s);return{line:`Plant "${e.into||"leak"}" as a proxy of ${Gi(e)||"—"}.`,metric:`corr ≈ ${i.toFixed(3)}`}}}}function KS(e,t){const n=[];for(const r of e??[])switch(r.type){case"mcar":(r.columns??[]).includes(t)&&n.push({type:r.type,text:`${qt(r.rate)} missing`});break;case"mar":r.column===t?n.push({type:r.type,text:`${qt(r.rate)} missing ← ${r.driver??"?"}`}):r.driver===t&&n.push({type:r.type,text:`drives ${r.column??"?"} missingness`,secondary:!0});break;case"mnar":r.column===t&&n.push({type:r.type,text:`${qt(r.rate)} missing (self)`});break;case"label_noise":r.column===t&&n.push({type:r.type,text:`${qt(r.rate)} flipped`});break;case"feature_noise":r.column===t&&n.push({type:r.type,text:`+${r.dist??"noise"} noise`});break;case"drift":r.column===t&&n.push({type:r.type,text:`drift ${Ln(bh(r))}`});break;case"covariate_shift":r.column===t&&n.push({type:r.type,text:`shift → μ ${Ln(vo(r).mean)}`});break;case"leakage":Gi(r)===t&&n.push({type:r.type,text:`→ ${r.into??"leak"} (proxy)`,secondary:!0});break}return n}function lv(e,t){var i,o;const n=wh(t),r=l=>l!=null&&l>=0&&l<=1,s=(l,c)=>!!l&&(c??n.all).includes(l);switch(e.type){case"mcar":return(i=e.columns)!=null&&i.length?e.columns.some(l=>!n.all.includes(l))?"A selected column no longer exists.":r(e.rate)?null:"Rate must be between 0 and 1.":"Pick at least one column to blank out.";case"mar":return s(e.column)?s(e.driver,n.numericOrBool)?r(e.rate)?null:"Rate must be between 0 and 1.":"Pick a numeric or boolean driver.":"Pick the column to make missing.";case"mnar":return s(e.column,n.numericOrBool)?e.driver&&!s(e.driver,n.numericOrBool)?"Driver must be numeric or boolean.":r(e.rate)?null:"Rate must be between 0 and 1.":"Pick a numeric or boolean column (it drives its own missingness).";case"label_noise":return s(e.column,n.labelable)?r(e.rate)?null:"Rate must be between 0 and 1.":"Pick a boolean or categorical column.";case"feature_noise":return s(e.column,n.numeric)?e.dist?null:"Pick a noise distribution.":"Pick a numeric column.";case"drift":return s(e.column,n.numeric)?null:"Pick a numeric column.";case"covariate_shift":{if(!s(e.column,n.numeric))return"Pick a numeric column.";const l=vo(e);return l.mean==null&&l.std==null?"Set a target mean and/or std.":null}case"leakage":{const l=Gi(e);return s(l,n.numericOrBool)?(o=e.into)!=null&&o.trim()?e.into===l?"The proxy must differ from the target.":null:"Name the planted proxy column.":"Pick a numeric or boolean target to leak."}}}function Rp(e,t){if(!(e!=null&&e.length))return e??[];const n=r=>r==null?r:t.rename&&r===t.rename.from?t.rename.to:r;return e.map(r=>{const s={...r};return s.columns&&(s.columns=s.columns.map(i=>n(i)).filter(i=>i!==t.remove)),s.column=n(s.column),s.driver=n(s.driver),typeof s.target=="string"&&(s.target=n(s.target)),s}).filter(r=>!qS(r,t.remove))}function qS(e,t){if(t==null)return!1;switch(e.type){case"mcar":return(e.columns??[]).length===0;case"mar":return e.column===t||e.driver===t;case"mnar":case"label_noise":case"feature_noise":case"drift":case"covariate_shift":return e.column===t;case"leakage":return Gi(e)===t}}const GS={mcar:ek,mar:gh,mnar:F0,label_noise:Q0,feature_noise:Rk,drift:Pk,covariate_shift:hk,leakage:go};function wo({type:e,size:t=15}){const n=GS[e];return a.jsx(n,{size:t})}function jh({failures:e,column:t,className:n,compact:r}){const s=KS(e,t);return s.length===0?null:a.jsx("div",{className:ee("flex flex-wrap gap-1",n),children:s.map((i,o)=>{const l=Ps[i.type].accent;return a.jsxs("span",{title:`${Ps[i.type].label} · ${i.text}`,className:ee("inline-flex items-center gap-1 rounded-pill px-1.5 py-0.5 text-[10px] font-medium leading-tight",i.secondary&&"opacity-70"),style:{color:l,background:`color-mix(in srgb, ${l} 13%, transparent)`},children:[a.jsx(wo,{type:i.type,size:11}),!r&&a.jsx("span",{className:"whitespace-nowrap",children:i.text})]},o)})})}const XS=["linear","logistic","polynomial","map","identity"],YS=["none","normal","lognormal","uniform","exponential"];function ZS(){return{edges:[],noise:{},interventions:[]}}function Nh(e){return e.causal??ZS()}function cv(e){return new Set(((e==null?void 0:e.edges)??[]).map(t=>t.to))}function uv(e,t){return e.edges.filter(n=>n.to===t)}function JS(e,t,n){if(n.type==="categorical"){const r={};return(n.categories??[]).forEach((s,i)=>r[s]=i),{from:e,to:t,fn:"map",mapping:r}}return{from:e,to:t,fn:"linear",weight:1,bias:0}}function Dp(e,t,n){if(t===n)return!0;const r=new Map;for(const o of e)r.has(o.from)||r.set(o.from,[]),r.get(o.from).push(o.to);const s=[n],i=new Set;for(;s.length;){const o=s.pop();if(o===t)return!0;if(!i.has(o)){i.add(o);for(const l of r.get(o)??[])s.push(l)}}return!1}function dv(e,t){var o;const n=new Map;e.forEach(l=>n.set(l,[]));for(const l of t)(o=n.get(l.to))==null||o.push(l.from);const r={},s=new Set,i=l=>{if(r[l]!==void 0)return r[l];if(s.has(l))return 0;s.add(l);const c=n.get(l)??[],u=c.length?Math.max(...c.map(i))+1:0;return s.delete(l),r[l]=u,u};return e.forEach(i),r}function eC(e,t){return t?e==="map"?t.type==="categorical":t.type==="numeric"||t.type==="boolean":!0}function Op(e,t){const n=cv(t),r={...e.features};for(const[s,i]of Object.entries(r)){if(i.type!=="numeric")continue;const o=n.has(s),l=i.dist!=null;if(o&&l){const{dist:c,params:u,...f}=i;r[s]={...f,type:"numeric"}}else!o&&!l&&(r[s]={...i,dist:"normal",params:{mean:0,std:1}})}return{...e,features:r,causal:t}}function Mc(e){const t={};for(const n of(e==null?void 0:e.interventions)??[])for(const[r,s]of Object.entries(n.do??{}))t[r]=s;return t}function Ap(e,t,n){const r=Mc(e);n===null?delete r[t]:r[t]=n;const s=Object.entries(r).map(([i,o])=>({do:{[i]:o}}));return{...e,interventions:s}}const Ve=e=>e==null||Number.isNaN(e)?"—":Number.isInteger(e)?String(e):e.toFixed(2);function kh(e){var t,n,r;switch(e.type){case"numeric":{const s=[];if(e.dist){s.push({label:"dist",value:e.dist,tone:"accent"});const i=e.params??{};for(const[o,l]of Object.entries(i))s.push({label:o,value:Ve(l)})}else s.push({label:"value",value:"derived (causal)",tone:"muted"});return(e.min!=null||e.max!=null)&&s.push({label:"clamp",value:`${e.min!=null?Ve(e.min):"−∞"} … ${e.max!=null?Ve(e.max):"∞"}`}),s.push({label:"dtype",value:e.dtype??"float"}),s}case"categorical":{const s=e.categories??[],i=e.weights??s.map(()=>1),o=i.reduce((c,u)=>c+u,0)||1,l=[{label:"levels",value:String(s.length),tone:"accent"}];return s.slice(0,6).forEach((c,u)=>{l.push({label:c,value:`${Math.round((i[u]??1)/o*100)}%`})}),s.length>6&&l.push({label:"…",value:`+${s.length-6} more`,tone:"muted"}),l}case"boolean":return[{label:"P(true)",value:(e.rate??.5).toFixed(2),tone:"accent"}];case"datetime":return[{label:"from",value:e.start??"—"},{label:"to",value:e.end??"—"},{label:"grain",value:e.granularity??"day"}];case"text":{const s=e.generator??"lorem",i=[{label:"generator",value:s,tone:"accent"}];return s==="lorem"?i.push({label:"length",value:`${((t=e.length)==null?void 0:t.min)??5}–${((n=e.length)==null?void 0:n.max)??30}`}):i.push({label:"locale",value:e.locale??"en"}),i}case"timeseries":{const s=[{label:"series",value:"T+S+AR+ε",tone:"accent"}];e.trend&&(e.trend.slope||e.trend.intercept)&&s.push({label:"trend",value:`${Ve(e.trend.slope)}·t + ${Ve(e.trend.intercept)}`});const i=e.seasonality??[];return i.length&&s.push({label:"seasons",value:i.map(o=>Ve(o.period)).join(", ")}),(r=e.ar)!=null&&r.length&&s.push({label:"AR(p)",value:`p=${e.ar.length}`}),s.push({label:"noise σ",value:Ve(e.noise_std??1)}),(e.min!=null||e.max!=null)&&s.push({label:"clamp",value:`${e.min!=null?Ve(e.min):"−∞"} … ${e.max!=null?Ve(e.max):"∞"}`}),s.push({label:"dtype",value:e.dtype??"float"}),s}default:return[]}}function fv(e){const t=[{label:`← ${e.from}`,value:e.fn,tone:"accent"}];switch(e.fn){case"linear":case"logistic":e.weight!=null&&t.push({label:"· weight",value:Ve(e.weight)}),e.bias!=null&&t.push({label:"· bias",value:Ve(e.bias)});break;case"polynomial":(e.coeffs??[]).forEach((n,r)=>t.push({label:`· c${r}`,value:Ve(n)}));break;case"map":Object.entries(e.mapping??{}).forEach(([n,r])=>t.push({label:`· ${n}`,value:Ve(r)}));break}return t}function hv(e){var t;switch(e.fn){case"linear":return`linear · w=${Ve(e.weight)}${e.bias?` b=${Ve(e.bias)}`:""}`;case"logistic":return`logistic · w=${Ve(e.weight)}${e.bias?` b=${Ve(e.bias)}`:""}`;case"polynomial":return`poly · deg ${(((t=e.coeffs)==null?void 0:t.length)??1)-1}`;case"map":{const n=Object.entries(e.mapping??{});return`map · ${n.slice(0,2).map(([s,i])=>`${s}→${Ve(i)}`).join(" ")}${n.length>2?" …":""}`}case"identity":return"identity";default:return e.fn}}function tC(e,t){var i;const n=uv(e,t),r=(i=e.noise)==null?void 0:i[t],s=Mc(e);return{derived:n.length>0,incoming:n,noise:r&&r.dist!=="none"?r:void 0,intervenedValue:t in s?s[t]:void 0}}function mv(e,t){const n=tC(e,t),r=[];for(const s of n.incoming)r.push(...fv(s));if(n.noise){const s=n.noise.params?Object.entries(n.noise.params).map(([i,o])=>`${i}=${Ve(o)}`).join(" "):"";r.push({label:"noise ε",value:`${n.noise.dist} ${s}`.trim()})}return n.intervenedValue!==void 0&&r.push({label:"do()",value:`= ${Ve(n.intervenedValue)}`,tone:"accent"}),r}const pv="datadoom-layout";function Li(e,t,n){if(!e)return n;try{const r=localStorage.getItem(`${pv}:${e}:${t}`);return r?JSON.parse(r):n}catch{return n}}function ql(e,t,n){if(e)try{localStorage.setItem(`${pv}:${e}:${t}`,JSON.stringify(n))}catch{}}const nC=212,rC=132,Xr=10,gu=(e,t,n)=>Math.min(n,Math.max(t,e));function sC({spec:e,datasetId:t,selected:n,showPreview:r,onSelect:s,onRename:i,onDelete:o,onReorder:l,onAddColumn:c}){const u=Object.keys(e.features),f=Nh(e),d=b.useRef(null),[h,x]=b.useState(()=>Li(t,"table-view",{x:36,y:32,scale:1})),w=b.useRef(h);w.current=h;const[v,j]=b.useState(()=>Li(t,"table-cols",{})),p=C=>v[C]??nC,[m,y]=b.useState(null),[g,N]=b.useState(null),E=b.useRef(null),P=b.useRef(null),[M,$]=b.useState(!1);b.useEffect(()=>{const C=window.setTimeout(()=>ql(t,"table-view",h),350);return()=>window.clearTimeout(C)},[h,t]),b.useEffect(()=>{const C=d.current;if(!C)return;const k=z=>{z.preventDefault();const A=C.getBoundingClientRect(),F=z.clientX-A.left,Q=z.clientY-A.top;z.ctrlKey||z.metaKey?x(W=>{const Z=gu(W.scale*Math.exp(-z.deltaY*.0016),.4,2.4),re=Z/W.scale;return{scale:Z,x:F-(F-W.x)*re,y:Q-(Q-W.y)*re}}):x(W=>({...W,x:W.x-z.deltaX,y:W.y-z.deltaY}))};return C.addEventListener("wheel",k,{passive:!1}),()=>C.removeEventListener("wheel",k)},[]);function R(C){if(C.button===0){P.current={sx:C.clientX,sy:C.clientY,ox:w.current.x,oy:w.current.y},$(!0);try{C.currentTarget.setPointerCapture(C.pointerId)}catch{}}}function L(C){const k=P.current;if(!k)return;const z=k.ox+(C.clientX-k.sx),A=k.oy+(C.clientY-k.sy);x(F=>({...F,x:z,y:A}))}function U(C){if(P.current){P.current=null,$(!1);try{C.currentTarget.releasePointerCapture(C.pointerId)}catch{}}}function H(C,k){C.preventDefault(),C.stopPropagation(),E.current={name:k,startX:C.clientX,startW:p(k)};const z=F=>{const Q=E.current;if(!Q)return;const W=(F.clientX-Q.startX)/w.current.scale,Z=Math.max(rC,Q.startW+W);j(re=>({...re,[Q.name]:Z}))},A=()=>{E.current=null,window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",A),j(F=>(ql(t,"table-cols",F),F))};window.addEventListener("pointermove",z),window.addEventListener("pointerup",A)}function S(){if(m==null||!g||g.index===m)return D();const C=[...u],[k]=C.splice(m,1);let z=C.indexOf(u[g.index]);g.before||(z+=1),C.splice(z,0,k),l(C),D()}function D(){y(null),N(null)}function T(){x({x:36,y:32,scale:1})}const I=r?u.map(C=>oC(e.features[C])):[];return a.jsxs("div",{ref:d,onPointerDown:R,onPointerMove:L,onPointerUp:U,onPointerCancel:U,className:ee("relative h-full overflow-hidden bg-bg",M?"cursor-grabbing":"cursor-grab"),style:{backgroundImage:"radial-gradient(var(--border) 1px, transparent 1px)",backgroundSize:`${22*h.scale}px ${22*h.scale}px`,backgroundPosition:`${h.x}px ${h.y}px`},children:[a.jsx("div",{className:"absolute left-0 top-0 origin-top-left",style:{transform:`translate(${h.x}px, ${h.y}px) scale(${h.scale})`},onDrop:S,onDragOver:C=>C.preventDefault(),children:a.jsxs("div",{className:"inline-flex overflow-hidden rounded-card border border-border bg-surface-1 shadow-lift",children:[u.map((C,k)=>a.jsx(iC,{name:C,width:p(C),feature:e.features[C],rows:[...kh(e.features[C]),...mv(f,C)],failures:e.failures,preview:r?I[k]:null,selected:n===C,dragging:m===k,insertBefore:(g==null?void 0:g.index)===k&&g.before,insertAfter:(g==null?void 0:g.index)===k&&!g.before,isLast:k===u.length-1,siblings:u.filter(z=>z!==C),onSelect:()=>s(C),onRename:z=>i(C,z),onDelete:()=>o(C),onDragStart:()=>y(k),onDragEnd:D,onDragOverCard:z=>N({index:k,before:z}),onResizeStart:z=>H(z,C)},C)),a.jsx("button",{onClick:c,onPointerDown:C=>C.stopPropagation(),title:"Add column",className:"ring-focus flex w-14 shrink-0 flex-col items-center justify-center gap-1 bg-surface-1 text-text-faint transition-colors hover:bg-primary-tint hover:text-primary",children:a.jsx(Ms,{size:20})})]})}),a.jsxs("div",{className:"pointer-events-none absolute bottom-3 left-4 right-32 text-xs italic text-text-faint",children:["Unlimited canvas · drag empty space to pan · ⌘/Ctrl-scroll to zoom · drag a column edge to resize ·"," ",a.jsx(I0,{size:11,className:"mb-0.5 inline"})," to reorder"]}),a.jsxs("div",{className:"absolute bottom-3 right-3 flex flex-col overflow-hidden rounded-control border border-border bg-surface-1 shadow-card",children:[a.jsx(yu,{title:"Zoom in",onClick:()=>x(C=>({...C,scale:gu(C.scale*1.15,.4,2.4)})),children:a.jsx(K0,{size:15})}),a.jsx(yu,{title:"Zoom out",onClick:()=>x(C=>({...C,scale:gu(C.scale/1.15,.4,2.4)})),children:a.jsx(q0,{size:15})}),a.jsx(yu,{title:"Reset view",onClick:T,children:a.jsx(B0,{size:14})})]})]})}function yu({children:e,onClick:t,title:n}){return a.jsx("button",{title:n,onClick:t,onPointerDown:r=>r.stopPropagation(),className:"flex h-8 w-8 items-center justify-center border-b border-border text-text-muted last:border-b-0 hover:bg-surface-2 hover:text-text",children:e})}function iC({name:e,width:t,feature:n,rows:r,failures:s,preview:i,selected:o,dragging:l,insertBefore:c,insertAfter:u,isLast:f,siblings:d,onSelect:h,onRename:x,onDelete:w,onDragStart:v,onDragEnd:j,onDragOverCard:p,onResizeStart:m}){return a.jsxs("div",{className:ee("relative flex shrink-0 flex-col",!f&&"border-r border-border",l&&"opacity-40"),style:{width:t},onPointerDown:y=>y.stopPropagation(),onClick:h,onDragOver:y=>{y.preventDefault();const g=y.currentTarget.getBoundingClientRect();p(y.clientX<g.left+g.width/2)},children:[c&&a.jsx(Fp,{side:"left"}),u&&a.jsx(Fp,{side:"right"}),a.jsxs("div",{className:ee("flex flex-col",o?"bg-primary-tint":"bg-surface-2"),children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[a.jsx("span",{draggable:!0,onDragStart:v,onDragEnd:j,onClick:y=>y.stopPropagation(),title:"Drag to reorder",className:"cursor-grab text-text-faint hover:text-text active:cursor-grabbing",children:a.jsx(I0,{size:14})}),a.jsx(aC,{name:e,siblings:d,onRename:x}),a.jsx("button",{title:"Delete column",onClick:y=>{y.stopPropagation(),w()},className:"ring-focus rounded p-1 text-text-faint transition-colors hover:bg-hazard-tint hover:text-hazard",children:a.jsx(tr,{size:13})})]}),a.jsxs("div",{className:"px-2.5 pb-2 pt-1.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx(yo,{type:n.type}),n.emit===!1&&a.jsx("span",{title:"Latent — drives the model but is not exported",className:"rounded-pill border border-border bg-surface-2 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-text-faint",children:"latent"})]}),a.jsx(jh,{failures:s,column:e,className:"mt-1.5"}),a.jsxs("dl",{className:"mt-2 space-y-1",children:[r.map((y,g)=>a.jsxs("div",{className:"flex items-start justify-between gap-2 text-[11px] leading-snug",children:[a.jsx("dt",{className:"shrink-0 text-text-faint",children:y.label}),a.jsx("dd",{className:ee("break-words text-right font-mono",y.tone==="accent"?"text-primary":y.tone==="muted"?"text-text-faint":"text-text-muted"),children:y.value})]},g)),r.length===0&&a.jsx("div",{className:"text-[11px] text-text-faint",children:"no settings"})]})]})]}),i&&a.jsx("div",{className:"border-t border-border",children:i.map((y,g)=>a.jsx("div",{className:ee("truncate border-b border-border/60 px-2.5 py-1.5 font-mono text-[11px] text-text-muted tnum last:border-b-0",g%2===1&&"bg-surface-2/40"),title:y,children:y},g))}),!f&&a.jsx("div",{onPointerDown:m,onClick:y=>y.stopPropagation(),className:"absolute -right-1 top-0 z-10 h-full w-2 cursor-col-resize hover:bg-primary/20"})]})}function Fp({side:e}){return a.jsx("span",{className:ee("absolute top-0 z-20 h-full w-0.5 bg-primary",e==="left"?"left-0":"right-0")})}function aC({name:e,siblings:t,onRename:n}){const[r,s]=b.useState(e);b.useEffect(()=>s(e),[e]);function i(){const o=r.trim();if(!o||o===e||t.includes(o)){s(e);return}n(o)}return a.jsx("input",{value:r,onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onBlur:i,onKeyDown:o=>{o.key==="Enter"&&o.target.blur(),o.key==="Escape"&&(s(e),o.target.blur())},spellCheck:!1,className:"ring-focus min-w-0 flex-1 rounded bg-transparent font-display text-sm font-semibold tracking-tight text-text outline-none focus:bg-surface-1 focus:px-1"})}function oC(e){switch(e.type){case"numeric":return e.dist?av(e.dist,e.params??{},128).slice(0,Xr).map(n=>{let r=n;return e.min!=null&&(r=Math.max(e.min,r)),e.max!=null&&(r=Math.min(e.max,r)),e.dtype==="int"?String(Math.round(r)):r.toFixed(3)}):Array(Xr).fill("· derived ·");case"categorical":{const t=e.categories??[];return Array.from({length:Xr},(n,r)=>t[r%(t.length||1)]??"—")}case"boolean":return Array.from({length:Xr},(t,n)=>n%3===0?"true":"false");case"datetime":return Array.from({length:Xr},()=>e.start??"2020-01-01");case"text":return Array(Xr).fill("lorem ipsum…");default:return Array(Xr).fill("—")}}function pt(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=pt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:lC}=O,{useSyncExternalStoreWithSelector:cC}=ev,uC=e=>e;function xv(e,t=uC,n){const r=cC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lC(r),r}const Lp=(e,t)=>{const n=G0(e),r=(s,i=t)=>xv(n,s,i);return Object.assign(r,n),r},dC=(e,t)=>e?Lp(e,t):Lp;function mt(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(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var fC={value:()=>{}};function Pc(){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 ml(n)}function ml(e){this._=e}function hC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ml.prototype=Pc.prototype={constructor:ml,on:function(e,t){var n=this._,r=hC(e+"",n),s,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((s=(e=r[i]).type)&&(s=mC(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(s=(e=r[i]).type)n[s]=Ip(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Ip(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ml(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,i;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,s=i.length;r<s;++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],s=0,i=r.length;s<i;++s)r[s].value.apply(t,n)}};function mC(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Ip(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=fC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Kd="http://www.w3.org/1999/xhtml";const Up={svg:"http://www.w3.org/2000/svg",xhtml:Kd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Up.hasOwnProperty(t)?{space:Up[t],local:e}:e}function pC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Kd&&t.documentElement.namespaceURI===Kd?t.createElement(e):t.createElementNS(n,e)}}function xC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gv(e){var t=zc(e);return(t.local?xC:pC)(t)}function gC(){}function Sh(e){return e==null?gC:function(){return this.querySelector(e)}}function yC(e){typeof e!="function"&&(e=Sh(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=new Array(o),c,u,f=0;f<o;++f)(c=i[f])&&(u=e.call(c,c.__data__,f,i))&&("__data__"in c&&(u.__data__=c.__data__),l[f]=u);return new Lt(r,this._parents)}function vC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wC(){return[]}function yv(e){return e==null?wC:function(){return this.querySelectorAll(e)}}function bC(e){return function(){return vC(e.apply(this,arguments))}}function jC(e){typeof e=="function"?e=bC(e):e=yv(e);for(var t=this._groups,n=t.length,r=[],s=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&(r.push(e.call(c,c.__data__,u,o)),s.push(c));return new Lt(r,s)}function vv(e){return function(){return this.matches(e)}}function wv(e){return function(t){return t.matches(e)}}var NC=Array.prototype.find;function kC(e){return function(){return NC.call(this.children,e)}}function SC(){return this.firstElementChild}function CC(e){return this.select(e==null?SC:kC(typeof e=="function"?e:wv(e)))}var EC=Array.prototype.filter;function _C(){return Array.from(this.children)}function MC(e){return function(){return EC.call(this.children,e)}}function PC(e){return this.selectAll(e==null?_C:MC(typeof e=="function"?e:wv(e)))}function zC(e){typeof e!="function"&&(e=vv(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Lt(r,this._parents)}function bv(e){return new Array(e.length)}function $C(){return new Lt(this._enter||this._groups.map(bv),this._parents)}function Gl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gl.prototype={constructor:Gl,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 TC(e){return function(){return e}}function RC(e,t,n,r,s,i){for(var o=0,l,c=t.length,u=i.length;o<u;++o)(l=t[o])?(l.__data__=i[o],r[o]=l):n[o]=new Gl(e,i[o]);for(;o<c;++o)(l=t[o])&&(s[o]=l)}function DC(e,t,n,r,s,i,o){var l,c,u=new Map,f=t.length,d=i.length,h=new Array(f),x;for(l=0;l<f;++l)(c=t[l])&&(h[l]=x=o.call(c,c.__data__,l,t)+"",u.has(x)?s[l]=c:u.set(x,c));for(l=0;l<d;++l)x=o.call(e,i[l],l,i)+"",(c=u.get(x))?(r[l]=c,c.__data__=i[l],u.delete(x)):n[l]=new Gl(e,i[l]);for(l=0;l<f;++l)(c=t[l])&&u.get(h[l])===c&&(s[l]=c)}function OC(e){return e.__data__}function AC(e,t){if(!arguments.length)return Array.from(this,OC);var n=t?DC:RC,r=this._parents,s=this._groups;typeof e!="function"&&(e=TC(e));for(var i=s.length,o=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var f=r[u],d=s[u],h=d.length,x=FC(e.call(f,f&&f.__data__,u,r)),w=x.length,v=l[u]=new Array(w),j=o[u]=new Array(w),p=c[u]=new Array(h);n(f,d,v,j,p,x,t);for(var m=0,y=0,g,N;m<w;++m)if(g=v[m]){for(m>=y&&(y=m+1);!(N=j[y])&&++y<w;);g._next=N||null}}return o=new Lt(o,r),o._enter=l,o._exit=c,o}function FC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LC(){return new Lt(this._exit||this._groups.map(bv),this._parents)}function IC(e,t,n){var r=this.enter(),s=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?i.remove():n(i),r&&s?r.merge(s).order():s}function UC(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,i=r.length,o=Math.min(s,i),l=new Array(s),c=0;c<o;++c)for(var u=n[c],f=r[c],d=u.length,h=l[c]=new Array(d),x,w=0;w<d;++w)(x=u[w]||f[w])&&(h[w]=x);for(;c<s;++c)l[c]=n[c];return new Lt(l,this._parents)}function BC(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,i=r[s],o;--s>=0;)(o=r[s])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function HC(e){e||(e=VC);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;i<r;++i){for(var o=n[i],l=o.length,c=s[i]=new Array(l),u,f=0;f<l;++f)(u=o[f])&&(c[f]=u);c.sort(t)}return new Lt(s,this._parents).order()}function VC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function WC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function QC(){return Array.from(this)}function KC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length;s<i;++s){var o=r[s];if(o)return o}return null}function qC(){let e=0;for(const t of this)++e;return e}function GC(){return!this.node()}function XC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],i=0,o=s.length,l;i<o;++i)(l=s[i])&&e.call(l,l.__data__,i,s);return this}function YC(e){return function(){this.removeAttribute(e)}}function ZC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JC(e,t){return function(){this.setAttribute(e,t)}}function eE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function nE(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 rE(e,t){var n=zc(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?ZC:YC:typeof t=="function"?n.local?nE:tE:n.local?eE:JC)(n,t))}function jv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function sE(e){return function(){this.style.removeProperty(e)}}function iE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function aE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oE(e,t,n){return arguments.length>1?this.each((t==null?sE:typeof t=="function"?aE:iE)(e,t,n??"")):Ii(this.node(),e)}function Ii(e,t){return e.style.getPropertyValue(t)||jv(e).getComputedStyle(e,null).getPropertyValue(t)}function lE(e){return function(){delete this[e]}}function cE(e,t){return function(){this[e]=t}}function uE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function dE(e,t){return arguments.length>1?this.each((t==null?lE:typeof t=="function"?uE:cE)(e,t)):this.node()[e]}function Nv(e){return e.trim().split(/^|\s+/)}function Ch(e){return e.classList||new kv(e)}function kv(e){this._node=e,this._names=Nv(e.getAttribute("class")||"")}kv.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 Sv(e,t){for(var n=Ch(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Cv(e,t){for(var n=Ch(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function fE(e){return function(){Sv(this,e)}}function hE(e){return function(){Cv(this,e)}}function mE(e,t){return function(){(t.apply(this,arguments)?Sv:Cv)(this,e)}}function pE(e,t){var n=Nv(e+"");if(arguments.length<2){for(var r=Ch(this.node()),s=-1,i=n.length;++s<i;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?mE:t?fE:hE)(n,t))}function xE(){this.textContent=""}function gE(e){return function(){this.textContent=e}}function yE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function vE(e){return arguments.length?this.each(e==null?xE:(typeof e=="function"?yE:gE)(e)):this.node().textContent}function wE(){this.innerHTML=""}function bE(e){return function(){this.innerHTML=e}}function jE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function NE(e){return arguments.length?this.each(e==null?wE:(typeof e=="function"?jE:bE)(e)):this.node().innerHTML}function kE(){this.nextSibling&&this.parentNode.appendChild(this)}function SE(){return this.each(kE)}function CE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function EE(){return this.each(CE)}function _E(e){var t=typeof e=="function"?e:gv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ME(){return null}function PE(e,t){var n=typeof e=="function"?e:gv(e),r=t==null?ME:typeof t=="function"?t:Sh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zE(){var e=this.parentNode;e&&e.removeChild(this)}function $E(){return this.each(zE)}function TE(){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 DE(e){return this.select(e?RE:TE)}function OE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function AE(e){return function(t){e.call(this,t,this.__data__)}}function FE(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,s=t.length,i;n<s;++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 IE(e,t,n){return function(){var r=this.__on,s,i=AE(t);if(r){for(var o=0,l=r.length;o<l;++o)if((s=r[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=n),s.value=t;return}}this.addEventListener(e.type,i,n),s={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(s):this.__on=[s]}}function UE(e,t,n){var r=FE(e+""),s,i=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,f;c<u;++c)for(s=0,f=l[c];s<i;++s)if((o=r[s]).type===f.type&&o.name===f.name)return f.value}return}for(l=t?IE:LE,s=0;s<i;++s)this.each(l(r[s],t,n));return this}function Ev(e,t,n){var r=jv(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function BE(e,t){return function(){return Ev(this,e,t)}}function HE(e,t){return function(){return Ev(this,e,t.apply(this,arguments))}}function VE(e,t){return this.each((typeof t=="function"?HE:BE)(e,t))}function*WE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length,o;s<i;++s)(o=r[s])&&(yield o)}var _v=[null];function Lt(e,t){this._groups=e,this._parents=t}function bo(){return new Lt([[document.documentElement]],_v)}function QE(){return this}Lt.prototype=bo.prototype={constructor:Lt,select:yC,selectAll:jC,selectChild:CC,selectChildren:PC,filter:zC,data:AC,enter:$C,exit:LC,join:IC,merge:UC,selection:QE,order:BC,sort:HC,call:WC,nodes:QC,node:KC,size:qC,empty:GC,each:XC,attr:rE,style:oE,property:dE,classed:pE,text:vE,html:NE,raise:SE,lower:EE,append:_E,insert:PE,remove:$E,clone:DE,datum:OE,on:UE,dispatch:VE,[Symbol.iterator]:WE};function Qt(e){return typeof e=="string"?new Lt([[document.querySelector(e)]],[document.documentElement]):new Lt([[e]],_v)}function KE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gn(e,t){if(e=KE(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 s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const qE={passive:!1},Ja={capture:!0,passive:!1};function vu(e){e.stopImmediatePropagation()}function ui(e){e.preventDefault(),e.stopImmediatePropagation()}function Mv(e){var t=e.document.documentElement,n=Qt(e).on("dragstart.drag",ui,Ja);"onselectstart"in t?n.on("selectstart.drag",ui,Ja):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Pv(e,t){var n=e.document.documentElement,r=Qt(e).on("dragstart.drag",null);t&&(r.on("click.drag",ui,Ja),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ho=e=>()=>e;function qd(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:o,y:l,dx:c,dy:u,dispatch:f}){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:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:f}})}qd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function GE(e){return!e.ctrlKey&&!e.button}function XE(){return this.parentNode}function YE(e,t){return t??{x:e.x,y:e.y}}function ZE(){return navigator.maxTouchPoints||"ontouchstart"in this}function zv(){var e=GE,t=XE,n=YE,r=ZE,s={},i=Pc("start","drag","end"),o=0,l,c,u,f,d=0;function h(g){g.on("mousedown.drag",x).filter(r).on("touchstart.drag",j).on("touchmove.drag",p,qE).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(g,N){if(!(f||!e.call(this,g,N))){var E=y(this,t.call(this,g,N),g,N,"mouse");E&&(Qt(g.view).on("mousemove.drag",w,Ja).on("mouseup.drag",v,Ja),Mv(g.view),vu(g),u=!1,l=g.clientX,c=g.clientY,E("start",g))}}function w(g){if(ui(g),!u){var N=g.clientX-l,E=g.clientY-c;u=N*N+E*E>d}s.mouse("drag",g)}function v(g){Qt(g.view).on("mousemove.drag mouseup.drag",null),Pv(g.view,u),ui(g),s.mouse("end",g)}function j(g,N){if(e.call(this,g,N)){var E=g.changedTouches,P=t.call(this,g,N),M=E.length,$,R;for($=0;$<M;++$)(R=y(this,P,g,N,E[$].identifier,E[$]))&&(vu(g),R("start",g,E[$]))}}function p(g){var N=g.changedTouches,E=N.length,P,M;for(P=0;P<E;++P)(M=s[N[P].identifier])&&(ui(g),M("drag",g,N[P]))}function m(g){var N=g.changedTouches,E=N.length,P,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),P=0;P<E;++P)(M=s[N[P].identifier])&&(vu(g),M("end",g,N[P]))}function y(g,N,E,P,M,$){var R=i.copy(),L=gn($||E,N),U,H,S;if((S=n.call(g,new qd("beforestart",{sourceEvent:E,target:h,identifier:M,active:o,x:L[0],y:L[1],dx:0,dy:0,dispatch:R}),P))!=null)return U=S.x-L[0]||0,H=S.y-L[1]||0,function D(T,I,C){var k=L,z;switch(T){case"start":s[M]=D,z=o++;break;case"end":delete s[M],--o;case"drag":L=gn(C||I,N),z=o;break}R.call(T,g,new qd(T,{sourceEvent:I,subject:S,target:h,identifier:M,active:z,x:L[0]+U,y:L[1]+H,dx:L[0]-k[0],dy:L[1]-k[1],dispatch:R}),P)}}return h.filter=function(g){return arguments.length?(e=typeof g=="function"?g:Ho(!!g),h):e},h.container=function(g){return arguments.length?(t=typeof g=="function"?g:Ho(g),h):t},h.subject=function(g){return arguments.length?(n=typeof g=="function"?g:Ho(g),h):n},h.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:Ho(!!g),h):r},h.on=function(){var g=i.on.apply(i,arguments);return g===i?h:g},h.clickDistance=function(g){return arguments.length?(d=(g=+g)*g,h):Math.sqrt(d)},h}function Eh(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $v(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jo(){}var eo=.7,Xl=1/eo,di="\\s*([+-]?\\d+)\\s*",to="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",JE=/^#([0-9a-f]{3,8})$/,e5=new RegExp(`^rgb\\(${di},${di},${di}\\)$`),t5=new RegExp(`^rgb\\(${kn},${kn},${kn}\\)$`),n5=new RegExp(`^rgba\\(${di},${di},${di},${to}\\)$`),r5=new RegExp(`^rgba\\(${kn},${kn},${kn},${to}\\)$`),s5=new RegExp(`^hsl\\(${to},${kn},${kn}\\)$`),i5=new RegExp(`^hsla\\(${to},${kn},${kn},${to}\\)$`),Bp={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};Eh(jo,no,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hp,formatHex:Hp,formatHex8:a5,formatHsl:o5,formatRgb:Vp,toString:Vp});function Hp(){return this.rgb().formatHex()}function a5(){return this.rgb().formatHex8()}function o5(){return Tv(this).formatHsl()}function Vp(){return this.rgb().formatRgb()}function no(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=JE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Wp(t):n===3?new Et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vo(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=e5.exec(e))?new Et(t[1],t[2],t[3],1):(t=t5.exec(e))?new Et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n5.exec(e))?Vo(t[1],t[2],t[3],t[4]):(t=r5.exec(e))?Vo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=s5.exec(e))?qp(t[1],t[2]/100,t[3]/100,1):(t=i5.exec(e))?qp(t[1],t[2]/100,t[3]/100,t[4]):Bp.hasOwnProperty(e)?Wp(Bp[e]):e==="transparent"?new Et(NaN,NaN,NaN,0):null}function Wp(e){return new Et(e>>16&255,e>>8&255,e&255,1)}function Vo(e,t,n,r){return r<=0&&(e=t=n=NaN),new Et(e,t,n,r)}function l5(e){return e instanceof jo||(e=no(e)),e?(e=e.rgb(),new Et(e.r,e.g,e.b,e.opacity)):new Et}function Gd(e,t,n,r){return arguments.length===1?l5(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Eh(Et,Gd,$v(jo,{brighter(e){return e=e==null?Xl:Math.pow(Xl,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?eo:Math.pow(eo,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Et(js(this.r),js(this.g),js(this.b),Yl(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:Qp,formatHex:Qp,formatHex8:c5,formatRgb:Kp,toString:Kp}));function Qp(){return`#${os(this.r)}${os(this.g)}${os(this.b)}`}function c5(){return`#${os(this.r)}${os(this.g)}${os(this.b)}${os((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kp(){const e=Yl(this.opacity);return`${e===1?"rgb(":"rgba("}${js(this.r)}, ${js(this.g)}, ${js(this.b)}${e===1?")":`, ${e})`}`}function Yl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function os(e){return e=js(e),(e<16?"0":"")+e.toString(16)}function qp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ln(e,t,n,r)}function Tv(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof jo||(e=no(e)),!e)return new ln;if(e instanceof ln)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new ln(o,l,c,e.opacity)}function u5(e,t,n,r){return arguments.length===1?Tv(e):new ln(e,t,n,r??1)}function ln(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Eh(ln,u5,$v(jo,{brighter(e){return e=e==null?Xl:Math.pow(Xl,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?eo:Math.pow(eo,e),new ln(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,s=2*n-r;return new Et(wu(e>=240?e-240:e+120,s,r),wu(e,s,r),wu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ln(Gp(this.h),Wo(this.s),Wo(this.l),Yl(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(){const e=Yl(this.opacity);return`${e===1?"hsl(":"hsla("}${Gp(this.h)}, ${Wo(this.s)*100}%, ${Wo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gp(e){return e=(e||0)%360,e<0?e+360:e}function Wo(e){return Math.max(0,Math.min(1,e||0))}function wu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Rv=e=>()=>e;function d5(e,t){return function(n){return e+n*t}}function f5(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 h5(e){return(e=+e)==1?Dv:function(t,n){return n-t?f5(t,n,e):Rv(isNaN(t)?n:t)}}function Dv(e,t){var n=t-e;return n?d5(e,n):Rv(isNaN(e)?t:e)}const Xp=function e(t){var n=h5(t);function r(s,i){var o=n((s=Gd(s)).r,(i=Gd(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=Dv(s.opacity,i.opacity);return function(f){return s.r=o(f),s.g=l(f),s.b=c(f),s.opacity=u(f),s+""}}return r.gamma=e,r}(1);function lr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Xd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bu=new RegExp(Xd.source,"g");function m5(e){return function(){return e}}function p5(e){return function(t){return e(t)+""}}function x5(e,t){var n=Xd.lastIndex=bu.lastIndex=0,r,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Xd.exec(e))&&(s=bu.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:lr(r,s)})),n=bu.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?p5(c[0].x):m5(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}var Yp=180/Math.PI,Yd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ov(e,t,n,r,s,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:s,translateY:i,rotate:Math.atan2(t,e)*Yp,skewX:Math.atan(c)*Yp,scaleX:o,scaleY:l}}var Qo;function g5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yd:Ov(t.a,t.b,t.c,t.d,t.e,t.f)}function y5(e){return e==null||(Qo||(Qo=document.createElementNS("http://www.w3.org/2000/svg","g")),Qo.setAttribute("transform",e),!(e=Qo.transform.baseVal.consolidate()))?Yd:(e=e.matrix,Ov(e.a,e.b,e.c,e.d,e.e,e.f))}function Av(e,t,n,r){function s(u){return u.length?u.pop()+" ":""}function i(u,f,d,h,x,w){if(u!==d||f!==h){var v=x.push("translate(",null,t,null,n);w.push({i:v-4,x:lr(u,d)},{i:v-2,x:lr(f,h)})}else(d||h)&&x.push("translate("+d+t+h+n)}function o(u,f,d,h){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),h.push({i:d.push(s(d)+"rotate(",null,r)-2,x:lr(u,f)})):f&&d.push(s(d)+"rotate("+f+r)}function l(u,f,d,h){u!==f?h.push({i:d.push(s(d)+"skewX(",null,r)-2,x:lr(u,f)}):f&&d.push(s(d)+"skewX("+f+r)}function c(u,f,d,h,x,w){if(u!==d||f!==h){var v=x.push(s(x)+"scale(",null,",",null,")");w.push({i:v-4,x:lr(u,d)},{i:v-2,x:lr(f,h)})}else(d!==1||h!==1)&&x.push(s(x)+"scale("+d+","+h+")")}return function(u,f){var d=[],h=[];return u=e(u),f=e(f),i(u.translateX,u.translateY,f.translateX,f.translateY,d,h),o(u.rotate,f.rotate,d,h),l(u.skewX,f.skewX,d,h),c(u.scaleX,u.scaleY,f.scaleX,f.scaleY,d,h),u=f=null,function(x){for(var w=-1,v=h.length,j;++w<v;)d[(j=h[w]).i]=j.x(x);return d.join("")}}}var v5=Av(g5,"px, ","px)","deg)"),w5=Av(y5,", ",")",")"),b5=1e-12;function Zp(e){return((e=Math.exp(e))+1/e)/2}function j5(e){return((e=Math.exp(e))-1/e)/2}function N5(e){return((e=Math.exp(2*e))-1)/(e+1)}const k5=function e(t,n,r){function s(i,o){var l=i[0],c=i[1],u=i[2],f=o[0],d=o[1],h=o[2],x=f-l,w=d-c,v=x*x+w*w,j,p;if(v<b5)p=Math.log(h/u)/t,j=function(P){return[l+P*x,c+P*w,u*Math.exp(t*P*p)]};else{var m=Math.sqrt(v),y=(h*h-u*u+r*v)/(2*u*n*m),g=(h*h-u*u-r*v)/(2*h*n*m),N=Math.log(Math.sqrt(y*y+1)-y),E=Math.log(Math.sqrt(g*g+1)-g);p=(E-N)/t,j=function(P){var M=P*p,$=Zp(N),R=u/(n*m)*($*N5(t*M+N)-j5(N));return[l+R*x,c+R*w,u*$/Zp(t*M+N)]}}return j.duration=p*1e3*t/Math.SQRT2,j}return s.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},s}(Math.SQRT2,2,4);var Ui=0,ya=0,oa=0,Fv=1e3,Zl,va,Jl=0,zs=0,$c=0,ro=typeof performance=="object"&&performance.now?performance:Date,Lv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _h(){return zs||(Lv(S5),zs=ro.now()+$c)}function S5(){zs=0}function ec(){this._call=this._time=this._next=null}ec.prototype=Iv.prototype={constructor:ec,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_h():+n)+(t==null?0:+t),!this._next&&va!==this&&(va?va._next=this:Zl=this,va=this),this._call=e,this._time=n,Zd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zd())}};function Iv(e,t,n){var r=new ec;return r.restart(e,t,n),r}function C5(){_h(),++Ui;for(var e=Zl,t;e;)(t=zs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ui}function Jp(){zs=(Jl=ro.now())+$c,Ui=ya=0;try{C5()}finally{Ui=0,_5(),zs=0}}function E5(){var e=ro.now(),t=e-Jl;t>Fv&&($c-=t,Jl=e)}function _5(){for(var e,t=Zl,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:Zl=n);va=e,Zd(r)}function Zd(e){if(!Ui){ya&&(ya=clearTimeout(ya));var t=e-zs;t>24?(e<1/0&&(ya=setTimeout(Jp,e-ro.now()-$c)),oa&&(oa=clearInterval(oa))):(oa||(Jl=ro.now(),oa=setInterval(E5,Fv)),Ui=1,Lv(Jp))}}function ex(e,t,n){var r=new ec;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var M5=Pc("start","end","cancel","interrupt"),P5=[],Uv=0,tx=1,Jd=2,pl=3,nx=4,ef=5,xl=6;function Tc(e,t,n,r,s,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;z5(e,n,{name:t,index:r,group:s,on:M5,tween:P5,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Uv})}function Mh(e,t){var n=fn(e,t);if(n.state>Uv)throw new Error("too late; already scheduled");return n}function En(e,t){var n=fn(e,t);if(n.state>pl)throw new Error("too late; already running");return n}function fn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function z5(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Iv(i,0,n.time);function i(u){n.state=tx,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var f,d,h,x;if(n.state!==tx)return c();for(f in r)if(x=r[f],x.name===n.name){if(x.state===pl)return ex(o);x.state===nx?(x.state=xl,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[f]):+f<t&&(x.state=xl,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[f])}if(ex(function(){n.state===pl&&(n.state=nx,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Jd,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Jd){for(n.state=pl,s=new Array(h=n.tween.length),f=0,d=-1;f<h;++f)(x=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=x);s.length=d+1}}function l(u){for(var f=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=ef,1),d=-1,h=s.length;++d<h;)s[d].call(e,f);n.state===ef&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=xl,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function gl(e,t){var n=e.__transition,r,s,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}s=r.state>Jd&&r.state<ef,r.state=xl,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function $5(e){return this.each(function(){gl(this,e)})}function T5(e,t){var n,r;return function(){var s=En(this,e),i=s.tween;if(i!==n){r=n=i;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}s.tween=r}}function R5(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var i=En(this,e),o=i.tween;if(o!==r){s=(r=o).slice();for(var l={name:t,value:n},c=0,u=s.length;c<u;++c)if(s[c].name===t){s[c]=l;break}c===u&&s.push(l)}i.tween=s}}function D5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=fn(this.node(),n).tween,s=0,i=r.length,o;s<i;++s)if((o=r[s]).name===e)return o.value;return null}return this.each((t==null?T5:R5)(n,e,t))}function Ph(e,t,n){var r=e._id;return e.each(function(){var s=En(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return fn(s,r).value[t]}}function Bv(e,t){var n;return(typeof t=="number"?lr:t instanceof no?Xp:(n=no(t))?(t=n,Xp):x5)(e,t)}function O5(e){return function(){this.removeAttribute(e)}}function A5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F5(e,t,n){var r,s=n+"",i;return function(){var o=this.getAttribute(e);return o===s?null:o===r?i:i=t(r=o,n)}}function L5(e,t,n){var r,s=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===r?i:i=t(r=o,n)}}function I5(e,t,n){var r,s,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===s?i:(s=c,i=t(r=o,l)))}}function U5(e,t,n){var r,s,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===s?i:(s=c,i=t(r=o,l)))}}function B5(e,t){var n=zc(e),r=n==="transform"?w5:Bv;return this.attrTween(e,typeof t=="function"?(n.local?U5:I5)(n,r,Ph(this,"attr."+e,t)):t==null?(n.local?A5:O5)(n):(n.local?L5:F5)(n,r,t))}function H5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function V5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function W5(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&V5(e,i)),n}return s._value=t,s}function Q5(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&H5(e,i)),n}return s._value=t,s}function K5(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=zc(e);return this.tween(n,(r.local?W5:Q5)(r,t))}function q5(e,t){return function(){Mh(this,e).delay=+t.apply(this,arguments)}}function G5(e,t){return t=+t,function(){Mh(this,e).delay=t}}function X5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?q5:G5)(t,e)):fn(this.node(),t).delay}function Y5(e,t){return function(){En(this,e).duration=+t.apply(this,arguments)}}function Z5(e,t){return t=+t,function(){En(this,e).duration=t}}function J5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y5:Z5)(t,e)):fn(this.node(),t).duration}function e_(e,t){if(typeof t!="function")throw new Error;return function(){En(this,e).ease=t}}function t_(e){var t=this._id;return arguments.length?this.each(e_(t,e)):fn(this.node(),t).ease}function n_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;En(this,e).ease=n}}function r_(e){if(typeof e!="function")throw new Error;return this.each(n_(this._id,e))}function s_(e){typeof e!="function"&&(e=vv(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Xn(r,this._parents,this._name,this._id)}function i_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,i=Math.min(r,s),o=new Array(r),l=0;l<i;++l)for(var c=t[l],u=n[l],f=c.length,d=o[l]=new Array(f),h,x=0;x<f;++x)(h=c[x]||u[x])&&(d[x]=h);for(;l<r;++l)o[l]=t[l];return new Xn(o,this._parents,this._name,this._id)}function a_(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 o_(e,t,n){var r,s,i=a_(t)?Mh:En;return function(){var o=i(this,e),l=o.on;l!==r&&(s=(r=l).copy()).on(t,n),o.on=s}}function l_(e,t){var n=this._id;return arguments.length<2?fn(this.node(),n).on.on(e):this.each(o_(n,e,t))}function c_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function u_(){return this.on("end.remove",c_(this._id))}function d_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Sh(e));for(var r=this._groups,s=r.length,i=new Array(s),o=0;o<s;++o)for(var l=r[o],c=l.length,u=i[o]=new Array(c),f,d,h=0;h<c;++h)(f=l[h])&&(d=e.call(f,f.__data__,h,l))&&("__data__"in f&&(d.__data__=f.__data__),u[h]=d,Tc(u[h],t,n,h,u,fn(f,n)));return new Xn(i,this._parents,t,n)}function f_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yv(e));for(var r=this._groups,s=r.length,i=[],o=[],l=0;l<s;++l)for(var c=r[l],u=c.length,f,d=0;d<u;++d)if(f=c[d]){for(var h=e.call(f,f.__data__,d,c),x,w=fn(f,n),v=0,j=h.length;v<j;++v)(x=h[v])&&Tc(x,t,n,v,h,w);i.push(h),o.push(f)}return new Xn(i,o,t,n)}var h_=bo.prototype.constructor;function m_(){return new h_(this._groups,this._parents)}function p_(e,t){var n,r,s;return function(){var i=Ii(this,e),o=(this.style.removeProperty(e),Ii(this,e));return i===o?null:i===n&&o===r?s:s=t(n=i,r=o)}}function Hv(e){return function(){this.style.removeProperty(e)}}function x_(e,t,n){var r,s=n+"",i;return function(){var o=Ii(this,e);return o===s?null:o===r?i:i=t(r=o,n)}}function g_(e,t,n){var r,s,i;return function(){var o=Ii(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Ii(this,e))),o===c?null:o===r&&c===s?i:(s=c,i=t(r=o,l))}}function y_(e,t){var n,r,s,i="style."+t,o="end."+i,l;return function(){var c=En(this,e),u=c.on,f=c.value[i]==null?l||(l=Hv(t)):void 0;(u!==n||s!==f)&&(r=(n=u).copy()).on(o,s=f),c.on=r}}function v_(e,t,n){var r=(e+="")=="transform"?v5:Bv;return t==null?this.styleTween(e,p_(e,r)).on("end.style."+e,Hv(e)):typeof t=="function"?this.styleTween(e,g_(e,r,Ph(this,"style."+e,t))).each(y_(this._id,e)):this.styleTween(e,x_(e,r,t),n).on("end.style."+e,null)}function w_(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function b_(e,t,n){var r,s;function i(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&w_(e,o,n)),r}return i._value=t,i}function j_(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,b_(e,t,n??""))}function N_(e){return function(){this.textContent=e}}function k_(e){return function(){var t=e(this);this.textContent=t??""}}function S_(e){return this.tween("text",typeof e=="function"?k_(Ph(this,"text",e)):N_(e==null?"":e+""))}function C_(e){return function(t){this.textContent=e.call(this,t)}}function E_(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&C_(s)),t}return r._value=e,r}function __(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,E_(e))}function M_(){for(var e=this._name,t=this._id,n=Vv(),r=this._groups,s=r.length,i=0;i<s;++i)for(var o=r[i],l=o.length,c,u=0;u<l;++u)if(c=o[u]){var f=fn(c,t);Tc(c,e,n,u,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Xn(r,this._parents,e,n)}function P_(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--s===0&&i()}};n.each(function(){var u=En(this,r),f=u.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),s===0&&i()})}var z_=0;function Xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Vv(){return++z_}var Mn=bo.prototype;Xn.prototype={constructor:Xn,select:d_,selectAll:f_,selectChild:Mn.selectChild,selectChildren:Mn.selectChildren,filter:s_,merge:i_,selection:m_,transition:M_,call:Mn.call,nodes:Mn.nodes,node:Mn.node,size:Mn.size,empty:Mn.empty,each:Mn.each,on:l_,attr:B5,attrTween:K5,style:v_,styleTween:j_,text:S_,textTween:__,remove:u_,tween:D5,delay:X5,duration:J5,ease:t_,easeVarying:r_,end:P_,[Symbol.iterator]:Mn[Symbol.iterator]};function $_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var T_={time:null,delay:0,duration:250,ease:$_};function R_(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 D_(e){var t,n;e instanceof Xn?(t=e._id,e=e._name):(t=Vv(),(n=T_).time=_h(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var o=r[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&Tc(c,e,t,u,o,n||R_(c,t));return new Xn(r,this._parents,e,t)}bo.prototype.interrupt=$5;bo.prototype.transition=D_;const Ko=e=>()=>e;function O_(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){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:s}})}function Bn(e,t,n){this.k=e,this.x=t,this.y=n}Bn.prototype={constructor:Bn,scale:function(e){return e===1?this:new Bn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Bn(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 Or=new Bn(1,0,0);Bn.prototype;function ju(e){e.stopImmediatePropagation()}function la(e){e.preventDefault(),e.stopImmediatePropagation()}function A_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function F_(){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 rx(){return this.__zoom||Or}function L_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function I_(){return navigator.maxTouchPoints||"ontouchstart"in this}function U_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function B_(){var e=A_,t=F_,n=U_,r=L_,s=I_,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=k5,u=Pc("start","zoom","end"),f,d,h,x=500,w=150,v=0,j=10;function p(S){S.property("__zoom",rx).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",R).filter(s).on("touchstart.zoom",L).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(S,D,T,I){var C=S.selection?S.selection():S;C.property("__zoom",rx),S!==C?N(S,D,T,I):C.interrupt().each(function(){E(this,arguments).event(I).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},p.scaleBy=function(S,D,T,I){p.scaleTo(S,function(){var C=this.__zoom.k,k=typeof D=="function"?D.apply(this,arguments):D;return C*k},T,I)},p.scaleTo=function(S,D,T,I){p.transform(S,function(){var C=t.apply(this,arguments),k=this.__zoom,z=T==null?g(C):typeof T=="function"?T.apply(this,arguments):T,A=k.invert(z),F=typeof D=="function"?D.apply(this,arguments):D;return n(y(m(k,F),z,A),C,o)},T,I)},p.translateBy=function(S,D,T,I){p.transform(S,function(){return n(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),o)},null,I)},p.translateTo=function(S,D,T,I,C){p.transform(S,function(){var k=t.apply(this,arguments),z=this.__zoom,A=I==null?g(k):typeof I=="function"?I.apply(this,arguments):I;return n(Or.translate(A[0],A[1]).scale(z.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof T=="function"?-T.apply(this,arguments):-T),k,o)},I,C)};function m(S,D){return D=Math.max(i[0],Math.min(i[1],D)),D===S.k?S:new Bn(D,S.x,S.y)}function y(S,D,T){var I=D[0]-T[0]*S.k,C=D[1]-T[1]*S.k;return I===S.x&&C===S.y?S:new Bn(S.k,I,C)}function g(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function N(S,D,T,I){S.on("start.zoom",function(){E(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(I).end()}).tween("zoom",function(){var C=this,k=arguments,z=E(C,k).event(I),A=t.apply(C,k),F=T==null?g(A):typeof T=="function"?T.apply(C,k):T,Q=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),W=C.__zoom,Z=typeof D=="function"?D.apply(C,k):D,re=c(W.invert(F).concat(Q/W.k),Z.invert(F).concat(Q/Z.k));return function(ie){if(ie===1)ie=Z;else{var de=re(ie),je=Q/de[2];ie=new Bn(je,F[0]-de[0]*je,F[1]-de[1]*je)}z.zoom(null,ie)}})}function E(S,D,T){return!T&&S.__zooming||new P(S,D)}function P(S,D){this.that=S,this.args=D,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,D),this.taps=0}P.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,D){return this.mouse&&S!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var D=Qt(this.that).datum();u.call(S,this.that,new O_(S,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),D)}};function M(S,...D){if(!e.apply(this,arguments))return;var T=E(this,D).event(S),I=this.__zoom,C=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,r.apply(this,arguments)))),k=gn(S);if(T.wheel)(T.mouse[0][0]!==k[0]||T.mouse[0][1]!==k[1])&&(T.mouse[1]=I.invert(T.mouse[0]=k)),clearTimeout(T.wheel);else{if(I.k===C)return;T.mouse=[k,I.invert(k)],gl(this),T.start()}la(S),T.wheel=setTimeout(z,w),T.zoom("mouse",n(y(m(I,C),T.mouse[0],T.mouse[1]),T.extent,o));function z(){T.wheel=null,T.end()}}function $(S,...D){if(h||!e.apply(this,arguments))return;var T=S.currentTarget,I=E(this,D,!0).event(S),C=Qt(S.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",Q,!0),k=gn(S,T),z=S.clientX,A=S.clientY;Mv(S.view),ju(S),I.mouse=[k,this.__zoom.invert(k)],gl(this),I.start();function F(W){if(la(W),!I.moved){var Z=W.clientX-z,re=W.clientY-A;I.moved=Z*Z+re*re>v}I.event(W).zoom("mouse",n(y(I.that.__zoom,I.mouse[0]=gn(W,T),I.mouse[1]),I.extent,o))}function Q(W){C.on("mousemove.zoom mouseup.zoom",null),Pv(W.view,I.moved),la(W),I.event(W).end()}}function R(S,...D){if(e.apply(this,arguments)){var T=this.__zoom,I=gn(S.changedTouches?S.changedTouches[0]:S,this),C=T.invert(I),k=T.k*(S.shiftKey?.5:2),z=n(y(m(T,k),I,C),t.apply(this,D),o);la(S),l>0?Qt(this).transition().duration(l).call(N,z,I,S):Qt(this).call(p.transform,z,I,S)}}function L(S,...D){if(e.apply(this,arguments)){var T=S.touches,I=T.length,C=E(this,D,S.changedTouches.length===I).event(S),k,z,A,F;for(ju(S),z=0;z<I;++z)A=T[z],F=gn(A,this),F=[F,this.__zoom.invert(F),A.identifier],C.touch0?!C.touch1&&C.touch0[2]!==F[2]&&(C.touch1=F,C.taps=0):(C.touch0=F,k=!0,C.taps=1+!!f);f&&(f=clearTimeout(f)),k&&(C.taps<2&&(d=F[0],f=setTimeout(function(){f=null},x)),gl(this),C.start())}}function U(S,...D){if(this.__zooming){var T=E(this,D).event(S),I=S.changedTouches,C=I.length,k,z,A,F;for(la(S),k=0;k<C;++k)z=I[k],A=gn(z,this),T.touch0&&T.touch0[2]===z.identifier?T.touch0[0]=A:T.touch1&&T.touch1[2]===z.identifier&&(T.touch1[0]=A);if(z=T.that.__zoom,T.touch1){var Q=T.touch0[0],W=T.touch0[1],Z=T.touch1[0],re=T.touch1[1],ie=(ie=Z[0]-Q[0])*ie+(ie=Z[1]-Q[1])*ie,de=(de=re[0]-W[0])*de+(de=re[1]-W[1])*de;z=m(z,Math.sqrt(ie/de)),A=[(Q[0]+Z[0])/2,(Q[1]+Z[1])/2],F=[(W[0]+re[0])/2,(W[1]+re[1])/2]}else if(T.touch0)A=T.touch0[0],F=T.touch0[1];else return;T.zoom("touch",n(y(z,A,F),T.extent,o))}}function H(S,...D){if(this.__zooming){var T=E(this,D).event(S),I=S.changedTouches,C=I.length,k,z;for(ju(S),h&&clearTimeout(h),h=setTimeout(function(){h=null},x),k=0;k<C;++k)z=I[k],T.touch0&&T.touch0[2]===z.identifier?delete T.touch0:T.touch1&&T.touch1[2]===z.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(z=gn(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<j)){var A=Qt(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return p.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:Ko(+S),p):r},p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Ko(!!S),p):e},p.touchable=function(S){return arguments.length?(s=typeof S=="function"?S:Ko(!!S),p):s},p.extent=function(S){return arguments.length?(t=typeof S=="function"?S:Ko([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),p):t},p.scaleExtent=function(S){return arguments.length?(i[0]=+S[0],i[1]=+S[1],p):[i[0],i[1]]},p.translateExtent=function(S){return arguments.length?(o[0][0]=+S[0][0],o[1][0]=+S[1][0],o[0][1]=+S[0][1],o[1][1]=+S[1][1],p):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},p.constrain=function(S){return arguments.length?(n=S,p):n},p.duration=function(S){return arguments.length?(l=+S,p):l},p.interpolate=function(S){return arguments.length?(c=S,p):c},p.on=function(){var S=u.on.apply(u,arguments);return S===u?p:S},p.clickDistance=function(S){return arguments.length?(v=(S=+S)*S,p):Math.sqrt(v)},p.tapDistance=function(S){return arguments.length?(j=+S,p):j},p}const Rc=b.createContext(null),H_=Rc.Provider,Yn={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.`},Wv=Yn.error001();function Fe(e,t){const n=b.useContext(Rc);if(n===null)throw new Error(Wv);return xv(n,e,t)}const Xe=()=>{const e=b.useContext(Rc);if(e===null)throw new Error(Wv);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},V_=e=>e.userSelectionActive?"none":"all";function Qv({position:e,children:t,className:n,style:r,...s}){const i=Fe(V_),o=`${e}`.split("-");return O.createElement("div",{className:pt(["react-flow__panel",n,...o]),style:{...r,pointerEvents:i},...s},t)}function W_({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:O.createElement(Qv,{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"},O.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Q_=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...f})=>{const d=b.useRef(null),[h,x]=b.useState({x:0,y:0,width:0,height:0}),w=pt(["react-flow__edge-textwrapper",u]);return b.useEffect(()=>{if(d.current){const v=d.current.getBBox();x({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:O.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:w,visibility:h.width?"visible":"hidden",...f},s&&O.createElement("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),O.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:d,style:r},n),c)};var K_=b.memo(Q_);const zh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ir=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$h=(e={x:0,y:0},t)=>({x:Ir(e.x,t[0][0],t[1][0]),y:Ir(e.y,t[0][1],t[1][1])}),sx=(e,t,n)=>e<t?Ir(Math.abs(e-t),1,50)/50:e>n?-Ir(Math.abs(e-n),1,50)/50:0,Kv=(e,t)=>{const n=sx(e.x,35,t.width-35)*20,r=sx(e.y,35,t.height-35)*20;return[n,r]},qv=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},q_=(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)}),Th=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),G_=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ix=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),tf=(e,t)=>{const 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)},X_=e=>Gt(e.width)&&Gt(e.height)&&Gt(e.x)&&Gt(e.y),Gt=e=>!isNaN(e)&&isFinite(e),Be=Symbol.for("internals"),Gv=["Enter"," ","Escape"],Y_=(e,t)=>{},Z_=e=>"nativeEvent"in e;function nf(e){var s,i;const t=Z_(e)?e.nativeEvent:e,n=((i=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Xv=e=>"clientX"in e,Ar=(e,t)=>{var i,o;const n=Xv(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},tc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},No=({id:e,path:t,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:f,markerEnd:d,markerStart:h,interactionWidth:x=20})=>O.createElement(O.Fragment,null,O.createElement("path",{id:e,style:f,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:h}),x&&O.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&Gt(n)&&Gt(r)?O.createElement(K_,{x:n,y:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);No.displayName="BaseEdge";function ca(e,t,n){return n===void 0?n:r=>{const s=t().edges.find(i=>i.id===e);s&&n(r,{...s})}}function Yv({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n<e?n+s:n-s,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[i,l,s,o]}function Zv({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+s*.375+o*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,f=Math.abs(c-e),d=Math.abs(u-t);return[c,u,f,d]}var $s;(function(e){e.Strict="strict",e.Loose="loose"})($s||($s={}));var ls;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ls||(ls={}));var so;(function(e){e.Partial="partial",e.Full="full"})(so||(so={}));var fr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(fr||(fr={}));var Bi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bi||(Bi={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));function ax({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===J.Left||e===J.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function Jv({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:s,targetPosition:i=J.Top}){const[o,l]=ax({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=ax({pos:i,x1:r,y1:s,x2:e,y2:t}),[f,d,h,x]=Zv({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${r},${s}`,f,d,h,x]}const Rh=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=J.Bottom,targetPosition:i=J.Top,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:w,interactionWidth:v})=>{const[j,p,m]=Jv({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return O.createElement(No,{path:j,labelX:p,labelY:m,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:w,interactionWidth:v})});Rh.displayName="SimpleBezierEdge";const ox={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},J_=({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},lx=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function e3({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:s,offset:i}){const o=ox[t],l=ox[r],c={x:e.x+o.x*i,y:e.y+o.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},f=J_({source:c,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",h=f[d];let x=[],w,v;const j={x:0,y:0},p={x:0,y:0},[m,y,g,N]=Yv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*l[d]===-1){w=s.x??m,v=s.y??y;const P=[{x:w,y:c.y},{x:w,y:u.y}],M=[{x:c.x,y:v},{x:u.x,y:v}];o[d]===h?x=d==="x"?P:M:x=d==="x"?M:P}else{const P=[{x:c.x,y:u.y}],M=[{x:u.x,y:c.y}];if(d==="x"?x=o.x===h?M:P:x=o.y===h?P:M,t===r){const H=Math.abs(e[d]-n[d]);if(H<=i){const S=Math.min(i-1,i-H);o[d]===h?j[d]=(c[d]>e[d]?-1:1)*S:p[d]=(u[d]>n[d]?-1:1)*S}}if(t!==r){const H=d==="x"?"y":"x",S=o[d]===l[H],D=c[H]>u[H],T=c[H]<u[H];(o[d]===1&&(!S&&D||S&&T)||o[d]!==1&&(!S&&T||S&&D))&&(x=d==="x"?P:M)}const $={x:c.x+j.x,y:c.y+j.y},R={x:u.x+p.x,y:u.y+p.y},L=Math.max(Math.abs($.x-x[0].x),Math.abs(R.x-x[0].x)),U=Math.max(Math.abs($.y-x[0].y),Math.abs(R.y-x[0].y));L>=U?(w=($.x+R.x)/2,v=x[0].y):(w=x[0].x,v=($.y+R.y)/2)}return[[e,{x:c.x+j.x,y:c.y+j.y},...x,{x:u.x+p.x,y:u.y+p.y},n],w,v,g,N]}function t3(e,t,n,r){const s=Math.min(lx(e,t)/2,lx(t,n)/2,r),{x:i,y:o}=t;if(e.x===i&&i===n.x||e.y===o&&o===n.y)return`L${i} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${i+s*u},${o}Q ${i},${o} ${i},${o+s*f}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+s*c}Q ${i},${o} ${i+s*l},${o}`}function rf({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:s,targetPosition:i=J.Top,borderRadius:o=5,centerX:l,centerY:c,offset:u=20}){const[f,d,h,x,w]=e3({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:i,center:{x:l,y:c},offset:u});return[f.reduce((j,p,m)=>{let y="";return m>0&&m<f.length-1?y=t3(f[m-1],p,f[m+1],o):y=`${m===0?"M":"L"}${p.x} ${p.y}`,j+=y,j},""),d,h,x,w]}const Dc=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:f,sourcePosition:d=J.Bottom,targetPosition:h=J.Top,markerEnd:x,markerStart:w,pathOptions:v,interactionWidth:j})=>{const[p,m,y]=rf({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:h,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return O.createElement(No,{path:p,labelX:m,labelY:y,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:f,markerEnd:x,markerStart:w,interactionWidth:j})});Dc.displayName="SmoothStepEdge";const Dh=b.memo(e=>{var t;return O.createElement(Dc,{...e,pathOptions:b.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Dh.displayName="StepEdge";function n3({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,o,l]=Yv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,o,l]}const Oh=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:f,markerEnd:d,markerStart:h,interactionWidth:x})=>{const[w,v,j]=n3({sourceX:e,sourceY:t,targetX:n,targetY:r});return O.createElement(No,{path:w,labelX:v,labelY:j,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:f,markerEnd:d,markerStart:h,interactionWidth:x})});Oh.displayName="StraightEdge";function qo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function cx({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case J.Left:return[t-qo(t-r,i),n];case J.Right:return[t+qo(r-t,i),n];case J.Top:return[t,n-qo(n-s,i)];case J.Bottom:return[t,n+qo(s-n,i)]}}function e1({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:s,targetPosition:i=J.Top,curvature:o=.25}){const[l,c]=cx({pos:n,x1:e,y1:t,x2:r,y2:s,c:o}),[u,f]=cx({pos:i,x1:r,y1:s,x2:e,y2:t,c:o}),[d,h,x,w]=Zv({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${l},${c} ${u},${f} ${r},${s}`,d,h,x,w]}const nc=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=J.Bottom,targetPosition:i=J.Top,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:w,pathOptions:v,interactionWidth:j})=>{const[p,m,y]=e1({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return O.createElement(No,{path:p,labelX:m,labelY:y,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:w,interactionWidth:j})});nc.displayName="BezierEdge";const Ah=b.createContext(null),r3=Ah.Provider;Ah.Consumer;const t1=()=>b.useContext(Ah),s3=e=>"id"in e&&"source"in e&&"target"in e,i3=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,sf=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,a3=(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)),o3=(e,t)=>{if(!e.source||!e.target)return t;let n;return s3(e)?n={...e}:n={...e,id:i3(e)},a3(n,t)?t:t.concat(n)},af=({x:e,y:t},[n,r,s],i,[o,l])=>{const c={x:(e-n)/s,y:(t-r)/s};return i?{x:o*Math.round(c.x/o),y:l*Math.round(c.y/l)}:c},n1=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),fi=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],s={x:e.position.x-n,y:e.position.y-r};return{...s,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:s}},Fh=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const{x:i,y:o}=fi(s,t).positionAbsolute;return q_(r,Th({x:i,y:o,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return G_(n)},r1=(e,t,[n,r,s]=[0,0,1],i=!1,o=!1,l=[0,0])=>{const c={x:(t.x-n)/s,y:(t.y-r)/s,width:t.width/s,height:t.height/s},u=[];return e.forEach(f=>{const{width:d,height:h,selectable:x=!0,hidden:w=!1}=f;if(o&&!x||w)return!1;const{positionAbsolute:v}=fi(f,l),j={x:v.x,y:v.y,width:d||0,height:h||0},p=tf(c,j),m=typeof d>"u"||typeof h>"u"||d===null||h===null,y=i&&p>0,g=(d||0)*(h||0);(m||y||p>=g||f.dragging)&&u.push(f)}),u},s1=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},i1=(e,t,n,r,s,i=.1)=>{const o=t/(e.width*(1+i)),l=n/(e.height*(1+i)),c=Math.min(o,l),u=Ir(c,r,s),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,x=n/2-d*u;return{x:h,y:x,zoom:u}},ns=(e,t=0)=>e.transition().duration(t);function ux(e,t,n,r){return(t[n]||[]).reduce((s,i)=>{var o,l;return`${e.id}-${i.id}-${n}`!==r&&s.push({id:i.id||null,type:n,nodeId:e.id,x:(((o=e.positionAbsolute)==null?void 0:o.x)??0)+i.x+i.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+i.y+i.height/2}),s},[])}function l3(e,t,n,r,s,i){const{x:o,y:l}=Ar(e),u=t.elementsFromPoint(o,l).find(w=>w.classList.contains("react-flow__handle"));if(u){const w=u.getAttribute("data-nodeid");if(w){const v=Lh(void 0,u),j=u.getAttribute("data-handleid"),p=i({nodeId:w,id:j,type:v});if(p){const m=s.find(y=>y.nodeId===w&&y.type===v&&y.id===j);return{handle:{id:j,type:v,nodeId:w,x:(m==null?void 0:m.x)||n.x,y:(m==null?void 0:m.y)||n.y},validHandleResult:p}}}}let f=[],d=1/0;if(s.forEach(w=>{const v=Math.sqrt((w.x-n.x)**2+(w.y-n.y)**2);if(v<=r){const j=i(w);v<=d&&(v<d?f=[{handle:w,validHandleResult:j}]:v===d&&f.push({handle:w,validHandleResult:j}),d=v)}}),!f.length)return{handle:null,validHandleResult:a1()};if(f.length===1)return f[0];const h=f.some(({validHandleResult:w})=>w.isValid),x=f.some(({handle:w})=>w.type==="target");return f.find(({handle:w,validHandleResult:v})=>x?w.type==="target":h?v.isValid:!0)||f[0]}const c3={source:null,target:null,sourceHandle:null,targetHandle:null},a1=()=>({handleDomNode:null,isValid:!1,connection:c3,endHandle:null});function o1(e,t,n,r,s,i,o){const l=s==="target",c=o.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...a1(),handleDomNode:c};if(c){const f=Lh(void 0,c),d=c.getAttribute("data-nodeid"),h=c.getAttribute("data-handleid"),x=c.classList.contains("connectable"),w=c.classList.contains("connectableend"),v={source:l?d:n,sourceHandle:l?h:r,target:l?n:d,targetHandle:l?r:h};u.connection=v,x&&w&&(t===$s.Strict?l&&f==="source"||!l&&f==="target":d!==n||h!==r)&&(u.endHandle={nodeId:d,handleId:h,type:f},u.isValid=i(v))}return u}function u3({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((s,i)=>{if(i[Be]){const{handleBounds:o}=i[Be];let l=[],c=[];o&&(l=ux(i,o,"source",`${t}-${n}-${r}`),c=ux(i,o,"target",`${t}-${n}-${r}`)),s.push(...l,...c)}return s},[])}function Lh(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Nu(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function d3(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function l1({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:o,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:u}){const f=qv(e.target),{connectionMode:d,domNode:h,autoPanOnConnect:x,connectionRadius:w,onConnectStart:v,panBy:j,getNodes:p,cancelConnection:m}=i();let y=0,g;const{x:N,y:E}=Ar(e),P=f==null?void 0:f.elementFromPoint(N,E),M=Lh(c,P),$=h==null?void 0:h.getBoundingClientRect();if(!$||!M)return;let R,L=Ar(e,$),U=!1,H=null,S=!1,D=null;const T=u3({nodes:p(),nodeId:n,handleId:t,handleType:M}),I=()=>{if(!x)return;const[z,A]=Kv(L,$);j({x:z,y:A}),y=requestAnimationFrame(I)};o({connectionPosition:L,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:M,connectionStartHandle:{nodeId:n,handleId:t,type:M},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:M});function C(z){const{transform:A}=i();L=Ar(z,$);const{handle:F,validHandleResult:Q}=l3(z,f,af(L,A,!1,[1,1]),w,T,W=>o1(W,d,n,t,s?"target":"source",l,f));if(g=F,U||(I(),U=!0),D=Q.handleDomNode,H=Q.connection,S=Q.isValid,o({connectionPosition:g&&S?n1({x:g.x,y:g.y},A):L,connectionStatus:d3(!!g,S),connectionEndHandle:Q.endHandle}),!g&&!S&&!D)return Nu(R);H.source!==H.target&&D&&(Nu(R),R=D,D.classList.add("connecting","react-flow__handle-connecting"),D.classList.toggle("valid",S),D.classList.toggle("react-flow__handle-valid",S))}function k(z){var A,F;(g||D)&&H&&S&&(r==null||r(H)),(F=(A=i()).onConnectEnd)==null||F.call(A,z),c&&(u==null||u(z)),Nu(R),m(),cancelAnimationFrame(y),U=!1,S=!1,H=null,D=null,f.removeEventListener("mousemove",C),f.removeEventListener("mouseup",k),f.removeEventListener("touchmove",C),f.removeEventListener("touchend",k)}f.addEventListener("mousemove",C),f.addEventListener("mouseup",k),f.addEventListener("touchmove",C),f.addEventListener("touchend",k)}const dx=()=>!0,f3=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),h3=(e,t,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:o}=r;return{connecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n}},c1=b.forwardRef(({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:f,onTouchStart:d,...h},x)=>{var $,R;const w=o||null,v=e==="target",j=Xe(),p=t1(),{connectOnClick:m,noPanClassName:y}=Fe(f3,mt),{connecting:g,clickConnecting:N}=Fe(h3(p,w,e),mt);p||(R=($=j.getState()).onError)==null||R.call($,"010",Yn.error010());const E=L=>{const{defaultEdgeOptions:U,onConnect:H,hasDefaultEdges:S}=j.getState(),D={...U,...L};if(S){const{edges:T,setEdges:I}=j.getState();I(o3(D,T))}H==null||H(D),l==null||l(D)},P=L=>{if(!p)return;const U=Xv(L);s&&(U&&L.button===0||!U)&&l1({event:L,handleId:w,nodeId:p,onConnect:E,isTarget:v,getState:j.getState,setState:j.setState,isValidConnection:n||j.getState().isValidConnection||dx}),U?f==null||f(L):d==null||d(L)},M=L=>{const{onClickConnectStart:U,onClickConnectEnd:H,connectionClickStartHandle:S,connectionMode:D,isValidConnection:T}=j.getState();if(!p||!S&&!s)return;if(!S){U==null||U(L,{nodeId:p,handleId:w,handleType:e}),j.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:w}});return}const I=qv(L.target),C=n||T||dx,{connection:k,isValid:z}=o1({nodeId:p,id:w,type:e},D,S.nodeId,S.handleId||null,S.type,C,I);z&&E(k),H==null||H(L),j.setState({connectionClickStartHandle:null})};return O.createElement("div",{"data-handleid":w,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${w}-${e}`,className:pt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:i,connecting:N,connectionindicator:r&&(s&&!g||i&&g)}]),onMouseDown:P,onTouchStart:P,onClick:m?M:void 0,ref:x,...h},c)});c1.displayName="Handle";var Ur=b.memo(c1);const u1=({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:r=J.Bottom})=>O.createElement(O.Fragment,null,O.createElement(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,O.createElement(Ur,{type:"source",position:r,isConnectable:t}));u1.displayName="DefaultNode";var of=b.memo(u1);const d1=({data:e,isConnectable:t,sourcePosition:n=J.Bottom})=>O.createElement(O.Fragment,null,e==null?void 0:e.label,O.createElement(Ur,{type:"source",position:n,isConnectable:t}));d1.displayName="InputNode";var f1=b.memo(d1);const h1=({data:e,isConnectable:t,targetPosition:n=J.Top})=>O.createElement(O.Fragment,null,O.createElement(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);h1.displayName="OutputNode";var m1=b.memo(h1);const Ih=()=>null;Ih.displayName="GroupNode";const m3=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Go=e=>e.id;function p3(e,t){return mt(e.selectedNodes.map(Go),t.selectedNodes.map(Go))&&mt(e.selectedEdges.map(Go),t.selectedEdges.map(Go))}const p1=b.memo(({onSelectionChange:e})=>{const t=Xe(),{selectedNodes:n,selectedEdges:r}=Fe(m3,p3);return b.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChange.forEach(i=>i(s))},[n,r,e]),null});p1.displayName="SelectionListener";const x3=e=>!!e.onSelectionChange;function g3({onSelectionChange:e}){const t=Fe(x3);return e||t?O.createElement(p1,{onSelectionChange:e}):null}const y3=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 Is(e,t){b.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function oe(e,t,n){b.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const v3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:o,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:f,nodesFocusable:d,edgesFocusable:h,edgesUpdatable:x,elevateNodesOnSelect:w,minZoom:v,maxZoom:j,nodeExtent:p,onNodesChange:m,onEdgesChange:y,elementsSelectable:g,connectionMode:N,snapGrid:E,snapToGrid:P,translateExtent:M,connectOnClick:$,defaultEdgeOptions:R,fitView:L,fitViewOptions:U,onNodesDelete:H,onEdgesDelete:S,onNodeDrag:D,onNodeDragStart:T,onNodeDragStop:I,onSelectionDrag:C,onSelectionDragStart:k,onSelectionDragStop:z,noPanClassName:A,nodeOrigin:F,rfId:Q,autoPanOnConnect:W,autoPanOnNodeDrag:Z,onError:re,connectionRadius:ie,isValidConnection:de,nodeDragThreshold:je})=>{const{setNodes:xe,setEdges:Ne,setDefaultNodesAndEdges:Qe,setMinZoom:lt,setMaxZoom:rt,setTranslateExtent:_e,setNodeExtent:st,reset:ye}=Fe(y3,mt),q=Xe();return b.useEffect(()=>{const ge=r==null?void 0:r.map(zt=>({...zt,...R}));return Qe(n,ge),()=>{ye()}},[]),oe("defaultEdgeOptions",R,q.setState),oe("connectionMode",N,q.setState),oe("onConnect",s,q.setState),oe("onConnectStart",i,q.setState),oe("onConnectEnd",o,q.setState),oe("onClickConnectStart",l,q.setState),oe("onClickConnectEnd",c,q.setState),oe("nodesDraggable",u,q.setState),oe("nodesConnectable",f,q.setState),oe("nodesFocusable",d,q.setState),oe("edgesFocusable",h,q.setState),oe("edgesUpdatable",x,q.setState),oe("elementsSelectable",g,q.setState),oe("elevateNodesOnSelect",w,q.setState),oe("snapToGrid",P,q.setState),oe("snapGrid",E,q.setState),oe("onNodesChange",m,q.setState),oe("onEdgesChange",y,q.setState),oe("connectOnClick",$,q.setState),oe("fitViewOnInit",L,q.setState),oe("fitViewOnInitOptions",U,q.setState),oe("onNodesDelete",H,q.setState),oe("onEdgesDelete",S,q.setState),oe("onNodeDrag",D,q.setState),oe("onNodeDragStart",T,q.setState),oe("onNodeDragStop",I,q.setState),oe("onSelectionDrag",C,q.setState),oe("onSelectionDragStart",k,q.setState),oe("onSelectionDragStop",z,q.setState),oe("noPanClassName",A,q.setState),oe("nodeOrigin",F,q.setState),oe("rfId",Q,q.setState),oe("autoPanOnConnect",W,q.setState),oe("autoPanOnNodeDrag",Z,q.setState),oe("onError",re,q.setState),oe("connectionRadius",ie,q.setState),oe("isValidConnection",de,q.setState),oe("nodeDragThreshold",je,q.setState),Is(e,xe),Is(t,Ne),Is(v,lt),Is(j,rt),Is(M,_e),Is(p,st),null},fx={display:"none"},w3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},x1="react-flow__node-desc",g1="react-flow__edge-desc",b3="react-flow__aria-live",j3=e=>e.ariaLiveMessage;function N3({rfId:e}){const t=Fe(j3);return O.createElement("div",{id:`${b3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:w3},t)}function k3({rfId:e,disableKeyboardA11y:t}){return O.createElement(O.Fragment,null,O.createElement("div",{id:`${x1}-${e}`,style:fx},"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."," "),O.createElement("div",{id:`${g1}-${e}`,style:fx},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&O.createElement(N3,{rfId:e}))}var io=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[o,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),f=u.reduce((d,h)=>d.concat(...h),[]);return[u,f]}return[[],[]]},[e]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const f=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&nf(x))return!1;const v=mx(x.code,l);i.current.add(x[v]),hx(o,i.current,!1)&&(x.preventDefault(),r(!0))},d=x=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&nf(x))return!1;const v=mx(x.code,l);hx(o,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[v]),x.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",f),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",h),()=>{u==null||u.removeEventListener("keydown",f),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",h)}}},[e,r]),n};function hx(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function mx(e,t){return t.includes(e)?"code":"key"}function y1(e,t,n,r){var l,c;const s=e.parentNode||e.parentId;if(!s)return n;const i=t.get(s),o=fi(i,r);return y1(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((l=i[Be])==null?void 0:l.z)??0)>(n.z??0)?((c=i[Be])==null?void 0:c.z)??0:n.z??0},r)}function v1(e,t,n){e.forEach(r=>{var i;const s=r.parentNode||r.parentId;if(s&&!e.has(s))throw new Error(`Parent node ${s} not found`);if(s||n!=null&&n[r.id]){const{x:o,y:l,z:c}=y1(r,e,{...r.position,z:((i=r[Be])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:l},r[Be].z=c,n!=null&&n[r.id]&&(r[Be].isParent=!0)}})}function ku(e,t,n,r){const s=new Map,i={},o=r?1e3:0;return e.forEach(l=>{var x;const c=(Gt(l.zIndex)?l.zIndex:0)+(l.selected?o:0),u=t.get(l.id),f={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},d=l.parentNode||l.parentId;d&&(i[d]=!0);const h=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==l.type;Object.defineProperty(f,Be,{enumerable:!1,value:{handleBounds:h||(x=u==null?void 0:u[Be])==null?void 0:x.handleBounds,z:c}}),s.set(l.id,f)}),v1(s,n,i),s}function w1(e,t={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:o,d3Zoom:l,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:f,nodeOrigin:d}=e(),h=t.initial&&!u&&f;if(l&&c&&(h||!t.initial)){const w=n().filter(j=>{var m;const p=t.includeHiddenNodes?j.width&&j.height:!j.hidden;return(m=t.nodes)!=null&&m.length?p&&t.nodes.some(y=>y.id===j.id):p}),v=w.every(j=>j.width&&j.height);if(w.length>0&&v){const j=Fh(w,d),{x:p,y:m,zoom:y}=i1(j,r,s,t.minZoom??i,t.maxZoom??o,t.padding??.1),g=Or.translate(p,m).scale(y);return typeof t.duration=="number"&&t.duration>0?l.transform(ns(c,t.duration),g):l.transform(c,g),!0}}return!1}function S3(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Be]:r[Be],selected:n.selected})}),new Map(t)}function C3(e,t){return t.map(n=>{const r=e.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function Xo({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:o,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:u}=n();e!=null&&e.length&&(c&&r({nodeInternals:S3(e,s)}),o==null||o(e)),t!=null&&t.length&&(u&&r({edges:C3(t,i)}),l==null||l(t))}const Us=()=>{},E3={zoomIn:Us,zoomOut:Us,zoomTo:Us,getZoom:()=>1,setViewport:Us,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Us,fitBounds:Us,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},_3=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),M3=()=>{const e=Xe(),{d3Zoom:t,d3Selection:n}=Fe(_3,mt);return b.useMemo(()=>n&&t?{zoomIn:s=>t.scaleBy(ns(n,s==null?void 0:s.duration),1.2),zoomOut:s=>t.scaleBy(ns(n,s==null?void 0:s.duration),1/1.2),zoomTo:(s,i)=>t.scaleTo(ns(n,i==null?void 0:i.duration),s),getZoom:()=>e.getState().transform[2],setViewport:(s,i)=>{const[o,l,c]=e.getState().transform,u=Or.translate(s.x??o,s.y??l).scale(s.zoom??c);t.transform(ns(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[s,i,o]=e.getState().transform;return{x:s,y:i,zoom:o}},fitView:s=>w1(e.getState,s),setCenter:(s,i,o)=>{const{width:l,height:c,maxZoom:u}=e.getState(),f=typeof(o==null?void 0:o.zoom)<"u"?o.zoom:u,d=l/2-s*f,h=c/2-i*f,x=Or.translate(d,h).scale(f);t.transform(ns(n,o==null?void 0:o.duration),x)},fitBounds:(s,i)=>{const{width:o,height:l,minZoom:c,maxZoom:u}=e.getState(),{x:f,y:d,zoom:h}=i1(s,o,l,c,u,(i==null?void 0:i.padding)??.1),x=Or.translate(f,d).scale(h);t.transform(ns(n,i==null?void 0:i.duration),x)},project:s=>{const{transform:i,snapToGrid:o,snapGrid:l}=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"),af(s,i,o,l)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:o,snapGrid:l,domNode:c}=e.getState();if(!c)return s;const{x:u,y:f}=c.getBoundingClientRect(),d={x:s.x-u,y:s.y-f};return af(d,i,o,l)},flowToScreenPosition:s=>{const{transform:i,domNode:o}=e.getState();if(!o)return s;const{x:l,y:c}=o.getBoundingClientRect(),u=n1(s,i);return{x:u.x+l,y:u.y+c}},viewportInitialized:!0}:E3,[t,n])};function Oc(){const e=M3(),t=Xe(),n=b.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=b.useCallback(v=>t.getState().nodeInternals.get(v),[]),s=b.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(j=>({...j}))},[]),i=b.useCallback(v=>{const{edges:j=[]}=t.getState();return j.find(p=>p.id===v)},[]),o=b.useCallback(v=>{const{getNodes:j,setNodes:p,hasDefaultNodes:m,onNodesChange:y}=t.getState(),g=j(),N=typeof v=="function"?v(g):v;if(m)p(N);else if(y){const E=N.length===0?g.map(P=>({type:"remove",id:P.id})):N.map(P=>({item:P,type:"reset"}));y(E)}},[]),l=b.useCallback(v=>{const{edges:j=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:y}=t.getState(),g=typeof v=="function"?v(j):v;if(m)p(g);else if(y){const N=g.length===0?j.map(E=>({type:"remove",id:E.id})):g.map(E=>({item:E,type:"reset"}));y(N)}},[]),c=b.useCallback(v=>{const j=Array.isArray(v)?v:[v],{getNodes:p,setNodes:m,hasDefaultNodes:y,onNodesChange:g}=t.getState();if(y){const E=[...p(),...j];m(E)}else if(g){const N=j.map(E=>({item:E,type:"add"}));g(N)}},[]),u=b.useCallback(v=>{const j=Array.isArray(v)?v:[v],{edges:p=[],setEdges:m,hasDefaultEdges:y,onEdgesChange:g}=t.getState();if(y)m([...p,...j]);else if(g){const N=j.map(E=>({item:E,type:"add"}));g(N)}},[]),f=b.useCallback(()=>{const{getNodes:v,edges:j=[],transform:p}=t.getState(),[m,y,g]=p;return{nodes:v().map(N=>({...N})),edges:j.map(N=>({...N})),viewport:{x:m,y,zoom:g}}},[]),d=b.useCallback(({nodes:v,edges:j})=>{const{nodeInternals:p,getNodes:m,edges:y,hasDefaultNodes:g,hasDefaultEdges:N,onNodesDelete:E,onEdgesDelete:P,onNodesChange:M,onEdgesChange:$}=t.getState(),R=(v||[]).map(D=>D.id),L=(j||[]).map(D=>D.id),U=m().reduce((D,T)=>{const I=T.parentNode||T.parentId,C=!R.includes(T.id)&&I&&D.find(z=>z.id===I);return(typeof T.deletable=="boolean"?T.deletable:!0)&&(R.includes(T.id)||C)&&D.push(T),D},[]),H=y.filter(D=>typeof D.deletable=="boolean"?D.deletable:!0),S=H.filter(D=>L.includes(D.id));if(U||S){const D=s1(U,H),T=[...S,...D],I=T.reduce((C,k)=>(C.includes(k.id)||C.push(k.id),C),[]);if((N||g)&&(N&&t.setState({edges:y.filter(C=>!I.includes(C.id))}),g&&(U.forEach(C=>{p.delete(C.id)}),t.setState({nodeInternals:new Map(p)}))),I.length>0&&(P==null||P(T),$&&$(I.map(C=>({id:C,type:"remove"})))),U.length>0&&(E==null||E(U),M)){const C=U.map(k=>({id:k.id,type:"remove"}));M(C)}}},[]),h=b.useCallback(v=>{const j=X_(v),p=j?null:t.getState().nodeInternals.get(v.id);return!j&&!p?[null,null,j]:[j?v:ix(p),p,j]},[]),x=b.useCallback((v,j=!0,p)=>{const[m,y,g]=h(v);return m?(p||t.getState().getNodes()).filter(N=>{if(!g&&(N.id===y.id||!N.positionAbsolute))return!1;const E=ix(N),P=tf(E,m);return j&&P>0||P>=m.width*m.height}):[]},[]),w=b.useCallback((v,j,p=!0)=>{const[m]=h(v);if(!m)return!1;const y=tf(m,j);return p&&y>0||y>=m.width*m.height},[]);return b.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:o,setEdges:l,addNodes:c,addEdges:u,toObject:f,deleteElements:d,getIntersectingNodes:x,isNodeIntersecting:w}),[e,n,r,s,i,o,l,c,u,f,d,x,w])}const P3={actInsideInputWithModifier:!1};var z3=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Xe(),{deleteElements:r}=Oc(),s=io(e,P3),i=io(t);b.useEffect(()=>{if(s){const{edges:o,getNodes:l}=n.getState(),c=l().filter(f=>f.selected),u=o.filter(f=>f.selected);r({nodes:c,edges:u}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function $3(e){const t=Xe();b.useEffect(()=>{let n;const r=()=>{var i,o;if(!e.current)return;const s=zh(e.current);(s.height===0||s.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",Yn.error004())),t.setState({width:s.width||500,height:s.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)}},[])}const Uh={position:"absolute",width:"100%",height:"100%",top:0,left:0},T3=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Yo=e=>({x:e.x,y:e.y,zoom:e.k}),Bs=(e,t)=>e.target.closest(`.${t}`),px=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),xx=e=>{const t=e.ctrlKey&&tc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},R3=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),D3=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=ls.Free,zoomOnDoubleClick:u=!0,elementsSelectable:f,panOnDrag:d=!0,defaultViewport:h,translateExtent:x,minZoom:w,maxZoom:v,zoomActivationKeyCode:j,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:g})=>{const N=b.useRef(),E=Xe(),P=b.useRef(!1),M=b.useRef(!1),$=b.useRef(null),R=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:L,d3Selection:U,d3ZoomHandler:H,userSelectionActive:S}=Fe(R3,mt),D=io(j),T=b.useRef(0),I=b.useRef(!1),C=b.useRef();return $3($),b.useEffect(()=>{if($.current){const k=$.current.getBoundingClientRect(),z=B_().scaleExtent([w,v]).translateExtent(x),A=Qt($.current).call(z),F=Or.translate(h.x,h.y).scale(Ir(h.zoom,w,v)),Q=[[0,0],[k.width,k.height]],W=z.constrain()(F,Q,x);z.transform(A,W),z.wheelDelta(xx),E.setState({d3Zoom:z,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[W.x,W.y,W.k],domNode:$.current.closest(".react-flow")})}},[]),b.useEffect(()=>{U&&L&&(o&&!D&&!S?U.on("wheel.zoom",k=>{if(Bs(k,y))return!1;k.preventDefault(),k.stopImmediatePropagation();const z=U.property("__zoom").k||1;if(k.ctrlKey&&i){const de=gn(k),je=xx(k),xe=z*Math.pow(2,je);L.scaleTo(U,xe,de,k);return}const A=k.deltaMode===1?20:1;let F=c===ls.Vertical?0:k.deltaX*A,Q=c===ls.Horizontal?0:k.deltaY*A;!tc()&&k.shiftKey&&c!==ls.Vertical&&(F=k.deltaY*A,Q=0),L.translateBy(U,-(F/z)*l,-(Q/z)*l,{internal:!0});const W=Yo(U.property("__zoom")),{onViewportChangeStart:Z,onViewportChange:re,onViewportChangeEnd:ie}=E.getState();clearTimeout(C.current),I.current||(I.current=!0,t==null||t(k,W),Z==null||Z(W)),I.current&&(e==null||e(k,W),re==null||re(W),C.current=setTimeout(()=>{n==null||n(k,W),ie==null||ie(W),I.current=!1},150))},{passive:!1}):typeof H<"u"&&U.on("wheel.zoom",function(k,z){if(!p&&k.type==="wheel"&&!k.ctrlKey||Bs(k,y))return null;k.preventDefault(),H.call(this,k,z)},{passive:!1}))},[S,o,c,U,L,H,D,i,p,y,t,e,n]),b.useEffect(()=>{L&&L.on("start",k=>{var F,Q;if(!k.sourceEvent||k.sourceEvent.internal)return null;T.current=(F=k.sourceEvent)==null?void 0:F.button;const{onViewportChangeStart:z}=E.getState(),A=Yo(k.transform);P.current=!0,R.current=A,((Q=k.sourceEvent)==null?void 0:Q.type)==="mousedown"&&E.setState({paneDragging:!0}),z==null||z(A),t==null||t(k.sourceEvent,A)})},[L,t]),b.useEffect(()=>{L&&(S&&!P.current?L.on("zoom",null):S||L.on("zoom",k=>{var A;const{onViewportChange:z}=E.getState();if(E.setState({transform:[k.transform.x,k.transform.y,k.transform.k]}),M.current=!!(r&&px(d,T.current??0)),(e||z)&&!((A=k.sourceEvent)!=null&&A.internal)){const F=Yo(k.transform);z==null||z(F),e==null||e(k.sourceEvent,F)}}))},[S,L,e,d,r]),b.useEffect(()=>{L&&L.on("end",k=>{if(!k.sourceEvent||k.sourceEvent.internal)return null;const{onViewportChangeEnd:z}=E.getState();if(P.current=!1,E.setState({paneDragging:!1}),r&&px(d,T.current??0)&&!M.current&&r(k.sourceEvent),M.current=!1,(n||z)&&T3(R.current,k.transform)){const A=Yo(k.transform);R.current=A,clearTimeout(N.current),N.current=setTimeout(()=>{z==null||z(A),n==null||n(k.sourceEvent,A)},o?150:0)}})},[L,o,d,n,r]),b.useEffect(()=>{L&&L.filter(k=>{const z=D||s,A=i&&k.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&k.button===1&&k.type==="mousedown"&&(Bs(k,"react-flow__node")||Bs(k,"react-flow__edge")))return!0;if(!d&&!z&&!o&&!u&&!i||S||!u&&k.type==="dblclick"||Bs(k,y)&&k.type==="wheel"||Bs(k,g)&&(k.type!=="wheel"||o&&k.type==="wheel"&&!D)||!i&&k.ctrlKey&&k.type==="wheel"||!z&&!o&&!A&&k.type==="wheel"||!d&&(k.type==="mousedown"||k.type==="touchstart")||Array.isArray(d)&&!d.includes(k.button)&&k.type==="mousedown")return!1;const F=Array.isArray(d)&&d.includes(k.button)||!k.button||k.button<=1;return(!k.ctrlKey||k.type==="wheel")&&F})},[S,L,s,i,o,u,d,f,D]),O.createElement("div",{className:"react-flow__renderer",ref:$,style:Uh},m)},O3=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function A3(){const{userSelectionActive:e,userSelectionRect:t}=Fe(O3,mt);return e&&t?O.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 gx(e,t){const n=t.parentNode||t.parentId,r=e.find(s=>s.id===n);if(r){const s=t.position.x+t.width-r.width,i=t.position.y+t.height-r.height;if(s>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,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);r.position.x=r.position.x-o,r.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);r.position.y=r.position.y-o,r.style.height+=o,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function F3(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,s)=>{const i=e.filter(l=>l.id===s.id);if(i.length===0)return r.push(s),r;const o={...s};for(const l of i)if(l)switch(l.type){case"select":{o.selected=l.selected;break}case"position":{typeof l.position<"u"&&(o.position=l.position),typeof l.positionAbsolute<"u"&&(o.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(o.dragging=l.dragging),o.expandParent&&gx(r,o);break}case"dimensions":{typeof l.dimensions<"u"&&(o.width=l.dimensions.width,o.height=l.dimensions.height),typeof l.updateStyle<"u"&&(o.style={...o.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(o.resizing=l.resizing),o.expandParent&&gx(r,o);break}case"remove":return r}return r.push(o),r},n)}function b1(e,t){return F3(e,t)}const cr=(e,t)=>({id:e,type:"select",selected:t});function ri(e,t){return e.reduce((n,r)=>{const s=t.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(cr(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(cr(r.id,!1))),n},[])}const Su=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},L3=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),j1=b.memo(({isSelecting:e,selectionMode:t=so.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:o,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:f,children:d})=>{const h=b.useRef(null),x=Xe(),w=b.useRef(0),v=b.useRef(0),j=b.useRef(),{userSelectionActive:p,elementsSelectable:m,dragging:y}=Fe(L3,mt),g=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),w.current=0,v.current=0},N=H=>{i==null||i(H),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},E=H=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){H.preventDefault();return}o==null||o(H)},P=l?H=>l(H):void 0,M=H=>{const{resetSelectedElements:S,domNode:D}=x.getState();if(j.current=D==null?void 0:D.getBoundingClientRect(),!m||!e||H.button!==0||H.target!==h.current||!j.current)return;const{x:T,y:I}=Ar(H,j.current);S(),x.setState({userSelectionRect:{width:0,height:0,startX:T,startY:I,x:T,y:I}}),r==null||r(H)},$=H=>{const{userSelectionRect:S,nodeInternals:D,edges:T,transform:I,onNodesChange:C,onEdgesChange:k,nodeOrigin:z,getNodes:A}=x.getState();if(!e||!j.current||!S)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const F=Ar(H,j.current),Q=S.startX??0,W=S.startY??0,Z={...S,x:F.x<Q?F.x:Q,y:F.y<W?F.y:W,width:Math.abs(F.x-Q),height:Math.abs(F.y-W)},re=A(),ie=r1(D,Z,I,t===so.Partial,!0,z),de=s1(ie,T).map(xe=>xe.id),je=ie.map(xe=>xe.id);if(w.current!==je.length){w.current=je.length;const xe=ri(re,je);xe.length&&(C==null||C(xe))}if(v.current!==de.length){v.current=de.length;const xe=ri(T,de);xe.length&&(k==null||k(xe))}x.setState({userSelectionRect:Z})},R=H=>{if(H.button!==0)return;const{userSelectionRect:S}=x.getState();!p&&S&&H.target===h.current&&(N==null||N(H)),x.setState({nodesSelectionActive:w.current>0}),g(),s==null||s(H)},L=H=>{p&&(x.setState({nodesSelectionActive:w.current>0}),s==null||s(H)),g()},U=m&&(e||p);return O.createElement("div",{className:pt(["react-flow__pane",{dragging:y,selection:e}]),onClick:U?void 0:Su(N,h),onContextMenu:Su(E,h),onWheel:Su(P,h),onMouseEnter:U?void 0:c,onMouseDown:U?M:void 0,onMouseMove:U?$:u,onMouseUp:U?R:void 0,onMouseLeave:U?L:f,ref:h,style:Uh},d,O.createElement(A3,null))});j1.displayName="Pane";function N1(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:N1(r,t):!1}function yx(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function I3(e,t,n,r){return Array.from(e.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!N1(s,e))&&(s.draggable||t&&typeof s.draggable>"u")).map(s=>{var i,o;return{id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=s.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((o=s.positionAbsolute)==null?void 0:o.y)??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}})}function U3(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function k1(e,t,n,r,s=[0,0],i){const o=U3(e,e.extent||r);let l=o;const c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const d=n.get(c),{x:h,y:x}=fi(d,s).positionAbsolute;l=d&&Gt(h)&&Gt(x)&&Gt(d.width)&&Gt(d.height)?[[h+e.width*s[0],x+e.height*s[1]],[h+d.width-e.width+e.width*s[0],x+d.height-e.height+e.height*s[1]]]:l}else i==null||i("005",Yn.error005()),l=o;else if(e.extent&&c&&e.extent!=="parent"){const d=n.get(c),{x:h,y:x}=fi(d,s).positionAbsolute;l=[[e.extent[0][0]+h,e.extent[0][1]+x],[e.extent[1][0]+h,e.extent[1][1]+x]]}let u={x:0,y:0};if(c){const d=n.get(c);u=fi(d,s).positionAbsolute}const f=l&&l!=="parent"?$h(t,l):t;return{position:{x:f.x-u.x,y:f.y-u.y},positionAbsolute:f}}function Cu({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[e?r.find(s=>s.id===e):r[0],r]}const vx=(e,t,n,r)=>{const s=t.querySelectorAll(e);if(!s||!s.length)return null;const i=Array.from(s),o=t.getBoundingClientRect(),l={x:o.width*r[0],y:o.height*r[1]};return i.map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-o.left-l.x)/n,y:(u.top-o.top-l.y)/n,...zh(c)}})};function ua(e,t,n){return n===void 0?n:r=>{const s=t().nodeInternals.get(e);s&&n(r,{...s})}}function lf({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:o,nodeInternals:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Yn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):s([e])}function S1(){const e=Xe();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=e.getState(),o=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(o-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(c.x/s[0]):c.x,ySnapped:i?s[1]*Math.round(c.y/s[1]):c.y,...c}},[])}function Eu(e){return(t,n,r)=>e==null?void 0:e(t,r)}function C1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:o}){const l=Xe(),[c,u]=b.useState(!1),f=b.useRef([]),d=b.useRef({x:null,y:null}),h=b.useRef(0),x=b.useRef(null),w=b.useRef({x:0,y:0}),v=b.useRef(null),j=b.useRef(!1),p=b.useRef(!1),m=b.useRef(!1),y=S1();return b.useEffect(()=>{if(e!=null&&e.current){const g=Qt(e.current),N=({x:M,y:$})=>{const{nodeInternals:R,onNodeDrag:L,onSelectionDrag:U,updateNodePositions:H,nodeExtent:S,snapGrid:D,snapToGrid:T,nodeOrigin:I,onError:C}=l.getState();d.current={x:M,y:$};let k=!1,z={x:0,y:0,x2:0,y2:0};if(f.current.length>1&&S){const F=Fh(f.current,I);z=Th(F)}if(f.current=f.current.map(F=>{const Q={x:M-F.distance.x,y:$-F.distance.y};T&&(Q.x=D[0]*Math.round(Q.x/D[0]),Q.y=D[1]*Math.round(Q.y/D[1]));const W=[[S[0][0],S[0][1]],[S[1][0],S[1][1]]];f.current.length>1&&S&&!F.extent&&(W[0][0]=F.positionAbsolute.x-z.x+S[0][0],W[1][0]=F.positionAbsolute.x+(F.width??0)-z.x2+S[1][0],W[0][1]=F.positionAbsolute.y-z.y+S[0][1],W[1][1]=F.positionAbsolute.y+(F.height??0)-z.y2+S[1][1]);const Z=k1(F,Q,R,W,I,C);return k=k||F.position.x!==Z.position.x||F.position.y!==Z.position.y,F.position=Z.position,F.positionAbsolute=Z.positionAbsolute,F}),!k)return;H(f.current,!0,!0),u(!0);const A=s?L:Eu(U);if(A&&v.current){const[F,Q]=Cu({nodeId:s,dragItems:f.current,nodeInternals:R});A(v.current,F,Q)}},E=()=>{if(!x.current)return;const[M,$]=Kv(w.current,x.current);if(M!==0||$!==0){const{transform:R,panBy:L}=l.getState();d.current.x=(d.current.x??0)-M/R[2],d.current.y=(d.current.y??0)-$/R[2],L({x:M,y:$})&&N(d.current)}h.current=requestAnimationFrame(E)},P=M=>{var I;const{nodeInternals:$,multiSelectionActive:R,nodesDraggable:L,unselectNodesAndEdges:U,onNodeDragStart:H,onSelectionDragStart:S}=l.getState();p.current=!0;const D=s?H:Eu(S);(!o||!i)&&!R&&s&&((I=$.get(s))!=null&&I.selected||U()),s&&i&&o&&lf({id:s,store:l,nodeRef:e});const T=y(M);if(d.current=T,f.current=I3($,L,T,s),D&&f.current){const[C,k]=Cu({nodeId:s,dragItems:f.current,nodeInternals:$});D(M.sourceEvent,C,k)}};if(t)g.on(".drag",null);else{const M=zv().on("start",$=>{const{domNode:R,nodeDragThreshold:L}=l.getState();L===0&&P($),m.current=!1;const U=y($);d.current=U,x.current=(R==null?void 0:R.getBoundingClientRect())||null,w.current=Ar($.sourceEvent,x.current)}).on("drag",$=>{var H,S;const R=y($),{autoPanOnNodeDrag:L,nodeDragThreshold:U}=l.getState();if($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1&&(m.current=!0),!m.current){if(!j.current&&p.current&&L&&(j.current=!0,E()),!p.current){const D=R.xSnapped-(((H=d==null?void 0:d.current)==null?void 0:H.x)??0),T=R.ySnapped-(((S=d==null?void 0:d.current)==null?void 0:S.y)??0);Math.sqrt(D*D+T*T)>U&&P($)}(d.current.x!==R.xSnapped||d.current.y!==R.ySnapped)&&f.current&&p.current&&(v.current=$.sourceEvent,w.current=Ar($.sourceEvent,x.current),N(R))}}).on("end",$=>{if(!(!p.current||m.current)&&(u(!1),j.current=!1,p.current=!1,cancelAnimationFrame(h.current),f.current)){const{updateNodePositions:R,nodeInternals:L,onNodeDragStop:U,onSelectionDragStop:H}=l.getState(),S=s?U:Eu(H);if(R(f.current,!1,!1),S){const[D,T]=Cu({nodeId:s,dragItems:f.current,nodeInternals:L});S($.sourceEvent,D,T)}}}).filter($=>{const R=$.target;return!$.button&&(!n||!yx(R,`.${n}`,e))&&(!r||yx(R,r,e))});return g.call(M),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,l,s,o,y]),c}function E1(){const e=Xe();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:o,snapToGrid:l,snapGrid:c,onError:u,nodesDraggable:f}=e.getState(),d=o().filter(m=>m.selected&&(m.draggable||f&&typeof m.draggable>"u")),h=l?c[0]:5,x=l?c[1]:5,w=n.isShiftPressed?4:1,v=n.x*h*w,j=n.y*x*w,p=d.map(m=>{if(m.positionAbsolute){const y={x:m.positionAbsolute.x+v,y:m.positionAbsolute.y+j};l&&(y.x=c[0]*Math.round(y.x/c[0]),y.y=c[1]*Math.round(y.y/c[1]));const{positionAbsolute:g,position:N}=k1(m,y,r,s,void 0,u);m.position=N,m.positionAbsolute=g}return m});i(p,!0,!1)},[])}const hi={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var da=e=>{const t=({id:n,type:r,data:s,xPos:i,yPos:o,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:f,onMouseEnter:d,onMouseMove:h,onMouseLeave:x,onContextMenu:w,onDoubleClick:v,style:j,className:p,isDraggable:m,isSelectable:y,isConnectable:g,isFocusable:N,selectNodesOnDrag:E,sourcePosition:P,targetPosition:M,hidden:$,resizeObserver:R,dragHandle:L,zIndex:U,isParent:H,noDragClassName:S,noPanClassName:D,initialized:T,disableKeyboardA11y:I,ariaLabel:C,rfId:k,hasHandleBounds:z})=>{const A=Xe(),F=b.useRef(null),Q=b.useRef(null),W=b.useRef(P),Z=b.useRef(M),re=b.useRef(r),ie=y||m||f||d||h||x,de=E1(),je=ua(n,A.getState,d),xe=ua(n,A.getState,h),Ne=ua(n,A.getState,x),Qe=ua(n,A.getState,w),lt=ua(n,A.getState,v),rt=ye=>{const{nodeDragThreshold:q}=A.getState();if(y&&(!E||!m||q>0)&&lf({id:n,store:A,nodeRef:F}),f){const ge=A.getState().nodeInternals.get(n);ge&&f(ye,{...ge})}},_e=ye=>{if(!nf(ye)&&!I)if(Gv.includes(ye.key)&&y){const q=ye.key==="Escape";lf({id:n,store:A,unselect:q,nodeRef:F})}else m&&u&&Object.prototype.hasOwnProperty.call(hi,ye.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${ye.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~o}`}),de({x:hi[ye.key].x,y:hi[ye.key].y,isShiftPressed:ye.shiftKey}))};b.useEffect(()=>()=>{Q.current&&(R==null||R.unobserve(Q.current),Q.current=null)},[]),b.useEffect(()=>{if(F.current&&!$){const ye=F.current;(!T||!z||Q.current!==ye)&&(Q.current&&(R==null||R.unobserve(Q.current)),R==null||R.observe(ye),Q.current=ye)}},[$,T,z]),b.useEffect(()=>{const ye=re.current!==r,q=W.current!==P,ge=Z.current!==M;F.current&&(ye||q||ge)&&(ye&&(re.current=r),q&&(W.current=P),ge&&(Z.current=M),A.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,P,M]);const st=C1({nodeRef:F,disabled:$||!m,noDragClassName:S,handleSelector:L,nodeId:n,isSelectable:y,selectNodesOnDrag:E});return $?null:O.createElement("div",{className:pt(["react-flow__node",`react-flow__node-${r}`,{[D]:m},p,{selected:u,selectable:y,parent:H,dragging:st}]),ref:F,style:{zIndex:U,transform:`translate(${l}px,${c}px)`,pointerEvents:ie?"all":"none",visibility:T?"visible":"hidden",...j},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:je,onMouseMove:xe,onMouseLeave:Ne,onContextMenu:Qe,onClick:rt,onDoubleClick:lt,onKeyDown:N?_e:void 0,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-describedby":I?void 0:`${x1}-${k}`,"aria-label":C},O.createElement(r3,{value:n},O.createElement(e,{id:n,data:s,type:r,xPos:i,yPos:o,selected:u,isConnectable:g,sourcePosition:P,targetPosition:M,dragging:st,dragHandle:L,zIndex:U})))};return t.displayName="NodeWrapper",b.memo(t)};const B3=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Fh(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function H3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Xe(),{width:s,height:i,x:o,y:l,transformString:c,userSelectionActive:u}=Fe(B3,mt),f=E1(),d=b.useRef(null);if(b.useEffect(()=>{var w;n||(w=d.current)==null||w.focus({preventScroll:!0})},[n]),C1({nodeRef:d}),u||!s||!i)return null;const h=e?w=>{const v=r.getState().getNodes().filter(j=>j.selected);e(w,v)}:void 0,x=w=>{Object.prototype.hasOwnProperty.call(hi,w.key)&&f({x:hi[w.key].x,y:hi[w.key].y,isShiftPressed:w.shiftKey})};return O.createElement("div",{className:pt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},O.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:i,top:l,left:o}}))}var V3=b.memo(H3);const W3=e=>e.nodesSelectionActive,_1=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:o,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:f,selectionKeyCode:d,selectionOnDrag:h,selectionMode:x,onSelectionStart:w,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:p,zoomActivationKeyCode:m,elementsSelectable:y,zoomOnScroll:g,zoomOnPinch:N,panOnScroll:E,panOnScrollSpeed:P,panOnScrollMode:M,zoomOnDoubleClick:$,panOnDrag:R,defaultViewport:L,translateExtent:U,minZoom:H,maxZoom:S,preventScrolling:D,onSelectionContextMenu:T,noWheelClassName:I,noPanClassName:C,disableKeyboardA11y:k})=>{const z=Fe(W3),A=io(d),F=io(p),Q=F||R,W=F||E,Z=A||h&&Q!==!0;return z3({deleteKeyCode:l,multiSelectionKeyCode:j}),O.createElement(D3,{onMove:c,onMoveStart:u,onMoveEnd:f,onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:g,zoomOnPinch:N,panOnScroll:W,panOnScrollSpeed:P,panOnScrollMode:M,zoomOnDoubleClick:$,panOnDrag:!A&&Q,defaultViewport:L,translateExtent:U,minZoom:H,maxZoom:S,zoomActivationKeyCode:m,preventScrolling:D,noWheelClassName:I,noPanClassName:C},O.createElement(j1,{onSelectionStart:w,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:Q,isSelecting:!!Z,selectionMode:x},e,z&&O.createElement(V3,{onSelectionContextMenu:T,noPanClassName:C,disableKeyboardA11y:k})))};_1.displayName="FlowRenderer";var Q3=b.memo(_1);function K3(e){return Fe(b.useCallback(n=>e?r1(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function q3(e){const t={input:da(e.input||f1),default:da(e.default||of),output:da(e.output||m1),group:da(e.group||Ih)},n={},r=Object.keys(e).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=da(e[i]||of),s),n);return{...t,...r}}const G3=({x:e,y:t,width:n,height:r,origin:s})=>!n||!r?{x:e,y:t}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:e,y:t}:{x:e-n*s[0],y:t-r*s[1]},X3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),M1=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:o}=Fe(X3,mt),l=K3(e.onlyRenderVisibleElements),c=b.useRef(),u=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const f=new ResizeObserver(d=>{const h=d.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(h)});return c.current=f,f},[]);return b.useEffect(()=>()=>{var f;(f=c==null?void 0:c.current)==null||f.disconnect()},[]),O.createElement("div",{className:"react-flow__nodes",style:Uh},l.map(f=>{var N,E,P;let d=f.type||"default";e.nodeTypes[d]||(o==null||o("003",Yn.error003(d)),d="default");const h=e.nodeTypes[d]||e.nodeTypes.default,x=!!(f.draggable||t&&typeof f.draggable>"u"),w=!!(f.selectable||s&&typeof f.selectable>"u"),v=!!(f.connectable||n&&typeof f.connectable>"u"),j=!!(f.focusable||r&&typeof f.focusable>"u"),p=e.nodeExtent?$h(f.positionAbsolute,e.nodeExtent):f.positionAbsolute,m=(p==null?void 0:p.x)??0,y=(p==null?void 0:p.y)??0,g=G3({x:m,y,width:f.width??0,height:f.height??0,origin:e.nodeOrigin});return O.createElement(h,{key:f.id,id:f.id,className:f.className,style:f.style,type:d,data:f.data,sourcePosition:f.sourcePosition||J.Bottom,targetPosition:f.targetPosition||J.Top,hidden:f.hidden,xPos:m,yPos:y,xPosOrigin:g.x,yPosOrigin:g.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!f.selected,isDraggable:x,isSelectable:w,isConnectable:v,isFocusable:j,resizeObserver:u,dragHandle:f.dragHandle,zIndex:((N=f[Be])==null?void 0:N.z)??0,isParent:!!((E=f[Be])!=null&&E.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!f.width&&!!f.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:f.ariaLabel,hasHandleBounds:!!((P=f[Be])!=null&&P.handleBounds)})}))};M1.displayName="NodeRenderer";var Y3=b.memo(M1);const Z3=(e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,J3=(e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,wx="react-flow__edgeupdater",bx=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:o,type:l})=>O.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:o,className:pt([wx,`${wx}-${l}`]),cx:Z3(t,r,e),cy:J3(n,r,e),r,stroke:"transparent",fill:"transparent"}),e4=()=>!0;var Hs=e=>{const t=({id:n,className:r,type:s,data:i,onClick:o,onEdgeDoubleClick:l,selected:c,animated:u,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:x,labelBgPadding:w,labelBgBorderRadius:v,style:j,source:p,target:m,sourceX:y,sourceY:g,targetX:N,targetY:E,sourcePosition:P,targetPosition:M,elementsSelectable:$,hidden:R,sourceHandleId:L,targetHandleId:U,onContextMenu:H,onMouseEnter:S,onMouseMove:D,onMouseLeave:T,reconnectRadius:I,onReconnect:C,onReconnectStart:k,onReconnectEnd:z,markerEnd:A,markerStart:F,rfId:Q,ariaLabel:W,isFocusable:Z,isReconnectable:re,pathOptions:ie,interactionWidth:de,disableKeyboardA11y:je})=>{const xe=b.useRef(null),[Ne,Qe]=b.useState(!1),[lt,rt]=b.useState(!1),_e=Xe(),st=b.useMemo(()=>`url('#${sf(F,Q)}')`,[F,Q]),ye=b.useMemo(()=>`url('#${sf(A,Q)}')`,[A,Q]);if(R)return null;const q=Te=>{var hn;const{edges:tn,addSelectedEdges:Qr,unselectNodesAndEdges:Kr,multiSelectionActive:qr}=_e.getState(),_n=tn.find(Xi=>Xi.id===n);_n&&($&&(_e.setState({nodesSelectionActive:!1}),_n.selected&&qr?(Kr({nodes:[],edges:[_n]}),(hn=xe.current)==null||hn.blur()):Qr([n])),o&&o(Te,_n))},ge=ca(n,_e.getState,l),zt=ca(n,_e.getState,H),en=ca(n,_e.getState,S),B=ca(n,_e.getState,D),Y=ca(n,_e.getState,T),ne=(Te,tn)=>{if(Te.button!==0)return;const{edges:Qr,isValidConnection:Kr}=_e.getState(),qr=tn?m:p,_n=(tn?U:L)||null,hn=tn?"target":"source",Xi=Kr||e4,Fc=tn,Yi=Qr.find(Gr=>Gr.id===n);rt(!0),k==null||k(Te,Yi,hn);const Lc=Gr=>{rt(!1),z==null||z(Gr,Yi,hn)};l1({event:Te,handleId:_n,nodeId:qr,onConnect:Gr=>C==null?void 0:C(Yi,Gr),isTarget:Fc,getState:_e.getState,setState:_e.setState,isValidConnection:Xi,edgeUpdaterType:hn,onReconnectEnd:Lc})},le=Te=>ne(Te,!0),$e=Te=>ne(Te,!1),Le=()=>Qe(!0),ke=()=>Qe(!1),we=!$&&!o,Ye=Te=>{var tn;if(!je&&Gv.includes(Te.key)&&$){const{unselectNodesAndEdges:Qr,addSelectedEdges:Kr,edges:qr}=_e.getState();Te.key==="Escape"?((tn=xe.current)==null||tn.blur(),Qr({edges:[qr.find(hn=>hn.id===n)]})):Kr([n])}};return O.createElement("g",{className:pt(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:u,inactive:we,updating:Ne}]),onClick:q,onDoubleClick:ge,onContextMenu:zt,onMouseEnter:en,onMouseMove:B,onMouseLeave:Y,onKeyDown:Z?Ye:void 0,tabIndex:Z?0:void 0,role:Z?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${p} to ${m}`,"aria-describedby":Z?`${g1}-${Q}`:void 0,ref:xe},!lt&&O.createElement(e,{id:n,source:p,target:m,selected:c,animated:u,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:x,labelBgPadding:w,labelBgBorderRadius:v,data:i,style:j,sourceX:y,sourceY:g,targetX:N,targetY:E,sourcePosition:P,targetPosition:M,sourceHandleId:L,targetHandleId:U,markerStart:st,markerEnd:ye,pathOptions:ie,interactionWidth:de}),re&&O.createElement(O.Fragment,null,(re==="source"||re===!0)&&O.createElement(bx,{position:P,centerX:y,centerY:g,radius:I,onMouseDown:le,onMouseEnter:Le,onMouseOut:ke,type:"source"}),(re==="target"||re===!0)&&O.createElement(bx,{position:M,centerX:N,centerY:E,radius:I,onMouseDown:$e,onMouseEnter:Le,onMouseOut:ke,type:"target"})))};return t.displayName="EdgeWrapper",b.memo(t)};function t4(e){const t={default:Hs(e.default||nc),straight:Hs(e.bezier||Oh),step:Hs(e.step||Dh),smoothstep:Hs(e.step||Dc),simplebezier:Hs(e.simplebezier||Rh)},n={},r=Object.keys(e).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=Hs(e[i]||nc),s),n);return{...t,...r}}function jx(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,s=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,o=(n==null?void 0:n.height)||t.height;switch(e){case J.Top:return{x:r+i/2,y:s};case J.Right:return{x:r+i,y:s+o/2};case J.Bottom:return{x:r+i/2,y:s+o};case J.Left:return{x:r,y:s+o/2}}}function Nx(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const n4=(e,t,n,r,s,i)=>{const o=jx(n,e,t),l=jx(i,r,s);return{sourceX:o.x,sourceY:o.y,targetX:l.x,targetY:l.y}};function r4({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:o,height:l,transform:c}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+s),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const f=Th({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:o/c[2],height:l/c[2]}),d=Math.max(0,Math.min(f.x2,u.x2)-Math.max(f.x,u.x)),h=Math.max(0,Math.min(f.y2,u.y2)-Math.max(f.y,u.y));return Math.ceil(d*h)>0}function kx(e){var r,s,i,o,l;const t=((r=e==null?void 0:e[Be])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const s4=[{level:0,isMaxLevel:!0,edges:[]}];function i4(e,t,n=!1){let r=-1;const s=e.reduce((o,l)=>{var f,d;const c=Gt(l.zIndex);let u=c?l.zIndex:0;if(n){const h=t.get(l.target),x=t.get(l.source),w=l.selected||(h==null?void 0:h.selected)||(x==null?void 0:x.selected),v=Math.max(((f=x==null?void 0:x[Be])==null?void 0:f.z)||0,((d=h==null?void 0:h[Be])==null?void 0:d.z)||0,1e3);u=(c?l.zIndex:0)+(w?v:0)}return o[u]?o[u].push(l):o[u]=[l],r=u>r?u:r,o},{}),i=Object.entries(s).map(([o,l])=>{const c=+o;return{edges:l,level:c,isMaxLevel:c===r}});return i.length===0?s4:i}function a4(e,t,n){const r=Fe(b.useCallback(s=>e?s.edges.filter(i=>{const o=t.get(i.source),l=t.get(i.target);return(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&r4({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:l.width,targetHeight:l.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[e,t]));return i4(r,t,n)}const o4=({color:e="none",strokeWidth:t=1})=>O.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),l4=({color:e="none",strokeWidth:t=1})=>O.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Sx={[Bi.Arrow]:o4,[Bi.ArrowClosed]:l4};function c4(e){const t=Xe();return b.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(Sx,e)?Sx[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Yn.error009(e)),null)},[e])}const u4=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=c4(t);return c?O.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},O.createElement(c,{color:n,strokeWidth:o})):null},d4=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(o=>{if(o&&typeof o=="object"){const l=sf(o,t);r.includes(l)||(s.push({id:l,color:o.color||e,...o}),r.push(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},P1=({defaultColor:e,rfId:t})=>{const n=Fe(b.useCallback(d4({defaultColor:e,rfId:t}),[e,t]),(r,s)=>!(r.length!==s.length||r.some((i,o)=>i.id!==s[o].id)));return O.createElement("defs",null,n.map(r=>O.createElement(u4,{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})))};P1.displayName="MarkerDefinitions";var f4=b.memo(P1);const h4=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}),z1=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:f,onEdgeDoubleClick:d,onReconnect:h,onReconnectStart:x,onReconnectEnd:w,reconnectRadius:v,children:j,disableKeyboardA11y:p})=>{const{edgesFocusable:m,edgesUpdatable:y,elementsSelectable:g,width:N,height:E,connectionMode:P,nodeInternals:M,onError:$}=Fe(h4,mt),R=a4(t,M,n);return N?O.createElement(O.Fragment,null,R.map(({level:L,edges:U,isMaxLevel:H})=>O.createElement("svg",{key:L,style:{zIndex:L},width:N,height:E,className:"react-flow__edges react-flow__container"},H&&O.createElement(f4,{defaultColor:e,rfId:r}),O.createElement("g",null,U.map(S=>{const[D,T,I]=kx(M.get(S.source)),[C,k,z]=kx(M.get(S.target));if(!I||!z)return null;let A=S.type||"default";s[A]||($==null||$("011",Yn.error011(A)),A="default");const F=s[A]||s.default,Q=P===$s.Strict?k.target:(k.target??[]).concat(k.source??[]),W=Nx(T.source,S.sourceHandle),Z=Nx(Q,S.targetHandle),re=(W==null?void 0:W.position)||J.Bottom,ie=(Z==null?void 0:Z.position)||J.Top,de=!!(S.focusable||m&&typeof S.focusable>"u"),je=S.reconnectable||S.updatable,xe=typeof h<"u"&&(je||y&&typeof je>"u");if(!W||!Z)return $==null||$("008",Yn.error008(W,S)),null;const{sourceX:Ne,sourceY:Qe,targetX:lt,targetY:rt}=n4(D,W,re,C,Z,ie);return O.createElement(F,{key:S.id,id:S.id,className:pt([S.className,i]),type:A,data:S.data,selected:!!S.selected,animated:!!S.animated,hidden:!!S.hidden,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,style:S.style,source:S.source,target:S.target,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerEnd:S.markerEnd,markerStart:S.markerStart,sourceX:Ne,sourceY:Qe,targetX:lt,targetY:rt,sourcePosition:re,targetPosition:ie,elementsSelectable:g,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:f,onEdgeDoubleClick:d,onReconnect:h,onReconnectStart:x,onReconnectEnd:w,reconnectRadius:v,rfId:r,ariaLabel:S.ariaLabel,isFocusable:de,isReconnectable:xe,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:p})})))),j):null};z1.displayName="EdgeRenderer";var m4=b.memo(z1);const p4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function x4({children:e}){const t=Fe(p4);return O.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function g4(e){const t=Oc(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const y4={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top},$1=({nodeId:e,handleType:t,style:n,type:r=fr.Bezier,CustomComponent:s,connectionStatus:i})=>{var E,P,M;const{fromNode:o,handleId:l,toX:c,toY:u,connectionMode:f}=Fe(b.useCallback($=>({fromNode:$.nodeInternals.get(e),handleId:$.connectionHandleId,toX:($.connectionPosition.x-$.transform[0])/$.transform[2],toY:($.connectionPosition.y-$.transform[1])/$.transform[2],connectionMode:$.connectionMode}),[e]),mt),d=(E=o==null?void 0:o[Be])==null?void 0:E.handleBounds;let h=d==null?void 0:d[t];if(f===$s.Loose&&(h=h||(d==null?void 0:d[t==="source"?"target":"source"])),!o||!h)return null;const x=l?h.find($=>$.id===l):h[0],w=x?x.x+x.width/2:(o.width??0)/2,v=x?x.y+x.height/2:o.height??0,j=(((P=o.positionAbsolute)==null?void 0:P.x)??0)+w,p=(((M=o.positionAbsolute)==null?void 0:M.y)??0)+v,m=x==null?void 0:x.position,y=m?y4[m]:null;if(!m||!y)return null;if(s)return O.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:o,fromHandle:x,fromX:j,fromY:p,toX:c,toY:u,fromPosition:m,toPosition:y,connectionStatus:i});let g="";const N={sourceX:j,sourceY:p,sourcePosition:m,targetX:c,targetY:u,targetPosition:y};return r===fr.Bezier?[g]=e1(N):r===fr.Step?[g]=rf({...N,borderRadius:0}):r===fr.SmoothStep?[g]=rf(N):r===fr.SimpleBezier?[g]=Jv(N):g=`M${j},${p} ${c},${u}`,O.createElement("path",{d:g,fill:"none",className:"react-flow__connection-path",style:n})};$1.displayName="ConnectionLine";const v4=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function w4({containerStyle:e,style:t,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:o,width:l,height:c,connectionStatus:u}=Fe(v4,mt);return!(s&&i&&l&&o)?null:O.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},O.createElement("g",{className:pt(["react-flow__connection",u])},O.createElement($1,{nodeId:s,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function Cx(e,t){return b.useRef(null),Xe(),b.useMemo(()=>t(e),[e])}const T1=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:o,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:x,onSelectionContextMenu:w,onSelectionStart:v,onSelectionEnd:j,connectionLineType:p,connectionLineStyle:m,connectionLineComponent:y,connectionLineContainerStyle:g,selectionKeyCode:N,selectionOnDrag:E,selectionMode:P,multiSelectionKeyCode:M,panActivationKeyCode:$,zoomActivationKeyCode:R,deleteKeyCode:L,onlyRenderVisibleElements:U,elementsSelectable:H,selectNodesOnDrag:S,defaultViewport:D,translateExtent:T,minZoom:I,maxZoom:C,preventScrolling:k,defaultMarkerColor:z,zoomOnScroll:A,zoomOnPinch:F,panOnScroll:Q,panOnScrollSpeed:W,panOnScrollMode:Z,zoomOnDoubleClick:re,panOnDrag:ie,onPaneClick:de,onPaneMouseEnter:je,onPaneMouseMove:xe,onPaneMouseLeave:Ne,onPaneScroll:Qe,onPaneContextMenu:lt,onEdgeContextMenu:rt,onEdgeMouseEnter:_e,onEdgeMouseMove:st,onEdgeMouseLeave:ye,onReconnect:q,onReconnectStart:ge,onReconnectEnd:zt,reconnectRadius:en,noDragClassName:B,noWheelClassName:Y,noPanClassName:ne,elevateEdgesOnSelect:le,disableKeyboardA11y:$e,nodeOrigin:Le,nodeExtent:ke,rfId:we})=>{const Ye=Cx(e,q3),Te=Cx(t,t4);return g4(i),O.createElement(Q3,{onPaneClick:de,onPaneMouseEnter:je,onPaneMouseMove:xe,onPaneMouseLeave:Ne,onPaneContextMenu:lt,onPaneScroll:Qe,deleteKeyCode:L,selectionKeyCode:N,selectionOnDrag:E,selectionMode:P,onSelectionStart:v,onSelectionEnd:j,multiSelectionKeyCode:M,panActivationKeyCode:$,zoomActivationKeyCode:R,elementsSelectable:H,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:A,zoomOnPinch:F,zoomOnDoubleClick:re,panOnScroll:Q,panOnScrollSpeed:W,panOnScrollMode:Z,panOnDrag:ie,defaultViewport:D,translateExtent:T,minZoom:I,maxZoom:C,onSelectionContextMenu:w,preventScrolling:k,noDragClassName:B,noWheelClassName:Y,noPanClassName:ne,disableKeyboardA11y:$e},O.createElement(x4,null,O.createElement(m4,{edgeTypes:Te,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:U,onEdgeContextMenu:rt,onEdgeMouseEnter:_e,onEdgeMouseMove:st,onEdgeMouseLeave:ye,onReconnect:q,onReconnectStart:ge,onReconnectEnd:zt,reconnectRadius:en,defaultMarkerColor:z,noPanClassName:ne,elevateEdgesOnSelect:!!le,disableKeyboardA11y:$e,rfId:we},O.createElement(w4,{style:m,type:p,component:y,containerStyle:g})),O.createElement("div",{className:"react-flow__edgelabel-renderer"}),O.createElement(Y3,{nodeTypes:Ye,onNodeClick:o,onNodeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:x,selectNodesOnDrag:S,onlyRenderVisibleElements:U,noPanClassName:ne,noDragClassName:B,disableKeyboardA11y:$e,nodeOrigin:Le,nodeExtent:ke,rfId:we})))};T1.displayName="GraphView";var b4=b.memo(T1);const cf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rr={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:cf,nodeExtent:cf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$s.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:Y_,isValidConnection:void 0},j4=()=>dC((e,t)=>({...rr,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=t();e({nodeInternals:ku(n,r,s,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",i=typeof r<"u",o=s?ku(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:o,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:o,fitViewOnInitOptions:l,domNode:c,nodeOrigin:u}=t(),f=c==null?void 0:c.querySelector(".react-flow__viewport");if(!f)return;const d=window.getComputedStyle(f),{m22:h}=new window.DOMMatrixReadOnly(d.transform),x=n.reduce((v,j)=>{const p=s.get(j.id);if(p!=null&&p.hidden)s.set(p.id,{...p,[Be]:{...p[Be],handleBounds:void 0}});else if(p){const m=zh(j.nodeElement);!!(m.width&&m.height&&(p.width!==m.width||p.height!==m.height||j.forceUpdate))&&(s.set(p.id,{...p,[Be]:{...p[Be],handleBounds:{source:vx(".source",j.nodeElement,h,u),target:vx(".target",j.nodeElement,h,u)}},...m}),v.push({id:p.id,type:"dimensions",dimensions:m}))}return v},[]);v1(s,u);const w=o||i&&!o&&w1(t,{initial:!0,...l});e({nodeInternals:new Map(s),fitViewOnInitDone:w}),(x==null?void 0:x.length)>0&&(r==null||r(x))},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:i}=t(),o=n.map(l=>{const c={id:l.id,type:"position",dragging:s};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(o)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:o,getNodes:l,elevateNodesOnSelect:c}=t();if(n!=null&&n.length){if(i){const u=b1(n,l()),f=ku(u,s,o,c);e({nodeInternals:f})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=t();let o,l=null;r?o=n.map(c=>cr(c,!0)):(o=ri(i(),n),l=ri(s,[])),Xo({changedNodes:o,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=t();let o,l=null;r?o=n.map(c=>cr(c,!0)):(o=ri(s,n),l=ri(i(),[])),Xo({changedNodes:l,changedEdges:o,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=t(),o=n||i(),l=r||s,c=o.map(f=>(f.selected=!1,cr(f.id,!1))),u=l.map(f=>cr(f.id,!1));Xo({changedNodes:c,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=t();r==null||r.scaleExtent([n,s]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=t();r==null||r.scaleExtent([s,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(l=>l.selected).map(l=>cr(l.id,!1)),o=n.filter(l=>l.selected).map(l=>cr(l.id,!1));Xo({changedNodes:i,changedEdges:o,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(s=>{s.positionAbsolute=$h(s.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:o,d3Selection:l,translateExtent:c}=t();if(!o||!l||!n.x&&!n.y)return!1;const u=Or.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),f=[[0,0],[s,i]],d=o==null?void 0:o.constrain()(u,f,c);return o.transform(l,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:rr.connectionNodeId,connectionHandleId:rr.connectionHandleId,connectionHandleType:rr.connectionHandleType,connectionStatus:rr.connectionStatus,connectionStartHandle:rr.connectionStartHandle,connectionEndHandle:rr.connectionEndHandle}),reset:()=>e({...rr})}),Object.is),R1=({children:e})=>{const t=b.useRef(null);return t.current||(t.current=j4()),O.createElement(H_,{value:t.current},e)};R1.displayName="ReactFlowProvider";const D1=({children:e})=>b.useContext(Rc)?O.createElement(O.Fragment,null,e):O.createElement(R1,null,e);D1.displayName="ReactFlowWrapper";const N4={input:f1,default:of,output:m1,group:Ih},k4={default:nc,straight:Oh,step:Dh,smoothstep:Dc,simplebezier:Rh},S4=[0,0],C4=[15,15],E4={x:0,y:0,zoom:1},_4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Bh=b.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=N4,edgeTypes:o=k4,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:f,onMoveStart:d,onMoveEnd:h,onConnect:x,onConnectStart:w,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:p,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:g,onNodeContextMenu:N,onNodeDoubleClick:E,onNodeDragStart:P,onNodeDrag:M,onNodeDragStop:$,onNodesDelete:R,onEdgesDelete:L,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:S,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:C,connectionMode:k=$s.Strict,connectionLineType:z=fr.Bezier,connectionLineStyle:A,connectionLineComponent:F,connectionLineContainerStyle:Q,deleteKeyCode:W="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:re=!1,selectionMode:ie=so.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:je=tc()?"Meta":"Control",zoomActivationKeyCode:xe=tc()?"Meta":"Control",snapToGrid:Ne=!1,snapGrid:Qe=C4,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:rt=!0,nodesDraggable:_e,nodesConnectable:st,nodesFocusable:ye,nodeOrigin:q=S4,edgesFocusable:ge,edgesUpdatable:zt,elementsSelectable:en,defaultViewport:B=E4,minZoom:Y=.5,maxZoom:ne=2,translateExtent:le=cf,preventScrolling:$e=!0,nodeExtent:Le,defaultMarkerColor:ke="#b1b1b7",zoomOnScroll:we=!0,zoomOnPinch:Ye=!0,panOnScroll:Te=!1,panOnScrollSpeed:tn=.5,panOnScrollMode:Qr=ls.Free,zoomOnDoubleClick:Kr=!0,panOnDrag:qr=!0,onPaneClick:_n,onPaneMouseEnter:hn,onPaneMouseMove:Xi,onPaneMouseLeave:Fc,onPaneScroll:Yi,onPaneContextMenu:Lc,children:Kh,onEdgeContextMenu:Gr,onEdgeDoubleClick:G1,onEdgeMouseEnter:X1,onEdgeMouseMove:Y1,onEdgeMouseLeave:Z1,onEdgeUpdate:J1,onEdgeUpdateStart:ew,onEdgeUpdateEnd:tw,onReconnect:nw,onReconnectStart:rw,onReconnectEnd:sw,reconnectRadius:iw=10,edgeUpdaterRadius:aw=10,onNodesChange:ow,onEdgesChange:lw,noDragClassName:cw="nodrag",noWheelClassName:uw="nowheel",noPanClassName:qh="nopan",fitView:dw=!1,fitViewOptions:fw,connectOnClick:hw=!0,attributionPosition:mw,proOptions:pw,defaultEdgeOptions:xw,elevateNodesOnSelect:gw=!0,elevateEdgesOnSelect:yw=!1,disableKeyboardA11y:Gh=!1,autoPanOnConnect:vw=!0,autoPanOnNodeDrag:ww=!0,connectionRadius:bw=20,isValidConnection:jw,onError:Nw,style:kw,id:Xh,nodeDragThreshold:Sw,...Cw},Ew)=>{const Ic=Xh||"1";return O.createElement("div",{...Cw,style:{...kw,..._4},ref:Ew,className:pt(["react-flow",s]),"data-testid":"rf__wrapper",id:Xh},O.createElement(D1,null,O.createElement(b4,{onInit:u,onMove:f,onMoveStart:d,onMoveEnd:h,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:g,onNodeContextMenu:N,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:o,connectionLineType:z,connectionLineStyle:A,connectionLineComponent:F,connectionLineContainerStyle:Q,selectionKeyCode:Z,selectionOnDrag:re,selectionMode:ie,deleteKeyCode:W,multiSelectionKeyCode:je,panActivationKeyCode:de,zoomActivationKeyCode:xe,onlyRenderVisibleElements:lt,selectNodesOnDrag:rt,defaultViewport:B,translateExtent:le,minZoom:Y,maxZoom:ne,preventScrolling:$e,zoomOnScroll:we,zoomOnPinch:Ye,zoomOnDoubleClick:Kr,panOnScroll:Te,panOnScrollSpeed:tn,panOnScrollMode:Qr,panOnDrag:qr,onPaneClick:_n,onPaneMouseEnter:hn,onPaneMouseMove:Xi,onPaneMouseLeave:Fc,onPaneScroll:Yi,onPaneContextMenu:Lc,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:C,onEdgeContextMenu:Gr,onEdgeDoubleClick:G1,onEdgeMouseEnter:X1,onEdgeMouseMove:Y1,onEdgeMouseLeave:Z1,onReconnect:nw??J1,onReconnectStart:rw??ew,onReconnectEnd:sw??tw,reconnectRadius:iw??aw,defaultMarkerColor:ke,noDragClassName:cw,noWheelClassName:uw,noPanClassName:qh,elevateEdgesOnSelect:yw,rfId:Ic,disableKeyboardA11y:Gh,nodeOrigin:q,nodeExtent:Le}),O.createElement(v3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:w,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:p,nodesDraggable:_e,nodesConnectable:st,nodesFocusable:ye,edgesFocusable:ge,edgesUpdatable:zt,elementsSelectable:en,elevateNodesOnSelect:gw,minZoom:Y,maxZoom:ne,nodeExtent:Le,onNodesChange:ow,onEdgesChange:lw,snapToGrid:Ne,snapGrid:Qe,connectionMode:k,translateExtent:le,connectOnClick:hw,defaultEdgeOptions:xw,fitView:dw,fitViewOptions:fw,onNodesDelete:R,onEdgesDelete:L,onNodeDragStart:P,onNodeDrag:M,onNodeDragStop:$,onSelectionDrag:S,onSelectionDragStart:H,onSelectionDragStop:D,noPanClassName:qh,nodeOrigin:q,rfId:Ic,autoPanOnConnect:vw,autoPanOnNodeDrag:ww,onError:Nw,connectionRadius:bw,isValidConnection:jw,nodeDragThreshold:Sw}),O.createElement(g3,{onSelectionChange:U}),Kh,O.createElement(W_,{proOptions:pw,position:mw}),O.createElement(k3,{rfId:Ic,disableKeyboardA11y:Gh})))});Bh.displayName="ReactFlow";function M4(e){return t=>{const[n,r]=b.useState(t),s=b.useCallback(i=>r(o=>e(i,o)),[]);return[n,r,s]}}const P4=M4(b1);function z4(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},O.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function $4(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},O.createElement("path",{d:"M0 0h32v4.2H0z"}))}function T4(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},O.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function R4(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function D4(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const wa=({children:e,className:t,...n})=>O.createElement("button",{type:"button",className:pt(["react-flow__controls-button",t]),...n},e);wa.displayName="ControlButton";const O4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),O1=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:f,position:d="bottom-left"})=>{const h=Xe(),[x,w]=b.useState(!1),{isInteractive:v,minZoomReached:j,maxZoomReached:p}=Fe(O4,mt),{zoomIn:m,zoomOut:y,fitView:g}=Oc();if(b.useEffect(()=>{w(!0)},[]),!x)return null;const N=()=>{m(),i==null||i()},E=()=>{y(),o==null||o()},P=()=>{g(s),l==null||l()},M=()=>{h.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)};return O.createElement(Qv,{className:pt(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls"},t&&O.createElement(O.Fragment,null,O.createElement(wa,{onClick:N,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p},O.createElement(z4,null)),O.createElement(wa,{onClick:E,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:j},O.createElement($4,null))),n&&O.createElement(wa,{className:"react-flow__controls-fitview",onClick:P,title:"fit view","aria-label":"fit view"},O.createElement(T4,null)),r&&O.createElement(wa,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity"},v?O.createElement(D4,null):O.createElement(R4,null)),f)};O1.displayName="Controls";var A4=b.memo(O1),At;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(At||(At={}));function F4({color:e,dimensions:t,lineWidth:n}){return O.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function L4({color:e,radius:t}){return O.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const I4={[At.Dots]:"#91919a",[At.Lines]:"#eee",[At.Cross]:"#e2e2e2"},U4={[At.Dots]:1,[At.Lines]:1,[At.Cross]:6},B4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function A1({id:e,variant:t=At.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:o,style:l,className:c}){const u=b.useRef(null),{transform:f,patternId:d}=Fe(B4,mt),h=o||I4[t],x=r||U4[t],w=t===At.Dots,v=t===At.Cross,j=Array.isArray(n)?n:[n,n],p=[j[0]*f[2]||1,j[1]*f[2]||1],m=x*f[2],y=v?[m,m]:p,g=w?[m/i,m/i]:[y[0]/i,y[1]/i];return O.createElement("svg",{className:pt(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},O.createElement("pattern",{id:d+e,x:f[0]%p[0],y:f[1]%p[1],width:p[0],height:p[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${g[0]},-${g[1]})`},w?O.createElement(L4,{color:h,radius:m/i}):O.createElement(F4,{dimensions:y,color:h,lineWidth:s})),O.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+e})`}))}A1.displayName="Background";var F1=b.memo(A1),mi;(function(e){e.Line="line",e.Handle="handle"})(mi||(mi={}));function H4({width:e,prevWidth:t,height:n,prevHeight:r,invertX:s,invertY:i}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}const L1={width:0,height:0,x:0,y:0},V4={...L1,pointerX:0,pointerY:0,aspectRatio:1};function W4({nodeId:e,position:t,variant:n=mi.Handle,className:r,style:s={},children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:h,onResizeStart:x,onResize:w,onResizeEnd:v}){const j=t1(),p=typeof e=="string"?e:j,m=Xe(),y=b.useRef(null),g=b.useRef(V4),N=b.useRef(L1),E=S1(),P=n===mi.Line?"right":"bottom-right",M=t??P;b.useEffect(()=>{if(!y.current||!p)return;const U=Qt(y.current),H=M.includes("right")||M.includes("left"),S=M.includes("bottom")||M.includes("top"),D=M.includes("left"),T=M.includes("top"),I=zv().on("start",C=>{const k=m.getState().nodeInternals.get(p),{xSnapped:z,ySnapped:A}=E(C);N.current={width:(k==null?void 0:k.width)??0,height:(k==null?void 0:k.height)??0,x:(k==null?void 0:k.position.x)??0,y:(k==null?void 0:k.position.y)??0},g.current={...N.current,pointerX:z,pointerY:A,aspectRatio:N.current.width/N.current.height},x==null||x(C,{...N.current})}).on("drag",C=>{const{nodeInternals:k,triggerNodeChanges:z}=m.getState(),{xSnapped:A,ySnapped:F}=E(C),Q=k.get(p);if(Q){const W=[],{pointerX:Z,pointerY:re,width:ie,height:de,x:je,y:xe,aspectRatio:Ne}=g.current,{x:Qe,y:lt,width:rt,height:_e}=N.current,st=Math.floor(H?A-Z:0),ye=Math.floor(S?F-re:0);let q=Ir(ie+(D?-st:st),l,u),ge=Ir(de+(T?-ye:ye),c,f);if(d){const le=q/ge,$e=H&&S,Le=H&&!S,ke=S&&!H;q=le<=Ne&&$e||ke?ge*Ne:q,ge=le>Ne&&$e||Le?q/Ne:ge,q>=u?(q=u,ge=u/Ne):q<=l&&(q=l,ge=l/Ne),ge>=f?(ge=f,q=f*Ne):ge<=c&&(ge=c,q=c*Ne)}const zt=q!==rt,en=ge!==_e;if(D||T){const le=D?je-(q-ie):je,$e=T?xe-(ge-de):xe,Le=le!==Qe&&zt,ke=$e!==lt&&en;if(Le||ke){const we={id:Q.id,type:"position",position:{x:Le?le:Qe,y:ke?$e:lt}};W.push(we),N.current.x=we.position.x,N.current.y=we.position.y}}if(zt||en){const le={id:p,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:q,height:ge}};W.push(le),N.current.width=q,N.current.height=ge}if(W.length===0)return;const B=H4({width:N.current.width,prevWidth:rt,height:N.current.height,prevHeight:_e,invertX:D,invertY:T}),Y={...N.current,direction:B};if((h==null?void 0:h(C,Y))===!1)return;w==null||w(C,Y),z(W)}}).on("end",C=>{const k={id:p,type:"dimensions",resizing:!1};v==null||v(C,{...N.current}),m.getState().triggerNodeChanges([k])});return U.call(I),()=>{U.on(".drag",null)}},[p,M,l,c,u,f,d,E,x,w,v]);const $=M.split("-"),R=n===mi.Line?"borderColor":"backgroundColor",L=o?{...s,[R]:o}:s;return O.createElement("div",{className:pt(["react-flow__resize-control","nodrag",...$,n,r]),ref:y,style:L},i)}var Ex=b.memo(W4);const Q4=["top-left","top-right","bottom-left","bottom-right"],K4=["top","right","bottom","left"];function q4({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:s,lineStyle:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:h,onResizeStart:x,onResize:w,onResizeEnd:v}){return t?O.createElement(O.Fragment,null,K4.map(j=>O.createElement(Ex,{key:j,className:s,style:i,nodeId:e,position:j,variant:mi.Line,color:o,minWidth:l,minHeight:c,maxWidth:u,maxHeight:f,onResizeStart:x,keepAspectRatio:d,shouldResize:h,onResize:w,onResizeEnd:v})),Q4.map(j=>O.createElement(Ex,{key:j,className:n,style:r,nodeId:e,position:j,color:o,minWidth:l,minHeight:c,maxWidth:u,maxHeight:f,onResizeStart:x,keepAspectRatio:d,shouldResize:h,onResize:w,onResizeEnd:v}))):null}function G4({data:e}){return a.jsxs(a.Fragment,{children:[a.jsx(q4,{isVisible:e.selected,minWidth:168,minHeight:72,lineClassName:"!border-primary",handleClassName:"!h-2 !w-2 !rounded-[2px] !border-primary !bg-surface-1"}),a.jsxs("div",{className:"group flex h-full w-full flex-col overflow-hidden rounded-card border bg-surface-1 shadow-card",style:{borderColor:e.selected?"var(--primary)":"var(--border)",boxShadow:e.selected?"0 0 0 2px var(--primary), var(--shadow-lift)":void 0},children:[a.jsx(Ur,{type:"target",position:J.Left,className:"!h-3.5 !w-3.5 !border-2 !border-surface-1 !bg-border-strong hover:!bg-primary"}),a.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border bg-surface-2 px-2.5 py-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate font-display text-sm font-semibold tracking-tight text-text",children:e.label}),e.intervened&&a.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-primary",title:"intervened (do)",children:[a.jsx(O0,{size:10})," do"]}),a.jsx("button",{title:"Delete column",onClick:t=>{t.stopPropagation(),e.onDelete()},className:"rounded p-0.5 text-text-faint opacity-0 transition-opacity hover:bg-hazard-tint hover:text-hazard group-hover:opacity-100",children:a.jsx(tr,{size:12})})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-2.5 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yo,{type:e.ftype}),a.jsx("span",{className:"text-[10px] uppercase tracking-wide text-text-faint",children:e.derived?"derived":"root"})]}),a.jsx(jh,{failures:e.failures,column:e.label,className:"mt-1.5"}),e.rows.length>0&&a.jsx("dl",{className:"mt-1.5 space-y-0.5",children:e.rows.map((t,n)=>a.jsxs("div",{className:"flex items-start justify-between gap-2 text-[11px] leading-snug",children:[a.jsx("dt",{className:"shrink-0 text-text-faint",children:t.label}),a.jsx("dd",{className:"break-words text-right font-mono",style:{color:t.tone==="accent"?"var(--primary)":"var(--text-muted)"},children:t.value})]},n))})]}),a.jsx(Ur,{type:"source",position:J.Right,className:"!h-3.5 !w-3.5 !border-2 !border-surface-1 !bg-primary hover:!scale-125"})]})]})}const X4={feature:G4};function Y4(){const{zoomIn:e,zoomOut:t,fitView:n}=Oc();return a.jsxs("div",{className:"absolute bottom-3 right-3 z-10 flex flex-col overflow-hidden rounded-control border border-border bg-surface-1 shadow-card",children:[a.jsx(_u,{title:"Zoom in",onClick:()=>e({duration:150}),children:a.jsx(K0,{size:15})}),a.jsx(_u,{title:"Zoom out",onClick:()=>t({duration:150}),children:a.jsx(q0,{size:15})}),a.jsx(_u,{title:"Reset view",onClick:()=>n({duration:200,padding:.2}),children:a.jsx(B0,{size:14})})]})}function _u({children:e,onClick:t,title:n}){return a.jsx("button",{title:n,onClick:t,onPointerDown:r=>r.stopPropagation(),className:"flex h-8 w-8 items-center justify-center border-b border-border text-text-muted last:border-b-0 hover:bg-surface-2 hover:text-text",children:e})}function Z4({fromX:e,fromY:t,toX:n,toY:r}){const s=Math.atan2(r-t,n-e),i=7;return a.jsxs("g",{children:[a.jsx("path",{d:`M${e},${t} C ${e+70},${t} ${n-70},${r} ${n},${r}`,stroke:"var(--primary)",strokeWidth:2,fill:"none",strokeDasharray:"6 4"}),a.jsx("polygon",{points:`0,0 ${-i*1.4},${-i*.7} ${-i*1.4},${i*.7}`,transform:`translate(${n},${r}) rotate(${s*180/Math.PI})`,fill:"var(--primary)"})]})}function J4({spec:e,datasetId:t,selection:n,onSelect:r,onCausalChange:s,onDeleteColumn:i}){const o=b.useMemo(()=>Nh(e),[e]),l=b.useMemo(()=>Object.keys(e.features),[e]),[c,u]=b.useState(null),[f,d,h]=P4([]),x=b.useRef(Li(t,"graph-nodes",{}));b.useEffect(()=>{if(!c)return;const g=window.setTimeout(()=>u(null),2600);return()=>window.clearTimeout(g)},[c]);const w=b.useMemo(()=>cv(o),[o]),v=b.useMemo(()=>Mc(o),[o]);b.useEffect(()=>{d(g=>{const N=new Map(g.map(M=>[M.id,M])),E=dv(l,o.edges),P={};return l.map(M=>{const $=N.get(M),R=x.current[M],L=E[M]??0,U=P[L]??0;P[L]=U+1;const H=R?{x:R.x,y:R.y}:{x:L*300+24,y:U*184+24};return{id:M,type:"feature",position:($==null?void 0:$.position)??H,width:($==null?void 0:$.width)??(R==null?void 0:R.width),style:($==null?void 0:$.style)??(R!=null&&R.width?{width:R.width}:{width:216}),draggable:!0,data:{label:M,ftype:e.features[M].type,derived:w.has(M),intervened:M in v,selected:(n==null?void 0:n.kind)==="node"&&n.name===M,rows:[...kh(e.features[M]),...mv(o,M)],failures:e.failures,onDelete:()=>i(M)}}})})},[e,o,w,v,n,l]),b.useEffect(()=>{if(f.length===0)return;const g=window.setTimeout(()=>{const N={};for(const E of f)N[E.id]={x:E.position.x,y:E.position.y,width:E.width??void 0};x.current=N,ql(t,"graph-nodes",N)},400);return()=>window.clearTimeout(g)},[f,t]);const j=b.useMemo(()=>o.edges.map((g,N)=>{const E=g.to in v,P=(n==null?void 0:n.kind)==="edge"&&n.index===N;return{id:`e${N}`,source:g.from,target:g.to,label:hv(g),type:"smoothstep",animated:!E,updatable:!0,selected:P,style:{stroke:P?"var(--primary)":"var(--border-strong)",strokeWidth:P?2.5:1.5,strokeDasharray:E?"4 3":void 0,opacity:E?.45:1},labelStyle:{fontSize:10,fill:"var(--text-muted)",fontWeight:500},labelBgStyle:{fill:"var(--surface-1)",fillOpacity:.92},labelBgPadding:[4,2],labelBgBorderRadius:4,markerEnd:{type:Bi.ArrowClosed,color:P?"var(--primary)":"var(--border-strong)"}}}),[o.edges,v,n]);function p(g,N){return g===N?(u("A feature can't depend on itself."),!1):o.edges.some(E=>E.from===g&&E.to===N)?(u(`${g} → ${N} already exists.`),!1):Dp(o.edges,g,N)?(u(`${g} → ${N} would create a cycle — rejected.`),!1):!0}function m(g){if(!g.source||!g.target||!p(g.source,g.target))return;const N=JS(g.source,g.target,e.features[g.source]),E={...o,edges:[...o.edges,N]};s(E),r({kind:"edge",index:E.edges.length-1})}function y(g,N){if(!N.source||!N.target)return;const E=Number(g.id.slice(1)),P=o.edges.filter(($,R)=>R!==E);if(N.source===N.target)return u("A feature can't depend on itself.");if(P.some($=>$.from===N.source&&$.to===N.target))return u(`${N.source} → ${N.target} already exists.`);if(Dp(P,N.source,N.target))return u(`${N.source} → ${N.target} would create a cycle — rejected.`);const M={...o.edges[E],from:N.source,to:N.target};s({...o,edges:o.edges.map(($,R)=>R===E?M:$)})}return l.length<2?a.jsx("div",{className:"dotgrid flex h-full items-center justify-center bg-bg p-10 text-center text-text-faint",children:a.jsxs("div",{className:"max-w-xs",children:[a.jsx("p",{className:"font-display text-lg font-semibold text-text-muted",children:"Wire up causality"}),a.jsx("p",{className:"mt-1 text-sm",children:"Add at least two columns (in Table view) to draw dependencies between them."})]})}):a.jsxs("div",{className:"relative h-full bg-bg",children:[c&&a.jsx("div",{className:"absolute left-1/2 top-3 z-10 -translate-x-1/2 animate-slide-up rounded-pill border border-hazard bg-hazard-tint px-3 py-1.5 text-xs text-hazard shadow-card",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(go,{size:13})," ",c]})}),a.jsxs(Bh,{nodes:f,edges:j,nodeTypes:X4,onNodesChange:h,onConnect:m,onEdgeUpdate:y,connectionLineComponent:Z4,onNodeClick:(g,N)=>r({kind:"node",name:N.id}),onEdgeClick:(g,N)=>r({kind:"edge",index:Number(N.id.slice(1))}),onPaneClick:()=>r(null),fitView:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[a.jsx(F1,{variant:At.Dots,gap:22,size:1,color:"var(--border)"}),a.jsx(Y4,{})]}),a.jsx("div",{className:"pointer-events-none absolute bottom-3 left-3 text-xs italic text-text-faint",children:"Drag a node to move it · drag its right dot to another node to link · drag an edge end to reconnect."})]})}function eM({spec:e,causal:t,selection:n,onCausalChange:r,onSelect:s}){return n?n.kind==="edge"?a.jsx(tM,{spec:e,causal:t,index:n.index,onCausalChange:r,onSelect:s}):a.jsx(sM,{spec:e,causal:t,name:n.name,onCausalChange:r}):a.jsxs("div",{className:"p-6 text-sm text-text-faint",children:[a.jsx(se,{children:"Causal inspector"}),a.jsx("p",{className:"mt-3 text-text-muted",children:"Drag from one column's handle to another to add a dependency. Click an edge to choose its structural function, or click a node to add noise or an intervention."})]})}function pi({label:e,children:t}){return a.jsxs("label",{className:"mb-3 block",children:[a.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function rc({value:e,onChange:t,placeholder:n}){return a.jsx("input",{type:"number",value:e??"",placeholder:n,onChange:r=>t(Number(r.target.value)),className:"mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}function tM({spec:e,causal:t,index:n,onCausalChange:r,onSelect:s}){const i=t.edges[n];if(!i)return null;const o=e.features[i.from];function l(d){const h=t.edges.map((x,w)=>w===n?{...x,...d}:x);r({...t,edges:h})}function c(d){const h={from:i.from,to:i.to,fn:d};if(d==="linear"||d==="logistic")h.weight=i.weight??1,h.bias=i.bias??0;else if(d==="polynomial")h.coeffs=i.coeffs??[0,1];else if(d==="map"){const w={};((o==null?void 0:o.type)==="categorical"?o.categories??[]:[]).forEach((v,j)=>{var p;return w[v]=((p=i.mapping)==null?void 0:p[v])??j}),h.mapping=w}const x=t.edges.map((w,v)=>v===n?h:w);r({...t,edges:x})}function u(){r({...t,edges:t.edges.filter((d,h)=>h!==n)}),s(null)}const f=!eC(i.fn,o);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-border p-4",children:[a.jsx(se,{children:"Edge"}),a.jsxs("div",{className:"mt-1 flex items-center gap-2 font-display text-lg font-semibold",children:[a.jsx("span",{children:i.from}),a.jsx("span",{className:"text-text-faint",children:"→"}),a.jsx("span",{children:i.to})]}),o&&a.jsxs("div",{className:"mt-1",children:[a.jsx("span",{className:"text-xs text-text-faint",children:"parent is "}),a.jsx(yo,{type:o.type})]})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[a.jsx(pi,{label:"Structural function",children:a.jsx("select",{value:i.fn,onChange:d=>c(d.target.value),className:"mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:XS.map(d=>a.jsx("option",{value:d,children:d},d))})}),f&&a.jsx("div",{className:"mb-3 rounded-control border border-hazard bg-hazard-tint px-3 py-2 text-xs text-hazard",children:i.fn==="map"?"map needs a categorical parent.":`${i.fn} needs a numeric/boolean parent — use 'map' for categorical.`}),(i.fn==="linear"||i.fn==="logistic")&&a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(pi,{label:"weight",children:a.jsx(rc,{value:i.weight??void 0,onChange:d=>l({weight:d})})}),a.jsx(pi,{label:"bias",children:a.jsx(rc,{value:i.bias??void 0,onChange:d=>l({bias:d})})})]}),i.fn==="logistic"&&a.jsx("p",{className:"mb-3 text-xs italic text-text-faint",children:"σ(weight·parent + bias) → a probability; a boolean child is then a Bernoulli draw."}),i.fn==="polynomial"&&a.jsx(nM,{coeffs:i.coeffs??[0,1],onChange:d=>l({coeffs:d})}),i.fn==="map"&&a.jsx(rM,{mapping:i.mapping??{},categories:(o==null?void 0:o.type)==="categorical"?o.categories??[]:[],onChange:d=>l({mapping:d})}),i.fn==="identity"&&a.jsx("p",{className:"text-sm text-text-muted",children:"Pass-through: the child gets the parent's value."}),a.jsxs("button",{onClick:u,className:"mt-4 inline-flex items-center gap-1.5 text-xs text-text-faint hover:text-hazard",children:[a.jsx(tr,{size:14})," Delete edge"]})]})]})}function nM({coeffs:e,onChange:t}){return a.jsxs("div",{children:[a.jsx(se,{children:"Coefficients · Σ cᵢ·parentⁱ"}),a.jsx("div",{className:"mt-2 space-y-1.5",children:e.map((n,r)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"w-12 font-mono text-[11px] text-text-faint",children:["c",r," (x^",r,")"]}),a.jsx("input",{type:"number",value:n,onChange:s=>{const i=[...e];i[r]=Number(s.target.value),t(i)},className:"flex-1 rounded-control border border-border bg-surface-2 px-2 py-1 font-mono text-xs outline-none focus:border-primary"}),a.jsx("button",{onClick:()=>t(e.filter((s,i)=>i!==r)),className:"text-text-faint hover:text-hazard",children:a.jsx(Sn,{size:14})})]},r))}),a.jsxs("button",{onClick:()=>t([...e,0]),className:"mt-2 inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[a.jsx(Ms,{size:13})," Add term"]})]})}function rM({mapping:e,categories:t,onChange:n}){return t.length===0?a.jsx("p",{className:"text-xs italic text-text-faint",children:"Parent has no categories to map."}):a.jsxs("div",{children:[a.jsx(se,{children:"Category → contribution"}),a.jsx("div",{className:"mt-2 space-y-1.5",children:t.map(r=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-24 truncate font-mono text-xs text-text-muted",children:r}),a.jsx("input",{type:"number",value:e[r]??0,onChange:s=>n({...e,[r]:Number(s.target.value)}),className:"flex-1 rounded-control border border-border bg-surface-2 px-2 py-1 font-mono text-xs outline-none focus:border-primary"})]},r))})]})}function sM({spec:e,causal:t,name:n,onCausalChange:r}){var f;const s=e.features[n],i=uv(t,n).length>0,o=((f=t.noise)==null?void 0:f[n])??{dist:"none"},l=Mc(t),c=n in l;function u(d){const h={...t.noise??{}};d.dist==="none"?h[n]={dist:"none"}:h[n]=d,r({...t,noise:h})}return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-border p-4",children:[a.jsx(se,{children:"Node"}),a.jsx("div",{className:"mt-1 font-display text-xl font-semibold tracking-tight",children:n}),a.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s&&a.jsx(yo,{type:s.type}),a.jsx("span",{className:"text-[11px] text-text-faint",children:i?"derived":"root (sampled)"})]})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[i?a.jsxs(a.Fragment,{children:[a.jsx(pi,{label:"Node noise ε",children:a.jsx("select",{value:o.dist,onChange:d=>u(d.target.value==="none"?{dist:"none"}:{dist:d.target.value,params:_c[d.target.value]??{}}),className:"mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:YS.map(d=>a.jsx("option",{value:d,children:d},d))})}),o.dist!=="none"&&o.params&&a.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(o.params).map(d=>a.jsx(pi,{label:d,children:a.jsx(rc,{value:o.params[d],onChange:h=>u({dist:o.dist,params:{...o.params,[d]:h}})})},d))})]}):a.jsx("p",{className:"mb-4 text-sm text-text-muted",children:"This is a root feature — its distribution is edited in the Table view's Inspector. Add an incoming edge to make it derived."}),a.jsxs("div",{className:"mt-2 border-t border-border pt-4",children:[a.jsxs(se,{children:["Intervention · do(",n,")"]}),a.jsxs("label",{className:"mt-2 flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:c,onChange:d=>r(Ap(t,n,d.target.checked?0:null)),className:"accent-[var(--primary)]"}),"Fix this node to a constant (detach its parents)"]}),c&&a.jsx(pi,{label:"value",children:a.jsx(rc,{value:l[n],onChange:d=>r(Ap(t,n,d))})})]})]})]})}function iM({spec:e,selected:t,onSelect:n,onChange:r,exportInjected:s,onExportInjected:i}){const o=e.failures??[];function l(f){const d=[...o,VS(f,e)];r(d),n(d.length-1)}function c(f){r(o.filter((d,h)=>h!==f)),n(null)}function u(f,d){const h=f+d;if(h<0||h>=o.length)return;const x=[...o];[x[f],x[h]]=[x[h],x[f]],r(x),n(h)}return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"mx-auto max-w-2xl px-6 py-7",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx(se,{children:"Failure pipeline"}),a.jsx("h2",{className:"mt-1.5 font-display text-2xl font-semibold tracking-tight",children:"Inject realistic data quality failures"}),a.jsx("p",{className:"mt-2 max-w-lg text-sm text-text-muted",children:"Corruptions apply in order, after a pristine baseline is captured. The clean dataset is always preserved alongside the injected one."})]}),a.jsx(I1,{onAdd:l})]}),a.jsxs("div",{className:"mt-5 flex items-center gap-2.5 rounded-control border border-success bg-success-tint px-3.5 py-2.5 text-sm text-success",children:[a.jsx(Sk,{size:16,className:"shrink-0"}),a.jsxs("span",{children:["The ",a.jsx("strong",{children:"clean"})," baseline is never modified — every failure runs on a copy, so you can always compare against the uncorrupted data."]})]}),o.length===0?a.jsx(oM,{onAdd:l}):a.jsxs(a.Fragment,{children:[a.jsx("ol",{className:"mt-5 space-y-2.5",children:o.map((f,d)=>a.jsx(aM,{failure:f,index:d,total:o.length,active:t===d,rows:e.rows,error:lv(f,e),onSelect:()=>n(d),onMove:h=>u(d,h),onRemove:()=>c(d)},d))}),a.jsxs("label",{className:"mt-5 flex cursor-pointer items-start gap-2.5 rounded-control border border-border bg-surface-1 px-3.5 py-3",children:[a.jsx("input",{type:"checkbox",checked:s,onChange:f=>i(f.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--primary)]"}),a.jsxs("span",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-text",children:"Export the corrupted variant"}),a.jsxs("span",{className:"mt-0.5 block text-xs text-text-faint",children:["Writes ",a.jsx("span",{className:"font-mono",children:"data.injected.csv"})," next to the clean output, and unlocks the clean-vs-injected Comparison in Results. Recommended."]})]})]})]})]})})}function aM({failure:e,index:t,total:n,active:r,rows:s,error:i,onSelect:o,onMove:l,onRemove:c}){const u=Ps[e.type],f=ov(e,s);return a.jsx("li",{onClick:o,className:ee("ring-focus group relative cursor-pointer rounded-card border bg-surface-1 p-3.5 shadow-card transition-all",r?"border-primary ring-1 ring-primary":"border-border hover:border-border-strong"),children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex flex-col items-center gap-0.5",children:a.jsx("span",{className:"font-mono text-[11px] text-text-faint tnum",children:t+1})}),a.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-control",style:{color:u.accent,background:`color-mix(in srgb, ${u.accent} 14%, transparent)`},children:a.jsx(wo,{type:e.type,size:17})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"truncate font-medium text-text",children:u.label}),i&&a.jsx("span",{title:i,className:"shrink-0 text-warning",children:a.jsx(go,{size:13})})]}),a.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-text-muted",children:QS(e)})]}),f.metric&&a.jsx("span",{className:"hidden shrink-0 rounded-pill px-2 py-0.5 font-mono text-[11px] font-semibold sm:inline",style:{color:u.accent,background:`color-mix(in srgb, ${u.accent} 12%, transparent)`},children:f.metric}),a.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",onClick:d=>d.stopPropagation(),children:[a.jsx("button",{disabled:t===0,onClick:()=>l(-1),title:"Move earlier",className:"ring-focus rounded p-1 text-text-faint hover:bg-surface-2 hover:text-text disabled:opacity-30",children:a.jsx(GN,{size:15})}),a.jsx("button",{disabled:t===n-1,onClick:()=>l(1),title:"Move later",className:"ring-focus rounded p-1 text-text-faint hover:bg-surface-2 hover:text-text disabled:opacity-30",children:a.jsx(R0,{size:15})}),a.jsx("button",{onClick:c,title:"Remove",className:"ring-focus rounded p-1 text-text-faint hover:bg-hazard-tint hover:text-hazard",children:a.jsx(tr,{size:14})})]})]})})}function I1({onAdd:e}){return a.jsx(Cc,{align:"right",trigger:({toggle:t})=>a.jsxs(me,{variant:"primary",onClick:t,children:[a.jsx(Ms,{size:15})," Add failure"]}),children:t=>a.jsx("div",{className:"w-[270px]",children:HS.map(n=>a.jsxs("div",{className:"mb-1 last:mb-0",children:[a.jsx("div",{className:"px-2.5 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-wider text-text-faint",children:n}),BS.filter(r=>Ps[r].category===n).map(r=>{const s=Ps[r];return a.jsx(ws,{icon:a.jsx("span",{style:{color:s.accent},children:a.jsx(wo,{type:r,size:15})}),onClick:()=>{e(r),t()},children:a.jsx("span",{title:s.blurb,className:"block truncate whitespace-nowrap text-text",children:s.label})},r)})]},n))})})}function oM({onAdd:e}){return a.jsxs("div",{className:"dotgrid mt-5 flex flex-col items-center justify-center rounded-card border border-dashed border-border p-12 text-center",children:[a.jsx("span",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-faint",children:a.jsx(gh,{size:22})}),a.jsx("h3",{className:"mt-4 font-display text-xl font-semibold",children:"No failures yet"}),a.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-text-muted",children:"Add missingness, label/feature noise, distribution drift, or a leakage trap to stress-test models against realistic, imperfect data."}),a.jsx("div",{className:"mt-5",children:a.jsx(I1,{onAdd:e})})]})}function lM({failure:e,index:t,spec:n,onChange:r,onDelete:s}){const i=Ps[e.type],o=wh(n),l=ov(e,n.rows),c=lv(e,n);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-border p-4",children:[a.jsxs(se,{children:["Failure step ",t+1]}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2.5",children:[a.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-control",style:{color:i.accent,background:`color-mix(in srgb, ${i.accent} 14%, transparent)`},children:a.jsx(wo,{type:e.type,size:16})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-display text-lg font-semibold leading-tight",children:i.label}),a.jsx("div",{className:"text-[11px] font-medium",style:{color:i.accent},children:i.category})]})]}),a.jsx("p",{className:"mt-2.5 text-xs leading-relaxed text-text-muted",children:i.blurb})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[a.jsx(uM,{failure:e,kinds:o,onChange:r}),a.jsxs("div",{className:"mt-4 rounded-control border border-border bg-surface-2 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(se,{children:"Estimated impact"}),l.metric&&a.jsx("span",{className:"rounded-pill px-2 py-0.5 font-mono text-[11px] font-semibold",style:{color:i.accent,background:`color-mix(in srgb, ${i.accent} 12%, transparent)`},children:l.metric})]}),a.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-text-muted",children:l.line}),a.jsx("p",{className:"mt-2 border-t border-border pt-2 font-mono text-[10.5px] leading-relaxed text-text-faint",children:i.math})]}),c&&a.jsx("div",{className:"mt-3 rounded-control border border-warning bg-warning-tint px-3 py-2 text-xs text-warning",children:c})]}),a.jsx("div",{className:"border-t border-border p-4",children:a.jsxs("button",{onClick:s,className:"ring-focus inline-flex items-center gap-1.5 rounded-control px-2 py-1.5 text-xs font-medium text-text-faint transition-colors hover:bg-hazard-tint hover:text-hazard",children:[a.jsx(tr,{size:14})," Remove step"]})})]})}function Ze({label:e,children:t,hint:n}){return a.jsxs("label",{className:"mb-3 block",children:[a.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t,n&&a.jsx("span",{className:"mt-1 block text-[11px] text-text-faint",children:n})]})}function fa({value:e,onChange:t,placeholder:n,step:r}){return a.jsx("input",{type:"number",step:r,value:e??"",placeholder:n,onChange:s=>t(s.target.value===""?void 0:Number(s.target.value)),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}function Pn({value:e,options:t,onChange:n,placeholder:r}){return a.jsxs("select",{value:e??"",onChange:s=>n(s.target.value),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:[r&&a.jsx("option",{value:"",disabled:!0,children:r}),t.map(s=>a.jsx("option",{value:s,children:s},s))]})}function Yr({label:e,value:t,min:n,max:r,step:s,onChange:i}){return a.jsx(Ze,{label:e,children:a.jsx("input",{type:"range",min:n,max:r,step:s,value:t,onChange:o=>i(Number(o.target.value)),className:"mt-2 w-full accent-[var(--primary)]"})})}function cM({selected:e,options:t,onToggle:n}){return t.length===0?a.jsx("p",{className:"mt-1 text-xs text-text-faint",children:"No columns available."}):a.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:t.map(r=>{const s=e.includes(r);return a.jsx("button",{onClick:()=>n(r),className:ee("ring-focus rounded-pill border px-2.5 py-1 text-xs font-medium transition-colors",s?"border-primary bg-primary-tint text-primary":"border-border text-text-muted hover:border-border-strong hover:text-text"),children:r},r)})})}function uM({failure:e,kinds:t,onChange:n}){const r=`${Math.round((e.rate??0)*100)}%`;switch(e.type){case"mcar":return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Columns to blank",children:a.jsx(cM,{selected:e.columns??[],options:t.all,onToggle:s=>{const i=new Set(e.columns??[]);i.has(s)?i.delete(s):i.add(s),n({...e,columns:t.all.filter(o=>i.has(o))})}})}),a.jsx(Yr,{label:`Missing rate · ${r}`,value:e.rate??0,min:0,max:1,step:.01,onChange:s=>n({...e,rate:s})})]});case"mar":return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Column to make missing",children:a.jsx(Pn,{value:e.column,options:t.all,onChange:s=>n({...e,column:s}),placeholder:"Select a column"})}),a.jsx(Ze,{label:"Driver (observed)",hint:"Missingness rises with this column. Must be numeric or boolean.",children:a.jsx(Pn,{value:e.driver,options:t.numericOrBool,onChange:s=>n({...e,driver:s}),placeholder:"Select a driver"})}),a.jsx(Yr,{label:`Missing rate · ${r}`,value:e.rate??0,min:0,max:1,step:.01,onChange:s=>n({...e,rate:s})}),a.jsx(Yr,{label:`Dependence strength · ${(e.strength??2).toFixed(1)}`,value:e.strength??2,min:0,max:6,step:.5,onChange:s=>n({...e,strength:s})})]});case"mnar":return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Column (drives its own missingness)",children:a.jsx(Pn,{value:e.column,options:t.numericOrBool,onChange:s=>n({...e,column:s}),placeholder:"Select a column"})}),a.jsx(Yr,{label:`Missing rate · ${r}`,value:e.rate??0,min:0,max:1,step:.01,onChange:s=>n({...e,rate:s})}),a.jsx(Yr,{label:`Dependence strength · ${(e.strength??2).toFixed(1)}`,value:e.strength??2,min:0,max:6,step:.5,onChange:s=>n({...e,strength:s})})]});case"label_noise":return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Label column",hint:"Boolean or categorical.",children:a.jsx(Pn,{value:e.column,options:t.labelable,onChange:s=>n({...e,column:s}),placeholder:"Select a column"})}),a.jsx(Yr,{label:`Flip rate · ${r}`,value:e.rate??0,min:0,max:1,step:.01,onChange:s=>n({...e,rate:s})})]});case"feature_noise":{const s=e.params??{};return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Numeric column",children:a.jsx(Pn,{value:e.column,options:t.numeric,onChange:i=>n({...e,column:i}),placeholder:"Select a column"})}),a.jsx(Ze,{label:"Noise distribution",children:a.jsx(Pn,{value:e.dist,options:iv,onChange:i=>n({...e,dist:i,params:_c[i]})})}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(s).map(i=>a.jsx(Ze,{label:i,children:a.jsx(fa,{value:s[i],onChange:o=>n({...e,params:{...s,[i]:o??0}})})},i))})]})}case"drift":{const s=e.schedule??{kind:"linear"};return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Numeric column",children:a.jsx(Pn,{value:e.column,options:t.numeric,onChange:i=>n({...e,column:i}),placeholder:"Select a column"})}),a.jsx(Ze,{label:"Schedule",children:a.jsx("div",{className:"mt-1 inline-flex rounded-control border border-border p-0.5",children:["linear","step"].map(i=>a.jsx("button",{onClick:()=>n({...e,schedule:{...s,kind:i}}),className:ee("ring-focus rounded-[7px] px-3 py-1 text-xs capitalize",(s.kind??"linear")===i?"bg-primary-tint text-primary":"text-text-muted"),children:i},i))})}),a.jsx(Ze,{label:"Total shift (magnitude)",hint:"Amount added by the last row.",children:a.jsx(fa,{value:s.magnitude,onChange:i=>n({...e,schedule:{...s,magnitude:i}})})}),(s.kind??"linear")==="step"&&a.jsx(Ze,{label:"Step at (fraction of rows)",children:a.jsx(fa,{value:s.at??.5,step:.05,onChange:i=>n({...e,schedule:{...s,at:i}})})})]})}case"covariate_shift":{const s=vo(e);return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Numeric column",children:a.jsx(Pn,{value:e.column,options:t.numeric,onChange:i=>n({...e,column:i}),placeholder:"Select a column"})}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ze,{label:"target mean",children:a.jsx(fa,{value:s.mean,placeholder:"—",onChange:i=>n({...e,target:{...s,mean:i}})})}),a.jsx(Ze,{label:"target std",hint:"optional",children:a.jsx(fa,{value:s.std,placeholder:"keep",onChange:i=>n({...e,target:{...s,std:i}})})})]})]})}case"leakage":{const s=e.noise??.05,i=1/Math.sqrt(1+s*s);return a.jsxs(a.Fragment,{children:[a.jsx(Ze,{label:"Target to leak",hint:"Numeric or boolean label.",children:a.jsx(Pn,{value:Gi(e),options:t.numericOrBool,onChange:o=>n({...e,target:o}),placeholder:"Select a target"})}),a.jsx(Ze,{label:"Planted column name",children:a.jsx("input",{value:e.into??"",onChange:o=>n({...e,into:o.target.value}),spellCheck:!1,placeholder:"leak",className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}),a.jsx(Yr,{label:`Proxy noise · ${s.toFixed(2)} → corr ${i.toFixed(3)}`,value:s,min:.01,max:.5,step:.01,onChange:o=>n({...e,noise:o})})]})}}}const Ac=[{tier:"beginner",label:"Beginner",band:[.9,.99],blurb:"Almost separable — a baseline aces it."},{tier:"intermediate",label:"Intermediate",band:[.8,.9],blurb:"Clear signal with real overlap."},{tier:"advanced",label:"Advanced",band:[.72,.8],blurb:"Hard — strong probes only edge ahead."},{tier:"kaggle",label:"Kaggle",band:[.62,.72],blurb:"Brutal — near the noise floor."}],dM=Object.fromEntries(Ac.map(e=>[e.tier,e])),fM=[{value:"logreg",label:"Logistic regression",blurb:"Linear baseline — the default."},{value:"tree",label:"Decision tree",blurb:"Captures simple non-linear splits."}],_x={noise:{label:"Feature noise",blurb:"Adds Gaussian observation noise to numeric predictors. Primary lever; leaves the causal graph intact."},label_noise:{label:"Label flips",blurb:"Flips a fraction of the label. Deep-end lever, engaged only when feature noise saturates."}},Hh=["noise","label_noise"];function U1(e){return e.emit===!1?!1:e.type==="boolean"||e.type==="categorical"&&e.categories.length===2}function B1(e){return Object.entries(e.features).filter(([,t])=>U1(t)).map(([t])=>t)}function Vh(e){return typeof e=="string"}function hM(e){return Vh(e)?dM[e].band:e.band}function mM(e){const t=B1(e);return t.length===0?null:{target:"advanced",label:t[0],probe:"logreg",max_iters:8,knobs:[...Hh]}}function pM(e,t){const n=t.features[e.label];if(!n)return`Label "${e.label}" is not a column.`;if(!U1(n))return`Label "${e.label}" must be boolean or a 2-class categorical (binary classification).`;if(!Vh(e.target)){const[r,s]=e.target.band;if(!(r>=0&&r<=s&&s<=1))return"Custom band must satisfy 0 ≤ low ≤ high ≤ 1."}return e.knobs.length===0?"Enable at least one knob so the loop can adjust difficulty.":null}const Mu=.5,Mx=1,Zr=e=>`${(Math.min(Mx,Math.max(Mu,e))-Mu)/(Mx-Mu)*100}%`;function H1({band:e,marker:t,met:n,showTiers:r=!0}){const[s,i]=e,o=n==null?"var(--primary)":n?"var(--success)":"var(--warning)";return a.jsxs("div",{className:"select-none",children:[a.jsxs("div",{className:"relative h-9 rounded-control border border-border bg-surface-2",children:[r&&Ac.map(l=>a.jsx("div",{title:`${l.label} · ${l.band[0]}–${l.band[1]}`,className:"absolute inset-y-0 border-l border-border/60",style:{left:Zr(l.band[0]),width:`calc(${Zr(l.band[1])} - ${Zr(l.band[0])})`}},l.tier)),a.jsx("div",{className:"absolute inset-y-0 rounded-[5px]",style:{left:Zr(s),width:`calc(${Zr(i)} - ${Zr(s)})`,background:"color-mix(in srgb, var(--primary) 18%, transparent)",boxShadow:"inset 0 0 0 1.5px var(--primary)"}}),t!=null&&a.jsxs("div",{className:"absolute inset-y-0",style:{left:Zr(t)},children:[a.jsx("div",{className:"absolute inset-y-0 w-0.5 -translate-x-1/2",style:{background:o}}),a.jsx("div",{className:"absolute -top-1.5 -translate-x-1/2 rounded-pill px-1.5 py-0.5 font-mono text-[10px] font-semibold text-white",style:{background:o},children:t.toFixed(3)})]})]}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[10px] text-text-faint",children:[a.jsx("span",{children:"0.50"}),a.jsx("span",{children:"0.75"}),a.jsx("span",{children:"1.00 AUROC"})]})]})}function sr({label:e,value:t,mono:n=!0}){return a.jsxs("div",{children:[a.jsx("div",{className:"kicker",children:e}),a.jsx("div",{className:ee("mt-0.5 text-lg font-semibold",n&&"font-mono tnum"),children:t})]})}function xM({report:e}){var i;if(!e)return a.jsx("div",{className:"rounded-card border border-dashed border-border p-10 text-center text-text-faint",children:"This run had no difficulty target. Enable difficulty targeting in the Canvas to calibrate the dataset to a baseline-AUROC band."});const[t,n]=e.target.band,r=e.target.tier?((i=Ac.find(o=>o.tier===e.target.tier))==null?void 0:i.label)??e.target.tier:"Custom band",s=t<=e.achieved_metric&&e.achieved_metric<=n?0:Math.min(Math.abs(e.achieved_metric-t),Math.abs(e.achieved_metric-n));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs(fe,{className:"p-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-10",children:[a.jsx(tt,{value:e.achieved_metric.toFixed(3),label:`Achieved ${e.metric_name.toUpperCase()}`,tone:e.band_met?"success":"warning"}),a.jsxs("div",{children:[a.jsxs("div",{className:"kicker",children:["Target · ",r]}),a.jsxs("div",{className:"mt-0.5 font-mono text-lg font-semibold tnum",children:[t.toFixed(2)," – ",n.toFixed(2)]})]})]}),a.jsx("span",{className:ee("rounded-pill px-3 py-1 text-sm font-semibold",e.band_met?"bg-success-tint text-success":"bg-warning-tint text-warning"),children:e.band_met?"✓ in band":`closest · Δ ${s.toFixed(3)}`})]}),a.jsx("div",{className:"mt-5",children:a.jsx(H1,{band:e.target.band,marker:e.achieved_metric,met:e.band_met})}),e.note&&a.jsx("p",{className:"mt-4 rounded-control border border-warning bg-warning-tint px-3 py-2 text-xs leading-relaxed text-warning",children:e.note})]}),a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"How it got there"}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4",children:[a.jsx(sr,{label:"Probe",value:e.probe,mono:!1}),a.jsx(sr,{label:"Iterations",value:String(e.iterations)}),a.jsx(sr,{label:"Difficulty dial",value:e.dial.toFixed(3)}),a.jsx(sr,{label:"Feature noise η",value:e.feature_noise.toFixed(3)}),a.jsx(sr,{label:"Label flips ρ",value:`${Math.round(e.label_flip*100)}%`}),a.jsx(sr,{label:"Noise-to-signal η²",value:e.reference.noise_to_signal.toFixed(3)}),a.jsx(sr,{label:"Linear separability",value:e.reference.linear_separability.toFixed(3)}),a.jsx(sr,{label:"Class balance",value:`${Math.round(e.reference.class_balance*100)}%`})]}),e.knobs_active.length>0&&a.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{className:"kicker mr-1",children:"Active knobs"}),e.knobs_active.map(o=>a.jsx("span",{className:"rounded-pill border border-primary bg-primary-tint px-2 py-0.5 text-xs font-medium text-primary",children:o},o))]}),a.jsxs("p",{className:"mt-4 border-t border-border pt-3 text-xs italic leading-relaxed text-text-faint",children:["Difficulty is empirical: the dataset is calibrated until a ",e.probe," baseline scores in the target band on a held-out split. Feature noise blurs the numeric predictors (the authored causal graph is left intact); label flips are the deep-end lever. Achieved score is reported honestly, misses included."]})]}),e.trace.length>1&&a.jsxs(fe,{className:"overflow-hidden",children:[a.jsx("div",{className:"border-b border-border px-4 py-2.5",children:a.jsx(se,{children:"Adaptive search · dial → probe AUROC"})}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface-2 text-left text-xs text-text-muted",children:[a.jsx("th",{className:"px-4 py-2",children:"Step"}),a.jsx("th",{className:"px-4 py-2",children:"Dial"}),a.jsx("th",{className:"px-4 py-2",children:"Probe AUROC"}),a.jsx("th",{className:"px-4 py-2",children:"Verdict"})]})}),a.jsx("tbody",{className:"font-mono text-xs tnum",children:e.trace.map((o,l)=>{const c=t<=o.metric&&o.metric<=n,u=c?"in band":o.metric>n?"too easy":"too hard";return a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-1.5 text-text-faint",children:l+1}),a.jsx("td",{className:"px-4 py-1.5",children:o.dial.toFixed(3)}),a.jsx("td",{className:"px-4 py-1.5",children:o.metric.toFixed(3)}),a.jsx("td",{className:"px-4 py-1.5 font-sans",style:{color:c?"var(--success)":"var(--text-muted)"},children:u})]},l)})})]})]})]})}function gM({spec:e,onChange:t}){const n=B1(e),r=e.difficulty??null;return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-2xl px-6 py-6",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-control bg-primary-tint text-primary",children:a.jsx(L0,{size:18})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-display text-xl font-semibold leading-tight",children:"Difficulty targeting"}),a.jsx("p",{className:"text-xs text-text-muted",children:"Calibrate the dataset to a baseline-model AUROC band — empirical, not a guess."})]})]}),n.length===0?a.jsxs(fe,{className:"mt-5 border-dashed p-6 text-sm text-text-muted",children:["Difficulty needs a ",a.jsx("strong",{children:"binary label"})," — a boolean column, or a categorical with exactly two categories. Add one in the ",a.jsx("strong",{children:"Table"})," view, then return here."]}):r==null?a.jsxs(fe,{className:"mt-5 flex flex-col items-start gap-3 border-dashed p-6",children:[a.jsx("p",{className:"text-sm text-text-muted",children:"Off — the dataset ships at its natural difficulty. Turn it on to tune how hard the label is to predict."}),a.jsxs(me,{variant:"primary",onClick:()=>t(mM(e)),children:[a.jsx(yh,{size:15})," Enable difficulty targeting"]})]}):a.jsx(yM,{spec:e,d:r,labels:n,onChange:t})]})})}function yM({spec:e,d:t,labels:n,onChange:r}){const s=c=>r({...t,...c}),i=!Vh(t.target),o=hM(t.target),l=pM(t,e);return a.jsxs("div",{className:"mt-5 space-y-5",children:[a.jsxs("section",{children:[a.jsx(se,{children:"Target band"}),a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[Ac.map(c=>{const u=!i&&t.target===c.tier;return a.jsxs("button",{onClick:()=>s({target:c.tier}),className:ee("ring-focus rounded-control border px-3 py-2.5 text-left transition-colors",u?"border-primary bg-primary-tint":"border-border hover:border-border-strong"),children:[a.jsxs("div",{className:"flex items-baseline justify-between",children:[a.jsx("span",{className:"text-sm font-semibold",children:c.label}),a.jsxs("span",{className:"font-mono text-[11px] text-text-muted tnum",children:[c.band[0].toFixed(2),"–",c.band[1].toFixed(2)]})]}),a.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-text-faint",children:c.blurb})]},c.tier)}),a.jsx("button",{onClick:()=>s({target:i?t.target:{metric:"auroc",band:o}}),className:ee("ring-focus col-span-2 rounded-control border px-3 py-2 text-left text-sm font-medium transition-colors",i?"border-primary bg-primary-tint text-primary":"border-border text-text-muted hover:text-text"),children:"Custom band…"})]}),i&&a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Low AUROC"}),a.jsx(Pu,{value:o[0],onChange:c=>s({target:{metric:"auroc",band:[c,o[1]]}})})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-xs font-medium text-text-muted",children:"High AUROC"}),a.jsx(Pu,{value:o[1],onChange:c=>s({target:{metric:"auroc",band:[o[0],c]}})})]})]}),a.jsx("div",{className:"mt-3",children:a.jsx(H1,{band:o})})]}),a.jsxs("section",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("label",{className:"block",children:[a.jsx(se,{children:"Label to predict"}),a.jsx(Px,{value:t.label,options:n,onChange:c=>s({label:c})})]}),a.jsxs("label",{className:"block",children:[a.jsx(se,{children:"Baseline probe"}),a.jsx(Px,{value:t.probe,options:fM.map(c=>c.value),onChange:c=>s({probe:c})})]})]}),a.jsxs("section",{children:[a.jsx(se,{children:"Difficulty knobs"}),a.jsx("p",{className:"mt-1 text-[11px] text-text-faint",children:"Composed into one bisection dial: feature noise first, label flips as the deep end."}),a.jsx("div",{className:"mt-2 space-y-2",children:Hh.map(c=>{const u=t.knobs.includes(c);return a.jsxs("button",{onClick:()=>vM(t,c,s),className:ee("ring-focus flex w-full items-start gap-2.5 rounded-control border px-3 py-2.5 text-left transition-colors",u?"border-primary bg-primary-tint":"border-border hover:border-border-strong"),children:[a.jsx("span",{className:ee("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-[5px] border",u?"border-primary bg-primary text-white":"border-border-strong"),children:u&&a.jsx("span",{className:"text-[10px] leading-none",children:"✓"})}),a.jsxs("span",{children:[a.jsx("span",{className:"text-sm font-medium",children:_x[c].label}),a.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-text-faint",children:_x[c].blurb})]})]},c)})})]}),a.jsx("section",{className:"grid grid-cols-2 gap-3",children:a.jsxs("label",{className:"block",children:[a.jsx(se,{children:"Max iterations"}),a.jsx(Pu,{value:t.max_iters,step:1,onChange:c=>s({max_iters:Math.max(1,Math.round(c))})})]})}),l&&a.jsx("div",{className:"rounded-control border border-warning bg-warning-tint px-3 py-2 text-xs text-warning",children:l}),a.jsx("p",{className:"rounded-control border border-border bg-surface-2 px-3 py-2.5 text-[11px] leading-relaxed text-text-faint",children:"The clean baseline is captured first; calibration bakes feature-observation noise (and label flips if needed) into the shipped dataset and reports the achieved AUROC honestly — including when a band can't be reached. Causal structure you authored is preserved."}),a.jsxs("button",{onClick:()=>r(null),className:"ring-focus inline-flex items-center gap-1.5 rounded-control px-2 py-1.5 text-xs font-medium text-text-faint transition-colors hover:bg-hazard-tint hover:text-hazard",children:[a.jsx(tr,{size:14})," Disable difficulty targeting"]})]})}function vM(e,t,n){const r=e.knobs.includes(t),s=Hh.filter(i=>i===t?!r:e.knobs.includes(i));n({knobs:s})}function Pu({value:e,onChange:t,step:n}){return a.jsx("input",{type:"number",step:n??.01,value:e??"",onChange:r=>t(r.target.value===""?0:Number(r.target.value)),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary"})}function Px({value:e,options:t,onChange:n}){return a.jsx("select",{value:e,onChange:r=>n(r.target.value),className:"ring-focus mt-1 w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 text-sm outline-none focus:border-primary",children:t.map(r=>a.jsx("option",{value:r,children:r},r))})}function uf(e,t=0){const n=" ".repeat(t);if(e==null)return"null";if(Array.isArray(e))return e.length===0?"[]":`
442
+ `+e.map(r=>`${n}- ${uf(r,t+1).replace(/^\n/,"")}`).join(`
443
+ `);if(typeof e=="object"){const r=Object.entries(e);return r.length===0?"{}":`
444
+ `+r.map(([s,i])=>{const o=uf(i,t+1);return`${n}${s}:${typeof i!="object"||i===null?" "+o:o}`}).join(`
445
+ `)}return typeof e=="string"?e:String(e)}function wM({open:e,onClose:t,spec:n}){if(!e)return null;const r=uf(n).replace(/^\n/,"");return a.jsxs("div",{className:"fixed inset-0 z-40 flex animate-fade-in justify-end",children:[a.jsx("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-[2px]",onClick:t,"aria-hidden":!0}),a.jsxs("div",{className:"relative z-10 flex h-full w-full max-w-md animate-slide-up flex-col border-l border-border bg-surface-1 shadow-pop",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[a.jsxs("div",{children:[a.jsx(se,{children:"Spec · read-only"}),a.jsxs("div",{className:"font-mono text-sm text-text",children:[n.name,".datadoom.yaml"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>{var s;return(s=navigator.clipboard)==null?void 0:s.writeText(r)},className:"text-text-faint hover:text-text",title:"Copy",children:a.jsx(D0,{size:16})}),a.jsx("button",{onClick:t,className:"text-text-faint hover:text-text","aria-label":"Close",children:a.jsx(Sn,{size:18})})]})]}),a.jsx("pre",{className:"min-h-0 flex-1 overflow-auto bg-surface-2 p-4 font-mono text-xs leading-relaxed text-text-muted",children:r})]})]})}function V1({datasetId:e,currentRunId:t,onOpenRun:n,dense:r}){const s=As(),i=Ds(),[o,l]=b.useState(null),c=Wt({queryKey:["runs",e],queryFn:()=>pe.listRuns(e),enabled:!!e}),u=Yt({mutationFn:h=>pe.deleteRun(h),onSuccess:()=>{i.invalidateQueries({queryKey:["runs",e]}),Cn("Generation deleted","success")},onError:h=>Cn(h.message,"error")}),f=b.useMemo(()=>(c.data??[]).slice().sort((h,x)=>h.created_at<x.created_at?1:-1),[c.data]);function d(h){n?n(h):s(`/datasets/${e}/results/${h}`)}return c.isLoading?a.jsx("div",{className:"flex justify-center py-10",children:a.jsx(Gn,{className:"h-5 w-5"})}):f.length===0?a.jsxs("div",{className:"rounded-card border border-dashed border-border p-8 text-center text-sm text-text-faint",children:["No generations yet. Hit ",a.jsx("span",{className:"font-medium text-text-muted",children:"Generate"})," to make one — it'll be tracked here forever."]}):a.jsxs("div",{className:"space-y-3",children:[!r&&a.jsx("p",{className:"text-sm text-text-muted",children:"Every generation of this dataset is kept — even across different configs — so you can revisit, rename, or download any of them at any time."}),f.map(h=>{const x=h.run_id===t,w=h.name||`${h.run_id.slice(0,8)}…`;return a.jsxs(fe,{className:ee("overflow-hidden p-4 transition-colors",x?"border-primary ring-1 ring-primary":"hover:border-border-strong"),children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:ee("flex h-9 w-9 shrink-0 items-center justify-center rounded-control",x?"bg-primary-tint text-primary":"bg-surface-2 text-text-faint"),children:a.jsx(ak,{size:17})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h4",{className:"truncate font-display text-[15px] font-semibold leading-tight tracking-tight text-text",children:w}),x&&a.jsx("span",{className:"shrink-0 rounded-pill bg-primary-tint px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:"viewing"})]}),a.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-xs text-text-faint",children:[a.jsx("span",{children:new Date(h.created_at).toLocaleString()}),a.jsx(zx,{}),a.jsxs("span",{className:"font-mono",children:["seed ",h.seed]}),h.compliance_score!=null&&a.jsxs(a.Fragment,{children:[a.jsx(zx,{}),a.jsxs("span",{children:[Math.round(h.compliance_score*100),"% compliance"]})]})]}),h.spec_hash&&a.jsxs("div",{className:"mt-1.5 flex w-fit items-center gap-1.5 rounded-pill bg-surface-2 px-2 py-0.5 font-mono text-[10px] text-text-faint",title:"The exact spec that produced this run is locked. Regenerate from it for byte-identical data.",children:[a.jsx(fk,{size:10}),"spec ",h.spec_hash.slice(0,12)]})]}),a.jsx(rv,{status:h.status})]}),a.jsxs("div",{className:"mt-3.5 flex items-center justify-end gap-2 border-t border-border pt-3",children:[!x&&h.status==="completed"&&a.jsx(me,{className:"px-3 py-1.5 text-xs",onClick:()=>d(h.run_id),children:"Open results"}),h.status==="completed"&&a.jsx("a",{href:pe.specYamlUrl(h.run_id),download:!0,title:"Download the locked, resolved spec YAML",children:a.jsxs(me,{variant:"ghost",className:"px-3 py-1.5 text-xs",children:[a.jsx(rk,{size:14})," Spec YAML"]})}),h.status==="completed"&&a.jsx("a",{href:pe.bundleUrl(h.run_id),download:!0,children:a.jsxs(me,{variant:"ghost",className:"px-3 py-1.5 text-xs",children:[a.jsx(xh,{size:14})," Download"]})}),a.jsx(Cc,{trigger:({toggle:v})=>a.jsx(ni,{onClick:v,children:a.jsx(A0,{size:16})}),children:v=>a.jsxs(a.Fragment,{children:[a.jsx(ws,{icon:a.jsx(H0,{size:14}),onClick:()=>{v(),l(h)},children:"Rename"}),a.jsx(ws,{icon:a.jsx(tr,{size:14}),danger:!0,onClick:async()=>{v(),await sv({title:`Delete "${w}"?`,message:"This generation and its artifacts will be permanently removed.",confirmLabel:"Delete",tone:"danger"})&&u.mutate(h.run_id)},children:"Delete"})]})})]})]},h.run_id)}),a.jsx(bM,{run:o,datasetId:e,onClose:()=>l(null)})]})}function zx(){return a.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-text-faint"})}function bM({run:e,datasetId:t,onClose:n}){const r=Ds(),[s,i]=b.useState("");b.useEffect(()=>{e&&i(e.name??"")},[e]);const o=Yt({mutationFn:()=>pe.renameRun(e.run_id,s.trim()),onSuccess:()=>{r.invalidateQueries({queryKey:["runs",t]}),r.invalidateQueries({queryKey:["run",e.run_id]}),Cn("Generation renamed","success"),n()},onError:l=>Cn(l.message,"error")});return a.jsx(Fs,{open:!!e,onClose:n,kicker:"Generation",title:"Rename generation",footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:n,children:"Cancel"}),a.jsx(me,{variant:"primary",disabled:!s.trim()||o.isPending,onClick:()=>o.mutate(),children:o.isPending?"Saving…":"Save"})]}),children:a.jsx(Sr,{label:"Name",hint:"A short, memorable label for this run.",children:a.jsx(bs,{autoFocus:!0,value:s,onChange:l=>i(l.target.value),placeholder:"baseline-v1"})})})}function jM({open:e,onClose:t,datasetId:n}){return e?a.jsxs("div",{className:"fixed inset-0 z-40 flex animate-fade-in justify-end",children:[a.jsx("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-[2px]",onClick:t,"aria-hidden":!0}),a.jsxs("div",{className:"relative z-10 flex h-full w-full max-w-lg animate-slide-up flex-col border-l border-border bg-bg shadow-pop",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-surface-1 px-5 py-4",children:[a.jsxs("div",{children:[a.jsx(se,{children:"History"}),a.jsx("div",{className:"font-display text-lg font-semibold tracking-tight",children:"Generations"})]}),a.jsx("button",{onClick:t,className:"ring-focus rounded-control p-1 text-text-faint hover:bg-surface-2 hover:text-text","aria-label":"Close",children:a.jsx(Sn,{size:18})})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:a.jsx(V1,{datasetId:n,dense:!0})})]})]}):null}const NM=100,kM=650;function SM(e){const[t,n]=b.useState(null),[,r]=b.useState(0),s=b.useCallback(()=>r(m=>m+1),[]),i=b.useRef(null),o=b.useRef(null),l=b.useRef([]),c=b.useRef([]),u=b.useRef(null),f=b.useRef(e);f.current=e;const d=b.useCallback(()=>{u.current&&(window.clearTimeout(u.current),u.current=null);const m=i.current;!m||m===o.current||(o.current&&(l.current.push(o.current),l.current.length>NM&&l.current.shift()),c.current=[],o.current=m,f.current(m),s())},[s]),h=b.useCallback(m=>{i.current=m,n(m),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(d,kM)},[d]),x=b.useCallback(m=>{i.current=m,o.current=m,n(m),f.current(m),s()},[s]),w=b.useCallback(()=>{if(u.current&&d(),l.current.length===0)return;const m=l.current.pop();o.current&&c.current.push(o.current),x(m)},[d,x]),v=b.useCallback(()=>{if(u.current&&d(),c.current.length===0)return;const m=c.current.pop();o.current&&l.current.push(o.current),x(m)},[d,x]),j=b.useCallback(m=>{u.current&&(window.clearTimeout(u.current),u.current=null),i.current=m,o.current=m,l.current=[],c.current=[],n(m),s()},[s]),p=b.useCallback(()=>(u.current&&d(),i.current),[d]);return{spec:t,canUndo:l.current.length>0,canRedo:c.current.length>0,set:h,undo:w,redo:v,load:j,flush:p}}function CM(){var q,ge,zt,en;const{id:e}=ph(),t=As(),n=Wr(B=>B.setCrumbs),r=Ds(),{data:s,isLoading:i}=Wt({queryKey:["dataset",e],queryFn:()=>pe.getDataset(e),enabled:!!e}),[o,l]=b.useState(null),[c,u]=b.useState("table"),[f,d]=b.useState(null),[h,x]=b.useState(null),[w,v]=b.useState(!0),[j,p]=b.useState(null),[m,y]=b.useState(!0),[g,N]=b.useState(!0),[E,P]=b.useState(!1),[M,$]=b.useState(!1),[R,L]=b.useState(!1),[U,H]=b.useState(null),[S,D]=b.useState(!1),T=Yt({mutationFn:B=>pe.saveSpec(e,B),onError:B=>p({message:B.message,locator:B.locator}),onSuccess:(B,Y)=>{v(!0),p(null),r.setQueryData(["dataset",e],ne=>ne!=null&&ne.current_spec?{...ne,current_spec:{...ne.current_spec,body:Y,spec_hash:B.spec_hash,version:B.version,spec_id:B.spec_id},updated_at:new Date().toISOString()}:ne)}}),I=b.useCallback(B=>{v(!1),p(null),H(null),T.mutate(B)},[e]),C=SM(I),k=C.spec,z=b.useRef(C.flush);z.current=C.flush,b.useEffect(()=>()=>void z.current(),[]),b.useEffect(()=>{D(!1),l(null),x(null)},[e]),b.useEffect(()=>{var B;(B=s==null?void 0:s.current_spec)!=null&&B.body&&!S&&(C.load(s.current_spec.body),l(Object.keys(s.current_spec.body.features)[0]??null),D(!0))},[s,S,C]),b.useEffect(()=>{k&&n([{label:"Datasets",to:"/datasets"},{label:k.name},{label:"Canvas"}])},[k,n]),b.useEffect(()=>{const B=Y=>{const ne=Y.target;["INPUT","TEXTAREA","SELECT"].includes(ne.tagName)||ne.isContentEditable||!(Y.metaKey||Y.ctrlKey)||(Y.key.toLowerCase()==="z"?(Y.preventDefault(),Y.shiftKey?C.redo():C.undo()):Y.key.toLowerCase()==="y"&&(Y.preventDefault(),C.redo()))};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[C]);const A=Yt({mutationFn:()=>pe.validate(k),onSuccess:B=>H({ok:!0,message:`Valid · ${B.spec_hash.slice(0,12)}…`}),onError:B=>H({ok:!1,message:B.message,locator:B.locator})}),F=Yt({mutationFn:async({name:B,applyFailures:Y})=>{var we;const ne=C.flush()??k,le=(((we=ne.failures)==null?void 0:we.length)??0)>0,$e=Ye=>ql(Ye,"graph-nodes",Li(e,"graph-nodes",{}));if(le&&!Y){const Ye={...ne,failures:[],export:{...ne.export??{},versions:Ne().filter(Te=>Te!=="injected")}};await T.mutateAsync(Ye);try{const Te=await pe.createRun(e,{name:B});return $e(Te.run_id),Te}finally{await T.mutateAsync(ne)}}let Le=ne;if(le){const Ye=Array.from(new Set([...Ne(),"injected"]));Le={...ne,export:{...ne.export??{},versions:Ye}},C.set(Le)}await T.mutateAsync(Le);const ke=await pe.createRun(e,{name:B});return $e(ke.run_id),ke},onSuccess:B=>t(`/datasets/${e}/run/${B.run_id}`),onError:B=>{L(!1),H({ok:!1,message:B.message,locator:B.locator})}}),Q=b.useMemo(()=>k?Object.keys(k.features):[],[k]);if(i||!k)return a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsx(Gn,{className:"h-6 w-6"})});function W(B,Y){var ke;if(!k||B===Y)return;const ne=Object.fromEntries(Object.entries(k.features).map(([we,Ye])=>[we===B?Y:we,Ye])),le=k.causal,$e=le&&{...le,edges:le.edges.map(we=>({...we,from:we.from===B?Y:we.from,to:we.to===B?Y:we.to})),noise:le.noise?Object.fromEntries(Object.entries(le.noise).map(([we,Ye])=>[we===B?Y:we,Ye])):le.noise,interventions:(ke=le.interventions)==null?void 0:ke.map(we=>({do:Object.fromEntries(Object.entries(we.do).map(([Ye,Te])=>[Ye===B?Y:Ye,Te]))}))},Le=Rp(k.failures,{rename:{from:B,to:Y}});C.set({...k,features:ne,causal:$e,failures:Le}),o===B&&l(Y),(f==null?void 0:f.kind)==="node"&&f.name===B&&d({kind:"node",name:Y})}function Z(B,Y){C.set({...k,features:{...k.features,[B]:Y}})}function re(B,Y){const ne={numeric:Qd(),categorical:{type:"categorical",categories:["a","b","c"]},boolean:{type:"boolean",rate:.5},datetime:{type:"datetime",start:"2020-01-01",end:"2024-12-31",granularity:"day"},text:{type:"text",generator:"lorem",length:{min:5,max:30}},timeseries:{type:"timeseries",trend:{slope:.01,intercept:0},seasonality:[{amplitude:1,period:24,phase:0}],ar:[.5],noise_std:1,dtype:"float"}};Z(B,ne[Y])}function ie(){const B=new Set(Q);let Y=Q.length+1,ne=`feature_${Y}`;for(;B.has(ne);)ne=`feature_${++Y}`;C.set({...k,features:{...k.features,[ne]:Qd()}}),l(ne),c==="graph"&&d({kind:"node",name:ne})}function de(B){var $e;if(!k)return;if(Q.length<=1){Cn("A dataset needs at least one column","error");return}const Y=Object.fromEntries(Object.entries(k.features).filter(([Le])=>Le!==B)),ne=k.causal;let le={...k,features:Y};if(ne){const Le={...ne,edges:ne.edges.filter(ke=>ke.from!==B&&ke.to!==B),noise:ne.noise?Object.fromEntries(Object.entries(ne.noise).filter(([ke])=>ke!==B)):ne.noise,interventions:($e=ne.interventions)==null?void 0:$e.map(ke=>({do:Object.fromEntries(Object.entries(ke.do).filter(([we])=>we!==B))})).filter(ke=>Object.keys(ke.do).length>0)};le=Op(le,Le)}le={...le,failures:Rp(le.failures,{remove:B})},C.set(le),o===B&&l(Object.keys(Y)[0]??null),(f==null?void 0:f.kind)==="node"&&f.name===B&&d(null),x(null),Cn(`Deleted "${B}"`)}function je(B){C.set({...k,features:Object.fromEntries(B.map(Y=>[Y,k.features[Y]]))})}function xe(B){C.set(Op(k,B))}function Ne(){var Y;const B=(Y=k.export)==null?void 0:Y.versions;return Array.isArray(B)&&B.length?B:["clean"]}const Qe=Ne().includes("injected");function lt(B){const Y={...k.export??{},versions:B};C.set({...k,export:Y})}function rt(){var Y;const B=(Y=k.export)==null?void 0:Y.formats;return Array.isArray(B)&&B.length?B:["csv"]}function _e(B){const Y=B.includes("csv")?B:["csv",...B];C.set({...k,export:{...k.export??{},formats:Y}})}function st(B){var le;const Y=(((le=k.failures)==null?void 0:le.length)??0)===0;let ne={...k,failures:B};if(Y&&B.length&&!Qe){const $e=Array.from(new Set([...Ne(),"injected"]));ne={...ne,export:{...k.export??{},versions:$e}}}C.set(ne)}function ye(B){C.set({...k,difficulty:B})}return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-surface-1 px-6 py-2.5",children:[a.jsx(uS,{value:c,onChange:u,options:[{value:"table",label:a.jsxs(a.Fragment,{children:[a.jsx(Ek,{size:14})," Table"]})},{value:"graph",label:a.jsxs(a.Fragment,{children:[a.jsx(ok,{size:14})," Graph"]})},{value:"failures",label:a.jsxs(a.Fragment,{children:[a.jsx(gh,{size:14})," Failures",(((q=k.failures)==null?void 0:q.length)??0)>0&&a.jsx("span",{className:"ml-0.5 rounded-pill bg-primary px-1.5 text-[10px] font-semibold leading-tight text-white tnum",children:k.failures.length})]})},{value:"difficulty",label:a.jsxs(a.Fragment,{children:[a.jsx(L0,{size:14})," Difficulty",k.difficulty&&a.jsx("span",{className:"ml-0.5 h-1.5 w-1.5 rounded-pill bg-primary","aria-label":"enabled"})]})}]}),a.jsxs("div",{className:"flex items-center rounded-control border border-border",children:[a.jsx(ni,{title:"Undo (⌘/Ctrl+Z)",disabled:!C.canUndo,onClick:C.undo,className:"rounded-r-none",children:a.jsx($k,{size:15})}),a.jsx("span",{className:"h-5 w-px bg-border"}),a.jsx(ni,{title:"Redo (⌘/Ctrl+Shift+Z)",disabled:!C.canRedo,onClick:C.redo,className:"rounded-l-none",children:a.jsx(wk,{size:15})})]}),c==="table"&&a.jsx(ni,{title:m?"Hide data preview":"Show data preview",active:m,onClick:()=>y(B=>!B),children:m?a.jsx(tk,{size:15}):a.jsx(F0,{size:15})}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsxs("span",{className:ee("flex items-center gap-1.5 text-xs",j?"text-hazard":"text-text-faint"),title:j?`${j.message}${j.locator?` @ ${j.locator}`:""}`:void 0,children:[j?a.jsx(go,{size:13}):w?a.jsx(Nc,{size:13,className:"text-success"}):a.jsx(Gn,{}),j?"can’t save — fix errors":w?"autosaved":"saving…"]}),a.jsxs(me,{onClick:()=>$(!0),children:[a.jsx(lk,{size:15})," Generations"]}),a.jsxs(me,{onClick:()=>P(!0),children:[a.jsx(JN,{size:15})," View Spec"]}),a.jsx(me,{onClick:()=>A.mutate(),children:"Validate"}),a.jsxs(me,{variant:"primary",disabled:F.isPending,onClick:()=>L(!0),children:[a.jsx(V0,{size:15})," Generate"]}),a.jsx(ni,{title:g?"Hide inspector":"Show inspector",onClick:()=>N(B=>!B),children:g?a.jsx(gk,{size:16}):a.jsx(yk,{size:16})})]})]}),U&&a.jsxs("div",{className:ee("px-6 py-2 text-sm",U.ok?"bg-success-tint text-success":"bg-hazard-tint text-hazard"),children:[U.ok?"✓ ":"✗ ",U.message,U.locator&&a.jsxs("span",{className:"ml-2 font-mono text-xs",children:["@ ",U.locator]})]}),a.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1",style:{gridTemplateColumns:g?"1fr 372px":"1fr 0px"},children:[a.jsxs("div",{className:"relative min-h-0",children:[c==="difficulty"?a.jsx(gM,{spec:k,onChange:ye}):c==="failures"?a.jsx(iM,{spec:k,selected:h,onSelect:x,onChange:st,exportInjected:Qe,onExportInjected:B=>lt(B?Array.from(new Set([...Ne(),"injected"])):Ne().filter(Y=>Y!=="injected"))}):c==="graph"?a.jsx(J4,{spec:k,datasetId:e,selection:f,onSelect:d,onCausalChange:xe,onDeleteColumn:de}):a.jsx(sC,{spec:k,datasetId:e,selected:o,showPreview:m,onSelect:l,onRename:W,onDelete:de,onReorder:je,onAddColumn:ie}),a.jsxs("div",{className:ee("pointer-events-none absolute right-3 top-3 flex flex-wrap justify-end gap-2",(c==="failures"||c==="difficulty")&&"hidden"),children:[a.jsx("div",{className:"pointer-events-auto",children:a.jsx(Fi,{label:"rows",value:k.rows.toLocaleString()})}),(s==null?void 0:s.current_spec)&&a.jsx("div",{className:"pointer-events-auto",children:a.jsx(Fi,{label:"spec_hash",value:s.current_spec.spec_hash})})]})]}),a.jsx("aside",{className:ee("min-h-0 overflow-hidden border-l border-border bg-surface-1 transition-opacity",g?"opacity-100":"pointer-events-none opacity-0"),children:c==="difficulty"?a.jsxs("div",{className:"space-y-4 p-6 text-sm leading-relaxed text-text-muted",children:[a.jsxs("div",{children:[a.jsx(se,{children:"About difficulty"}),a.jsxs("p",{className:"mt-2",children:["Difficulty is ",a.jsx("em",{children:"empirical"}),": the engine trains a baseline probe on a held-out split and tunes the data until its AUROC lands in your target band."]})]}),a.jsxs("p",{children:["It turns one bisection dial — ",a.jsx("strong",{children:"feature-observation noise"})," first (blurs the numeric predictors, leaving your causal graph intact), then ",a.jsx("strong",{children:"label flips"})," as the deep end. The clean baseline is captured before any of this."]}),a.jsxs("p",{className:"text-text-faint",children:["The achieved AUROC, iterations, and final knob values are reported on the run's",a.jsx("strong",{className:"font-medium text-text-muted",children:" Difficulty"})," tab — honestly, misses and all."]})]}):c==="failures"?h!=null&&((ge=k.failures)!=null&&ge[h])?a.jsx(lM,{failure:k.failures[h],index:h,spec:k,onChange:B=>st(k.failures.map((Y,ne)=>ne===h?B:Y)),onDelete:()=>{st(k.failures.filter((B,Y)=>Y!==h)),x(null)}}):a.jsx("div",{className:"p-6 text-sm text-text-faint",children:"Select a failure step to configure it, or add one to begin."}):c==="graph"?a.jsx(eM,{spec:k,causal:Nh(k),selection:f,onCausalChange:xe,onSelect:d}):o&&k.features[o]?a.jsx(TS,{name:o,feature:k.features[o],siblingNames:Q.filter(B=>B!==o),onRename:B=>W(o,B),onChange:B=>Z(o,B),onChangeType:B=>re(o,B),onDelete:()=>de(o),locatorError:U&&!U.ok&&((zt=U.locator)!=null&&zt.includes(o))?U.message:null}):a.jsx("div",{className:"p-6 text-sm text-text-faint",children:"Select a column to edit it."})})]}),a.jsx(wM,{open:E,onClose:()=>P(!1),spec:k}),a.jsx(jM,{open:M,onClose:()=>$(!1),datasetId:e}),a.jsx(_M,{open:R,defaultName:k.name,hasFailures:(((en=k.failures)==null?void 0:en.length)??0)>0,defaultApply:Qe,pending:F.isPending,formats:rt(),onFormats:_e,onClose:()=>L(!1),onConfirm:(B,Y)=>F.mutate({name:B,applyFailures:Y})})]})}const EM=[{id:"csv",label:"CSV",hint:"always — backs preview + the determinism checksum"},{id:"json",label:"JSON",hint:"records array, pandas-readable"},{id:"parquet",label:"Parquet",hint:"columnar; needs the parquet extra"}];function _M({open:e,defaultName:t,hasFailures:n,defaultApply:r,pending:s,formats:i,onFormats:o,onClose:l,onConfirm:c}){const[u,f]=b.useState(""),[d,h]=b.useState(!0);function x(w){w!=="csv"&&o(i.includes(w)?i.filter(v=>v!==w):[...i,w])}return b.useEffect(()=>{if(e){const w=new Date().toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});f(`${t} · ${w}`),h(r)}},[e,t,r]),a.jsxs(Fs,{open:e,onClose:l,kicker:"New generation",title:"Name this generation",footer:a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:l,children:"Cancel"}),a.jsxs(me,{variant:"primary",disabled:!u.trim()||s,onClick:()=>c(u.trim(),d),children:[a.jsx(V0,{size:15})," ",s?"Starting…":"Generate"]})]}),children:[a.jsx(Sr,{label:"Generation name",hint:"Required — every generation is named so you can find it later.",children:a.jsx(bs,{autoFocus:!0,value:u,onChange:w=>f(w.target.value),onKeyDown:w=>{w.key==="Enter"&&u.trim()&&!s&&c(u.trim(),d)},placeholder:"baseline-v1"})}),n&&a.jsxs("label",{className:"mt-4 flex cursor-pointer items-start gap-2.5 rounded-control border border-border bg-surface-2 px-3.5 py-3",children:[a.jsx("input",{type:"checkbox",checked:d,onChange:w=>h(w.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--primary)]"}),a.jsxs("span",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-text",children:"Inject failures"}),a.jsx("span",{className:"mt-0.5 block text-xs text-text-faint",children:d?"Produces both the clean baseline and the corrupted variant (with Comparison).":"Produces the clean dataset only — failures stay configured but aren’t applied this run."})]})]}),a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"kicker mb-2",children:"Output formats"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:EM.map(w=>{const v=w.id==="csv"||i.includes(w.id);return a.jsxs("label",{className:ee("flex items-center gap-2.5 rounded-control border px-3 py-2",w.id==="csv"?"cursor-default border-border bg-surface-2/60":"cursor-pointer border-border bg-surface-2 hover:border-border-strong"),children:[a.jsx("input",{type:"checkbox",checked:v,disabled:w.id==="csv",onChange:()=>x(w.id),className:"h-4 w-4 accent-[var(--primary)]"}),a.jsx("span",{className:"text-sm font-medium text-text",children:w.label}),a.jsx("span",{className:"ml-auto text-xs text-text-faint",children:w.hint})]},w.id)})})]})]})}const MM=[{key:"intake",label:"Intake & Validate"},{key:"snapshot",label:"Snapshot & Hash"},{key:"seed",label:"Seed"},{key:"base_generation",label:"Base Generation"},{key:"causal",label:"Causal / SEM",optional:!0},{key:"failure_injection",label:"Failure Injection",optional:!0},{key:"difficulty",label:"Difficulty Calibration",optional:!0},{key:"compliance",label:"Compliance"},{key:"packaging",label:"Packaging"}];function PM({statuses:e}){return a.jsx("ol",{className:"space-y-1",children:MM.map(t=>{const n=e[t.key]??(t.optional?"skipped":"pending");return a.jsxs("li",{className:ee("flex items-center gap-3 rounded-control px-3 py-2",n==="running"&&"bg-primary-tint",n==="failed"&&"bg-hazard-tint"),children:[a.jsx(zM,{status:n}),a.jsx("span",{className:ee("text-sm",n==="done"&&"text-text",n==="running"&&"font-medium text-primary",n==="failed"&&"font-medium text-hazard",(n==="pending"||n==="skipped")&&"text-text-faint"),children:t.label}),n==="skipped"&&a.jsx("span",{className:"kicker ml-auto",children:"not in this spec"})]},t.key)})})}function zM({status:e}){return e==="done"?a.jsx(Nc,{size:16,className:"text-success"}):e==="running"?a.jsx(U0,{size:16,className:"animate-spin text-primary"}):e==="failed"?a.jsx(Sn,{size:16,className:"text-hazard"}):a.jsx(ZN,{size:16,className:"text-text-faint/40"})}function $M(e,t){let n=!1,r=null,s=null;const o=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/api/ws/runs/${e}`;try{r=new WebSocket(o),r.onmessage=c=>{if(!n)try{t(JSON.parse(c.data))}catch{}},r.onerror=()=>{!n&&(r==null?void 0:r.readyState)!==WebSocket.OPEN&&l()}}catch{l()}function l(){n||s||(s=new EventSource(`/api/runs/${e}/events`),s.onmessage=c=>{if(!n)try{t(JSON.parse(c.data))}catch{}})}return()=>{n=!0,r==null||r.close(),s==null||s.close()}}function TM(){const{id:e,runId:t}=ph(),n=As(),r=Wr(y=>y.setCrumbs),{data:s}=Wt({queryKey:["run",t],queryFn:()=>pe.getRun(t),enabled:!!t}),[i,o]=b.useState({}),[l,c]=b.useState([]),[u,f]=b.useState(0),[d,h]=b.useState(null),x=b.useRef(null);b.useEffect(()=>r([{label:"Datasets",to:"/datasets"},{label:"Generate"}]),[r]),b.useEffect(()=>t?$M(t,g=>{g.type==="stage"?(o(N=>({...N,[g.stage]:g.status==="done"?"done":"running"})),f(g.pct)):g.type==="log"?c(N=>[...N,`[${g.level.toUpperCase()}] ${g.message}`]):g.type==="completed"?(o(N=>({...N,packaging:"done"})),f(100),h(g)):g.type==="failed"?(o(N=>({...N,[g.stage]:"failed"})),h(g),c(N=>[...N,`[ERROR] ${g.message}`])):g.type==="cancelled"&&h(g)}):void 0,[t]),b.useEffect(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)},[l]);const w=(d==null?void 0:d.type)==="completed",v=(d==null?void 0:d.type)==="failed",j=(d==null?void 0:d.type)==="cancelled",p=w?XN:v||j?YN:U0,m=w?"text-success":v?"text-hazard":j?"text-text-faint":"text-primary";return a.jsxs("div",{className:"flex h-full flex-col px-8 py-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(p,{size:26,className:ee(m,!d&&"animate-spin")}),a.jsxs("div",{children:[a.jsx(se,{children:w?"Complete":v?"Failed":j?"Cancelled":"Generating"}),a.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight",children:w?"Generation complete":v?"Generation failed":"Run in progress"})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[s&&a.jsx(Fi,{label:"seed",value:s.seed}),s&&a.jsx(Fi,{label:"spec_id",value:s.spec_id})]})]}),a.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[a.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-pill bg-surface-2",children:a.jsx("div",{className:ee("h-full rounded-pill transition-[width] duration-300",v?"bg-hazard":"bg-primary"),style:{width:`${u}%`}})}),a.jsxs("span",{className:"font-mono text-sm tnum text-text-muted",children:[u,"%"]})]}),a.jsxs("div",{className:"mt-5 grid min-h-0 flex-1 grid-cols-1 gap-4 lg:grid-cols-[minmax(300px,380px)_1fr]",children:[a.jsxs("div",{className:"flex min-h-0 flex-col rounded-card border border-border bg-surface-1 shadow-card",children:[a.jsx("div",{className:"border-b border-border px-4 py-2.5",children:a.jsx(se,{children:"Pipeline stages"})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:a.jsx(PM,{statuses:i})})]}),a.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden rounded-card border border-border bg-[#15140f] shadow-card",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-white/10 px-4 py-2.5 text-white/70",children:[a.jsx(Mk,{size:14}),a.jsx("span",{className:"kicker !text-white/40",children:"Console"}),a.jsxs("span",{className:"ml-auto font-mono text-xs text-white/40",children:[l.length," lines"]})]}),a.jsx("div",{ref:x,className:"min-h-0 flex-1 overflow-auto p-4 font-mono text-xs leading-relaxed text-white/75",children:l.length===0?a.jsx("span",{className:"text-white/30",children:"waiting for output…"}):l.map((y,g)=>a.jsxs("div",{className:y.startsWith("[ERROR]")?"text-hazard":"",children:[a.jsxs("span",{className:"select-none text-white/25",children:[String(g+1).padStart(2,"0")," "]}),y]},g))})]})]}),a.jsxs("div",{className:"mt-5 flex items-center justify-between gap-3",children:[a.jsxs("p",{className:"text-sm text-text-faint",children:["Reproducible from ",a.jsx("span",{className:"font-mono",children:"spec_hash + seed"})," — identical bytes, forever."]}),a.jsxs("div",{className:"flex gap-3",children:[!d&&a.jsx(me,{variant:"destructive",onClick:()=>t&&pe.cancelRun(t),children:"Cancel run"}),w&&a.jsx(me,{variant:"primary",onClick:()=>n(`/datasets/${e}/results/${t}`),children:"View Results →"}),v&&a.jsxs(a.Fragment,{children:[a.jsx(me,{onClick:()=>n(`/datasets/${e}`),children:"Edit spec"}),a.jsx(me,{variant:"primary",onClick:()=>n(`/datasets/${e}`),children:"Retry"})]}),j&&a.jsx(me,{onClick:()=>n(`/datasets/${e}`),children:"Back to Canvas"})]})]})]})}function RM({data:e}){return a.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-card border border-border bg-surface-1 shadow-card",children:[a.jsx(Ur,{type:"target",position:J.Left,style:{opacity:0}}),a.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border bg-surface-2 px-2.5 py-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate font-display text-sm font-semibold tracking-tight text-text",children:e.label}),e.intervened&&a.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-primary",title:"intervened (do)",children:[a.jsx(O0,{size:10})," do"]})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-2.5 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e.ftype&&a.jsx(yo,{type:e.ftype}),a.jsx("span",{className:"text-[10px] uppercase tracking-wide text-text-faint",children:e.derived?"derived":"root"})]}),a.jsx(jh,{failures:e.failures,column:e.label,className:"mt-1.5"}),e.rows.length>0&&a.jsx("dl",{className:"mt-1.5 space-y-0.5",children:e.rows.map((t,n)=>a.jsxs("div",{className:"flex items-start justify-between gap-2 text-[11px] leading-snug",children:[a.jsx("dt",{className:"shrink-0 text-text-faint",children:t.label}),a.jsx("dd",{className:"break-words text-right font-mono",style:{color:t.tone==="accent"?"var(--primary)":"var(--text-muted)"},children:t.value})]},n))})]}),a.jsx(Ur,{type:"source",position:J.Right,style:{opacity:0}})]})}const DM={view:RM};function OM({truth:e,spec:t,datasetId:n,runId:r,empirical:s}){const i=b.useMemo(()=>{if(e.nodes&&e.nodes.length)return e.nodes;const c=new Set;return e.edges.forEach(u=>{c.add(u.from),c.add(u.to)}),[...c]},[e]),o=b.useMemo(()=>{const c=Li(n,"graph-nodes",{}),u=Li(r,"graph-nodes",c),f=dv(i,e.edges.map(x=>({from:x.from,to:x.to,fn:x.fn}))),d={},h=x=>e.edges.filter(w=>w.to===x);return i.map(x=>{var N,E;const w=f[x]??0,v=d[w]??0;d[w]=v+1;const j=u[x],p=t==null?void 0:t.features[x],m=[];p&&kh(p).forEach(P=>m.push(P));for(const P of h(x))fv(P).forEach(M=>m.push(M));const y=s==null?void 0:s[x];y&&(y.mean!=null||y.std!=null)&&m.push({label:"realized",value:`x̄=${((N=y.mean)==null?void 0:N.toFixed(2))??"—"} s=${((E=y.std)==null?void 0:E.toFixed(2))??"—"}`});const g=(j==null?void 0:j.width)??216;return{id:x,type:"view",position:j?{x:j.x,y:j.y}:{x:w*300+24,y:v*184+24},width:j==null?void 0:j.width,style:{width:g},data:{label:x,ftype:p==null?void 0:p.type,derived:h(x).length>0,intervened:x in(e.interventions??{}),rows:m,failures:t==null?void 0:t.failures},draggable:!1}})},[i,e,t,s,n,r]),l=b.useMemo(()=>e.edges.map((c,u)=>({id:`t${u}`,source:c.from,target:c.to,type:"smoothstep",label:hv(c),style:{stroke:"var(--border-strong)",strokeWidth:1.5,strokeDasharray:c.active?void 0:"4 3",opacity:c.active?1:.4},labelStyle:{fontSize:10,fill:"var(--text-muted)",fontWeight:500},labelBgStyle:{fill:"var(--surface-1)",fillOpacity:.92},labelBgPadding:[4,2],labelBgBorderRadius:4,markerEnd:{type:Bi.ArrowClosed,color:"var(--border-strong)"}})),[e]);return a.jsx("div",{className:"h-[460px] bg-bg",children:a.jsxs(Bh,{nodes:o,edges:l,nodeTypes:DM,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[a.jsx(F1,{variant:At.Dots,gap:20,size:1,color:"var(--border)"}),a.jsx(A4,{showInteractive:!1})]})})}function AM({runId:e,report:t,cleanPreview:n,spec:r}){const s=t==null?void 0:t.failures,i=Wt({queryKey:["preview",e,"injected"],queryFn:()=>pe.preview(e,200,"injected"),enabled:!!e,retry:!1});if(!s||s.count===0)return a.jsxs(Rx,{children:["This run injected no failures. Add corruptions in the Canvas → ",a.jsx("strong",{children:"Failures"})," view, then regenerate to compare the clean and injected datasets here."]});const o=s.modes??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(FM,{modes:o,clean:n,injected:i.data}),a.jsxs("section",{children:[a.jsx(se,{children:"What each failure actually did"}),a.jsx("p",{className:"mt-1 text-xs italic text-text-faint",children:"Measured on the full generated dataset by the engine — not an estimate."}),a.jsx("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",children:o.map(l=>a.jsx(LM,{diff:l},l.index))})]}),a.jsx(UM,{modes:o,clean:n,injected:i.data,spec:r}),a.jsxs("section",{children:[a.jsx(se,{children:"Clean → injected, row by row"}),i.isLoading?a.jsx(Gn,{className:"mt-3"}):i.data&&n?a.jsx(BM,{clean:n,injected:i.data}):a.jsx(Rx,{children:"The injected variant wasn’t exported for this run."})]})]})}function FM({modes:e,clean:t,injected:n}){const r=new Set;let s=0;for(const o of e){if(o.nullified_fraction)for(const[l,c]of Object.entries(o.nullified_fraction))r.add(l),s+=c;o.realized_rate!=null&&o.column&&(r.add(o.column),s+=o.realized_rate)}const i=t&&n?n.columns.filter(o=>!t.columns.includes(o)):[];return a.jsxs(fe,{className:"flex flex-wrap items-center gap-x-10 gap-y-6 p-6",children:[a.jsx(tt,{value:e.length,label:"Failure modes",tone:"primary"}),a.jsx(tt,{value:`${Math.round(s*100)}%`,label:"Cells made missing",tone:s>0?"hazard":"text"}),a.jsx(tt,{value:r.size,label:"Columns affected"}),i.length>0&&a.jsx(tt,{value:`+${i.length}`,label:"Leakage columns",tone:"warning"}),a.jsxs("p",{className:"max-w-xs text-sm text-text-muted",children:["Both variants share the same"," ",a.jsx("span",{className:"font-mono text-xs",children:"(spec_hash, seed)"})," — the clean baseline is byte-identical to a run with no failures."]})]})}function ba(e){return e==null?"—":`${(e*100).toFixed(1)}%`}function zn(e,t=2){return e==null||!Number.isFinite(e)?"—":e.toFixed(t)}function LM({diff:e}){const t=Ps[e.type];return a.jsxs(fe,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-control",style:{color:t.accent,background:`color-mix(in srgb, ${t.accent} 14%, transparent)`},children:a.jsx(wo,{type:e.type,size:15})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate text-sm font-medium",children:t.label}),a.jsxs("div",{className:"font-mono text-[11px] text-text-faint",children:["#",e.index+1," · ",e.column??e.into??(e.nullified_fraction?Object.keys(e.nullified_fraction).join(", "):"")]})]})]}),a.jsx("div",{className:"mt-3",children:IM(e,t.accent)})]})}function Zo({value:e,target:t,color:n}){return a.jsxs("div",{className:"relative mt-1 h-2 w-full overflow-hidden rounded-pill bg-surface-3",children:[a.jsx("div",{className:"h-full rounded-pill",style:{width:`${Math.min(100,e*100)}%`,background:n}}),t!=null&&a.jsx("span",{className:"absolute top-[-2px] h-3 w-0.5 bg-text-faint",style:{left:`${Math.min(100,t*100)}%`},title:`target ${ba(t)}`})]})}function Jo({label:e,value:t,color:n}){return a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-base font-semibold tnum",style:n?{color:n}:void 0,children:t}),a.jsx("div",{className:"kicker mt-0.5",children:e})]})}function IM(e,t){var n,r,s,i;switch(e.type){case"mcar":{const o=Object.values(e.nullified_fraction??{}),l=o.length?o.reduce((c,u)=>c+u,0)/o.length:0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-baseline justify-between text-xs text-text-muted",children:[a.jsx("span",{children:"realized missing"}),a.jsx("span",{className:"font-mono font-semibold text-text",children:ba(l)})]}),a.jsx(Zo,{value:l,target:e.rate,color:t})]})}case"mar":case"mnar":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-baseline justify-between text-xs text-text-muted",children:[a.jsxs("span",{children:["realized missing ",e.self_dependent?"(self-driven)":`← ${e.driver}`]}),a.jsx("span",{className:"font-mono font-semibold text-text",children:ba(e.realized_rate)})]}),a.jsx(Zo,{value:e.realized_rate??0,target:e.target_rate,color:t}),a.jsxs("div",{className:"mt-1 text-[11px] text-text-faint",children:["target ",ba(e.target_rate)]})]});case"label_noise":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-baseline justify-between text-xs text-text-muted",children:[a.jsx("span",{children:"labels flipped"}),a.jsx("span",{className:"font-mono font-semibold text-text",children:ba(e.flipped_fraction)})]}),a.jsx(Zo,{value:e.flipped_fraction??0,target:e.rate,color:t})]});case"feature_noise":return a.jsxs("div",{className:"flex gap-6",children:[a.jsx(Jo,{label:"noise σ",value:zn(e.realized_noise_std),color:t}),a.jsx(Jo,{label:"mean shift",value:zn(e.realized_mean_shift)})]});case"drift":return a.jsxs("div",{className:"flex items-end justify-between gap-3",children:[a.jsxs("div",{className:"flex gap-6",children:[a.jsx(Jo,{label:"total shift",value:zn(e.total_shift),color:t}),a.jsx(Jo,{label:"2nd−1st half",value:zn(e.mean_shift_second_vs_first_half)})]}),a.jsx("svg",{viewBox:"0 0 40 16",className:"h-5 w-12 shrink-0",children:a.jsx("line",{x1:"1",y1:"15",x2:"39",y2:"2",stroke:t,strokeWidth:"1.6",strokeLinecap:"round"})})]});case"covariate_shift":return a.jsxs("div",{className:"space-y-1 font-mono text-xs",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-text-faint",children:"mean"}),a.jsxs("span",{children:[zn((n=e.before)==null?void 0:n.mean)," ",a.jsx("span",{className:"text-text-faint",children:"→"})," ",a.jsx("span",{style:{color:t},children:zn((r=e.after)==null?void 0:r.mean)})]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-text-faint",children:"std"}),a.jsxs("span",{children:[zn((s=e.before)==null?void 0:s.std)," ",a.jsx("span",{className:"text-text-faint",children:"→"})," ",a.jsx("span",{style:{color:t},children:zn((i=e.after)==null?void 0:i.std)})]})]})]});case"leakage":{const o=e.realized_correlation??0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-baseline justify-between text-xs text-text-muted",children:[a.jsxs("span",{children:["corr(",e.into,", ",e.target,")"]}),a.jsx("span",{className:"font-mono font-semibold",style:{color:t},children:zn(o,3)})]}),a.jsx(Zo,{value:Math.abs(o),color:t}),a.jsx("div",{className:"mt-1 text-[11px] text-text-faint",children:"a near-perfect proxy for the label"})]})}default:return null}}function $x(e,t){if(!e)return[];const n=e.columns.indexOf(t);return n<0?[]:e.rows.map(r=>Number(r[n])).filter(r=>Number.isFinite(r))}function UM({modes:e,clean:t,injected:n,spec:r}){const s=b.useMemo(()=>{var o;const i=new Set;for(const l of e)if((l.type==="drift"||l.type==="covariate_shift"||l.type==="feature_noise")&&l.column){const c=(o=r==null?void 0:r.features)==null?void 0:o[l.column];(!r||c&&c.type==="numeric")&&i.add(l.column)}return[...i]},[e,r]);return s.length===0||!t||!n?null:a.jsxs("section",{children:[a.jsx(se,{children:"Distribution shift"}),a.jsx("p",{className:"mt-1 text-xs italic text-text-faint",children:"Clean (grey) vs injected (violet) on a shared axis — the sampled preview rows."}),a.jsx("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",children:s.map(i=>a.jsxs(fe,{className:"p-4",children:[a.jsx("div",{className:"text-sm font-medium",children:i}),a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-3",children:[a.jsx(Tx,{label:"clean",values:$x(t,i),color:"var(--text-faint)"}),a.jsx(Tx,{label:"injected",values:$x(n,i),color:"var(--primary)"})]})]},i))})]})}function Tx({label:e,values:t,color:n}){return a.jsxs("div",{className:"rounded-control border border-border bg-surface-2 p-2",children:[a.jsx(vh,{values:t,color:n,height:80}),a.jsx("div",{className:"kicker mt-1 text-center",children:e})]})}function BM({clean:e,injected:t}){const[n,r]=b.useState(!0),s=b.useMemo(()=>Object.fromEntries(e.columns.map((d,h)=>[d,h])),[e.columns]);function i(d,h){var j,p;if(!(d in s))return"added";const x=(j=e.rows[h])==null?void 0:j[s[d]],w=t.columns.indexOf(d),v=(p=t.rows[h])==null?void 0:p[w];return(v==null||v==="")&&x!=null&&x!==""?"nullified":String(x)!==String(v)?"changed":"same"}const o=Math.min(e.rows.length,t.rows.length),l=d=>e.columns.some(h=>{const x=i(h,d);return x==="nullified"||x==="changed"}),c=b.useMemo(()=>{const d=[];for(let h=0;h<o;h++)l(h)&&d.push(h);return d},[o,e,t]),u=n?c:Array.from({length:o},(d,h)=>h),f={same:"text-text-faint",nullified:"bg-hazard-tint text-hazard font-semibold",changed:"bg-warning-tint text-warning",added:"bg-primary-tint text-primary"};return a.jsxs(fe,{className:"mt-3 overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border px-4 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[a.jsx(zu,{swatch:"bg-hazard",label:"made missing"}),a.jsx(zu,{swatch:"bg-warning",label:"value changed"}),a.jsx(zu,{swatch:"bg-primary",label:"planted column"})]}),a.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-text-muted",children:[a.jsx("input",{type:"checkbox",checked:n,onChange:d=>r(d.target.checked),className:"h-3.5 w-3.5 accent-[var(--primary)]"}),"Changed rows only",a.jsxs("span",{className:"font-mono text-text-faint tnum",children:["(",c.length," of ",o,")"]})]})]}),a.jsx("div",{className:"max-h-[460px] overflow-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{className:"sticky top-0 z-10",children:a.jsxs("tr",{className:"border-b border-border bg-surface-2 text-left",children:[a.jsx("th",{className:"px-2 py-2 font-mono text-[10px] text-text-faint",children:"#"}),t.columns.map(d=>a.jsxs("th",{className:ee("px-3 py-2 font-mono text-[11px]",d in s?"text-text-muted":"text-primary"),children:[d,!(d in s)&&" ★"]},d))]})}),a.jsx("tbody",{children:u.slice(0,120).map(d=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-2 py-1.5 font-mono text-[10px] text-text-faint tnum",children:d}),t.columns.map(h=>{var p,m;const x=i(h,d),w=t.columns.indexOf(h),v=(p=t.rows[d])==null?void 0:p[w],j=h in s?(m=e.rows[d])==null?void 0:m[s[h]]:void 0;return a.jsx("td",{title:x==="changed"?`clean: ${String(j)}`:void 0,className:ee("px-3 py-1.5 font-mono tnum",f[x]),children:x==="nullified"?"∅":v==null||v===""?"·":String(v)},h)})]},d))})]})}),u.length===0&&a.jsx("div",{className:"px-4 py-6 text-center text-xs text-text-faint",children:n&&c.length===0?"No nullified or altered cells in the sampled rows — this run only adds a planted column. Uncheck to see all rows.":"No rows to show."})]})}function zu({swatch:e,label:t}){return a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-text-muted",children:[a.jsx("span",{className:ee("h-2.5 w-2.5 rounded-[3px]",e)}),t]})}function Rx({children:e}){return a.jsx("div",{className:"rounded-card border border-dashed border-border p-10 text-center text-sm text-text-faint",children:e})}function HM({spec:e,report:t,preview:n,run:r,artifacts:s}){var v,j,p,m,y,g;const i=e?Object.entries(e.features):[],o=(n==null?void 0:n.total)??(e==null?void 0:e.rows)??0,l=i.length,c=(t==null?void 0:t.compliance_score)??((v=t==null?void 0:t.distribution)==null?void 0:v.compliance_score)??null,u=(t==null?void 0:t.failures)??null,f=i.reduce((N,[,E])=>(N[E.type]=(N[E.type]??0)+1,N),{}),d=Object.entries(f).map(([N,E])=>({label:N,count:E,color:hl[N]??"var(--text-muted)"})),h=i.reduce((N,[,E])=>{if(E.type==="numeric"){const P=E.dist??"derived";N[P]=(N[P]??0)+1}return N},{}),x=(p=(j=t==null?void 0:t.causal_truth)==null?void 0:j.edges)!=null&&p.length?new Set(t.causal_truth.edges.map(N=>N.to)).size:0,w=((y=(m=t==null?void 0:t.causal_truth)==null?void 0:m.edges)==null?void 0:y.length)??0;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(fe,{className:"flex flex-wrap items-center gap-x-12 gap-y-6 p-6",children:[a.jsx(tt,{value:o.toLocaleString(),label:"Rows"}),a.jsx(tt,{value:l,label:"Columns"}),a.jsx(tt,{value:c!=null?`${Math.round(c*100)}%`:"—",label:"Compliance",tone:c!=null&&c>=.8?"success":c!=null&&c>=.5?"warning":"hazard"}),u&&u.count>0&&a.jsx(tt,{value:u.count,label:"Failure modes",tone:"hazard"}),r&&a.jsx(tt,{value:r.seed,label:"Seed",tone:"primary"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"Column composition"}),a.jsxs("div",{className:"mt-4 flex items-center gap-6",children:[a.jsx(VM,{slices:d}),a.jsx("ul",{className:"space-y-1.5 text-sm",children:d.map(N=>a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-2.5 w-2.5 rounded-[3px]",style:{background:N.color}}),a.jsx("span",{className:"capitalize text-text",children:N.label}),a.jsx("span",{className:"font-mono text-xs text-text-faint tnum",children:N.count})]},N.label))})]})]}),a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"Distribution families"}),Object.keys(h).length===0?a.jsx("p",{className:"mt-4 text-sm text-text-muted",children:"No sampled numeric features."}):a.jsx(Dx,{items:Object.entries(h).sort((N,E)=>E[1]-N[1]).map(([N,E])=>({label:N,count:E})),color:"var(--primary)"})]})]}),w>0&&a.jsxs(fe,{className:"flex flex-wrap items-center gap-x-12 gap-y-4 p-6",children:[a.jsxs("div",{children:[a.jsx(se,{children:"Causal structure"}),a.jsx("p",{className:"mt-1 max-w-md text-sm text-text-muted",children:"This dataset carries a true generating graph — derived columns are computed from their parents, not sampled independently."})]}),a.jsx(tt,{value:w,label:"Edges",tone:"primary"}),a.jsx(tt,{value:x,label:"Derived cols"}),((g=t==null?void 0:t.causal_truth)==null?void 0:g.interventions)&&Object.keys(t.causal_truth.interventions).length>0&&a.jsx(tt,{value:Object.keys(t.causal_truth.interventions).length,label:"Interventions",tone:"warning"})]}),u&&u.count>0&&a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"Injected failures · by mode"}),a.jsx(Dx,{items:Object.entries(u.modes.reduce((N,E)=>(N[E.type]=(N[E.type]??0)+1,N),{})).sort((N,E)=>E[1]-N[1]).map(([N,E])=>({label:N,count:E})),color:"var(--hazard)"})]}),a.jsxs(fe,{className:"overflow-hidden",children:[a.jsx("div",{className:"border-b border-border px-4 py-2.5",children:a.jsx(se,{children:"Artifacts · reproducible bundle"})}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface-2 text-left text-xs text-text-muted",children:[a.jsx("th",{className:"px-4 py-2",children:"File"}),a.jsx("th",{className:"px-4 py-2",children:"Version"}),a.jsx("th",{className:"px-4 py-2",children:"Size"}),a.jsx("th",{className:"px-4 py-2",children:"SHA-256"})]})}),a.jsx("tbody",{className:"font-mono text-xs tnum",children:(s??[]).length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-3 text-center font-sans text-text-faint",children:"No artifacts recorded."})}):(s??[]).map(N=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-2",children:N.format}),a.jsxs("td",{className:"px-4 py-2 font-sans",children:[N.version,N.split?` · ${N.split}`:""]}),a.jsx("td",{className:"px-4 py-2",children:WM(N.size_bytes)}),a.jsxs("td",{className:"px-4 py-2 text-text-faint",title:N.checksum_sha256,children:[N.checksum_sha256.slice(0,12),"…"]})]},N.artifact_id))})]})]})]})}function VM({slices:e}){const t=e.reduce((i,o)=>i+o.count,0)||1,n=42,r=2*Math.PI*n;let s=0;return a.jsxs("svg",{width:"110",height:"110",viewBox:"0 0 110 110",className:"-rotate-90",children:[a.jsx("circle",{cx:"55",cy:"55",r:n,fill:"none",stroke:"var(--surface-2)",strokeWidth:"14"}),e.map(i=>{const l=i.count/t*r,c=a.jsx("circle",{cx:"55",cy:"55",r:n,fill:"none",stroke:i.color,strokeWidth:"14",strokeDasharray:`${l} ${r-l}`,strokeDashoffset:-s},i.label);return s+=l,c})]})}function Dx({items:e,color:t}){const n=Math.max(1,...e.map(r=>r.count));return a.jsx("div",{className:"mt-4 space-y-2.5",children:e.map(r=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-28 truncate font-mono text-xs text-text-muted",children:r.label}),a.jsx("div",{className:"h-3 flex-1 overflow-hidden rounded-pill bg-surface-2",children:a.jsx("div",{className:"h-full rounded-pill",style:{width:`${r.count/n*100}%`,background:t}})}),a.jsx("span",{className:"w-6 text-right font-mono text-xs text-text-faint tnum",children:r.count})]},r.label))})}function WM(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}const yl={critical:{label:"Critical",cls:"text-hazard bg-hazard-tint",bar:"var(--hazard)",rank:3},high:{label:"High",cls:"text-hazard bg-hazard-tint",bar:"var(--hazard)",rank:2},medium:{label:"Medium",cls:"text-warning bg-warning-tint",bar:"var(--warning)",rank:1},low:{label:"Low",cls:"text-text-muted bg-surface-2",bar:"var(--text-faint)",rank:0}},QM={label:{label:"target",cls:"text-primary bg-primary-tint"},derived:{label:"derived",cls:"text-info bg-info-tint"},leakage_proxy:{label:"leakage",cls:"text-hazard bg-hazard-tint"},feature:{label:"feature",cls:"text-text-muted bg-surface-2"}},Jr=e=>e==null||!Number.isFinite(e)?"—":Math.abs(e)>=1e5||Math.abs(e)<.001&&e!==0?e.toExponential(2):Number.isInteger(e)?String(e):e.toFixed(3),ja=e=>`${(e*100).toFixed(1)}%`;function KM({profile:e}){const[t,n]=b.useState(!1),r=b.useMemo(()=>{const i=(e==null?void 0:e.columns)??[];return t?i.filter(o=>o.issues.length>0):i},[e,t]);if(!e||e.columns.length===0)return a.jsx("div",{className:"rounded-card border border-dashed border-border p-10 text-center text-text-faint",children:"No column profile is available for this run."});const s=e.summary;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(fe,{className:"p-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-10 gap-y-4",children:[a.jsx(tt,{value:s.n_columns,label:"Columns"}),a.jsx(tt,{value:s.columns_with_issues,label:"With issues",tone:s.columns_with_issues?"warning":"success"}),s.critical_issues>0&&a.jsx(tt,{value:s.critical_issues,label:"Critical",tone:"hazard"}),s.high_issues>0&&a.jsx(tt,{value:s.high_issues,label:"High severity",tone:"hazard"}),a.jsxs("div",{className:"max-w-sm text-sm text-text-muted",children:["A per-column field guide for modelling this data: type, summary statistics, and — where the engine injected a data-quality issue — what it is and how to handle it.",s.label&&a.jsxs("span",{className:"mt-1 block font-mono text-xs text-text-faint",children:["detected target: ",a.jsx("span",{className:"text-primary",children:s.label})]})]})]}),s.total_issues>0&&a.jsxs("label",{className:"mt-4 flex w-fit cursor-pointer items-center gap-2 text-xs text-text-muted",children:[a.jsx("input",{type:"checkbox",checked:t,onChange:i=>n(i.target.checked),className:"accent-primary"}),"Show only columns with issues"]})]}),r.map(i=>a.jsx(qM,{col:i},i.name))]})}function qM({col:e}){const t=QM[e.role],n=e.issues.reduce((r,s)=>r==null||yl[s.severity].rank>yl[r].rank?s.severity:r,null);return a.jsxs(fe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border px-5 py-3",style:n?{boxShadow:`inset 3px 0 0 ${yl[n].bar}`}:void 0,children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-display text-lg font-semibold",children:e.name}),a.jsx(df,{className:t.cls,children:t.label}),a.jsx(df,{className:"bg-surface-2 text-text-muted",children:e.feature_type}),a.jsx("span",{className:"font-mono text-[11px] text-text-faint",children:e.dtype}),e.parents.length>0&&a.jsxs("span",{className:"font-mono text-[11px] text-text-faint",children:["← ",e.parents.join(", ")]})]}),e.issues.length>0&&a.jsxs("span",{className:"text-xs font-medium text-text-muted",children:[e.issues.length," issue",e.issues.length>1?"s":""]})]}),a.jsxs("div",{className:"px-5 py-4",children:[e.description&&a.jsx("p",{className:"mb-3 text-sm italic text-text-muted",children:e.description}),a.jsx(GM,{col:e}),e.stats==null&&e.categories&&e.categories.length>0&&a.jsx(XM,{col:e}),e.issues.length>0&&a.jsx("div",{className:"mt-4 space-y-3",children:e.issues.map((r,s)=>a.jsx(YM,{issue:r},`${r.mode}-${s}`))})]})]})}function GM({col:e}){const t=[{label:"rows",value:String(e.count)},{label:"missing",value:ja(e.missing_pct)},{label:"unique",value:String(e.unique)}];return e.stats&&(t.push({label:"mean",value:Jr(e.stats.mean)},{label:"std",value:Jr(e.stats.std)},{label:"min",value:Jr(e.stats.min)},{label:"median",value:Jr(e.stats.median)},{label:"max",value:Jr(e.stats.max)}),e.stats.skew!=null&&t.push({label:"skew",value:Jr(e.stats.skew)})),e.imbalance&&t.push({label:"balance",value:`${ja(e.imbalance.majority_pct)} / ${ja(e.imbalance.minority_pct)}`}),e.injected&&(t.push({label:"missing (injected)",value:ja(e.injected.missing_pct)}),e.injected.mean!=null&&t.push({label:"mean (injected)",value:Jr(e.injected.mean)})),a.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 sm:grid-cols-3 md:grid-cols-4",children:t.map(n=>a.jsxs("div",{className:"flex items-baseline justify-between gap-2 border-b border-border/60 pb-1",children:[a.jsx("span",{className:"kicker",children:n.label}),a.jsx("span",{className:"font-mono text-sm text-text tnum",children:n.value})]},n.label))})}function XM({col:e}){const t=e.categories??[],n=Math.max(...t.map(r=>r.pct),1e-4);return a.jsxs("div",{className:"mt-4 space-y-1.5",children:[a.jsx(se,{children:"Class distribution"}),t.map(r=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-28 truncate font-mono text-xs text-text-muted",title:r.value,children:r.value}),a.jsx("div",{className:"h-3 flex-1 overflow-hidden rounded-pill bg-surface-2",children:a.jsx("div",{className:"h-full rounded-pill bg-primary",style:{width:`${Math.max(2,r.pct/n*100)}%`}})}),a.jsx("span",{className:"w-12 text-right font-mono text-xs text-text-muted tnum",children:ja(r.pct)})]},r.value))]})}function YM({issue:e}){const t=yl[e.severity],n=e.severity==="critical"?kk:go;return a.jsxs("div",{className:"rounded-control border border-border bg-surface-2/40 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(n,{size:15,style:{color:t.bar}}),a.jsx("span",{className:"font-medium text-text",children:e.title}),a.jsx(df,{className:t.cls,children:t.label}),a.jsx("span",{className:"font-mono text-xs text-text-muted",children:e.magnitude})]}),a.jsx("p",{className:"mt-2 text-sm text-text-muted",children:e.explanation}),a.jsxs("div",{className:"mt-2.5 flex gap-2 rounded-control bg-primary-tint/50 p-2.5",children:[a.jsx(dk,{size:15,className:"mt-0.5 shrink-0 text-primary"}),a.jsxs("p",{className:"text-sm text-text",children:[a.jsx("span",{className:"font-medium",children:"How to handle it: "}),e.recommendation]})]}),e.techniques.length>0&&a.jsx("ul",{className:"mt-2.5 space-y-1 pl-1",children:e.techniques.map(r=>a.jsxs("li",{className:"flex gap-2 text-xs text-text-muted",children:[a.jsx("span",{className:"text-text-faint",children:"•"}),r]},r))})]})}function df({children:e,className:t}){return a.jsx("span",{className:ee("rounded-pill px-2 py-0.5 text-[11px] font-semibold",t),children:e})}function ZM(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const W1={clean:{badge:"clean",cls:"bg-success-tint text-success",desc:"the pristine generated data"},injected:{badge:"injected",cls:"bg-warning-tint text-warning",desc:"data with the failure modes applied"},spec:{badge:"locked spec",cls:"bg-primary-tint text-primary",desc:"exact spec + seed to regenerate"},audit:{badge:"audit",cls:"bg-info-tint text-info",desc:"human-readable report of this run"}};function JM(e){var t;return e.filename==="metadata.json"?"run metadata + checksums":((t=W1[e.version])==null?void 0:t.desc)??e.format.toUpperCase()+" export"}function eP({open:e,onClose:t,runId:n,artifacts:r}){const s=r.find(l=>l.version==="audit"),i=l=>l.version==="clean"?0:l.version==="injected"?1:l.filename==="metadata.json"?2:3,o=[...r].sort((l,c)=>i(l)-i(c)||l.filename.localeCompare(c.filename));return a.jsx(Fs,{open:e,onClose:t,kicker:"Take it with you",title:"Export",footer:a.jsx(me,{onClick:t,children:"Done"}),children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("a",{href:pe.bundleUrl(n),className:"flex items-center gap-3 rounded-control border-2 border-primary bg-primary-tint px-4 py-3",children:[a.jsx(mk,{size:18,className:"text-primary"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-sm font-medium text-text",children:"Download bundle (.zip)"}),a.jsxs("div",{className:"text-xs text-text-muted",children:["data + ",a.jsx("span",{className:"font-mono",children:"metadata.json"})," + the locked"," ",a.jsx("span",{className:"font-mono",children:"spec.resolved.yaml"})," +"," ",a.jsx("span",{className:"font-mono",children:"audit_report.md"})," — everything to regenerate and review."]})]})]}),s&&a.jsxs("a",{href:pe.downloadUrl(s.artifact_id),className:"flex items-center gap-3 rounded-control border border-info bg-info-tint/40 px-4 py-3",children:[a.jsx(nk,{size:18,className:"text-info"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-sm font-medium text-text",children:"Audit report"}),a.jsx("div",{className:"text-xs text-text-muted",children:"Compliance, the column guide (stats + issues + ML advice), failures, and checksums — as Markdown."})]}),a.jsx(xh,{size:15,className:"text-info"})]}),a.jsx("div",{className:"kicker pt-2",children:"Individual files"}),o.map(l=>{const c=W1[l.version];return a.jsxs("a",{href:pe.downloadUrl(l.artifact_id),className:"flex items-center gap-3 rounded-control border border-border bg-surface-2 px-4 py-2.5 hover:border-border-strong",children:[a.jsx(sk,{size:15,className:"shrink-0 text-text-muted"}),a.jsx("span",{className:"font-mono text-sm text-text",children:l.filename}),c&&l.filename!=="metadata.json"&&a.jsx("span",{className:ee("rounded-pill px-1.5 text-[10px] font-semibold",c.cls),children:c.badge}),a.jsx("span",{className:"hidden text-xs text-text-faint sm:inline",children:JM(l)}),a.jsx("span",{className:"ml-auto font-mono text-xs text-text-faint tnum",children:ZM(l.size_bytes)})]},l.artifact_id)}),a.jsxs("p",{className:"pt-1 text-xs text-text-faint",children:["The ",a.jsx("span",{className:"font-mono",children:"injected"})," file carries the configured failure modes; the"," ",a.jsx("span",{className:"font-mono",children:"clean"})," file is the pristine baseline. Data formats follow the spec's"," ",a.jsx("span",{className:"font-mono",children:"export.formats"}),"."]})]})})}const tP=new Set(["linear","identity"]);function Ox(e,t){const n=e.columns.indexOf(t);return n<0?[]:e.rows.map(r=>{const s=r[n];return typeof s=="boolean"?s?1:0:s==="true"?1:s==="false"?0:Number(s)})}function nP(e,t){var o;const n=((o=e[0])==null?void 0:o.length)??0;if(n===0)return null;const r=Array.from({length:n},()=>new Array(n).fill(0)),s=new Array(n).fill(0);for(let l=0;l<e.length;l++)for(let c=0;c<n;c++){s[c]+=e[l][c]*t[l];for(let u=0;u<n;u++)r[c][u]+=e[l][c]*e[l][u]}for(let l=0;l<n;l++)r[l][l]+=1e-8;const i=r.map((l,c)=>[...l,s[c]]);for(let l=0;l<n;l++){let c=l;for(let f=l+1;f<n;f++)Math.abs(i[f][l])>Math.abs(i[c][l])&&(c=f);if(Math.abs(i[c][l])<1e-12)return null;[i[l],i[c]]=[i[c],i[l]];const u=i[l][l];for(let f=l;f<=n;f++)i[l][f]/=u;for(let f=0;f<n;f++){if(f===l)continue;const d=i[f][l];for(let h=l;h<=n;h++)i[f][h]-=d*i[l][h]}}return i.map(l=>l[n])}function rP(e,t){if(!e||!t)return[];const n=new Map;for(const s of e.edges)s.active&&(n.has(s.to)||n.set(s.to,[]),n.get(s.to).push(s));const r=[];for(const[s,i]of n){const o=i.map(m=>m.from),l=i.every(m=>tP.has(m.fn)),c=Ox(t,s),u=o.map(m=>Ox(t,m));if(!(c.length>o.length+2&&c.every(Number.isFinite)&&u.every(m=>m.length===c.length&&m.every(Number.isFinite))))continue;if(!l){r.push({target:s,terms:o.map(m=>({parent:m,recovered:NaN,truth:null})),intercept:NaN,residualStd:NaN,r2:NaN,n:c.length,note:"non-linear / categorical structure — not OLS-recoverable"});continue}const d=c.map((m,y)=>[1,...u.map(g=>g[y])]),h=nP(d,c);if(!h)continue;const x=h[0],w=h.slice(1),v=c.reduce((m,y)=>m+y,0)/c.length;let j=0,p=0;for(let m=0;m<c.length;m++){const y=x+w.reduce((g,N,E)=>g+N*u[E][m],0);j+=(c[m]-y)**2,p+=(c[m]-v)**2}r.push({target:s,terms:o.map((m,y)=>({parent:m,recovered:w[y],truth:i[y].fn==="identity"?1:i[y].weight??null})),intercept:x,residualStd:Math.sqrt(j/Math.max(1,c.length-w.length-1)),r2:p>0?1-j/p:1,n:c.length})}return r}const sP=["Overview","Data Preview","Column Guide","Distributions","Correlation & MI","Causal Graph","Difficulty","Comparison","Generations","Evaluation"];function iP(){var p,m,y,g,N,E,P,M,$,R,L;const{id:e,runId:t}=ph(),[n,r]=b.useState("Overview"),[s,i]=b.useState(!1),o=Wr(U=>U.setCrumbs),l=Wt({queryKey:["run",t],queryFn:()=>pe.getRun(t),enabled:!!t}),c=Wt({queryKey:["report",t],queryFn:()=>pe.report(t),enabled:!!t}),u=Wt({queryKey:["preview",t],queryFn:()=>pe.preview(t,200),enabled:!!t}),f=Wt({queryKey:["artifacts",t],queryFn:()=>pe.artifacts(t),enabled:!!t}),d=e??((p=l.data)==null?void 0:p.dataset_id),h=Wt({queryKey:["spec",d],queryFn:()=>pe.getSpec(d),enabled:!!d});if(b.useEffect(()=>{o([{label:"Datasets",to:"/datasets"},...h.data?[{label:h.data.body.name,to:`/datasets/${d}`}]:[],{label:"Results"}])},[o,h.data,d]),l.isLoading||c.isLoading)return a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsx(Gn,{className:"h-6 w-6"})});const x=((m=c.data)==null?void 0:m.compliance_score)??null,w=!!((g=(y=c.data)==null?void 0:y.failures)!=null&&g.count),v=!!((N=c.data)!=null&&N.difficulty),j=sP.filter(U=>(U!=="Comparison"||w)&&(U!=="Difficulty"||v));return a.jsxs("div",{className:"h-full overflow-y-auto",children:[a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-10",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx(se,{children:"Run report"}),a.jsx("h1",{className:"mt-1.5 font-display text-[36px] font-semibold leading-none tracking-tight",children:"Results"}),a.jsxs("div",{className:"mt-3 flex flex-wrap gap-2.5",children:[l.data&&a.jsx(Fi,{label:"seed",value:l.data.seed}),((E=c.data)==null?void 0:E.determinism)&&a.jsx(Fi,{label:"spec_hash",value:c.data.determinism.spec_hash})]}),a.jsx("p",{className:"mt-3 max-w-md border-l-2 border-primary pl-3 text-sm italic text-text-muted",children:"Regenerate from this spec + seed for byte-identical data."})]}),a.jsxs(me,{variant:"primary",onClick:()=>i(!0),children:[a.jsx(xh,{size:15})," Export"]})]}),a.jsx("div",{className:"mt-7 flex flex-wrap gap-x-1 gap-y-0 border-b border-border",children:j.map(U=>{var H,S,D,T;return a.jsxs("button",{onClick:()=>r(U),className:ee("ring-focus inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-4 py-2.5 text-sm font-medium transition-colors",n===U?"border-primary text-text":"border-transparent text-text-muted hover:text-text"),children:[U,U==="Comparison"&&a.jsx("span",{className:"rounded-pill bg-primary-tint px-1.5 text-[10px] font-semibold text-primary tnum",children:(S=(H=c.data)==null?void 0:H.failures)==null?void 0:S.count}),U==="Column Guide"&&!!((T=(D=c.data)==null?void 0:D.profile)!=null&&T.summary.total_issues)&&a.jsx("span",{className:"rounded-pill bg-warning-tint px-1.5 text-[10px] font-semibold text-warning tnum",children:c.data.profile.summary.total_issues})]},U)})}),a.jsxs("div",{className:"mt-6 animate-fade-in",children:[n==="Overview"&&a.jsx(HM,{spec:(P=h.data)==null?void 0:P.body,report:c.data,preview:u.data,run:l.data,artifacts:f.data??[]}),n==="Data Preview"&&a.jsx(aP,{data:u.data,loading:u.isLoading}),n==="Column Guide"&&a.jsx(KM,{profile:(M=c.data)==null?void 0:M.profile}),n==="Distributions"&&a.jsx(lP,{report:c.data,preview:u.data}),n==="Correlation & MI"&&a.jsx(cP,{report:c.data}),n==="Causal Graph"&&a.jsx(dP,{report:c.data,spec:($=h.data)==null?void 0:$.body,datasetId:d,runId:t}),n==="Difficulty"&&a.jsx(xM,{report:(R=c.data)==null?void 0:R.difficulty}),n==="Comparison"&&t&&a.jsx(AM,{runId:t,report:c.data,cleanPreview:u.data,spec:(L=h.data)==null?void 0:L.body}),n==="Generations"&&a.jsx(V1,{datasetId:d,currentRunId:t}),n==="Evaluation"&&a.jsx(fP,{report:c.data,preview:u.data,score:x})]})]}),t&&a.jsx(eP,{open:s,onClose:()=>i(!1),runId:t,artifacts:f.data??[]})]})}function aP({data:e,loading:t}){return t||!e?a.jsx(Gn,{}):a.jsxs(fe,{className:"overflow-auto",children:[a.jsx("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:a.jsxs("span",{className:"kicker",children:["First ",e.rows.length," of ",e.total.toLocaleString()," rows"]})}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsx("tr",{className:"border-b border-border bg-surface-2 text-left",children:e.columns.map(n=>a.jsx("th",{className:"px-3 py-2 font-mono text-xs text-text-muted",children:n},n))})}),a.jsx("tbody",{children:e.rows.slice(0,100).map((n,r)=>a.jsx("tr",{className:"border-b border-border last:border-0",children:n.map((s,i)=>a.jsx("td",{className:"px-3 py-1.5 font-mono text-xs text-text-muted tnum",children:String(s)},i))},r))})]})]})}function oP(e,t){if(!e)return[];const n=e.columns.indexOf(t);return n<0?[]:e.rows.map(r=>Number(r[n])).filter(r=>Number.isFinite(r))}function Wh(e){return e.applicable??!0}function Q1(e){return Wh(e)?e.passed?"success":e.p_value>.01?"warning":"hazard":"muted"}const K1={success:"var(--success)",warning:"var(--warning)",hazard:"var(--hazard)",muted:"var(--text-faint)"};function lP({report:e,preview:t}){var r;const n=((r=e==null?void 0:e.distribution)==null?void 0:r.features)??[];return n.length===0?a.jsx(Qh,{children:"No numeric features to assess."}):a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[n.map(s=>{const i=Q1(s),o=K1[i],c=Wh(s)?s.passed?"pass":"review":"n/a";return a.jsxs(fe,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"font-display text-lg font-semibold",children:s.feature}),a.jsx("span",{className:"font-mono text-[11px]",style:{color:o},children:s.dist})]}),a.jsx("div",{className:"mt-2",children:a.jsx(vh,{values:oP(t,s.feature),color:o})}),a.jsxs("div",{className:"mt-2 flex items-center justify-between font-mono text-xs text-text-muted",children:[a.jsx("span",{title:"Which test decided the verdict",children:s.test==="chi2_gof"?`χ² ${s.gof?`${s.gof.bins}b`:"GoF"}`:s.test==="none"?"abstain":`KS D=${s.ks_statistic.toFixed(3)}`}),a.jsxs("span",{children:["p=",s.p_value.toFixed(3)]}),a.jsx("span",{style:{color:o},title:s.note??void 0,children:c})]}),s.note&&a.jsx("p",{className:"mt-1.5 text-[11px] italic text-text-faint",children:s.note})]},s.feature)}),a.jsxs("p",{className:"col-span-full text-xs italic text-text-faint",children:["Continuous, un-clamped features are judged by a Kolmogorov–Smirnov test against the requested CDF. Integer, discrete (e.g. poisson), and clamped features are judged by a chi-square ",a.jsx("span",{className:"not-italic font-mono",children:"goodness-of-fit"})," against the effective PMF (boundary bins absorb the clamped tail). A feature only shows"," ",a.jsx("span",{className:"not-italic font-mono",children:"n/a"})," when no valid test can be formed. We report fit honestly and never refit to the sample."]})]})}function Ax({matrix:e,diverging:t,normalize:n}){const r=s=>s==null?"var(--surface-2)":t?`rgba(${s>=0?"91, 67, 230":"200, 64, 42"}, ${Math.min(1,Math.abs(s)).toFixed(2)})`:`rgba(91, 67, 230, ${(n?Math.min(1,s/n):Math.min(1,s)).toFixed(2)})`;return a.jsxs("table",{className:"mt-3 border-collapse",style:{tableLayout:"fixed"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"w-28"}),e.columns.map(s=>a.jsx("th",{title:s,className:"w-14 max-w-[56px] break-words px-1 pb-2 align-bottom font-mono text-[10px] leading-tight text-text-faint",children:s},s))]})}),a.jsx("tbody",{children:e.matrix.map((s,i)=>a.jsxs("tr",{children:[a.jsx("td",{title:e.columns[i],className:"w-28 max-w-[112px] break-words pr-2 text-right align-middle font-mono text-[10px] leading-tight text-text-faint",children:e.columns[i]}),s.map((o,l)=>a.jsx("td",{className:"p-0.5",children:a.jsx("div",{title:o==null?"—":o.toFixed(3),className:"flex h-11 w-14 items-center justify-center rounded-[4px] font-mono text-[10px]",style:{background:r(o),color:o!=null&&Math.abs(t?o:n?o/n:o)>.5?"#fff":"var(--text-muted)"},children:o==null?"—":o.toFixed(2)})},l))]},i))})]})}function cP({report:e}){const t=e==null?void 0:e.correlation,n=e==null?void 0:e.mutual_information;if(!t&&!n)return a.jsx(Qh,{children:"Correlation needs at least two numeric features."});const r=n?Math.max(1e-4,...n.matrix.flatMap((s,i)=>s.map((o,l)=>i===l||o==null?0:o))):1;return a.jsxs("div",{className:"space-y-4",children:[t&&a.jsxs(fe,{className:"overflow-auto p-4",children:[a.jsx(se,{children:"Pearson correlation"}),a.jsx(Ax,{matrix:t,diverging:!0})]}),n&&a.jsxs(fe,{className:"overflow-auto p-4",children:[a.jsxs(se,{children:["Mutual information · ",n.units??"nats"]}),a.jsx("p",{className:"mt-1 text-xs italic text-text-faint",children:"Captures non-linear dependence too; the diagonal is each column's entropy H(X)."}),a.jsx(Ax,{matrix:n,diverging:!1,normalize:r})]})]})}function uP(e){var n;const t={};for(const r of((n=e==null?void 0:e.distribution)==null?void 0:n.features)??[])t[r.feature]={mean:r.empirical.mean,std:r.empirical.std};return t}function dP({report:e,spec:t,datasetId:n,runId:r}){const s=e==null?void 0:e.causal_truth;if(!s||s.edges.length===0)return a.jsx(Qh,{children:"This dataset has no causal structure — features are sampled independently."});const i=Object.entries(s.interventions??{});return a.jsxs("div",{className:"space-y-4",children:[a.jsxs(fe,{className:"overflow-hidden",children:[a.jsx("div",{className:"border-b border-border px-4 py-2.5",children:a.jsx(se,{children:"True generating graph · every column's settings & structural equations"})}),a.jsx(OM,{truth:s,spec:t,datasetId:n,runId:r,empirical:uP(e)})]}),i.length>0&&a.jsxs(fe,{className:"p-4",children:[a.jsx(se,{children:"Interventions · do()"}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-2 font-mono text-xs",children:i.map(([o,l])=>a.jsxs("span",{className:"rounded-control border border-primary bg-primary-tint px-2 py-1 text-primary",children:["do(",o," = ",l,")"]},o))}),a.jsx("p",{className:"mt-2 text-xs italic text-text-faint",children:"Intervened nodes are fixed to a constant; their incoming edges (dashed) are detached."})]})]})}function fP({report:e,preview:t,score:n}){var i,o;const r=((i=e==null?void 0:e.distribution)==null?void 0:i.features)??[],s=b.useMemo(()=>rP(e==null?void 0:e.causal_truth,t),[e==null?void 0:e.causal_truth,t]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(fe,{className:"flex flex-wrap items-center gap-10 p-6",children:[a.jsx(tt,{value:n!=null?`${Math.round(n*100)}%`:"—",label:"Compliance score",tone:n!=null&&n>=.8?"success":n!=null&&n>=.5?"warning":"hazard"}),a.jsxs("div",{className:"max-w-sm text-sm text-text-muted",children:["The fraction of ",a.jsx("em",{children:"KS-applicable"})," features (continuous, float, un-clamped) whose realized sample is statistically consistent (KS, α=0.05) with the requested distribution. Integer, discrete, and clamped features abstain (n/a) and are judged by their moments.",((o=e==null?void 0:e.distribution)==null?void 0:o.applicable_features)!=null&&a.jsxs("span",{className:"mt-1 block font-mono text-xs text-text-faint",children:[e.distribution.applicable_features," of ",e.distribution.assessed_features," assessed features KS-applicable"]})]})]}),s.length>0&&a.jsxs(fe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"border-b border-border px-4 py-2.5",children:[a.jsx(se,{children:"Structural recovery · can a regression read back our equations?"}),a.jsxs("p",{className:"mt-1 text-xs italic text-text-faint",children:["For each derived column we fit ",a.jsx("span",{className:"font-mono not-italic",children:"target ~ parents"})," (OLS) on the realized sample and compare the recovered slope to the declared structural weight. Honest generation lands recovered ≈ declared."]})]}),a.jsx("div",{className:"divide-y divide-border",children:s.map(l=>a.jsxs("div",{className:"px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"font-display text-base font-semibold",children:l.target}),l.note?a.jsx("span",{className:"text-xs italic text-text-faint",children:l.note}):a.jsxs("div",{className:"flex gap-4 font-mono text-xs text-text-muted",children:[a.jsxs("span",{children:["R²=",l.r2.toFixed(3)]}),a.jsxs("span",{children:["resid σ=",l.residualStd.toFixed(3)]}),a.jsxs("span",{children:["n=",l.n]})]})]}),!l.note&&a.jsxs("table",{className:"mt-2 w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-left text-text-faint",children:[a.jsx("th",{className:"py-1 font-medium",children:"term"}),a.jsx("th",{className:"py-1 font-medium",children:"recovered"}),a.jsx("th",{className:"py-1 font-medium",children:"declared"}),a.jsx("th",{className:"py-1 font-medium",children:"Δ"})]})}),a.jsxs("tbody",{className:"font-mono tnum",children:[a.jsxs("tr",{className:"border-t border-border",children:[a.jsx("td",{className:"py-1 text-text-muted",children:"intercept"}),a.jsx("td",{className:"py-1",children:l.intercept.toFixed(3)}),a.jsx("td",{className:"py-1 text-text-faint",children:"—"}),a.jsx("td",{className:"py-1 text-text-faint",children:"—"})]}),l.terms.map(c=>{const u=c.truth!=null?Math.abs(c.recovered-c.truth):null;return a.jsxs("tr",{className:"border-t border-border",children:[a.jsx("td",{className:"py-1 text-text-muted",children:c.parent}),a.jsx("td",{className:"py-1",children:c.recovered.toFixed(3)}),a.jsx("td",{className:"py-1 text-text-faint",children:c.truth!=null?c.truth.toFixed(3):"—"}),a.jsx("td",{className:"py-1",style:{color:u!=null?u<.15?"var(--success)":u<.4?"var(--warning)":"var(--hazard)":void 0},children:u!=null?u.toFixed(3):"—"})]},c.parent)})]})]})]},l.target))})]}),r.length>0&&a.jsxs(fe,{className:"overflow-hidden",children:[a.jsx("div",{className:"border-b border-border px-4 py-2.5",children:a.jsx(se,{children:"Target vs actual"})}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-surface-2 text-left text-xs text-text-muted",children:[a.jsx("th",{className:"px-4 py-2",children:"Feature"}),a.jsx("th",{className:"px-4 py-2",children:"Distribution"}),a.jsx("th",{className:"px-4 py-2",children:"Empirical mean"}),a.jsx("th",{className:"px-4 py-2",children:"Empirical std"}),a.jsx("th",{className:"px-4 py-2",children:"Clamped"}),a.jsx("th",{className:"px-4 py-2",children:"Fit p"})]})}),a.jsx("tbody",{className:"font-mono text-xs tnum",children:r.map(l=>{var u,f;const c=Wh(l);return a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-2 font-sans text-sm",children:l.feature}),a.jsx("td",{className:"px-4 py-2",children:l.dist}),a.jsx("td",{className:"px-4 py-2",children:(u=l.empirical.mean)==null?void 0:u.toFixed(3)}),a.jsx("td",{className:"px-4 py-2",children:(f=l.empirical.std)==null?void 0:f.toFixed(3)}),a.jsxs("td",{className:"px-4 py-2",children:[(l.clamped_fraction*100).toFixed(1),"%"]}),a.jsx("td",{className:"px-4 py-2",title:l.note??void 0,style:{color:K1[Q1(l)]},children:c?l.p_value.toFixed(3):"n/a"})]},l.feature)})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"Achieved difficulty"}),e!=null&&e.difficulty?a.jsxs("div",{className:"mt-2 text-sm text-text-muted",children:[a.jsx("span",{className:"font-mono text-lg font-semibold text-text tnum",children:e.difficulty.achieved_metric.toFixed(3)})," ",e.difficulty.metric_name.toUpperCase()," vs target"," ",e.difficulty.target.band[0].toFixed(2),"–",e.difficulty.target.band[1].toFixed(2),a.jsx("span",{className:ee("ml-2 rounded-pill px-2 py-0.5 text-xs font-semibold",e.difficulty.band_met?"bg-success-tint text-success":"bg-warning-tint text-warning"),children:e.difficulty.band_met?"in band":"closest"}),a.jsx("p",{className:"mt-1.5 text-xs text-text-faint",children:"See the Difficulty tab for the full calibration trace."})]}):a.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"No difficulty target was set for this run. Enable difficulty targeting in the Canvas to calibrate to a baseline-AUROC band."})]}),(e==null?void 0:e.determinism)&&a.jsxs(fe,{className:"p-5",children:[a.jsx(se,{children:"Determinism"}),a.jsxs("div",{className:"mt-3 space-y-2 font-mono text-xs text-text-muted",children:[a.jsxs("div",{children:["seed: ",e.determinism.seed]}),Object.entries(e.determinism.artifact_checksums).map(([l,c])=>a.jsxs("div",{className:"truncate",children:[l,": ",a.jsx("span",{className:"text-text-faint",children:c})]},l))]})]})]})]})}function Qh({children:e}){return a.jsx("div",{className:"rounded-card border border-dashed border-border p-10 text-center text-text-faint",children:e})}function hP({kicker:e,title:t,body:n}){const r=Wr(s=>s.setCrumbs);return b.useEffect(()=>r([]),[r]),a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx("div",{className:"mx-auto max-w-5xl px-8 py-12",children:a.jsx(Ec,{kicker:e,title:t,children:a.jsx("p",{className:"max-w-md text-text-muted",children:n})})})})}const $u="ring-focus w-full rounded-control border border-border bg-surface-2 px-2.5 py-1.5 font-mono text-sm outline-none focus:border-primary disabled:opacity-70";function q1(e){const t=[];return e.type&&t.push(e.type),e.minimum!==void 0&&t.push(`≥ ${e.minimum}`),e.maximum!==void 0&&t.push(`≤ ${e.maximum}`),t.join(" · ")}function mP({prop:e,disabled:t}){const n=e.default;return e.enum&&e.enum.length>0?a.jsx("select",{className:$u,disabled:t,defaultValue:n,children:e.enum.map(r=>a.jsx("option",{value:String(r),children:String(r)},String(r)))}):e.type==="boolean"?a.jsx("input",{type:"checkbox",disabled:t,defaultChecked:!!n,className:"h-4 w-4 accent-[var(--primary)]"}):e.type==="number"||e.type==="integer"?a.jsx("input",{type:"number",disabled:t,min:e.minimum,max:e.maximum,step:e.type==="integer"?1:"any",defaultValue:n,placeholder:q1(e),className:$u}):a.jsx("input",{type:"text",disabled:t,defaultValue:n,placeholder:e.type??"string",className:$u})}function pP({schema:e,disabled:t=!1}){const n=e.properties??{},r=Object.keys(n),s=new Set(e.required??[]);return r.length===0?a.jsx("p",{className:"text-xs text-text-faint",children:"No configurable parameters."}):a.jsx("div",{className:"flex flex-col gap-3",children:r.map(i=>{const o=n[i];return a.jsxs("label",{className:"block",children:[a.jsxs("span",{className:"flex items-baseline justify-between",children:[a.jsxs("span",{className:"text-xs font-medium text-text",children:[o.title??i,s.has(i)&&a.jsx("span",{className:"text-primary",children:" *"})]}),a.jsx("span",{className:"font-mono text-[10px] text-text-faint",children:q1(o)})]}),a.jsx("span",{className:"mt-1 block",children:a.jsx(mP,{prop:o,disabled:t})}),o.description&&a.jsx("span",{className:"mt-1 block text-[11px] text-text-muted",children:o.description})]},i)})})}const xP=[{kind:"distribution",label:"Distributions",blurb:"Sampling distributions for a feature's values.",icon:Ck},{kind:"structural_fn",label:"Structural functions",blurb:"Causal/SEM edge equations.",icon:Q0},{kind:"failure_mode",label:"Failure modes",blurb:"Corruption transforms (missingness, noise, drift…).",icon:vk},{kind:"exporter",label:"Exporters",blurb:"Output formats and adapters.",icon:T0},{kind:"probe_model",label:"Probe models",blurb:"Difficulty baselines whose score sets the target.",icon:_k}];function gP(){const e=Wr(o=>o.setCrumbs);b.useEffect(()=>e([]),[e]);const{data:t,isLoading:n,isError:r}=Wt({queryKey:["plugins"],queryFn:pe.listPlugins}),s=t??[],i=s.filter(o=>!o.builtin).length;return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-12",children:[a.jsxs("header",{className:"mb-8",children:[a.jsx(se,{children:"Ecosystem"}),a.jsx("h1",{className:"mt-1 font-serif text-3xl text-text",children:"Plugins"}),a.jsxs("p",{className:"mt-2 max-w-2xl text-text-muted",children:["Every capability available to a run — core built-ins plus plugins discovered from installed ",a.jsx("code",{className:"font-mono text-sm",children:"datadoom-plugin-*"})," packages and your local plugins directory. Offline; no marketplace."]}),!n&&!r&&a.jsxs("p",{className:"mt-3 text-sm text-text-faint",children:[s.length," capabilities · ",s.length-i," core ·"," ",i," third-party"]})]}),n&&a.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[a.jsx(Gn,{})," Loading registry…"]}),r&&a.jsx(Ec,{kicker:"Unavailable",title:"Couldn't load plugins",children:a.jsx("p",{className:"text-text-muted",children:"The plugin registry endpoint did not respond."})}),!n&&!r&&a.jsxs("div",{className:"flex flex-col gap-10",children:[xP.map(({kind:o,label:l,blurb:c,icon:u})=>{const f=s.filter(d=>d.kind===o);return f.length===0?null:a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[a.jsx(u,{size:18,className:"text-text-muted"}),a.jsx("h2",{className:"font-serif text-xl text-text",children:l}),a.jsx("span",{className:"rounded-pill bg-surface-2 px-2 py-0.5 font-mono text-[11px] text-text-muted",children:f.length})]}),a.jsx("p",{className:"mb-4 text-sm text-text-faint",children:c}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:f.map(d=>a.jsx(yP,{plugin:d},`${d.kind}:${d.name}`))})]},o)}),a.jsx(wP,{})]})]})})}function yP({plugin:e}){return a.jsxs(fe,{className:"flex flex-col gap-3 p-4",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-mono text-sm font-medium text-text",children:e.name}),e.version&&a.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-text-faint",children:["v",e.version]})]}),a.jsx(vP,{plugin:e})]}),e.schema?a.jsxs("div",{className:"rounded-control border border-border bg-surface-1 p-3",children:[a.jsx("div",{className:"mb-2 text-[11px] font-medium uppercase tracking-wide text-text-faint",children:"Parameters"}),a.jsx(pP,{schema:e.schema,disabled:!0})]}):!e.builtin&&a.jsx("p",{className:"text-xs text-text-faint",children:"No declared parameter schema."})]})}function vP({plugin:e}){return e.builtin?a.jsx("span",{className:"shrink-0 rounded-pill bg-surface-2 px-2 py-0.5 text-[11px] font-medium text-text-muted",children:"core"}):a.jsxs("span",{className:ee("shrink-0 rounded-pill px-2 py-0.5 text-[11px] font-medium","bg-primary-tint text-primary"),title:`Discovered via ${e.source==="local"?"the local plugins directory":"a Python entry point"}`,children:["plugin · ",e.source]})}function wP(){return a.jsxs(fe,{className:"flex gap-4 p-5",children:[a.jsx(W0,{size:20,className:"mt-0.5 shrink-0 text-text-muted"}),a.jsxs("div",{className:"text-sm text-text-muted",children:[a.jsx("div",{className:"font-medium text-text",children:"Add a capability"}),a.jsxs("p",{className:"mt-1 max-w-2xl",children:["Scaffold a plugin with"," ",a.jsx("code",{className:"font-mono text-xs",children:"datadoom plugin new <kind> <name>"}),", implement it against the engine ABC using the injected seeded RNG, then"," ",a.jsx("code",{className:"font-mono text-xs",children:"pip install -e ."})," — it appears here and in the Canvas automatically. Drop a ",a.jsx("code",{className:"font-mono text-xs",children:".py"})," in"," ",a.jsx("code",{className:"font-mono text-xs",children:"$DATADOOM_HOME/plugins/"})," for quick experiments. Validate with ",a.jsx("code",{className:"font-mono text-xs",children:"datadoom plugin check"}),"."]})]})]})}function bP(){const e=Wr(h=>h.setCrumbs);b.useEffect(()=>e([]),[e]);const t=As(),{data:n,isLoading:r,isError:s}=Wt({queryKey:["templates"],queryFn:pe.listTemplates}),i=Yt({mutationFn:async h=>{const x=await pe.getTemplate(h.id);return pe.createDataset({name:x.name,description:x.description,spec:x.spec})},onSuccess:h=>t(`/datasets/${h.dataset_id}`),onError:h=>Cn(h.message,"error")}),[o,l]=b.useState("all"),c=[...n??[]].sort((h,x)=>h.level!==x.level?h.level==="hackathon"?-1:1:h.domain===x.domain?h.name.localeCompare(x.name):h.domain.localeCompare(x.domain)),u=o==="all"?c:c.filter(h=>h.level===o),f=new Set(u.map(h=>h.domain)).size,d=c.filter(h=>h.level==="hackathon").length;return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"mx-auto max-w-6xl px-8 py-12",children:[a.jsxs("header",{className:"mb-8",children:[a.jsx(se,{children:"Collections"}),a.jsx("h1",{className:"mt-1 font-serif text-3xl text-text",children:"Templates"}),a.jsxs("p",{className:"mt-2 max-w-2xl text-text-muted",children:["Curated, ready-to-run domain datasets. Start from one in a click — it opens in the Canvas as a new dataset you can edit, then generate. ",a.jsx("span",{className:"text-text",children:"Hackathon"})," ","challenges are enterprise-grade ML problems — deep causal structure, a hidden confounder, realistic data-quality failures and a calibrated difficulty band."]}),!r&&!s&&a.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[a.jsx("div",{className:"inline-flex rounded-pill border border-border bg-surface p-0.5 text-sm",children:["all","hackathon","starter"].map(h=>a.jsx("button",{onClick:()=>l(h),className:"rounded-pill px-3 py-1 capitalize transition-colors "+(o===h?"bg-primary text-white":"text-text-muted hover:text-text"),children:h==="hackathon"?`Hackathon (${d})`:h},h))}),a.jsxs("p",{className:"text-sm text-text-faint",children:[u.length," templates across ",f," domains"]})]})]}),r&&a.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[a.jsx(Gn,{})," Loading templates…"]}),s&&a.jsx(Ec,{kicker:"Unavailable",title:"Couldn't load templates",children:a.jsx("p",{className:"text-text-muted",children:"The templates endpoint did not respond."})}),!r&&!s&&a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:u.map(h=>a.jsx(jP,{t:h,busy:i.isPending,onUse:()=>i.mutate(h)},h.id))})]})})}function jP({t:e,busy:t,onUse:n}){return a.jsxs(fe,{className:"flex h-full flex-col gap-3 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"rounded-pill bg-primary-tint px-2.5 py-0.5 text-[11px] font-medium text-primary",children:e.domain}),e.level==="hackathon"&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-pill bg-warning-tint px-2.5 py-0.5 text-[11px] font-medium text-text",children:[a.jsx(zk,{size:12})," Hackathon"]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-serif text-lg leading-tight text-text",children:e.name}),a.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-text-muted",children:e.description})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-3 pt-1",children:[a.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.tags.map(r=>a.jsx("span",{className:"rounded-pill bg-surface-2 px-2 py-0.5 font-mono text-[10px] text-text-muted",children:r},r))}),a.jsxs(me,{variant:"primary",className:"w-full justify-center",disabled:t,onClick:n,children:[a.jsx(yh,{size:15})," Use this template ",a.jsx(KN,{size:15})]})]})]})}function NP(){return a.jsx(xS,{children:a.jsxs(PN,{children:[a.jsx(pn,{path:"/",element:a.jsx(Np,{to:"/datasets",replace:!0})}),a.jsx(pn,{path:"/datasets",element:a.jsx(jS,{})}),a.jsx(pn,{path:"/datasets/:id",element:a.jsx(CM,{})}),a.jsx(pn,{path:"/datasets/:id/run/:runId",element:a.jsx(TM,{})}),a.jsx(pn,{path:"/datasets/:id/results/:runId",element:a.jsx(iP,{})}),a.jsx(pn,{path:"/templates",element:a.jsx(bP,{})}),a.jsx(pn,{path:"/plugins",element:a.jsx(gP,{})}),a.jsx(pn,{path:"/settings",element:a.jsx(hP,{kicker:"Preferences",title:"Settings",body:"DataDoom runs in a single, carefully tuned light theme. Storage and generation defaults land alongside team mode."})}),a.jsx(pn,{path:"*",element:a.jsx(Np,{to:"/datasets",replace:!0})})]})})}const kP=new _j({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});Tu.createRoot(document.getElementById("root")).render(a.jsx(O.StrictMode,{children:a.jsx(Mj,{client:kP,children:a.jsx(FN,{children:a.jsx(NP,{})})})}));