locust-cloud 1.10.0__py3-none-any.whl → 1.11.1__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.
- locust_cloud/auth.py +9 -8
- locust_cloud/cloud.py +4 -2
- locust_cloud/timescale/queries.py +1 -1
- locust_cloud/webui/dist/assets/{index-DkFumpSS.js → index-DYD7wLyS.js} +1 -1
- locust_cloud/webui/dist/index.html +1 -1
- locust_cloud/webui/tsconfig.tsbuildinfo +1 -1
- {locust_cloud-1.10.0.dist-info → locust_cloud-1.11.1.dist-info}/METADATA +1 -1
- {locust_cloud-1.10.0.dist-info → locust_cloud-1.11.1.dist-info}/RECORD +10 -10
- {locust_cloud-1.10.0.dist-info → locust_cloud-1.11.1.dist-info}/WHEEL +0 -0
- {locust_cloud-1.10.0.dist-info → locust_cloud-1.11.1.dist-info}/entry_points.txt +0 -0
locust_cloud/auth.py
CHANGED
@@ -87,7 +87,7 @@ def register_auth(environment: locust.env.Environment):
|
|
87
87
|
|
88
88
|
credentials = auth_response.json()
|
89
89
|
|
90
|
-
if os.getenv("CUSTOMER_ID", "") and credentials["
|
90
|
+
if os.getenv("CUSTOMER_ID", "") and credentials["customer_id"] != os.getenv("CUSTOMER_ID", ""):
|
91
91
|
session["auth_error"] = "Invalid login for this deployment"
|
92
92
|
return redirect(url_for("locust.login"))
|
93
93
|
|
@@ -133,10 +133,11 @@ def register_auth(environment: locust.env.Environment):
|
|
133
133
|
"label": "Username",
|
134
134
|
"name": "username",
|
135
135
|
"is_required": True,
|
136
|
+
"type": "email",
|
136
137
|
},
|
137
138
|
{
|
138
139
|
"label": "Full Name",
|
139
|
-
"name": "
|
140
|
+
"name": "customer_name",
|
140
141
|
"is_required": True,
|
141
142
|
},
|
142
143
|
{
|
@@ -181,7 +182,7 @@ def register_auth(environment: locust.env.Environment):
|
|
181
182
|
session["auth_info"] = ""
|
182
183
|
|
183
184
|
username = request.form.get("username", "")
|
184
|
-
|
185
|
+
customer_name = request.form.get("customer_name", "")
|
185
186
|
password = request.form.get("password")
|
186
187
|
access_code = request.form.get("access_code")
|
187
188
|
|
@@ -193,9 +194,9 @@ def register_auth(environment: locust.env.Environment):
|
|
193
194
|
|
194
195
|
auth_response.raise_for_status()
|
195
196
|
|
196
|
-
session["
|
197
|
+
session["user_sub_id"] = auth_response.json().get("user_sub_id")
|
197
198
|
session["username"] = username
|
198
|
-
session["
|
199
|
+
session["customer_name"] = customer_name
|
199
200
|
session["auth_info"] = (
|
200
201
|
"Please check your email and enter the confirmation code. If you didn't get a code after one minute, you can [request a new one](/resend-code)"
|
201
202
|
)
|
@@ -212,7 +213,7 @@ def register_auth(environment: locust.env.Environment):
|
|
212
213
|
def resend_code():
|
213
214
|
try:
|
214
215
|
auth_response = requests.post(
|
215
|
-
f"{environment.parsed_options.deployer_url}/
|
216
|
+
f"{environment.parsed_options.deployer_url}/auth/resend-confirmation",
|
216
217
|
json={"username": session["username"]},
|
217
218
|
)
|
218
219
|
|
@@ -242,8 +243,8 @@ def register_auth(environment: locust.env.Environment):
|
|
242
243
|
f"{environment.parsed_options.deployer_url}/auth/confirm-signup",
|
243
244
|
json={
|
244
245
|
"username": session.get("username"),
|
245
|
-
"
|
246
|
-
"
|
246
|
+
"customer_name": session.get("customer_name"),
|
247
|
+
"user_sub_id": session["user_sub_id"],
|
247
248
|
"confirmation_code": confirmation_code,
|
248
249
|
},
|
249
250
|
)
|
locust_cloud/cloud.py
CHANGED
@@ -102,7 +102,7 @@ advanced.add_argument(
|
|
102
102
|
advanced.add_argument(
|
103
103
|
"--region",
|
104
104
|
type=str,
|
105
|
-
default=
|
105
|
+
default=os.environ.get("AWS_DEFAULT_REGION"),
|
106
106
|
help="Sets the AWS region to use for the deployed cluster, e.g. us-east-1. It defaults to use AWS_DEFAULT_REGION env var, like AWS tools.",
|
107
107
|
)
|
108
108
|
parser.add_argument(
|
@@ -172,7 +172,7 @@ logging.getLogger("requests").setLevel(logging.INFO)
|
|
172
172
|
logging.getLogger("urllib3").setLevel(logging.INFO)
|
173
173
|
|
174
174
|
|
175
|
-
api_url = f"https://api.{options.region}.locust.cloud/1"
|
175
|
+
api_url = os.environ.get("LOCUSTCLOUD_DEPLOYER_URL", f"https://api.{options.region}.locust.cloud/1")
|
176
176
|
|
177
177
|
|
178
178
|
def main() -> None:
|
@@ -181,6 +181,8 @@ def main() -> None:
|
|
181
181
|
"Setting a region is required to use Locust Cloud. Please ensure the AWS_DEFAULT_REGION env variable or the --region flag is set."
|
182
182
|
)
|
183
183
|
sys.exit(1)
|
184
|
+
if options.region:
|
185
|
+
os.environ["AWS_DEFAULT_REGION"] = options.region
|
184
186
|
|
185
187
|
s3_bucket = "dmdb-default" if options.region == "us-east-1" else "locust-default"
|
186
188
|
deployments: list[Any] = []
|
@@ -267,7 +267,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
267
267
|
<span style="color:${f};">
|
268
268
|
${d}: ${bgt({chartValueFormatter:i,value:h})}
|
269
269
|
</span>
|
270
|
-
`,""):"No data",borderWidth:0},xAxis:{type:"time",min:(e.time||[new Date().toISOString()])[0],startValue:(e.time||[])[0],axisLabel:{formatter:_gt}},grid:{left:60,right:40},yAxis:xgt({splitAxis:a,yAxisLabels:o}),series:LSe({charts:e,lines:r,scatterplot:s}),color:n,toolbox:{right:10,feature:{dataZoom:{title:{zoom:"Zoom Select",back:"Zoom Reset"},yAxisIndex:!1},saveAsImage:{name:t.replace(/\s+/g,"_").toLowerCase()+"_"+new Date().getTime()/1e3,title:"Download as PNG",emphasis:{iconStyle:{textPosition:"left"}}}}}}),wgt=e=>({symbol:"none",label:{formatter:t=>`Run #${t.dataIndex+1}`,padding:[0,0,8,0]},data:(e.markers||[]).map(t=>({xAxis:t}))}),Cgt=e=>t=>{const{batch:r}=t;if(!r)return;const[{start:n,startValue:i,end:a}]=r,o=n>0&&a<=100||i>0;e.setOption({dataZoom:[{type:"slider",show:o}]})};function Bl({charts:e,title:t,lines:r,colors:n,chartValueFormatter:i,splitAxis:a,yAxisLabels:o,scatterplot:s,shouldReplaceMergeLines:l=!1}){const[u,c]=O.useState(null),f=mo(({theme:{isDarkMode:h}})=>h),d=O.useRef(null);return O.useEffect(()=>{if(!d.current)return;const h=utt(d.current);h.setOption(Sgt({charts:e,title:t,lines:r,colors:n,chartValueFormatter:i,splitAxis:a,yAxisLabels:o,scatterplot:s})),h.on("datazoom",Cgt(h));const p=()=>h.resize();return window.addEventListener("resize",p),h.group="swarmCharts",ctt("swarmCharts"),c(h),()=>{ftt(h),window.removeEventListener("resize",p)}},[d]),O.useEffect(()=>{const h=r.every(({key:p})=>!!e[p]);u&&h&&u.setOption({series:r.map(({key:p,yAxisIndex:v,...g},y)=>({...g,data:e[p],...a?{yAxisIndex:v||y}:{},...y===0?{markLine:wgt(e)}:{}}))})},[e,u,r]),O.useEffect(()=>{if(u){const{textColor:h,axisColor:p,backgroundColor:v,splitLine:g}=f?Zre.DARK:Zre.LIGHT;u.setOption({backgroundColor:v,textStyle:{color:h},title:{textStyle:{color:h}},legend:{icon:"circle",inactiveColor:h,textStyle:{color:h}},tooltip:{backgroundColor:v,textStyle:{color:h}},xAxis:{axisLine:{lineStyle:{color:p}}},yAxis:{axisLine:{lineStyle:{color:p}},splitLine:{lineStyle:{color:g}}}})}},[u,f]),O.useEffect(()=>{u&&u.setOption({series:LSe({charts:e,lines:r,scatterplot:s})},l?{replaceMerge:["series"]}:void 0)},[r]),H.jsx("div",{ref:d,style:{width:"100%",height:"300px"}})}const Tgt=lu.percentilesToChart?lu.percentilesToChart.map(e=>({name:`${e*100}th percentile`,key:`responseTimePercentile${e}`})):[],Mgt=["#ff9f00","#9966CC","#8A2BE2","#8E4585","#E0B0FF","#C8A2C8","#E6E6FA"],Igt=[{title:"Total Requests per Second",lines:[{name:"RPS",key:"currentRps"},{name:"Failures/s",key:"currentFailPerSec"}],colors:["#00ca5a","#ff6d6d"]},{title:"Response Times (ms)",lines:Tgt,colors:Mgt},{title:"Number of Users",lines:[{name:"Number of Users",key:"userCount"}],colors:["#0099ff"]}];function Agt({charts:e}){return H.jsx("div",{children:Igt.map((t,r)=>H.jsx(Bl,{...t,charts:e},`swarm-chart-${r}`))})}const kgt=({ui:{charts:e}})=>({charts:e}),Dgt=ho(kgt)(Agt);function Pgt(e){return(e*100).toFixed(1)+"%"}function dV({classRatio:e}){return H.jsx("ul",{children:Object.entries(e).map(([t,{ratio:r,tasks:n}])=>H.jsxs("li",{children:[`${Pgt(r)} ${t}`,n&&H.jsx(dV,{classRatio:n})]},`nested-ratio-${t}`))})}function Lgt({ratios:{perClass:e,total:t}}){return!e&&!t?null:H.jsxs("div",{children:[e&&H.jsxs(H.Fragment,{children:[H.jsx("h3",{children:"Ratio Per Class"}),H.jsx(dV,{classRatio:e})]}),t&&H.jsxs(H.Fragment,{children:[H.jsx("h3",{children:"Total Ratio"}),H.jsx(dV,{classRatio:t})]})]})}const Rgt=({ui:{ratios:e}})=>({ratios:e}),Egt=ho(Rgt)(Lgt);function Ogt(){const{data:e,refetch:t}=uYe(),r=Qu(Ub.setUi),n=mo(({swarm:a})=>a.state),i=n===Ut.SPAWNING||n==Ut.RUNNING;O.useEffect(()=>{e&&r({ratios:e})},[e]),Mv(t,5e3,{shouldRunInterval:i,immediate:!0})}function Ngt(){return Ogt(),H.jsx(Egt,{})}const zgt=[{key:"id",title:"Worker"},{key:"state",title:"State"},{key:"userCount",title:"# users"},{key:"cpuUsage",title:"CPU usage"},{key:"memoryUsage",title:"Memory usage",formatter:FHe}];function Bgt({workers:e=[]}){return H.jsx(Td,{defaultSortKey:"id",rows:e,structure:zgt})}const Fgt=({ui:{workers:e}})=>({workers:e}),Vgt=ho(Fgt)(Bgt),zo={stats:{component:xqe,key:"stats",title:"Statistics"},charts:{component:Dgt,key:"charts",title:"Charts"},failures:{component:tqe,key:"failures",title:"Failures"},exceptions:{component:KYe,key:"exceptions",title:"Exceptions"},ratios:{component:Ngt,key:"ratios",title:"Current Ratio"},reports:{component:lqe,key:"reports",title:"Download Data"},logs:{component:aqe,key:Gge,title:"Logs"},workers:{component:Vgt,key:"workers",title:"Workers",shouldDisplayTab:e=>e.swarm.isDistributed}},RSe=[zo.stats,zo.charts,zo.failures,zo.exceptions,zo.ratios,zo.reports,zo.logs,zo.workers],$gt=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);window.history.pushState(null,"",t)},Ggt=()=>window.location.search?BHe(window.location.search):null,Wgt={query:Ggt()},ESe=jo({name:"url",initialState:Wgt,reducers:{setUrl:$1}}),Hgt=ESe.actions,jgt=ESe.reducer;function Ugt({hasNotification:e,title:t}){return H.jsxs(Vt,{sx:{display:"flex",alignItems:"center"},children:[e&&H.jsx(GW,{color:"secondary"}),H.jsx("span",{children:t})]})}function Ygt({currentTabIndexFromQuery:e,notification:t,setNotification:r,setUrl:n,tabs:i}){const[a,o]=O.useState(e),s=(l,u)=>{const c=i[u].key;t[c]&&r({[c]:!1}),$gt({tab:c}),n({query:{tab:c}}),o(u)};return O.useEffect(()=>{o(e)},[e]),H.jsxs(qd,{maxWidth:"xl",children:[H.jsx(Vt,{sx:{mb:2},children:H.jsx(_$e,{onChange:s,value:a,children:i.map(({key:l,title:u},c)=>H.jsx(bVe,{label:H.jsx(Ugt,{hasNotification:t[l],title:u})},`tab-${c}`))})}),i.map(({component:l=GYe},u)=>a===u&&H.jsx(l,{},`tabpabel-${u}`))]})}const qgt=(e,{tabs:t,extendedTabs:r})=>{const{notification:n,swarm:{extendedTabs:i},url:{query:a}}=e,o=(t||[...RSe,...r||i||[]]).filter(({shouldDisplayTab:l})=>!l||l&&l(e)),s=a&&a.tab?o.findIndex(({key:l})=>l===a.tab):0;return{notification:n,tabs:o,currentTabIndexFromQuery:s>-1?s:0}},Xgt={setNotification:Hge.setNotification,setUrl:Hgt.setUrl},OSe=ho(qgt,Xgt)(Ygt),Zgt=e=>W6({palette:{mode:e,primary:{main:"#15803d"},success:{main:"#00C853"}},components:{MuiCssBaseline:{styleOverrides:{":root":{"--footer-height":"40px"},p:{margin:0}}}}});function NSe(){const e=mo(({theme:{isDarkMode:t}})=>t);return O.useMemo(()=>Zgt(e?su.DARK:su.LIGHT),[e])}const Qre=2e3;function zSe(){const e=Qu(VW.setSwarm),t=Qu(Ub.setUi),r=Qu(Ub.updateCharts),n=Qu(Ub.updateChartMarkers),i=mo(({swarm:d})=>d),a=O.useRef(i.state),[o,s]=O.useState(!1),{data:l,refetch:u}=lYe(),c=i.state===Ut.SPAWNING||i.state==Ut.RUNNING,f=()=>{if(!l)return;const{currentResponseTimePercentiles:d,extendedStats:h,stats:p,errors:v,totalRps:g,totalFailPerSec:y,failRatio:m,workers:x,userCount:_,totalAvgResponseTime:S}=l,b=new Date().toISOString();o&&(s(!1),n(b));const w=Vf(g,2),C=Vf(y,2),T=Vf(m*100),M={...Object.entries(d).reduce((I,[A,k])=>({...I,[A]:[b,k||0]}),{}),currentRps:[b,w],currentFailPerSec:[b,C],totalAvgResponseTime:[b,Vf(S,2)],userCount:[b,_],time:b};t({extendedStats:h,stats:p,errors:v,totalRps:w,failRatio:T,workers:x,userCount:_}),r(M)};O.useEffect(()=>{l&&e({state:l.state})},[l&&l.state]),Mv(f,Qre,{shouldRunInterval:!!l&&c}),Mv(u,Qre,{shouldRunInterval:c}),O.useEffect(()=>{i.state===Ut.RUNNING&&a.current===Ut.STOPPED&&s(!0),a.current=i.state},[i.state,a])}function Kgt({swarmState:e,tabs:t,extendedTabs:r}){zSe(),Yge();const n=NSe();return H.jsxs(aWe,{theme:n,children:[H.jsx(tWe,{}),H.jsx(MYe,{children:e===Ut.READY?H.jsx(tL,{}):H.jsx(OSe,{extendedTabs:r,tabs:t})})]})}const Qgt=({swarm:{state:e}})=>({swarmState:e});ho(Qgt)(Kgt);const Jgt=pW({[DA.reducerPath]:DA.reducer,logViewer:LYe,notification:AYe,swarm:vYe,theme:EHe,ui:ZYe,url:jgt}),eyt=cHe({reducer:Jgt,middleware:e=>e().concat(DA.middleware)});var hV={},Jre=OG;hV.createRoot=Jre.createRoot,hV.hydrateRoot=Jre.hydrateRoot;var Kj={},v5={};const tyt=Vc(cEe);var ene;function ryt(){return ene||(ene=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=tyt}(v5)),v5}var nyt=F6;Object.defineProperty(Kj,"__esModule",{value:!0});var BSe=Kj.default=void 0,iyt=nyt(ryt()),ayt=W;BSe=Kj.default=(0,iyt.default)((0,ayt.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function ti(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oyt=typeof Symbol=="function"&&Symbol.observable||"@@observable",tne=oyt,g5=()=>Math.random().toString(36).substring(7).split("").join("."),syt={INIT:`@@redux/INIT${g5()}`,REPLACE:`@@redux/REPLACE${g5()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${g5()}`},Ik=syt;function Su(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function FSe(e,t,r){if(typeof e!="function")throw new Error(ti(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ti(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ti(1));return r(FSe)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,l=!1;function u(){o===a&&(o=new Map,a.forEach((g,y)=>{o.set(y,g)}))}function c(){if(l)throw new Error(ti(3));return i}function f(g){if(typeof g!="function")throw new Error(ti(4));if(l)throw new Error(ti(5));let y=!0;u();const m=s++;return o.set(m,g),function(){if(y){if(l)throw new Error(ti(6));y=!1,u(),o.delete(m),a=null}}}function d(g){if(!Su(g))throw new Error(ti(7));if(typeof g.type>"u")throw new Error(ti(8));if(typeof g.type!="string")throw new Error(ti(17));if(l)throw new Error(ti(9));try{l=!0,i=n(i,g)}finally{l=!1}return(a=o).forEach(m=>{m()}),g}function h(g){if(typeof g!="function")throw new Error(ti(10));n=g,d({type:Ik.REPLACE})}function p(){const g=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(ti(11));function m(){const _=y;_.next&&_.next(c())}return m(),{unsubscribe:g(m)}},[tne](){return this}}}return d({type:Ik.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:h,[tne]:p}}function lyt(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Ik.INIT})>"u")throw new Error(ti(12));if(typeof r(void 0,{type:Ik.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ti(13))})}function Qj(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let i;try{lyt(r)}catch(a){i=a}return function(o={},s){if(i)throw i;let l=!1;const u={};for(let c=0;c<n.length;c++){const f=n[c],d=r[f],h=o[f],p=d(h,s);if(typeof p>"u")throw s&&s.type,new Error(ti(14));u[f]=p,l=l||p!==h}return l=l||n.length!==Object.keys(o).length,l?u:o}}function Ak(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function uyt(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(ti(15))};const o={getState:i.getState,dispatch:(l,...u)=>a(l,...u)},s=e.map(l=>l(o));return a=Ak(...s)(i.dispatch),{...i,dispatch:a}}}function VSe(e){return Su(e)&&"type"in e&&typeof e.type=="string"}var Jj=Symbol.for("immer-nothing"),lS=Symbol.for("immer-draftable"),Ea=Symbol.for("immer-state");function oi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ev=Object.getPrototypeOf;function wu(e){return!!e&&!!e[Ea]}function ul(e){var t;return e?$Se(e)||Array.isArray(e)||!!e[lS]||!!((t=e.constructor)!=null&&t[lS])||cC(e)||fC(e):!1}var cyt=Object.prototype.constructor.toString();function $Se(e){if(!e||typeof e!="object")return!1;const t=Ev(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===cyt}function fyt(e){return wu(e)||oi(15,e),e[Ea].base_}function Bw(e,t){Ov(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Ov(e){const t=e[Ea];return t?t.type_:Array.isArray(e)?1:cC(e)?2:fC(e)?3:0}function Fw(e,t){return Ov(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y5(e,t){return Ov(e)===2?e.get(t):e[t]}function GSe(e,t,r){const n=Ov(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function dyt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cC(e){return e instanceof Map}function fC(e){return e instanceof Set}function lp(e){return e.copy_||e.base_}function pV(e,t){if(cC(e))return new Map(e);if(fC(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=$Se(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ea];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const o=i[a],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(Ev(e),n)}else{const n=Ev(e);if(n!==null&&r)return{...e};const i=Object.create(n);return Object.assign(i,e)}}function e8(e,t=!1){return WL(e)||wu(e)||!ul(e)||(Ov(e)>1&&(e.set=e.add=e.clear=e.delete=hyt),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>e8(n,!0))),e}function hyt(){oi(2)}function WL(e){return Object.isFrozen(e)}var vV={};function Nv(e){const t=vV[e];return t||oi(0,e),t}function pyt(e,t){vV[e]||(vV[e]=t)}var Vw;function WSe(){return Vw}function vyt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rne(e,t){t&&(Nv("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gV(e){yV(e),e.drafts_.forEach(gyt),e.drafts_=null}function yV(e){e===Vw&&(Vw=e.parent_)}function nne(e){return Vw=vyt(Vw,e)}function gyt(e){const t=e[Ea];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ine(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ea].modified_&&(gV(t),oi(4)),ul(e)&&(e=kk(t,e),t.parent_||Dk(t,e)),t.patches_&&Nv("Patches").generateReplacementPatches_(r[Ea].base_,e,t.patches_,t.inversePatches_)):e=kk(t,r,[]),gV(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Jj?e:void 0}function kk(e,t,r){if(WL(t))return t;const n=t[Ea];if(!n)return Bw(t,(i,a)=>ane(e,n,t,i,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Dk(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const i=n.copy_;let a=i,o=!1;n.type_===3&&(a=new Set(i),i.clear(),o=!0),Bw(a,(s,l)=>ane(e,n,i,s,l,r,o)),Dk(e,i,!1),r&&e.patches_&&Nv("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ane(e,t,r,n,i,a,o){if(wu(i)){const s=a&&t&&t.type_!==3&&!Fw(t.assigned_,n)?a.concat(n):void 0,l=kk(e,i,s);if(GSe(r,n,l),wu(l))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(ul(i)&&!WL(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;kk(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Dk(e,i)}}function Dk(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&e8(t,r)}function yyt(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:WSe(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=t8;r&&(i=[n],a=$w);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}var t8={get(e,t){if(t===Ea)return e;const r=lp(e);if(!Fw(r,t))return myt(e,r,t);const n=r[t];return e.finalized_||!ul(n)?n:n===m5(e.base_,t)?(x5(e),e.copy_[t]=xV(n,e)):n},has(e,t){return t in lp(e)},ownKeys(e){return Reflect.ownKeys(lp(e))},set(e,t,r){const n=HSe(lp(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=m5(lp(e),t),a=i==null?void 0:i[Ea];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(dyt(r,i)&&(r!==void 0||Fw(e.base_,t)))return!0;x5(e),mV(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return m5(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,x5(e),mV(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=lp(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){oi(11)},getPrototypeOf(e){return Ev(e.base_)},setPrototypeOf(){oi(12)}},$w={};Bw(t8,(e,t)=>{$w[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});$w.deleteProperty=function(e,t){return $w.set.call(this,e,t,void 0)};$w.set=function(e,t,r){return t8.set.call(this,e[0],t,r,e[0])};function m5(e,t){const r=e[Ea];return(r?lp(r):e)[t]}function myt(e,t,r){var i;const n=HSe(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function HSe(e,t){if(!(t in e))return;let r=Ev(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ev(r)}}function mV(e){e.modified_||(e.modified_=!0,e.parent_&&mV(e.parent_))}function x5(e){e.copy_||(e.copy_=pV(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xyt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const o=this;return function(l=a,...u){return o.produce(l,c=>r.call(this,c,...u))}}typeof r!="function"&&oi(6),n!==void 0&&typeof n!="function"&&oi(7);let i;if(ul(t)){const a=nne(this),o=xV(t,void 0);let s=!0;try{i=r(o),s=!1}finally{s?gV(a):yV(a)}return rne(a,n),ine(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Jj&&(i=void 0),this.autoFreeze_&&e8(i,!0),n){const a=[],o=[];Nv("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else oi(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,l=>t(l,...s));let n,i;return[this.produce(t,r,(o,s)=>{n=o,i=s}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ul(e)||oi(8),wu(e)&&(e=_yt(e));const t=nne(this),r=xV(e,void 0);return r[Ea].isManual_=!0,yV(t),r}finishDraft(e,t){const r=e&&e[Ea];(!r||!r.isManual_)&&oi(9);const{scope_:n}=r;return rne(n,t),ine(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=Nv("Patches").applyPatches_;return wu(e)?n(e,t):this.produce(e,i=>n(i,t))}};function xV(e,t){const r=cC(e)?Nv("MapSet").proxyMap_(e,t):fC(e)?Nv("MapSet").proxySet_(e,t):yyt(e,t);return(t?t.scope_:WSe()).drafts_.push(r),r}function _yt(e){return wu(e)||oi(10,e),jSe(e)}function jSe(e){if(!ul(e)||WL(e))return e;const t=e[Ea];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=pV(e,t.scope_.immer_.useStrictShallowCopy_)}else r=pV(e,!0);return Bw(r,(n,i)=>{GSe(r,n,jSe(i))}),t&&(t.finalized_=!1),r}function byt(){const t="replace",r="add",n="remove";function i(d,h,p,v){switch(d.type_){case 0:case 2:return o(d,h,p,v);case 1:return a(d,h,p,v);case 3:return s(d,h,p,v)}}function a(d,h,p,v){let{base_:g,assigned_:y}=d,m=d.copy_;m.length<g.length&&([g,m]=[m,g],[p,v]=[v,p]);for(let x=0;x<g.length;x++)if(y[x]&&m[x]!==g[x]){const _=h.concat([x]);p.push({op:t,path:_,value:f(m[x])}),v.push({op:t,path:_,value:f(g[x])})}for(let x=g.length;x<m.length;x++){const _=h.concat([x]);p.push({op:r,path:_,value:f(m[x])})}for(let x=m.length-1;g.length<=x;--x){const _=h.concat([x]);v.push({op:n,path:_})}}function o(d,h,p,v){const{base_:g,copy_:y}=d;Bw(d.assigned_,(m,x)=>{const _=y5(g,m),S=y5(y,m),b=x?Fw(g,m)?t:r:n;if(_===S&&b===t)return;const w=h.concat(m);p.push(b===n?{op:b,path:w}:{op:b,path:w,value:S}),v.push(b===r?{op:n,path:w}:b===n?{op:r,path:w,value:f(_)}:{op:t,path:w,value:f(_)})})}function s(d,h,p,v){let{base_:g,copy_:y}=d,m=0;g.forEach(x=>{if(!y.has(x)){const _=h.concat([m]);p.push({op:n,path:_,value:x}),v.unshift({op:r,path:_,value:x})}m++}),m=0,y.forEach(x=>{if(!g.has(x)){const _=h.concat([m]);p.push({op:r,path:_,value:x}),v.unshift({op:n,path:_,value:x})}m++})}function l(d,h,p,v){p.push({op:t,path:[],value:h===Jj?void 0:h}),v.push({op:t,path:[],value:d})}function u(d,h){return h.forEach(p=>{const{path:v,op:g}=p;let y=d;for(let S=0;S<v.length-1;S++){const b=Ov(y);let w=v[S];typeof w!="string"&&typeof w!="number"&&(w=""+w),(b===0||b===1)&&(w==="__proto__"||w==="constructor")&&oi(19),typeof y=="function"&&w==="prototype"&&oi(19),y=y5(y,w),typeof y!="object"&&oi(18,v.join("/"))}const m=Ov(y),x=c(p.value),_=v[v.length-1];switch(g){case t:switch(m){case 2:return y.set(_,x);case 3:oi(16);default:return y[_]=x}case r:switch(m){case 1:return _==="-"?y.push(x):y.splice(_,0,x);case 2:return y.set(_,x);case 3:return y.add(x);default:return y[_]=x}case n:switch(m){case 1:return y.splice(_,1);case 2:return y.delete(_);case 3:return y.delete(p.value);default:return delete y[_]}default:oi(17,g)}}),d}function c(d){if(!ul(d))return d;if(Array.isArray(d))return d.map(c);if(cC(d))return new Map(Array.from(d.entries()).map(([p,v])=>[p,c(v)]));if(fC(d))return new Set(Array.from(d).map(c));const h=Object.create(Ev(d));for(const p in d)h[p]=c(d[p]);return Fw(d,lS)&&(h[lS]=d[lS]),h}function f(d){return wu(d)?c(d):d}pyt("Patches",{applyPatches_:u,generatePatches_:i,generateReplacementPatches_:l})}var uo=new xyt,dC=uo.produce,USe=uo.produceWithPatches.bind(uo);uo.setAutoFreeze.bind(uo);uo.setUseStrictShallowCopy.bind(uo);var one=uo.applyPatches.bind(uo);uo.createDraft.bind(uo);uo.finishDraft.bind(uo);function Syt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wyt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Cyt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var sne=e=>Array.isArray(e)?e:[e];function Tyt(e){const t=Array.isArray(e[0])?e[0]:e;return Cyt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Myt(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var Iyt=class{constructor(e){this.value=e}deref(){return this.value}},Ayt=typeof WeakRef<"u"?WeakRef:Iyt,kyt=0,lne=1;function wM(){return{s:kyt,v:void 0,o:null,p:null}}function Pk(e,t={}){let r=wM();const{resultEqualityCheck:n}=t;let i,a=0;function o(){var f;let s=r;const{length:l}=arguments;for(let d=0,h=l;d<h;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let v=s.o;v===null&&(s.o=v=new WeakMap);const g=v.get(p);g===void 0?(s=wM(),v.set(p,s)):s=g}else{let v=s.p;v===null&&(s.p=v=new Map);const g=v.get(p);g===void 0?(s=wM(),v.set(p,s)):s=g}}const u=s;let c;if(s.s===lne)c=s.v;else if(c=e.apply(null,arguments),a++,n){const d=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;d!=null&&n(d,c)&&(c=d,a!==0&&a--),i=typeof c=="object"&&c!==null||typeof c=="function"?new Ayt(c):c}return u.s=lne,u.v=c,c}return o.clearCache=()=>{r=wM(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Dyt(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,s,l={},u=i.pop();typeof u=="object"&&(l=u,u=i.pop()),Syt(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:h=Pk,argsMemoizeOptions:p=[],devModeChecks:v={}}=c,g=sne(d),y=sne(p),m=Tyt(i),x=f(function(){return a++,u.apply(null,arguments)},...g),_=h(function(){o++;const b=Myt(m,arguments);return s=x.apply(null,b),s},...y);return Object.assign(_,{resultFunc:u,memoizedResultFunc:x,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var r8=Dyt(Pk),Pyt=Object.assign((e,t=r8)=>{wyt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((o,s,l)=>(o[r[l]]=s,o),{}))},{withTypes:()=>Pyt});function YSe(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Lyt=YSe(),Ryt=YSe,Eyt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ak:Ak.apply(null,arguments)},Oyt=e=>e&&typeof e.match=="function";function el(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(ro(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>VSe(n)&&n.type===e,r}var qSe=class fb extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,fb.prototype)}static get[Symbol.species](){return fb}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new fb(...t[0].concat(this)):new fb(...t.concat(this))}};function une(e){return ul(e)?dC(e,()=>{}):e}function cne(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(ro(10));const n=r.insert(t,e);return e.set(t,n),n}function Nyt(e){return typeof e=="boolean"}var zyt=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new qSe;return r&&(Nyt(r)?o.push(Lyt):o.push(Ryt(r.extraArgument))),o},Qy="RTK_autoBatch",h_=()=>e=>({payload:e,meta:{[Qy]:!0}}),XSe=e=>t=>{setTimeout(t,e)},Byt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:XSe(10),Fyt=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?Byt:e.type==="callback"?e.queueNotification:XSe(e.timeout),u=()=>{o=!1,a&&(a=!1,s.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const f=()=>i&&c(),d=n.subscribe(f);return s.add(c),()=>{d(),s.delete(c)}},dispatch(c){var f;try{return i=!((f=c==null?void 0:c.meta)!=null&&f[Qy]),a=!i,a&&(o||(o=!0,l(u))),n.dispatch(c)}finally{i=!0}}})},Vyt=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new qSe(e);return n&&i.push(Fyt(typeof n=="object"?n:void 0)),i};function $yt(e){const t=zyt(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof r=="function")s=r;else if(Su(r))s=Qj(r);else throw new Error(ro(1));let l;typeof n=="function"?l=n(t):l=t();let u=Ak;i&&(u=Eyt({trace:!1,...typeof i=="object"&&i}));const c=uyt(...l),f=Vyt(c);let d=typeof o=="function"?o(f):f();const h=u(...d);return FSe(s,a,h)}function ZSe(e){const t={},r=[];let n;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(ro(28));if(s in t)throw new Error(ro(29));return t[s]=o,i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function Gyt(e){return typeof e=="function"}function Wyt(e,t){let[r,n,i]=ZSe(t),a;if(Gyt(e))a=()=>une(e());else{const s=une(e);a=()=>s}function o(s=a(),l){let u=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[i]),u.reduce((c,f)=>{if(f)if(wu(c)){const h=f(c,l);return h===void 0?c:h}else{if(ul(c))return dC(c,d=>f(d,l));{const d=f(c,l);if(d===void 0){if(c===null)return c;throw new Error(ro(9))}return d}}return c},s)}return o.getInitialState=a,o}var KSe=(e,t)=>Oyt(e)?e.match(t):e(t);function Pc(...e){return t=>e.some(r=>KSe(r,t))}function uS(...e){return t=>e.every(r=>KSe(r,t))}function HL(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function hC(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function n8(...e){return e.length===0?t=>HL(t,["pending"]):hC(e)?Pc(...e.map(t=>t.pending)):n8()(e[0])}function l0(...e){return e.length===0?t=>HL(t,["rejected"]):hC(e)?Pc(...e.map(t=>t.rejected)):l0()(e[0])}function jL(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?uS(l0(...e),t):hC(e)?uS(l0(...e),t):jL()(e[0])}function Ed(...e){return e.length===0?t=>HL(t,["fulfilled"]):hC(e)?Pc(...e.map(t=>t.fulfilled)):Ed()(e[0])}function _V(...e){return e.length===0?t=>HL(t,["pending","fulfilled","rejected"]):hC(e)?Pc(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):_V()(e[0])}var Hyt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",QSe=(e=21)=>{let t="",r=e;for(;r--;)t+=Hyt[Math.random()*64|0];return t},jyt=["name","message","stack","code"],_5=class{constructor(e,t){zR(this,"_type");this.payload=e,this.meta=t}},fne=class{constructor(e,t){zR(this,"_type");this.payload=e,this.meta=t}},Uyt=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of jyt)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},dne=(()=>{function e(t,r,n){const i=el(t+"/fulfilled",(l,u,c,f)=>({payload:l,meta:{...f||{},arg:c,requestId:u,requestStatus:"fulfilled"}})),a=el(t+"/pending",(l,u,c)=>({payload:void 0,meta:{...c||{},arg:u,requestId:l,requestStatus:"pending"}})),o=el(t+"/rejected",(l,u,c,f,d)=>({payload:f,error:(n&&n.serializeError||Uyt)(l||"Rejected"),meta:{...d||{},arg:c,requestId:u,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function s(l){return(u,c,f)=>{const d=n!=null&&n.idGenerator?n.idGenerator(l):QSe(),h=new AbortController;let p,v;function g(m){v=m,h.abort()}const y=async function(){var _,S;let m;try{let b=(_=n==null?void 0:n.condition)==null?void 0:_.call(n,l,{getState:c,extra:f});if(qyt(b)&&(b=await b),b===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const w=new Promise((C,T)=>{p=()=>{T({name:"AbortError",message:v||"Aborted"})},h.signal.addEventListener("abort",p)});u(a(d,l,(S=n==null?void 0:n.getPendingMeta)==null?void 0:S.call(n,{requestId:d,arg:l},{getState:c,extra:f}))),m=await Promise.race([w,Promise.resolve(r(l,{dispatch:u,getState:c,extra:f,requestId:d,signal:h.signal,abort:g,rejectWithValue:(C,T)=>new _5(C,T),fulfillWithValue:(C,T)=>new fne(C,T)})).then(C=>{if(C instanceof _5)throw C;return C instanceof fne?i(C.payload,d,l,C.meta):i(C,d,l)})])}catch(b){m=b instanceof _5?o(null,d,l,b.payload,b.meta):o(b,d,l)}finally{p&&h.signal.removeEventListener("abort",p)}return n&&!n.dispatchConditionRejection&&o.match(m)&&m.meta.condition||u(m),m}();return Object.assign(y,{abort:g,requestId:d,arg:l,unwrap(){return y.then(Yyt)}})}}return Object.assign(s,{pending:a,rejected:o,fulfilled:i,settled:Pc(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Yyt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qyt(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Xyt=Symbol.for("rtk-slice-createasyncthunk");function Zyt(e,t){return`${e}/${t}`}function Kyt({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Xyt];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(ro(11));typeof process<"u";const s=(typeof i.reducers=="function"?i.reducers(Jyt()):i.reducers)||{},l=Object.keys(s),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(x,_){const S=typeof x=="string"?x:x.type;if(!S)throw new Error(ro(12));if(S in u.sliceCaseReducersByType)throw new Error(ro(13));return u.sliceCaseReducersByType[S]=_,c},addMatcher(x,_){return u.sliceMatchers.push({matcher:x,reducer:_}),c},exposeAction(x,_){return u.actionCreators[x]=_,c},exposeCaseReducer(x,_){return u.sliceCaseReducersByName[x]=_,c}};l.forEach(x=>{const _=s[x],S={reducerName:x,type:Zyt(a,x),createNotation:typeof i.reducers=="function"};tmt(_)?nmt(S,_,c,t):emt(S,_,c)});function f(){const[x={},_=[],S=void 0]=typeof i.extraReducers=="function"?ZSe(i.extraReducers):[i.extraReducers],b={...x,...u.sliceCaseReducersByType};return Wyt(i.initialState,w=>{for(let C in b)w.addCase(C,b[C]);for(let C of u.sliceMatchers)w.addMatcher(C.matcher,C.reducer);for(let C of _)w.addMatcher(C.matcher,C.reducer);S&&w.addDefaultCase(S)})}const d=x=>x,h=new Map;let p;function v(x,_){return p||(p=f()),p(x,_)}function g(){return p||(p=f()),p.getInitialState()}function y(x,_=!1){function S(w){let C=w[x];return typeof C>"u"&&_&&(C=g()),C}function b(w=d){const C=cne(h,_,{insert:()=>new WeakMap});return cne(C,w,{insert:()=>{const T={};for(const[M,I]of Object.entries(i.selectors??{}))T[M]=Qyt(I,w,g,_);return T}})}return{reducerPath:x,getSelectors:b,get selectors(){return b(S)},selectSlice:S}}const m={name:a,reducer:v,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:g,...y(o),injectInto(x,{reducerPath:_,...S}={}){const b=_??o;return x.inject({reducerPath:b,reducer:v},S),{...m,...y(b,!0)}}};return m}}function Qyt(e,t,r,n){function i(a,...o){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...o)}return i.unwrapped=e,i}var Fl=Kyt();function Jyt(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function emt({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!rmt(n))throw new Error(ro(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?el(e,o):el(e))}function tmt(e){return e._reducerDefinitionType==="asyncThunk"}function rmt(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nmt({type:e,reducerName:t},r,n,i){if(!i)throw new Error(ro(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:l,settled:u,options:c}=r,f=i(e,a,c);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),s&&n.addCase(f.pending,s),l&&n.addCase(f.rejected,l),u&&n.addMatcher(f.settled,u),n.exposeCaseReducer(t,{fulfilled:o||CM,pending:s||CM,rejected:l||CM,settled:u||CM})}function CM(){}function ro(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var JSe=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(JSe||{});function imt(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var hne=Su;function ewe(e,t){if(e===t||!(hne(e)&&hne(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let i=r.length===n.length;const a=Array.isArray(t)?[]:{};for(const o of r)a[o]=ewe(e[o],t[o]),i&&(i=e[o]===a[o]);return i?e:a}function bm(e){let t=0;for(const r in e)t++;return t}var pne=e=>[].concat(...e);function amt(e){return new RegExp("(^|:)//").test(e)}function omt(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function vne(e){return e!=null}function smt(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var lmt=e=>e.replace(/\/$/,""),umt=e=>e.replace(/^\//,"");function cmt(e,t){if(!e)return t;if(!t)return e;if(amt(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=lmt(e),t=umt(t),`${e}${r}${t}`}var gne=(...e)=>fetch(...e),fmt=e=>e.status>=200&&e.status<=299,dmt=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function yne(e){if(!Su(e))return e;const t={...e};for(const[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function hmt({baseUrl:e,prepareHeaders:t=f=>f,fetchFn:r=gne,paramsSerializer:n,isJsonContentType:i=dmt,jsonContentType:a="application/json",jsonReplacer:o,timeout:s,responseHandler:l,validateStatus:u,...c}={}){return typeof fetch>"u"&&r===gne&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(d,h)=>{const{signal:p,getState:v,extra:g,endpoint:y,forced:m,type:x}=h;let _,{url:S,headers:b=new Headers(c.headers),params:w=void 0,responseHandler:C=l??"json",validateStatus:T=u??fmt,timeout:M=s,...I}=typeof d=="string"?{url:d}:d,A={...c,signal:p,...I};b=new Headers(yne(b)),A.headers=await t(b,{getState:v,extra:g,endpoint:y,forced:m,type:x})||b;const k=j=>typeof j=="object"&&(Su(j)||Array.isArray(j)||typeof j.toJSON=="function");if(!A.headers.has("content-type")&&k(A.body)&&A.headers.set("content-type",a),k(A.body)&&i(A.headers)&&(A.body=JSON.stringify(A.body,o)),w){const j=~S.indexOf("?")?"&":"?",V=n?n(w):new URLSearchParams(yne(w));S+=j+V}S=cmt(e,S);const D=new Request(S,A);_={request:new Request(S,A)};let L,N=!1,R=M&&setTimeout(()=>{N=!0,h.abort()},M);try{L=await r(D)}catch(j){return{error:{status:N?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(j)},meta:_}}finally{R&&clearTimeout(R)}const B=L.clone();_.response=B;let E,G="";try{let j;if(await Promise.all([f(L,C).then(V=>E=V,V=>j=V),B.text().then(V=>G=V,()=>{})]),j)throw j}catch(j){return{error:{status:"PARSING_ERROR",originalStatus:L.status,data:G,error:String(j)},meta:_}}return T(L,E)?{data:E,meta:_}:{error:{status:L.status,data:E},meta:_}};async function f(d,h){if(typeof h=="function")return h(d);if(h==="content-type"&&(h=i(d.headers)?"json":"text"),h==="json"){const p=await d.text();return p.length?JSON.parse(p):null}return d.text()}}var mne=class{constructor(e,t=void 0){this.value=e,this.meta=t}},i8=el("__rtkq/focused"),twe=el("__rtkq/unfocused"),a8=el("__rtkq/online"),rwe=el("__rtkq/offline");function nwe(e){return e.type==="query"}function pmt(e){return e.type==="mutation"}function o8(e,t,r,n,i,a){return vmt(e)?e(t,r,n,i).map(bV).map(a):Array.isArray(e)?e.map(bV).map(a):[]}function vmt(e){return typeof e=="function"}function bV(e){return typeof e=="string"?{type:e}:e}function gmt(e,t){return e.catch(t)}var Gw=Symbol("forceQueryFn"),SV=e=>typeof e[Gw]=="function";function ymt({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:i}){const a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:l,updateSubscriptionOptions:u}=n.internalActions;return{buildInitiateQuery:p,buildInitiateMutation:v,getRunningQueryThunk:c,getRunningMutationThunk:f,getRunningQueriesThunk:d,getRunningMutationsThunk:h};function c(g,y){return m=>{var S;const x=i.endpointDefinitions[g],_=e({queryArgs:y,endpointDefinition:x,endpointName:g});return(S=a.get(m))==null?void 0:S[_]}}function f(g,y){return m=>{var x;return(x=o.get(m))==null?void 0:x[y]}}function d(){return g=>Object.values(a.get(g)||{}).filter(vne)}function h(){return g=>Object.values(o.get(g)||{}).filter(vne)}function p(g,y){const m=(x,{subscribe:_=!0,forceRefetch:S,subscriptionOptions:b,[Gw]:w,...C}={})=>(T,M)=>{var j;const I=e({queryArgs:x,endpointDefinition:y,endpointName:g}),A=t({...C,type:"query",subscribe:_,forceRefetch:S,subscriptionOptions:b,endpointName:g,originalArgs:x,queryCacheKey:I,[Gw]:w}),k=n.endpoints[g].select(x),D=T(A),P=k(M()),{requestId:L,abort:N}=D,R=P.requestId!==L,B=(j=a.get(T))==null?void 0:j[I],E=()=>k(M()),G=Object.assign(w?D.then(E):R&&!B?Promise.resolve(P):Promise.all([B,D]).then(E),{arg:x,requestId:L,subscriptionOptions:b,queryCacheKey:I,abort:N,async unwrap(){const V=await G;if(V.isError)throw V.error;return V.data},refetch:()=>T(m(x,{subscribe:!1,forceRefetch:!0})),unsubscribe(){_&&T(s({queryCacheKey:I,requestId:L}))},updateSubscriptionOptions(V){G.subscriptionOptions=V,T(u({endpointName:g,requestId:L,queryCacheKey:I,options:V}))}});if(!B&&!R&&!w){const V=a.get(T)||{};V[I]=G,a.set(T,V),G.then(()=>{delete V[I],bm(V)||a.delete(T)})}return G};return m}function v(g){return(y,{track:m=!0,fixedCacheKey:x}={})=>(_,S)=>{const b=r({type:"mutation",endpointName:g,originalArgs:y,track:m,fixedCacheKey:x}),w=_(b),{requestId:C,abort:T,unwrap:M}=w,I=gmt(w.unwrap().then(P=>({data:P})),P=>({error:P})),A=()=>{_(l({requestId:C,fixedCacheKey:x}))},k=Object.assign(I,{arg:w.arg,requestId:C,abort:T,unwrap:M,reset:A}),D=o.get(_)||{};return o.set(_,D),D[C]=k,k.then(()=>{delete D[C],bm(D)||o.delete(_)}),x&&(D[x]=k,k.then(()=>{D[x]===k&&(delete D[x],bm(D)||o.delete(_))})),k}}}function xne(e){return e}function mmt({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:a}){const o=(m,x,_,S)=>(b,w)=>{const C=r[m],T=n({queryArgs:x,endpointDefinition:C,endpointName:m});if(b(i.internalActions.queryResultPatched({queryCacheKey:T,patches:_})),!S)return;const M=i.endpoints[m].select(x)(w()),I=o8(C.providesTags,M.data,void 0,x,{},a);b(i.internalActions.updateProvidedBy({queryCacheKey:T,providedTags:I}))},s=(m,x,_,S=!0)=>(b,w)=>{const T=i.endpoints[m].select(x)(w()),M={patches:[],inversePatches:[],undo:()=>b(i.util.patchQueryData(m,x,M.inversePatches,S))};if(T.status==="uninitialized")return M;let I;if("data"in T)if(ul(T.data)){const[A,k,D]=USe(T.data,_);M.patches.push(...k),M.inversePatches.push(...D),I=A}else I=_(T.data),M.patches.push({op:"replace",path:[],value:I}),M.inversePatches.push({op:"replace",path:[],value:T.data});return M.patches.length===0||b(i.util.patchQueryData(m,x,M.patches,S)),M},l=(m,x,_)=>S=>S(i.endpoints[m].initiate(x,{subscribe:!1,forceRefetch:!0,[Gw]:()=>({data:_})})),u=async(m,{signal:x,abort:_,rejectWithValue:S,fulfillWithValue:b,dispatch:w,getState:C,extra:T})=>{const M=r[m.endpointName];try{let I=xne,A;const k={signal:x,abort:_,dispatch:w,getState:C,extra:T,endpoint:m.endpointName,type:m.type,forced:m.type==="query"?c(m,C()):void 0},D=m.type==="query"?m[Gw]:void 0;if(D?A=D():M.query?(A=await t(M.query(m.originalArgs),k,M.extraOptions),M.transformResponse&&(I=M.transformResponse)):A=await M.queryFn(m.originalArgs,k,M.extraOptions,P=>t(P,k,M.extraOptions)),typeof process<"u",A.error)throw new mne(A.error,A.meta);return b(await I(A.data,A.meta,m.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:A.meta,[Qy]:!0})}catch(I){let A=I;if(A instanceof mne){let k=xne;M.query&&M.transformErrorResponse&&(k=M.transformErrorResponse);try{return S(await k(A.value,A.meta,m.originalArgs),{baseQueryMeta:A.meta,[Qy]:!0})}catch(D){A=D}}throw typeof process<"u",console.error(A),A}};function c(m,x){var C,T,M;const _=(T=(C=x[e])==null?void 0:C.queries)==null?void 0:T[m.queryCacheKey],S=(M=x[e])==null?void 0:M.config.refetchOnMountOrArgChange,b=_==null?void 0:_.fulfilledTimeStamp,w=m.forceRefetch??(m.subscribe&&S);return w?w===!0||(Number(new Date)-Number(b))/1e3>=w:!1}const f=dne(`${e}/executeQuery`,u,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Qy]:!0}},condition(m,{getState:x}){var M,I,A;const _=x(),S=(I=(M=_[e])==null?void 0:M.queries)==null?void 0:I[m.queryCacheKey],b=S==null?void 0:S.fulfilledTimeStamp,w=m.originalArgs,C=S==null?void 0:S.originalArgs,T=r[m.endpointName];return SV(m)?!0:(S==null?void 0:S.status)==="pending"?!1:c(m,_)||nwe(T)&&((A=T==null?void 0:T.forceRefetch)!=null&&A.call(T,{currentArg:w,previousArg:C,endpointState:S,state:_}))?!0:!b},dispatchConditionRejection:!0}),d=dne(`${e}/executeMutation`,u,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Qy]:!0}}}),h=m=>"force"in m,p=m=>"ifOlderThan"in m,v=(m,x,_)=>(S,b)=>{const w=h(_)&&_.force,C=p(_)&&_.ifOlderThan,T=(I=!0)=>{const A={forceRefetch:I,isPrefetch:!0};return i.endpoints[m].initiate(x,A)},M=i.endpoints[m].select(x)(b());if(w)S(T());else if(C){const I=M==null?void 0:M.fulfilledTimeStamp;if(!I){S(T());return}(Number(new Date)-Number(new Date(I)))/1e3>=C&&S(T())}else S(T(!1))};function g(m){return x=>{var _,S;return((S=(_=x==null?void 0:x.meta)==null?void 0:_.arg)==null?void 0:S.endpointName)===m}}function y(m,x){return{matchPending:uS(n8(m),g(x)),matchFulfilled:uS(Ed(m),g(x)),matchRejected:uS(l0(m),g(x))}}return{queryThunk:f,mutationThunk:d,prefetch:v,updateQueryData:s,upsertQueryData:l,patchQueryData:o,buildMatchThunkActions:y}}function iwe(e,t,r,n){return o8(r[e.meta.arg.endpointName][t],Ed(e)?e.payload:void 0,jL(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function TM(e,t,r){const n=e[t];n&&r(n)}function Ww(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function _ne(e,t,r){const n=e[Ww(t)];n&&r(n)}var p_={};function xmt({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:o},assertTagType:s,config:l}){const u=el(`${e}/resetApiState`),c=Fl({name:`${e}/queries`,initialState:p_,reducers:{removeQueryResult:{reducer(x,{payload:{queryCacheKey:_}}){delete x[_]},prepare:h_()},queryResultPatched:{reducer(x,{payload:{queryCacheKey:_,patches:S}}){TM(x,_,b=>{b.data=one(b.data,S.concat())})},prepare:h_()}},extraReducers(x){x.addCase(t.pending,(_,{meta:S,meta:{arg:b}})=>{var C;const w=SV(b);_[C=b.queryCacheKey]??(_[C]={status:"uninitialized",endpointName:b.endpointName}),TM(_,b.queryCacheKey,T=>{T.status="pending",T.requestId=w&&T.requestId?T.requestId:S.requestId,b.originalArgs!==void 0&&(T.originalArgs=b.originalArgs),T.startedTimeStamp=S.startedTimeStamp})}).addCase(t.fulfilled,(_,{meta:S,payload:b})=>{TM(_,S.arg.queryCacheKey,w=>{if(w.requestId!==S.requestId&&!SV(S.arg))return;const{merge:C}=n[S.arg.endpointName];if(w.status="fulfilled",C)if(w.data!==void 0){const{fulfilledTimeStamp:T,arg:M,baseQueryMeta:I,requestId:A}=S;let k=dC(w.data,D=>C(D,b,{arg:M.originalArgs,baseQueryMeta:I,fulfilledTimeStamp:T,requestId:A}));w.data=k}else w.data=b;else w.data=n[S.arg.endpointName].structuralSharing??!0?ewe(wu(w.data)?fyt(w.data):w.data,b):b;delete w.error,w.fulfilledTimeStamp=S.fulfilledTimeStamp})}).addCase(t.rejected,(_,{meta:{condition:S,arg:b,requestId:w},error:C,payload:T})=>{TM(_,b.queryCacheKey,M=>{if(!S){if(M.requestId!==w)return;M.status="rejected",M.error=T??C}})}).addMatcher(o,(_,S)=>{const{queries:b}=a(S);for(const[w,C]of Object.entries(b))((C==null?void 0:C.status)==="fulfilled"||(C==null?void 0:C.status)==="rejected")&&(_[w]=C)})}}),f=Fl({name:`${e}/mutations`,initialState:p_,reducers:{removeMutationResult:{reducer(x,{payload:_}){const S=Ww(_);S in x&&delete x[S]},prepare:h_()}},extraReducers(x){x.addCase(r.pending,(_,{meta:S,meta:{requestId:b,arg:w,startedTimeStamp:C}})=>{w.track&&(_[Ww(S)]={requestId:b,status:"pending",endpointName:w.endpointName,startedTimeStamp:C})}).addCase(r.fulfilled,(_,{payload:S,meta:b})=>{b.arg.track&&_ne(_,b,w=>{w.requestId===b.requestId&&(w.status="fulfilled",w.data=S,w.fulfilledTimeStamp=b.fulfilledTimeStamp)})}).addCase(r.rejected,(_,{payload:S,error:b,meta:w})=>{w.arg.track&&_ne(_,w,C=>{C.requestId===w.requestId&&(C.status="rejected",C.error=S??b)})}).addMatcher(o,(_,S)=>{const{mutations:b}=a(S);for(const[w,C]of Object.entries(b))((C==null?void 0:C.status)==="fulfilled"||(C==null?void 0:C.status)==="rejected")&&w!==(C==null?void 0:C.requestId)&&(_[w]=C)})}}),d=Fl({name:`${e}/invalidation`,initialState:p_,reducers:{updateProvidedBy:{reducer(x,_){var w,C;const{queryCacheKey:S,providedTags:b}=_.payload;for(const T of Object.values(x))for(const M of Object.values(T)){const I=M.indexOf(S);I!==-1&&M.splice(I,1)}for(const{type:T,id:M}of b){const I=(w=x[T]??(x[T]={}))[C=M||"__internal_without_id"]??(w[C]=[]);I.includes(S)||I.push(S)}},prepare:h_()}},extraReducers(x){x.addCase(c.actions.removeQueryResult,(_,{payload:{queryCacheKey:S}})=>{for(const b of Object.values(_))for(const w of Object.values(b)){const C=w.indexOf(S);C!==-1&&w.splice(C,1)}}).addMatcher(o,(_,S)=>{var w,C;const{provided:b}=a(S);for(const[T,M]of Object.entries(b))for(const[I,A]of Object.entries(M)){const k=(w=_[T]??(_[T]={}))[C=I||"__internal_without_id"]??(w[C]=[]);for(const D of A)k.includes(D)||k.push(D)}}).addMatcher(Pc(Ed(t),jL(t)),(_,S)=>{const b=iwe(S,"providesTags",n,s),{queryCacheKey:w}=S.meta.arg;d.caseReducers.updateProvidedBy(_,d.actions.updateProvidedBy({queryCacheKey:w,providedTags:b}))})}}),h=Fl({name:`${e}/subscriptions`,initialState:p_,reducers:{updateSubscriptionOptions(x,_){},unsubscribeQueryResult(x,_){},internal_getRTKQSubscriptions(){}}}),p=Fl({name:`${e}/internalSubscriptions`,initialState:p_,reducers:{subscriptionsUpdated:{reducer(x,_){return one(x,_.payload)},prepare:h_()}}}),v=Fl({name:`${e}/config`,initialState:{online:smt(),focused:omt(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(x,{payload:_}){x.middlewareRegistered=x.middlewareRegistered==="conflict"||i!==_?"conflict":!0}},extraReducers:x=>{x.addCase(a8,_=>{_.online=!0}).addCase(rwe,_=>{_.online=!1}).addCase(i8,_=>{_.focused=!0}).addCase(twe,_=>{_.focused=!1}).addMatcher(o,_=>({..._}))}}),g=Qj({queries:c.reducer,mutations:f.reducer,provided:d.reducer,subscriptions:p.reducer,config:v.reducer}),y=(x,_)=>g(u.match(_)?void 0:x,_),m={...v.actions,...c.actions,...h.actions,...p.actions,...f.actions,...d.actions,resetApiState:u};return{reducer:y,actions:m}}var Bp=Symbol.for("RTKQ/skipToken"),awe={status:"uninitialized"},bne=dC(awe,()=>{}),Sne=dC(awe,()=>{});function _mt({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=f=>bne,i=f=>Sne;return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u,selectCachedArgsForQuery:c};function a(f){return{...f,...imt(f.status)}}function o(f){return f[t]}function s(f,d){return h=>{const p=e({queryArgs:h,endpointDefinition:d,endpointName:f});return r(h===Bp?n:y=>{var m,x;return((x=(m=o(y))==null?void 0:m.queries)==null?void 0:x[p])??bne},a)}}function l(){return f=>{let d;return typeof f=="object"?d=Ww(f)??Bp:d=f,r(d===Bp?i:v=>{var g,y;return((y=(g=o(v))==null?void 0:g.mutations)==null?void 0:y[d])??Sne},a)}}function u(f,d){const h=f[t],p=new Set;for(const v of d.map(bV)){const g=h.provided[v.type];if(!g)continue;let y=(v.id!==void 0?g[v.id]:pne(Object.values(g)))??[];for(const m of y)p.add(m)}return pne(Array.from(p.values()).map(v=>{const g=h.queries[v];return g?[{queryCacheKey:v,endpointName:g.endpointName,originalArgs:g.originalArgs}]:[]}))}function c(f,d){return Object.values(f[t].queries).filter(h=>(h==null?void 0:h.endpointName)===d&&h.status!=="uninitialized").map(h=>h.originalArgs)}}var qg=WeakMap?new WeakMap:void 0,wne=({endpointName:e,queryArgs:t})=>{let r="";const n=qg==null?void 0:qg.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(a,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=Su(o)?Object.keys(o).sort().reduce((s,l)=>(s[l]=o[l],s),{}):o,o));Su(t)&&(qg==null||qg.set(t,i)),r=i}return`${e}(${r})`};function bmt(...e){return function(r){const n=Pk(u=>{var c;return(c=r.extractRehydrationInfo)==null?void 0:c.call(r,u,{reducerPath:r.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let c=wne;if("serializeQueryArgs"in u.endpointDefinition){const f=u.endpointDefinition.serializeQueryArgs;c=d=>{const h=f(d);return typeof h=="string"?h:wne({...d,queryArgs:h})}}else r.serializeQueryArgs&&(c=r.serializeQueryArgs);return c(u)},tagTypes:[...r.tagTypes||[]]},a={endpointDefinitions:{},batch(u){u()},apiUid:QSe(),extractRehydrationInfo:n,hasRehydrationInfo:Pk(u=>n(u)!=null)},o={injectEndpoints:l,enhanceEndpoints({addTagTypes:u,endpoints:c}){if(u)for(const f of u)i.tagTypes.includes(f)||i.tagTypes.push(f);if(c)for(const[f,d]of Object.entries(c))typeof d=="function"?d(a.endpointDefinitions[f]):Object.assign(a.endpointDefinitions[f]||{},d);return o}},s=e.map(u=>u.init(o,i,a));function l(u){const c=u.endpoints({query:f=>({...f,type:"query"}),mutation:f=>({...f,type:"mutation"})});for(const[f,d]of Object.entries(c)){if(u.overrideExisting!==!0&&f in a.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(ro(39));typeof process<"u";continue}a.endpointDefinitions[f]=d;for(const h of s)h.injectEndpoint(f,d)}return o}return o.injectEndpoints({endpoints:r.endpoints})}}function df(e,...t){return Object.assign(e,...t)}var Smt=({api:e,queryThunk:t,internalState:r})=>{const n=`${e.reducerPath}/subscriptions`;let i=null,a=null;const{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions,l=(h,p)=>{var g,y,m;if(o.match(p)){const{queryCacheKey:x,requestId:_,options:S}=p.payload;return(g=h==null?void 0:h[x])!=null&&g[_]&&(h[x][_]=S),!0}if(s.match(p)){const{queryCacheKey:x,requestId:_}=p.payload;return h[x]&&delete h[x][_],!0}if(e.internalActions.removeQueryResult.match(p))return delete h[p.payload.queryCacheKey],!0;if(t.pending.match(p)){const{meta:{arg:x,requestId:_}}=p,S=h[y=x.queryCacheKey]??(h[y]={});return S[`${_}_running`]={},x.subscribe&&(S[_]=x.subscriptionOptions??S[_]??{}),!0}let v=!1;if(t.fulfilled.match(p)||t.rejected.match(p)){const x=h[p.meta.arg.queryCacheKey]||{},_=`${p.meta.requestId}_running`;v||(v=!!x[_]),delete x[_]}if(t.rejected.match(p)){const{meta:{condition:x,arg:_,requestId:S}}=p;if(x&&_.subscribe){const b=h[m=_.queryCacheKey]??(h[m]={});b[S]=_.subscriptionOptions??b[S]??{},v=!0}}return v},u=()=>r.currentSubscriptions,d={getSubscriptions:u,getSubscriptionCount:h=>{const v=u()[h]??{};return bm(v)},isRequestSubscribed:(h,p)=>{var g;const v=u();return!!((g=v==null?void 0:v[h])!=null&&g[p])}};return(h,p)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return i=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,d];const v=l(r.currentSubscriptions,h);let g=!0;if(v){a||(a=setTimeout(()=>{const x=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,_]=USe(i,()=>x);p.next(e.internalActions.subscriptionsUpdated(_)),i=x,a=null},500));const y=typeof h.type=="string"&&!!h.type.startsWith(n),m=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;g=!y&&!m}return[g,!1]}};function wmt(e){for(const t in e)return!1;return!0}var Cmt=2147483647/1e3-1,Tmt=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i})=>{const{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions,s=Pc(o.match,r.fulfilled,r.rejected);function l(d){const h=i.currentSubscriptions[d];return!!h&&!wmt(h)}const u={},c=(d,h,p)=>{var v;if(s(d)){const g=h.getState()[e],{queryCacheKey:y}=o.match(d)?d.payload:d.meta.arg;f(y,(v=g.queries[y])==null?void 0:v.endpointName,h,g.config)}if(t.util.resetApiState.match(d))for(const[g,y]of Object.entries(u))y&&clearTimeout(y),delete u[g];if(n.hasRehydrationInfo(d)){const g=h.getState()[e],{queries:y}=n.extractRehydrationInfo(d);for(const[m,x]of Object.entries(y))f(m,x==null?void 0:x.endpointName,h,g.config)}};function f(d,h,p,v){const g=n.endpointDefinitions[h],y=(g==null?void 0:g.keepUnusedDataFor)??v.keepUnusedDataFor;if(y===1/0)return;const m=Math.max(0,Math.min(y,Cmt));if(!l(d)){const x=u[d];x&&clearTimeout(x),u[d]=setTimeout(()=>{l(d)||p.dispatch(a({queryCacheKey:d})),delete u[d]},m*1e3)}}return c},Cne=new Error("Promise never resolved before cacheEntryRemoved."),Mmt=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a})=>{const o=_V(n),s=_V(i),l=Ed(n,i),u={},c=(h,p,v)=>{const g=f(h);if(n.pending.match(h)){const y=v[t].queries[g],m=p.getState()[t].queries[g];!y&&m&&d(h.meta.arg.endpointName,h.meta.arg.originalArgs,g,p,h.meta.requestId)}else if(i.pending.match(h))p.getState()[t].mutations[g]&&d(h.meta.arg.endpointName,h.meta.arg.originalArgs,g,p,h.meta.requestId);else if(l(h)){const y=u[g];y!=null&&y.valueResolved&&(y.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete y.valueResolved)}else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h)){const y=u[g];y&&(delete u[g],y.cacheEntryRemoved())}else if(e.util.resetApiState.match(h))for(const[y,m]of Object.entries(u))delete u[y],m.cacheEntryRemoved()};function f(h){return o(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.arg.fixedCacheKey??h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?Ww(h.payload):""}function d(h,p,v,g,y){const m=r.endpointDefinitions[h],x=m==null?void 0:m.onCacheEntryAdded;if(!x)return;const _={},S=new Promise(I=>{_.cacheEntryRemoved=I}),b=Promise.race([new Promise(I=>{_.valueResolved=I}),S.then(()=>{throw Cne})]);b.catch(()=>{}),u[v]=_;const w=e.endpoints[h].select(m.type==="query"?p:v),C=g.dispatch((I,A,k)=>k),T={...g,getCacheEntry:()=>w(g.getState()),requestId:y,extra:C,updateCachedData:m.type==="query"?I=>g.dispatch(e.util.updateQueryData(h,p,I)):void 0,cacheDataLoaded:b,cacheEntryRemoved:S},M=x(p,T);Promise.resolve(M).catch(I=>{if(I!==Cne)throw I})}return c},Imt=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Amt=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:o,refetchQuery:s,internalState:l})=>{const{removeQueryResult:u}=a.internalActions,c=Pc(Ed(n),jL(n)),f=Pc(Ed(n,i),l0(n,i));let d=[];const h=(g,y)=>{c(g)?v(iwe(g,"invalidatesTags",r,o),y):f(g)?v([],y):a.util.invalidateTags.match(g)&&v(o8(g.payload,void 0,void 0,void 0,void 0,o),y)};function p(g){var y,m;for(const x in g.queries)if(((y=g.queries[x])==null?void 0:y.status)==="pending")return!0;for(const x in g.mutations)if(((m=g.mutations[x])==null?void 0:m.status)==="pending")return!0;return!1}function v(g,y){const m=y.getState(),x=m[e];if(d.push(...g),x.config.invalidationBehavior==="delayed"&&p(x))return;const _=d;if(d=[],_.length===0)return;const S=a.util.selectInvalidatedBy(m,_);t.batch(()=>{const b=Array.from(S.values());for(const{queryCacheKey:w}of b){const C=x.queries[w],T=l.currentSubscriptions[w]??{};C&&(bm(T)===0?y.dispatch(u({queryCacheKey:w})):C.status!=="uninitialized"&&y.dispatch(s(C,w)))}})}return h},kmt=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{const a={},o=(d,h)=>{(r.internalActions.updateSubscriptionOptions.match(d)||r.internalActions.unsubscribeQueryResult.match(d))&&l(d.payload,h),(t.pending.match(d)||t.rejected.match(d)&&d.meta.condition)&&l(d.meta.arg,h),(t.fulfilled.match(d)||t.rejected.match(d)&&!d.meta.condition)&&s(d.meta.arg,h),r.util.resetApiState.match(d)&&c()};function s({queryCacheKey:d},h){const p=h.getState()[e],v=p.queries[d],g=i.currentSubscriptions[d];if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:y,skipPollingIfUnfocused:m}=f(g);if(!Number.isFinite(y))return;const x=a[d];x!=null&&x.timeout&&(clearTimeout(x.timeout),x.timeout=void 0);const _=Date.now()+y;a[d]={nextPollTimestamp:_,pollingInterval:y,timeout:setTimeout(()=>{(p.config.focused||!m)&&h.dispatch(n(v,d)),s({queryCacheKey:d},h)},y)}}function l({queryCacheKey:d},h){const v=h.getState()[e].queries[d],g=i.currentSubscriptions[d];if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:y}=f(g);if(!Number.isFinite(y)){u(d);return}const m=a[d],x=Date.now()+y;(!m||x<m.nextPollTimestamp)&&s({queryCacheKey:d},h)}function u(d){const h=a[d];h!=null&&h.timeout&&clearTimeout(h.timeout),delete a[d]}function c(){for(const d of Object.keys(a))u(d)}function f(d={}){let h=!1,p=Number.POSITIVE_INFINITY;for(let v in d)d[v].pollingInterval&&(p=Math.min(d[v].pollingInterval,p),h=d[v].skipPollingIfUnfocused||h);return{lowestPollingInterval:p,skipPollingIfUnfocused:h}}return o},Dmt=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const i=n8(r,n),a=l0(r,n),o=Ed(r,n),s={};return(u,c)=>{var f,d;if(i(u)){const{requestId:h,arg:{endpointName:p,originalArgs:v}}=u.meta,g=t.endpointDefinitions[p],y=g==null?void 0:g.onQueryStarted;if(y){const m={},x=new Promise((w,C)=>{m.resolve=w,m.reject=C});x.catch(()=>{}),s[h]=m;const _=e.endpoints[p].select(g.type==="query"?v:h),S=c.dispatch((w,C,T)=>T),b={...c,getCacheEntry:()=>_(c.getState()),requestId:h,extra:S,updateCachedData:g.type==="query"?w=>c.dispatch(e.util.updateQueryData(p,v,w)):void 0,queryFulfilled:x};y(v,b)}}else if(o(u)){const{requestId:h,baseQueryMeta:p}=u.meta;(f=s[h])==null||f.resolve({data:u.payload,meta:p}),delete s[h]}else if(a(u)){const{requestId:h,rejectedWithValue:p,baseQueryMeta:v}=u.meta;(d=s[h])==null||d.reject({error:u.payload??u.error,isUnhandledError:!p,meta:v}),delete s[h]}}},Pmt=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{const{removeQueryResult:a}=r.internalActions,o=(l,u)=>{i8.match(l)&&s(u,"refetchOnFocus"),a8.match(l)&&s(u,"refetchOnReconnect")};function s(l,u){const c=l.getState()[e],f=c.queries,d=i.currentSubscriptions;t.batch(()=>{for(const h of Object.keys(d)){const p=f[h],v=d[h];if(!v||!p)continue;(Object.values(v).some(y=>y[u]===!0)||Object.values(v).every(y=>y[u]===void 0)&&c.config[u])&&(bm(v)===0?l.dispatch(a({queryCacheKey:h})):p.status!=="uninitialized"&&l.dispatch(n(p,h)))}})}return o};function Lmt(e){const{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:a}=i,o={invalidateTags:el(`${t}/invalidateTags`)},s=f=>f.type.startsWith(`${t}/`),l=[Imt,Tmt,Amt,kmt,Mmt,Dmt];return{middleware:f=>{let d=!1;const p={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},v=l.map(m=>m(p)),g=Smt(p),y=Pmt(p);return m=>x=>{if(!VSe(x))return m(x);d||(d=!0,f.dispatch(n.internalActions.middlewareRegistered(a)));const _={...f,next:m},S=f.getState(),[b,w]=g(x,_,S);let C;if(b?C=m(x):C=w,f.getState()[t]&&(y(x,_,S),s(x)||i.hasRehydrationInfo(x)))for(const T of v)T(x,_,S);return C}},actions:o};function c(f,d,h={}){return r({type:"query",endpointName:f.endpointName,originalArgs:f.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:d,...h})}}var Tne=Symbol(),Rmt=({createSelector:e=r8}={})=>({name:Tne,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:a,keepUnusedDataFor:o,refetchOnMountOrArgChange:s,refetchOnFocus:l,refetchOnReconnect:u,invalidationBehavior:c},f){byt();const d=R=>(typeof process<"u",R);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:a8,onOffline:rwe,onFocus:i8,onFocusLost:twe},util:{}});const{queryThunk:h,mutationThunk:p,patchQueryData:v,updateQueryData:g,upsertQueryData:y,prefetch:m,buildMatchThunkActions:x}=mmt({baseQuery:r,reducerPath:i,context:f,api:t,serializeQueryArgs:a,assertTagType:d}),{reducer:_,actions:S}=xmt({context:f,queryThunk:h,mutationThunk:p,reducerPath:i,assertTagType:d,config:{refetchOnFocus:l,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:c}});df(t.util,{patchQueryData:v,updateQueryData:g,upsertQueryData:y,prefetch:m,resetApiState:S.resetApiState}),df(t.internalActions,S);const{middleware:b,actions:w}=Lmt({reducerPath:i,context:f,queryThunk:h,mutationThunk:p,api:t,assertTagType:d});df(t.util,w),df(t,{reducer:_,middleware:b});const{buildQuerySelector:C,buildMutationSelector:T,selectInvalidatedBy:M,selectCachedArgsForQuery:I}=_mt({serializeQueryArgs:a,reducerPath:i,createSelector:e});df(t.util,{selectInvalidatedBy:M,selectCachedArgsForQuery:I});const{buildInitiateQuery:A,buildInitiateMutation:k,getRunningMutationThunk:D,getRunningMutationsThunk:P,getRunningQueriesThunk:L,getRunningQueryThunk:N}=ymt({queryThunk:h,mutationThunk:p,api:t,serializeQueryArgs:a,context:f});return df(t.util,{getRunningMutationThunk:D,getRunningMutationsThunk:P,getRunningQueryThunk:N,getRunningQueriesThunk:L}),{name:Tne,injectEndpoint(R,B){var G;const E=t;(G=E.endpoints)[R]??(G[R]={}),nwe(B)?df(E.endpoints[R],{name:R,select:C(R,B),initiate:A(R,B)},x(h,R)):pmt(B)&&df(E.endpoints[R],{name:R,select:T(),initiate:k(R)},x(p,R))}}}});function Emt(e){return e.type==="query"}function Omt(e){return e.type==="mutation"}function MM(e,...t){return Object.assign(e,...t)}function b5(e){return e.replace(e[0],e[0].toUpperCase())}var Xg=WeakMap?new WeakMap:void 0,Nmt=({endpointName:e,queryArgs:t})=>{let r="";const n=Xg==null?void 0:Xg.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(a,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=Su(o)?Object.keys(o).sort().reduce((s,l)=>(s[l]=o[l],s),{}):o,o));Su(t)&&(Xg==null||Xg.set(t,i)),r=i}return`${e}(${r})`},S5=Symbol();function Mne(e,t,r,n){const i=O.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),a=O.useRef(i);return O.useEffect(()=>{a.current.serialized!==i.serialized&&(a.current=i)},[i]),a.current.serialized===i.serialized?a.current.queryArgs:e}function w5(e){const t=O.useRef(e);return O.useEffect(()=>{Za(t.current,e)||(t.current=e)},[e]),Za(t.current,e)?t.current:e}var zmt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bmt=zmt(),Fmt=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Vmt=Fmt(),$mt=()=>Bmt||Vmt?O.useLayoutEffect:O.useEffect,Gmt=$mt(),Wmt=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:JSe.pending}:e;function Hmt({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:i},unstable__sideEffectsInRender:a,createSelector:o},serializeQueryArgs:s,context:l}){const u=a?p=>p():O.useEffect;return{buildQueryHooks:d,buildMutationHook:h,usePrefetch:f};function c(p,v,g){if(v!=null&&v.endpointName&&p.isUninitialized){const{endpointName:b}=v,w=l.endpointDefinitions[b];s({queryArgs:v.originalArgs,endpointDefinition:w,endpointName:b})===s({queryArgs:g,endpointDefinition:w,endpointName:b})&&(v=void 0)}let y=p.isSuccess?p.data:v==null?void 0:v.data;y===void 0&&(y=p.data);const m=y!==void 0,x=p.isLoading,_=(!v||v.isLoading||v.isUninitialized)&&!m&&x,S=p.isSuccess||x&&m;return{...p,data:y,currentData:p.data,isFetching:x,isLoading:_,isSuccess:S}}function f(p,v){const g=r(),y=w5(v);return O.useCallback((m,x)=>g(e.util.prefetch(p,m,{...y,...x})),[p,g,y])}function d(p){const v=(m,{refetchOnReconnect:x,refetchOnFocus:_,refetchOnMountOrArgChange:S,skip:b=!1,pollingInterval:w=0,skipPollingIfUnfocused:C=!1}={})=>{const{initiate:T}=e.endpoints[p],M=r(),I=O.useRef(void 0);if(!I.current){const E=M(e.internalActions.internal_getRTKQSubscriptions());I.current=E}const A=Mne(b?Bp:m,Nmt,l.endpointDefinitions[p],p),k=w5({refetchOnReconnect:x,refetchOnFocus:_,pollingInterval:w,skipPollingIfUnfocused:C}),D=O.useRef(!1),P=O.useRef(void 0);let{queryCacheKey:L,requestId:N}=P.current||{},R=!1;L&&N&&(R=I.current.isRequestSubscribed(L,N));const B=!R&&D.current;return u(()=>{D.current=R}),u(()=>{B&&(P.current=void 0)},[B]),u(()=>{var j;const E=P.current;if(typeof process<"u",A===Bp){E==null||E.unsubscribe(),P.current=void 0;return}const G=(j=P.current)==null?void 0:j.subscriptionOptions;if(!E||E.arg!==A){E==null||E.unsubscribe();const V=M(T(A,{subscriptionOptions:k,forceRefetch:S}));P.current=V}else k!==G&&E.updateSubscriptionOptions(k)},[M,T,S,A,k,B]),O.useEffect(()=>()=>{var E;(E=P.current)==null||E.unsubscribe(),P.current=void 0},[]),O.useMemo(()=>({refetch:()=>{var E;if(!P.current)throw new Error(ro(38));return(E=P.current)==null?void 0:E.refetch()}}),[])},g=({refetchOnReconnect:m,refetchOnFocus:x,pollingInterval:_=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:b}=e.endpoints[p],w=r(),[C,T]=O.useState(S5),M=O.useRef(void 0),I=w5({refetchOnReconnect:m,refetchOnFocus:x,pollingInterval:_,skipPollingIfUnfocused:S});u(()=>{var P,L;const D=(P=M.current)==null?void 0:P.subscriptionOptions;I!==D&&((L=M.current)==null||L.updateSubscriptionOptions(I))},[I]);const A=O.useRef(I);u(()=>{A.current=I},[I]);const k=O.useCallback(function(D,P=!1){let L;return t(()=>{var N;(N=M.current)==null||N.unsubscribe(),M.current=L=w(b(D,{subscriptionOptions:A.current,forceRefetch:!P})),T(D)}),L},[w,b]);return O.useEffect(()=>()=>{var D;(D=M==null?void 0:M.current)==null||D.unsubscribe()},[]),O.useEffect(()=>{C!==S5&&!M.current&&k(C,!0)},[C,k]),O.useMemo(()=>[k,C],[k,C])},y=(m,{skip:x=!1,selectFromResult:_}={})=>{const{select:S}=e.endpoints[p],b=Mne(x?Bp:m,s,l.endpointDefinitions[p],p),w=O.useRef(void 0),C=O.useMemo(()=>o([S(b),(k,D)=>D,k=>b],c,{memoizeOptions:{resultEqualityCheck:Za}}),[S,b]),T=O.useMemo(()=>_?o([C],_,{devModeChecks:{identityFunctionCheck:"never"}}):C,[C,_]),M=n(k=>T(k,w.current),Za),I=i(),A=C(I.getState(),w.current);return Gmt(()=>{w.current=A},[A]),M};return{useQueryState:y,useQuerySubscription:v,useLazyQuerySubscription:g,useLazyQuery(m){const[x,_]=g(m),S=y(_,{...m,skip:_===S5}),b=O.useMemo(()=>({lastArg:_}),[_]);return O.useMemo(()=>[x,S,b],[x,S,b])},useQuery(m,x){const _=v(m,x),S=y(m,{selectFromResult:m===Bp||x!=null&&x.skip?void 0:Wmt,...x}),{data:b,status:w,isLoading:C,isSuccess:T,isError:M,error:I}=S;return O.useDebugValue({data:b,status:w,isLoading:C,isSuccess:T,isError:M,error:I}),O.useMemo(()=>({...S,..._}),[S,_])}}}function h(p){return({selectFromResult:v,fixedCacheKey:g}={})=>{const{select:y,initiate:m}=e.endpoints[p],x=r(),[_,S]=O.useState();O.useEffect(()=>()=>{_!=null&&_.arg.fixedCacheKey||_==null||_.reset()},[_]);const b=O.useCallback(function(G){const j=x(m(G,{fixedCacheKey:g}));return S(j),j},[x,m,g]),{requestId:w}=_||{},C=O.useMemo(()=>y({fixedCacheKey:g,requestId:_==null?void 0:_.requestId}),[g,_,y]),T=O.useMemo(()=>v?o([C],v):C,[v,C]),M=n(T,Za),I=g==null?_==null?void 0:_.arg.originalArgs:void 0,A=O.useCallback(()=>{t(()=>{_&&S(void 0),g&&x(e.internalActions.removeMutationResult({requestId:w,fixedCacheKey:g}))})},[x,g,_,w]),{endpointName:k,data:D,status:P,isLoading:L,isSuccess:N,isError:R,error:B}=M;O.useDebugValue({endpointName:k,data:D,status:P,isLoading:L,isSuccess:N,isError:R,error:B});const E=O.useMemo(()=>({...M,originalArgs:I,reset:A}),[M,I,A]);return O.useMemo(()=>[b,E],[b,E])}}}var jmt=Symbol(),Umt=({batch:e=nfe,hooks:t={useDispatch:b6,useSelector:_1,useStore:_6},createSelector:r=r8,unstable__sideEffectsInRender:n=!1,...i}={})=>({name:jmt,init(a,{serializeQueryArgs:o},s){const l=a,{buildQueryHooks:u,buildMutationHook:c,usePrefetch:f}=Hmt({api:a,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:o,context:s});return MM(l,{usePrefetch:f}),MM(s,{batch:e}),{injectEndpoint(d,h){if(Emt(h)){const{useQuery:p,useLazyQuery:v,useLazyQuerySubscription:g,useQueryState:y,useQuerySubscription:m}=u(d);MM(l.endpoints[d],{useQuery:p,useLazyQuery:v,useLazyQuerySubscription:g,useQueryState:y,useQuerySubscription:m}),a[`use${b5(d)}Query`]=p,a[`useLazy${b5(d)}Query`]=v}else if(Omt(h)){const p=c(d);MM(l.endpoints[d],{useMutation:p}),a[`use${b5(d)}Mutation`]=p}}}}}),Ymt=bmt(Rmt(),Umt());const Zg=(e,t,{fallbackValue:r}={fallbackValue:"0"})=>e.reduce((n,i)=>{const{name:a,time:o}=i,s=i[t]||r,l=n.time||[];return l.push(o),n[a]?(n[a].push([o,s]),{...n,time:l}):{...n,[a]:[[o,s]],time:l}},{});function Of(e){return Vf(Number(e[1]),2)}const Ine=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);window.history.pushState(null,"",t)},qmt=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);return t},Xmt=e=>e?e[e.length-1][1]:"0",Lk=Ymt({baseQuery:hmt({baseUrl:"cloud-stats"}),reducerPath:"cloud-stats",endpoints:e=>({getRequestNames:e.mutation({query:t=>({url:"request-names",method:"POST",body:t}),transformResponse:t=>t.map(({name:r})=>({name:`${r}`,key:r}))}),getRpsPerRequest:e.mutation({query:t=>({url:"rps-per-request",method:"POST",body:t}),transformResponse:t=>Zg(t,"throughput")}),getAvgResponseTimes:e.mutation({query:t=>({url:"avg-response-times",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseTime")}),getErrorsPerRequest:e.mutation({query:t=>({url:"errors-per-request",method:"POST",body:t}),transformResponse:t=>Zg(t,"errorRate")}),getPerc99ResponseTimes:e.mutation({query:t=>({url:"perc99-response-times",method:"POST",body:t}),transformResponse:t=>Zg(t,"perc99",{fallbackValue:null})}),getResponseLength:e.mutation({query:t=>({url:"response-length",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseLength",{fallbackValue:null})}),getRps:e.mutation({query:t=>({url:"rps",method:"POST",body:t}),transformResponse:t=>t.reduce((r,{users:n,rps:i,errorRate:a,time:o})=>({users:[...r.users||[],[o,n||Xmt(r.users)]],rps:[...r.rps||[],[o,i||"0"]],errorRate:[...r.errorRate||[],[o,a||"0"]],time:[...r.time||[],o]}),{})}),getTestrunsTable:e.mutation({query:()=>({url:"testruns-table",method:"POST"}),transformResponse:t=>t.map(({runId:r,...n})=>{const i=new Date(r).toLocaleString(),a=qmt({tab:"charts",testrun:i});return{...n,runId:`[${i}](${a})`}})}),getTestrunsRps:e.mutation({query:()=>({url:"testruns-rps",method:"POST"}),transformResponse:t=>t.reduce((r,{avgRps:n,avgRpsFailed:i,time:a})=>({...r,avgRps:[...r.avgRps||[],[a,n]],avgRpsFailed:[...r.avgRpsFailed||[],[a,i]],time:[...r.time||[],a]}),{})}),getTestrunsResponseTime:e.mutation({query:()=>({url:"testruns-response-time",method:"POST"}),transformResponse:t=>t.reduce((r,{avgResponseTime:n,avgResponseTimeFailed:i,time:a})=>({...r,avgResponseTime:[...r.avgResponseTime||[],[a,n]],avgResponseTimeFailed:[...r.avgResponseTimeFailed||[],[a,i]],time:[...r.time||[],a]}),{})}),getRequests:e.mutation({query:t=>({url:"requests",method:"POST",body:t})}),getFailures:e.mutation({query:t=>({url:"failures",method:"POST",body:t})}),getTotalRequests:e.mutation({query:t=>({url:"total-requests",method:"POST",body:t}),transformResponse:([{totalRequests:t}])=>t||0}),getTotalFailures:e.mutation({query:t=>({url:"total-failures",method:"POST",body:t}),transformResponse:([{totalFailures:t}])=>t||0}),getErrorPercentage:e.mutation({query:t=>({url:"error-percentage",method:"POST",body:t}),transformResponse:([{errorPercentage:t}])=>{const r=Vf(t,2);return isNaN(r)?0:r}}),getTotalVuh:e.mutation({query:()=>({url:"total-vuh",method:"POST"})}),getCustomerData:e.mutation({query:()=>({url:"customer",method:"POST"}),transformResponse:([t])=>({...t,maxUsers:Number(t.maxUsers),maxVuh:Number(t.maxVuh),maxWorkers:Number(t.maxWorkers),usersPerWorker:Number(t.usersPerWorker)})}),getTestruns:e.mutation({query:()=>({url:"testruns",method:"POST"})}),getScatterplot:e.mutation({query:t=>({url:"scatterplot",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseTime")})})}),{useGetRequestNamesMutation:owe,useGetRpsPerRequestMutation:Zmt,useGetAvgResponseTimesMutation:Kmt,useGetErrorsPerRequestMutation:Qmt,useGetPerc99ResponseTimesMutation:Jmt,useGetResponseLengthMutation:e0t,useGetRpsMutation:t0t,useGetTestrunsTableMutation:r0t,useGetTestrunsRpsMutation:n0t,useGetTestrunsResponseTimeMutation:i0t,useGetRequestsMutation:a0t,useGetFailuresMutation:o0t,useGetTotalRequestsMutation:s0t,useGetTotalFailuresMutation:l0t,useGetErrorPercentageMutation:u0t,useGetTotalVuhMutation:c0t,useGetCustomerDataMutation:f0t,useGetTestrunsMutation:d0t,useGetScatterplotMutation:h0t}=Lk;function UL(e,{payload:t}){return{...e,...t}}const p0t={username:window.templateArgs.username},swe=Fl({name:"customer",initialState:p0t,reducers:{setCustomer:UL}}),v0t=swe.actions,g0t=swe.reducer,y0t={message:null},lwe=Fl({name:"snackbar",initialState:y0t,reducers:{setSnackbar:UL}}),Qd=lwe.actions,m0t=lwe.reducer,x0t={resolution:5,testruns:{},currentTestrunIndex:0,testrunsForDisplay:[],shouldShowAdvanced:!1},uwe=Fl({name:"toolbar",initialState:x0t,reducers:{setToolbar:UL}}),cwe=uwe.actions,_0t=uwe.reducer,Sm={CLOUD:"CLOUD",CLASSIC:"CLASSIC"},b0t={viewType:Sm.CLOUD,hasDismissedSwarmForm:!1},fwe=Fl({name:"ui",initialState:b0t,reducers:{setUi:UL}}),dwe=fwe.actions,S0t=fwe.reducer,hwe=O.createContext(null),w0t=Qj({[Lk.reducerPath]:Lk.reducer,customer:g0t,snackbar:m0t,toolbar:_0t,ui:S0t}),pwe=$yt({reducer:w0t,middleware:e=>e().concat(Lk.middleware)}),ys=_1,co=Xce(hwe),C0t=()=>e=>pwe.dispatch(e);function fo(e,t){const r=C0t();return O.useCallback(n=>{r(e(n))},[e,r])}function wV(){const{numUsers:e,workerCount:t}=ys(({swarm:u})=>u),{maxUsers:r,usersPerWorker:n}=co(({customer:u})=>u),[i,a]=O.useState(),[o,s]=O.useState(!1),l=O.useCallback(({target:u})=>{if(u&&u.name==="userCount"){const c=Number(u.value);r&&c>r?(a({level:"error",message:"The number of users has exceeded the allowance for this account."}),s(!0)):c>t*Number(n)?(a({level:"warning",message:`Locust worker count is determined by the User count you specified at start up (${e}), and launching more users risks overloading workers, impacting your results. Re-run locust-cloud with your desired user count to avoid this.`}),s(!1)):(s(!1),a(void 0))}},[e,t,r,n]);return{alert:i,shouldDisableForm:o,handleFormChange:l}}function T0t(){const e=ys(({swarm:u})=>u.state),{viewType:t,hasDismissedSwarmForm:r}=co(({ui:u})=>u),{alert:n,shouldDisableForm:i,handleFormChange:a}=wV(),{alert:o,shouldDisableForm:s,handleFormChange:l}=wV();return!r&&e===Ut.READY?null:W.jsxs(Vt,{sx:{display:"flex",columnGap:2,marginY:"auto",height:"50px"},children:[e===Ut.STOPPED||r?W.jsx(Bge,{alert:n,isDisabled:i,onFormChange:a}):W.jsxs(W.Fragment,{children:[W.jsx(zge,{alert:o,isDisabled:s,onFormChange:l}),W.jsx(Vge,{})]}),t==Sm.CLASSIC&&W.jsx(Fge,{})]})}function M0t(){return W.jsx(gpe,{position:"static",children:W.jsx(qd,{maxWidth:"xl",children:W.jsxs(Zpe,{disableGutters:!0,sx:{display:"flex",justifyContent:"space-between",columnGap:2},children:[W.jsx(Wn,{color:"inherit",href:"/",sx:{display:"flex",alignItems:"center"},underline:"none",children:W.jsx(xve,{})}),W.jsxs(Vt,{sx:{display:"flex",columnGap:6},children:[!window.templateArgs.isGraphViewer&&W.jsxs(W.Fragment,{children:[W.jsx(Gve,{}),W.jsx(T0t,{})]}),W.jsx(Bve,{})]})]})})})}function I0t(){const e=fo(dwe.setUi),{viewType:t}=co(({ui:n})=>n),r=t===Sm.CLOUD?Sm.CLASSIC:Sm.CLOUD;return W.jsx(qd,{maxWidth:"xl",sx:{position:"relative"},children:W.jsx(Gc,{onClick:()=>e({viewType:r}),sx:{position:"absolute",mt:"4px",right:16,zIndex:1},children:r})})}function A0t({children:e}){const t=ys(({swarm:r})=>r.state);return W.jsxs(W.Fragment,{children:[W.jsx(M0t,{}),!window.templateArgs.isGraphViewer&&t!==Ut.READY&&W.jsx(I0t,{}),W.jsx("main",{children:e})]})}function k0t(){const e=O.useCallback(()=>r({message:null}),[]),t=co(({snackbar:n})=>n.message),r=fo(Qd.setSnackbar);return W.jsx(tVe,{autoHideDuration:5e3,onClose:e,open:!!t,children:W.jsx(yA,{onClose:e,severity:"error",sx:{width:"100%"},variant:"filled",children:t})})}const vwe="5",D0t=["1","2",vwe,"10","30"];function s8({onSelectTestRun:e,showHideAdvanced:t,shouldShowResolution:r=!1}){const n=fo(cwe.setToolbar),{testruns:i,testrunsForDisplay:a,currentTestrunIndex:o}=co(({toolbar:d})=>d),s=ys(({url:d})=>d.query&&d.query.showAdvanced==="true"||!1),[l,u]=O.useState(a[0]),c=d=>{e&&e(d.target.value);const h=i[d.target.value];n({currentTestrun:h.runId,currentTestrunIndex:h.index}),Ine({testrun:d.target.value})},f=d=>{n({shouldShowAdvanced:d.target.checked}),Ine({showAdvanced:String(d.target.checked)})};return O.useEffect(()=>{o!==void 0&&o>=0&&u(a[o])},[o,a]),O.useEffect(()=>{s&&n({shouldShowAdvanced:s})},[s]),W.jsxs(Vt,{sx:{display:"flex",columnGap:2,mb:1},children:[r&&W.jsx(sw,{defaultValue:vwe,label:"Resolution",name:"resolution",onChange:d=>n({resolution:Number(d.target.value)}),options:D0t,size:"small",sx:{width:"150px"}}),!!a.length&&W.jsx(sw,{label:"Test Run",name:"testrun",onChange:c,options:a,size:"small",sx:{width:"250px"},value:l}),t&&W.jsx(QG,{control:W.jsx(_A,{defaultChecked:s,onChange:f}),label:"Advanced"})]})}function gwe(e,t,{shouldRunInterval:r,immediate:n}={shouldRunInterval:!0,immediate:!1}){const i=O.useRef(e);O.useEffect(()=>{i.current=e},[e]),O.useEffect(()=>{if(!r)return;n&&i.current();let a=!1;const o=async()=>{a||(await i.current(),setTimeout(o,t))};return o(),()=>{a=!0}},[t,r])}const v_={time:[]},P0t={time:[]},Kg={RPS:["#00ca5a","#0099ff","#ff6d6d"],PER_REQUEST:["#9966CC","#8A2BE2","#8E4585","#E0B0FF","#C8A2C8","#E6E6FA"],ERROR:["#ff8080","#ff4d4d","#ff1a1a","#e60000","#b30000","#800000"]},L0t=["Users","RPS"],R0t=[{name:"Users",key:"users",yAxisIndex:0},{name:"Requests per Second",key:"rps",yAxisIndex:1,areaStyle:{}},{name:"Errors per Second",key:"errorRate",yAxisIndex:1,areaStyle:{}}],E0t={requestLines:[],rpsPerRequest:v_,avgResponseTimes:v_,errorsPerRequest:v_,perc99ResponseTimes:v_,responseLength:v_,rpsData:P0t};function ywe(){const{state:e}=ys(({swarm:M})=>M),{resolution:t,currentTestrunIndex:r,currentTestrun:n,testruns:i,shouldShowAdvanced:a}=co(({toolbar:M})=>M),o=fo(Qd.setSnackbar),[s,l]=O.useState(!0),[u,c]=O.useState(!1),[f,d]=O.useState(new Date().toISOString()),[h,p]=O.useState(E0t),[v,g]=O.useState(!1),[y]=owe(),[m]=Zmt(),[x]=Kmt(),[_]=Qmt(),[S]=Jmt(),[b]=e0t(),[w]=t0t(),C=async()=>{if(n){const M=new Date().toISOString(),{endTime:I}=i[new Date(n).toLocaleString()],A={start:n,end:!I||e===Ut.RUNNING&&r===0?f:I,resolution:t,testrun:n},k=[{key:"requestLines",mutation:y},{key:"rpsData",mutation:w},{key:"avgResponseTimes",mutation:x},{key:"rpsPerRequest",mutation:m,isAdvanced:!0},{key:"errorsPerRequest",mutation:_,isAdvanced:!0},{key:"perc99ResponseTimes",mutation:S,isAdvanced:!0},{key:"responseLength",mutation:b,isAdvanced:!0}].filter(({isAdvanced:L})=>!L||a),D=await Promise.all(k.map(({mutation:L})=>L(A))),P=D.find(({error:L})=>L);if(P&&P.error&&"error"in P.error)o({message:P.error.error});else{const L=k.reduce((B,{key:E},G)=>({...B,[E]:D[G].data}),{}),N=L.requestLines.length;!N&&!h.requestLines&&(r!==0||e!==Ut.RUNNING)?c(!0):c(!1);const R=N!==h.requestLines.length||L.requestLines.some(({key:B},E)=>B!==h.requestLines[E].key);L.requestLines=R?L.requestLines:h.requestLines,g(R),p({...h,...L}),l(!1)}e!==Ut.STOPPED&&d(M)}};gwe(C,1e3,{shouldRunInterval:e===Ut.SPAWNING||e==Ut.RUNNING,immediate:!0}),O.useEffect(()=>{C()},[n,t,a]),O.useEffect(()=>{e===Ut.RUNNING&&l(!0)},[e]);const T=O.useCallback(()=>{l(!0),c(!1)},[]);return W.jsxs(W.Fragment,{children:[W.jsx(s8,{onSelectTestRun:T,shouldShowResolution:!0,showHideAdvanced:!0}),u&&W.jsx(yA,{severity:"error",children:"There was a problem loading some graphs for this testrun."}),W.jsxs(Vt,{sx:{position:"relative"},children:[s&&W.jsx(Vt,{sx:{position:"absolute",height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0.4)",zIndex:1,display:"flex",justifyContent:"center",paddingTop:4},children:W.jsx(iBe,{})}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.rpsData,colors:Kg.RPS,lines:R0t,splitAxis:!0,title:"Throughput / active users",yAxisLabels:L0t}),W.jsxs(Vt,{sx:{display:!u||u&&h.requestLines&&h.requestLines.length?"block":"none"},children:[W.jsx(Bl,{chartValueFormatter:M=>`${Vf(Number(M[1]),2)}ms`,charts:h.avgResponseTimes,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Average Response Times"}),a&&W.jsxs(W.Fragment,{children:[W.jsx(Bl,{chartValueFormatter:Of,charts:h.rpsPerRequest,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"RPS per Request"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.errorsPerRequest,colors:Kg.ERROR,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Errors per Request"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.perc99ResponseTimes,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"99th Percentile Response Times"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.responseLength,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Response Length"})]})]})]})]})}const Ane=e=>e===1?"":"s";function O0t(e){if(!e||!e.length||!e[0].totalVuh)return"Unknown";const[{totalVuh:t}]=e;if(t==="0")return t;const[r,n]=t.includes("days")?t.split(", "):["0 days",t],i=parseInt(r)*24,[a,o]=n.split(":").map(Number),s=a+i;return[s&&`${s} hour${Ane(s)}`,o&&`${o} minute${Ane(o)}`].filter(Boolean).join(", ")}function mwe(){const[e,t]=O.useState(),r=ys(({swarm:s})=>s.state),{maxVuh:n}=co(({customer:s})=>s),i=fo(Qd.setSnackbar),[a]=c0t(),o=async()=>{const{data:s,error:l}=await a(),u=l;u&&"error"in u?i({message:u.error}):t(O0t(s))};return O.useEffect(()=>{o()},[r]),W.jsxs(hl,{elevation:3,sx:{py:4,px:8,display:"flex",flexDirection:"column",alignItems:"center",rowGap:4},children:[window.templateArgs.username&&W.jsxs(Vt,{sx:{display:"flex",alignItems:"center",flexDirection:"column",rowGap:1},children:[W.jsx(Mt,{sx:{fontWeight:"bold"},children:"Current User"}),W.jsx(Mt,{children:window.templateArgs.username})]}),W.jsxs(Vt,{sx:{display:"flex",alignItems:"center",flexDirection:"column",rowGap:1},children:[W.jsx(Mt,{sx:{fontWeight:"bold"},children:"Current Month Virtual User Time"}),W.jsxs(Mt,{children:["Included in Plan: ",n]}),W.jsxs(Mt,{children:["Used: ",e]})]})]})}const N0t=["#8A2BE2","#0000FF","#00ca5a","#FFA500","#FFFF00","#EE82EE"];function xwe(){const e=ys(({swarm:d})=>d.state),{currentTestrun:t}=co(({toolbar:d})=>d),r=fo(Qd.setSnackbar),[n,i]=O.useState(new Date().toISOString()),[a,o]=O.useState({time:[]}),[s,l]=O.useState([]),[u]=owe(),[c]=h0t(),f=async()=>{if(t){const d=new Date().toISOString(),h={start:t,end:n,testrun:t},[{data:p,error:v},{data:g,error:y}]=await Promise.all([u(h),c(h)]),m=v||y;m&&"error"in m&&r({message:m.error}),p&&g&&(l(p),o(g)),e!==Ut.STOPPED&&i(d)}};return Mv(f,5e3,{shouldRunInterval:e===Ut.SPAWNING||e==Ut.RUNNING}),O.useEffect(()=>{f()},[t]),W.jsxs(W.Fragment,{children:[W.jsx(s8,{}),W.jsx(Bl,{chartValueFormatter:Of,charts:a,colors:N0t,lines:s,scatterplot:!0,title:"Scatterplot"})]})}/*! *****************************************************************************
|
270
|
+
`,""):"No data",borderWidth:0},xAxis:{type:"time",min:(e.time||[new Date().toISOString()])[0],startValue:(e.time||[])[0],axisLabel:{formatter:_gt}},grid:{left:60,right:40},yAxis:xgt({splitAxis:a,yAxisLabels:o}),series:LSe({charts:e,lines:r,scatterplot:s}),color:n,toolbox:{right:10,feature:{dataZoom:{title:{zoom:"Zoom Select",back:"Zoom Reset"},yAxisIndex:!1},saveAsImage:{name:t.replace(/\s+/g,"_").toLowerCase()+"_"+new Date().getTime()/1e3,title:"Download as PNG",emphasis:{iconStyle:{textPosition:"left"}}}}}}),wgt=e=>({symbol:"none",label:{formatter:t=>`Run #${t.dataIndex+1}`,padding:[0,0,8,0]},data:(e.markers||[]).map(t=>({xAxis:t}))}),Cgt=e=>t=>{const{batch:r}=t;if(!r)return;const[{start:n,startValue:i,end:a}]=r,o=n>0&&a<=100||i>0;e.setOption({dataZoom:[{type:"slider",show:o}]})};function Bl({charts:e,title:t,lines:r,colors:n,chartValueFormatter:i,splitAxis:a,yAxisLabels:o,scatterplot:s,shouldReplaceMergeLines:l=!1}){const[u,c]=O.useState(null),f=mo(({theme:{isDarkMode:h}})=>h),d=O.useRef(null);return O.useEffect(()=>{if(!d.current)return;const h=utt(d.current);h.setOption(Sgt({charts:e,title:t,lines:r,colors:n,chartValueFormatter:i,splitAxis:a,yAxisLabels:o,scatterplot:s})),h.on("datazoom",Cgt(h));const p=()=>h.resize();return window.addEventListener("resize",p),h.group="swarmCharts",ctt("swarmCharts"),c(h),()=>{ftt(h),window.removeEventListener("resize",p)}},[d]),O.useEffect(()=>{const h=r.every(({key:p})=>!!e[p]);u&&h&&u.setOption({series:r.map(({key:p,yAxisIndex:v,...g},y)=>({...g,data:e[p],...a?{yAxisIndex:v||y}:{},...y===0?{markLine:wgt(e)}:{}}))})},[e,u,r]),O.useEffect(()=>{if(u){const{textColor:h,axisColor:p,backgroundColor:v,splitLine:g}=f?Zre.DARK:Zre.LIGHT;u.setOption({backgroundColor:v,textStyle:{color:h},title:{textStyle:{color:h}},legend:{icon:"circle",inactiveColor:h,textStyle:{color:h}},tooltip:{backgroundColor:v,textStyle:{color:h}},xAxis:{axisLine:{lineStyle:{color:p}}},yAxis:{axisLine:{lineStyle:{color:p}},splitLine:{lineStyle:{color:g}}}})}},[u,f]),O.useEffect(()=>{u&&u.setOption({series:LSe({charts:e,lines:r,scatterplot:s})},l?{replaceMerge:["series"]}:void 0)},[r]),H.jsx("div",{ref:d,style:{width:"100%",height:"300px"}})}const Tgt=lu.percentilesToChart?lu.percentilesToChart.map(e=>({name:`${e*100}th percentile`,key:`responseTimePercentile${e}`})):[],Mgt=["#ff9f00","#9966CC","#8A2BE2","#8E4585","#E0B0FF","#C8A2C8","#E6E6FA"],Igt=[{title:"Total Requests per Second",lines:[{name:"RPS",key:"currentRps"},{name:"Failures/s",key:"currentFailPerSec"}],colors:["#00ca5a","#ff6d6d"]},{title:"Response Times (ms)",lines:Tgt,colors:Mgt},{title:"Number of Users",lines:[{name:"Number of Users",key:"userCount"}],colors:["#0099ff"]}];function Agt({charts:e}){return H.jsx("div",{children:Igt.map((t,r)=>H.jsx(Bl,{...t,charts:e},`swarm-chart-${r}`))})}const kgt=({ui:{charts:e}})=>({charts:e}),Dgt=ho(kgt)(Agt);function Pgt(e){return(e*100).toFixed(1)+"%"}function dV({classRatio:e}){return H.jsx("ul",{children:Object.entries(e).map(([t,{ratio:r,tasks:n}])=>H.jsxs("li",{children:[`${Pgt(r)} ${t}`,n&&H.jsx(dV,{classRatio:n})]},`nested-ratio-${t}`))})}function Lgt({ratios:{perClass:e,total:t}}){return!e&&!t?null:H.jsxs("div",{children:[e&&H.jsxs(H.Fragment,{children:[H.jsx("h3",{children:"Ratio Per Class"}),H.jsx(dV,{classRatio:e})]}),t&&H.jsxs(H.Fragment,{children:[H.jsx("h3",{children:"Total Ratio"}),H.jsx(dV,{classRatio:t})]})]})}const Rgt=({ui:{ratios:e}})=>({ratios:e}),Egt=ho(Rgt)(Lgt);function Ogt(){const{data:e,refetch:t}=uYe(),r=Qu(Ub.setUi),n=mo(({swarm:a})=>a.state),i=n===Ut.SPAWNING||n==Ut.RUNNING;O.useEffect(()=>{e&&r({ratios:e})},[e]),Mv(t,5e3,{shouldRunInterval:i,immediate:!0})}function Ngt(){return Ogt(),H.jsx(Egt,{})}const zgt=[{key:"id",title:"Worker"},{key:"state",title:"State"},{key:"userCount",title:"# users"},{key:"cpuUsage",title:"CPU usage"},{key:"memoryUsage",title:"Memory usage",formatter:FHe}];function Bgt({workers:e=[]}){return H.jsx(Td,{defaultSortKey:"id",rows:e,structure:zgt})}const Fgt=({ui:{workers:e}})=>({workers:e}),Vgt=ho(Fgt)(Bgt),zo={stats:{component:xqe,key:"stats",title:"Statistics"},charts:{component:Dgt,key:"charts",title:"Charts"},failures:{component:tqe,key:"failures",title:"Failures"},exceptions:{component:KYe,key:"exceptions",title:"Exceptions"},ratios:{component:Ngt,key:"ratios",title:"Current Ratio"},reports:{component:lqe,key:"reports",title:"Download Data"},logs:{component:aqe,key:Gge,title:"Logs"},workers:{component:Vgt,key:"workers",title:"Workers",shouldDisplayTab:e=>e.swarm.isDistributed}},RSe=[zo.stats,zo.charts,zo.failures,zo.exceptions,zo.ratios,zo.reports,zo.logs,zo.workers],$gt=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);window.history.pushState(null,"",t)},Ggt=()=>window.location.search?BHe(window.location.search):null,Wgt={query:Ggt()},ESe=jo({name:"url",initialState:Wgt,reducers:{setUrl:$1}}),Hgt=ESe.actions,jgt=ESe.reducer;function Ugt({hasNotification:e,title:t}){return H.jsxs(Vt,{sx:{display:"flex",alignItems:"center"},children:[e&&H.jsx(GW,{color:"secondary"}),H.jsx("span",{children:t})]})}function Ygt({currentTabIndexFromQuery:e,notification:t,setNotification:r,setUrl:n,tabs:i}){const[a,o]=O.useState(e),s=(l,u)=>{const c=i[u].key;t[c]&&r({[c]:!1}),$gt({tab:c}),n({query:{tab:c}}),o(u)};return O.useEffect(()=>{o(e)},[e]),H.jsxs(qd,{maxWidth:"xl",children:[H.jsx(Vt,{sx:{mb:2},children:H.jsx(_$e,{onChange:s,value:a,children:i.map(({key:l,title:u},c)=>H.jsx(bVe,{label:H.jsx(Ugt,{hasNotification:t[l],title:u})},`tab-${c}`))})}),i.map(({component:l=GYe},u)=>a===u&&H.jsx(l,{},`tabpabel-${u}`))]})}const qgt=(e,{tabs:t,extendedTabs:r})=>{const{notification:n,swarm:{extendedTabs:i},url:{query:a}}=e,o=(t||[...RSe,...r||i||[]]).filter(({shouldDisplayTab:l})=>!l||l&&l(e)),s=a&&a.tab?o.findIndex(({key:l})=>l===a.tab):0;return{notification:n,tabs:o,currentTabIndexFromQuery:s>-1?s:0}},Xgt={setNotification:Hge.setNotification,setUrl:Hgt.setUrl},OSe=ho(qgt,Xgt)(Ygt),Zgt=e=>W6({palette:{mode:e,primary:{main:"#15803d"},success:{main:"#00C853"}},components:{MuiCssBaseline:{styleOverrides:{":root":{"--footer-height":"40px"},p:{margin:0}}}}});function NSe(){const e=mo(({theme:{isDarkMode:t}})=>t);return O.useMemo(()=>Zgt(e?su.DARK:su.LIGHT),[e])}const Qre=2e3;function zSe(){const e=Qu(VW.setSwarm),t=Qu(Ub.setUi),r=Qu(Ub.updateCharts),n=Qu(Ub.updateChartMarkers),i=mo(({swarm:d})=>d),a=O.useRef(i.state),[o,s]=O.useState(!1),{data:l,refetch:u}=lYe(),c=i.state===Ut.SPAWNING||i.state==Ut.RUNNING,f=()=>{if(!l)return;const{currentResponseTimePercentiles:d,extendedStats:h,stats:p,errors:v,totalRps:g,totalFailPerSec:y,failRatio:m,workers:x,userCount:_,totalAvgResponseTime:S}=l,b=new Date().toISOString();o&&(s(!1),n(b));const w=Vf(g,2),C=Vf(y,2),T=Vf(m*100),M={...Object.entries(d).reduce((I,[A,k])=>({...I,[A]:[b,k||0]}),{}),currentRps:[b,w],currentFailPerSec:[b,C],totalAvgResponseTime:[b,Vf(S,2)],userCount:[b,_],time:b};t({extendedStats:h,stats:p,errors:v,totalRps:w,failRatio:T,workers:x,userCount:_}),r(M)};O.useEffect(()=>{l&&e({state:l.state})},[l&&l.state]),Mv(f,Qre,{shouldRunInterval:!!l&&c}),Mv(u,Qre,{shouldRunInterval:c}),O.useEffect(()=>{i.state===Ut.RUNNING&&a.current===Ut.STOPPED&&s(!0),a.current=i.state},[i.state,a])}function Kgt({swarmState:e,tabs:t,extendedTabs:r}){zSe(),Yge();const n=NSe();return H.jsxs(aWe,{theme:n,children:[H.jsx(tWe,{}),H.jsx(MYe,{children:e===Ut.READY?H.jsx(tL,{}):H.jsx(OSe,{extendedTabs:r,tabs:t})})]})}const Qgt=({swarm:{state:e}})=>({swarmState:e});ho(Qgt)(Kgt);const Jgt=pW({[DA.reducerPath]:DA.reducer,logViewer:LYe,notification:AYe,swarm:vYe,theme:EHe,ui:ZYe,url:jgt}),eyt=cHe({reducer:Jgt,middleware:e=>e().concat(DA.middleware)});var hV={},Jre=OG;hV.createRoot=Jre.createRoot,hV.hydrateRoot=Jre.hydrateRoot;var Kj={},v5={};const tyt=Vc(cEe);var ene;function ryt(){return ene||(ene=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=tyt}(v5)),v5}var nyt=F6;Object.defineProperty(Kj,"__esModule",{value:!0});var BSe=Kj.default=void 0,iyt=nyt(ryt()),ayt=W;BSe=Kj.default=(0,iyt.default)((0,ayt.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function ti(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oyt=typeof Symbol=="function"&&Symbol.observable||"@@observable",tne=oyt,g5=()=>Math.random().toString(36).substring(7).split("").join("."),syt={INIT:`@@redux/INIT${g5()}`,REPLACE:`@@redux/REPLACE${g5()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${g5()}`},Ik=syt;function Su(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function FSe(e,t,r){if(typeof e!="function")throw new Error(ti(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ti(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ti(1));return r(FSe)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,l=!1;function u(){o===a&&(o=new Map,a.forEach((g,y)=>{o.set(y,g)}))}function c(){if(l)throw new Error(ti(3));return i}function f(g){if(typeof g!="function")throw new Error(ti(4));if(l)throw new Error(ti(5));let y=!0;u();const m=s++;return o.set(m,g),function(){if(y){if(l)throw new Error(ti(6));y=!1,u(),o.delete(m),a=null}}}function d(g){if(!Su(g))throw new Error(ti(7));if(typeof g.type>"u")throw new Error(ti(8));if(typeof g.type!="string")throw new Error(ti(17));if(l)throw new Error(ti(9));try{l=!0,i=n(i,g)}finally{l=!1}return(a=o).forEach(m=>{m()}),g}function h(g){if(typeof g!="function")throw new Error(ti(10));n=g,d({type:Ik.REPLACE})}function p(){const g=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(ti(11));function m(){const _=y;_.next&&_.next(c())}return m(),{unsubscribe:g(m)}},[tne](){return this}}}return d({type:Ik.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:h,[tne]:p}}function lyt(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Ik.INIT})>"u")throw new Error(ti(12));if(typeof r(void 0,{type:Ik.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ti(13))})}function Qj(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let i;try{lyt(r)}catch(a){i=a}return function(o={},s){if(i)throw i;let l=!1;const u={};for(let c=0;c<n.length;c++){const f=n[c],d=r[f],h=o[f],p=d(h,s);if(typeof p>"u")throw s&&s.type,new Error(ti(14));u[f]=p,l=l||p!==h}return l=l||n.length!==Object.keys(o).length,l?u:o}}function Ak(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function uyt(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(ti(15))};const o={getState:i.getState,dispatch:(l,...u)=>a(l,...u)},s=e.map(l=>l(o));return a=Ak(...s)(i.dispatch),{...i,dispatch:a}}}function VSe(e){return Su(e)&&"type"in e&&typeof e.type=="string"}var Jj=Symbol.for("immer-nothing"),lS=Symbol.for("immer-draftable"),Ea=Symbol.for("immer-state");function oi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ev=Object.getPrototypeOf;function wu(e){return!!e&&!!e[Ea]}function ul(e){var t;return e?$Se(e)||Array.isArray(e)||!!e[lS]||!!((t=e.constructor)!=null&&t[lS])||cC(e)||fC(e):!1}var cyt=Object.prototype.constructor.toString();function $Se(e){if(!e||typeof e!="object")return!1;const t=Ev(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===cyt}function fyt(e){return wu(e)||oi(15,e),e[Ea].base_}function Bw(e,t){Ov(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Ov(e){const t=e[Ea];return t?t.type_:Array.isArray(e)?1:cC(e)?2:fC(e)?3:0}function Fw(e,t){return Ov(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y5(e,t){return Ov(e)===2?e.get(t):e[t]}function GSe(e,t,r){const n=Ov(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function dyt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cC(e){return e instanceof Map}function fC(e){return e instanceof Set}function lp(e){return e.copy_||e.base_}function pV(e,t){if(cC(e))return new Map(e);if(fC(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=$Se(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ea];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const o=i[a],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(Ev(e),n)}else{const n=Ev(e);if(n!==null&&r)return{...e};const i=Object.create(n);return Object.assign(i,e)}}function e8(e,t=!1){return WL(e)||wu(e)||!ul(e)||(Ov(e)>1&&(e.set=e.add=e.clear=e.delete=hyt),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>e8(n,!0))),e}function hyt(){oi(2)}function WL(e){return Object.isFrozen(e)}var vV={};function Nv(e){const t=vV[e];return t||oi(0,e),t}function pyt(e,t){vV[e]||(vV[e]=t)}var Vw;function WSe(){return Vw}function vyt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rne(e,t){t&&(Nv("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gV(e){yV(e),e.drafts_.forEach(gyt),e.drafts_=null}function yV(e){e===Vw&&(Vw=e.parent_)}function nne(e){return Vw=vyt(Vw,e)}function gyt(e){const t=e[Ea];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ine(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ea].modified_&&(gV(t),oi(4)),ul(e)&&(e=kk(t,e),t.parent_||Dk(t,e)),t.patches_&&Nv("Patches").generateReplacementPatches_(r[Ea].base_,e,t.patches_,t.inversePatches_)):e=kk(t,r,[]),gV(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Jj?e:void 0}function kk(e,t,r){if(WL(t))return t;const n=t[Ea];if(!n)return Bw(t,(i,a)=>ane(e,n,t,i,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Dk(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const i=n.copy_;let a=i,o=!1;n.type_===3&&(a=new Set(i),i.clear(),o=!0),Bw(a,(s,l)=>ane(e,n,i,s,l,r,o)),Dk(e,i,!1),r&&e.patches_&&Nv("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ane(e,t,r,n,i,a,o){if(wu(i)){const s=a&&t&&t.type_!==3&&!Fw(t.assigned_,n)?a.concat(n):void 0,l=kk(e,i,s);if(GSe(r,n,l),wu(l))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(ul(i)&&!WL(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;kk(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Dk(e,i)}}function Dk(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&e8(t,r)}function yyt(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:WSe(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=t8;r&&(i=[n],a=$w);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}var t8={get(e,t){if(t===Ea)return e;const r=lp(e);if(!Fw(r,t))return myt(e,r,t);const n=r[t];return e.finalized_||!ul(n)?n:n===m5(e.base_,t)?(x5(e),e.copy_[t]=xV(n,e)):n},has(e,t){return t in lp(e)},ownKeys(e){return Reflect.ownKeys(lp(e))},set(e,t,r){const n=HSe(lp(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=m5(lp(e),t),a=i==null?void 0:i[Ea];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(dyt(r,i)&&(r!==void 0||Fw(e.base_,t)))return!0;x5(e),mV(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return m5(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,x5(e),mV(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=lp(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){oi(11)},getPrototypeOf(e){return Ev(e.base_)},setPrototypeOf(){oi(12)}},$w={};Bw(t8,(e,t)=>{$w[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});$w.deleteProperty=function(e,t){return $w.set.call(this,e,t,void 0)};$w.set=function(e,t,r){return t8.set.call(this,e[0],t,r,e[0])};function m5(e,t){const r=e[Ea];return(r?lp(r):e)[t]}function myt(e,t,r){var i;const n=HSe(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function HSe(e,t){if(!(t in e))return;let r=Ev(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ev(r)}}function mV(e){e.modified_||(e.modified_=!0,e.parent_&&mV(e.parent_))}function x5(e){e.copy_||(e.copy_=pV(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xyt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const o=this;return function(l=a,...u){return o.produce(l,c=>r.call(this,c,...u))}}typeof r!="function"&&oi(6),n!==void 0&&typeof n!="function"&&oi(7);let i;if(ul(t)){const a=nne(this),o=xV(t,void 0);let s=!0;try{i=r(o),s=!1}finally{s?gV(a):yV(a)}return rne(a,n),ine(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Jj&&(i=void 0),this.autoFreeze_&&e8(i,!0),n){const a=[],o=[];Nv("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else oi(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,l=>t(l,...s));let n,i;return[this.produce(t,r,(o,s)=>{n=o,i=s}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ul(e)||oi(8),wu(e)&&(e=_yt(e));const t=nne(this),r=xV(e,void 0);return r[Ea].isManual_=!0,yV(t),r}finishDraft(e,t){const r=e&&e[Ea];(!r||!r.isManual_)&&oi(9);const{scope_:n}=r;return rne(n,t),ine(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=Nv("Patches").applyPatches_;return wu(e)?n(e,t):this.produce(e,i=>n(i,t))}};function xV(e,t){const r=cC(e)?Nv("MapSet").proxyMap_(e,t):fC(e)?Nv("MapSet").proxySet_(e,t):yyt(e,t);return(t?t.scope_:WSe()).drafts_.push(r),r}function _yt(e){return wu(e)||oi(10,e),jSe(e)}function jSe(e){if(!ul(e)||WL(e))return e;const t=e[Ea];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=pV(e,t.scope_.immer_.useStrictShallowCopy_)}else r=pV(e,!0);return Bw(r,(n,i)=>{GSe(r,n,jSe(i))}),t&&(t.finalized_=!1),r}function byt(){const t="replace",r="add",n="remove";function i(d,h,p,v){switch(d.type_){case 0:case 2:return o(d,h,p,v);case 1:return a(d,h,p,v);case 3:return s(d,h,p,v)}}function a(d,h,p,v){let{base_:g,assigned_:y}=d,m=d.copy_;m.length<g.length&&([g,m]=[m,g],[p,v]=[v,p]);for(let x=0;x<g.length;x++)if(y[x]&&m[x]!==g[x]){const _=h.concat([x]);p.push({op:t,path:_,value:f(m[x])}),v.push({op:t,path:_,value:f(g[x])})}for(let x=g.length;x<m.length;x++){const _=h.concat([x]);p.push({op:r,path:_,value:f(m[x])})}for(let x=m.length-1;g.length<=x;--x){const _=h.concat([x]);v.push({op:n,path:_})}}function o(d,h,p,v){const{base_:g,copy_:y}=d;Bw(d.assigned_,(m,x)=>{const _=y5(g,m),S=y5(y,m),b=x?Fw(g,m)?t:r:n;if(_===S&&b===t)return;const w=h.concat(m);p.push(b===n?{op:b,path:w}:{op:b,path:w,value:S}),v.push(b===r?{op:n,path:w}:b===n?{op:r,path:w,value:f(_)}:{op:t,path:w,value:f(_)})})}function s(d,h,p,v){let{base_:g,copy_:y}=d,m=0;g.forEach(x=>{if(!y.has(x)){const _=h.concat([m]);p.push({op:n,path:_,value:x}),v.unshift({op:r,path:_,value:x})}m++}),m=0,y.forEach(x=>{if(!g.has(x)){const _=h.concat([m]);p.push({op:r,path:_,value:x}),v.unshift({op:n,path:_,value:x})}m++})}function l(d,h,p,v){p.push({op:t,path:[],value:h===Jj?void 0:h}),v.push({op:t,path:[],value:d})}function u(d,h){return h.forEach(p=>{const{path:v,op:g}=p;let y=d;for(let S=0;S<v.length-1;S++){const b=Ov(y);let w=v[S];typeof w!="string"&&typeof w!="number"&&(w=""+w),(b===0||b===1)&&(w==="__proto__"||w==="constructor")&&oi(19),typeof y=="function"&&w==="prototype"&&oi(19),y=y5(y,w),typeof y!="object"&&oi(18,v.join("/"))}const m=Ov(y),x=c(p.value),_=v[v.length-1];switch(g){case t:switch(m){case 2:return y.set(_,x);case 3:oi(16);default:return y[_]=x}case r:switch(m){case 1:return _==="-"?y.push(x):y.splice(_,0,x);case 2:return y.set(_,x);case 3:return y.add(x);default:return y[_]=x}case n:switch(m){case 1:return y.splice(_,1);case 2:return y.delete(_);case 3:return y.delete(p.value);default:return delete y[_]}default:oi(17,g)}}),d}function c(d){if(!ul(d))return d;if(Array.isArray(d))return d.map(c);if(cC(d))return new Map(Array.from(d.entries()).map(([p,v])=>[p,c(v)]));if(fC(d))return new Set(Array.from(d).map(c));const h=Object.create(Ev(d));for(const p in d)h[p]=c(d[p]);return Fw(d,lS)&&(h[lS]=d[lS]),h}function f(d){return wu(d)?c(d):d}pyt("Patches",{applyPatches_:u,generatePatches_:i,generateReplacementPatches_:l})}var uo=new xyt,dC=uo.produce,USe=uo.produceWithPatches.bind(uo);uo.setAutoFreeze.bind(uo);uo.setUseStrictShallowCopy.bind(uo);var one=uo.applyPatches.bind(uo);uo.createDraft.bind(uo);uo.finishDraft.bind(uo);function Syt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wyt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Cyt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var sne=e=>Array.isArray(e)?e:[e];function Tyt(e){const t=Array.isArray(e[0])?e[0]:e;return Cyt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Myt(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var Iyt=class{constructor(e){this.value=e}deref(){return this.value}},Ayt=typeof WeakRef<"u"?WeakRef:Iyt,kyt=0,lne=1;function wM(){return{s:kyt,v:void 0,o:null,p:null}}function Pk(e,t={}){let r=wM();const{resultEqualityCheck:n}=t;let i,a=0;function o(){var f;let s=r;const{length:l}=arguments;for(let d=0,h=l;d<h;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let v=s.o;v===null&&(s.o=v=new WeakMap);const g=v.get(p);g===void 0?(s=wM(),v.set(p,s)):s=g}else{let v=s.p;v===null&&(s.p=v=new Map);const g=v.get(p);g===void 0?(s=wM(),v.set(p,s)):s=g}}const u=s;let c;if(s.s===lne)c=s.v;else if(c=e.apply(null,arguments),a++,n){const d=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;d!=null&&n(d,c)&&(c=d,a!==0&&a--),i=typeof c=="object"&&c!==null||typeof c=="function"?new Ayt(c):c}return u.s=lne,u.v=c,c}return o.clearCache=()=>{r=wM(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Dyt(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,s,l={},u=i.pop();typeof u=="object"&&(l=u,u=i.pop()),Syt(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:h=Pk,argsMemoizeOptions:p=[],devModeChecks:v={}}=c,g=sne(d),y=sne(p),m=Tyt(i),x=f(function(){return a++,u.apply(null,arguments)},...g),_=h(function(){o++;const b=Myt(m,arguments);return s=x.apply(null,b),s},...y);return Object.assign(_,{resultFunc:u,memoizedResultFunc:x,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var r8=Dyt(Pk),Pyt=Object.assign((e,t=r8)=>{wyt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((o,s,l)=>(o[r[l]]=s,o),{}))},{withTypes:()=>Pyt});function YSe(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Lyt=YSe(),Ryt=YSe,Eyt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ak:Ak.apply(null,arguments)},Oyt=e=>e&&typeof e.match=="function";function el(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(ro(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>VSe(n)&&n.type===e,r}var qSe=class fb extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,fb.prototype)}static get[Symbol.species](){return fb}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new fb(...t[0].concat(this)):new fb(...t.concat(this))}};function une(e){return ul(e)?dC(e,()=>{}):e}function cne(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(ro(10));const n=r.insert(t,e);return e.set(t,n),n}function Nyt(e){return typeof e=="boolean"}var zyt=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new qSe;return r&&(Nyt(r)?o.push(Lyt):o.push(Ryt(r.extraArgument))),o},Qy="RTK_autoBatch",h_=()=>e=>({payload:e,meta:{[Qy]:!0}}),XSe=e=>t=>{setTimeout(t,e)},Byt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:XSe(10),Fyt=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?Byt:e.type==="callback"?e.queueNotification:XSe(e.timeout),u=()=>{o=!1,a&&(a=!1,s.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const f=()=>i&&c(),d=n.subscribe(f);return s.add(c),()=>{d(),s.delete(c)}},dispatch(c){var f;try{return i=!((f=c==null?void 0:c.meta)!=null&&f[Qy]),a=!i,a&&(o||(o=!0,l(u))),n.dispatch(c)}finally{i=!0}}})},Vyt=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new qSe(e);return n&&i.push(Fyt(typeof n=="object"?n:void 0)),i};function $yt(e){const t=zyt(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof r=="function")s=r;else if(Su(r))s=Qj(r);else throw new Error(ro(1));let l;typeof n=="function"?l=n(t):l=t();let u=Ak;i&&(u=Eyt({trace:!1,...typeof i=="object"&&i}));const c=uyt(...l),f=Vyt(c);let d=typeof o=="function"?o(f):f();const h=u(...d);return FSe(s,a,h)}function ZSe(e){const t={},r=[];let n;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(ro(28));if(s in t)throw new Error(ro(29));return t[s]=o,i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function Gyt(e){return typeof e=="function"}function Wyt(e,t){let[r,n,i]=ZSe(t),a;if(Gyt(e))a=()=>une(e());else{const s=une(e);a=()=>s}function o(s=a(),l){let u=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[i]),u.reduce((c,f)=>{if(f)if(wu(c)){const h=f(c,l);return h===void 0?c:h}else{if(ul(c))return dC(c,d=>f(d,l));{const d=f(c,l);if(d===void 0){if(c===null)return c;throw new Error(ro(9))}return d}}return c},s)}return o.getInitialState=a,o}var KSe=(e,t)=>Oyt(e)?e.match(t):e(t);function Pc(...e){return t=>e.some(r=>KSe(r,t))}function uS(...e){return t=>e.every(r=>KSe(r,t))}function HL(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function hC(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function n8(...e){return e.length===0?t=>HL(t,["pending"]):hC(e)?Pc(...e.map(t=>t.pending)):n8()(e[0])}function l0(...e){return e.length===0?t=>HL(t,["rejected"]):hC(e)?Pc(...e.map(t=>t.rejected)):l0()(e[0])}function jL(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?uS(l0(...e),t):hC(e)?uS(l0(...e),t):jL()(e[0])}function Ed(...e){return e.length===0?t=>HL(t,["fulfilled"]):hC(e)?Pc(...e.map(t=>t.fulfilled)):Ed()(e[0])}function _V(...e){return e.length===0?t=>HL(t,["pending","fulfilled","rejected"]):hC(e)?Pc(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):_V()(e[0])}var Hyt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",QSe=(e=21)=>{let t="",r=e;for(;r--;)t+=Hyt[Math.random()*64|0];return t},jyt=["name","message","stack","code"],_5=class{constructor(e,t){zR(this,"_type");this.payload=e,this.meta=t}},fne=class{constructor(e,t){zR(this,"_type");this.payload=e,this.meta=t}},Uyt=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of jyt)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},dne=(()=>{function e(t,r,n){const i=el(t+"/fulfilled",(l,u,c,f)=>({payload:l,meta:{...f||{},arg:c,requestId:u,requestStatus:"fulfilled"}})),a=el(t+"/pending",(l,u,c)=>({payload:void 0,meta:{...c||{},arg:u,requestId:l,requestStatus:"pending"}})),o=el(t+"/rejected",(l,u,c,f,d)=>({payload:f,error:(n&&n.serializeError||Uyt)(l||"Rejected"),meta:{...d||{},arg:c,requestId:u,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function s(l){return(u,c,f)=>{const d=n!=null&&n.idGenerator?n.idGenerator(l):QSe(),h=new AbortController;let p,v;function g(m){v=m,h.abort()}const y=async function(){var _,S;let m;try{let b=(_=n==null?void 0:n.condition)==null?void 0:_.call(n,l,{getState:c,extra:f});if(qyt(b)&&(b=await b),b===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const w=new Promise((C,T)=>{p=()=>{T({name:"AbortError",message:v||"Aborted"})},h.signal.addEventListener("abort",p)});u(a(d,l,(S=n==null?void 0:n.getPendingMeta)==null?void 0:S.call(n,{requestId:d,arg:l},{getState:c,extra:f}))),m=await Promise.race([w,Promise.resolve(r(l,{dispatch:u,getState:c,extra:f,requestId:d,signal:h.signal,abort:g,rejectWithValue:(C,T)=>new _5(C,T),fulfillWithValue:(C,T)=>new fne(C,T)})).then(C=>{if(C instanceof _5)throw C;return C instanceof fne?i(C.payload,d,l,C.meta):i(C,d,l)})])}catch(b){m=b instanceof _5?o(null,d,l,b.payload,b.meta):o(b,d,l)}finally{p&&h.signal.removeEventListener("abort",p)}return n&&!n.dispatchConditionRejection&&o.match(m)&&m.meta.condition||u(m),m}();return Object.assign(y,{abort:g,requestId:d,arg:l,unwrap(){return y.then(Yyt)}})}}return Object.assign(s,{pending:a,rejected:o,fulfilled:i,settled:Pc(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Yyt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qyt(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Xyt=Symbol.for("rtk-slice-createasyncthunk");function Zyt(e,t){return`${e}/${t}`}function Kyt({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Xyt];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(ro(11));typeof process<"u";const s=(typeof i.reducers=="function"?i.reducers(Jyt()):i.reducers)||{},l=Object.keys(s),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(x,_){const S=typeof x=="string"?x:x.type;if(!S)throw new Error(ro(12));if(S in u.sliceCaseReducersByType)throw new Error(ro(13));return u.sliceCaseReducersByType[S]=_,c},addMatcher(x,_){return u.sliceMatchers.push({matcher:x,reducer:_}),c},exposeAction(x,_){return u.actionCreators[x]=_,c},exposeCaseReducer(x,_){return u.sliceCaseReducersByName[x]=_,c}};l.forEach(x=>{const _=s[x],S={reducerName:x,type:Zyt(a,x),createNotation:typeof i.reducers=="function"};tmt(_)?nmt(S,_,c,t):emt(S,_,c)});function f(){const[x={},_=[],S=void 0]=typeof i.extraReducers=="function"?ZSe(i.extraReducers):[i.extraReducers],b={...x,...u.sliceCaseReducersByType};return Wyt(i.initialState,w=>{for(let C in b)w.addCase(C,b[C]);for(let C of u.sliceMatchers)w.addMatcher(C.matcher,C.reducer);for(let C of _)w.addMatcher(C.matcher,C.reducer);S&&w.addDefaultCase(S)})}const d=x=>x,h=new Map;let p;function v(x,_){return p||(p=f()),p(x,_)}function g(){return p||(p=f()),p.getInitialState()}function y(x,_=!1){function S(w){let C=w[x];return typeof C>"u"&&_&&(C=g()),C}function b(w=d){const C=cne(h,_,{insert:()=>new WeakMap});return cne(C,w,{insert:()=>{const T={};for(const[M,I]of Object.entries(i.selectors??{}))T[M]=Qyt(I,w,g,_);return T}})}return{reducerPath:x,getSelectors:b,get selectors(){return b(S)},selectSlice:S}}const m={name:a,reducer:v,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:g,...y(o),injectInto(x,{reducerPath:_,...S}={}){const b=_??o;return x.inject({reducerPath:b,reducer:v},S),{...m,...y(b,!0)}}};return m}}function Qyt(e,t,r,n){function i(a,...o){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...o)}return i.unwrapped=e,i}var Fl=Kyt();function Jyt(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function emt({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!rmt(n))throw new Error(ro(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?el(e,o):el(e))}function tmt(e){return e._reducerDefinitionType==="asyncThunk"}function rmt(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nmt({type:e,reducerName:t},r,n,i){if(!i)throw new Error(ro(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:l,settled:u,options:c}=r,f=i(e,a,c);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),s&&n.addCase(f.pending,s),l&&n.addCase(f.rejected,l),u&&n.addMatcher(f.settled,u),n.exposeCaseReducer(t,{fulfilled:o||CM,pending:s||CM,rejected:l||CM,settled:u||CM})}function CM(){}function ro(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var JSe=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(JSe||{});function imt(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var hne=Su;function ewe(e,t){if(e===t||!(hne(e)&&hne(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let i=r.length===n.length;const a=Array.isArray(t)?[]:{};for(const o of r)a[o]=ewe(e[o],t[o]),i&&(i=e[o]===a[o]);return i?e:a}function bm(e){let t=0;for(const r in e)t++;return t}var pne=e=>[].concat(...e);function amt(e){return new RegExp("(^|:)//").test(e)}function omt(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function vne(e){return e!=null}function smt(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var lmt=e=>e.replace(/\/$/,""),umt=e=>e.replace(/^\//,"");function cmt(e,t){if(!e)return t;if(!t)return e;if(amt(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=lmt(e),t=umt(t),`${e}${r}${t}`}var gne=(...e)=>fetch(...e),fmt=e=>e.status>=200&&e.status<=299,dmt=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function yne(e){if(!Su(e))return e;const t={...e};for(const[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function hmt({baseUrl:e,prepareHeaders:t=f=>f,fetchFn:r=gne,paramsSerializer:n,isJsonContentType:i=dmt,jsonContentType:a="application/json",jsonReplacer:o,timeout:s,responseHandler:l,validateStatus:u,...c}={}){return typeof fetch>"u"&&r===gne&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(d,h)=>{const{signal:p,getState:v,extra:g,endpoint:y,forced:m,type:x}=h;let _,{url:S,headers:b=new Headers(c.headers),params:w=void 0,responseHandler:C=l??"json",validateStatus:T=u??fmt,timeout:M=s,...I}=typeof d=="string"?{url:d}:d,A={...c,signal:p,...I};b=new Headers(yne(b)),A.headers=await t(b,{getState:v,extra:g,endpoint:y,forced:m,type:x})||b;const k=j=>typeof j=="object"&&(Su(j)||Array.isArray(j)||typeof j.toJSON=="function");if(!A.headers.has("content-type")&&k(A.body)&&A.headers.set("content-type",a),k(A.body)&&i(A.headers)&&(A.body=JSON.stringify(A.body,o)),w){const j=~S.indexOf("?")?"&":"?",V=n?n(w):new URLSearchParams(yne(w));S+=j+V}S=cmt(e,S);const D=new Request(S,A);_={request:new Request(S,A)};let L,N=!1,R=M&&setTimeout(()=>{N=!0,h.abort()},M);try{L=await r(D)}catch(j){return{error:{status:N?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(j)},meta:_}}finally{R&&clearTimeout(R)}const B=L.clone();_.response=B;let E,G="";try{let j;if(await Promise.all([f(L,C).then(V=>E=V,V=>j=V),B.text().then(V=>G=V,()=>{})]),j)throw j}catch(j){return{error:{status:"PARSING_ERROR",originalStatus:L.status,data:G,error:String(j)},meta:_}}return T(L,E)?{data:E,meta:_}:{error:{status:L.status,data:E},meta:_}};async function f(d,h){if(typeof h=="function")return h(d);if(h==="content-type"&&(h=i(d.headers)?"json":"text"),h==="json"){const p=await d.text();return p.length?JSON.parse(p):null}return d.text()}}var mne=class{constructor(e,t=void 0){this.value=e,this.meta=t}},i8=el("__rtkq/focused"),twe=el("__rtkq/unfocused"),a8=el("__rtkq/online"),rwe=el("__rtkq/offline");function nwe(e){return e.type==="query"}function pmt(e){return e.type==="mutation"}function o8(e,t,r,n,i,a){return vmt(e)?e(t,r,n,i).map(bV).map(a):Array.isArray(e)?e.map(bV).map(a):[]}function vmt(e){return typeof e=="function"}function bV(e){return typeof e=="string"?{type:e}:e}function gmt(e,t){return e.catch(t)}var Gw=Symbol("forceQueryFn"),SV=e=>typeof e[Gw]=="function";function ymt({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:i}){const a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:l,updateSubscriptionOptions:u}=n.internalActions;return{buildInitiateQuery:p,buildInitiateMutation:v,getRunningQueryThunk:c,getRunningMutationThunk:f,getRunningQueriesThunk:d,getRunningMutationsThunk:h};function c(g,y){return m=>{var S;const x=i.endpointDefinitions[g],_=e({queryArgs:y,endpointDefinition:x,endpointName:g});return(S=a.get(m))==null?void 0:S[_]}}function f(g,y){return m=>{var x;return(x=o.get(m))==null?void 0:x[y]}}function d(){return g=>Object.values(a.get(g)||{}).filter(vne)}function h(){return g=>Object.values(o.get(g)||{}).filter(vne)}function p(g,y){const m=(x,{subscribe:_=!0,forceRefetch:S,subscriptionOptions:b,[Gw]:w,...C}={})=>(T,M)=>{var j;const I=e({queryArgs:x,endpointDefinition:y,endpointName:g}),A=t({...C,type:"query",subscribe:_,forceRefetch:S,subscriptionOptions:b,endpointName:g,originalArgs:x,queryCacheKey:I,[Gw]:w}),k=n.endpoints[g].select(x),D=T(A),P=k(M()),{requestId:L,abort:N}=D,R=P.requestId!==L,B=(j=a.get(T))==null?void 0:j[I],E=()=>k(M()),G=Object.assign(w?D.then(E):R&&!B?Promise.resolve(P):Promise.all([B,D]).then(E),{arg:x,requestId:L,subscriptionOptions:b,queryCacheKey:I,abort:N,async unwrap(){const V=await G;if(V.isError)throw V.error;return V.data},refetch:()=>T(m(x,{subscribe:!1,forceRefetch:!0})),unsubscribe(){_&&T(s({queryCacheKey:I,requestId:L}))},updateSubscriptionOptions(V){G.subscriptionOptions=V,T(u({endpointName:g,requestId:L,queryCacheKey:I,options:V}))}});if(!B&&!R&&!w){const V=a.get(T)||{};V[I]=G,a.set(T,V),G.then(()=>{delete V[I],bm(V)||a.delete(T)})}return G};return m}function v(g){return(y,{track:m=!0,fixedCacheKey:x}={})=>(_,S)=>{const b=r({type:"mutation",endpointName:g,originalArgs:y,track:m,fixedCacheKey:x}),w=_(b),{requestId:C,abort:T,unwrap:M}=w,I=gmt(w.unwrap().then(P=>({data:P})),P=>({error:P})),A=()=>{_(l({requestId:C,fixedCacheKey:x}))},k=Object.assign(I,{arg:w.arg,requestId:C,abort:T,unwrap:M,reset:A}),D=o.get(_)||{};return o.set(_,D),D[C]=k,k.then(()=>{delete D[C],bm(D)||o.delete(_)}),x&&(D[x]=k,k.then(()=>{D[x]===k&&(delete D[x],bm(D)||o.delete(_))})),k}}}function xne(e){return e}function mmt({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:a}){const o=(m,x,_,S)=>(b,w)=>{const C=r[m],T=n({queryArgs:x,endpointDefinition:C,endpointName:m});if(b(i.internalActions.queryResultPatched({queryCacheKey:T,patches:_})),!S)return;const M=i.endpoints[m].select(x)(w()),I=o8(C.providesTags,M.data,void 0,x,{},a);b(i.internalActions.updateProvidedBy({queryCacheKey:T,providedTags:I}))},s=(m,x,_,S=!0)=>(b,w)=>{const T=i.endpoints[m].select(x)(w()),M={patches:[],inversePatches:[],undo:()=>b(i.util.patchQueryData(m,x,M.inversePatches,S))};if(T.status==="uninitialized")return M;let I;if("data"in T)if(ul(T.data)){const[A,k,D]=USe(T.data,_);M.patches.push(...k),M.inversePatches.push(...D),I=A}else I=_(T.data),M.patches.push({op:"replace",path:[],value:I}),M.inversePatches.push({op:"replace",path:[],value:T.data});return M.patches.length===0||b(i.util.patchQueryData(m,x,M.patches,S)),M},l=(m,x,_)=>S=>S(i.endpoints[m].initiate(x,{subscribe:!1,forceRefetch:!0,[Gw]:()=>({data:_})})),u=async(m,{signal:x,abort:_,rejectWithValue:S,fulfillWithValue:b,dispatch:w,getState:C,extra:T})=>{const M=r[m.endpointName];try{let I=xne,A;const k={signal:x,abort:_,dispatch:w,getState:C,extra:T,endpoint:m.endpointName,type:m.type,forced:m.type==="query"?c(m,C()):void 0},D=m.type==="query"?m[Gw]:void 0;if(D?A=D():M.query?(A=await t(M.query(m.originalArgs),k,M.extraOptions),M.transformResponse&&(I=M.transformResponse)):A=await M.queryFn(m.originalArgs,k,M.extraOptions,P=>t(P,k,M.extraOptions)),typeof process<"u",A.error)throw new mne(A.error,A.meta);return b(await I(A.data,A.meta,m.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:A.meta,[Qy]:!0})}catch(I){let A=I;if(A instanceof mne){let k=xne;M.query&&M.transformErrorResponse&&(k=M.transformErrorResponse);try{return S(await k(A.value,A.meta,m.originalArgs),{baseQueryMeta:A.meta,[Qy]:!0})}catch(D){A=D}}throw typeof process<"u",console.error(A),A}};function c(m,x){var C,T,M;const _=(T=(C=x[e])==null?void 0:C.queries)==null?void 0:T[m.queryCacheKey],S=(M=x[e])==null?void 0:M.config.refetchOnMountOrArgChange,b=_==null?void 0:_.fulfilledTimeStamp,w=m.forceRefetch??(m.subscribe&&S);return w?w===!0||(Number(new Date)-Number(b))/1e3>=w:!1}const f=dne(`${e}/executeQuery`,u,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Qy]:!0}},condition(m,{getState:x}){var M,I,A;const _=x(),S=(I=(M=_[e])==null?void 0:M.queries)==null?void 0:I[m.queryCacheKey],b=S==null?void 0:S.fulfilledTimeStamp,w=m.originalArgs,C=S==null?void 0:S.originalArgs,T=r[m.endpointName];return SV(m)?!0:(S==null?void 0:S.status)==="pending"?!1:c(m,_)||nwe(T)&&((A=T==null?void 0:T.forceRefetch)!=null&&A.call(T,{currentArg:w,previousArg:C,endpointState:S,state:_}))?!0:!b},dispatchConditionRejection:!0}),d=dne(`${e}/executeMutation`,u,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Qy]:!0}}}),h=m=>"force"in m,p=m=>"ifOlderThan"in m,v=(m,x,_)=>(S,b)=>{const w=h(_)&&_.force,C=p(_)&&_.ifOlderThan,T=(I=!0)=>{const A={forceRefetch:I,isPrefetch:!0};return i.endpoints[m].initiate(x,A)},M=i.endpoints[m].select(x)(b());if(w)S(T());else if(C){const I=M==null?void 0:M.fulfilledTimeStamp;if(!I){S(T());return}(Number(new Date)-Number(new Date(I)))/1e3>=C&&S(T())}else S(T(!1))};function g(m){return x=>{var _,S;return((S=(_=x==null?void 0:x.meta)==null?void 0:_.arg)==null?void 0:S.endpointName)===m}}function y(m,x){return{matchPending:uS(n8(m),g(x)),matchFulfilled:uS(Ed(m),g(x)),matchRejected:uS(l0(m),g(x))}}return{queryThunk:f,mutationThunk:d,prefetch:v,updateQueryData:s,upsertQueryData:l,patchQueryData:o,buildMatchThunkActions:y}}function iwe(e,t,r,n){return o8(r[e.meta.arg.endpointName][t],Ed(e)?e.payload:void 0,jL(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function TM(e,t,r){const n=e[t];n&&r(n)}function Ww(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function _ne(e,t,r){const n=e[Ww(t)];n&&r(n)}var p_={};function xmt({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:o},assertTagType:s,config:l}){const u=el(`${e}/resetApiState`),c=Fl({name:`${e}/queries`,initialState:p_,reducers:{removeQueryResult:{reducer(x,{payload:{queryCacheKey:_}}){delete x[_]},prepare:h_()},queryResultPatched:{reducer(x,{payload:{queryCacheKey:_,patches:S}}){TM(x,_,b=>{b.data=one(b.data,S.concat())})},prepare:h_()}},extraReducers(x){x.addCase(t.pending,(_,{meta:S,meta:{arg:b}})=>{var C;const w=SV(b);_[C=b.queryCacheKey]??(_[C]={status:"uninitialized",endpointName:b.endpointName}),TM(_,b.queryCacheKey,T=>{T.status="pending",T.requestId=w&&T.requestId?T.requestId:S.requestId,b.originalArgs!==void 0&&(T.originalArgs=b.originalArgs),T.startedTimeStamp=S.startedTimeStamp})}).addCase(t.fulfilled,(_,{meta:S,payload:b})=>{TM(_,S.arg.queryCacheKey,w=>{if(w.requestId!==S.requestId&&!SV(S.arg))return;const{merge:C}=n[S.arg.endpointName];if(w.status="fulfilled",C)if(w.data!==void 0){const{fulfilledTimeStamp:T,arg:M,baseQueryMeta:I,requestId:A}=S;let k=dC(w.data,D=>C(D,b,{arg:M.originalArgs,baseQueryMeta:I,fulfilledTimeStamp:T,requestId:A}));w.data=k}else w.data=b;else w.data=n[S.arg.endpointName].structuralSharing??!0?ewe(wu(w.data)?fyt(w.data):w.data,b):b;delete w.error,w.fulfilledTimeStamp=S.fulfilledTimeStamp})}).addCase(t.rejected,(_,{meta:{condition:S,arg:b,requestId:w},error:C,payload:T})=>{TM(_,b.queryCacheKey,M=>{if(!S){if(M.requestId!==w)return;M.status="rejected",M.error=T??C}})}).addMatcher(o,(_,S)=>{const{queries:b}=a(S);for(const[w,C]of Object.entries(b))((C==null?void 0:C.status)==="fulfilled"||(C==null?void 0:C.status)==="rejected")&&(_[w]=C)})}}),f=Fl({name:`${e}/mutations`,initialState:p_,reducers:{removeMutationResult:{reducer(x,{payload:_}){const S=Ww(_);S in x&&delete x[S]},prepare:h_()}},extraReducers(x){x.addCase(r.pending,(_,{meta:S,meta:{requestId:b,arg:w,startedTimeStamp:C}})=>{w.track&&(_[Ww(S)]={requestId:b,status:"pending",endpointName:w.endpointName,startedTimeStamp:C})}).addCase(r.fulfilled,(_,{payload:S,meta:b})=>{b.arg.track&&_ne(_,b,w=>{w.requestId===b.requestId&&(w.status="fulfilled",w.data=S,w.fulfilledTimeStamp=b.fulfilledTimeStamp)})}).addCase(r.rejected,(_,{payload:S,error:b,meta:w})=>{w.arg.track&&_ne(_,w,C=>{C.requestId===w.requestId&&(C.status="rejected",C.error=S??b)})}).addMatcher(o,(_,S)=>{const{mutations:b}=a(S);for(const[w,C]of Object.entries(b))((C==null?void 0:C.status)==="fulfilled"||(C==null?void 0:C.status)==="rejected")&&w!==(C==null?void 0:C.requestId)&&(_[w]=C)})}}),d=Fl({name:`${e}/invalidation`,initialState:p_,reducers:{updateProvidedBy:{reducer(x,_){var w,C;const{queryCacheKey:S,providedTags:b}=_.payload;for(const T of Object.values(x))for(const M of Object.values(T)){const I=M.indexOf(S);I!==-1&&M.splice(I,1)}for(const{type:T,id:M}of b){const I=(w=x[T]??(x[T]={}))[C=M||"__internal_without_id"]??(w[C]=[]);I.includes(S)||I.push(S)}},prepare:h_()}},extraReducers(x){x.addCase(c.actions.removeQueryResult,(_,{payload:{queryCacheKey:S}})=>{for(const b of Object.values(_))for(const w of Object.values(b)){const C=w.indexOf(S);C!==-1&&w.splice(C,1)}}).addMatcher(o,(_,S)=>{var w,C;const{provided:b}=a(S);for(const[T,M]of Object.entries(b))for(const[I,A]of Object.entries(M)){const k=(w=_[T]??(_[T]={}))[C=I||"__internal_without_id"]??(w[C]=[]);for(const D of A)k.includes(D)||k.push(D)}}).addMatcher(Pc(Ed(t),jL(t)),(_,S)=>{const b=iwe(S,"providesTags",n,s),{queryCacheKey:w}=S.meta.arg;d.caseReducers.updateProvidedBy(_,d.actions.updateProvidedBy({queryCacheKey:w,providedTags:b}))})}}),h=Fl({name:`${e}/subscriptions`,initialState:p_,reducers:{updateSubscriptionOptions(x,_){},unsubscribeQueryResult(x,_){},internal_getRTKQSubscriptions(){}}}),p=Fl({name:`${e}/internalSubscriptions`,initialState:p_,reducers:{subscriptionsUpdated:{reducer(x,_){return one(x,_.payload)},prepare:h_()}}}),v=Fl({name:`${e}/config`,initialState:{online:smt(),focused:omt(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(x,{payload:_}){x.middlewareRegistered=x.middlewareRegistered==="conflict"||i!==_?"conflict":!0}},extraReducers:x=>{x.addCase(a8,_=>{_.online=!0}).addCase(rwe,_=>{_.online=!1}).addCase(i8,_=>{_.focused=!0}).addCase(twe,_=>{_.focused=!1}).addMatcher(o,_=>({..._}))}}),g=Qj({queries:c.reducer,mutations:f.reducer,provided:d.reducer,subscriptions:p.reducer,config:v.reducer}),y=(x,_)=>g(u.match(_)?void 0:x,_),m={...v.actions,...c.actions,...h.actions,...p.actions,...f.actions,...d.actions,resetApiState:u};return{reducer:y,actions:m}}var Bp=Symbol.for("RTKQ/skipToken"),awe={status:"uninitialized"},bne=dC(awe,()=>{}),Sne=dC(awe,()=>{});function _mt({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=f=>bne,i=f=>Sne;return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u,selectCachedArgsForQuery:c};function a(f){return{...f,...imt(f.status)}}function o(f){return f[t]}function s(f,d){return h=>{const p=e({queryArgs:h,endpointDefinition:d,endpointName:f});return r(h===Bp?n:y=>{var m,x;return((x=(m=o(y))==null?void 0:m.queries)==null?void 0:x[p])??bne},a)}}function l(){return f=>{let d;return typeof f=="object"?d=Ww(f)??Bp:d=f,r(d===Bp?i:v=>{var g,y;return((y=(g=o(v))==null?void 0:g.mutations)==null?void 0:y[d])??Sne},a)}}function u(f,d){const h=f[t],p=new Set;for(const v of d.map(bV)){const g=h.provided[v.type];if(!g)continue;let y=(v.id!==void 0?g[v.id]:pne(Object.values(g)))??[];for(const m of y)p.add(m)}return pne(Array.from(p.values()).map(v=>{const g=h.queries[v];return g?[{queryCacheKey:v,endpointName:g.endpointName,originalArgs:g.originalArgs}]:[]}))}function c(f,d){return Object.values(f[t].queries).filter(h=>(h==null?void 0:h.endpointName)===d&&h.status!=="uninitialized").map(h=>h.originalArgs)}}var qg=WeakMap?new WeakMap:void 0,wne=({endpointName:e,queryArgs:t})=>{let r="";const n=qg==null?void 0:qg.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(a,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=Su(o)?Object.keys(o).sort().reduce((s,l)=>(s[l]=o[l],s),{}):o,o));Su(t)&&(qg==null||qg.set(t,i)),r=i}return`${e}(${r})`};function bmt(...e){return function(r){const n=Pk(u=>{var c;return(c=r.extractRehydrationInfo)==null?void 0:c.call(r,u,{reducerPath:r.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let c=wne;if("serializeQueryArgs"in u.endpointDefinition){const f=u.endpointDefinition.serializeQueryArgs;c=d=>{const h=f(d);return typeof h=="string"?h:wne({...d,queryArgs:h})}}else r.serializeQueryArgs&&(c=r.serializeQueryArgs);return c(u)},tagTypes:[...r.tagTypes||[]]},a={endpointDefinitions:{},batch(u){u()},apiUid:QSe(),extractRehydrationInfo:n,hasRehydrationInfo:Pk(u=>n(u)!=null)},o={injectEndpoints:l,enhanceEndpoints({addTagTypes:u,endpoints:c}){if(u)for(const f of u)i.tagTypes.includes(f)||i.tagTypes.push(f);if(c)for(const[f,d]of Object.entries(c))typeof d=="function"?d(a.endpointDefinitions[f]):Object.assign(a.endpointDefinitions[f]||{},d);return o}},s=e.map(u=>u.init(o,i,a));function l(u){const c=u.endpoints({query:f=>({...f,type:"query"}),mutation:f=>({...f,type:"mutation"})});for(const[f,d]of Object.entries(c)){if(u.overrideExisting!==!0&&f in a.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(ro(39));typeof process<"u";continue}a.endpointDefinitions[f]=d;for(const h of s)h.injectEndpoint(f,d)}return o}return o.injectEndpoints({endpoints:r.endpoints})}}function df(e,...t){return Object.assign(e,...t)}var Smt=({api:e,queryThunk:t,internalState:r})=>{const n=`${e.reducerPath}/subscriptions`;let i=null,a=null;const{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions,l=(h,p)=>{var g,y,m;if(o.match(p)){const{queryCacheKey:x,requestId:_,options:S}=p.payload;return(g=h==null?void 0:h[x])!=null&&g[_]&&(h[x][_]=S),!0}if(s.match(p)){const{queryCacheKey:x,requestId:_}=p.payload;return h[x]&&delete h[x][_],!0}if(e.internalActions.removeQueryResult.match(p))return delete h[p.payload.queryCacheKey],!0;if(t.pending.match(p)){const{meta:{arg:x,requestId:_}}=p,S=h[y=x.queryCacheKey]??(h[y]={});return S[`${_}_running`]={},x.subscribe&&(S[_]=x.subscriptionOptions??S[_]??{}),!0}let v=!1;if(t.fulfilled.match(p)||t.rejected.match(p)){const x=h[p.meta.arg.queryCacheKey]||{},_=`${p.meta.requestId}_running`;v||(v=!!x[_]),delete x[_]}if(t.rejected.match(p)){const{meta:{condition:x,arg:_,requestId:S}}=p;if(x&&_.subscribe){const b=h[m=_.queryCacheKey]??(h[m]={});b[S]=_.subscriptionOptions??b[S]??{},v=!0}}return v},u=()=>r.currentSubscriptions,d={getSubscriptions:u,getSubscriptionCount:h=>{const v=u()[h]??{};return bm(v)},isRequestSubscribed:(h,p)=>{var g;const v=u();return!!((g=v==null?void 0:v[h])!=null&&g[p])}};return(h,p)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return i=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,d];const v=l(r.currentSubscriptions,h);let g=!0;if(v){a||(a=setTimeout(()=>{const x=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,_]=USe(i,()=>x);p.next(e.internalActions.subscriptionsUpdated(_)),i=x,a=null},500));const y=typeof h.type=="string"&&!!h.type.startsWith(n),m=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;g=!y&&!m}return[g,!1]}};function wmt(e){for(const t in e)return!1;return!0}var Cmt=2147483647/1e3-1,Tmt=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i})=>{const{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions,s=Pc(o.match,r.fulfilled,r.rejected);function l(d){const h=i.currentSubscriptions[d];return!!h&&!wmt(h)}const u={},c=(d,h,p)=>{var v;if(s(d)){const g=h.getState()[e],{queryCacheKey:y}=o.match(d)?d.payload:d.meta.arg;f(y,(v=g.queries[y])==null?void 0:v.endpointName,h,g.config)}if(t.util.resetApiState.match(d))for(const[g,y]of Object.entries(u))y&&clearTimeout(y),delete u[g];if(n.hasRehydrationInfo(d)){const g=h.getState()[e],{queries:y}=n.extractRehydrationInfo(d);for(const[m,x]of Object.entries(y))f(m,x==null?void 0:x.endpointName,h,g.config)}};function f(d,h,p,v){const g=n.endpointDefinitions[h],y=(g==null?void 0:g.keepUnusedDataFor)??v.keepUnusedDataFor;if(y===1/0)return;const m=Math.max(0,Math.min(y,Cmt));if(!l(d)){const x=u[d];x&&clearTimeout(x),u[d]=setTimeout(()=>{l(d)||p.dispatch(a({queryCacheKey:d})),delete u[d]},m*1e3)}}return c},Cne=new Error("Promise never resolved before cacheEntryRemoved."),Mmt=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a})=>{const o=_V(n),s=_V(i),l=Ed(n,i),u={},c=(h,p,v)=>{const g=f(h);if(n.pending.match(h)){const y=v[t].queries[g],m=p.getState()[t].queries[g];!y&&m&&d(h.meta.arg.endpointName,h.meta.arg.originalArgs,g,p,h.meta.requestId)}else if(i.pending.match(h))p.getState()[t].mutations[g]&&d(h.meta.arg.endpointName,h.meta.arg.originalArgs,g,p,h.meta.requestId);else if(l(h)){const y=u[g];y!=null&&y.valueResolved&&(y.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete y.valueResolved)}else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h)){const y=u[g];y&&(delete u[g],y.cacheEntryRemoved())}else if(e.util.resetApiState.match(h))for(const[y,m]of Object.entries(u))delete u[y],m.cacheEntryRemoved()};function f(h){return o(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.arg.fixedCacheKey??h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?Ww(h.payload):""}function d(h,p,v,g,y){const m=r.endpointDefinitions[h],x=m==null?void 0:m.onCacheEntryAdded;if(!x)return;const _={},S=new Promise(I=>{_.cacheEntryRemoved=I}),b=Promise.race([new Promise(I=>{_.valueResolved=I}),S.then(()=>{throw Cne})]);b.catch(()=>{}),u[v]=_;const w=e.endpoints[h].select(m.type==="query"?p:v),C=g.dispatch((I,A,k)=>k),T={...g,getCacheEntry:()=>w(g.getState()),requestId:y,extra:C,updateCachedData:m.type==="query"?I=>g.dispatch(e.util.updateQueryData(h,p,I)):void 0,cacheDataLoaded:b,cacheEntryRemoved:S},M=x(p,T);Promise.resolve(M).catch(I=>{if(I!==Cne)throw I})}return c},Imt=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Amt=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:o,refetchQuery:s,internalState:l})=>{const{removeQueryResult:u}=a.internalActions,c=Pc(Ed(n),jL(n)),f=Pc(Ed(n,i),l0(n,i));let d=[];const h=(g,y)=>{c(g)?v(iwe(g,"invalidatesTags",r,o),y):f(g)?v([],y):a.util.invalidateTags.match(g)&&v(o8(g.payload,void 0,void 0,void 0,void 0,o),y)};function p(g){var y,m;for(const x in g.queries)if(((y=g.queries[x])==null?void 0:y.status)==="pending")return!0;for(const x in g.mutations)if(((m=g.mutations[x])==null?void 0:m.status)==="pending")return!0;return!1}function v(g,y){const m=y.getState(),x=m[e];if(d.push(...g),x.config.invalidationBehavior==="delayed"&&p(x))return;const _=d;if(d=[],_.length===0)return;const S=a.util.selectInvalidatedBy(m,_);t.batch(()=>{const b=Array.from(S.values());for(const{queryCacheKey:w}of b){const C=x.queries[w],T=l.currentSubscriptions[w]??{};C&&(bm(T)===0?y.dispatch(u({queryCacheKey:w})):C.status!=="uninitialized"&&y.dispatch(s(C,w)))}})}return h},kmt=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{const a={},o=(d,h)=>{(r.internalActions.updateSubscriptionOptions.match(d)||r.internalActions.unsubscribeQueryResult.match(d))&&l(d.payload,h),(t.pending.match(d)||t.rejected.match(d)&&d.meta.condition)&&l(d.meta.arg,h),(t.fulfilled.match(d)||t.rejected.match(d)&&!d.meta.condition)&&s(d.meta.arg,h),r.util.resetApiState.match(d)&&c()};function s({queryCacheKey:d},h){const p=h.getState()[e],v=p.queries[d],g=i.currentSubscriptions[d];if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:y,skipPollingIfUnfocused:m}=f(g);if(!Number.isFinite(y))return;const x=a[d];x!=null&&x.timeout&&(clearTimeout(x.timeout),x.timeout=void 0);const _=Date.now()+y;a[d]={nextPollTimestamp:_,pollingInterval:y,timeout:setTimeout(()=>{(p.config.focused||!m)&&h.dispatch(n(v,d)),s({queryCacheKey:d},h)},y)}}function l({queryCacheKey:d},h){const v=h.getState()[e].queries[d],g=i.currentSubscriptions[d];if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:y}=f(g);if(!Number.isFinite(y)){u(d);return}const m=a[d],x=Date.now()+y;(!m||x<m.nextPollTimestamp)&&s({queryCacheKey:d},h)}function u(d){const h=a[d];h!=null&&h.timeout&&clearTimeout(h.timeout),delete a[d]}function c(){for(const d of Object.keys(a))u(d)}function f(d={}){let h=!1,p=Number.POSITIVE_INFINITY;for(let v in d)d[v].pollingInterval&&(p=Math.min(d[v].pollingInterval,p),h=d[v].skipPollingIfUnfocused||h);return{lowestPollingInterval:p,skipPollingIfUnfocused:h}}return o},Dmt=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const i=n8(r,n),a=l0(r,n),o=Ed(r,n),s={};return(u,c)=>{var f,d;if(i(u)){const{requestId:h,arg:{endpointName:p,originalArgs:v}}=u.meta,g=t.endpointDefinitions[p],y=g==null?void 0:g.onQueryStarted;if(y){const m={},x=new Promise((w,C)=>{m.resolve=w,m.reject=C});x.catch(()=>{}),s[h]=m;const _=e.endpoints[p].select(g.type==="query"?v:h),S=c.dispatch((w,C,T)=>T),b={...c,getCacheEntry:()=>_(c.getState()),requestId:h,extra:S,updateCachedData:g.type==="query"?w=>c.dispatch(e.util.updateQueryData(p,v,w)):void 0,queryFulfilled:x};y(v,b)}}else if(o(u)){const{requestId:h,baseQueryMeta:p}=u.meta;(f=s[h])==null||f.resolve({data:u.payload,meta:p}),delete s[h]}else if(a(u)){const{requestId:h,rejectedWithValue:p,baseQueryMeta:v}=u.meta;(d=s[h])==null||d.reject({error:u.payload??u.error,isUnhandledError:!p,meta:v}),delete s[h]}}},Pmt=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{const{removeQueryResult:a}=r.internalActions,o=(l,u)=>{i8.match(l)&&s(u,"refetchOnFocus"),a8.match(l)&&s(u,"refetchOnReconnect")};function s(l,u){const c=l.getState()[e],f=c.queries,d=i.currentSubscriptions;t.batch(()=>{for(const h of Object.keys(d)){const p=f[h],v=d[h];if(!v||!p)continue;(Object.values(v).some(y=>y[u]===!0)||Object.values(v).every(y=>y[u]===void 0)&&c.config[u])&&(bm(v)===0?l.dispatch(a({queryCacheKey:h})):p.status!=="uninitialized"&&l.dispatch(n(p,h)))}})}return o};function Lmt(e){const{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:a}=i,o={invalidateTags:el(`${t}/invalidateTags`)},s=f=>f.type.startsWith(`${t}/`),l=[Imt,Tmt,Amt,kmt,Mmt,Dmt];return{middleware:f=>{let d=!1;const p={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},v=l.map(m=>m(p)),g=Smt(p),y=Pmt(p);return m=>x=>{if(!VSe(x))return m(x);d||(d=!0,f.dispatch(n.internalActions.middlewareRegistered(a)));const _={...f,next:m},S=f.getState(),[b,w]=g(x,_,S);let C;if(b?C=m(x):C=w,f.getState()[t]&&(y(x,_,S),s(x)||i.hasRehydrationInfo(x)))for(const T of v)T(x,_,S);return C}},actions:o};function c(f,d,h={}){return r({type:"query",endpointName:f.endpointName,originalArgs:f.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:d,...h})}}var Tne=Symbol(),Rmt=({createSelector:e=r8}={})=>({name:Tne,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:a,keepUnusedDataFor:o,refetchOnMountOrArgChange:s,refetchOnFocus:l,refetchOnReconnect:u,invalidationBehavior:c},f){byt();const d=R=>(typeof process<"u",R);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:a8,onOffline:rwe,onFocus:i8,onFocusLost:twe},util:{}});const{queryThunk:h,mutationThunk:p,patchQueryData:v,updateQueryData:g,upsertQueryData:y,prefetch:m,buildMatchThunkActions:x}=mmt({baseQuery:r,reducerPath:i,context:f,api:t,serializeQueryArgs:a,assertTagType:d}),{reducer:_,actions:S}=xmt({context:f,queryThunk:h,mutationThunk:p,reducerPath:i,assertTagType:d,config:{refetchOnFocus:l,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:c}});df(t.util,{patchQueryData:v,updateQueryData:g,upsertQueryData:y,prefetch:m,resetApiState:S.resetApiState}),df(t.internalActions,S);const{middleware:b,actions:w}=Lmt({reducerPath:i,context:f,queryThunk:h,mutationThunk:p,api:t,assertTagType:d});df(t.util,w),df(t,{reducer:_,middleware:b});const{buildQuerySelector:C,buildMutationSelector:T,selectInvalidatedBy:M,selectCachedArgsForQuery:I}=_mt({serializeQueryArgs:a,reducerPath:i,createSelector:e});df(t.util,{selectInvalidatedBy:M,selectCachedArgsForQuery:I});const{buildInitiateQuery:A,buildInitiateMutation:k,getRunningMutationThunk:D,getRunningMutationsThunk:P,getRunningQueriesThunk:L,getRunningQueryThunk:N}=ymt({queryThunk:h,mutationThunk:p,api:t,serializeQueryArgs:a,context:f});return df(t.util,{getRunningMutationThunk:D,getRunningMutationsThunk:P,getRunningQueryThunk:N,getRunningQueriesThunk:L}),{name:Tne,injectEndpoint(R,B){var G;const E=t;(G=E.endpoints)[R]??(G[R]={}),nwe(B)?df(E.endpoints[R],{name:R,select:C(R,B),initiate:A(R,B)},x(h,R)):pmt(B)&&df(E.endpoints[R],{name:R,select:T(),initiate:k(R)},x(p,R))}}}});function Emt(e){return e.type==="query"}function Omt(e){return e.type==="mutation"}function MM(e,...t){return Object.assign(e,...t)}function b5(e){return e.replace(e[0],e[0].toUpperCase())}var Xg=WeakMap?new WeakMap:void 0,Nmt=({endpointName:e,queryArgs:t})=>{let r="";const n=Xg==null?void 0:Xg.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(a,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=Su(o)?Object.keys(o).sort().reduce((s,l)=>(s[l]=o[l],s),{}):o,o));Su(t)&&(Xg==null||Xg.set(t,i)),r=i}return`${e}(${r})`},S5=Symbol();function Mne(e,t,r,n){const i=O.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),a=O.useRef(i);return O.useEffect(()=>{a.current.serialized!==i.serialized&&(a.current=i)},[i]),a.current.serialized===i.serialized?a.current.queryArgs:e}function w5(e){const t=O.useRef(e);return O.useEffect(()=>{Za(t.current,e)||(t.current=e)},[e]),Za(t.current,e)?t.current:e}var zmt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bmt=zmt(),Fmt=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Vmt=Fmt(),$mt=()=>Bmt||Vmt?O.useLayoutEffect:O.useEffect,Gmt=$mt(),Wmt=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:JSe.pending}:e;function Hmt({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:i},unstable__sideEffectsInRender:a,createSelector:o},serializeQueryArgs:s,context:l}){const u=a?p=>p():O.useEffect;return{buildQueryHooks:d,buildMutationHook:h,usePrefetch:f};function c(p,v,g){if(v!=null&&v.endpointName&&p.isUninitialized){const{endpointName:b}=v,w=l.endpointDefinitions[b];s({queryArgs:v.originalArgs,endpointDefinition:w,endpointName:b})===s({queryArgs:g,endpointDefinition:w,endpointName:b})&&(v=void 0)}let y=p.isSuccess?p.data:v==null?void 0:v.data;y===void 0&&(y=p.data);const m=y!==void 0,x=p.isLoading,_=(!v||v.isLoading||v.isUninitialized)&&!m&&x,S=p.isSuccess||x&&m;return{...p,data:y,currentData:p.data,isFetching:x,isLoading:_,isSuccess:S}}function f(p,v){const g=r(),y=w5(v);return O.useCallback((m,x)=>g(e.util.prefetch(p,m,{...y,...x})),[p,g,y])}function d(p){const v=(m,{refetchOnReconnect:x,refetchOnFocus:_,refetchOnMountOrArgChange:S,skip:b=!1,pollingInterval:w=0,skipPollingIfUnfocused:C=!1}={})=>{const{initiate:T}=e.endpoints[p],M=r(),I=O.useRef(void 0);if(!I.current){const E=M(e.internalActions.internal_getRTKQSubscriptions());I.current=E}const A=Mne(b?Bp:m,Nmt,l.endpointDefinitions[p],p),k=w5({refetchOnReconnect:x,refetchOnFocus:_,pollingInterval:w,skipPollingIfUnfocused:C}),D=O.useRef(!1),P=O.useRef(void 0);let{queryCacheKey:L,requestId:N}=P.current||{},R=!1;L&&N&&(R=I.current.isRequestSubscribed(L,N));const B=!R&&D.current;return u(()=>{D.current=R}),u(()=>{B&&(P.current=void 0)},[B]),u(()=>{var j;const E=P.current;if(typeof process<"u",A===Bp){E==null||E.unsubscribe(),P.current=void 0;return}const G=(j=P.current)==null?void 0:j.subscriptionOptions;if(!E||E.arg!==A){E==null||E.unsubscribe();const V=M(T(A,{subscriptionOptions:k,forceRefetch:S}));P.current=V}else k!==G&&E.updateSubscriptionOptions(k)},[M,T,S,A,k,B]),O.useEffect(()=>()=>{var E;(E=P.current)==null||E.unsubscribe(),P.current=void 0},[]),O.useMemo(()=>({refetch:()=>{var E;if(!P.current)throw new Error(ro(38));return(E=P.current)==null?void 0:E.refetch()}}),[])},g=({refetchOnReconnect:m,refetchOnFocus:x,pollingInterval:_=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:b}=e.endpoints[p],w=r(),[C,T]=O.useState(S5),M=O.useRef(void 0),I=w5({refetchOnReconnect:m,refetchOnFocus:x,pollingInterval:_,skipPollingIfUnfocused:S});u(()=>{var P,L;const D=(P=M.current)==null?void 0:P.subscriptionOptions;I!==D&&((L=M.current)==null||L.updateSubscriptionOptions(I))},[I]);const A=O.useRef(I);u(()=>{A.current=I},[I]);const k=O.useCallback(function(D,P=!1){let L;return t(()=>{var N;(N=M.current)==null||N.unsubscribe(),M.current=L=w(b(D,{subscriptionOptions:A.current,forceRefetch:!P})),T(D)}),L},[w,b]);return O.useEffect(()=>()=>{var D;(D=M==null?void 0:M.current)==null||D.unsubscribe()},[]),O.useEffect(()=>{C!==S5&&!M.current&&k(C,!0)},[C,k]),O.useMemo(()=>[k,C],[k,C])},y=(m,{skip:x=!1,selectFromResult:_}={})=>{const{select:S}=e.endpoints[p],b=Mne(x?Bp:m,s,l.endpointDefinitions[p],p),w=O.useRef(void 0),C=O.useMemo(()=>o([S(b),(k,D)=>D,k=>b],c,{memoizeOptions:{resultEqualityCheck:Za}}),[S,b]),T=O.useMemo(()=>_?o([C],_,{devModeChecks:{identityFunctionCheck:"never"}}):C,[C,_]),M=n(k=>T(k,w.current),Za),I=i(),A=C(I.getState(),w.current);return Gmt(()=>{w.current=A},[A]),M};return{useQueryState:y,useQuerySubscription:v,useLazyQuerySubscription:g,useLazyQuery(m){const[x,_]=g(m),S=y(_,{...m,skip:_===S5}),b=O.useMemo(()=>({lastArg:_}),[_]);return O.useMemo(()=>[x,S,b],[x,S,b])},useQuery(m,x){const _=v(m,x),S=y(m,{selectFromResult:m===Bp||x!=null&&x.skip?void 0:Wmt,...x}),{data:b,status:w,isLoading:C,isSuccess:T,isError:M,error:I}=S;return O.useDebugValue({data:b,status:w,isLoading:C,isSuccess:T,isError:M,error:I}),O.useMemo(()=>({...S,..._}),[S,_])}}}function h(p){return({selectFromResult:v,fixedCacheKey:g}={})=>{const{select:y,initiate:m}=e.endpoints[p],x=r(),[_,S]=O.useState();O.useEffect(()=>()=>{_!=null&&_.arg.fixedCacheKey||_==null||_.reset()},[_]);const b=O.useCallback(function(G){const j=x(m(G,{fixedCacheKey:g}));return S(j),j},[x,m,g]),{requestId:w}=_||{},C=O.useMemo(()=>y({fixedCacheKey:g,requestId:_==null?void 0:_.requestId}),[g,_,y]),T=O.useMemo(()=>v?o([C],v):C,[v,C]),M=n(T,Za),I=g==null?_==null?void 0:_.arg.originalArgs:void 0,A=O.useCallback(()=>{t(()=>{_&&S(void 0),g&&x(e.internalActions.removeMutationResult({requestId:w,fixedCacheKey:g}))})},[x,g,_,w]),{endpointName:k,data:D,status:P,isLoading:L,isSuccess:N,isError:R,error:B}=M;O.useDebugValue({endpointName:k,data:D,status:P,isLoading:L,isSuccess:N,isError:R,error:B});const E=O.useMemo(()=>({...M,originalArgs:I,reset:A}),[M,I,A]);return O.useMemo(()=>[b,E],[b,E])}}}var jmt=Symbol(),Umt=({batch:e=nfe,hooks:t={useDispatch:b6,useSelector:_1,useStore:_6},createSelector:r=r8,unstable__sideEffectsInRender:n=!1,...i}={})=>({name:jmt,init(a,{serializeQueryArgs:o},s){const l=a,{buildQueryHooks:u,buildMutationHook:c,usePrefetch:f}=Hmt({api:a,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:o,context:s});return MM(l,{usePrefetch:f}),MM(s,{batch:e}),{injectEndpoint(d,h){if(Emt(h)){const{useQuery:p,useLazyQuery:v,useLazyQuerySubscription:g,useQueryState:y,useQuerySubscription:m}=u(d);MM(l.endpoints[d],{useQuery:p,useLazyQuery:v,useLazyQuerySubscription:g,useQueryState:y,useQuerySubscription:m}),a[`use${b5(d)}Query`]=p,a[`useLazy${b5(d)}Query`]=v}else if(Omt(h)){const p=c(d);MM(l.endpoints[d],{useMutation:p}),a[`use${b5(d)}Mutation`]=p}}}}}),Ymt=bmt(Rmt(),Umt());const Zg=(e,t,{fallbackValue:r}={fallbackValue:"0"})=>e.reduce((n,i)=>{const{name:a,time:o}=i,s=i[t]||r,l=n.time||[];return l.push(o),n[a]?(n[a].push([o,s]),{...n,time:l}):{...n,[a]:[[o,s]],time:l}},{});function Of(e){return Vf(Number(e[1]),2)}const Ine=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);window.history.pushState(null,"",t)},qmt=e=>{const t=new URL(window.location.href);for(const[r,n]of Object.entries(e))t.searchParams.set(r,n);return t},Xmt=e=>e?e[e.length-1][1]:"0",Lk=Ymt({baseQuery:hmt({baseUrl:"cloud-stats"}),reducerPath:"cloud-stats",endpoints:e=>({getRequestNames:e.mutation({query:t=>({url:"request-names",method:"POST",body:t}),transformResponse:t=>t.map(({name:r})=>({name:`${r}`,key:r}))}),getRpsPerRequest:e.mutation({query:t=>({url:"rps-per-request",method:"POST",body:t}),transformResponse:t=>Zg(t,"throughput")}),getAvgResponseTimes:e.mutation({query:t=>({url:"avg-response-times",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseTime")}),getErrorsPerRequest:e.mutation({query:t=>({url:"errors-per-request",method:"POST",body:t}),transformResponse:t=>Zg(t,"errorRate")}),getPerc99ResponseTimes:e.mutation({query:t=>({url:"perc99-response-times",method:"POST",body:t}),transformResponse:t=>Zg(t,"perc99",{fallbackValue:null})}),getResponseLength:e.mutation({query:t=>({url:"response-length",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseLength",{fallbackValue:null})}),getRps:e.mutation({query:t=>({url:"rps",method:"POST",body:t}),transformResponse:t=>t.reduce((r,{users:n,rps:i,errorRate:a,time:o})=>({users:[...r.users||[],[o,n||Xmt(r.users)]],rps:[...r.rps||[],[o,i||"0"]],errorRate:[...r.errorRate||[],[o,a||"0"]],time:[...r.time||[],o]}),{})}),getTestrunsTable:e.mutation({query:()=>({url:"testruns-table",method:"POST"}),transformResponse:t=>t.map(({runId:r,...n})=>{const i=new Date(r).toLocaleString(),a=qmt({tab:"charts",testrun:i});return{...n,runId:`[${i}](${a})`}})}),getTestrunsRps:e.mutation({query:()=>({url:"testruns-rps",method:"POST"}),transformResponse:t=>t.reduce((r,{avgRps:n,avgRpsFailed:i,time:a})=>({...r,avgRps:[...r.avgRps||[],[a,n]],avgRpsFailed:[...r.avgRpsFailed||[],[a,i]],time:[...r.time||[],a]}),{})}),getTestrunsResponseTime:e.mutation({query:()=>({url:"testruns-response-time",method:"POST"}),transformResponse:t=>t.reduce((r,{avgResponseTime:n,avgResponseTimeFailed:i,time:a})=>({...r,avgResponseTime:[...r.avgResponseTime||[],[a,n]],avgResponseTimeFailed:[...r.avgResponseTimeFailed||[],[a,i]],time:[...r.time||[],a]}),{})}),getRequests:e.mutation({query:t=>({url:"requests",method:"POST",body:t})}),getFailures:e.mutation({query:t=>({url:"failures",method:"POST",body:t})}),getTotalRequests:e.mutation({query:t=>({url:"total-requests",method:"POST",body:t}),transformResponse:([{totalRequests:t}])=>t||0}),getTotalFailures:e.mutation({query:t=>({url:"total-failures",method:"POST",body:t}),transformResponse:([{totalFailures:t}])=>t||0}),getErrorPercentage:e.mutation({query:t=>({url:"error-percentage",method:"POST",body:t}),transformResponse:([{errorPercentage:t}])=>{const r=Vf(t,2);return isNaN(r)?0:r}}),getTotalVuh:e.mutation({query:()=>({url:"total-vuh",method:"POST"})}),getCustomerData:e.mutation({query:()=>({url:"customer",method:"POST"}),transformResponse:([t])=>({...t,maxUsers:Number(t.maxUsers),maxVuh:Number(t.maxVuh),maxWorkers:Number(t.maxWorkers),usersPerWorker:Number(t.usersPerWorker)})}),getTestruns:e.mutation({query:()=>({url:"testruns",method:"POST"})}),getScatterplot:e.mutation({query:t=>({url:"scatterplot",method:"POST",body:t}),transformResponse:t=>Zg(t,"responseTime")})})}),{useGetRequestNamesMutation:owe,useGetRpsPerRequestMutation:Zmt,useGetAvgResponseTimesMutation:Kmt,useGetErrorsPerRequestMutation:Qmt,useGetPerc99ResponseTimesMutation:Jmt,useGetResponseLengthMutation:e0t,useGetRpsMutation:t0t,useGetTestrunsTableMutation:r0t,useGetTestrunsRpsMutation:n0t,useGetTestrunsResponseTimeMutation:i0t,useGetRequestsMutation:a0t,useGetFailuresMutation:o0t,useGetTotalRequestsMutation:s0t,useGetTotalFailuresMutation:l0t,useGetErrorPercentageMutation:u0t,useGetTotalVuhMutation:c0t,useGetCustomerDataMutation:f0t,useGetTestrunsMutation:d0t,useGetScatterplotMutation:h0t}=Lk;function UL(e,{payload:t}){return{...e,...t}}const p0t={username:window.templateArgs.username},swe=Fl({name:"customer",initialState:p0t,reducers:{setCustomer:UL}}),v0t=swe.actions,g0t=swe.reducer,y0t={message:null},lwe=Fl({name:"snackbar",initialState:y0t,reducers:{setSnackbar:UL}}),Qd=lwe.actions,m0t=lwe.reducer,x0t={resolution:5,testruns:{},currentTestrunIndex:0,testrunsForDisplay:[],shouldShowAdvanced:!1},uwe=Fl({name:"toolbar",initialState:x0t,reducers:{setToolbar:UL}}),cwe=uwe.actions,_0t=uwe.reducer,Sm={CLOUD:"CLOUD",CLASSIC:"CLASSIC"},b0t={viewType:Sm.CLOUD,hasDismissedSwarmForm:!1},fwe=Fl({name:"ui",initialState:b0t,reducers:{setUi:UL}}),dwe=fwe.actions,S0t=fwe.reducer,hwe=O.createContext(null),w0t=Qj({[Lk.reducerPath]:Lk.reducer,customer:g0t,snackbar:m0t,toolbar:_0t,ui:S0t}),pwe=$yt({reducer:w0t,middleware:e=>e().concat(Lk.middleware)}),ys=_1,co=Xce(hwe),C0t=()=>e=>pwe.dispatch(e);function fo(e,t){const r=C0t();return O.useCallback(n=>{r(e(n))},[e,r])}function wV(){const{numUsers:e,workerCount:t}=ys(({swarm:u})=>u),{maxUsers:r,usersPerWorker:n}=co(({customer:u})=>u),[i,a]=O.useState(),[o,s]=O.useState(!1),l=O.useCallback(({target:u})=>{if(u&&u.name==="userCount"){const c=Number(u.value);r&&c>r?(a({level:"error",message:"The number of users has exceeded the allowance for this account."}),s(!0)):c>t*Number(n)?(a({level:"warning",message:`Locust worker count is determined by the User count you specified at start up (${e}), and launching more users risks overloading workers, impacting your results. Re-run locust-cloud with your desired user count to avoid this.`}),s(!1)):(s(!1),a(void 0))}},[e,t,r,n]);return{alert:i,shouldDisableForm:o,handleFormChange:l}}function T0t(){const e=ys(({swarm:u})=>u.state),{viewType:t,hasDismissedSwarmForm:r}=co(({ui:u})=>u),{alert:n,shouldDisableForm:i,handleFormChange:a}=wV(),{alert:o,shouldDisableForm:s,handleFormChange:l}=wV();return!r&&e===Ut.READY?null:W.jsxs(Vt,{sx:{display:"flex",columnGap:2,marginY:"auto",height:"50px"},children:[e===Ut.STOPPED||r?W.jsx(Bge,{alert:n,isDisabled:i,onFormChange:a}):W.jsxs(W.Fragment,{children:[W.jsx(zge,{alert:o,isDisabled:s,onFormChange:l}),W.jsx(Vge,{})]}),t==Sm.CLASSIC&&W.jsx(Fge,{})]})}function M0t(){return W.jsx(gpe,{position:"static",children:W.jsx(qd,{maxWidth:"xl",children:W.jsxs(Zpe,{disableGutters:!0,sx:{display:"flex",justifyContent:"space-between",columnGap:2},children:[W.jsx(Wn,{color:"inherit",href:"/",sx:{display:"flex",alignItems:"center"},underline:"none",children:W.jsx(xve,{})}),W.jsxs(Vt,{sx:{display:"flex",columnGap:6},children:[!window.templateArgs.isGraphViewer&&W.jsxs(W.Fragment,{children:[W.jsx(Gve,{}),W.jsx(T0t,{})]}),W.jsx(Bve,{})]})]})})})}function I0t(){const e=fo(dwe.setUi),{viewType:t}=co(({ui:n})=>n),r=t===Sm.CLOUD?Sm.CLASSIC:Sm.CLOUD;return W.jsx(qd,{maxWidth:"xl",sx:{position:"relative"},children:W.jsx(Gc,{onClick:()=>e({viewType:r}),sx:{position:"absolute",mt:"4px",right:16,zIndex:1},children:r})})}function A0t({children:e}){const t=ys(({swarm:r})=>r.state);return W.jsxs(W.Fragment,{children:[W.jsx(M0t,{}),!window.templateArgs.isGraphViewer&&t!==Ut.READY&&W.jsx(I0t,{}),W.jsx("main",{children:e})]})}function k0t(){const e=O.useCallback(()=>r({message:null}),[]),t=co(({snackbar:n})=>n.message),r=fo(Qd.setSnackbar);return W.jsx(tVe,{autoHideDuration:5e3,onClose:e,open:!!t,children:W.jsx(yA,{onClose:e,severity:"error",sx:{width:"100%"},variant:"filled",children:t})})}const vwe="5",D0t=["1","2",vwe,"10","30"];function s8({onSelectTestRun:e,showHideAdvanced:t,shouldShowResolution:r=!1}){const n=fo(cwe.setToolbar),{testruns:i,testrunsForDisplay:a,currentTestrunIndex:o}=co(({toolbar:d})=>d),s=ys(({url:d})=>d.query&&d.query.showAdvanced==="true"||!1),[l,u]=O.useState(a[0]),c=d=>{e&&e(d.target.value);const h=i[d.target.value];n({currentTestrun:h.runId,currentTestrunIndex:h.index}),Ine({testrun:d.target.value})},f=d=>{n({shouldShowAdvanced:d.target.checked}),Ine({showAdvanced:String(d.target.checked)})};return O.useEffect(()=>{o!==void 0&&o>=0&&u(a[o])},[o,a]),O.useEffect(()=>{s&&n({shouldShowAdvanced:s})},[s]),W.jsxs(Vt,{sx:{display:"flex",columnGap:2,mb:1},children:[r&&W.jsx(sw,{defaultValue:vwe,label:"Resolution",name:"resolution",onChange:d=>n({resolution:Number(d.target.value)}),options:D0t,size:"small",sx:{width:"150px"}}),!!a.length&&W.jsx(sw,{label:"Test Run",name:"testrun",onChange:c,options:a,size:"small",sx:{width:"250px"},value:l}),t&&W.jsx(QG,{control:W.jsx(_A,{defaultChecked:s,onChange:f}),label:"Advanced"})]})}function gwe(e,t,{shouldRunInterval:r,immediate:n}={shouldRunInterval:!0,immediate:!1}){const i=O.useRef(e);O.useEffect(()=>{i.current=e},[e]),O.useEffect(()=>{if(!r)return;n&&i.current();let a=!1;const o=async()=>{a||(await i.current(),setTimeout(o,t))};return o(),()=>{a=!0}},[t,r])}const v_={time:[]},P0t={time:[]},Kg={RPS:["#00ca5a","#0099ff","#ff6d6d"],PER_REQUEST:["#9966CC","#8A2BE2","#8E4585","#E0B0FF","#C8A2C8","#E6E6FA"],ERROR:["#ff8080","#ff4d4d","#ff1a1a","#e60000","#b30000","#800000"]},L0t=["Users","RPS"],R0t=[{name:"Users",key:"users",yAxisIndex:0},{name:"Requests per Second",key:"rps",yAxisIndex:1,areaStyle:{}},{name:"Errors per Second",key:"errorRate",yAxisIndex:1,areaStyle:{}}],E0t={requestLines:[],rpsPerRequest:v_,avgResponseTimes:v_,errorsPerRequest:v_,perc99ResponseTimes:v_,responseLength:v_,rpsData:P0t};function ywe(){const{state:e}=ys(({swarm:M})=>M),{resolution:t,currentTestrunIndex:r,currentTestrun:n,testruns:i,shouldShowAdvanced:a}=co(({toolbar:M})=>M),o=fo(Qd.setSnackbar),[s,l]=O.useState(!0),[u,c]=O.useState(!1),[f,d]=O.useState(new Date().toISOString()),[h,p]=O.useState(E0t),[v,g]=O.useState(!1),[y]=owe(),[m]=Zmt(),[x]=Kmt(),[_]=Qmt(),[S]=Jmt(),[b]=e0t(),[w]=t0t(),C=async()=>{if(n){const M=new Date().toISOString(),{endTime:I}=i[new Date(n).toLocaleString()],A={start:n,end:!I||e===Ut.RUNNING&&r===0?f:I,resolution:t,testrun:n},k=[{key:"requestLines",mutation:y},{key:"rpsData",mutation:w},{key:"avgResponseTimes",mutation:x},{key:"rpsPerRequest",mutation:m,isAdvanced:!0},{key:"errorsPerRequest",mutation:_,isAdvanced:!0},{key:"perc99ResponseTimes",mutation:S,isAdvanced:!0},{key:"responseLength",mutation:b,isAdvanced:!0}].filter(({isAdvanced:L})=>!L||a),D=await Promise.all(k.map(({mutation:L})=>L(A))),P=D.find(({error:L})=>L);if(P&&P.error&&"error"in P.error)o({message:P.error.error});else{const L=k.reduce((B,{key:E},G)=>({...B,[E]:D[G].data}),{}),N=L.requestLines.length;!N&&!h.requestLines&&(r!==0||e!==Ut.RUNNING)?c(!0):c(!1);const R=N!==h.requestLines.length||L.requestLines.some(({key:B},E)=>B!==h.requestLines[E].key);L.requestLines=R?L.requestLines:h.requestLines,g(R),p({...h,...L}),l(!1)}e!==Ut.STOPPED&&d(M)}};gwe(C,1e3,{shouldRunInterval:e===Ut.SPAWNING||e==Ut.RUNNING,immediate:!0}),O.useEffect(()=>{C()},[n,t,a]),O.useEffect(()=>{e===Ut.RUNNING&&l(!0)},[e]);const T=O.useCallback(()=>{l(!0),c(!1)},[]);return W.jsxs(W.Fragment,{children:[W.jsx(s8,{onSelectTestRun:T,shouldShowResolution:!0,showHideAdvanced:!0}),u&&W.jsx(yA,{severity:"error",children:"There was a problem loading some graphs for this testrun."}),W.jsxs(Vt,{sx:{position:"relative"},children:[s&&W.jsx(Vt,{sx:{position:"absolute",height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0.4)",zIndex:1,display:"flex",justifyContent:"center",paddingTop:4},children:W.jsx(iBe,{})}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.rpsData,colors:Kg.RPS,lines:R0t,splitAxis:!0,title:"Throughput / active users",yAxisLabels:L0t}),W.jsxs(Vt,{sx:{display:!u||u&&h.requestLines&&h.requestLines.length?"block":"none"},children:[W.jsx(Bl,{chartValueFormatter:M=>`${Vf(Number(M[1]),2)}ms`,charts:h.avgResponseTimes,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Average Response Times"}),a&&W.jsxs(W.Fragment,{children:[W.jsx(Bl,{chartValueFormatter:Of,charts:h.rpsPerRequest,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"RPS per Request"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.errorsPerRequest,colors:Kg.ERROR,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Errors per Request"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.perc99ResponseTimes,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"99th Percentile Response Times"}),W.jsx(Bl,{chartValueFormatter:Of,charts:h.responseLength,colors:Kg.PER_REQUEST,lines:h.requestLines,shouldReplaceMergeLines:v,title:"Response Length"})]})]})]})]})}const Ane=e=>e===1?"":"s";function O0t(e){if(!e||!e.length||!e[0].totalVuh)return"Unknown";const[{totalVuh:t}]=e;if(t==="0")return t;const[r,n]=t.includes("days")?t.split(", "):["0 days",t],i=parseInt(r)*24,[a,o]=n.split(":").map(Number),s=a+i;return[s&&`${s} hour${Ane(s)}`,o&&`${o} minute${Ane(o)}`].filter(Boolean).join(", ")}function mwe(){const[e,t]=O.useState(),r=ys(({swarm:s})=>s.state),{maxVuh:n}=co(({customer:s})=>s),i=fo(Qd.setSnackbar),[a]=c0t(),o=async()=>{const{data:s,error:l}=await a(),u=l;u&&"error"in u?i({message:u.error}):t(O0t(s))};return O.useEffect(()=>{o()},[r]),W.jsxs(hl,{elevation:3,sx:{py:4,px:8,display:"flex",flexDirection:"column",alignItems:"center",rowGap:4},children:[window.templateArgs.username&&W.jsxs(Vt,{sx:{display:"flex",alignItems:"center",flexDirection:"column",rowGap:1},children:[W.jsx(Mt,{sx:{fontWeight:"bold"},children:"Current User"}),W.jsx(Mt,{children:window.templateArgs.username})]}),W.jsxs(Vt,{sx:{display:"flex",alignItems:"center",flexDirection:"column",rowGap:1},children:[W.jsx(Mt,{sx:{fontWeight:"bold"},children:"Current Month Virtual User Time"}),W.jsxs(Mt,{children:["Included in Plan: ",n]}),W.jsxs(Mt,{children:["Used: ",e||"0 minutes"]})]})]})}const N0t=["#8A2BE2","#0000FF","#00ca5a","#FFA500","#FFFF00","#EE82EE"];function xwe(){const e=ys(({swarm:d})=>d.state),{currentTestrun:t}=co(({toolbar:d})=>d),r=fo(Qd.setSnackbar),[n,i]=O.useState(new Date().toISOString()),[a,o]=O.useState({time:[]}),[s,l]=O.useState([]),[u]=owe(),[c]=h0t(),f=async()=>{if(t){const d=new Date().toISOString(),h={start:t,end:n,testrun:t},[{data:p,error:v},{data:g,error:y}]=await Promise.all([u(h),c(h)]),m=v||y;m&&"error"in m&&r({message:m.error}),p&&g&&(l(p),o(g)),e!==Ut.STOPPED&&i(d)}};return Mv(f,5e3,{shouldRunInterval:e===Ut.SPAWNING||e==Ut.RUNNING}),O.useEffect(()=>{f()},[t]),W.jsxs(W.Fragment,{children:[W.jsx(s8,{}),W.jsx(Bl,{chartValueFormatter:Of,charts:a,colors:N0t,lines:s,scatterplot:!0,title:"Scatterplot"})]})}/*! *****************************************************************************
|
271
271
|
Copyright (c) Microsoft Corporation.
|
272
272
|
|
273
273
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<meta name="theme-color" content="#000000" />
|
9
9
|
|
10
10
|
<title>Locust Cloud</title>
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
11
|
+
<script type="module" crossorigin src="./assets/index-DYD7wLyS.js"></script>
|
12
12
|
</head>
|
13
13
|
<body>
|
14
14
|
<div id="root"></div>
|