1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8841],{8841:function(e,t,n){n.d(t,{G:function(){return d},Z:function(){return u}});var a=n(7437),o=n(2265),r=n(2617),i=n(9376),c=n(9412),s=n(7365);let l=/(?:CLAWDBOT|OPENCLAW)_GATEWAY_TOKEN=([a-fA-F0-9]{64})/;function d(e){return JSON.parse(localStorage.getItem("openclaw-names")||"{}")[e]||null}function u(){let e=(0,i.useRouter)(),[t,n]=(0,o.useState)("idle"),[d,u]=(0,o.useState)(""),[p,m]=(0,o.useState)(""),[y,g]=(0,o.useState)(null),h=(0,o.useRef)(null),{provider:f,apiKeys:w,setProvider:_,hydrate:b}=(0,s.D)();(0,o.useEffect)(()=>{b(),u((0,c.x)())},[b]);let v=(0,o.useCallback)(()=>{h.current&&(clearInterval(h.current),h.current=null)},[]),x=(0,o.useCallback)(async()=>{v(),n("deploying"),g(null);let t=d.trim()||(0,c.x)();m('Deploying "'.concat(t,'"...'));try{let a={provider:f},o=w[f];o&&(a.apiKey=o);let i=await r.hi.deployOpenClaw(a),c=i.instanceName||i.instance_name||i.name,s=i.gatewayToken||null;if(!function(e,t){let n=JSON.parse(localStorage.getItem("openclaw-names")||"{}");n[e]=t,localStorage.setItem("openclaw-names",JSON.stringify(n))}(c,t),s&&c)try{localStorage.setItem("openclaw-token-".concat(c),s)}catch(e){}n("polling"),m('Starting "'.concat(t,'"...'));let d=0;h.current=setInterval(async()=>{if(++d>120){v(),n("error"),g("Deployment timed out after 10 minutes.");return}try{var a,o,i,u;let d=await r.hi.getDeployment(c),p=d.state||d.status,y=null!==(i=null===(a=d.replicas)||void 0===a?void 0:a.desired)&&void 0!==i?i:0,h=null!==(u=null===(o=d.replicas)||void 0===o?void 0:o.ready)&&void 0!==u?u:0;if("Failed"===p)v(),n("error"),g("Deployment failed: ".concat(d.message||"Unknown error"));else if(("Active"===p||"Ready"===p)&&h>=y&&y>0){v();let t=s?"/openclaw/chat/".concat(c,"?token=").concat(s):"/openclaw/chat/".concat(c);e.push(t)}else if(m('Starting "'.concat(t,'"...')),!s&&!localStorage.getItem("openclaw-token-".concat(c)))try{let e=await r.hi.getDeploymentLogs(c,50),t=("string"==typeof e?e:(null==e?void 0:e.logs)||"").match(l);t&&localStorage.setItem("openclaw-token-".concat(c),t[1])}catch(e){}}catch(e){}},5e3)}catch(e){n("error"),g(e.message)}},[v,e,d,f,w]),D=["deploying","polling"].includes(t);return s.a.find(e=>e.id===f)||s.a[0],(0,a.jsxs)("div",{className:"rounded-xl border border-oc-border bg-oc-surface p-4 md:p-6",children:[(0,a.jsx)("h3",{className:"font-aeonik text-xs uppercase tracking-[0.1em] text-oc-muted md:text-[1.1rem]",children:"Deploy OpenClaw"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-oc-muted md:text-[1.4rem] md:leading-1.3",children:"One-click deploy an OpenClaw gateway instance. Runs on Basilica GPU cloud, billed from your credit balance."}),(0,a.jsxs)("div",{className:"mt-4 md:mt-5",children:["idle"===t&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"deploy-name",className:"mb-1 block text-xs text-oc-muted",children:"Deployment name"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{id:"deploy-name",type:"text",value:d,onChange:e=>u(e.target.value),placeholder:"my-openclaw",className:"flex-1 rounded-lg border border-oc-border bg-oc-input-bg px-4 py-3 text-sm text-oc-primary outline-none placeholder:text-oc-muted focus:border-red-light focus:ring-2 focus:ring-red-light/30"}),(0,a.jsx)("button",{onClick:()=>u((0,c.x)()),"aria-label":"Generate random name",title:"Generate random name",className:"rounded-lg border border-oc-border px-3 py-3 text-oc-muted transition-colors hover:border-oc-primary hover:text-oc-primary",children:(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182M2.985 19.644l3.181-3.182"})})})]})]}),(0,a.jsx)("button",{onClick:x,className:"w-full rounded-lg bg-red-light px-6 py-3 text-sm font-medium text-white-0 transition-all duration-200 hover:bg-red-dark active:scale-[0.98] md:w-fit md:px-8 md:py-4 md:text-[1.5rem]",children:"Deploy OpenClaw"})]}),D&&(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-oc-muted border-t-red-light"}),(0,a.jsx)("p",{className:"text-sm text-oc-primary md:text-[1.4rem]",children:p})]}),"error"===t&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-red-light md:text-[1.4rem]",children:y}),(0,a.jsx)("button",{onClick:()=>{n("idle"),g(null),u((0,c.x)())}
1,className:"w-fit rounded-lg border border-oc-border px-5 py-2.5 text-sm text-oc-secondary transition-all duration-200 hover:border-oc-primary md:px-6 md:py-3 md:text-[1.3rem]",children:"Try Again"})]})]})]})}},2617:function(e,t,n){n.d(t,{g8:function(){return c},hi:function(){return m}});var a=n(9818),o=n(6800);let r=null,i=null;function c(e,t){o.vD||(r=e,i=(null==t?void 0:t.onAuthError)||null)}async function s(){if(!r)return console.warn("[api] No token getter initialized â request will be unauthenticated"),{};for(let e=0;e<2;e++)try{let t=await r();if(!t){if(console.warn("[api] Token getter returned empty token (attempt ".concat(e+1,")")),0===e){await new Promise(e=>setTimeout(e,1e3));continue}break}console.debug("[api] Token obtained: ".concat(t.slice(0,10),"...").concat(t.slice(-6)," (").concat(t.length," chars)"));try{let e=JSON.parse(atob(t.split(".")[1]));console.debug("[api] Token claims:",{iss:e.iss,aud:e.aud,sub:e.sub,exp:new Date(1e3*e.exp).toISOString(),scope:e.scope});let n=1e3*e.exp-Date.now();n<6e4&&console.warn("[api] Token expires in ".concat(Math.round(n/1e3),"s â may fail mid-request"))}catch(e){}return{Authorization:"Bearer ".concat(t)}}catch(t){console.error("[api] Failed to get access token (attempt ".concat(e+1,"):"),t.message||t),0===e&&await new Promise(e=>setTimeout(e,1e3))}if(console.error("[api] Token fetch failed after retries â triggering auth error callback"),i)try{i()}catch(e){}return{}}class l extends Error{constructor(e,t){super(t),this.status=e}}async function d(e){if(!e.ok){let t=await e.text().catch(()=>"");if(401===e.status&&i)try{i()}catch(e){}throw new l(e.status,function(e,t){if(401===e)return"Session expired â please sign in again.";if(403===e)return"You don't have permission for this action.";if(502===e||503===e)return"Service temporarily unavailable. Please try again.";try{var n;let e=JSON.parse(t);return(null==e?void 0:null===(n=e.error)||void 0===n?void 0:n.message)||(null==e?void 0:e.message)||(null==e?void 0:e.error)||t}catch(n){return t||"Request failed (".concat(e,")")}}(e.status,t))}return 204===e.status?null:(e.headers.get("content-type")||"").includes("application/json")?e.json():e.text()}async function u(e,t,n,o){let r={"Content-Type":"application/json",...await s(),...o||{}},i="".concat(a.C).concat(t);return d(await fetch(i,{method:e,headers:r,...n?{body:JSON.stringify(n)}:{}}))}async function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={"Content-Type":"application/json",...await s()};return d(await fetch("/api/openclaw/deploy",{method:"POST",headers:t,body:JSON.stringify(e)}))}let m=o.vD?o.yD:{get:e=>u("GET",e),post:(e,t)=>u("POST",e,t),delete:e=>u("DELETE",e),getBalance:()=>u("GET","/billing/balance"),getDepositAccount:()=>u("GET","/payments/deposit-account"),createDepositAccount:()=>u("POST","/payments/deposit-account"),listDeposits:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return u("GET","/payments/deposits?limit=".concat(e,"&offset=").concat(t))},createCardPurchase:(e,t)=>u("POST","/card-payments/purchases",{amount_cents:e},{"Idempotency-Key":t}),getCardPurchase:e=>u("GET","/card-payments/purchases/".concat(e)),listCardPurchases:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return u("GET","/card-payments/purchases?limit=".concat(e,"&offset=").concat(t))},listDeployments:()=>u("GET","/deployments"),getDeployment:e=>u("GET","/deployments/".concat(e)),createDeployment:e=>u("POST","/deployments",e),deployOpenClaw:p,deleteDeployment:e=>u("DELETE","/deployments/".concat(e)),restartDeployment:e=>u("POST","/deployments/".concat(encodeURIComponent(e),"/restart"),{}),getDeploymentLogs:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return u("GET","/deployments/".concat(e,"/logs?tail=").concat(t))},getDeploymentEvents:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return u("GET","/deployments/".concat(encodeURIComponent(e),"/events?limit=").concat(t))},getDeploymentEnvVar:(e,t)=>
1u("GET","/deployments/".concat(encodeURIComponent(e),"/env/").concat(encodeURIComponent(t))),createShareToken:e=>u("POST","/deployments/".concat(e,"/share-token")),getShareToken:e=>u("GET","/deployments/".concat(e,"/share-token"))}},9818:function(e,t,n){n.d(t,{C:function(){return o},y:function(){return a}});let a={domain:"auth.basilica.ai",clientId:"KXOhOXiQiLdD3JUfHWesdlNqBlXBDQ0E",audience:"https://api.basilica.ai/",redirectUri:"".concat(window.location.origin,"/openclaw")},o="https://api.basilica.ai"},9412:function(e,t,n){n.d(t,{x:function(){return r}});let a=["feisty","mighty","sneaky","brave","swift","clever","fierce","gentle","grumpy","happy","jolly","lucky","noble","plucky","quirky","rusty","salty","sandy","shiny","snappy","spicy","stormy","sunny","tiny","wild","bold","cosmic","daring","electric","frosty","golden","hidden","iron","jade","keen","lunar","mystic","neon","obsidian","phantom"],o=["crab","hermit","pincer","claw","shell","reef","coral","tide","wave","shore","kelp","pearl","barnacle","lobster","shrimp","mantis","spider","king","ghost","fiddler","coconut","horseshoe","samurai","ninja","pirate","sentinel","guardian","voyager","drifter","crawler","snapper","crusher","digger","scuttler","brawler","raider","scout","ranger","warden","titan"];function r(){let e=a[Math.floor(Math.random()*a.length)],t=o[Math.floor(Math.random()*o.length)],n=Math.floor(65535*Math.random()).toString(16).padStart(4,"0");return"".concat(e,"-").concat(t,"-").concat(n)}},6800:function(e,t,n){n.d(t,{nI:function(){return o},vD:function(){return a},yD:function(){return p}});let a=!1,o={sub:"mock|12345",email:"[email protected]",name:"Dev User",picture:null,email_verified:!0},r="https://3848afa7-4e7e-441d-9d76-d1c0d39acf34.deployments.basilica.ai",i=[{instance_name:"openclaw-3848afa7",image:"ghcr.io/one-covenant/basilica-openclaw:latest",state:"Ready",public_url:r,replicas:1,port:18789,created_at:new Date(Date.now()-36e5).toISOString()},{instance_name:"openclaw-e5f6g7h8",image:"ghcr.io/one-covenant/basilica-openclaw:latest",state:"Pending",public_url:null,replicas:1,port:18789,created_at:new Date(Date.now()-6e4).toISOString()}],c=[{block_number:4821039,event_index:2,from_address:"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",to_address:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",amount_tao:"2.500000000",status:"credited",observed_at:new Date(Date.now()-864e5).toISOString()},{block_number:4821102,event_index:0,from_address:"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",to_address:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",amount_tao:"1.000000000",status:"finalized",observed_at:new Date(Date.now()-36e5).toISOString()},{block_number:4821200,event_index:1,from_address:"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",to_address:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",amount_tao:"0.500000000",status:"pending",observed_at:new Date(Date.now()-3e5).toISOString()}],s=[{id:"cs_test_mock_completed_1",status:"completed",requested_amount_cents:2500,paid_amount_cents:2500,checkout_url:"",receipt_url:"https://pay.stripe.com/receipts/mock-1",hosted_invoice_url:null,invoice_pdf:null,created_at:new Date(Date.now()-864e5).toISOString(),completed_at:new Date(Date.now()-863e5).toISOString(),expires_at:null},{id:"cs_test_mock_pending_1",status:"pending",requested_amount_cents:1e3,paid_amount_cents:null,checkout_url:"/checkout/success?session_id=cs_test_mock_pending_1&mock=1",receipt_url:null,hosted_invoice_url:null,invoice_pdf:null,created_at:new Date(Date.now()-12e4).toISOString(),completed_at:null,expires_at:new Date(Date.now()+168e4).toISOString()}],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return new Promise(t=>setTimeout(t,e))},d=[...i],u=[...s],p={get:async()=>(await l(),{}),post:async()=>(await l(),{}),delete:async()=>(await l(),null),getBalance:async()=>(await l(),{balance:"123.45",last_updated:new Date().toISOString()}),getDepositAccount:async()=>(await l(),{user_id:o.sub,address:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",exists:!0}),createDepositAccount:async()=>(await l(),{user_id:o.sub,address:"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"}),listDeposits:async()=>(await l(),{deposits:c,total_count:c.length}),createCardPurchase:async e=>{await l(500);let t="cs_test_mock_".concat(Date.now().toString(36)),n={id:t,checkout_url:"/checkout/success?session_id=".concat(t,"&mock=1"),requested_amount_cents:e,status:"pending"};return u=[{id:t,status:"pending",requested_amount_cents:e,paid_amount_cents:null,checkout_url:n.checkout_url,receipt_url:null,hosted_invoice_url:null,invoice_pdf:null,created_at:new Date().toISOString(),completed_at:null,expires_at:new Date(Date.now()+18e5).toISOString()},...u],n},getCardPurchase:async e=>(await l(),u.find(t=>
1t.id===e)||null),listCardPurchases:async()=>(await l(),{purchases:u}),listDeployments:async()=>(await l(),{deployments:d}),getDeployment:async e=>(await l(),d.find(t=>t.instance_name===e)||{instance_name:e,state:"Ready",public_url:r,replicas:1,port:18789}),createDeployment:async e=>{await l(800);let t={instance_name:e.instanceName||"openclaw-".concat(Date.now().toString(36)),image:e.image||"ghcr.io/one-covenant/basilica-openclaw:latest",state:"Ready",public_url:r,replicas:1,port:e.port||18789,created_at:new Date().toISOString()};return d=[t,...d],t},deployOpenClaw:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await l(800);let t=e.name||"openclaw-".concat(Date.now().toString(36)),n=e.provider||"minimax";console.debug("[mock] deployOpenClaw: provider=".concat(n,", hasApiKey=").concat(!!e.apiKey));let a={instance_name:t,image:"ghcr.io/one-covenant/basilica-openclaw:latest",state:"Ready",public_url:r,replicas:1,port:18789,created_at:new Date().toISOString()};return d=[a,...d],a},deleteDeployment:async e=>(await l(),d=d.filter(t=>t.instance_name!==e),null),restartDeployment:async e=>(await l(600),d.find(t=>t.instance_name===e)||{instance_name:e,state:"Ready"}),getDeploymentLogs:async()=>(await l(),"[2026-02-12T10:00:00Z] Starting OpenClaw gateway...\n[2026-02-12T10:00:01Z] Loading model configuration...\n[2026-02-12T10:00:02Z] OPENCLAW_GATEWAY_TOKEN=".concat("0ed7a05ce13b38cbf48a83cb579d8e50b8f2543c76f9a4b194b46387373c15e7","\n[2026-02-12T10:00:03Z] Gateway ready on port 18789"))}},7365:function(e,t,n){n.d(t,{D:function(){return c},a:function(){return o}});var a=n(3011);let o=[{id:"minimax",label:"MiniMax M2.5",model:"MiniMax-M2.5"},{id:"moonshot",label:"Kimi K2.5",model:"kimi-k2.5"},{id:"openai",label:"OpenAI",model:"gpt-5.2-pro"},{id:"anthropic",label:"Anthropic",model:"claude-opus-4-1-20250805"}],r="openclaw-provider-settings";function i(e){try{localStorage.setItem(r,JSON.stringify({provider:e.provider,apiKeys:e.apiKeys}))}catch(e){}}let c=(0,a.U)((e,t)=>({provider:"minimax",apiKeys:{openai:"",anthropic:"",minimax:"",moonshot:""},setProvider:n=>{e({provider:n}),i(t())},setApiKey:(n,a)=>{e(e=>({apiKeys:{...e.apiKeys,[n]:a}})),i(t())},hydrate:()=>{let n=function(){try{let e=localStorage.getItem(r);return e?JSON.parse(e):{}}catch(e){return{}}}();(n.provider||n.apiKeys)&&e({...n.provider?{provider:n.provider}:{},...n.apiKeys?{apiKeys:{...t().apiKeys,...n.apiKeys}}:{}})}}))}}]);
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.