import{r as o,j as n}from"./@radix-C7hRs6Kx.js";import{m as i,o as u,F as d,p as m}from"./index-D2iSHVZq.js";import{b as p}from"./@tanstack-CSxjHCME.js";const l=o.forwardRef(({className:e,...t},r)=>n.jsx("label",{ref:r,...t,className:i("flex w-full items-center gap-2 space-x-2 rounded-md border border-theme-border-moderate p-4 font-semibold transition-shadow duration-150 hover:cursor-pointer hover:shadow-sm data-[state=selected]:border-theme-surface-strong",e)}));l.displayName="RadioItemLabel";const f=o.forwardRef(({className:e,type:t,...r},a)=>n.jsx("input",{type:"radio",ref:a,...r,className:i("h-3 w-3 border !border-theme-border-bold text-theme-surface-primary focus:ring-2 focus:ring-theme-surface-strong",e)}));f.displayName="RadioItem";function x(e){return new Promise(t=>setTimeout(t,e))}async function h({workspaceId:e,payload:t}){const r=u(m.workspaces.stacks(e)),a=await fetch(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){const c=await a.json().then(s=>Array.isArray(s.detail)?s.detail[1]:s.detail).catch(()=>"Error while creating new stack");throw new d({status:a.status,statusText:a.statusText,message:c})}return a.json()}function g(e){return p({...e,mutationFn:async({workspaceId:t,payload:r})=>h({workspaceId:t,payload:r})})}export{l as R,f as a,x as s,g as u};
