1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9595],{12895:(e,t,r)=>{"use strict";r.d(t,{w:()=>n});var a=r(12115),o=r(89101);function n(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(!1),[s,c]=(0,a.useState)(null),l=(0,a.useRef)(!1),{authenticated:i,ready:d,getAccessToken:u}=(0,o.y)(),h=(0,a.useCallback)(async()=>{if(!d||!i)return void t(null);if(!l.current){l.current=!0,n(!0),c(null);try{let e=await u(),r=await fetch("/api/operator/get",{headers:{Authorization:"Bearer ".concat(e)}}),a=await r.json();if(!r.ok)throw Error(a.error||"Failed to fetch operator");a.success&&a.operator?t(a.operator):(console.log("No operator found, creating automatically..."),await p())}catch(e){console.error("Error fetching operator:",e),c(e instanceof Error?e.message:"Unknown error"),t(null)}finally{n(!1),l.current=!1}}},[d,i,u]),p=async()=>{if(!i)throw Error("User not authenticated");try{let e=await u(),r=await fetch("/api/operator/create",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await r.json();if(!r.ok)throw Error(a.error||"Failed to create operator");a.success&&t({address:a.operatorAddress,privyWalletId:a.privyWalletId,createdAt:new Date().toISOString(),isManaged:!0})}catch(e){throw console.error("Error creating operator:",e),e}},f=async()=>{if(!i)throw Error("User not authenticated");n(!0),c(null);try{await p()}catch(e){throw console.error("Error creating operator:",e),c(e instanceof Error?e.message:"Unknown error"),e}finally{n(!1)}};return(0,a.useEffect)(()=>{h()},[h]),{operator:e,loading:r,error:s,createOperator:f,refetch:h}}},34961:(e,t,r)=>{"use strict";r.d(t,{l6:()=>d,gC:()=>p,eb:()=>f,bq:()=>u,yv:()=>h});var a=r(95155),o=r(12115),n=r(66474),s=r(52596),c=r(39688);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,c.QP)((0,s.$)(t))}let i=o.createContext(null),d=e=>{let{value:t,onValueChange:r,children:n,className:s}=e,[c,d]=o.useState(!1);return(0,a.jsx)(i.Provider,{value:{value:t,onValueChange:r,isOpen:c,setIsOpen:d},children:(0,a.jsxs)("div",{className:l("relative",s),children:[n,c&&(0,a.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>d(!1)})]})})},u=o.forwardRef((e,t)=>{let{className:r,children:s,...c}=e,d=o.useContext(i);if(!d)throw Error("SelectTrigger must be used within Select");return(0,a.jsxs)("button",{type:"button",className:l("flex h-10 w-full items-center justify-between rounded-md border border-gray-800 bg-transparent px-3 py-2 text-sm placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),onClick:()=>d.setIsOpen(!d.isOpen),ref:t,...c,children:[s,(0,a.jsx)(n.A,{className:"h-4 w-4 opacity-50"})]})});u.displayName="SelectTrigger";let h=o.forwardRef((e,t)=>{let{className:r,placeholder:n,...s}=e,c=o.useContext(i);if(!c)throw Error("SelectValue must be used within Select");return(0,a.jsx)("span",{className:l("block truncate",r),ref:t,...s,children:{all:"portfolio",currency:"currency",assets:"assets"}[c.value]||c.value||n})});h.displayName="SelectValue";let p=o.forwardRef((e,t)=>{let{className:r,children:n,...s}=e,c=o.useContext(i);if(!c)throw Error("SelectContent must be used within Select");return c.isOpen?(0,a.jsx)("div",{className:l("absolute top-full left-0 z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-800 bg-black text-white shadow-md",r),ref:t,...s,children:n}):null});p.displayName="SelectContent";let f=o.forwardRef((e,t)=>{let{className:r,children:n,value:s,...c}=e,d=o.useContext(i);if(!d)throw Error("SelectItem must be used within Select");return(0,a.jsx)("div",{className:l("relative flex cursor-pointer select-none items-center px-3 py-2 text-sm outline-none hover:bg-gray-800 focus:bg-gray-800",r),onClick:()=>{d.onValueChange(s),d.setIsOpen(!1)},ref:t,...c,children:n})});f.displayName="SelectItem"},47790:()=>{},56180:(e,t,r)=>{"use strict";r.d(t,{Bt:()=>d,ex:()=>i});var a=r(96709),o=r(56886),n=r(95284),s=r(37200),c=r(53658),l=r(65730);let i={base:a.E,arbitrum:o.D,celo:n.A,ethereum:s.r,optimism:c.R,polygon:l.n},d={base:a.E}},60025:(e,t,r)=>{"use strict";r.d(t,{$e:()=>s,T0:()=>l,ck:()=>c,jv:()=>o});let a=e=>{console.log("[".concat(e.type.toUpperCase(),"] ").concat(e.message))};function o(e){a=e}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;a({message:e,type:t,metadata:r,txHash:o,chainKey:n})}let s={info:(e,t)=>n(e,"info",t),success:(e,t,r,a)=>n(e,"success",t,r,a),warning:(e,t)=>
1n(e,"warning",t),error:(e,t,r,a)=>n(e,"error",t,r,a)};function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",r={base:"https://basescan.org",ethereum:"https://etherscan.io",arbitrum:"https://arbiscan.io",optimism:"https://optimistic.etherscan.io",polygon:"https://polygonscan.com",celo:"https://celoscan.io"},a=r[t]||r.base;return"".concat(a,"/tx/").concat(e)}let l={transfer:{executing:(e,t)=>"transferring ".concat(e," ").concat(t,"..."),confirmed:(e,t,r)=>"transferred ".concat(e," ").concat(t," to ").concat(r.slice(0,8),"...").concat(r.slice(-6)),failed:"transfer failed",insufficientBalance:(e,t,r)=>"insufficient ".concat(r," balance. have ").concat(e,", need ").concat(t)},swap:{executing:(e,t,r)=>"swapping ".concat(e," ").concat(t," for ").concat(r,"..."),confirmed:(e,t,r,a)=>"swapped ".concat(e," ").concat(t," for ").concat(r," ").concat(a),failed:"swap failed"},tba:{deploying:"deploying agent account...",deployed:"agent account deployed",failed:"agent deployment failed"}}},84742:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var a=r(95155),o=r(56180),n=r(34961);let s={base:"base",arbitrum:"arbitrum",celo:"celo",ethereum:"ethereum",optimism:"optimism",polygon:"polygon"};function c(e){let{selectedChain:t,onChainChange:r,variant:c="default",className:l="",disabled:i=!1,showLabel:d=!1,label:u="network"}=e,h=Object.entries(o.ex);if("minimal"===c)return(0,a.jsxs)("div",{className:"flex items-center gap-2 ".concat(l),children:[d&&(0,a.jsx)("span",{className:"text-muted text-mono-xs",children:u}),(0,a.jsx)("select",{value:t,onChange:e=>r(e.target.value),disabled:i,className:"bg-gray-900/30 rounded-lg px-3 py-1.5 text-white text-mono-xs hover:bg-gray-800/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed border-0 focus:outline-none focus:ring-0",children:h.map(e=>{let[t,r]=e;return(0,a.jsx)("option",{value:t,className:"bg-black",children:s[t]||t},t)})})]});if("dropdown"===c)return(0,a.jsxs)("div",{className:"".concat(l),children:[d&&(0,a.jsx)("div",{className:"text-muted mb-2 text-mono-xs",children:u}),(0,a.jsxs)("select",{value:t,onChange:e=>r(e.target.value),disabled:i,className:"w-full bg-black border border-white/20 text-white px-2 py-1 text-mono-xs hover:border-white/40 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[h.map(e=>{let[t,r]=e;return(0,a.jsx)("option",{value:t,className:"bg-black",children:s[t]||t},t)}),(0,a.jsx)("option",{disabled:!0,value:"",className:"bg-black text-gray-500",children:"more chains coming soon"})]})]});if("indicator"===c){Object.entries(o.Bt);let e=Object.entries(o.ex).filter(e=>{let[t]=e;return!o.Bt.hasOwnProperty(t)});return(0,a.jsxs)("div",{className:"".concat(l),children:[d&&(0,a.jsx)("div",{className:"text-muted mb-2 text-mono-xs",children:u}),(0,a.jsxs)("select",{value:t,onChange:e=>{e.target.value=t},className:"w-full bg-black border border-white/20 text-white px-2 py-1 text-mono-xs hover:border-white/40 transition-colors cursor-pointer",children:[(0,a.jsxs)("option",{value:t,className:"bg-black",children:[s[t]||t," (active)"]}),e.length>0&&(0,a.jsx)("optgroup",{label:"coming soon",className:"bg-black text-gray-500",children:e.map(e=>{let[t]=e;return(0,a.jsx)("option",{value:t,disabled:!0,className:"bg-black text-gray-500",children:s[t]||t},t)})})]})]})}return(0,a.jsxs)("div",{className:"".concat(l),children:[d&&(0,a.jsx)("div",{className:"text-muted mb-2 text-mono-sm",children:u}),(0,a.jsxs)(n.l6,{value:t,onValueChange:r,children:[(0,a.jsx)(n.bq,{className:"bg-black border-white/20 text-white hover:border-white/40 disabled:opacity-50 disabled:cursor-not-allowed",disabled:i,children:(0,a.jsx)(n.yv,{placeholder:"select chain"})}),(0,a.jsx)(n.gC,{className:"bg-black border-gray-800",children:h.map(e=>{let[t,r]=e;return(0,a.jsx)(n.eb,{value:t,className:"text-white hover:bg-gray-800 focus:bg-gray-800 cursor-pointer",children:s[t]||t},t)})})]})]})}},87893:(e,t,r)=>{"use strict";r.d(t,{IR:()=>l,Ui:()=>u,aF:()=>d});var a=r(21610),o=r(97175),n=r(38091),s=r(56180);async function c(e,t){let r=s.Bt[t];if(!r)throw Error("Chain ".concat(t," not supported"));await e.switchChain(r.id);let n=await e.getEthereumProvider(),c=(0,a.F)({account:e.address,chain:r,transport:(0,o.I)(n)});return{address:e.address,chainKey:t,walletClient:c}}async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base";return(await c(e,t)).walletClient}async function i(e,t){let r=s.Bt[t];if(!r)throw Error("Chain ".concat(t," not supported"));let a=await l(e,t);return new n.TokenboundClient({walletClient:a,chainId:r.id})}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base";return await i(e,t)}function u(e){return e.address}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.