var y=Object.defineProperty,P=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var u=(e,t,o)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,f=(e,t)=>{for(var o in t||(t={}))I.call(t,o)&&u(e,o,t[o]);if(m)for(var o of m(t))D.call(t,o)&&u(e,o,t[o]);return e},v=(e,t)=>P(e,A(t));var s=(e,t,o)=>new Promise((d,r)=>{var i=n=>{try{a(o.next(n))}catch(p){r(p)}},c=n=>{try{a(o.throw(n))}catch(p){r(p)}},a=n=>n.done?d(n.value):Promise.resolve(n.value).then(i,c);a((o=o.apply(e,t)).next())});import{createContext as B,useCallback as R,useEffect as _,useState as w}from"react";import S from"axios";import{createContext as E,useMemo as Y}from"react";import{jsx as O}from"react/jsx-runtime";var z=E(void 0),x="production";var C=x==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var b=e=>s(void 0,null,function*(){try{return(yield S.get(`${C}/consumer`,{headers:{"X-API-KEY":e}})).data}catch(t){return{}}});import{jsx as l,jsxs as h}from"react/jsx-runtime";var N=()=>l("div",{style:{width:"100%",maxWidth:"1660px",margin:"0 auto",height:"630px",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent"},children:h("svg",{viewBox:"0 0 50 50",width:"50",height:"50",children:[l("circle",{cx:"25",cy:"25",r:"20",stroke:"#b1b5c3",strokeWidth:"3",fill:"none"}),h("circle",{cx:"25",cy:"25",r:"10",stroke:"#777e90",strokeWidth:"3",fill:"none",children:[l("animate",{attributeName:"r",values:"10;20;10",dur:"1s",repeatCount:"indefinite"}),l("animate",{attributeName:"stroke-opacity",values:"1;0;1",dur:"1s",repeatCount:"indefinite"})]})]})}),k=N;import{jsx as g}from"react/jsx-runtime";var F=B(void 0),L={profile:{name:"",email:"",profileImage:""},type:"BASIC",domain:"",externalCurrencyEnabled:!1,config:{launchpadEnabled:!1,allowedChains:[],allowedMarketPlaces:[],analyticsEnabled:!1,links:{support:"",whitelist:"",submit:""},logKey:"",categoryFilterEnabled:!0,typeFilterEnabled:!0,zoraReferralAddress:""}},ae=({accessKey:e,children:t})=>{let[o,d]=w(L),[r,i]=w(!0),c=R(()=>s(void 0,null,function*(){i(!0);let a=yield b(e);d(a),i(!1)}),[e]);return _(()=>{e&&c()},[e]),r?g(k,{}):g(F.Provider,{value:v(f({},o),{isConsumerLoading:r,accessKey:e}),children:t})};export{F as ConsumerContext,ae as ConsumerContextProvider};
