var sn=Object.defineProperty;var on=(e,t,d)=>t in e?sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[t]=d;var oe=(e,t,d)=>on(e,typeof t!="symbol"?t+"":t,d);import{r as M,b as an,w as lt,h as Ve,i as cn,j as Dt,n as Mt,k as ye,l as ft,m as ge,p as Se,o as Me,q as tt,s as ue,t as gt,u as un,v as We,S as Ot,x as Le,y as nt,z as _t,A as dn,B as qt,C as Nt,D as ln,E as fn,F as rt,G as pt,H as gn,I as pn,J as hn,K as mn,L as yn,M as Ce,N as Sn,P as bn}from"./vendor-L5FivjNr.js";/**
 * 2026 Paysera
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 *
 * @author Paysera <plugins@paysera.com>
 * @copyright 2026 Paysera
 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */var kt={exports:{}},qe={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vn=M,Pn=Symbol.for("react.element"),En=Symbol.for("react.fragment"),In=Object.prototype.hasOwnProperty,Cn=vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Tn={key:!0,ref:!0,__self:!0,__source:!0};function jt(e,t,d){var m,h={},E=null,v=null;d!==void 0&&(E=""+d),t.key!==void 0&&(E=""+t.key),t.ref!==void 0&&(v=t.ref);for(m in t)In.call(t,m)&&!Tn.hasOwnProperty(m)&&(h[m]=t[m]);if(e&&e.defaultProps)for(m in t=e.defaultProps,t)h[m]===void 0&&(h[m]=t[m]);return{$$typeof:Pn,type:e,key:E,ref:v,props:h,_owner:Cn.current}}qe.Fragment=En;qe.jsx=jt;qe.jsxs=jt;kt.exports=qe;var W=kt.exports,Qn,ht=an;Qn=ht.createRoot,ht.hydrateRoot;var ee=(e=>(e.DISCONNECTED="disconnected",e.ERROR="error",e.CONNECTED="connected",e.SUSPENDED="suspended",e.SANDBOX="sandbox",e))(ee||{}),st=(e=>(e.ENABLED="enabled",e.DISABLED="disabled",e))(st||{});const An=e=>e?Object.values(st).includes(e):!1,wn=e=>An(e)&&e===st.ENABLED,xn=e=>e?Object.values(ee).includes(e):!1,Ut=M.createContext(void 0),Rn=({children:e})=>{const t=payseraData==null?void 0:payseraData.user,d=xn(t==null?void 0:t.connectionStatus)?t==null?void 0:t.connectionStatus:ee.DISCONNECTED,[m,h]=M.useState({authorized:(t==null?void 0:t.authorized)||!1,checkoutSandboxEnabled:wn(t==null?void 0:t.checkoutSandboxMode),connectionStatus:d,paymentSettings:(t==null?void 0:t.paymentSettings)||{enable_payments:!1,payment_window_mode:"same_page",payment_title:"",status_awaiting_payment:"",status_awaiting_confirmation:"",status_confirmed_payment:""}});return W.jsx(Ut.Provider,{value:{user:m,setUser:h},children:e})},Dn=()=>{const e=M.useContext(Ut);if(e===void 0)throw new Error("useUserContext must be used within a UserProvider");return e},Ft=M.createContext(void 0),Mn=({children:e})=>{const t={fontSizes:{xs:"12px",sm:"13px",md:"14px",lg:"15px",xl:"18px",xxl:"20px","3xl":"24px"},spacing:{xs:"8px",sm:"12px",md:"16px",lg:"20px",xl:"24px",xxl:"32px"}};return W.jsx(Ft.Provider,{value:t,children:e})},On=()=>{const e=M.useContext(Ft);if(e===void 0)throw new Error("useThemeContext must be used within a ThemeProvider");return e};var _n=class extends Error{constructor(t){super(t[0].message);oe(this,"issues");this.name="SchemaError",this.issues=t}},Lt=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Lt||{}),re="uninitialized",Je="pending",Ee="fulfilled",Ie="rejected";function mt(e){return{status:e,isUninitialized:e===re,isLoading:e===Je,isSuccess:e===Ee,isError:e===Ie}}var yt=We;function it(e,t){if(e===t||!(yt(e)&&yt(t)||Array.isArray(e)&&Array.isArray(t)))return t;const d=Object.keys(t),m=Object.keys(e);let h=d.length===m.length;const E=Array.isArray(t)?[]:{};for(const v of d)E[v]=it(e[v],t[v]),h&&(h=e[v]===E[v]);return h?e:E}function Ye(e,t,d){return e.reduce((m,h,E)=>(t(h,E)&&m.push(d(h,E)),m),[]).flat()}function qn(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function ot(e){return e!=null}function St(e){return[...(e==null?void 0:e.values())??[]].filter(ot)}function Nn(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Oe(e,t,d){return e.has(t)?e.get(t):e.set(t,d(t)).get(t)}var Xe=()=>new Map,bt=class{constructor(e,t=void 0){oe(this,"value");oe(this,"meta");this.value=e,this.meta=t}},Ne="__rtkq/",kn="online",jn="offline",$t="focused",at=ye(`${Ne}${$t}`),zt=ye(`${Ne}un${$t}`),ct=ye(`${Ne}${kn}`),Bt=ye(`${Ne}${jn}`),Ae="query",Ht="mutation",Kt="infinitequery";function ke(e){return e.type===Ae}function Un(e){return e.type===Ht}function je(e){return e.type===Kt}function _e(e){return ke(e)||je(e)}function ut(e,t,d,m,h,E){const v=Fn(e)?e(t,d,m,h):e;return v?Ye(v,ot,Q=>E(Gt(Q))):[]}function Fn(e){return typeof e=="function"}function Gt(e){return typeof e=="string"?{type:e}:e}function Ln(e,t){return e.catch(t)}var me=(e,t)=>e.endpointDefinitions[t],Te=Symbol("forceQueryFn"),Ze=e=>typeof e[Te]=="function";function $n({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:d,mutationThunk:m,api:h,context:E,getInternalState:v}){const Q=f=>{var a;return(a=v(f))==null?void 0:a.runningQueries},_=f=>{var a;return(a=v(f))==null?void 0:a.runningMutations},{unsubscribeQueryResult:C,removeMutationResult:O,updateSubscriptionOptions:R}=h.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:A,buildInitiateMutation:p,getRunningQueryThunk:D,getRunningMutationThunk:T,getRunningQueriesThunk:N,getRunningMutationsThunk:I};function D(f,a){return l=>{var u;const c=me(E,f),g=e({queryArgs:a,endpointDefinition:c,endpointName:f});return(u=Q(l))==null?void 0:u.get(g)}}function T(f,a){return l=>{var c;return(c=_(l))==null?void 0:c.get(a)}}function N(){return f=>St(Q(f))}function I(){return f=>St(_(f))}function y(f,a){const l=(c,{subscribe:g=!0,forceRefetch:u,subscriptionOptions:s,[Te]:n,...r}={})=>(i,o)=>{var F;const S=e({queryArgs:c,endpointDefinition:a,endpointName:f});let x;const q={...r,type:Ae,subscribe:g,forceRefetch:u,subscriptionOptions:s,endpointName:f,originalArgs:c,queryCacheKey:S,[Te]:n};if(ke(a))x=t(q);else{const{direction:U,initialPageParam:G,refetchCachedPages:J}=r;x=d({...q,direction:U,initialPageParam:G,refetchCachedPages:J})}const w=h.endpoints[f].select(c),b=i(x),j=w(o()),{requestId:k,abort:H}=b,K=j.requestId!==k,$=(F=Q(i))==null?void 0:F.get(S),V=()=>w(o()),B=Object.assign(n?b.then(V):K&&!$?Promise.resolve(j):Promise.all([$,b]).then(V),{arg:c,requestId:k,subscriptionOptions:s,queryCacheKey:S,abort:H,async unwrap(){const U=await B;if(U.isError)throw U.error;return U.data},refetch:U=>i(l(c,{subscribe:!1,forceRefetch:!0,...U})),unsubscribe(){g&&i(C({queryCacheKey:S,requestId:k}))},updateSubscriptionOptions(U){B.subscriptionOptions=U,i(R({endpointName:f,requestId:k,queryCacheKey:S,options:U}))}});if(!$&&!K&&!n){const U=Q(i);U.set(S,B),B.then(()=>{U.delete(S)})}return B};return l}function P(f,a){return y(f,a)}function A(f,a){return y(f,a)}function p(f){return(a,{track:l=!0,fixedCacheKey:c}={})=>(g,u)=>{const s=m({type:"mutation",endpointName:f,originalArgs:a,track:l,fixedCacheKey:c}),n=g(s),{requestId:r,abort:i,unwrap:o}=n,S=Ln(n.unwrap().then(b=>({data:b})),b=>({error:b})),x=()=>{g(O({requestId:r,fixedCacheKey:c}))},q=Object.assign(S,{arg:n.arg,requestId:r,abort:i,unwrap:o,reset:x}),w=_(g);return w.set(r,q),q.then(()=>{w.delete(r)}),c&&(w.set(c,q),q.then(()=>{w.get(c)===q&&w.delete(c)})),q}}}var Vt=class extends _n{constructor(t,d,m,h){super(t);oe(this,"value");oe(this,"schemaName");oe(this,"_bqMeta");this.value=d,this.schemaName=m,this._bqMeta=h}},ae=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function ce(e,t,d,m){const h=await e["~standard"].validate(t);if(h.issues)throw new Vt(h.issues,t,d,m);return h.value}function vt(e){return e}var be=(e={})=>({...e,[Ot]:!0});function zn({reducerPath:e,baseQuery:t,context:{endpointDefinitions:d},serializeQueryArgs:m,api:h,assertTagType:E,selectors:v,onSchemaFailure:Q,catchSchemaFailure:_,skipSchemaValidation:C}){const O=(n,r,i,o)=>(S,x)=>{const q=d[n],w=m({queryArgs:r,endpointDefinition:q,endpointName:n});if(S(h.internalActions.queryResultPatched({queryCacheKey:w,patches:i})),!o)return;const b=h.endpoints[n].select(r)(x()),j=ut(q.providesTags,b.data,void 0,r,{},E);S(h.internalActions.updateProvidedBy([{queryCacheKey:w,providedTags:j}]))};function R(n,r,i=0){const o=[r,...n];return i&&o.length>i?o.slice(0,-1):o}function D(n,r,i=0){const o=[...n,r];return i&&o.length>i?o.slice(1):o}const T=(n,r,i,o=!0)=>(S,x)=>{const w=h.endpoints[n].select(r)(x()),b={patches:[],inversePatches:[],undo:()=>S(h.util.patchQueryData(n,r,b.inversePatches,o))};if(w.status===re)return b;let j;if("data"in w)if(dn(w.data)){const[k,H,K]=qt(w.data,i);b.patches.push(...H),b.inversePatches.push(...K),j=k}else j=i(w.data),b.patches.push({op:"replace",path:[],value:j}),b.inversePatches.push({op:"replace",path:[],value:w.data});return b.patches.length===0||S(h.util.patchQueryData(n,r,b.patches,o)),b},N=(n,r,i)=>o=>o(h.endpoints[n].initiate(r,{subscribe:!1,forceRefetch:!0,[Te]:()=>({data:i})})),I=(n,r)=>n.query&&n[r]?n[r]:vt,y=async(n,{signal:r,abort:i,rejectWithValue:o,fulfillWithValue:S,dispatch:x,getState:q,extra:w})=>{var K,$;const b=d[n.endpointName],{metaSchema:j,skipSchemaValidation:k=C}=b,H=n.type===Ae;try{let V=vt;const B={signal:r,abort:i,dispatch:x,getState:q,extra:w,endpoint:n.endpointName,type:n.type,forced:H?P(n,q()):void 0,queryCacheKey:H?n.queryCacheKey:void 0},F=H?n[Te]:void 0;let U;const G=async(L,z,se,Y)=>{if(z==null&&L.pages.length)return Promise.resolve({data:L});const de={queryArg:n.originalArgs,pageParam:z},X=await J(de),le=Y?R:D;return{data:{pages:le(L.pages,X.data,se),pageParams:le(L.pageParams,z,se)},meta:X.meta}};async function J(L){let z;const{extraOptions:se,argSchema:Y,rawResponseSchema:de,responseSchema:X}=b;if(Y&&!ae(k,"arg")&&(L=await ce(Y,L,"argSchema",{})),F?z=F():b.query?(V=I(b,"transformResponse"),z=await t(b.query(L),B,se)):z=await b.queryFn(L,B,se,fe=>t(fe,B,se)),typeof process<"u",z.error)throw new bt(z.error,z.meta);let{data:le}=z;de&&!ae(k,"rawResponse")&&(le=await ce(de,z.data,"rawResponseSchema",z.meta));let ie=await V(le,z.meta,L);return X&&!ae(k,"response")&&(ie=await ce(X,ie,"responseSchema",z.meta)),{...z,data:ie}}if(H&&"infiniteQueryOptions"in b){const{infiniteQueryOptions:L}=b,{maxPages:z=1/0}=L,se=n.refetchCachedPages??L.refetchCachedPages??!0;let Y;const de={pages:[],pageParams:[]},X=(K=v.selectQueryEntry(q(),n.queryCacheKey))==null?void 0:K.data,ie=P(n,q())&&!n.direction||!X?de:X;if("direction"in n&&n.direction&&ie.pages.length){const fe=n.direction==="backward",Fe=(fe?Wt:et)(L,ie,n.originalArgs);Y=await G(ie,Fe,z,fe)}else{const{initialPageParam:fe=L.initialPageParam}=n,Ue=(X==null?void 0:X.pageParams)??[],Fe=Ue[0]??fe,nn=Ue.length;if(Y=await G(ie,Fe,z),F&&(Y={data:Y.data.pages[0]}),se)for(let dt=1;dt<nn;dt++){const rn=et(L,Y.data,n.originalArgs);Y=await G(Y.data,rn,z)}}U=Y}else U=await J(n.originalArgs);return j&&!ae(k,"meta")&&U.meta&&(U.meta=await ce(j,U.meta,"metaSchema",U.meta)),S(U.data,be({fulfilledTimeStamp:Date.now(),baseQueryMeta:U.meta}))}catch(V){let B=V;if(B instanceof bt){let F=I(b,"transformErrorResponse");const{rawErrorResponseSchema:U,errorResponseSchema:G}=b;let{value:J,meta:L}=B;try{U&&!ae(k,"rawErrorResponse")&&(J=await ce(U,J,"rawErrorResponseSchema",L)),j&&!ae(k,"meta")&&(L=await ce(j,L,"metaSchema",L));let z=await F(J,L,n.originalArgs);return G&&!ae(k,"errorResponse")&&(z=await ce(G,z,"errorResponseSchema",L)),o(z,be({baseQueryMeta:L}))}catch(z){B=z}}try{if(B instanceof Vt){const F={endpoint:n.endpointName,arg:n.originalArgs,type:n.type,queryCacheKey:H?n.queryCacheKey:void 0};($=b.onSchemaFailure)==null||$.call(b,B,F),Q==null||Q(B,F);const{catchSchemaFailure:U=_}=b;if(U)return o(U(B,F),be({baseQueryMeta:B._bqMeta}))}}catch(F){B=F}throw console.error(B),B}};function P(n,r){const i=v.selectQueryEntry(r,n.queryCacheKey),o=v.selectConfig(r).refetchOnMountOrArgChange,S=i==null?void 0:i.fulfilledTimeStamp,x=n.forceRefetch??(n.subscribe&&o);return x?x===!0||(Number(new Date)-Number(S))/1e3>=x:!1}const A=()=>ft(`${e}/executeQuery`,y,{getPendingMeta({arg:r}){const i=d[r.endpointName];return be({startedTimeStamp:Date.now(),...je(i)?{direction:r.direction}:{}})},condition(r,{getState:i}){var k;const o=i(),S=v.selectQueryEntry(o,r.queryCacheKey),x=S==null?void 0:S.fulfilledTimeStamp,q=r.originalArgs,w=S==null?void 0:S.originalArgs,b=d[r.endpointName],j=r.direction;return Ze(r)?!0:(S==null?void 0:S.status)==="pending"?!1:P(r,o)||ke(b)&&((k=b==null?void 0:b.forceRefetch)!=null&&k.call(b,{currentArg:q,previousArg:w,endpointState:S,state:o}))?!0:!(x&&!j)},dispatchConditionRejection:!0}),p=A(),f=A(),a=ft(`${e}/executeMutation`,y,{getPendingMeta(){return be({startedTimeStamp:Date.now()})}}),l=n=>"force"in n,c=n=>"ifOlderThan"in n,g=(n,r,i={})=>(o,S)=>{const x=l(i)&&i.force,q=c(i)&&i.ifOlderThan,w=(j=!0)=>{const k={forceRefetch:j,subscribe:!1};return h.endpoints[n].initiate(r,k)},b=h.endpoints[n].select(r)(S());if(x)o(w());else if(q){const j=b==null?void 0:b.fulfilledTimeStamp;if(!j){o(w());return}(Number(new Date)-Number(new Date(j)))/1e3>=q&&o(w())}else o(w(!1))};function u(n){return r=>{var i,o;return((o=(i=r==null?void 0:r.meta)==null?void 0:i.arg)==null?void 0:o.endpointName)===n}}function s(n,r){return{matchPending:Le(_t(n),u(r)),matchFulfilled:Le(ue(n),u(r)),matchRejected:Le(nt(n),u(r))}}return{queryThunk:p,mutationThunk:a,infiniteQueryThunk:f,prefetch:g,updateQueryData:T,upsertQueryData:N,patchQueryData:O,buildMatchThunkActions:s}}function et(e,{pages:t,pageParams:d},m){const h=t.length-1;return e.getNextPageParam(t[h],t,d[h],d,m)}function Wt(e,{pages:t,pageParams:d},m){var h;return(h=e.getPreviousPageParam)==null?void 0:h.call(e,t[0],t,d[0],d,m)}function Jt(e,t,d,m){return ut(d[e.meta.arg.endpointName][t],ue(e)?e.payload:void 0,tt(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,m)}function Pt(e){return Nt(e)?ln(e):e}function we(e,t,d){const m=e[t];m&&d(m)}function Qe(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Et(e,t,d){const m=e[Qe(t)];m&&d(m)}var xe={};function Bn({reducerPath:e,queryThunk:t,mutationThunk:d,serializeQueryArgs:m,context:{endpointDefinitions:h,apiUid:E,extractRehydrationInfo:v,hasRehydrationInfo:Q},assertTagType:_,config:C}){const O=ye(`${e}/resetApiState`);function R(u,s,n,r){var i;u[i=s.queryCacheKey]??(u[i]={status:re,endpointName:s.endpointName}),we(u,s.queryCacheKey,o=>{o.status=Je,o.requestId=n&&o.requestId?o.requestId:r.requestId,s.originalArgs!==void 0&&(o.originalArgs=s.originalArgs),o.startedTimeStamp=r.startedTimeStamp;const S=h[r.arg.endpointName];je(S)&&"direction"in s&&(o.direction=s.direction)})}function D(u,s,n,r){we(u,s.arg.queryCacheKey,i=>{if(i.requestId!==s.requestId&&!r)return;const{merge:o}=h[s.arg.endpointName];if(i.status=Ee,o)if(i.data!==void 0){const{fulfilledTimeStamp:S,arg:x,baseQueryMeta:q,requestId:w}=s;let b=rt(i.data,j=>o(j,n,{arg:x.originalArgs,baseQueryMeta:q,fulfilledTimeStamp:S,requestId:w}));i.data=b}else i.data=n;else i.data=h[s.arg.endpointName].structuralSharing??!0?it(Nt(i.data)?gn(i.data):i.data,n):n;delete i.error,i.fulfilledTimeStamp=s.fulfilledTimeStamp})}const T=ge({name:`${e}/queries`,initialState:xe,reducers:{removeQueryResult:{reducer(u,{payload:{queryCacheKey:s}}){delete u[s]},prepare:Se()},cacheEntriesUpserted:{reducer(u,s){for(const n of s.payload){const{queryDescription:r,value:i}=n;R(u,r,!0,{arg:r,requestId:s.meta.requestId,startedTimeStamp:s.meta.timestamp}),D(u,{arg:r,requestId:s.meta.requestId,fulfilledTimeStamp:s.meta.timestamp,baseQueryMeta:{}},i,!0)}},prepare:u=>({payload:u.map(r=>{const{endpointName:i,arg:o,value:S}=r,x=h[i];return{queryDescription:{type:Ae,endpointName:i,originalArgs:r.arg,queryCacheKey:m({queryArgs:o,endpointDefinition:x,endpointName:i})},value:S}}),meta:{[Ot]:!0,requestId:Mt(),timestamp:Date.now()}})},queryResultPatched:{reducer(u,{payload:{queryCacheKey:s,patches:n}}){we(u,s,r=>{r.data=gt(r.data,n.concat())})},prepare:Se()}},extraReducers(u){u.addCase(t.pending,(s,{meta:n,meta:{arg:r}})=>{const i=Ze(r);R(s,r,i,n)}).addCase(t.fulfilled,(s,{meta:n,payload:r})=>{const i=Ze(n.arg);D(s,n,r,i)}).addCase(t.rejected,(s,{meta:{condition:n,arg:r,requestId:i},error:o,payload:S})=>{we(s,r.queryCacheKey,x=>{if(!n){if(x.requestId!==i)return;x.status=Ie,x.error=S??o}})}).addMatcher(Q,(s,n)=>{const{queries:r}=v(n);for(const[i,o]of Object.entries(r))((o==null?void 0:o.status)===Ee||(o==null?void 0:o.status)===Ie)&&(s[i]=o)})}}),N=ge({name:`${e}/mutations`,initialState:xe,reducers:{removeMutationResult:{reducer(u,{payload:s}){const n=Qe(s);n in u&&delete u[n]},prepare:Se()}},extraReducers(u){u.addCase(d.pending,(s,{meta:n,meta:{requestId:r,arg:i,startedTimeStamp:o}})=>{i.track&&(s[Qe(n)]={requestId:r,status:Je,endpointName:i.endpointName,startedTimeStamp:o})}).addCase(d.fulfilled,(s,{payload:n,meta:r})=>{r.arg.track&&Et(s,r,i=>{i.requestId===r.requestId&&(i.status=Ee,i.data=n,i.fulfilledTimeStamp=r.fulfilledTimeStamp)})}).addCase(d.rejected,(s,{payload:n,error:r,meta:i})=>{i.arg.track&&Et(s,i,o=>{o.requestId===i.requestId&&(o.status=Ie,o.error=n??r)})}).addMatcher(Q,(s,n)=>{const{mutations:r}=v(n);for(const[i,o]of Object.entries(r))((o==null?void 0:o.status)===Ee||(o==null?void 0:o.status)===Ie)&&i!==(o==null?void 0:o.requestId)&&(s[i]=o)})}}),I={tags:{},keys:{}},y=ge({name:`${e}/invalidation`,initialState:I,reducers:{updateProvidedBy:{reducer(u,s){var n,r,i;for(const{queryCacheKey:o,providedTags:S}of s.payload){P(u,o);for(const{type:x,id:q}of S){const w=(r=(n=u.tags)[x]??(n[x]={}))[i=q||"__internal_without_id"]??(r[i]=[]);w.includes(o)||w.push(o)}u.keys[o]=S}},prepare:Se()}},extraReducers(u){u.addCase(T.actions.removeQueryResult,(s,{payload:{queryCacheKey:n}})=>{P(s,n)}).addMatcher(Q,(s,n)=>{var i,o,S;const{provided:r}=v(n);for(const[x,q]of Object.entries(r.tags??{}))for(const[w,b]of Object.entries(q)){const j=(o=(i=s.tags)[x]??(i[x]={}))[S=w||"__internal_without_id"]??(o[S]=[]);for(const k of b)j.includes(k)||j.push(k),s.keys[k]=r.keys[k]}}).addMatcher(Me(ue(t),tt(t)),(s,n)=>{A(s,[n])}).addMatcher(T.actions.cacheEntriesUpserted.match,(s,n)=>{const r=n.payload.map(({queryDescription:i,value:o})=>({type:"UNKNOWN",payload:o,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:i}}));A(s,r)})}});function P(u,s){var r;const n=Pt(u.keys[s]??[]);for(const i of n){const o=i.type,S=i.id??"__internal_without_id",x=(r=u.tags[o])==null?void 0:r[S];x&&(u.tags[o][S]=Pt(x).filter(q=>q!==s))}delete u.keys[s]}function A(u,s){const n=s.map(r=>{const i=Jt(r,"providesTags",h,_),{queryCacheKey:o}=r.meta.arg;return{queryCacheKey:o,providedTags:i}});y.caseReducers.updateProvidedBy(u,y.actions.updateProvidedBy(n))}const p=ge({name:`${e}/subscriptions`,initialState:xe,reducers:{updateSubscriptionOptions(u,s){},unsubscribeQueryResult(u,s){},internal_getRTKQSubscriptions(){}}}),f=ge({name:`${e}/internalSubscriptions`,initialState:xe,reducers:{subscriptionsUpdated:{reducer(u,s){return gt(u,s.payload)},prepare:Se()}}}),a=ge({name:`${e}/config`,initialState:{online:Nn(),focused:qn(),middlewareRegistered:!1,...C},reducers:{middlewareRegistered(u,{payload:s}){u.middlewareRegistered=u.middlewareRegistered==="conflict"||E!==s?"conflict":!0}},extraReducers:u=>{u.addCase(ct,s=>{s.online=!0}).addCase(Bt,s=>{s.online=!1}).addCase(at,s=>{s.focused=!0}).addCase(zt,s=>{s.focused=!1}).addMatcher(Q,s=>({...s}))}}),l=un({queries:T.reducer,mutations:N.reducer,provided:y.reducer,subscriptions:f.reducer,config:a.reducer}),c=(u,s)=>l(O.match(s)?void 0:u,s),g={...a.actions,...T.actions,...p.actions,...f.actions,...N.actions,...y.actions,resetApiState:O};return{reducer:c,actions:g}}var Z=Symbol.for("RTKQ/skipToken"),Yt={status:re},It=rt(Yt,()=>{}),Ct=rt(Yt,()=>{});function Hn({serializeQueryArgs:e,reducerPath:t,createSelector:d}){const m=p=>It,h=p=>Ct;return{buildQuerySelector:D,buildInfiniteQuerySelector:T,buildMutationSelector:N,selectInvalidatedBy:I,selectCachedArgsForQuery:y,selectApiState:v,selectQueries:Q,selectMutations:C,selectQueryEntry:_,selectConfig:O};function E(p){return{...p,...mt(p.status)}}function v(p){return p[t]}function Q(p){var f;return(f=v(p))==null?void 0:f.queries}function _(p,f){var a;return(a=Q(p))==null?void 0:a[f]}function C(p){var f;return(f=v(p))==null?void 0:f.mutations}function O(p){var f;return(f=v(p))==null?void 0:f.config}function R(p,f,a){return l=>{if(l===Z)return d(m,a);const c=e({queryArgs:l,endpointDefinition:f,endpointName:p});return d(u=>_(u,c)??It,a)}}function D(p,f){return R(p,f,E)}function T(p,f){const{infiniteQueryOptions:a}=f;function l(c){const g={...c,...mt(c.status)},{isLoading:u,isError:s,direction:n}=g,r=n==="forward",i=n==="backward";return{...g,hasNextPage:P(a,g.data,g.originalArgs),hasPreviousPage:A(a,g.data,g.originalArgs),isFetchingNextPage:u&&r,isFetchingPreviousPage:u&&i,isFetchNextPageError:s&&r,isFetchPreviousPageError:s&&i}}return R(p,f,l)}function N(){return p=>{let f;return typeof p=="object"?f=Qe(p)??Z:f=p,d(f===Z?h:c=>{var g,u;return((u=(g=v(c))==null?void 0:g.mutations)==null?void 0:u[f])??Ct},E)}}function I(p,f){const a=p[t],l=new Set,c=Ye(f,ot,Gt);for(const g of c){const u=a.provided.tags[g.type];if(!u)continue;let s=(g.id!==void 0?u[g.id]:Object.values(u).flat())??[];for(const n of s)l.add(n)}return Array.from(l.values()).flatMap(g=>{const u=a.queries[g];return u?{queryCacheKey:g,endpointName:u.endpointName,originalArgs:u.originalArgs}:[]})}function y(p,f){return Ye(Object.values(Q(p)),a=>(a==null?void 0:a.endpointName)===f&&a.status!==re,a=>a.originalArgs)}function P(p,f,a){return f?et(p,f,a)!=null:!1}function A(p,f,a){return!f||!p.getPreviousPageParam?!1:Wt(p,f,a)!=null}}var pe=WeakMap?new WeakMap:void 0,Tt=({endpointName:e,queryArgs:t})=>{let d="";const m=pe==null?void 0:pe.get(t);if(typeof m=="string")d=m;else{const h=JSON.stringify(t,(E,v)=>(v=typeof v=="bigint"?{$bigint:v.toString()}:v,v=We(v)?Object.keys(v).sort().reduce((Q,_)=>(Q[_]=v[_],Q),{}):v,v));We(t)&&(pe==null||pe.set(t,h)),d=h}return`${e}(${d})`};function Xt(...e){return function(d){const m=lt(C=>{var O;return(O=d.extractRehydrationInfo)==null?void 0:O.call(d,C,{reducerPath:d.reducerPath??"api"})}),h={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...d,extractRehydrationInfo:m,serializeQueryArgs(C){let O=Tt;if("serializeQueryArgs"in C.endpointDefinition){const R=C.endpointDefinition.serializeQueryArgs;O=D=>{const T=R(D);return typeof T=="string"?T:Tt({...D,queryArgs:T})}}else d.serializeQueryArgs&&(O=d.serializeQueryArgs);return O(C)},tagTypes:[...d.tagTypes||[]]},E={endpointDefinitions:{},batch(C){C()},apiUid:Mt(),extractRehydrationInfo:m,hasRehydrationInfo:lt(C=>m(C)!=null)},v={injectEndpoints:_,enhanceEndpoints({addTagTypes:C,endpoints:O}){if(C)for(const R of C)h.tagTypes.includes(R)||h.tagTypes.push(R);if(O)for(const[R,D]of Object.entries(O))typeof D=="function"?D(me(E,R)):Object.assign(me(E,R)||{},D);return v}},Q=e.map(C=>C.init(v,h,E));function _(C){const O=C.endpoints({query:R=>({...R,type:Ae}),mutation:R=>({...R,type:Ht}),infiniteQuery:R=>({...R,type:Kt})});for(const[R,D]of Object.entries(O)){if(C.overrideExisting!==!0&&R in E.endpointDefinitions){if(C.overrideExisting==="throw")throw new Error(Ve(39));continue}E.endpointDefinitions[R]=D;for(const T of Q)T.injectEndpoint(R,D)}return v}return v.injectEndpoints({endpoints:d.endpoints})}}function te(e,...t){return Object.assign(e,...t)}var Kn=({api:e,queryThunk:t,internalState:d,mwApi:m})=>{const h=`${e.reducerPath}/subscriptions`;let E=null,v=null;const{updateSubscriptionOptions:Q,unsubscribeQueryResult:_}=e.internalActions,C=(I,y)=>{if(Q.match(y)){const{queryCacheKey:A,requestId:p,options:f}=y.payload,a=I.get(A);return a!=null&&a.has(p)&&a.set(p,f),!0}if(_.match(y)){const{queryCacheKey:A,requestId:p}=y.payload,f=I.get(A);return f&&f.delete(p),!0}if(e.internalActions.removeQueryResult.match(y))return I.delete(y.payload.queryCacheKey),!0;if(t.pending.match(y)){const{meta:{arg:A,requestId:p}}=y,f=Oe(I,A.queryCacheKey,Xe);return A.subscribe&&f.set(p,A.subscriptionOptions??f.get(p)??{}),!0}let P=!1;if(t.rejected.match(y)){const{meta:{condition:A,arg:p,requestId:f}}=y;if(A&&p.subscribe){const a=Oe(I,p.queryCacheKey,Xe);a.set(f,p.subscriptionOptions??a.get(f)??{}),P=!0}}return P},O=()=>d.currentSubscriptions,T={getSubscriptions:O,getSubscriptionCount:I=>{const P=O().get(I);return(P==null?void 0:P.size)??0},isRequestSubscribed:(I,y)=>{var A;const P=O();return!!((A=P==null?void 0:P.get(I))!=null&&A.get(y))}};function N(I){return JSON.parse(JSON.stringify(Object.fromEntries([...I].map(([y,P])=>[y,Object.fromEntries(P)]))))}return(I,y)=>{if(E||(E=N(d.currentSubscriptions)),e.util.resetApiState.match(I))return E={},d.currentSubscriptions.clear(),v=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(I))return[!1,T];const P=C(d.currentSubscriptions,I);let A=!0;if(P){v||(v=setTimeout(()=>{const a=N(d.currentSubscriptions),[,l]=qt(E,()=>a);y.next(e.internalActions.subscriptionsUpdated(l)),E=a,v=null},500));const p=typeof I.type=="string"&&!!I.type.startsWith(h),f=t.rejected.match(I)&&I.meta.condition&&!!I.meta.arg.subscribe;A=!p&&!f}return[A,!1]}},Gn=2147483647/1e3-1,Vn=({reducerPath:e,api:t,queryThunk:d,context:m,internalState:h,selectors:{selectQueryEntry:E,selectConfig:v},getRunningQueryThunk:Q,mwApi:_})=>{const{removeQueryResult:C,unsubscribeQueryResult:O,cacheEntriesUpserted:R}=t.internalActions,D=Me(O.match,d.fulfilled,d.rejected,R.match);function T(p){const f=h.currentSubscriptions.get(p);return f?f.size>0:!1}const N={};function I(p){var f;for(const a of p.values())(f=a==null?void 0:a.abort)==null||f.call(a)}const y=(p,f)=>{const a=f.getState(),l=v(a);if(D(p)){let c;if(R.match(p))c=p.payload.map(g=>g.queryDescription.queryCacheKey);else{const{queryCacheKey:g}=O.match(p)?p.payload:p.meta.arg;c=[g]}P(c,f,l)}if(t.util.resetApiState.match(p)){for(const[c,g]of Object.entries(N))g&&clearTimeout(g),delete N[c];I(h.runningQueries),I(h.runningMutations)}if(m.hasRehydrationInfo(p)){const{queries:c}=m.extractRehydrationInfo(p);P(Object.keys(c),f,l)}};function P(p,f,a){const l=f.getState();for(const c of p){const g=E(l,c);g!=null&&g.endpointName&&A(c,g.endpointName,f,a)}}function A(p,f,a,l){const c=me(m,f),g=(c==null?void 0:c.keepUnusedDataFor)??l.keepUnusedDataFor;if(g===1/0)return;const u=Math.max(0,Math.min(g,Gn));if(!T(p)){const s=N[p];s&&clearTimeout(s),N[p]=setTimeout(()=>{if(!T(p)){const n=E(a.getState(),p);if(n!=null&&n.endpointName){const r=a.dispatch(Q(n.endpointName,n.originalArgs));r==null||r.abort()}a.dispatch(C({queryCacheKey:p}))}delete N[p]},u*1e3)}}return y},Qt=new Error("Promise never resolved before cacheEntryRemoved."),Wn=({api:e,reducerPath:t,context:d,queryThunk:m,mutationThunk:h,internalState:E,selectors:{selectQueryEntry:v,selectApiState:Q}})=>{const _=pt(m),C=pt(h),O=ue(m,h),R={},{removeQueryResult:D,removeMutationResult:T,cacheEntriesUpserted:N}=e.internalActions;function I(a,l,c){const g=R[a];g!=null&&g.valueResolved&&(g.valueResolved({data:l,meta:c}),delete g.valueResolved)}function y(a){const l=R[a];l&&(delete R[a],l.cacheEntryRemoved())}function P(a){const{arg:l,requestId:c}=a.meta,{endpointName:g,originalArgs:u}=l;return[g,u,c]}const A=(a,l,c)=>{const g=p(a);function u(s,n,r,i){const o=v(c,n),S=v(l.getState(),n);!o&&S&&f(s,i,n,l,r)}if(m.pending.match(a)){const[s,n,r]=P(a);u(s,g,r,n)}else if(N.match(a))for(const{queryDescription:s,value:n}of a.payload){const{endpointName:r,originalArgs:i,queryCacheKey:o}=s;u(r,o,a.meta.requestId,i),I(o,n,{})}else if(h.pending.match(a)){if(l.getState()[t].mutations[g]){const[n,r,i]=P(a);f(n,r,g,l,i)}}else if(O(a))I(g,a.payload,a.meta.baseQueryMeta);else if(D.match(a)||T.match(a))y(g);else if(e.util.resetApiState.match(a))for(const s of Object.keys(R))y(s)};function p(a){return _(a)?a.meta.arg.queryCacheKey:C(a)?a.meta.arg.fixedCacheKey??a.meta.requestId:D.match(a)?a.payload.queryCacheKey:T.match(a)?Qe(a.payload):""}function f(a,l,c,g,u){const s=me(d,a),n=s==null?void 0:s.onCacheEntryAdded;if(!n)return;const r={},i=new Promise(b=>{r.cacheEntryRemoved=b}),o=Promise.race([new Promise(b=>{r.valueResolved=b}),i.then(()=>{throw Qt})]);o.catch(()=>{}),R[c]=r;const S=e.endpoints[a].select(_e(s)?l:c),x=g.dispatch((b,j,k)=>k),q={...g,getCacheEntry:()=>S(g.getState()),requestId:u,extra:x,updateCachedData:_e(s)?b=>g.dispatch(e.util.updateQueryData(a,l,b)):void 0,cacheDataLoaded:o,cacheEntryRemoved:i},w=n(l,q);Promise.resolve(w).catch(b=>{if(b!==Qt)throw b})}return A},Jn=({api:e,context:{apiUid:t},reducerPath:d})=>(m,h)=>{e.util.resetApiState.match(m)&&h.dispatch(e.internalActions.middlewareRegistered(t))},Yn=({reducerPath:e,context:t,context:{endpointDefinitions:d},mutationThunk:m,queryThunk:h,api:E,assertTagType:v,refetchQuery:Q,internalState:_})=>{const{removeQueryResult:C}=E.internalActions,O=Me(ue(m),tt(m)),R=Me(ue(h,m),nt(h,m));let D=[],T=0;const N=(P,A)=>{(h.pending.match(P)||m.pending.match(P))&&T++,R(P)&&(T=Math.max(0,T-1)),O(P)?y(Jt(P,"invalidatesTags",d,v),A):R(P)?y([],A):E.util.invalidateTags.match(P)&&y(ut(P.payload,void 0,void 0,void 0,void 0,v),A)};function I(){return T>0}function y(P,A){const p=A.getState(),f=p[e];if(D.push(...P),f.config.invalidationBehavior==="delayed"&&I())return;const a=D;if(D=[],a.length===0)return;const l=E.util.selectInvalidatedBy(p,a);t.batch(()=>{const c=Array.from(l.values());for(const{queryCacheKey:g}of c){const u=f.queries[g],s=Oe(_.currentSubscriptions,g,Xe);u&&(s.size===0?A.dispatch(C({queryCacheKey:g})):u.status!==re&&A.dispatch(Q(u)))}})}return N},Xn=({reducerPath:e,queryThunk:t,api:d,refetchQuery:m,internalState:h})=>{const{currentPolls:E,currentSubscriptions:v}=h,Q=new Set;let _=null;const C=(y,P)=>{(d.internalActions.updateSubscriptionOptions.match(y)||d.internalActions.unsubscribeQueryResult.match(y))&&O(y.payload.queryCacheKey,P),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&O(y.meta.arg.queryCacheKey,P),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&R(y.meta.arg,P),d.util.resetApiState.match(y)&&(N(),_&&(clearTimeout(_),_=null),Q.clear())};function O(y,P){Q.add(y),_||(_=setTimeout(()=>{for(const A of Q)D({queryCacheKey:A},P);Q.clear(),_=null},0))}function R({queryCacheKey:y},P){const A=P.getState()[e],p=A.queries[y],f=v.get(y);if(!p||p.status===re)return;const{lowestPollingInterval:a,skipPollingIfUnfocused:l}=I(f);if(!Number.isFinite(a))return;const c=E.get(y);c!=null&&c.timeout&&(clearTimeout(c.timeout),c.timeout=void 0);const g=Date.now()+a;E.set(y,{nextPollTimestamp:g,pollingInterval:a,timeout:setTimeout(()=>{(A.config.focused||!l)&&P.dispatch(m(p)),R({queryCacheKey:y},P)},a)})}function D({queryCacheKey:y},P){const p=P.getState()[e].queries[y],f=v.get(y);if(!p||p.status===re)return;const{lowestPollingInterval:a}=I(f);if(!Number.isFinite(a)){T(y);return}const l=E.get(y),c=Date.now()+a;(!l||c<l.nextPollTimestamp)&&R({queryCacheKey:y},P)}function T(y){const P=E.get(y);P!=null&&P.timeout&&clearTimeout(P.timeout),E.delete(y)}function N(){for(const y of E.keys())T(y)}function I(y=new Map){let P=!1,A=Number.POSITIVE_INFINITY;for(const p of y.values())p.pollingInterval&&(A=Math.min(p.pollingInterval,A),P=p.skipPollingIfUnfocused||P);return{lowestPollingInterval:A,skipPollingIfUnfocused:P}}return C},Zn=({api:e,context:t,queryThunk:d,mutationThunk:m})=>{const h=_t(d,m),E=nt(d,m),v=ue(d,m),Q={};return(C,O)=>{var R,D;if(h(C)){const{requestId:T,arg:{endpointName:N,originalArgs:I}}=C.meta,y=me(t,N),P=y==null?void 0:y.onQueryStarted;if(P){const A={},p=new Promise((c,g)=>{A.resolve=c,A.reject=g});p.catch(()=>{}),Q[T]=A;const f=e.endpoints[N].select(_e(y)?I:T),a=O.dispatch((c,g,u)=>u),l={...O,getCacheEntry:()=>f(O.getState()),requestId:T,extra:a,updateCachedData:_e(y)?c=>O.dispatch(e.util.updateQueryData(N,I,c)):void 0,queryFulfilled:p};P(I,l)}}else if(v(C)){const{requestId:T,baseQueryMeta:N}=C.meta;(R=Q[T])==null||R.resolve({data:C.payload,meta:N}),delete Q[T]}else if(E(C)){const{requestId:T,rejectedWithValue:N,baseQueryMeta:I}=C.meta;(D=Q[T])==null||D.reject({error:C.payload??C.error,isUnhandledError:!N,meta:I}),delete Q[T]}}},er=({reducerPath:e,context:t,api:d,refetchQuery:m,internalState:h})=>{const{removeQueryResult:E}=d.internalActions,v=(_,C)=>{at.match(_)&&Q(C,"refetchOnFocus"),ct.match(_)&&Q(C,"refetchOnReconnect")};function Q(_,C){const O=_.getState()[e],R=O.queries,D=h.currentSubscriptions;t.batch(()=>{for(const T of D.keys()){const N=R[T],I=D.get(T);if(!I||!N)continue;const y=[...I.values()];(y.some(A=>A[C]===!0)||y.every(A=>A[C]===void 0)&&O.config[C])&&(I.size===0?_.dispatch(E({queryCacheKey:T})):N.status!==re&&_.dispatch(m(N)))}})}return v};function tr(e){const{reducerPath:t,queryThunk:d,api:m,context:h,getInternalState:E}=e,{apiUid:v}=h,Q={invalidateTags:ye(`${t}/invalidateTags`)},_=D=>D.type.startsWith(`${t}/`),C=[Jn,Vn,Yn,Xn,Wn,Zn];return{middleware:D=>{let T=!1;const N=E(D.dispatch),I={...e,internalState:N,refetchQuery:R,isThisApiSliceAction:_,mwApi:D},y=C.map(p=>p(I)),P=Kn(I),A=er(I);return p=>f=>{if(!fn(f))return p(f);T||(T=!0,D.dispatch(m.internalActions.middlewareRegistered(v)));const a={...D,next:p},l=D.getState(),[c,g]=P(f,a,l);let u;if(c?u=p(f):u=g,D.getState()[t]&&(A(f,a,l),_(f)||h.hasRehydrationInfo(f)))for(const s of y)s(f,a,l);return u}},actions:Q};function R(D){return e.api.endpoints[D.endpointName].initiate(D.originalArgs,{subscribe:!1,forceRefetch:!0})}}var At=Symbol(),Zt=({createSelector:e=Dt}={})=>({name:At,init(t,{baseQuery:d,tagTypes:m,reducerPath:h,serializeQueryArgs:E,keepUnusedDataFor:v,refetchOnMountOrArgChange:Q,refetchOnFocus:_,refetchOnReconnect:C,invalidationBehavior:O,onSchemaFailure:R,catchSchemaFailure:D,skipSchemaValidation:T},N){cn();const I=F=>F;Object.assign(t,{reducerPath:h,endpoints:{},internalActions:{onOnline:ct,onOffline:Bt,onFocus:at,onFocusLost:zt},util:{}});const y=Hn({serializeQueryArgs:E,reducerPath:h,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:A,buildQuerySelector:p,buildInfiniteQuerySelector:f,buildMutationSelector:a}=y;te(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:A});const{queryThunk:l,infiniteQueryThunk:c,mutationThunk:g,patchQueryData:u,updateQueryData:s,upsertQueryData:n,prefetch:r,buildMatchThunkActions:i}=zn({baseQuery:d,reducerPath:h,context:N,api:t,serializeQueryArgs:E,assertTagType:I,selectors:y,onSchemaFailure:R,catchSchemaFailure:D,skipSchemaValidation:T}),{reducer:o,actions:S}=Bn({context:N,queryThunk:l,mutationThunk:g,serializeQueryArgs:E,reducerPath:h,assertTagType:I,config:{refetchOnFocus:_,refetchOnReconnect:C,refetchOnMountOrArgChange:Q,keepUnusedDataFor:v,reducerPath:h,invalidationBehavior:O}});te(t.util,{patchQueryData:u,updateQueryData:s,upsertQueryData:n,prefetch:r,resetApiState:S.resetApiState,upsertQueryEntries:S.cacheEntriesUpserted}),te(t.internalActions,S);const x=new WeakMap,q=F=>Oe(x,F,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:w,buildInitiateInfiniteQuery:b,buildInitiateMutation:j,getRunningMutationThunk:k,getRunningMutationsThunk:H,getRunningQueriesThunk:K,getRunningQueryThunk:$}=$n({queryThunk:l,mutationThunk:g,infiniteQueryThunk:c,api:t,serializeQueryArgs:E,context:N,getInternalState:q});te(t.util,{getRunningMutationThunk:k,getRunningMutationsThunk:H,getRunningQueryThunk:$,getRunningQueriesThunk:K});const{middleware:V,actions:B}=tr({reducerPath:h,context:N,queryThunk:l,mutationThunk:g,infiniteQueryThunk:c,api:t,assertTagType:I,selectors:y,getRunningQueryThunk:$,getInternalState:q});return te(t.util,B),te(t,{reducer:o,middleware:V}),{name:At,injectEndpoint(F,U){var L;const J=(L=t.endpoints)[F]??(L[F]={});ke(U)&&te(J,{name:F,select:p(F,U),initiate:w(F,U)},i(l,F)),Un(U)&&te(J,{name:F,select:a(),initiate:j(F)},i(g,F)),je(U)&&te(J,{name:F,select:f(F,U),initiate:b(F,U)},i(l,F))}}}});Zt();function Re(e){return e.replace(e[0],e[0].toUpperCase())}var nr="query",rr="mutation",sr="infinitequery";function ir(e){return e.type===nr}function or(e){return e.type===rr}function en(e){return e.type===sr}function ve(e,...t){return Object.assign(e,...t)}var $e=Symbol();function ze(e){const t=M.useRef(e),d=M.useMemo(()=>it(t.current,e),[e]);return M.useEffect(()=>{t.current!==d&&(t.current=d)},[d]),d}function he(e){const t=M.useRef(e);return M.useEffect(()=>{Ce(t.current,e)||(t.current=e)},[e]),Ce(t.current,e)?t.current:e}var ar=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cr=ar(),ur=()=>typeof navigator<"u"&&navigator.product==="ReactNative",dr=ur(),lr=()=>cr||dr?M.useLayoutEffect:M.useEffect,fr=lr(),wt=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Lt.pending}:e;function Be(e,...t){const d={};return t.forEach(m=>{d[m]=e[m]}),d}var He=["data","status","isLoading","isSuccess","isError","error"];function gr({api:e,moduleOptions:{batch:t,hooks:{useDispatch:d,useSelector:m,useStore:h},unstable__sideEffectsInRender:E,createSelector:v},serializeQueryArgs:Q,context:_}){const C=E?l=>l():M.useEffect,O=l=>{var c,g;return(g=(c=l.current)==null?void 0:c.unsubscribe)==null?void 0:g.call(c)},R=_.endpointDefinitions;return{buildQueryHooks:p,buildInfiniteQueryHooks:f,buildMutationHook:a,usePrefetch:N};function D(l,c,g){if(c!=null&&c.endpointName&&l.isUninitialized){const{endpointName:o}=c,S=R[o];g!==Z&&Q({queryArgs:c.originalArgs,endpointDefinition:S,endpointName:o})===Q({queryArgs:g,endpointDefinition:S,endpointName:o})&&(c=void 0)}let u=l.isSuccess?l.data:c==null?void 0:c.data;u===void 0&&(u=l.data);const s=u!==void 0,n=l.isLoading,r=(!c||c.isLoading||c.isUninitialized)&&!s&&n,i=l.isSuccess||s&&(n&&!(c!=null&&c.isError)||l.isUninitialized);return{...l,data:u,currentData:l.data,isFetching:n,isLoading:r,isSuccess:i}}function T(l,c,g){if(c!=null&&c.endpointName&&l.isUninitialized){const{endpointName:o}=c,S=R[o];g!==Z&&Q({queryArgs:c.originalArgs,endpointDefinition:S,endpointName:o})===Q({queryArgs:g,endpointDefinition:S,endpointName:o})&&(c=void 0)}let u=l.isSuccess?l.data:c==null?void 0:c.data;u===void 0&&(u=l.data);const s=u!==void 0,n=l.isLoading,r=(!c||c.isLoading||c.isUninitialized)&&!s&&n,i=l.isSuccess||s&&(n&&!(c!=null&&c.isError)||l.isUninitialized);return{...l,data:u,currentData:l.data,isFetching:n,isLoading:r,isSuccess:i}}function N(l,c){const g=d(),u=he(c);return M.useCallback((s,n)=>g(e.util.prefetch(l,s,{...u,...n})),[l,g,u])}function I(l,c,{refetchOnReconnect:g,refetchOnFocus:u,refetchOnMountOrArgChange:s,skip:n=!1,pollingInterval:r=0,skipPollingIfUnfocused:i=!1,...o}={}){const{initiate:S}=e.endpoints[l],x=d(),q=M.useRef(void 0);if(!q.current){const G=x(e.internalActions.internal_getRTKQSubscriptions());q.current=G}const w=ze(n?Z:c),b=he({refetchOnReconnect:g,refetchOnFocus:u,pollingInterval:r,skipPollingIfUnfocused:i}),j=o.initialPageParam,k=he(j),H=o.refetchCachedPages,K=he(H),$=M.useRef(void 0);let{queryCacheKey:V,requestId:B}=$.current||{},F=!1;V&&B&&(F=q.current.isRequestSubscribed(V,B));const U=!F&&$.current!==void 0;return C(()=>{U&&($.current=void 0)},[U]),C(()=>{var L;const G=$.current;if(w===Z){G==null||G.unsubscribe(),$.current=void 0;return}const J=(L=$.current)==null?void 0:L.subscriptionOptions;if(!G||G.arg!==w){G==null||G.unsubscribe();const z=x(S(w,{subscriptionOptions:b,forceRefetch:s,...en(R[l])?{initialPageParam:k,refetchCachedPages:K}:{}}));$.current=z}else b!==J&&G.updateSubscriptionOptions(b)},[x,S,s,w,b,U,k,K,l]),[$,x,S,b]}function y(l,c){return(u,{skip:s=!1,selectFromResult:n}={})=>{const{select:r}=e.endpoints[l],i=ze(s?Z:u),o=M.useRef(void 0),S=M.useMemo(()=>v([r(i),(j,k)=>k,j=>i],c,{memoizeOptions:{resultEqualityCheck:Ce}}),[r,i]),x=M.useMemo(()=>n?v([S],n,{devModeChecks:{identityFunctionCheck:"never"}}):S,[S,n]),q=m(j=>x(j,o.current),Ce),w=h(),b=S(w.getState(),o.current);return fr(()=>{o.current=b},[b]),q}}function P(l){M.useEffect(()=>()=>{O(l),l.current=void 0},[l])}function A(l){if(!l.current)throw new Error(Ve(38));return l.current.refetch()}function p(l){const c=(s,n={})=>{const[r]=I(l,s,n);return P(r),M.useMemo(()=>({refetch:()=>A(r)}),[r])},g=({refetchOnReconnect:s,refetchOnFocus:n,pollingInterval:r=0,skipPollingIfUnfocused:i=!1}={})=>{const{initiate:o}=e.endpoints[l],S=d(),[x,q]=M.useState($e),w=M.useRef(void 0),b=he({refetchOnReconnect:s,refetchOnFocus:n,pollingInterval:r,skipPollingIfUnfocused:i});C(()=>{var $,V;const K=($=w.current)==null?void 0:$.subscriptionOptions;b!==K&&((V=w.current)==null||V.updateSubscriptionOptions(b))},[b]);const j=M.useRef(b);C(()=>{j.current=b},[b]);const k=M.useCallback(function(K,$=!1){let V;return t(()=>{O(w),w.current=V=S(o(K,{subscriptionOptions:j.current,forceRefetch:!$})),q(K)}),V},[S,o]),H=M.useCallback(()=>{var K,$;(K=w.current)!=null&&K.queryCacheKey&&S(e.internalActions.removeQueryResult({queryCacheKey:($=w.current)==null?void 0:$.queryCacheKey}))},[S]);return M.useEffect(()=>()=>{O(w)},[]),M.useEffect(()=>{x!==$e&&!w.current&&k(x,!0)},[x,k]),M.useMemo(()=>[k,x,{reset:H}],[k,x,H])},u=y(l,D);return{useQueryState:u,useQuerySubscription:c,useLazyQuerySubscription:g,useLazyQuery(s){const[n,r,{reset:i}]=g(s),o=u(r,{...s,skip:r===$e}),S=M.useMemo(()=>({lastArg:r}),[r]);return M.useMemo(()=>[n,{...o,reset:i},S],[n,o,i,S])},useQuery(s,n){const r=c(s,n),i=u(s,{selectFromResult:s===Z||n!=null&&n.skip?void 0:wt,...n}),o=Be(i,...He);return M.useDebugValue(o),M.useMemo(()=>({...i,...r}),[i,r])}}}function f(l){const c=(u,s={})=>{const[n,r,i,o]=I(l,u,s),S=M.useRef(o);C(()=>{S.current=o},[o]);const x=s.refetchCachedPages,q=he(x),w=M.useCallback(function(k,H){let K;return t(()=>{O(n),n.current=K=r(i(k,{subscriptionOptions:S.current,direction:H}))}),K},[n,r,i]);P(n);const b=ze(s.skip?Z:u),j=M.useCallback(k=>{if(!n.current)throw new Error(Ve(38));const H={refetchCachedPages:(k==null?void 0:k.refetchCachedPages)??q};return n.current.refetch(H)},[n,q]);return M.useMemo(()=>({trigger:w,refetch:j,fetchNextPage:()=>w(b,"forward"),fetchPreviousPage:()=>w(b,"backward")}),[j,w,b])},g=y(l,T);return{useInfiniteQueryState:g,useInfiniteQuerySubscription:c,useInfiniteQuery(u,s){const{refetch:n,fetchNextPage:r,fetchPreviousPage:i}=c(u,s),o=g(u,{selectFromResult:u===Z||s!=null&&s.skip?void 0:wt,...s}),S=Be(o,...He,"hasNextPage","hasPreviousPage");return M.useDebugValue(S),M.useMemo(()=>({...o,fetchNextPage:r,fetchPreviousPage:i,refetch:n}),[o,r,i,n])}}}function a(l){return({selectFromResult:c,fixedCacheKey:g}={})=>{const{select:u,initiate:s}=e.endpoints[l],n=d(),[r,i]=M.useState();M.useEffect(()=>()=>{r!=null&&r.arg.fixedCacheKey||r==null||r.reset()},[r]);const o=M.useCallback(function(K){const $=n(s(K,{fixedCacheKey:g}));return i($),$},[n,s,g]),{requestId:S}=r||{},x=M.useMemo(()=>u({fixedCacheKey:g,requestId:r==null?void 0:r.requestId}),[g,r,u]),q=M.useMemo(()=>c?v([x],c):x,[c,x]),w=m(q,Ce),b=g==null?r==null?void 0:r.arg.originalArgs:void 0,j=M.useCallback(()=>{t(()=>{r&&i(void 0),g&&n(e.internalActions.removeMutationResult({requestId:S,fixedCacheKey:g}))})},[n,g,r,S]),k=Be(w,...He,"endpointName");M.useDebugValue(k);const H=M.useMemo(()=>({...w,originalArgs:b,reset:j}),[w,b,j]);return M.useMemo(()=>[o,H],[o,H])}}}var pr=Symbol(),hr=({batch:e=pn,hooks:t={useDispatch:yn,useSelector:mn,useStore:hn},createSelector:d=Dt,unstable__sideEffectsInRender:m=!1,...h}={})=>({name:pr,init(E,{serializeQueryArgs:v},Q){const _=E,{buildQueryHooks:C,buildInfiniteQueryHooks:O,buildMutationHook:R,usePrefetch:D}=gr({api:E,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:m,createSelector:d},serializeQueryArgs:v,context:Q});return ve(_,{usePrefetch:D}),ve(Q,{batch:e}),{injectEndpoint(T,N){if(ir(N)){const{useQuery:I,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:A,useQuerySubscription:p}=C(T);ve(_.endpoints[T],{useQuery:I,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:A,useQuerySubscription:p}),E[`use${Re(T)}Query`]=I,E[`useLazy${Re(T)}Query`]=y}if(or(N)){const I=R(T);ve(_.endpoints[T],{useMutation:I}),E[`use${Re(T)}Mutation`]=I}else if(en(N)){const{useInfiniteQuery:I,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}=O(T);ve(_.endpoints[T],{useInfiniteQuery:I,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}),E[`use${Re(T)}InfiniteQuery`]=I}}}}}),mr=Xt(Zt(),hr());const yr=()=>async e=>{try{const t=new URL(window.payseraData.ajaxUrl,window.location.origin);t.protocol=window.location.protocol,t.searchParams.set("ajax","1"),t.searchParams.set("action",e.action),e.params&&Object.entries(e.params).forEach(([v,Q])=>{if(Q!=null){if(Array.isArray(Q)){Q.forEach(_=>{t.searchParams.append(`${v}[]`,_)});return}t.searchParams.set(v,Q)}});const d=e.method||"GET",m={method:d};e.data&&d!=="GET"&&(m.headers={"Content-Type":"application/json"},m.body=JSON.stringify(e.data));const h=await fetch(t.toString(),m),E=await h.json();return E.success?{data:E.data}:{error:{status:h.status,data:E.error||E.message||"Unknown error"}}}catch(t){return{error:{status:500,data:t instanceof Error?t.message:"Network error"}}}},ne={toggleSandbox:"ToggleSandbox",connectionStatus:"GetConnectionStatus",authorize:"Authorize",getCredentials:"GetCredentials",paymentSettings:"UpdatePaymentSettings",paymentsList:"GetPayments",paymentOrder:"GetPayment",paymentStatuses:"GetPaymentStatuses",getDiagnostics:"GetDiagnostics",downloadDiagnosticReport:"DownloadDiagnosticReport"};function xt(e){const t={};for(const[d,m]of Object.entries(e)){if(m==null)continue;if(Array.isArray(m)){const E=m.filter(v=>v!=null&&v!=="").map(v=>String(v));E.length>0&&(t[d]=E);continue}const h=String(m);h!==""&&(t[d]=h)}return t}const De=mr({reducerPath:"api",baseQuery:yr(),tagTypes:["PaymentSettings"],endpoints:e=>({toggleCheckoutSandbox:e.mutation({query:()=>({action:ne.toggleSandbox,method:"POST"}),invalidatesTags:["PaymentSettings"]}),getConnectionStatus:e.query({query:()=>({action:ne.connectionStatus,method:"GET"})}),authorize:e.mutation({query:t=>({action:ne.authorize,method:"POST",data:t})}),getCredentials:e.query({query:()=>({action:ne.getCredentials,method:"GET"})}),updatePaymentSettings:e.mutation({query:t=>({action:ne.paymentSettings,method:"POST",data:t}),invalidatesTags:["PaymentSettings"]}),getPayments:e.query({query:t=>({action:ne.paymentsList,method:"GET",params:xt(t)})}),getPayment:e.query({query:t=>({action:ne.paymentOrder,method:"GET",params:{payment_id:t}})}),getPaymentStatuses:e.query({query:t=>({action:ne.paymentStatuses,method:"GET",params:xt(t)})}),getDiagnostics:e.query({query:()=>({action:ne.getDiagnostics,method:"GET"})})})}),{useLazyGetConnectionStatusQuery:Nr,useAuthorizeMutation:kr,useGetCredentialsQuery:jr,useUpdatePaymentSettingsMutation:Ur,useGetPaymentsQuery:Fr,useGetPaymentQuery:Lr,useGetDiagnosticsQuery:$r}=De,Sr=Sn({reducer:{[De.reducerPath]:De.reducer},middleware:e=>e().concat(De.middleware)}),br="_errorContainer_11xgt_1",vr="_errorMessage_11xgt_10",Pr="_reloadButton_11xgt_16",Ke={errorContainer:br,errorMessage:vr,reloadButton:Pr};class Er extends M.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,d){console.error("Paysera React Error:",t,d)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:W.jsxs("div",{className:Ke.errorContainer,children:[W.jsx("p",{className:Ke.errorMessage,children:"Something went wrong loading this page."}),W.jsx("button",{className:Ke.reloadButton,onClick:()=>window.location.reload(),type:"button",children:"Reload"})]}):this.props.children}}const zr=({children:e})=>W.jsx(Er,{children:W.jsx(Mn,{children:W.jsx(Rn,{children:W.jsx(bn,{store:Sr,children:e})})})}),Ir=({children:e,spacing:t="32px",className:d=""})=>W.jsx("div",{className:"paysera-admin-layout",children:W.jsx("div",{className:d,style:{display:"flex",flexDirection:"column",gap:t,justifyContent:"flex-start"},children:e})}),Cr=M.memo(Ir);Cr.displayName="AdminLayout";function Pe(e){var d;return(((d=window.payseraData)==null?void 0:d.translations)||{})[e]||e}const Tr="_connectionStatus_1x2mo_1",Qr="_badge_1x2mo_6",Ar="_disconnected_1x2mo_16",wr="_error_1x2mo_21",xr="_connected_1x2mo_26",Rr="_suspended_1x2mo_31",Dr="_sandbox_1x2mo_36",Ge={connectionStatus:Tr,badge:Qr,disconnected:Ar,error:wr,connected:xr,suspended:Rr,sandbox:Dr},Rt={[ee.DISCONNECTED]:Pe("Unauthorised"),[ee.ERROR]:Pe("Error"),[ee.CONNECTED]:Pe("Connected"),[ee.SUSPENDED]:Pe("Suspended"),[ee.SANDBOX]:Pe("Sandbox mode")},tn=M.memo(()=>{const{user:e}=Dn(),t=e.connectionStatus||ee.DISCONNECTED;return W.jsx("div",{className:Ge.connectionStatus,children:W.jsx("span",{className:`${Ge.badge} ${Ge[t]||""}`.trim(),children:Rt[t]||Rt[ee.DISCONNECTED]})})});tn.displayName="ConnectionStatus";const Mr=({title:e,subtitle:t,className:d="",spacing:m})=>{const h=On();return W.jsxs("div",{className:`paysera-page-header ${d}`.trim(),style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",flexWrap:"wrap",gap:"16px",flexGrow:1},children:[W.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:m||h.spacing.sm},children:[W.jsx("h2",{style:{margin:0},children:e}),t&&W.jsx("p",{style:{margin:0,fontSize:"18px",color:"#6c868e"},children:t})]}),W.jsx(tn,{})]})},Or=M.memo(Mr);Or.displayName="PageHeader";export{Cr as A,Er as E,Or as P,Dn as a,kr as b,Nr as c,jr as d,Qn as e,zr as f,$r as g,ne as h,Ur as i,W as j,Fr as k,Lr as l,Pe as t,On as u};
