import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{d as t,f as n,g as r,h as i,l as a,m as o,p as s,u as c}from"./graphql-w47gyQE9.js";import{n as l,t as u}from"./jsx-runtime-BHz_hoGM.js";import{d,t as f}from"./useTranslation-CWZfA4RN.js";var p=class extends r{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),o(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&n(t.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??c();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){t.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},m=e(l(),1);function h(e,n){let r=a(n),[o]=m.useState(()=>new p(r,e));m.useEffect(()=>{o.setOptions(e)},[o,e]);let c=m.useSyncExternalStore(m.useCallback(e=>o.subscribe(t.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=m.useCallback((e,t)=>{o.mutate(e,t).catch(s)},[o]);if(c.error&&i(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:l,mutateAsync:c.mutate}}var g=e(d(),1),_={inline:`_inline_a0mwm_18`,loadingSpinnerInner:`_loading-spinner-inner_a0mwm_22`,mini:`_mini_a0mwm_28`,spin:`_spin_a0mwm_1`},v=u(),y=({inline:e,mini:t,className:n})=>{let{t:r}=f(void 0,{useSuspense:!1}),i=r(`common.loading`,{defaultValue:`Loading…`});return(0,v.jsx)(`div`,{role:`alert`,"aria-busy":`true`,className:(0,g.default)(n,e&&_.inline,t&&_.mini),children:(0,v.jsxs)(`svg`,{role:`img`,className:_.loadingSpinnerInner,viewBox:`0 0 100 101`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,v.jsx)(`title`,{children:i}),(0,v.jsx)(`path`,{d:`M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z`,fill:`currentFill`})]})})};export{h as n,y as t};
//# sourceMappingURL=LoadingSpinner-0XRXvdGq.js.map