1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2732],{10005:(e,r,t)=>{"use strict";t.d(r,{_:()=>s});var n=t(88604),a=t(63916),i=t(40459);let s=(0,n.w)({shared:{NODE_ENV:a.k5(["development","production","test"]).default("development")},server:{CLERK_SECRET_KEY:a.Yj()},client:{NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:a.Yj(),NEXT_PUBLIC_API_URL:a.Yj().url(),NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY:a.Yj().optional()},experimental__runtimeEnv:{NODE_ENV:"production",NEXT_PUBLIC_API_URL:"https://api.flowser.ai",NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:"pk_live_Y2xlcmsuZmxvd3Nlci5haSQ",NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY:"pk_live_51RfegLIeOImcBhu665BDKA7OPiqJSpga76VcqGBb42WJ8bSBkfNbwAkm4f6vfRf8qQrSTWIJH2YP70mGW2u2nBiW00jpUuOFE1"},skipValidation:!!i.env.CI||"lint"===i.env.npm_lifecycle_event})},11946:(e,r,t)=>{Promise.resolve().then(t.bind(t,34473))},21649:(e,r,t)=>{"use strict";t.d(r,{$:()=>u,r:()=>o});var n=t(54568),a=t(7620),i=t(54616),s=t(46118),l=t(89355);let o=(0,i.F)("focus-visible:ring-ring focus-visible:ring-offset-background inline-flex cursor-pointer items-center justify-center gap-2 text-sm font-semibold whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-[8px] border-transparent",destructive:"bg-destructive text-destructive-foreground rounded-[8px] border-transparent",outline:"text-foreground border-border hover:border-border-strong rounded-[8px] border bg-transparent",secondary:"bg-secondary text-secondary-foreground rounded-[8px] border-transparent",ghost:"text-foreground hover:bg-hover-surface rounded-[8px] border-transparent bg-transparent",link:"text-primary border-transparent underline-offset-4 hover:underline",cta:"btn-cta rounded-lg border-transparent",ink:"btn-ink rounded-lg border-transparent text-white"},size:{sm:"h-9 rounded-[8px] px-3",md:"h-10 px-4 py-2",lg:"h-11 rounded-[8px] px-8",icon:"size-10",none:""}},defaultVariants:{variant:"primary",size:"md"}}),u=a.forwardRef((e,r)=>{let{className:t,variant:a,size:i,asChild:u=!1,...d}=e,c=u?s.DX:"button";return(0,n.jsx)(c,{className:(0,l.cn)(o({variant:a,size:i,className:t})),ref:r,...d})});u.displayName="Button"},27541:(e,r,t)=>{"use strict";var n=t(43041);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}}),t.o(n,"useSelectedLayoutSegments")&&t.d(r,{useSelectedLayoutSegments:function(){return n.useSelectedLayoutSegments}})},32064:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});let n=(0,t(92068).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},34473:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var n=t(54568),a=t(27541),i=t(27736),s=t(21649),l=t(32064),o=t(46479);function u(){let{instanceId:e}=(0,a.useParams)(),r=(0,o.n6)(),{data:t,isLoading:u}=(0,i.I)(r.flowser.instances.get.queryOptions({instanceId:e}));if((0,i.I)({...r.flowser.chat.getGatewayToken.queryOptions({instanceId:e}),enabled:(null==t?void 0:t.status)==="RUNNING"&&!!t.gatewayUrl}),u)return(0,n.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading..."})});if(!(null==t?void 0:t.gatewayUrl)||"RUNNING"!==t.status)return(0,n.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed py-20 text-center",children:(0,n.jsx)("p",{className:"text-muted-foreground",children:"Instance is not running. Start it to access the dashboard."})});let d="".concat(t.gatewayUrl,"/");return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-6 py-20",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,n.jsx)("h3",{className:"text-lg font-medium",children:"OpenClaw Control UI"}),(0,n.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:"OpenClaw includes a built-in dashboard for monitoring agents, sessions, tools, and configuration. Click below to open it â authentication is handled automatically."})]}),(0,n.jsx)(s.$,{asChild:!0,size:"lg",className:"gap-2",children:(0,n.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:[(0,n.jsx)(l.A,{className:"h-4 w-4"}),"Open Dashboard"]})})]})}},46118:(e,r,t)=>{"use strict";t.d(r,{DX:()=>l,Dc:()=>u,TL:()=>s});var n=t(7620),a=t(61715),i=t(54568);function s(e){let r=function(e){let r=n.forwardRef((e,r)=>{let{children:t,...i}=e;if(n.isValidElement(t)){var s;let e,l,o=(s=t,(l=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.
1isReactWarning)?s.ref:(l=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),u=function(e,r){let t={...r};for(let n in r){let a=e[n],i=r[n];/^on[A-Z]/.test(n)?a&&i?t[n]=(...e)=>{let r=i(...e);return a(...e),r}:a&&(t[n]=a):"style"===n?t[n]={...a,...i}:"className"===n&&(t[n]=[a,i].filter(Boolean).join(" "))}return{...e,...t}}(i,t.props);return t.type!==n.Fragment&&(u.ref=r?(0,a.t)(r,o):o),n.cloneElement(t,u)}return n.Children.count(t)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}(e),t=n.forwardRef((e,t)=>{let{children:a,...s}=e,l=n.Children.toArray(a),o=l.find(d);if(o){let e=o.props.children,a=l.map(r=>r!==o?r:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,i.jsx)(r,{...s,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,a):null})}return(0,i.jsx)(r,{...s,ref:t,children:a})});return t.displayName=`${e}.Slot`,t}var l=s("Slot"),o=Symbol("radix.slottable");function u(e){let r=({children:e})=>(0,i.jsx)(i.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=o,r}function d(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===o}},46479:(e,r,t)=>{"use strict";let n,a;t.d(r,{oU:()=>b,sr:()=>E,Ty:()=>y,n6:()=>g,_K:()=>_});var i=t(54568),s=t(7620),l=t(50505),o=t(4869),u=t(78784),d=t(62542),c=t(79409),f=t(10005);async function p(e,r){let{timeout:t=1e4,interval:n=200}=null!=r?r:{},a=Date.now();for(;Date.now()-a<t;)try{return await Promise.resolve(e())}catch(e){await new Promise(e=>setTimeout(e,n))}throw Error("Operation timed out")}var m=t(52386);let h=function(){let e,r=!1;return async()=>{if(void 0!==e&&!0===r){var t,n;return null!=(n=await (null==(t=e.session)?void 0:t.getToken()))?n:null}return p(async()=>{var t,n,a,i;if(void 0===(e=window.Clerk))throw Error("throwing for retry");if(!0===r)return null!=(n=await (null==(t=e.session)?void 0:t.getToken()))?n:null;let s=e.status;return"ready"===s||"degraded"===s?(r=!0,null!=(i=await (null==(a=e.session)?void 0:a.getToken()))?i:null):await new Promise((t,n)=>{let a=setTimeout(()=>{i(),n(Error("Clerk session loading timed out"))},2e4);function i(){null==e||e.off("status",s),clearTimeout(a)}function s(a){if("error"===a&&(n(Error("Clerk session error")),i()),"ready"===a||"degraded"===a){var s,l;r=!0,t(null!=(l=null==e||null==(s=e.session)?void 0:s.getToken())?l:null),i()}}null==e||e.on("status",s)})},{timeout:1/0})}}(),{useTRPC:g,TRPCProvider:v}=(0,d.dW)(),y=()=>null!=n?n:n=(0,u.XT)({links:[(0,u.$H)({enabled:e=>"development"===f._.NODE_ENV||"down"===e.direction&&e.result instanceof Error}),(0,u.N9)({transformer:c.Ay,url:f._.NEXT_PUBLIC_API_URL+"/api/trpc",async headers(){let e=new Headers;e.set("x-trpc-source","flowser-react");let r=await h();return null!==r&&e.set("Authorization","Bearer ".concat(r)),e}})]}),x=(0,s.createContext)(null);function w(e){return(0,i.jsx)(x.Provider,{value:e.client,children:e.children})}function _(){let e=(0,s.useContext)(x);if(null===e)throw Error("useTrpcClient must be used within a TRPCClientProvider");return e}function b(){let{organization:e}=(0,l.Z5)(),r=(0,o.jE)(),t=null==e?void 0:e.id,n=(0,s.useRef)(t),a=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{if(a.current){a.current=!1,n.current=t;return}n.current!==t&&(n.current=t,r.invalidateQueries())},[t,r]),null}function E(e){let r=null!=a?a:a=(0,m.U)(),[t]=(0,s.useState)(()=>y());return(0,i.jsx)(o.Ht,{client:r,children:(0,i.jsx)(w,{client:t,children:(0,i.jsx)(v,{trpcClient:t,queryClient:r,children:e.children})})})}},52386:(e,r,t)=>{"use strict";t.d(r,{U:()=>s});var n=t(29292),a=t(84557),i=t(79409);let s=()=>new n.E({defaultOptions:{queries:{staleTime:3e4},dehydrate:{serializeData:i.Ay.serialize,shouldDehydrateQuery:e=>(0,a.XS)(e)||"pending"===e.state.status,shouldRedactErrors:()=>!1},hydrate:{deserializeData:i.Ay.deserialize}}})},61715:(e,r,t)=>{"use strict";t.d(r,{s:()=>s,t:()=>i});var n=t(7620);function a(e,r){if("function"==typeof e)return e(r);null!=e&&(e.current=r)}function i(...e){return r=>{let t=!1,n=e.map(e=>{let n=a(e,r);return t||"function"!=typeof n||(t=!0),n});if(t)return()=>{for(let r=0;r<n.length;r++){let t=n[r];"function"==typeof t?t():a(e[r],null)}}}}function s(...e){return n.useCallback(i(...e),e)}},89355:(e,r,t)=>{"use strict";t.d(r,{cn:()=>i});var n=t(54616),a=t(13714);let i=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,a.QP)((0,n.cx)(r))}},92068:(e,r,t)=>{"use strict";t.d(r,{A:()=>
1o});var n=t(7620);let a=e=>{let r=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase());return r.charAt(0).toUpperCase()+r.slice(1)},i=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()};var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)((e,r)=>{let{color:t="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:u="",children:d,iconNode:c,...f}=e;return(0,n.createElement)("svg",{ref:r,...s,width:a,height:a,stroke:t,strokeWidth:o?24*Number(l)/Number(a):l,className:i("lucide",u),...!d&&!(e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0})(f)&&{"aria-hidden":"true"},...f},[...c.map(e=>{let[r,t]=e;return(0,n.createElement)(r,t)}),...Array.isArray(d)?d:[d]])}),o=(e,r)=>{let t=(0,n.forwardRef)((t,s)=>{let{className:o,...u}=t;return(0,n.createElement)(l,{ref:s,iconNode:r,className:i("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...u})});return t.displayName=a(e),t}}},e=>{e.O(0,[505,4353,6407,7736,587,8274,7358],()=>e(e.s=11946)),_N_E=e.O()}]);
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.