@shepai/cli 1.145.0-pr452.ae7b9df → 1.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
- package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_5b89327c._.js → _f0507de3._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5b89327c._.js.map → _f0507de3._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_c480d290._.js → _f3428a54._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_c480d290._.js.map → _f3428a54._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
- package/web/.next/server/chunks/ssr/_f39a1adb._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_3f392ed3._.js +3 -0
- package/web/.next/server/chunks/ssr/{src_presentation_web_36d135cd._.js.map → src_presentation_web_3f392ed3._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +44 -44
- package/web/.next/static/chunks/00c975ddd2b87528.js +1 -0
- package/web/.next/static/chunks/{9f1367bf0f603996.js → 0ead3bd3449a6efe.js} +1 -1
- package/web/.next/static/chunks/{f0d47ebee8ca8bc3.js → 5afa709c97ad44c3.js} +1 -1
- package/web/.next/static/chunks/{9940f68284ee180e.js → 64a97bd60c175b9e.js} +1 -1
- package/web/.next/static/chunks/6dad9c4718b9ef1c.js +1 -0
- package/web/.next/static/chunks/{e7744ffb13a4a677.js → 7558964bf146f27c.js} +1 -1
- package/web/.next/static/chunks/{412d6a39406dcc01.js → 86bc398562d84b1d.js} +1 -1
- package/web/.next/static/chunks/{af3b565e34bea1e8.js → 8ff013b5490a9111.js} +1 -1
- package/web/.next/static/chunks/{66dbc5a3e4f9a938.js → 96fb06a2ff46e152.js} +1 -1
- package/web/.next/static/chunks/b3ee28e6d690043f.js +2 -0
- package/web/.next/static/chunks/bb466ffb8a013811.js +1 -0
- package/web/.next/static/chunks/d8364c7cbc1a8432.js +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_36d135cd._.js +0 -3
- package/web/.next/static/chunks/2f69a2c8803b4d03.js +0 -1
- package/web/.next/static/chunks/4887b859bc457552.js +0 -2
- package/web/.next/static/chunks/4f0adb1f7fe668dc.js +0 -1
- package/web/.next/static/chunks/62b396454129b531.js +0 -1
- package/web/.next/static/chunks/b190938cb5fd9b35.js +0 -1
- /package/web/.next/static/{myvK7Q1DabrQLkyfNQtH1 → i_fav2t7dzinMjPL3vmUY}/_buildManifest.js +0 -0
- /package/web/.next/static/{myvK7Q1DabrQLkyfNQtH1 → i_fav2t7dzinMjPL3vmUY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{myvK7Q1DabrQLkyfNQtH1 → i_fav2t7dzinMjPL3vmUY}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},68304,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(91967),i=e.i(22528),o=e.i(51080),a=e.i(85995),s=e.i(87620),l=e.i(66033),u=e.i(36589),c=e.i(13123),d="Tabs",[f,p]=(0,i.createContextScope)(d,[o.createRovingFocusGroupScope]),h=(0,o.createRovingFocusGroupScope)(),[y,m]=f(d),g=r.forwardRef((e,r)=>{let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:a,orientation:f="horizontal",dir:p,activationMode:h="automatic",...m}=e,g=(0,l.useDirection)(p),[v,b]=(0,u.useControllableState)({prop:i,onChange:o,defaultProp:a??"",caller:d});return(0,t.jsx)(y,{scope:n,baseId:(0,c.useId)(),value:v,onValueChange:b,orientation:f,dir:g,activationMode:h,children:(0,t.jsx)(s.Primitive.div,{dir:g,"data-orientation":f,...m,ref:r})})});g.displayName=d;var v="TabsList",b=r.forwardRef((e,r)=>{let{__scopeTabs:n,loop:i=!0,...a}=e,l=m(v,n),u=h(n);return(0,t.jsx)(o.Root,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:i,children:(0,t.jsx)(s.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:r})})});b.displayName=v;var x="TabsTrigger",w=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:a,disabled:l=!1,...u}=e,c=m(x,i),d=h(i),f=C(c.baseId,a),p=S(c.baseId,a),y=a===c.value;return(0,t.jsx)(o.Item,{asChild:!0,...d,focusable:!l,active:y,children:(0,t.jsx)(s.Primitive.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":p,"data-state":y?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:f,...u,ref:r,onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(a)}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(a)}),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;y||l||!e||c.onValueChange(a)})})})});w.displayName=x;var k="TabsContent",j=r.forwardRef((e,n)=>{let{__scopeTabs:i,value:o,forceMount:l,children:u,...c}=e,d=m(k,i),f=C(d.baseId,o),p=S(d.baseId,o),h=o===d.value,y=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.Presence,{present:l||h,children:({present:r})=>(0,t.jsx)(s.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:p,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&u})})});function C(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}j.displayName=k,e.s(["Content",()=>j,"List",()=>b,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>j,"TabsList",()=>b,"TabsTrigger",()=>w,"Trigger",()=>w,"createTabsScope",()=>p],43133);var P=e.i(43133),P=P,R=e.i(31777);let E=P.Root,T=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.List,{ref:n,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...r}));T.displayName=P.List.displayName;let O=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.Trigger,{ref:n,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...r}));O.displayName=P.Trigger.displayName;let M=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.Content,{ref:n,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...r}));M.displayName=P.Content.displayName,e.s(["Tabs",()=>E,"TabsContent",()=>M,"TabsList",()=>T,"TabsTrigger",()=>O],68304)},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},32494,e=>{"use strict";let t=(0,e.i(3645).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>t],32494)},79687,e=>{"use strict";var t=e.i(14748);e.s(["AlertCircle",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n=(0,e.i(18354).createLogger)("[SSE]");function i(e,t,r,n){if("u"<typeof EventSource)return()=>{};let i=null,o=!1,a=1e3,s=null,l=null;return!function u(){o||(i=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),i.onopen=()=>{n("connected"),l=setTimeout(()=>{l=null,a=1e3},5e3)},i.onerror=()=>{i?.close(),i=null,n("disconnected"),null!==l&&(clearTimeout(l),l=null);let e=a;a=Math.min(2*e,3e4),s=setTimeout(()=>{s=null,u()},e)},i.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>{let t=[...e,n];return t.length>500?t.slice(-250):t}),r(n)}))}(),()=>{o=!0,null!==s&&(clearTimeout(s),s=null),null!==l&&(clearTimeout(l),l=null),i&&(i.close(),i=null)}}let o=(0,r.createContext)(null);function a({children:e,runId:a}){let{events:s,lastEvent:l,connectionStatus:u}=function(e){let[t,o]=(0,r.useState)([]),[a,s]=(0,r.useState)(null),[l,u]=(0,r.useState)("disconnected"),c=e?.runId,d=(0,r.useRef)(null),f=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;n.debug("event received:",e.eventType,e),o(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),s(e)}else"status"===t.type&&u(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return i(c,o,s,u);let t=!1,r={current:void 0};function n(e){t||(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}function a(){if(t)return;let e=navigator.serviceWorker.controller;e&&(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}return navigator.serviceWorker.addEventListener("message",f),navigator.serviceWorker.addEventListener("controllerchange",a),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let a=e.active??e.installing??e.waiting;if(!a){r.current=i(c,o,s,u);return}if("activated"===a.state)n(a);else{let e=()=>{"activated"===a.state&&(a.removeEventListener("statechange",e),n(a))};a.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=i(c,o,s,u))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",f),navigator.serviceWorker.removeEventListener("controllerchange",a),d.current?.postMessage({type:"unsubscribe"}),d.current=null,r.current?.()}},[c,f]),{events:t,lastEvent:a,connectionStatus:l}}({runId:a}),c=(0,r.useMemo)(()=>({events:s,lastEvent:l,connectionStatus:u}),[s,l,u]);return(0,t.jsx)(o.Provider,{value:c,children:e})}function s(){let e=(0,r.useContext)(o);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>a,"useAgentEventsContext",()=>s],39443)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},54277,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t],30090),e.s(["CircleX",()=>t],54277)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),n=e.i(87342),i=e.i(5978),o=e.i(22528),a=e.i(13123),s=e.i(87620),l=e.i(29297),u=e.i(36589),c=e.i(66033),d=e.i(20314),f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[y,m,g]=(0,n.createCollection)(h),[v,b]=(0,o.createContextScope)(h,[g]),[x,w]=v(h),k=t.forwardRef((e,t)=>(0,d.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(j,{...e,ref:t})})}));k.displayName=h;var j=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:o,orientation:a,loop:y=!1,dir:g,currentTabStopId:v,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:w,onEntryFocus:k,preventScrollOnEntryFocus:j=!1,...C}=e,S=t.useRef(null),P=(0,i.useComposedRefs)(n,S),E=(0,c.useDirection)(g),[T,O]=(0,u.useControllableState)({prop:v,defaultProp:b??null,onChange:w,caller:h}),[M,A]=t.useState(!1),_=(0,l.useCallbackRef)(k),F=m(o),L=t.useRef(!1),[I,N]=t.useState(0);return t.useEffect(()=>{let e=S.current;if(e)return e.addEventListener(f,_),()=>e.removeEventListener(f,_)},[_]),(0,d.jsx)(x,{scope:o,orientation:a,dir:E,loop:y,currentTabStopId:T,onItemFocus:t.useCallback(e=>O(e),[O]),onItemShiftTab:t.useCallback(()=>A(!0),[]),onFocusableItemAdd:t.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>N(e=>e-1),[]),children:(0,d.jsx)(s.Primitive.div,{tabIndex:M||0===I?-1:0,"data-orientation":a,...C,ref:P,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!M){let t=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===T),...e].filter(Boolean).map(e=>e.ref.current),j)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>A(!1))})})}),C="RovingFocusGroupItem",S=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:i,focusable:o=!0,active:l=!1,tabStopId:u,children:c,...f}=e,p=(0,a.useId)(),h=u||p,g=w(C,i),v=g.currentTabStopId===h,b=m(i),{onFocusableItemAdd:x,onFocusableItemRemove:k,currentTabStopId:j}=g;return t.useEffect(()=>{if(o)return x(),()=>k()},[o,x,k]),(0,d.jsx)(y.ItemSlot,{scope:i,id:h,focusable:o,active:l,children:(0,d.jsx)(s.Primitive.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{o?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let i=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return P[i]}(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&i.reverse();let o=i.indexOf(e.currentTarget);i=g.loop?(r=i,n=o+1,r.map((e,t)=>r[(n+t)%r.length])):i.slice(o+1)}setTimeout(()=>R(i))}}),children:"function"==typeof c?c({isCurrentTabStop:v,hasTabStop:null!=j}):c})})});S.displayName=C;var P={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>S,"Root",()=>k,"createRovingFocusGroupScope",()=>b])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),n=e.i(5978),i=e.i(86874),o=e.i(20314);function a(e){let a=e+"CollectionProvider",[s,l]=(0,r.createContextScope)(a),[u,c]=s(a,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:n}=e,i=t.default.useRef(null),a=t.default.useRef(new Map).current;return(0,o.jsx)(u,{scope:r,itemMap:a,collectionRef:i,children:n})};d.displayName=a;let f=e+"CollectionSlot",p=(0,i.createSlot)(f),h=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,a=c(f,r),s=(0,n.useComposedRefs)(t,a.collectionRef);return(0,o.jsx)(p,{ref:s,children:i})});h.displayName=f;let y=e+"CollectionItemSlot",m="data-radix-collection-item",g=(0,i.createSlot)(y),v=t.default.forwardRef((e,r)=>{let{scope:i,children:a,...s}=e,l=t.default.useRef(null),u=(0,n.useComposedRefs)(r,l),d=c(y,i);return t.default.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>void d.itemMap.delete(l))),(0,o.jsx)(g,{...{[m]:""},ref:u,children:a})});return v.displayName=y,[{Provider:d,Slot:h,ItemSlot:v},function(r){let n=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},l]}var s=new WeakMap;function l(e,t){var r,n;let i,o,a;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let s=(r=e,n=t,i=r.length,(a=(o=u(n))>=0?o:i+o)<0||a>=i?-1:a);return -1===s?void 0:e[s]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],s.set(this,!0)}set(e,t){return s.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,i=this.has(t),o=this.#e.length,a=u(e),s=a>=0?a:o+a,l=s<0||s>=o?-1:s;if(l===this.size||i&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!i;a<0&&s++;let d=[...this.#e],f=!1;for(let e=s;e<c;e++)if(s===e){let o=d[e];d[e]===t&&(o=d[e+1]),i&&this.delete(t),n=this.get(o),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],i=n;n=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,n){let i=new e(this);return i.insert(t,r,n),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,r){let n=[],i=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(n)}reduce(...e){let[t,r]=e,n=0,i=r??this.at(0);for(let r of this)i=0===n&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this]),n++;return i}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);n=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>a])},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},82569,5147,e=>{"use strict";let t=(0,e.i(3645).default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);e.s(["Github",()=>t],82569);var r=e.i(20314),n=e.i(79054);let i={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null,archived:null};function o(e){return i[e]}let a=(0,n.createContext)(null);function s({children:e}){let[t,i]=(0,n.useState)([]),[o,s]=(0,n.useState)(!1),l=(0,n.useMemo)(()=>({features:t,setFeatures:i,hasRepositories:o,setHasRepositories:s}),[t,o]);return(0,r.jsx)(a.Provider,{value:l,children:e})}function l(){let e=(0,n.useContext)(a);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>s,"mapNodeStateToSidebarStatus",()=>o,"useSidebarFeaturesContext",()=>l],5147)},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...i}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...i})}e.s(["Input",()=>n])},66459,e=>{"use strict";let t=(0,e.i(3645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},83241,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let n=e.r(9328);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},90891,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},31218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return l}});let n=e.r(20314),i=e.r(26036),o=e.r(58988),a=e.r(90891),s=e.r(22193);function l({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let l=(0,s.getDeploymentIdQueryOrEmptyString)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${l}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},84929,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(20314),i=e.r(79054),o=e.r(83241),a=e.r(31218);function s(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},u=function(e){let t={...l,...e},r=(0,i.lazy)(()=>t.loader().then(s)),u=t.loading;function c(e){let s=u?(0,n.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?i.Suspense:i.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...l?{fallback:s}:{},children:d})}return c.displayName="LoadableComponent",c}},47901,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(81258)._(e.r(84929));function i(e,t){let r={};"function"==typeof e&&(r.loader=e);let i={...r,...t};return(0,n.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},13322,61201,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(47901),i=e.i(83428),o=e.i(60112),a=e.i(2287),s=e.i(35364);let l=(0,n.default)(()=>e.A(89305).then(e=>e.FileManager),{loadableGenerated:{modules:[15567]},ssr:!1,loading:()=>(0,t.jsx)(u,{})});function u(){return(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})})}async function c(e){let t=new URLSearchParams;e&&t.set("path",e);let r=await fetch(`/api/directory/list?${t.toString()}`);if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to load directory"}))).error??"Failed to load directory");return r.json()}function d({open:e,onOpenChange:n,onSelect:i,initialPath:u}){let[d,f]=(0,r.useState)([]),[p,h]=(0,r.useState)(""),[y,m]=(0,r.useState)(!1),[g,v]=(0,r.useState)(null),b=(0,r.useRef)(!1),x=(0,r.useCallback)(async e=>{m(!0),v(null);try{let t=await c(e);f(t.entries),h(t.currentPath)}catch(t){let e=t instanceof Error?t.message:"Failed to load directory";o.toast.error(e)}finally{m(!1)}},[]);(0,r.useEffect)(()=>{e&&!b.current&&(b.current=!0,x(u)),e||(b.current=!1)},[e,u,x]);let w=(0,r.useCallback)(e=>{let t=e.absolutePath;e.isDirectory&&t&&x(t)},[x]),k=(0,r.useCallback)(e=>{1===e.length&&e[0].isDirectory?v(e[0].absolutePath??null):v(null)},[]);function j(){i(null),n(!1)}return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:e=>{e||j()},children:(0,t.jsxs)(a.DialogContent,{className:"flex h-[95dvh] max-w-[95vw] flex-col",onCloseAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:"Select Folder"}),(0,t.jsx)(a.DialogDescription,{className:"truncate font-mono text-xs",children:p||"Loading..."})]}),(0,t.jsx)("div",{className:"shep-file-manager min-h-0 flex-1 overflow-hidden rounded-md border",children:(0,t.jsx)(l,{files:d.map(e=>({name:e.name,isDirectory:!0,path:`/${e.name}`,absolutePath:e.path,updatedAt:e.updatedAt})),isLoading:y,height:"100%",width:"100%",layout:"list",enableFilePreview:!1,permissions:{upload:!1,delete:!1,create:!1,download:!1,copy:!1,move:!1,rename:!1},onFileOpen:w,onSelectionChange:k,onRefresh:()=>x(p)},p)}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(s.Button,{variant:"outline",onClick:j,children:"Cancel"}),(0,t.jsx)(s.Button,{variant:"secondary",onClick:function(){p&&(i(p),n(!1))},disabled:!p,children:"Select Current Folder"}),(0,t.jsx)(s.Button,{onClick:function(){g&&(i(g),n(!1))},disabled:!g,children:"Select Folder"})]})]})})}e.s(["ReactFileManagerDialog",()=>d],61201),e.s([],13322)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("006b313427520d4cdf7d2e88adafbe5f546332a603",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function n(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>n],78521)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${i}${c}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return s(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return y},ST:function(){return m},WEB_VITALS:function(){return o},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return k}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let y="u">typeof performance,m=y&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(58464),i=e.r(53626);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return b}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(44066),a=e.r(20314),s=o._(e.r(79054)),l=e.r(95889),u=e.r(18152),c=e.r(80764),d=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),y=e.r(95555);function m(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function g(t){var r;let n,i,o,[l,g]=(0,s.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,s.useRef)(null),{href:x,as:w,children:k,prefetch:j=null,passHref:C,replace:S,shallow:P,scroll:R,onClick:E,onMouseEnter:T,onTouchStart:O,legacyBehavior:M=!1,onNavigate:A,ref:_,unstable_dynamicOnHover:F,...L}=t;n=k,M&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let I=s.default.useContext(u.AppRouterContext),N=!1!==j,D=!1!==j?null===(r=j)||"auto"===r?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,{href:z,as:U}=s.default.useMemo(()=>{let e=m(x);return{href:e,as:w?m(w):e}},[x,w]);if(M){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=s.default.Children.only(n)}let $=M?i&&"object"==typeof i&&i.ref:_,B=s.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,z,I,D,N,g)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[N,z,I,D,g]),K={ref:(0,c.useMergedRef)(B,$),onClick(t){M||"function"!=typeof E||E(t),M&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,i,o,a,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(81574);s.default.startTransition(()=>{d(n||r,o?"replace":"push",a??!0,i.current)})}}(t,z,U,b,S,R,A)},onMouseEnter(e){M||"function"!=typeof T||T(e),M&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),I&&N&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)},onTouchStart:function(e){M||"function"!=typeof O||O(e),M&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),I&&N&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)}};return(0,d.isAbsoluteUrl)(U)?K.href=U:M&&!C&&("a"!==i.type||"href"in i.props)||(K.href=(0,f.addBasePath)(U)),o=M?s.default.cloneElement(i,K):(0,a.jsx)("a",{...L,...K,children:n}),(0,a.jsx)(v.Provider,{value:l,children:o})}e.r(38670);let v=(0,s.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},89305,e=>{e.v(t=>Promise.all(["static/chunks/6d7b999c99d6d175.js"].map(t=>e.l(t))).then(()=>t(15567)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},68304,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(91967),i=e.i(22528),o=e.i(51080),a=e.i(85995),s=e.i(87620),l=e.i(66033),u=e.i(36589),c=e.i(13123),d="Tabs",[f,p]=(0,i.createContextScope)(d,[o.createRovingFocusGroupScope]),h=(0,o.createRovingFocusGroupScope)(),[y,m]=f(d),g=r.forwardRef((e,r)=>{let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:a,orientation:f="horizontal",dir:p,activationMode:h="automatic",...m}=e,g=(0,l.useDirection)(p),[v,b]=(0,u.useControllableState)({prop:i,onChange:o,defaultProp:a??"",caller:d});return(0,t.jsx)(y,{scope:n,baseId:(0,c.useId)(),value:v,onValueChange:b,orientation:f,dir:g,activationMode:h,children:(0,t.jsx)(s.Primitive.div,{dir:g,"data-orientation":f,...m,ref:r})})});g.displayName=d;var v="TabsList",b=r.forwardRef((e,r)=>{let{__scopeTabs:n,loop:i=!0,...a}=e,l=m(v,n),u=h(n);return(0,t.jsx)(o.Root,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:i,children:(0,t.jsx)(s.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:r})})});b.displayName=v;var x="TabsTrigger",w=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:a,disabled:l=!1,...u}=e,c=m(x,i),d=h(i),f=C(c.baseId,a),p=S(c.baseId,a),y=a===c.value;return(0,t.jsx)(o.Item,{asChild:!0,...d,focusable:!l,active:y,children:(0,t.jsx)(s.Primitive.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":p,"data-state":y?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:f,...u,ref:r,onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(a)}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(a)}),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;y||l||!e||c.onValueChange(a)})})})});w.displayName=x;var k="TabsContent",j=r.forwardRef((e,n)=>{let{__scopeTabs:i,value:o,forceMount:l,children:u,...c}=e,d=m(k,i),f=C(d.baseId,o),p=S(d.baseId,o),h=o===d.value,y=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.Presence,{present:l||h,children:({present:r})=>(0,t.jsx)(s.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:p,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&u})})});function C(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}j.displayName=k,e.s(["Content",()=>j,"List",()=>b,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>j,"TabsList",()=>b,"TabsTrigger",()=>w,"Trigger",()=>w,"createTabsScope",()=>p],43133);var P=e.i(43133),P=P,R=e.i(31777);let E=P.Root,T=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.List,{ref:n,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...r}));T.displayName=P.List.displayName;let O=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.Trigger,{ref:n,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...r}));O.displayName=P.Trigger.displayName;let M=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(P.Content,{ref:n,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...r}));M.displayName=P.Content.displayName,e.s(["Tabs",()=>E,"TabsContent",()=>M,"TabsList",()=>T,"TabsTrigger",()=>O],68304)},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},32494,e=>{"use strict";let t=(0,e.i(3645).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>t],32494)},79687,e=>{"use strict";var t=e.i(14748);e.s(["AlertCircle",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n=(0,e.i(18354).createLogger)("[SSE]");function i(e,t,r,n){if("u"<typeof EventSource)return()=>{};let i=null,o=!1,a=1e3,s=null,l=null;return!function u(){o||(i=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),i.onopen=()=>{n("connected"),l=setTimeout(()=>{l=null,a=1e3},5e3)},i.onerror=()=>{i?.close(),i=null,n("disconnected"),null!==l&&(clearTimeout(l),l=null);let e=a;a=Math.min(2*e,3e4),s=setTimeout(()=>{s=null,u()},e)},i.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>{let t=[...e,n];return t.length>500?t.slice(-250):t}),r(n)}))}(),()=>{o=!0,null!==s&&(clearTimeout(s),s=null),null!==l&&(clearTimeout(l),l=null),i&&(i.close(),i=null)}}let o=(0,r.createContext)(null);function a({children:e,runId:a}){let{events:s,lastEvent:l,connectionStatus:u}=function(e){let[t,o]=(0,r.useState)([]),[a,s]=(0,r.useState)(null),[l,u]=(0,r.useState)("disconnected"),c=e?.runId,d=(0,r.useRef)(null),f=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;n.debug("event received:",e.eventType,e),o(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),s(e)}else"status"===t.type&&u(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return i(c,o,s,u);let t=!1,r={current:void 0};function n(e){t||(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}function a(){if(t)return;let e=navigator.serviceWorker.controller;e&&(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}return navigator.serviceWorker.addEventListener("message",f),navigator.serviceWorker.addEventListener("controllerchange",a),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let a=e.active??e.installing??e.waiting;if(!a){r.current=i(c,o,s,u);return}if("activated"===a.state)n(a);else{let e=()=>{"activated"===a.state&&(a.removeEventListener("statechange",e),n(a))};a.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=i(c,o,s,u))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",f),navigator.serviceWorker.removeEventListener("controllerchange",a),d.current?.postMessage({type:"unsubscribe"}),d.current=null,r.current?.()}},[c,f]),{events:t,lastEvent:a,connectionStatus:l}}({runId:a}),c=(0,r.useMemo)(()=>({events:s,lastEvent:l,connectionStatus:u}),[s,l,u]);return(0,t.jsx)(o.Provider,{value:c,children:e})}function s(){let e=(0,r.useContext)(o);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>a,"useAgentEventsContext",()=>s],39443)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},54277,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t],30090),e.s(["CircleX",()=>t],54277)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),n=e.i(87342),i=e.i(5978),o=e.i(22528),a=e.i(13123),s=e.i(87620),l=e.i(29297),u=e.i(36589),c=e.i(66033),d=e.i(20314),f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[y,m,g]=(0,n.createCollection)(h),[v,b]=(0,o.createContextScope)(h,[g]),[x,w]=v(h),k=t.forwardRef((e,t)=>(0,d.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(j,{...e,ref:t})})}));k.displayName=h;var j=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:o,orientation:a,loop:y=!1,dir:g,currentTabStopId:v,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:w,onEntryFocus:k,preventScrollOnEntryFocus:j=!1,...C}=e,S=t.useRef(null),P=(0,i.useComposedRefs)(n,S),E=(0,c.useDirection)(g),[T,O]=(0,u.useControllableState)({prop:v,defaultProp:b??null,onChange:w,caller:h}),[M,A]=t.useState(!1),_=(0,l.useCallbackRef)(k),F=m(o),L=t.useRef(!1),[I,N]=t.useState(0);return t.useEffect(()=>{let e=S.current;if(e)return e.addEventListener(f,_),()=>e.removeEventListener(f,_)},[_]),(0,d.jsx)(x,{scope:o,orientation:a,dir:E,loop:y,currentTabStopId:T,onItemFocus:t.useCallback(e=>O(e),[O]),onItemShiftTab:t.useCallback(()=>A(!0),[]),onFocusableItemAdd:t.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>N(e=>e-1),[]),children:(0,d.jsx)(s.Primitive.div,{tabIndex:M||0===I?-1:0,"data-orientation":a,...C,ref:P,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!M){let t=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===T),...e].filter(Boolean).map(e=>e.ref.current),j)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>A(!1))})})}),C="RovingFocusGroupItem",S=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:i,focusable:o=!0,active:l=!1,tabStopId:u,children:c,...f}=e,p=(0,a.useId)(),h=u||p,g=w(C,i),v=g.currentTabStopId===h,b=m(i),{onFocusableItemAdd:x,onFocusableItemRemove:k,currentTabStopId:j}=g;return t.useEffect(()=>{if(o)return x(),()=>k()},[o,x,k]),(0,d.jsx)(y.ItemSlot,{scope:i,id:h,focusable:o,active:l,children:(0,d.jsx)(s.Primitive.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{o?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let i=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return P[i]}(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&i.reverse();let o=i.indexOf(e.currentTarget);i=g.loop?(r=i,n=o+1,r.map((e,t)=>r[(n+t)%r.length])):i.slice(o+1)}setTimeout(()=>R(i))}}),children:"function"==typeof c?c({isCurrentTabStop:v,hasTabStop:null!=j}):c})})});S.displayName=C;var P={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>S,"Root",()=>k,"createRovingFocusGroupScope",()=>b])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),n=e.i(5978),i=e.i(86874),o=e.i(20314);function a(e){let a=e+"CollectionProvider",[s,l]=(0,r.createContextScope)(a),[u,c]=s(a,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:n}=e,i=t.default.useRef(null),a=t.default.useRef(new Map).current;return(0,o.jsx)(u,{scope:r,itemMap:a,collectionRef:i,children:n})};d.displayName=a;let f=e+"CollectionSlot",p=(0,i.createSlot)(f),h=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,a=c(f,r),s=(0,n.useComposedRefs)(t,a.collectionRef);return(0,o.jsx)(p,{ref:s,children:i})});h.displayName=f;let y=e+"CollectionItemSlot",m="data-radix-collection-item",g=(0,i.createSlot)(y),v=t.default.forwardRef((e,r)=>{let{scope:i,children:a,...s}=e,l=t.default.useRef(null),u=(0,n.useComposedRefs)(r,l),d=c(y,i);return t.default.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>void d.itemMap.delete(l))),(0,o.jsx)(g,{...{[m]:""},ref:u,children:a})});return v.displayName=y,[{Provider:d,Slot:h,ItemSlot:v},function(r){let n=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},l]}var s=new WeakMap;function l(e,t){var r,n;let i,o,a;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let s=(r=e,n=t,i=r.length,(a=(o=u(n))>=0?o:i+o)<0||a>=i?-1:a);return -1===s?void 0:e[s]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],s.set(this,!0)}set(e,t){return s.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,i=this.has(t),o=this.#e.length,a=u(e),s=a>=0?a:o+a,l=s<0||s>=o?-1:s;if(l===this.size||i&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!i;a<0&&s++;let d=[...this.#e],f=!1;for(let e=s;e<c;e++)if(s===e){let o=d[e];d[e]===t&&(o=d[e+1]),i&&this.delete(t),n=this.get(o),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],i=n;n=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,n){let i=new e(this);return i.insert(t,r,n),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,r){let n=[],i=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(n)}reduce(...e){let[t,r]=e,n=0,i=r??this.at(0);for(let r of this)i=0===n&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this]),n++;return i}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);n=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>a])},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},82569,5147,e=>{"use strict";let t=(0,e.i(3645).default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);e.s(["Github",()=>t],82569);var r=e.i(20314),n=e.i(79054);let i={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null,archived:null};function o(e){return i[e]}let a=(0,n.createContext)(null);function s({children:e}){let[t,i]=(0,n.useState)([]),[o,s]=(0,n.useState)(!1),l=(0,n.useMemo)(()=>({features:t,setFeatures:i,hasRepositories:o,setHasRepositories:s}),[t,o]);return(0,r.jsx)(a.Provider,{value:l,children:e})}function l(){let e=(0,n.useContext)(a);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>s,"mapNodeStateToSidebarStatus",()=>o,"useSidebarFeaturesContext",()=>l],5147)},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...i}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...i})}e.s(["Input",()=>n])},66459,e=>{"use strict";let t=(0,e.i(3645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},83241,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let n=e.r(9328);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},90891,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},31218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return l}});let n=e.r(20314),i=e.r(26036),o=e.r(58988),a=e.r(90891),s=e.r(22193);function l({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let l=(0,s.getDeploymentIdQueryOrEmptyString)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${l}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},84929,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(20314),i=e.r(79054),o=e.r(83241),a=e.r(31218);function s(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},u=function(e){let t={...l,...e},r=(0,i.lazy)(()=>t.loader().then(s)),u=t.loading;function c(e){let s=u?(0,n.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?i.Suspense:i.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...l?{fallback:s}:{},children:d})}return c.displayName="LoadableComponent",c}},47901,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(81258)._(e.r(84929));function i(e,t){let r={};"function"==typeof e&&(r.loader=e);let i={...r,...t};return(0,n.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},13322,61201,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(47901),i=e.i(83428),o=e.i(60112),a=e.i(2287),s=e.i(35364);let l=(0,n.default)(()=>e.A(89305).then(e=>e.FileManager),{loadableGenerated:{modules:[15567]},ssr:!1,loading:()=>(0,t.jsx)(u,{})});function u(){return(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})})}async function c(e){let t=new URLSearchParams;e&&t.set("path",e);let r=await fetch(`/api/directory/list?${t.toString()}`);if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to load directory"}))).error??"Failed to load directory");return r.json()}function d({open:e,onOpenChange:n,onSelect:i,initialPath:u}){let[d,f]=(0,r.useState)([]),[p,h]=(0,r.useState)(""),[y,m]=(0,r.useState)(!1),[g,v]=(0,r.useState)(null),b=(0,r.useRef)(!1),x=(0,r.useCallback)(async e=>{m(!0),v(null);try{let t=await c(e);f(t.entries),h(t.currentPath)}catch(t){let e=t instanceof Error?t.message:"Failed to load directory";o.toast.error(e)}finally{m(!1)}},[]);(0,r.useEffect)(()=>{e&&!b.current&&(b.current=!0,x(u)),e||(b.current=!1)},[e,u,x]);let w=(0,r.useCallback)(e=>{let t=e.absolutePath;e.isDirectory&&t&&x(t)},[x]),k=(0,r.useCallback)(e=>{1===e.length&&e[0].isDirectory?v(e[0].absolutePath??null):v(null)},[]);function j(){i(null),n(!1)}return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:e=>{e||j()},children:(0,t.jsxs)(a.DialogContent,{className:"flex h-[95dvh] max-w-[95vw] flex-col",onCloseAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:"Select Folder"}),(0,t.jsx)(a.DialogDescription,{className:"truncate font-mono text-xs",children:p||"Loading..."})]}),(0,t.jsx)("div",{className:"shep-file-manager min-h-0 flex-1 overflow-hidden rounded-md border",children:(0,t.jsx)(l,{files:d.map(e=>({name:e.name,isDirectory:!0,path:`/${e.name}`,absolutePath:e.path,updatedAt:e.updatedAt})),isLoading:y,height:"100%",width:"100%",layout:"list",enableFilePreview:!1,permissions:{upload:!1,delete:!1,create:!1,download:!1,copy:!1,move:!1,rename:!1},onFileOpen:w,onSelectionChange:k,onRefresh:()=>x(p)},p)}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(s.Button,{variant:"outline",onClick:j,children:"Cancel"}),(0,t.jsx)(s.Button,{variant:"secondary",onClick:function(){p&&(i(p),n(!1))},disabled:!p,children:"Select Current Folder"}),(0,t.jsx)(s.Button,{onClick:function(){g&&(i(g),n(!1))},disabled:!g,children:"Select Folder"})]})]})})}e.s(["ReactFileManagerDialog",()=>d],61201),e.s([],13322)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00732642a4a6737d75db0fffae894e3434b5bfeb6f",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function n(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>n],78521)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${i}${c}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return s(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return y},ST:function(){return m},WEB_VITALS:function(){return o},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return k}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let y="u">typeof performance,m=y&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(58464),i=e.r(53626);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return b}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(44066),a=e.r(20314),s=o._(e.r(79054)),l=e.r(95889),u=e.r(18152),c=e.r(80764),d=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),y=e.r(95555);function m(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function g(t){var r;let n,i,o,[l,g]=(0,s.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,s.useRef)(null),{href:x,as:w,children:k,prefetch:j=null,passHref:C,replace:S,shallow:P,scroll:R,onClick:E,onMouseEnter:T,onTouchStart:O,legacyBehavior:M=!1,onNavigate:A,ref:_,unstable_dynamicOnHover:F,...L}=t;n=k,M&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let I=s.default.useContext(u.AppRouterContext),N=!1!==j,D=!1!==j?null===(r=j)||"auto"===r?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,{href:z,as:U}=s.default.useMemo(()=>{let e=m(x);return{href:e,as:w?m(w):e}},[x,w]);if(M){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=s.default.Children.only(n)}let $=M?i&&"object"==typeof i&&i.ref:_,B=s.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,z,I,D,N,g)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[N,z,I,D,g]),K={ref:(0,c.useMergedRef)(B,$),onClick(t){M||"function"!=typeof E||E(t),M&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,i,o,a,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(81574);s.default.startTransition(()=>{d(n||r,o?"replace":"push",a??!0,i.current)})}}(t,z,U,b,S,R,A)},onMouseEnter(e){M||"function"!=typeof T||T(e),M&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),I&&N&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)},onTouchStart:function(e){M||"function"!=typeof O||O(e),M&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),I&&N&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)}};return(0,d.isAbsoluteUrl)(U)?K.href=U:M&&!C&&("a"!==i.type||"href"in i.props)||(K.href=(0,f.addBasePath)(U)),o=M?s.default.cloneElement(i,K):(0,a.jsx)("a",{...L,...K,children:n}),(0,a.jsx)(v.Provider,{value:l,children:o})}e.r(38670);let v=(0,s.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},89305,e=>{e.v(t=>Promise.all(["static/chunks/6d7b999c99d6d175.js"].map(t=>e.l(t))).then(()=>t(15567)))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>t],16868)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},48306,64764,80436,28267,57484,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,...a}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}e.s(["Textarea",()=>a],48306);var s=e.i(15506);e.s(["Loader2Icon",()=>s.default],64764);var o=e.i(95230);e.s(["DownloadIcon",()=>o.default],80436);var i=e.i(1693);e.s(["VisuallyHidden",0,i],28267);let n=(0,e.i(3645).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>n],57484)},50032,86254,42076,e=>{"use strict";var t=e.i(20314),r=e.i(60253),a=e.i(64764),s=e.i(80436),o=e.i(31777),i=e.i(2287),n=e.i(28267),l=e.i(57484),d=e.i(16298),d=d;let c=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var p=e.i(93752),p=p;e.i(35364);let u=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),h=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function m(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function f(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function g({name:e,size:g,mimeType:b,path:v,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",T=u.has(N)?c:".pdf"===N?d.default:h.has(N)?p.default:l.FileIcon,P=".pdf"===N?"bg-red-50 text-red-600":u.has(N)?"bg-blue-50 text-blue-600":h.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&x.has(e.slice(k).toLowerCase());return w?(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(a.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,t.jsxs)(i.Dialog,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(i.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:f(v,b),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,t.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]}),(0,t.jsxs)(i.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(n.VisuallyHidden.Root,{children:(0,t.jsxs)(i.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:f(v,b),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:m(g)})]}),(0,t.jsx)("a",{href:f(v,b),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(s.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,o.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",P),children:(0,t.jsx)(T,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:m(g)}),!y&&(0,t.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]})}async function b(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>g],86254),e.s([],50032),e.s(["pickFiles",()=>b],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",T=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});T.displayName=N;var P="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(P,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":$(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=P;var R="PopoverPortal",[F,A]=v(R,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(F,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};E.displayName=R;var D="PopoverContent",I=r.forwardRef((e,r)=>{let a=A(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(M,{...o,ref:r})})});I.displayName=D;var O=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:O,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),M=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":$(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var H=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function $(e){return e?"open":"closed"}H.displayName="PopoverArrow",e.s(["Anchor",()=>T,"Arrow",()=>H,"Close",()=>B,"Content",()=>I,"Popover",()=>k,"PopoverAnchor",()=>T,"PopoverArrow",()=>H,"PopoverClose",()=>B,"PopoverContent",()=>I,"PopoverPortal",()=>E,"PopoverTrigger",()=>S,"Portal",()=>E,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var q=e.i(89920),q=q,G=e.i(31777);let V=q.Root,_=q.Trigger;q.Anchor;let K=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(q.Portal,{children:(0,t.jsx)(q.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));K.displayName=q.Content.displayName,e.s(["Popover",()=>V,"PopoverContent",()=>K,"PopoverTrigger",()=>_],90382)},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),T=!y||j||!!y.closest("form"),[P,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:P,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":v(P),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),T&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),T&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:P,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911);var C=e.i(23925),k=e.i(11345),N=e.i(76016),T=e.i(3879),P=e.i(85155),S=e.i(86782),R=e.i(29847),F=e.i(35364),A=e.i(90382);function E({initialAgentType:e,initialModel:a,onAgentModelChange:s,disabled:o,className:i,mode:n}){let[l,d]=r.useState(!1),[c,p]=r.useState([]),[u,h]=r.useState(!0),[m,x]=r.useState(e),[f,g]=r.useState(a),[b,v]=r.useState(null),[j,y]=r.useState(0),[E,D]=r.useState(null);r.useEffect(()=>{(0,T.getAllAgentModels)().then(p).finally(()=>h(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{y(0),D(null)},150);return()=>clearTimeout(e)}},[l]);let I=async(e,t)=>{if(d(!1),e!==m||t!==f){if("override"===n){x(e),g(t),s?.(e,t);return}x(e),g(t),s?.(e,t),v(null);try{let r=await (0,P.updateAgentAndModel)(e,t||null);r.ok||(x(m),g(f),s?.(m,f),v(r.error??"Failed to save"))}catch{x(m),g(f),s?.(m,f),v("Failed to save")}}},O=(0,S.getAgentTypeIcon)(m),z=c.find(e=>e.agentType===m)?.label??m,M=f?(0,R.getModelMeta)(f).displayName||f:null,L=E?c.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,w.cn)("flex flex-col gap-1",i),children:[(0,t.jsxs)(A.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(A.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(F.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(o??!1)||u,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(O,{className:"h-4 w-4 shrink-0"}),u?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:M})]}):null]})]})})}),(0,t.jsx)(A.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===j?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,S.getAgentTypeIcon)(e.agentType),a=m===e.agentType,s=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>{s?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>y(1))})):I(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),a&&!s?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,s?(0,t.jsx)(N.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{y(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(k.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=m===L.agentType&&f===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>I(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!b&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:b})]})}e.s(["AgentModelPicker",()=>E],41413)},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("40c59603e12eae4ffc99f06340490c9446b37910d8",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868),l=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428);let m=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var x=e.i(70471),f=e.i(31777),g=e.i(8361);e.i(1650);var b=e.i(11495),v=e.i(45811),j=e.i(35364),w=e.i(98127),y=e.i(48306),C=e.i(41957),k=e.i(81846),N=e.i(90382),T=e.i(51911),P=e.i(2828),S=e.i(30153);e.i(50032);var R=e.i(86254),F=e.i(41413),A=e.i(25235),E=e.i(78521);e.i(13322);var D=e.i(61201),I=e.i(75921),O=e.i(87326),z=e.i(42076);let M=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),L=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],U={allowPrd:!1,allowPlan:!1,allowMerge:!1};function B({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:w,currentModel:N,initialDescription:A}){let E=(0,g.useSoundAction)("create"),D=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",I=l?.approvalGates??U,O=l?.push??!1,B=l?.openPr??!1,q=l?.ciWatchEnabled!==!1,G=l?.enableEvidence??!1,V=l?.commitEvidence??!1,[_,K]=(0,r.useState)(A??"");(0,r.useEffect)(()=>{A&&K(A)},[A]);let[W,X]=(0,r.useState)([]),[Y,Z]=(0,r.useState)({...I}),[J,Q]=(0,r.useState)(O),[ee,et]=(0,r.useState)(B),[er,ea]=(0,r.useState)(l?.ciWatchEnabled!==!1),[es,eo]=(0,r.useState)(G),[ei,en]=(0,r.useState)(V),[el,ed]=(0,r.useState)(void 0),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(!1),[em,ex]=(0,r.useState)(!1),[ef,eg]=(0,r.useState)(!0),[eb,ev]=(0,r.useState)(void 0),[ej,ew]=(0,r.useState)(void 0),[ey,eC]=(0,r.useState)(D||void 0),[ek,eN]=(0,r.useState)(u??[]),[eT,eP]=(0,r.useState)(!1),[eS,eR]=(0,r.useState)(null),[eF,eA]=(0,r.useState)(!1),eE=(0,r.useRef)(crypto.randomUUID()),eD=(0,r.useRef)(0),eI=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(Z({...l.approvalGates}),Q(l.push),et(l.openPr),ea(!1!==l.ciWatchEnabled),eo(l.enableEvidence),en(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{eN(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&ed(h)},[e,h]);let eO=(0,r.useCallback)(()=>{K(""),X([]),Z({...I}),Q(O),et(B),ea(q),eo(G),en(V),ed(void 0),eC(D||void 0),eN(u??[]),ep(!1),eh(!1),ex(!1),eg(!0),ev(void 0),ew(void 0),eR(null),eD.current=0,eP(!1)},[I,O,B,G,q,V,D,u]),ez=""!==_.trim()||W.length>0,{attemptClose:eM}=(0,S.useGuardedDrawerClose)({open:e,isDirty:ez,onClose:a,onReset:eO}),eL=(0,r.useCallback)(async e=>{for(let t of(eR(null),e)){if(t.size>0xa00000)return void eR(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!M.has(e))return void eR(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();X(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eE.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));X(t=>t.filter(t=>t.id!==e)),eR(t.error??"Upload failed");return}let s=await a.json();X(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{X(t=>t.filter(t=>t.id!==e)),eR("Upload failed")}}},[]),eU=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current+=1,1===eD.current&&eP(!0)},[]),eB=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current-=1,0===eD.current&&eP(!1)},[]),eH=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),e$=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current=0,eP(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eL(t)},[eL]),eq=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eL(r))},[eL]),eG=(0,r.useCallback)(e=>{if(e.preventDefault(),!_.trim())return;let t=ey??D;t&&(E.play(),s({description:_.trim(),attachments:W.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:Y.allowPrd??!1,allowPlan:Y.allowPlan??!1,allowMerge:Y.allowMerge??!1},push:!!em||J||ee,openPr:!!em||ee,ciWatchEnabled:er,enableEvidence:es,commitEvidence:ei,fast:ec,forkAndPr:em,commitSpecs:ef,...eu?{pending:eu}:{},...eb?{agentType:eb}:{},...ej?{model:ej}:{},...el?{parentId:el}:{},sessionId:eE.current}),eO())},[_,W,Y,ey,D,s,J,ee,es,er,ei,ec,em,ef,eu,eb,ej,el,E,eO]),eV=(0,r.useCallback)(async()=>{try{let e=await (0,z.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();X(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eE.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));X(t=>t.filter(t=>t.id!==e)),eR(t.error??"Upload failed");return}let a=await r.json();X(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{X(t=>t.filter(t=>t.id!==e)),eR("Upload failed")}}}catch{}},[]),e_=(0,r.useCallback)(e=>{X(t=>t.filter(t=>t.id!==e))},[]),eK=(0,r.useRef)(null),eW=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),eK.current?.requestSubmit())},[]),eX=(0,r.useCallback)(()=>{eA(!0)},[]),eY=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eI.current?.contains(document.activeElement),t=eI.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eA(!1)},0)},[]),eZ=d&&d.length>0,eJ=!D&&!ey,eQ=!D&&void 0!==u;return(0,t.jsx)(b.BaseDrawer,{open:e,onClose:eM,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(v.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(v.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(k.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(j.Button,{variant:"outline",onClick:eM,disabled:i,children:"Cancel"}),(0,t.jsx)(j.Button,{type:"submit",form:"create-feature-form",disabled:!_.trim()||i||eJ,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:eK,id:"create-feature-form",onSubmit:eG,onKeyDown:eW,className:"flex flex-col gap-4",children:[eQ?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)($,{repositories:ek,value:ey,onChange:eC,onAddRepository:e=>{eN(t=>[...t,e]),eC(e.path)},disabled:i})]}):D?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===D)?.name??D.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":eT?"true":"false",onDragEnter:eU,onDragLeave:eB,onDragOver:eH,onDrop:e$,className:(0,f.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eT&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(C.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eI,onFocus:eX,onBlur:eY,className:(0,f.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eF&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:_,onChange:e=>K(e.target.value),onPaste:eq,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),W.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:W.map(e=>(0,t.jsx)(R.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>e_(e.id),disabled:i,loading:e.loading},e.id))}),eS?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eS}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(F.AgentModelPicker,{initialAgentType:eb??w??"claude-code",initialModel:ej??N??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ev(e),ew(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:eu,onCheckedChange:eh,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"fast-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eV,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),eZ&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(C.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(H,{features:d,value:el,onChange:ed,disabled:i})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:L.map(e=>(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:Y[e.id]??!1,onCheckedChange:t=>Z(r=>({...r,[e.id]:t})),disabled:i||ec&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(C.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ec&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=L.every(e=>Y[e.id]),t={};for(let r of L)t[r.id]=!e;Z(t)},disabled:i,className:(0,f.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",L.every(e=>Y[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:es,onCheckedChange:e=>{eo(e),e||en(!1)},disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:ei,onCheckedChange:en,disabled:i||!es||!ee&&!em}),(0,t.jsx)(C.Label,{htmlFor:"commit-evidence",className:(0,f.cn)("cursor-pointer text-xs font-medium",(!es||!ee&&!em)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ee||em?es?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!em||J||ee,onCheckedChange:e=>{Q(e),!e&&ee&&et(!1)},disabled:i||em}),(0,t.jsx)(C.Label,{htmlFor:"push",className:(0,f.cn)("cursor-pointer text-xs font-medium",em&&"opacity-50"),children:"Push"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:em?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!em||ee,onCheckedChange:e=>{et(e),e||en(!1)},disabled:i||em}),(0,t.jsx)(C.Label,{htmlFor:"open-pr",className:(0,f.cn)("cursor-pointer text-xs font-medium",em&&"opacity-50"),children:"PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:em?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:er,onCheckedChange:ea,disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:ef,onCheckedChange:eg,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:em,onCheckedChange:e=>{ex(e),e&&eg(!1)},disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function H({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(N.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,f.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(w.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function $({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,m]=(0,r.useState)(""),[x,g]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(!1),C=(0,r.useRef)(null),{reactFileManager:k}=(0,I.useFeatureFlags)(),T=e.find(e=>e.path===a),P=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,S=(0,r.useCallback)(e=>{s(e),c(!1),m("")},[s]),R=(0,r.useCallback)(async e=>{let t=await (0,O.addRepository)({path:e});if(t.error){v(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),m("")}},[o,s]),F=(0,r.useCallback)(async()=>{if(!x){if(k)return void y(!0);g(!0),v(null);try{let e=await (0,E.pickFolder)();if(!e)return void g(!1);await R(e)}catch{y(!0)}finally{g(!1)}}},[x,k,R]),z=(0,r.useCallback)(async e=>{if(y(!1),e){g(!0),v(null);try{await R(e)}catch(e){v(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[R]);return(0,r.useEffect)(()=>{n?setTimeout(()=>C.current?.focus(),0):m("")},[n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(N.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,f.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(w.Input,{ref:C,placeholder:"Search repositories...",value:p,onChange:e=>m(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===P.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):P.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>S(e.path),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(A.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:F,disabled:x,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[x?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]}),(0,t.jsx)(D.ReactFileManagerDialog,{open:j,onOpenChange:e=>{e||y(!1)},onSelect:z})]})}function q({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),x(!1)})},[h]);return(0,t.jsx)(B,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>q],15203)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24042,64970,e=>{"use strict";var t=e.i(3645);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",()=>n],24042);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>r],64970)},81803,72714,e=>{"use strict";var t=e.i(20314),n=e.i(83428),r=e.i(51251),a=e.i(31777),o=e.i(35364),l=e.i(8361);function i({label:e,onClick:i,loading:u,error:s,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:u,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",s&&"text-destructive hover:text-destructive",!s&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[u?(0,t.jsx)(n.Loader2,{className:"size-4 animate-spin"}):s?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}e.s(["ActionButton",()=>i],72714),e.s([],81803)},99348,17466,45811,e=>{"use strict";let t;var n=e.i(20314),r=e.i(79054),a=e.i(83428),o=e.i(30702),l=e.i(38573),i=e.i(17406),u=e.i(81846),s=e.i(2287),d=e.i(21023);let c=(0,d.createServerReference)("408c4ab38276cfe216f7797d0cfa3f90306a83b998",d.callServer,void 0,d.findSourceMapURL,"getDeploymentLogs");function f({open:e,onOpenChange:t,targetId:a}){let{logs:o,isConnected:l}=function(e){let[t,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1),l=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{l.current&&(l.current.close(),l.current=null),o(!1)},[]);return(0,r.useEffect)(()=>{if(!e){n([]),o(!1);return}c(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return l.current=t,t.onopen=()=>{o(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{o(!1)},()=>{t.close(),l.current=null}},[e,i]),{logs:t,isConnected:a}}(e?a:null);return(0,n.jsx)(p,{open:e,onOpenChange:t,logs:o,isConnected:l})}function p({open:e,onOpenChange:t,logs:a,isConnected:o}){let i=(0,r.useRef)(null),u=(0,r.useRef)(!0),d=(0,r.useCallback)(()=>{let e=i.current;e&&(u.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,r.useEffect)(()=>{u.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a]),(0,n.jsx)(s.Dialog,{open:e,onOpenChange:t,children:(0,n.jsxs)(s.DialogContent,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,n.jsxs)(s.DialogHeader,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,n.jsx)(s.DialogTitle,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${o?"bg-green-500":"bg-zinc-500"}`}),(0,n.jsx)("span",{className:"text-xs text-zinc-400",children:o?"Connected":"Disconnected"})]})]}),(0,n.jsxs)("div",{ref:i,onScroll:d,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===a.length?(0,n.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):a.map(e=>(0,n.jsx)(m,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!o&&a.length>0&&(0,n.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function m({entry:e}){return(0,n.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,n.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}function g({status:e,url:t,targetId:s}){let[d,c]=(0,r.useState)(!1),p=s&&(e===i.DeploymentState.Booting||e===i.DeploymentState.Ready);switch(e){case i.DeploymentState.Booting:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Badge,{className:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",children:[(0,n.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Starting...",p?(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-blue-100",onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"h-3 w-3"})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});case i.DeploymentState.Ready:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,n.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full bg-green-500"}),t?(0,n.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:underline",onClick:e=>e.stopPropagation(),children:[t,(0,n.jsx)(o.ExternalLink,{className:"h-3 w-3"})]}):"Ready",p?(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-green-100",onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"h-3 w-3"})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});default:return null}}e.s(["DeploymentStatusBadge",()=>g],17466),e.s([],99348);var h=e.i(48249),v=e.i(567);let w=r.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),y=()=>{let e=r.default.useContext(w);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function b(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function x(){return R(/^iPhone/)||R(/^iPad/)||R(/^Mac/)&&navigator.maxTouchPoints>1}function R(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let C="u">typeof window?r.useLayoutEffect:r.useEffect;function j(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let D="u">typeof document&&window.visualViewport;function T(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function E(e){for(T(e)&&(e=e.parentElement);e&&!T(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let S=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),$=0;function N(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function k(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=E(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function P(e){return e instanceof HTMLInputElement&&!S.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function M(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let O=new WeakMap;function z(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||O.set(e,r)}let I=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function L(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[I(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[I(t)?5:4]):null}function B(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let F=[.32,.72,0,1],A="vaul-dragging";function H(e){let t=r.default.useRef(e);return r.default.useEffect(()=>{t.current=e}),r.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function W({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.default.useState(e),[a]=n,o=r.default.useRef(a),l=H(t);return r.default.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=H(n);return[i,r.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}let q=()=>()=>{},Y=null;function U({open:e,onOpenChange:n,children:a,onDrag:o,onRelease:l,snapPoints:i,shouldScaleBackground:u=!1,setBackgroundColorOnScale:s=!0,closeThreshold:d=.25,scrollLockTimeout:c=100,dismissible:f=!0,handleOnly:p=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:h,fixed:y,modal:R=!0,onClose:T,nested:S,noBodyStyles:M=!1,direction:B="bottom",defaultOpen:H=!1,disablePreventScroll:q=!0,snapToSequentialPoint:U=!1,preventScrollRestoration:X=!1,repositionInputs:V=!0,onAnimationEnd:K,container:J,autoFocus:_=!1}){var G,Q;let[Z=!1,ee]=W({defaultProp:H,prop:e,onChange:e=>{null==n||n(e),e||S||ek(),setTimeout(()=>{null==K||K(e)},500),e&&!R&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[et,en]=r.default.useState(!1),[er,ea]=r.default.useState(!1),[eo,el]=r.default.useState(!1),ei=r.default.useRef(null),eu=r.default.useRef(null),es=r.default.useRef(null),ed=r.default.useRef(null),ec=r.default.useRef(null),ef=r.default.useRef(!1),ep=r.default.useRef(null),em=r.default.useRef(0),eg=r.default.useRef(!1),eh=r.default.useRef(!H),ev=r.default.useRef(0),ew=r.default.useRef(null),ey=r.default.useRef((null==(G=ew.current)?void 0:G.getBoundingClientRect().height)||0),eb=r.default.useRef((null==(Q=ew.current)?void 0:Q.getBoundingClientRect().width)||0),ex=r.default.useRef(0),eR=r.default.useCallback(e=>{i&&e===eE.length-1&&(eu.current=new Date)},[]),{activeSnapPoint:eC,activeSnapPointIndex:ej,setActiveSnapPoint:eD,onRelease:eT,snapPointsOffset:eE,onDrag:eS,shouldFade:e$,getPercentageDragged:eN}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:a,overlayRef:o,fadeFromIndex:l,onSnapPointChange:i,direction:u="bottom",container:s,snapToSequentialPoint:d}){let[c,f]=W({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=r.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);r.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=r.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=r.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=r.default.useMemo(()=>{var e;let t=s?{width:s.getBoundingClientRect().width,height:s.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),I(u)){let a=n?r:p?e*t.height:0;return p?"bottom"===u?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===u?t.width-a:-t.width+a:a}))?e:[]},[n,p,s]),y=r.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),b=r.default.useCallback(e=>{var t;let r=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(r),z(a.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(u)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&r!==w.length-1&&void 0!==l&&r!==l&&r<l?z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"0"}):z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(r,0)])},[a.current,n,w,l,o,f]);return r.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&b(w[r])}},[c,e,n,w,b]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:a}){if(void 0===l)return;let i="bottom"===u||"right"===u?(null!=y?y:0)-e:(null!=y?y:0)+e,s=h===l-1,c=0===h,f=e>0;if(s&&z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`}),!d&&r>2&&!f)return void(a?t():b(w[0]));if(!d&&r>2&&f&&w&&n)return void b(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=I(u)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void b(w[n.length-1]):void(c&&e<0&&a&&t(),null===h||b(w[h+e]))}b(p)},onDrag:function({draggedDistance:e}){if(null===y)return;let t="bottom"===u||"right"===u?y-e:y+e;("bottom"===u||"right"===u)&&t<w[w.length-1]||("top"===u||"left"===u)&&t>w[w.length-1]||z(a.current,{transform:I(u)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:h,drawerRef:ew,fadeFromIndex:m,overlayRef:ei,onSnapPointChange:eR,direction:B,container:J,snapToSequentialPoint:U});!function(e={}){let{isDisabled:n}=e;C(()=>{if(!n){var e,r,a;let n,o,l,i,u,s,d;return 1==++$&&x()&&(l=0,i=window.pageXOffset,u=window.pageYOffset,s=j((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),d=j(N(document,"touchstart",e=>{((o=E(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),N(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),N(document,"touchend",e=>{let t=e.target;P(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),N(document,"focus",e=>{let t=e.target;P(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",D&&(D.height<window.innerHeight?requestAnimationFrame(()=>{k(t)}):D.addEventListener("resize",()=>k(t),{once:!0}))}))},!0),N(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{s(),d(),window.scrollTo(i,u)}),()=>{0==--$&&(null==t||t())}}},[n])}({isDisabled:!Z||er||!R||eo||!et||!V||!q});let{restorePositionSetting:ek}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:a,preventScrollRestoration:o,noBodyStyles:l}){let[i,u]=r.default.useState(()=>"u">typeof window?window.location.href:""),s=r.default.useRef(0),d=r.default.useCallback(()=>{if(b()&&null===Y&&e&&!l){Y={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-s.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&s.current>=t&&(document.body.style.top=`${-(s.current+e)}px`)}),300)}},[e]),c=r.default.useCallback(()=>{if(b()&&null!==Y&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Y),window.requestAnimationFrame(()=>{o&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),Y=null}},[i]);return r.default.useEffect(()=>{function e(){s.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),r.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),r.default.useEffect(()=>{!n&&a&&(e?(window.matchMedia("(display-mode: standalone)").matches||d(),t||window.setTimeout(()=>{c()},500)):c())},[e,a,i,t,n,d,c]),{restorePositionSetting:c}}({isOpen:Z,modal:R,nested:null!=S&&S,hasBeenOpened:et,preventScrollRestoration:X,noBodyStyles:M});function eP(){return(window.innerWidth-26)/window.innerWidth}function eM(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ew.current?L(ew.current,B):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===B||"left"===B)return!0;if(eu.current&&l.getTime()-eu.current.getTime()<500)return!1;if(null!==o&&("bottom"===B?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ec.current&&l.getTime()-ec.current.getTime()<c&&0===o||t)return ec.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ec.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function eO(e){er&&ew.current&&(ew.current.classList.remove(A),ef.current=!1,ea(!1),ed.current=new Date),null==T||T(),e||ee(!1),setTimeout(()=>{i&&eD(i[0])},500)}function ez(){if(!ew.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=L(ew.current,B);z(ew.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${F.join(",")})`}),z(ei.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"1"}),u&&t&&t>0&&Z&&z(e,{borderRadius:"8px",overflow:"hidden",...I(B)?{transform:`scale(${eP()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eP()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${F.join(",")})`},!0)}return r.default.useEffect(()=>{window.requestAnimationFrame(()=>{eh.current=!0})},[]),r.default.useEffect(()=>{var e;function t(){if(ew.current&&V&&(P(document.activeElement)||eg.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ew.current.getBoundingClientRect().height||0;ex.current||(ex.current=a);let o=ew.current.getBoundingClientRect().top;if(Math.abs(ev.current-r)>60&&(eg.current=!eg.current),i&&i.length>0&&eE&&ej&&(r+=eE[ej]||0),ev.current=r,a>t||eg.current){let e=ew.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),y?ew.current.style.height=`${e-Math.max(r,0)}px`:ew.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ew.current.style.height=`${ex.current}px`)}i&&i.length>0&&!eg.current?ew.current.style.bottom="0px":ew.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[ej,i,eE]),r.default.useEffect(()=>(Z&&(z(document.documentElement,{scrollBehavior:"auto"}),eu.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=O.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[Z]),r.default.useEffect(()=>{R||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[R]),r.default.createElement(v.Root,{defaultOpen:H,onOpenChange:e=>{(f||e)&&(e?en(!0):eO(!0),ee(e))},open:Z},r.default.createElement(w.Provider,{value:{activeSnapPoint:eC,snapPoints:i,setActiveSnapPoint:eD,drawerRef:ew,overlayRef:ei,onOpenChange:n,onPress:function(e){var t,n;!f&&!i||(!ew.current||ew.current.contains(e.target))&&(ey.current=(null==(t=ew.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ew.current)?void 0:n.getBoundingClientRect().width)||0,ea(!0),es.current=new Date,x()&&window.addEventListener("touchend",()=>ef.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),em.current=I(B)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!er||!ew.current)return;ew.current.classList.remove(A),ef.current=!1,ea(!1),ed.current=new Date;let r=L(ew.current,B);if(!e||!eM(e.target,!1)||!r||Number.isNaN(r)||null===es.current)return;let a=ed.current.getTime()-es.current.getTime(),o=em.current-(I(B)?e.pageY:e.pageX),u=Math.abs(o)/a;if(u>.05&&(el(!0),setTimeout(()=>{el(!1)},200)),i){eT({draggedDistance:o*("bottom"===B||"right"===B?1:-1),closeDrawer:eO,velocity:u,dismissible:f}),null==l||l(e,!0);return}if("bottom"===B||"right"===B?o>0:o<0){ez(),null==l||l(e,!0);return}if(u>.4){eO(),null==l||l(e,!1);return}let s=Math.min(null!=(t=ew.current.getBoundingClientRect().height)?t:0,window.innerHeight),c=Math.min(null!=(n=ew.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===B||"right"===B?c:s)*d){eO(),null==l||l(e,!1);return}null==l||l(e,!0),ez()},onDrag:function(e){if(ew.current&&er){let t="bottom"===B||"right"===B?1:-1,n=(em.current-(I(B)?e.pageY:e.pageX))*t,r=n>0,a=i&&!f&&!r;if(a&&0===ej)return;let l=Math.abs(n),s=document.querySelector("[data-vaul-drawer-wrapper]"),d=l/("bottom"===B||"top"===B?ey.current:eb.current),c=eN(l,r);if(null!==c&&(d=c),a&&d>=1||!ef.current&&!eM(e.target,r))return;if(ew.current.classList.add(A),ef.current=!0,z(ew.current,{transition:"none"}),z(ei.current,{transition:"none"}),i&&eS({draggedDistance:n}),r&&!i){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;z(ew.current,{transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let p=1-d;if((e$||m&&ej===m-1)&&(null==o||o(e,d),z(ei.current,{opacity:`${p}`,transition:"none"},!0)),s&&ei.current&&u){let e=Math.min(eP()+d*(1-eP()),1),t=8-8*d,n=Math.max(0,14-14*d);z(s,{borderRadius:`${t}px`,transform:I(B)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){let e=l*t;z(ew.current,{transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:f,shouldAnimate:eh,handleOnly:p,isOpen:Z,isDragging:er,shouldFade:e$,closeDrawer:eO,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;z(ew.current,{transform:I(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ep.current&&window.clearTimeout(ep.current),z(ew.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(B)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ew.current&&(ep.current=setTimeout(()=>{let e=L(ew.current,B);z(ew.current,{transition:"none",transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=I(B)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&z(ew.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eg,modal:R,snapPointsOffset:eE,activeSnapPointIndex:ej,direction:B,shouldScaleBackground:u,setBackgroundColorOnScale:s,noBodyStyles:M,container:J,autoFocus:_}},a))}let X=r.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:a,onRelease:o,shouldFade:l,isOpen:i,modal:u,shouldAnimate:s}=y(),d=M(t,n),c=a&&a.length>0;if(!u)return null;let f=r.default.useCallback(e=>o(e),[o]);return r.default.createElement(v.Overlay,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&l?"true":"false","data-vaul-animate":(null==s?void 0:s.current)?"true":"false",...e})});X.displayName="Drawer.Overlay";let V=r.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...a},o){let{drawerRef:l,onPress:i,onRelease:u,onDrag:s,keyboardIsOpen:d,snapPointsOffset:c,activeSnapPointIndex:f,modal:p,isOpen:m,direction:g,snapPoints:h,container:w,handleOnly:b,shouldAnimate:x,autoFocus:R}=y(),[C,j]=r.default.useState(!1),D=M(o,l),T=r.default.useRef(null),E=r.default.useRef(null),S=r.default.useRef(!1),$=h&&h.length>0;function N(e){T.current=null,S.current=!1,u(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:a,noBodyStyles:o}=y(),l=r.default.useRef(null),i=(0,r.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}r.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(a&&!o?B(document.body,{background:"black"}):q,B(t,{transformOrigin:I(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${F.join(",")})`}));let n=B(t,{borderRadius:"8px",overflow:"hidden",...I(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},500)}}},[t,n,i])}(),r.default.useEffect(()=>{$&&window.requestAnimationFrame(()=>{j(!0)})},[]),r.default.createElement(v.Content,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":m&&$?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":(null==x?void 0:x.current)?"true":"false",...a,ref:D,style:c&&c.length>0?{"--snap-point-height":`${c[null!=f?f:0]}px`,...t}:t,onPointerDown:e=>{b||(null==a.onPointerDown||a.onPointerDown.call(a,e),T.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==n||n(e),R||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!p||t.defaultPrevented)?t.preventDefault():d.current&&(d.current=!1)},onFocusOutside:e=>{if(!p)return void e.preventDefault()},onPointerMove:e=>{if(E.current=e,b||(null==a.onPointerMove||a.onPointerMove.call(a,e),!T.current))return;let t=e.pageY-T.current.y,n=e.pageX-T.current.x,r="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(S.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return S.current=!0,!0})({x:n,y:t},g,r)?s(e):(Math.abs(n)>r||Math.abs(t)>r)&&(T.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),T.current=null,S.current=!1,u(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),N(E.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),E.current&&N(E.current)}})});V.displayName="Drawer.Content";let K=r.default.forwardRef(function({preventCycle:e=!1,children:t,...n},a){let{closeDrawer:o,isDragging:l,snapPoints:i,activeSnapPoint:u,setActiveSnapPoint:s,dismissible:d,handleOnly:c,isOpen:f,onPress:p,onDrag:m}=y(),g=r.default.useRef(null),h=r.default.useRef(!1);function v(){g.current&&window.clearTimeout(g.current),h.current=!1}return r.default.createElement("div",{onClick:function(){h.current?v():window.setTimeout(()=>{!function(){if(l||e||h.current)return v();if(v(),!i||0===i.length){d||o();return}if(u===i[i.length-1]&&d)return o();let t=i.findIndex(e=>e===u);-1===t||s(i[t+1])}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&p(e),g.current=window.setTimeout(()=>{h.current=!0},250)},onPointerMove:e=>{c&&m(e)},ref:a,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},r.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});K.displayName="Drawer.Handle";let J={Root:U,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...a}){let{onNestedDrag:o,onNestedOpenChange:l,onNestedRelease:i}=y();if(!o)throw Error("Drawer.NestedRoot must be placed in another drawer");return r.default.createElement(U,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{o(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:i,...a})},Content:V,Overlay:X,Trigger:v.Trigger,Portal:function(e){let t=y(),{container:n=t.container,...a}=e;return r.default.createElement(v.Portal,{container:n,...a})},Handle:K,Close:v.Close,Title:v.Title,Description:v.Description};var _=e.i(31777);function G({...e}){return(0,n.jsx)(J.Root,{"data-slot":"drawer",...e})}function Q({...e}){return(0,n.jsx)(J.Portal,{"data-slot":"drawer-portal",...e})}function Z({className:e,...t}){return(0,n.jsx)(J.Overlay,{"data-slot":"drawer-overlay",className:(0,_.cn)("fixed inset-0 z-50 bg-black/50",e),...t})}function ee({className:e,children:t,direction:r="bottom",showCloseButton:a=!0,...o}){return(0,n.jsx)(Q,{children:(0,n.jsxs)(J.Content,{"data-slot":"drawer-content",className:(0,_.cn)("bg-background fixed z-50 flex flex-col shadow-lg","bottom"===r&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===r&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===r&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===r&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"right"===r?"calc(100% + 8px)":"left"===r||"top"===r?"calc(-100% - 8px)":"calc(100% + 8px)",userSelect:"text",...o.style??{}},...o,children:[t,a?(0,n.jsxs)(J.Close,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(h.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})}function et({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,_.cn)("flex flex-col gap-1.5 p-4",e),...t})}function en({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,_.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})}function er({className:e,...t}){return(0,n.jsx)(J.Title,{"data-slot":"drawer-title",className:(0,_.cn)("text-foreground font-semibold",e),...t})}function ea({className:e,...t}){return(0,n.jsx)(J.Description,{"data-slot":"drawer-description",className:(0,_.cn)("text-muted-foreground text-sm",e),...t})}e.s(["Drawer",()=>G,"DrawerContent",()=>ee,"DrawerDescription",()=>ea,"DrawerFooter",()=>en,"DrawerHeader",()=>et,"DrawerOverlay",()=>Z,"DrawerTitle",()=>er],45811)},8537,e=>{"use strict";var t=e.i(79054),n=e.i(18354),r=e.i(21023);let a=(0,r.createServerReference)("400146385be62c3bb09c99e3ddab55c3d4dbb8e6da",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("4007ddae06021bfeb2d4c381558bc7446e0b229148",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("40b47fc6ca91621048fbc0e9c0fc0a4a11041cf95a",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("401cbdf600ad2e52d06be73c3d0bb30b96c7f6057e",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),u=(0,n.createLogger)("[useDeployAction]");function s(e){let[n,r]=(0,t.useState)(!1),[s,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(!0),y=(0,t.useRef)(p);(0,t.useEffect)(()=>{y.current=p},[p]),(0,t.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]),(0,t.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let n=await i(e.targetId);if(t||!w.current)return;n&&"Stopped"!==n.state&&(u.info(`mount recovery: "${e.targetId}" state=${n.state}, url=${n.url}`),m(n.state),h(n.url),x(e.targetId))}catch{u.debug(`mount recovery failed for "${e.targetId}" — ignoring`)}})(),()=>{t=!0}},[e?.targetId]),(0,t.useEffect)(()=>()=>{v.current&&clearInterval(v.current)},[]);let b=(0,t.useCallback)(()=>{v.current&&(u.debug("stopping polling"),clearInterval(v.current),v.current=null)},[]),x=(0,t.useCallback)(e=>{b(),u.debug(`starting polling for "${e}" every 3000ms`),v.current=setInterval(async()=>{let t;if(!w.current)return void b();try{t=await i(e)}catch(t){u.warn(`poll fetch failed for "${e}":`,t),w.current&&(m(null),h(null),b());return}w.current&&(t&&"Stopped"!==t.state?(t.state!==y.current&&u.info(`poll state changed: ${y.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(u.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),b()))},3e3)},[b]);(0,t.useEffect)(()=>{if(!e||null!==p)return;let t=setInterval(async()=>{if(w.current)try{let t=await i(e.targetId);if(!w.current)return;t&&"Stopped"!==t.state&&(u.info(`idle poll: "${e.targetId}" state=${t.state}, url=${t.url}`),m(t.state),h(t.url),x(e.targetId))}catch{}},5e3);return()=>clearInterval(t)},[e,p,x]);let R=(0,t.useCallback)(async()=>{if(!e)return void u.warn("deploy() called but input is null — no-op");if(n)return void u.warn("deploy() called but already loading — no-op");u.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(u.info("server action result:",t),!w.current)return void u.warn("component unmounted after deploy — discarding result");if(t.success)u.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),x(e.targetId);else{let e=t.error??"An unexpected error occurred";u.warn(`deploy failed: ${e}`),f(e)}}catch(t){if(!w.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";u.error(`deploy threw exception: ${e}`,t),f(e)}finally{w.current&&r(!1)}},[e,n,x]),C=(0,t.useCallback)(async()=>{if(e&&!s){u.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(u.info("stop result:",t),!w.current)return;t.success&&(b(),m(null),h(null))}catch(e){u.warn("stop error (non-critical):",e)}finally{w.current&&d(!1)}}},[e,s,b]);return{deploy:R,stop:C,deployLoading:n,stopLoading:s,deployError:c,status:p,url:g}}e.s(["useDeployAction",()=>s],8537)},11495,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(48249),a=e.i(24042),o=e.i(64970),l=e.i(94237),i=e.i(31777);e.i(81803);var u=e.i(72714);e.i(99348);var s=e.i(17466),d=e.i(45811),c=e.i(25235),f=e.i(2828),p=e.i(8537),m=e.i(75921);let g=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl"}},defaultVariants:{size:"sm"}});function h({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:u="Drawer",size:s,header:f,children:p,footer:h,className:w,"data-testid":y,deployTarget:b}){let x=(0,m.useFeatureFlags)(),R=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{let t=e.target;!document.body.contains(t)||R.current?.contains(t)||t.closest(l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]')||a()};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,o,a,l]),(0,t.jsxs)(d.Drawer,{direction:"right",modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(d.DrawerOverlay,{}):null,(0,t.jsxs)(d.DrawerContent,{ref:R,direction:"right",showCloseButton:!1,className:(0,i.cn)(g({size:s}),"bg-white/85 backdrop-blur-xl dark:bg-neutral-800/85",w),"data-testid":y,onInteractOutside:o?void 0:e=>e.preventDefault(),children:[(0,t.jsx)(d.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:u})}),(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:u})}),(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":y?`${y}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),f?(0,t.jsx)(d.DrawerHeader,{className:"shrink-0",children:f}):null,f?(0,t.jsx)(c.Separator,{}):null,x.envDeploy&&b?(0,t.jsx)(v,{deployTarget:b}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:p}),h?(0,t.jsx)(d.DrawerFooter,{className:"shrink-0",children:h}):null]})]})}function v({deployTarget:e}){let n=(0,p.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pt-3 pb-3",children:[(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(u.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(f.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(s.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",()=>h])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24042,64970,e=>{"use strict";var t=e.i(3645);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",()=>n],24042);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>r],64970)},81803,72714,e=>{"use strict";var t=e.i(20314),n=e.i(83428),r=e.i(51251),a=e.i(31777),o=e.i(35364),l=e.i(8361);function i({label:e,onClick:i,loading:u,error:s,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:u,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",s&&"text-destructive hover:text-destructive",!s&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[u?(0,t.jsx)(n.Loader2,{className:"size-4 animate-spin"}):s?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}e.s(["ActionButton",()=>i],72714),e.s([],81803)},99348,17466,45811,e=>{"use strict";let t;var n=e.i(20314),r=e.i(79054),a=e.i(83428),o=e.i(30702),l=e.i(38573),i=e.i(17406),u=e.i(81846),s=e.i(2287),d=e.i(21023);let c=(0,d.createServerReference)("40252064b7f977f14548877a9370a87066ac0cfff9",d.callServer,void 0,d.findSourceMapURL,"getDeploymentLogs");function f({open:e,onOpenChange:t,targetId:a}){let{logs:o,isConnected:l}=function(e){let[t,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1),l=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{l.current&&(l.current.close(),l.current=null),o(!1)},[]);return(0,r.useEffect)(()=>{if(!e){n([]),o(!1);return}c(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return l.current=t,t.onopen=()=>{o(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{o(!1)},()=>{t.close(),l.current=null}},[e,i]),{logs:t,isConnected:a}}(e?a:null);return(0,n.jsx)(p,{open:e,onOpenChange:t,logs:o,isConnected:l})}function p({open:e,onOpenChange:t,logs:a,isConnected:o}){let i=(0,r.useRef)(null),u=(0,r.useRef)(!0),d=(0,r.useCallback)(()=>{let e=i.current;e&&(u.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,r.useEffect)(()=>{u.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a]),(0,n.jsx)(s.Dialog,{open:e,onOpenChange:t,children:(0,n.jsxs)(s.DialogContent,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,n.jsxs)(s.DialogHeader,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,n.jsx)(s.DialogTitle,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${o?"bg-green-500":"bg-zinc-500"}`}),(0,n.jsx)("span",{className:"text-xs text-zinc-400",children:o?"Connected":"Disconnected"})]})]}),(0,n.jsxs)("div",{ref:i,onScroll:d,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===a.length?(0,n.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):a.map(e=>(0,n.jsx)(m,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!o&&a.length>0&&(0,n.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function m({entry:e}){return(0,n.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,n.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}function g({status:e,url:t,targetId:s}){let[d,c]=(0,r.useState)(!1),p=s&&(e===i.DeploymentState.Booting||e===i.DeploymentState.Ready);switch(e){case i.DeploymentState.Booting:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Badge,{className:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",children:[(0,n.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Starting...",p?(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-blue-100",onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"h-3 w-3"})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});case i.DeploymentState.Ready:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,n.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full bg-green-500"}),t?(0,n.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:underline",onClick:e=>e.stopPropagation(),children:[t,(0,n.jsx)(o.ExternalLink,{className:"h-3 w-3"})]}):"Ready",p?(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-green-100",onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"h-3 w-3"})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});default:return null}}e.s(["DeploymentStatusBadge",()=>g],17466),e.s([],99348);var h=e.i(48249),v=e.i(567);let w=r.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),y=()=>{let e=r.default.useContext(w);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function b(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function x(){return R(/^iPhone/)||R(/^iPad/)||R(/^Mac/)&&navigator.maxTouchPoints>1}function R(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let C="u">typeof window?r.useLayoutEffect:r.useEffect;function j(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let D="u">typeof document&&window.visualViewport;function T(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function E(e){for(T(e)&&(e=e.parentElement);e&&!T(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let S=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),$=0;function N(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function k(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=E(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function P(e){return e instanceof HTMLInputElement&&!S.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function M(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let O=new WeakMap;function z(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||O.set(e,r)}let I=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function L(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[I(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[I(t)?5:4]):null}function B(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let F=[.32,.72,0,1],A="vaul-dragging";function H(e){let t=r.default.useRef(e);return r.default.useEffect(()=>{t.current=e}),r.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function W({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.default.useState(e),[a]=n,o=r.default.useRef(a),l=H(t);return r.default.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=H(n);return[i,r.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}let q=()=>()=>{},Y=null;function U({open:e,onOpenChange:n,children:a,onDrag:o,onRelease:l,snapPoints:i,shouldScaleBackground:u=!1,setBackgroundColorOnScale:s=!0,closeThreshold:d=.25,scrollLockTimeout:c=100,dismissible:f=!0,handleOnly:p=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:h,fixed:y,modal:R=!0,onClose:T,nested:S,noBodyStyles:M=!1,direction:B="bottom",defaultOpen:H=!1,disablePreventScroll:q=!0,snapToSequentialPoint:U=!1,preventScrollRestoration:X=!1,repositionInputs:V=!0,onAnimationEnd:K,container:J,autoFocus:_=!1}){var G,Q;let[Z=!1,ee]=W({defaultProp:H,prop:e,onChange:e=>{null==n||n(e),e||S||ek(),setTimeout(()=>{null==K||K(e)},500),e&&!R&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[et,en]=r.default.useState(!1),[er,ea]=r.default.useState(!1),[eo,el]=r.default.useState(!1),ei=r.default.useRef(null),eu=r.default.useRef(null),es=r.default.useRef(null),ed=r.default.useRef(null),ec=r.default.useRef(null),ef=r.default.useRef(!1),ep=r.default.useRef(null),em=r.default.useRef(0),eg=r.default.useRef(!1),eh=r.default.useRef(!H),ev=r.default.useRef(0),ew=r.default.useRef(null),ey=r.default.useRef((null==(G=ew.current)?void 0:G.getBoundingClientRect().height)||0),eb=r.default.useRef((null==(Q=ew.current)?void 0:Q.getBoundingClientRect().width)||0),ex=r.default.useRef(0),eR=r.default.useCallback(e=>{i&&e===eE.length-1&&(eu.current=new Date)},[]),{activeSnapPoint:eC,activeSnapPointIndex:ej,setActiveSnapPoint:eD,onRelease:eT,snapPointsOffset:eE,onDrag:eS,shouldFade:e$,getPercentageDragged:eN}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:a,overlayRef:o,fadeFromIndex:l,onSnapPointChange:i,direction:u="bottom",container:s,snapToSequentialPoint:d}){let[c,f]=W({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=r.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);r.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=r.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=r.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=r.default.useMemo(()=>{var e;let t=s?{width:s.getBoundingClientRect().width,height:s.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),I(u)){let a=n?r:p?e*t.height:0;return p?"bottom"===u?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===u?t.width-a:-t.width+a:a}))?e:[]},[n,p,s]),y=r.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),b=r.default.useCallback(e=>{var t;let r=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(r),z(a.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(u)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&r!==w.length-1&&void 0!==l&&r!==l&&r<l?z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"0"}):z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(r,0)])},[a.current,n,w,l,o,f]);return r.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&b(w[r])}},[c,e,n,w,b]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:a}){if(void 0===l)return;let i="bottom"===u||"right"===u?(null!=y?y:0)-e:(null!=y?y:0)+e,s=h===l-1,c=0===h,f=e>0;if(s&&z(o.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`}),!d&&r>2&&!f)return void(a?t():b(w[0]));if(!d&&r>2&&f&&w&&n)return void b(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=I(u)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void b(w[n.length-1]):void(c&&e<0&&a&&t(),null===h||b(w[h+e]))}b(p)},onDrag:function({draggedDistance:e}){if(null===y)return;let t="bottom"===u||"right"===u?y-e:y+e;("bottom"===u||"right"===u)&&t<w[w.length-1]||("top"===u||"left"===u)&&t>w[w.length-1]||z(a.current,{transform:I(u)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:h,drawerRef:ew,fadeFromIndex:m,overlayRef:ei,onSnapPointChange:eR,direction:B,container:J,snapToSequentialPoint:U});!function(e={}){let{isDisabled:n}=e;C(()=>{if(!n){var e,r,a;let n,o,l,i,u,s,d;return 1==++$&&x()&&(l=0,i=window.pageXOffset,u=window.pageYOffset,s=j((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),d=j(N(document,"touchstart",e=>{((o=E(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),N(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),N(document,"touchend",e=>{let t=e.target;P(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),N(document,"focus",e=>{let t=e.target;P(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",D&&(D.height<window.innerHeight?requestAnimationFrame(()=>{k(t)}):D.addEventListener("resize",()=>k(t),{once:!0}))}))},!0),N(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{s(),d(),window.scrollTo(i,u)}),()=>{0==--$&&(null==t||t())}}},[n])}({isDisabled:!Z||er||!R||eo||!et||!V||!q});let{restorePositionSetting:ek}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:a,preventScrollRestoration:o,noBodyStyles:l}){let[i,u]=r.default.useState(()=>"u">typeof window?window.location.href:""),s=r.default.useRef(0),d=r.default.useCallback(()=>{if(b()&&null===Y&&e&&!l){Y={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-s.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&s.current>=t&&(document.body.style.top=`${-(s.current+e)}px`)}),300)}},[e]),c=r.default.useCallback(()=>{if(b()&&null!==Y&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Y),window.requestAnimationFrame(()=>{o&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),Y=null}},[i]);return r.default.useEffect(()=>{function e(){s.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),r.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),r.default.useEffect(()=>{!n&&a&&(e?(window.matchMedia("(display-mode: standalone)").matches||d(),t||window.setTimeout(()=>{c()},500)):c())},[e,a,i,t,n,d,c]),{restorePositionSetting:c}}({isOpen:Z,modal:R,nested:null!=S&&S,hasBeenOpened:et,preventScrollRestoration:X,noBodyStyles:M});function eP(){return(window.innerWidth-26)/window.innerWidth}function eM(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ew.current?L(ew.current,B):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===B||"left"===B)return!0;if(eu.current&&l.getTime()-eu.current.getTime()<500)return!1;if(null!==o&&("bottom"===B?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ec.current&&l.getTime()-ec.current.getTime()<c&&0===o||t)return ec.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ec.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function eO(e){er&&ew.current&&(ew.current.classList.remove(A),ef.current=!1,ea(!1),ed.current=new Date),null==T||T(),e||ee(!1),setTimeout(()=>{i&&eD(i[0])},500)}function ez(){if(!ew.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=L(ew.current,B);z(ew.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${F.join(",")})`}),z(ei.current,{transition:`opacity 0.5s cubic-bezier(${F.join(",")})`,opacity:"1"}),u&&t&&t>0&&Z&&z(e,{borderRadius:"8px",overflow:"hidden",...I(B)?{transform:`scale(${eP()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eP()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${F.join(",")})`},!0)}return r.default.useEffect(()=>{window.requestAnimationFrame(()=>{eh.current=!0})},[]),r.default.useEffect(()=>{var e;function t(){if(ew.current&&V&&(P(document.activeElement)||eg.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ew.current.getBoundingClientRect().height||0;ex.current||(ex.current=a);let o=ew.current.getBoundingClientRect().top;if(Math.abs(ev.current-r)>60&&(eg.current=!eg.current),i&&i.length>0&&eE&&ej&&(r+=eE[ej]||0),ev.current=r,a>t||eg.current){let e=ew.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),y?ew.current.style.height=`${e-Math.max(r,0)}px`:ew.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ew.current.style.height=`${ex.current}px`)}i&&i.length>0&&!eg.current?ew.current.style.bottom="0px":ew.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[ej,i,eE]),r.default.useEffect(()=>(Z&&(z(document.documentElement,{scrollBehavior:"auto"}),eu.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=O.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[Z]),r.default.useEffect(()=>{R||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[R]),r.default.createElement(v.Root,{defaultOpen:H,onOpenChange:e=>{(f||e)&&(e?en(!0):eO(!0),ee(e))},open:Z},r.default.createElement(w.Provider,{value:{activeSnapPoint:eC,snapPoints:i,setActiveSnapPoint:eD,drawerRef:ew,overlayRef:ei,onOpenChange:n,onPress:function(e){var t,n;!f&&!i||(!ew.current||ew.current.contains(e.target))&&(ey.current=(null==(t=ew.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ew.current)?void 0:n.getBoundingClientRect().width)||0,ea(!0),es.current=new Date,x()&&window.addEventListener("touchend",()=>ef.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),em.current=I(B)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!er||!ew.current)return;ew.current.classList.remove(A),ef.current=!1,ea(!1),ed.current=new Date;let r=L(ew.current,B);if(!e||!eM(e.target,!1)||!r||Number.isNaN(r)||null===es.current)return;let a=ed.current.getTime()-es.current.getTime(),o=em.current-(I(B)?e.pageY:e.pageX),u=Math.abs(o)/a;if(u>.05&&(el(!0),setTimeout(()=>{el(!1)},200)),i){eT({draggedDistance:o*("bottom"===B||"right"===B?1:-1),closeDrawer:eO,velocity:u,dismissible:f}),null==l||l(e,!0);return}if("bottom"===B||"right"===B?o>0:o<0){ez(),null==l||l(e,!0);return}if(u>.4){eO(),null==l||l(e,!1);return}let s=Math.min(null!=(t=ew.current.getBoundingClientRect().height)?t:0,window.innerHeight),c=Math.min(null!=(n=ew.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===B||"right"===B?c:s)*d){eO(),null==l||l(e,!1);return}null==l||l(e,!0),ez()},onDrag:function(e){if(ew.current&&er){let t="bottom"===B||"right"===B?1:-1,n=(em.current-(I(B)?e.pageY:e.pageX))*t,r=n>0,a=i&&!f&&!r;if(a&&0===ej)return;let l=Math.abs(n),s=document.querySelector("[data-vaul-drawer-wrapper]"),d=l/("bottom"===B||"top"===B?ey.current:eb.current),c=eN(l,r);if(null!==c&&(d=c),a&&d>=1||!ef.current&&!eM(e.target,r))return;if(ew.current.classList.add(A),ef.current=!0,z(ew.current,{transition:"none"}),z(ei.current,{transition:"none"}),i&&eS({draggedDistance:n}),r&&!i){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;z(ew.current,{transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let p=1-d;if((e$||m&&ej===m-1)&&(null==o||o(e,d),z(ei.current,{opacity:`${p}`,transition:"none"},!0)),s&&ei.current&&u){let e=Math.min(eP()+d*(1-eP()),1),t=8-8*d,n=Math.max(0,14-14*d);z(s,{borderRadius:`${t}px`,transform:I(B)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){let e=l*t;z(ew.current,{transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:f,shouldAnimate:eh,handleOnly:p,isOpen:Z,isDragging:er,shouldFade:e$,closeDrawer:eO,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;z(ew.current,{transform:I(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ep.current&&window.clearTimeout(ep.current),z(ew.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(B)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ew.current&&(ep.current=setTimeout(()=>{let e=L(ew.current,B);z(ew.current,{transition:"none",transform:I(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=I(B)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&z(ew.current,{transition:`transform 0.5s cubic-bezier(${F.join(",")})`,transform:I(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eg,modal:R,snapPointsOffset:eE,activeSnapPointIndex:ej,direction:B,shouldScaleBackground:u,setBackgroundColorOnScale:s,noBodyStyles:M,container:J,autoFocus:_}},a))}let X=r.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:a,onRelease:o,shouldFade:l,isOpen:i,modal:u,shouldAnimate:s}=y(),d=M(t,n),c=a&&a.length>0;if(!u)return null;let f=r.default.useCallback(e=>o(e),[o]);return r.default.createElement(v.Overlay,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&l?"true":"false","data-vaul-animate":(null==s?void 0:s.current)?"true":"false",...e})});X.displayName="Drawer.Overlay";let V=r.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...a},o){let{drawerRef:l,onPress:i,onRelease:u,onDrag:s,keyboardIsOpen:d,snapPointsOffset:c,activeSnapPointIndex:f,modal:p,isOpen:m,direction:g,snapPoints:h,container:w,handleOnly:b,shouldAnimate:x,autoFocus:R}=y(),[C,j]=r.default.useState(!1),D=M(o,l),T=r.default.useRef(null),E=r.default.useRef(null),S=r.default.useRef(!1),$=h&&h.length>0;function N(e){T.current=null,S.current=!1,u(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:a,noBodyStyles:o}=y(),l=r.default.useRef(null),i=(0,r.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}r.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(a&&!o?B(document.body,{background:"black"}):q,B(t,{transformOrigin:I(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${F.join(",")})`}));let n=B(t,{borderRadius:"8px",overflow:"hidden",...I(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},500)}}},[t,n,i])}(),r.default.useEffect(()=>{$&&window.requestAnimationFrame(()=>{j(!0)})},[]),r.default.createElement(v.Content,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":m&&$?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":(null==x?void 0:x.current)?"true":"false",...a,ref:D,style:c&&c.length>0?{"--snap-point-height":`${c[null!=f?f:0]}px`,...t}:t,onPointerDown:e=>{b||(null==a.onPointerDown||a.onPointerDown.call(a,e),T.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==n||n(e),R||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!p||t.defaultPrevented)?t.preventDefault():d.current&&(d.current=!1)},onFocusOutside:e=>{if(!p)return void e.preventDefault()},onPointerMove:e=>{if(E.current=e,b||(null==a.onPointerMove||a.onPointerMove.call(a,e),!T.current))return;let t=e.pageY-T.current.y,n=e.pageX-T.current.x,r="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(S.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return S.current=!0,!0})({x:n,y:t},g,r)?s(e):(Math.abs(n)>r||Math.abs(t)>r)&&(T.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),T.current=null,S.current=!1,u(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),N(E.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),E.current&&N(E.current)}})});V.displayName="Drawer.Content";let K=r.default.forwardRef(function({preventCycle:e=!1,children:t,...n},a){let{closeDrawer:o,isDragging:l,snapPoints:i,activeSnapPoint:u,setActiveSnapPoint:s,dismissible:d,handleOnly:c,isOpen:f,onPress:p,onDrag:m}=y(),g=r.default.useRef(null),h=r.default.useRef(!1);function v(){g.current&&window.clearTimeout(g.current),h.current=!1}return r.default.createElement("div",{onClick:function(){h.current?v():window.setTimeout(()=>{!function(){if(l||e||h.current)return v();if(v(),!i||0===i.length){d||o();return}if(u===i[i.length-1]&&d)return o();let t=i.findIndex(e=>e===u);-1===t||s(i[t+1])}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&p(e),g.current=window.setTimeout(()=>{h.current=!0},250)},onPointerMove:e=>{c&&m(e)},ref:a,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},r.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});K.displayName="Drawer.Handle";let J={Root:U,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...a}){let{onNestedDrag:o,onNestedOpenChange:l,onNestedRelease:i}=y();if(!o)throw Error("Drawer.NestedRoot must be placed in another drawer");return r.default.createElement(U,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{o(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:i,...a})},Content:V,Overlay:X,Trigger:v.Trigger,Portal:function(e){let t=y(),{container:n=t.container,...a}=e;return r.default.createElement(v.Portal,{container:n,...a})},Handle:K,Close:v.Close,Title:v.Title,Description:v.Description};var _=e.i(31777);function G({...e}){return(0,n.jsx)(J.Root,{"data-slot":"drawer",...e})}function Q({...e}){return(0,n.jsx)(J.Portal,{"data-slot":"drawer-portal",...e})}function Z({className:e,...t}){return(0,n.jsx)(J.Overlay,{"data-slot":"drawer-overlay",className:(0,_.cn)("fixed inset-0 z-50 bg-black/50",e),...t})}function ee({className:e,children:t,direction:r="bottom",showCloseButton:a=!0,...o}){return(0,n.jsx)(Q,{children:(0,n.jsxs)(J.Content,{"data-slot":"drawer-content",className:(0,_.cn)("bg-background fixed z-50 flex flex-col shadow-lg","bottom"===r&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===r&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===r&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===r&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"right"===r?"calc(100% + 8px)":"left"===r||"top"===r?"calc(-100% - 8px)":"calc(100% + 8px)",userSelect:"text",...o.style??{}},...o,children:[t,a?(0,n.jsxs)(J.Close,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(h.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})}function et({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,_.cn)("flex flex-col gap-1.5 p-4",e),...t})}function en({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,_.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})}function er({className:e,...t}){return(0,n.jsx)(J.Title,{"data-slot":"drawer-title",className:(0,_.cn)("text-foreground font-semibold",e),...t})}function ea({className:e,...t}){return(0,n.jsx)(J.Description,{"data-slot":"drawer-description",className:(0,_.cn)("text-muted-foreground text-sm",e),...t})}e.s(["Drawer",()=>G,"DrawerContent",()=>ee,"DrawerDescription",()=>ea,"DrawerFooter",()=>en,"DrawerHeader",()=>et,"DrawerOverlay",()=>Z,"DrawerTitle",()=>er],45811)},8537,e=>{"use strict";var t=e.i(79054),n=e.i(18354),r=e.i(21023);let a=(0,r.createServerReference)("4041288b78ea9385382bcecf0470b5f918303b94bb",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("40eb056bfb6d6892bd8091b5c177beae080b2755d2",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("40bfd94e511e08b5b0d2fda10b6ac1e376ba969855",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("4018d080179a87a50cd0dd9fcdf8d124279e72b879",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),u=(0,n.createLogger)("[useDeployAction]");function s(e){let[n,r]=(0,t.useState)(!1),[s,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(!0),y=(0,t.useRef)(p);(0,t.useEffect)(()=>{y.current=p},[p]),(0,t.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]),(0,t.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let n=await i(e.targetId);if(t||!w.current)return;n&&"Stopped"!==n.state&&(u.info(`mount recovery: "${e.targetId}" state=${n.state}, url=${n.url}`),m(n.state),h(n.url),x(e.targetId))}catch{u.debug(`mount recovery failed for "${e.targetId}" — ignoring`)}})(),()=>{t=!0}},[e?.targetId]),(0,t.useEffect)(()=>()=>{v.current&&clearInterval(v.current)},[]);let b=(0,t.useCallback)(()=>{v.current&&(u.debug("stopping polling"),clearInterval(v.current),v.current=null)},[]),x=(0,t.useCallback)(e=>{b(),u.debug(`starting polling for "${e}" every 3000ms`),v.current=setInterval(async()=>{let t;if(!w.current)return void b();try{t=await i(e)}catch(t){u.warn(`poll fetch failed for "${e}":`,t),w.current&&(m(null),h(null),b());return}w.current&&(t&&"Stopped"!==t.state?(t.state!==y.current&&u.info(`poll state changed: ${y.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(u.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),b()))},3e3)},[b]);(0,t.useEffect)(()=>{if(!e||null!==p)return;let t=setInterval(async()=>{if(w.current)try{let t=await i(e.targetId);if(!w.current)return;t&&"Stopped"!==t.state&&(u.info(`idle poll: "${e.targetId}" state=${t.state}, url=${t.url}`),m(t.state),h(t.url),x(e.targetId))}catch{}},5e3);return()=>clearInterval(t)},[e,p,x]);let R=(0,t.useCallback)(async()=>{if(!e)return void u.warn("deploy() called but input is null — no-op");if(n)return void u.warn("deploy() called but already loading — no-op");u.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(u.info("server action result:",t),!w.current)return void u.warn("component unmounted after deploy — discarding result");if(t.success)u.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),x(e.targetId);else{let e=t.error??"An unexpected error occurred";u.warn(`deploy failed: ${e}`),f(e)}}catch(t){if(!w.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";u.error(`deploy threw exception: ${e}`,t),f(e)}finally{w.current&&r(!1)}},[e,n,x]),C=(0,t.useCallback)(async()=>{if(e&&!s){u.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(u.info("stop result:",t),!w.current)return;t.success&&(b(),m(null),h(null))}catch(e){u.warn("stop error (non-critical):",e)}finally{w.current&&d(!1)}}},[e,s,b]);return{deploy:R,stop:C,deployLoading:n,stopLoading:s,deployError:c,status:p,url:g}}e.s(["useDeployAction",()=>s],8537)},11495,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(48249),a=e.i(24042),o=e.i(64970),l=e.i(94237),i=e.i(31777);e.i(81803);var u=e.i(72714);e.i(99348);var s=e.i(17466),d=e.i(45811),c=e.i(25235),f=e.i(2828),p=e.i(8537),m=e.i(75921);let g=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl"}},defaultVariants:{size:"sm"}});function h({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:u="Drawer",size:s,header:f,children:p,footer:h,className:w,"data-testid":y,deployTarget:b}){let x=(0,m.useFeatureFlags)(),R=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{let t=e.target;!document.body.contains(t)||R.current?.contains(t)||t.closest(l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]')||a()};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,o,a,l]),(0,t.jsxs)(d.Drawer,{direction:"right",modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(d.DrawerOverlay,{}):null,(0,t.jsxs)(d.DrawerContent,{ref:R,direction:"right",showCloseButton:!1,className:(0,i.cn)(g({size:s}),"bg-white/85 backdrop-blur-xl dark:bg-neutral-800/85",w),"data-testid":y,onInteractOutside:o?void 0:e=>e.preventDefault(),children:[(0,t.jsx)(d.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:u})}),(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:u})}),(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":y?`${y}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),f?(0,t.jsx)(d.DrawerHeader,{className:"shrink-0",children:f}):null,f?(0,t.jsx)(c.Separator,{}):null,x.envDeploy&&b?(0,t.jsx)(v,{deployTarget:b}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:p}),h?(0,t.jsx)(d.DrawerFooter,{className:"shrink-0",children:h}):null]})]})}function v({deployTarget:e}){let n=(0,p.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pt-3 pb-3",children:[(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(u.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(f.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(s.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",()=>h])}]);
|