reflex-agent 0.13.4 → 0.14.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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +102 -95
- package/.next/app-path-routes-manifest.json +8 -7
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route.js +53 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/install-archive/route.js +1 -0
- package/.next/server/app/api/utilities/install-archive/route.js.nft.json +1 -0
- package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -0
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +2 -2
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +1 -1
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +6 -6
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +4 -4
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +5 -5
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -7
- package/.next/server/chunks/1105.js +1 -1
- package/.next/server/chunks/1358.js +1 -1
- package/.next/server/chunks/285.js +9 -6
- package/.next/server/chunks/3091.js +1 -0
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/3795.js +3 -0
- package/.next/server/chunks/{2688.js → 4299.js} +2 -2
- package/.next/server/chunks/4812.js +1 -1
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/{8425.js → 6648.js} +1 -1
- package/.next/server/chunks/7300.js +56 -4
- package/.next/server/chunks/7358.js +3 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/969.js +1 -0
- package/.next/server/chunks/9809.js +1 -1
- package/.next/server/chunks/9861.js +57 -5
- package/.next/server/functions-config-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/1y4wPze4yO8DprxGKwSXQ/_buildManifest.js +1 -0
- package/.next/static/chunks/{5596-93b53c14a2d5c59a.js → 2608-755e5d9ca79c19dc.js} +1 -1
- package/.next/static/chunks/4108.17cd7704e88bcb32.js +1 -0
- package/.next/static/chunks/{9001-6f38a673a3868871.js → 4442-79daa48fe7845771.js} +1 -1
- package/.next/static/chunks/6226-819ec17660994a7d.js +1 -0
- package/.next/static/chunks/7922-9a16eb68adcc7498.js +1 -0
- package/.next/static/chunks/9624-7dc547ab202a1d82.js +1 -0
- package/.next/static/chunks/app/api/agents/[agentId]/respond/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/images/[rootId]/[file]/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/oauth/callback/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/oauth/start/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/attachments/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/send/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stop/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stream/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/dashboard/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/roots/[id]/suggestions/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/bundle.js/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-api.mjs/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-ui.mjs/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/iframe/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/style.css/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/api/utilities/install-archive/route-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/layout-5caae9e60f5d6d42.js +1 -0
- package/.next/static/chunks/app/onboarding/page-3bb8ad02f9c88fdf.js +1 -0
- package/.next/static/chunks/app/{page-0c090eba51732036.js → page-6e32890e646e50aa.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/{page-292bc4cdceb6ea1d.js → page-ac00a7a8d6a16da8.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/{page-5e4f7b893c02c2bd.js → page-14cb4b8a24e40dc7.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/layout-5d0cd3b754198853.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/page-7bbe675652b7f9e8.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-2080ede443a668d2.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-c744450355558209.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/page-8175a0fbbc465472.js +1 -0
- package/.next/static/chunks/app/roots/new/page-3d83b5dfb0a8f869.js +1 -0
- package/.next/static/chunks/app/settings/page-550fab06213d866c.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-c290e46d1beba1ff.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/{page-ea8352712b521f75.js → page-5aaa4731a5ab783d.js} +1 -1
- package/.next/static/chunks/app/utilities/page-0e362fd622574297.js +1 -0
- package/.next/static/chunks/{webpack-a4eadc02863be5eb.js → webpack-e60c7ddfa84db519.js} +1 -1
- package/.next/trace +90 -90
- package/.next/types/app/api/utilities/install-archive/route.ts +347 -0
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/dist/lib/reflex/prompts/defaults.js +3 -0
- package/dist/lib/reflex/prompts/defaults.js.map +1 -1
- package/package.json +2 -1
- package/.next/server/chunks/2678.js +0 -3
- package/.next/server/chunks/491.js +0 -1
- package/.next/server/chunks/6238.js +0 -1
- package/.next/static/chunks/3717-339a6fc5e3b929f9.js +0 -1
- package/.next/static/chunks/4108.58294dcccaecb2f1.js +0 -1
- package/.next/static/chunks/4179-847dcd61bef8c59f.js +0 -1
- package/.next/static/chunks/4273-0b053f2035ad088d.js +0 -1
- package/.next/static/chunks/app/api/agents/[agentId]/respond/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/images/[rootId]/[file]/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/oauth/callback/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/oauth/start/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/attachments/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/send/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stop/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stream/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/dashboard/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/roots/[id]/suggestions/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/bundle.js/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-api.mjs/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-ui.mjs/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/iframe/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/api/utilities/[scope]/[id]/style.css/route-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/layout-5e042e4e97dcea31.js +0 -1
- package/.next/static/chunks/app/onboarding/page-97aa4ad99276380f.js +0 -1
- package/.next/static/chunks/app/roots/[id]/layout-7e2f82a91b10b7e2.js +0 -1
- package/.next/static/chunks/app/roots/[id]/memory/page-b1fd919707f00c99.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-da97fb20eef9677c.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-932edf8ce73b23bc.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/page-7339062dee577728.js +0 -1
- package/.next/static/chunks/app/roots/new/page-c96a333c1ef53fba.js +0 -1
- package/.next/static/chunks/app/settings/page-75c61dd145bed57e.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-e4b74cf795d4e211.js +0 -1
- package/.next/static/chunks/app/utilities/page-b5514f6c3291e23f.js +0 -1
- package/.next/static/my3C6nd2vY80TaiBNwet5/_buildManifest.js +0 -1
- /package/.next/static/{my3C6nd2vY80TaiBNwet5 → 1y4wPze4yO8DprxGKwSXQ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8138],{4959:(e,t,s)=>{"use strict";s.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var a=s(4624);s(99356);var r=s(13506);function n(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...s})}function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",t),...s})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",t),...s})}},7530:(e,t,s)=>{Promise.resolve().then(s.bind(s,32669)),Promise.resolve().then(s.bind(s,81360)),Promise.resolve().then(s.bind(s,86049)),Promise.resolve().then(s.bind(s,28148)),Promise.resolve().then(s.bind(s,8190)),Promise.resolve().then(s.bind(s,8265)),Promise.resolve().then(s.bind(s,74962)),Promise.resolve().then(s.bind(s,91074)),Promise.resolve().then(s.bind(s,96253)),Promise.resolve().then(s.bind(s,28050)),Promise.resolve().then(s.bind(s,94904)),Promise.resolve().then(s.bind(s,13270)),Promise.resolve().then(s.bind(s,99730)),Promise.resolve().then(s.bind(s,89146)),Promise.resolve().then(s.bind(s,19078)),Promise.resolve().then(s.bind(s,67854)),Promise.resolve().then(s.bind(s,69050)),Promise.resolve().then(s.bind(s,63739)),Promise.resolve().then(s.bind(s,33976)),Promise.resolve().then(s.bind(s,12537)),Promise.resolve().then(s.bind(s,97485)),Promise.resolve().then(s.bind(s,41923)),Promise.resolve().then(s.bind(s,73868)),Promise.resolve().then(s.bind(s,53511)),Promise.resolve().then(s.bind(s,2018)),Promise.resolve().then(s.bind(s,18487)),Promise.resolve().then(s.bind(s,98346)),Promise.resolve().then(s.bind(s,14884)),Promise.resolve().then(s.bind(s,85314)),Promise.resolve().then(s.bind(s,17280)),Promise.resolve().then(s.bind(s,8855)),Promise.resolve().then(s.bind(s,86631)),Promise.resolve().then(s.bind(s,2604)),Promise.resolve().then(s.bind(s,27237)),Promise.resolve().then(s.bind(s,49455)),Promise.resolve().then(s.bind(s,39211)),Promise.resolve().then(s.bind(s,56360)),Promise.resolve().then(s.t.bind(s,54400,23))},8265:(e,t,s)=>{"use strict";s.d(t,{Dashboard:()=>eC});var a=s(4624),r=s(99356),n=s(49411),i=s(3747),o=s(56221),l=s(85253),d=s(63514),c=s(54400),m=s.n(c),u=s(41234),x=s(3239),h=s(86790),p=s(28310),g=s(4959);function f(e){let{rootId:t,activeGoals:s,runningAgents:r}=e,i=(0,n.c)("roots"),o=s.length+r.length;return(0,a.jsxs)(g.Zp,{children:[(0,a.jsxs)(g.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,a.jsxs)(g.ZB,{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)(u.A,{className:"h-4 w-4 text-violet-600"}),i("activeGoals.title")]}),o>0&&(0,a.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:o})]}),(0,a.jsxs)(g.Wu,{className:"space-y-2",children:[0===o&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:i("activeGoals.empty")}),s.map(e=>(0,a.jsx)(m(),{href:"/roots/".concat(t,"/chat/").concat(e.topicId),className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-violet-600 mt-0.5 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.topicTitle}),e.running&&(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin text-violet-600 shrink-0"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:e.goal}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-muted-foreground",children:[(0,a.jsx)("span",{children:i("activeGoals.iterationLabel",{count:e.goalIterations})}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{children:i("activeGoals.updatedLabel",{time:function(e,t){let s=Date.now()-Date.parse(e);if(!Number.isFinite(s)||s<0)return t("activeGoals.justNow");let a=Math.floor(s/6e4);if(a<1)return t("activeGoals.justNow");if(a<60)return t("activeGoals.minutesAgo",{count:a});let r=Math.floor(a/60);return r<24?t("activeGoals.hoursAgo",{count:r}):t("activeGoals.daysAgo",{count:Math.floor(r/24)})}(e.updatedAt,i)})})]})]})]})},e.topicId)),r.map(e=>(0,a.jsx)(m(),{href:"/roots/".concat(t,"/chat/").concat(e.topicId),className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 text-amber-600 mt-0.5 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.topicTitle}),(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin text-amber-600 shrink-0"}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground",children:i("activeGoals.agentRunning")})]})]})},e.topicId))]})]})}var v=s(85924),b=s(3024),j=s(59145),w=s(31108);function N(e){let{rootId:t,items:s}=e,r=(0,n.c)("roots");return(0,a.jsxs)(g.Zp,{children:[(0,a.jsxs)(g.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,a.jsxs)(g.ZB,{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)(v.A,{className:"h-4 w-4 text-amber-600"}),r("pendingApprovals.title")]}),s.length>0&&(0,a.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:s.length})]}),(0,a.jsxs)(g.Wu,{className:"space-y-2",children:[0===s.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:r("pendingApprovals.empty")}),s.map(e=>{var s;return(0,a.jsx)(m(),{href:"/roots/".concat(t,"/chat/").concat(e.topicId),className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(y,{kind:e.kind}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.summary}),(0,a.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:"permission"===(s=e.kind)?"permission":"question"===s?"question":"mcp-add"})]}),e.details&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:e.details}),(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:["topic ",e.topicId.slice(0,12)," \xb7 ",function(e,t){let s=Date.now()-Date.parse(e);if(!Number.isFinite(s)||s<0)return t("pendingApprovals.justNow");let a=Math.floor(s/6e4);if(a<1)return t("pendingApprovals.justNow");if(a<60)return t("pendingApprovals.minutesAgo",{count:a});let r=Math.floor(a/60);return r<24?t("pendingApprovals.hoursAgo",{count:r}):t("pendingApprovals.daysAgo",{count:Math.floor(r/24)})}(e.ts,r)]})]})]})},"".concat(e.kind,":").concat(e.requestId))})]})]})}function y(e){let{kind:t}=e,s="h-3.5 w-3.5 mt-0.5 shrink-0";return"permission"===t?(0,a.jsx)(b.A,{className:"".concat(s," text-rose-600")}):"question"===t?(0,a.jsx)(j.A,{className:"".concat(s," text-sky-600")}):(0,a.jsx)(w.A,{className:"".concat(s," text-emerald-600")})}var k=s(49623),S=s(7911);let A=(0,S.createServerReference)("60dfbabd13fc2571a3310ecfe3d06848339c06a0f5",S.callServer,void 0,S.findSourceMapURL,"readKbPreviewAction");function C(e){let{rootId:t,items:s}=e,i=(0,n.c)("roots"),[o,l]=(0,r.useState)({});return(0,r.useEffect)(()=>{let e=!1;return(async()=>{for(let a of s){if(o[a.rel])continue;let s=await A(t,a.rel);if(e)return;s.ok&&l(e=>({...e,[a.rel]:s.preview}))}})(),()=>{e=!0}},[t,s]),(0,a.jsxs)(g.Zp,{children:[(0,a.jsxs)(g.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,a.jsxs)(g.ZB,{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 text-emerald-700"}),i("recentKb.title")]}),s.length>0&&(0,a.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:s.length})]}),(0,a.jsxs)(g.Wu,{className:"space-y-2",children:[0===s.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:i("recentKb.empty")}),s.map(e=>{var s;return(0,a.jsx)(m(),{href:"/roots/".concat(t,"/kb/").concat(e.rel.split("/").map(encodeURIComponent).join("/")),className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-emerald-700"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.title}),e.kind&&(0,a.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.kind})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:null!=(s=o[e.rel])?s:e.rel}),(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:[function(e,t){let s=Date.now()-Date.parse(e);if(!Number.isFinite(s)||s<0)return t("recentKb.justNow");let a=Math.floor(s/6e4);if(a<1)return t("recentKb.justNow");if(a<60)return t("recentKb.minutesAgo",{count:a});let r=Math.floor(a/60);return r<24?t("recentKb.hoursAgo",{count:r}):t("recentKb.daysAgo",{count:Math.floor(r/24)})}(e.modifiedAt,i)," \xb7 ",(0,a.jsx)("span",{className:"font-mono",children:e.rel})]})]})]})},e.rel)})]})]})}var R=s(69285),U=s(95046),M=s(8096),T=s(54207),D=s(95265),I=s(18909);function E(e){let{rootId:t,cache:s}=e,d=(0,n.c)("roots"),[c,m]=(0,r.useState)(s),[u,h]=(0,r.useTransition)(),f=(0,R.useRouter)(),v=c&&Date.now()-Date.parse(c.generatedAt)>864e5;return(0,a.jsxs)(g.Zp,{className:"lg:col-span-2",children:[(0,a.jsxs)(g.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,a.jsxs)(g.ZB,{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)(U.A,{className:"h-4 w-4 text-amber-500"}),d("aiSuggestions.title"),v&&(0,a.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:d("aiSuggestions.stale")})]}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{h(async()=>{try{let s=await fetch("/api/roots/".concat(t,"/suggestions"),{method:"POST",cache:"no-store"}),a=await s.json();if(!a.ok){var e;o.oR.error(null!=(e=a.error)?e:d("aiSuggestions.regenerateFailed"));return}a.cache&&m(a.cache)}catch(e){o.oR.error(e instanceof Error?e.message:String(e))}})},disabled:u,className:"gap-1 h-7 text-xs",children:[u?(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(i.A,{className:"h-3 w-3"}),d("aiSuggestions.recompute")]})]}),(0,a.jsxs)(g.Wu,{className:"space-y-2",children:[!c&&!u&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:d("aiSuggestions.intro")}),c&&0===c.items.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:d("aiSuggestions.nothingUrgent")}),(0,a.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:null==c?void 0:c.items.map((e,s)=>(0,a.jsxs)("div",{className:"rounded-md border bg-card p-3 space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(M.A,{className:"h-3.5 w-3.5 text-amber-500 mt-0.5 shrink-0"}),(0,a.jsx)("p",{className:"text-sm font-medium leading-snug flex-1",children:e.title})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e.why}),(0,a.jsx)(P,{rootId:t,item:e,router:f})]},s))}),c&&(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground pt-1",children:d.rich("aiSuggestions.generatedAt",{time:function(e,t){let s=Date.now()-Date.parse(e);if(!Number.isFinite(s)||s<0)return t("aiSuggestions.justNow");let a=Math.floor(s/6e4);if(a<1)return t("aiSuggestions.justNow");if(a<60)return t("aiSuggestions.minutesAgo",{count:a});let r=Math.floor(a/60);return r<24?t("aiSuggestions.hoursAgo",{count:r}):t("aiSuggestions.daysAgo",{count:Math.floor(r/24)})}(c.generatedAt,d),model:c.model,code:e=>(0,a.jsx)("code",{className:"font-mono",children:e})})})]})]})}function P(e){let{rootId:t,item:s,router:i}=e,[c,u]=(0,r.useTransition)(),h=(0,n.c)("roots"),{action:p}=s;if("none"===p.kind)return null;if("open-topic"===p.kind&&p.target)return(0,a.jsx)(l.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,a.jsxs)(m(),{href:"/roots/".concat(t,"/chat/").concat(p.target),children:[(0,a.jsx)(T.A,{className:"h-3 w-3"}),p.label]})});if("open-kb"===p.kind&&p.target){let e=p.target.split("/").map(encodeURIComponent).join("/");return(0,a.jsx)(l.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,a.jsxs)(m(),{href:"/roots/".concat(t,"/kb/").concat(e),children:[(0,a.jsx)(T.A,{className:"h-3 w-3"}),p.label]})})}return"send-message"===p.kind&&p.target?(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>{u(async()=>{try{let s=await (0,I.g)(t,p.target,[],void 0);if(!s.ok){var e;o.oR.error(null!=(e=s.error)?e:h("aiSuggestions.sendFailed"));return}(0,d.$d)(d.Zi.topicsChanged(t)),i.push("/roots/".concat(t,"/chat/").concat(s.topicId))}catch(e){o.oR.error(e instanceof Error?e.message:String(e))}})},disabled:c,children:[c?(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(D.A,{className:"h-3 w-3"}),p.label]}):null}var L=s(39624),z=s(71789),W=s(53732),F=s(43153),Z=s(13561);let $=(0,S.createServerReference)("4087a986d820b95d73e045597345add8b0babd3e20",S.callServer,void 0,S.findSourceMapURL,"listSuggestionsAction"),B=(0,S.createServerReference)("404ff320167b43ffa5cc3bd0e226190a76ea85ec82",S.callServer,void 0,S.findSourceMapURL,"approveSuggestionAction"),O=(0,S.createServerReference)("40227410fb430e137c1411c0a9f96bd65178628b54",S.callServer,void 0,S.findSourceMapURL,"rejectSuggestionAction");var K=s(13506);let G={utility:L.A,research:z.A,widget:W.A,goal:u.A,skill:M.A},H={utility:"text-emerald-600",research:"text-violet-600",widget:"text-blue-600",goal:"text-amber-600",skill:"text-pink-600"};function V(e){let{rootId:t}=e,s=(0,R.useRouter)(),[n,d]=(0,r.useState)([]),[c,m]=(0,r.useState)(!0),[u,h]=(0,r.useState)({}),[f,v]=(0,r.useTransition)(),b=(0,r.useCallback)(async()=>{let e=await $(t);m(!1),e.ok&&d(e.items)},[t]);return((0,r.useEffect)(()=>{b()},[b]),(0,r.useEffect)(()=>{let e=window.setInterval(()=>{"visible"===document.visibilityState&&b()},3e4);return()=>window.clearInterval(e)},[b]),c||0===n.length)?null:(0,a.jsxs)(g.Zp,{children:[(0,a.jsxs)(g.aR,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)(g.ZB,{className:"text-lg flex items-center gap-2",children:[(0,a.jsx)(U.A,{className:"h-4 w-4 text-amber-500"}),"Suggestions",(0,a.jsx)(p.E,{variant:"secondary",className:"ml-1",children:n.length})]}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>v(()=>b()),disabled:f,className:"h-7 gap-1",children:[(0,a.jsx)(i.A,{className:(0,K.cn)("h-3 w-3",f&&"animate-spin")}),"Refresh"]})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Hypotheses the agent put together from the onboarding chat. Approve to start a topic; dismiss to drop it (and remember you said no)."})]}),(0,a.jsx)(g.Wu,{className:"space-y-2",children:n.map(e=>{var r;let n=null!=(r=G[e.kind])?r:U.A,i=u[e.id];return(0,a.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,a.jsx)(n,{className:(0,K.cn)("h-4 w-4 mt-1 shrink-0",H[e.kind])}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-medium text-sm",children:e.title}),(0,a.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:e.kind})]}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 leading-snug",children:e.description}),e.prompt&&(0,a.jsx)("code",{className:"block mt-1 text-[10px] font-mono text-muted-foreground/70 truncate",children:e.prompt})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"default",disabled:!!i,onClick:()=>{h(t=>({...t,[e.id]:"approve"})),(async()=>{let a=await B({rootId:t,suggestionId:e.id});if(h(t=>({...t,[e.id]:null})),!a.ok){var r;o.oR.error(null!=(r=a.error)?r:"Failed to start topic");return}o.oR.success("Started: ".concat(e.title)),d(t=>t.filter(t=>t.id!==e.id)),s.push("/roots/".concat(t,"/chat/").concat(a.topicId))})()},className:"h-8 gap-1",children:["approve"===i?(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(F.A,{className:"h-3 w-3"}),"Approve"]}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"ghost",disabled:!!i,onClick:()=>{h(t=>({...t,[e.id]:"reject"})),(async()=>{let s=await O({rootId:t,suggestionId:e.id});if(h(t=>({...t,[e.id]:null})),!s.ok){var a;o.oR.error(null!=(a=s.error)?a:"Failed to reject");return}o.oR.success("Dismissed: ".concat(e.title)),d(t=>t.filter(t=>t.id!==e.id))})()},className:"h-8 gap-1 text-muted-foreground hover:text-destructive",children:["reject"===i?(0,a.jsx)(x.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(Z.A,{className:"h-3 w-3"}),"Dismiss"]})]})]},e.id)})})]})}var _=s(77364),q=s(93305),J=s(41379);let Y=(0,S.createServerReference)("603d7a1d2a8a93939e0b0776920d0536b0c12ea4af",S.callServer,void 0,S.findSourceMapURL,"saveWidgetOrderAction"),Q=(0,S.createServerReference)("60305aa98e61bd8af8cb924e439599f8c6580b8ec1",S.callServer,void 0,S.findSourceMapURL,"hideWidgetAction"),X={sm:2,md:3,wide:6},ee=["sys:active-goals","sys:pending","sys:recent-kb","sys:ai-suggestions"],et=[{id:"sys:active-goals",title:"Active goals & running agents",description:"Topics with an active /goal and a running orchestrator."},{id:"sys:pending",title:"Awaiting response",description:"Unanswered permission / question / mcp-add cards."},{id:"sys:recent-kb",title:"Recent in KB",description:"KB files modified in the last 72 hours."},{id:"sys:ai-suggestions",title:"What's next — Reflex suggestions",description:"Gemini-driven analysis of project state with actions."}],es=(0,S.createServerReference)("704a2283d9a78f2f24df0d9d51fde9b8341a0427b0",S.callServer,void 0,S.findSourceMapURL,"setWidgetSizeAction"),ea=[{mode:"sm",label:"S",titleKey:"widgetsCommon.sizeSm"},{mode:"md",label:"M",titleKey:"widgetsCommon.sizeMd"},{mode:"wide",label:"W",titleKey:"widgetsCommon.sizeWide"}];function er(e){let{rootId:t,widgetId:s,mode:i,onChanged:l}=e,d=(0,n.c)("roots"),[c,m]=(0,r.useTransition)();return(0,a.jsx)("div",{role:"radiogroup","aria-label":d("widgetsCommon.sizeAria"),className:"inline-flex items-center rounded border bg-background/80 backdrop-blur overflow-hidden text-[10px] leading-none",children:ea.map(e=>{let r=e.mode===i,n="sm"===e.mode?d("widgetsCommon.sizeSm"):"md"===e.mode?d("widgetsCommon.sizeMd"):d("widgetsCommon.sizeWide");return(0,a.jsx)("button",{type:"button",role:"radio","aria-checked":r,"aria-label":n,title:n,onClick:()=>{var a;(a=e.mode)!==i&&m(async()=>{let e=await es(t,s,a);if(!e.ok){var r;o.oR.error(null!=(r=e.error)?r:d("widgetsCommon.sizeFailed"));return}l()})},disabled:c,className:["px-1.5 py-0.5 font-mono transition-colors disabled:opacity-50",r?"bg-violet-600 text-white":"text-muted-foreground hover:bg-accent hover:text-foreground"].join(" "),children:e.label},e.mode)})})}function en(e){let t=X[e];return 2===t?"lg:col-span-2":3===t?"lg:col-span-3":"lg:col-span-6"}var ei=s(73600),eo=s(76974),el=s(72691),ed=s(22841),ec=s(97997);let em=(0,S.createServerReference)("78f78663f957901a906fea0e31a6c280b794074696",S.callServer,void 0,S.findSourceMapURL,"patchWidgetDataAction"),eu=(0,S.createServerReference)("70d1b1518de9d710010a2f55d357672197bef698cf",S.callServer,void 0,S.findSourceMapURL,"setWidgetRefreshAction"),ex=(0,S.createServerReference)("602af8fbe0c77f8d4db87df3a6d0eeefb78bedec64",S.callServer,void 0,S.findSourceMapURL,"refreshWidgetNowAction");function eh(e){let{rootId:t,widget:s,mode:i,onHide:l,hiding:d,onLayoutChanged:c,dnd:u}=e,x=(0,n.c)("roots"),[h,f]=(0,r.useTransition)(),v=u.dragging===s.id,b=u.dropTarget===s.id&&!v,j=en(i);return(0,a.jsxs)(g.Zp,{draggable:!0,onDragStart:e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",s.id),u.onDragStart(s.id)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",u.dropTarget!==s.id&&u.onDragOver(s.id)},onDrop:e=>{e.preventDefault(),u.onDrop(s.id)},onDragEnd:()=>u.onDragEnd(),className:[j,"transition-all",v?"opacity-50":"",b?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background":""].join(" "),children:[(0,a.jsxs)(g.aR,{className:"pb-2 flex flex-row items-start gap-2 space-y-0",children:[(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-grab active:cursor-grabbing mt-1 shrink-0","aria-label":x("widgetsCommon.dragHandle")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)(g.ZB,{className:"text-sm flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"truncate",children:s.title}),(0,a.jsx)(p.E,{variant:"outline",className:"text-[10px] font-mono shrink-0",children:s.kind})]}),s.description&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5 line-clamp-2",children:s.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 -mt-0.5 shrink-0",children:[(0,a.jsx)(er,{rootId:t,widgetId:s.id,mode:i,onChanged:c}),s.sourceTopicId&&(0,a.jsx)(m(),{href:"/roots/".concat(t,"/chat/").concat(s.sourceTopicId),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground","aria-label":x("widgetsCommon.editViaTopicAria"),title:x("widgetsCommon.editViaTopicTitle"),children:(0,a.jsx)(eo.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{type:"button",onClick:()=>f(async()=>{await Promise.resolve(),l(s.id)}),disabled:h||d,"aria-label":x("widgetsCommon.hideAria"),title:x("widgetsCommon.hideTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:(0,a.jsx)(Z.A,{className:"h-3.5 w-3.5"})})]})]}),(0,a.jsxs)(g.Wu,{className:"space-y-3",children:[(0,ec.v)(t,s.kind,s.data,{widgetId:s.id,onPatch:async e=>{let a=await em(t,s.id,e);if(!a.ok){var r,n;throw o.oR.error(null!=(r=a.error)?r:x("widgetsCommon.savePatchFailed")),Error(null!=(n=a.error)?n:x("widgetsCommon.patchFailed"))}}}),(0,a.jsx)(ep,{rootId:t,widget:s})]})]})}function ep(e){var t,s;let{rootId:l,widget:d}=e,c=(0,n.c)("roots"),[m,u]=(0,r.useTransition)(),[x,h]=(0,r.useTransition)(),p=null!=(t=d.refresh)?t:"manual",g=null!=(s=d.lastRefreshAt)?s:d.updatedAt;return d.sourceTopicId?(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t text-[11px] text-muted-foreground",children:[(0,a.jsx)(el.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"shrink-0",children:c("widgetsCommon.updatedAt",{time:function(e,t){let s=Date.now()-Date.parse(e);if(!Number.isFinite(s)||s<0)return t("widgetsCommon.justNow");let a=Math.floor(s/6e4);if(a<1)return t("widgetsCommon.justNow");if(a<60)return t("widgetsCommon.minutesAgo",{count:a});let r=Math.floor(a/60);return r<24?t("widgetsCommon.hoursAgo",{count:r}):t("widgetsCommon.daysAgo",{count:Math.floor(r/24)})}(g,c)})}),(0,a.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[(0,a.jsxs)(ed.l6,{value:p,onValueChange:e=>{h(async()=>{var t,s;let a=await eu(l,d.id,e);a.ok?o.oR.success("manual"===e?c("widgetsCommon.autoRefreshOff"):c("widgetsCommon.cadenceSet",{cadence:(s=e,c("hourly"===s?"widgetsCommon.cadenceHourly":"daily"===s?"widgetsCommon.cadenceDaily":"weekly"===s?"widgetsCommon.cadenceWeekly":"widgetsCommon.cadenceManual"))})):o.oR.error(null!=(t=a.error)?t:c("widgetsCommon.cadenceFailed"))})},disabled:x,children:[(0,a.jsx)(ed.bq,{className:"h-6 text-[10px] gap-1 px-1.5 w-auto min-w-[110px]",children:(0,a.jsx)(ed.yv,{})}),(0,a.jsxs)(ed.gC,{children:[(0,a.jsx)(ed.eb,{value:"manual",children:c("widgetsCommon.manual")}),(0,a.jsx)(ed.eb,{value:"hourly",children:c("widgetsCommon.hourly")}),(0,a.jsx)(ed.eb,{value:"daily",children:c("widgetsCommon.daily")}),(0,a.jsx)(ed.eb,{value:"weekly",children:c("widgetsCommon.weekly")})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{u(async()=>{var e;let t=await ex(l,d.id);t.ok?o.oR.success(c("widgetsCommon.refreshStarted")):o.oR.error(null!=(e=t.error)?e:c("widgetsCommon.refreshFailed"))})},disabled:m,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 hover:bg-accent text-foreground/80 hover:text-foreground",title:c("widgetsCommon.refreshNowTitle"),children:[(0,a.jsx)(i.A,{className:"h-3 w-3 ".concat(m?"animate-spin":"")}),c("widgetsCommon.refreshLabel")]})]})]}):null}var eg=s(84784),ef=s(41280),ev=s(46972),eb=s(80192),ej=s(62350);let ew=(0,S.createServerReference)("6065071e5b8323ef87f38e7c6932dbb2c1cdd68fef",S.callServer,void 0,S.findSourceMapURL,"deleteWidgetAction");function eN(e){let{rootId:t,open:s,onOpenChange:i,widgets:o,layout:d,onChanged:c}=e,m=(0,n.c)("roots");if((0,r.useEffect)(()=>{if(!s)return;let e=e=>{"Escape"===e.key&&i(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s,i]),!s)return null;let u=new Set(d.hidden);return(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:e=>{e.target===e.currentTarget&&i(!1)},children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>i(!1)}),(0,a.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,a.jsx)(q.A,{className:"h-4 w-4 text-violet-600"}),(0,a.jsx)("h2",{className:"text-sm font-medium flex-1",children:m("widgetsCommon.libraryTitle")}),(0,a.jsx)(l.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>i(!1),children:(0,a.jsx)(Z.A,{className:"h-4 w-4"})})]}),(0,a.jsx)(eb.F,{className:"flex-1 min-h-0",children:(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:m("widgetsCommon.systemWidgetsHeading")}),et.map(e=>(0,a.jsx)(ey,{rootId:t,id:e.id,title:e.title,description:e.description,badge:"system",badgeVariant:"default",hidden:u.has(e.id),canDelete:!1,onChanged:c},e.id))]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:m("widgetsCommon.userWidgetsHeading",{count:o.length})}),0===o.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:m("widgetsCommon.noUserWidgets")}),o.map(e=>{var s;return(0,a.jsx)(ey,{rootId:t,id:e.id,title:e.title,description:null!=(s=e.description)?s:"kind: ".concat(e.kind),badge:e.kind,badgeVariant:"outline",hidden:u.has(e.id),canDelete:!0,onChanged:c},e.id)})]})]})})]})]})}function ey(e){let{rootId:t,id:s,title:i,description:d,badge:c,badgeVariant:m,hidden:u,canDelete:x,onChanged:h}=e,g=(0,n.c)("roots"),[f,v]=(0,r.useTransition)();return(0,a.jsxs)("div",{className:"flex items-start gap-3 rounded-md border bg-card px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:i}),(0,a.jsx)(p.E,{variant:m,className:"text-[10px] font-mono",children:c}),u&&(0,a.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:g("widgetsCommon.hidden")})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:d})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)(l.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{v(async()=>{let e=u?await (0,ej.t)(t,s):await Q(t,s);if(!e.ok)return void o.oR.error(e.error);h()})},disabled:f,className:"gap-1 h-7 text-xs",children:u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eg.A,{className:"h-3 w-3"}),g("widgetsCommon.show")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ef.A,{className:"h-3 w-3"}),g("widgetsCommon.hide")]})}),x&&(0,a.jsx)(l.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>{confirm(g("widgetsCommon.deleteWidgetConfirm",{title:i}))&&v(async()=>{let e=await ew(t,s);if(!e.ok)return void o.oR.error(e.error);h()})},disabled:f,className:"h-7 w-7 text-muted-foreground hover:text-destructive",title:g("widgetsCommon.deleteForever"),children:(0,a.jsx)(ev.A,{className:"h-3.5 w-3.5"})})]})]})}function ek(e){let{rootId:t,widgets:s,layout:i,systemRenderers:d,snapshot:c,onLayoutChanged:m}=e,u=(0,n.c)("roots"),x=(0,r.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.id,t);return e},[s]),[h,p]=(0,r.useState)(i.order),[g,f]=(0,r.useState)(i.hidden),[,v]=(0,r.useTransition)(),[b,j]=(0,r.useState)(null),[w,N]=(0,r.useState)(null),[y,k]=(0,r.useState)(!1);eA(i.order,p),eA(i.hidden,f);let S=(0,r.useCallback)(e=>{p(e),v(async()=>{let s=await Y(t,e);s.ok?(p(s.layout.order),f(s.layout.hidden),m()):o.oR.error(s.error)})},[t,m]),A=(0,r.useCallback)(e=>{p(h.filter(t=>t!==e)),f(t=>[...new Set([e,...t])]),v(async()=>{let s=await Q(t,e);if(!s.ok)return void o.oR.error(s.error);p(s.layout.order),f(s.layout.hidden),m()})},[t,h,m]),C={onDragStart:e=>j(e),onDragOver:e=>N(e),onDrop:e=>{if(j(null),N(null),!b||b===e)return;let t=[...h],s=t.indexOf(b),a=t.indexOf(e);s<0||a<0||(t.splice(s,1),t.splice(a,0,b),S(t))},onDragEnd:()=>{j(null),N(null)},dragging:b,dropTarget:w};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:u("widgetsCommon.projectWidgetsTitle")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:u("widgetsCommon.projectWidgetsHint")})]}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"outline",onClick:()=>k(!0),className:"gap-1 h-8",children:[(0,a.jsx)(q.A,{className:"h-3.5 w-3.5"}),u("widgetsCommon.library",{count:g.length})]})]}),0===h.length&&(0,a.jsxs)("div",{className:"rounded-md border border-dashed bg-muted/20 p-6 text-center space-y-2",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:u.rich("widgetsCommon.emptyDashboard",{example:()=>(0,a.jsx)("em",{children:u("widgetsCommon.emptyDashboardExample")})})}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>k(!0),className:"gap-1",children:[(0,a.jsx)(J.A,{className:"h-3 w-3"}),u("widgetsCommon.restoreSystem")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-6 gap-4",children:h.map(e=>{var s,r;let n=x.get(e),o=null==(s=i.sizes)?void 0:s[e],l=null!=o?o:(null==(r=null==n?void 0:n.size)?void 0:r.mode)?r.mode:(null==r?void 0:r.cols)===1?"sm":(null==r?void 0:r.cols)===2?"md":(null==r?void 0:r.cols)===3?"wide":"md";return ee.includes(e)?(0,a.jsx)(eS,{rootId:t,id:e,node:d[e],onHide:A,dnd:C,mode:l,onLayoutChanged:m},e):n?(0,a.jsx)(eh,{rootId:t,widget:n,mode:l,onHide:A,hiding:!1,dnd:C,onLayoutChanged:m},e):null})}),(0,a.jsx)(eN,{open:y,onOpenChange:k,rootId:t,widgets:s,layout:{order:h,hidden:g},onChanged:()=>{m()}})]})}function eS(e){let{rootId:t,id:s,node:r,onHide:i,dnd:o,mode:l,onLayoutChanged:d}=e,c=(0,n.c)("roots"),m=o.dragging===s,u=o.dropTarget===s&&!m,x=en(l);return(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",s),o.onDragStart(s)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",o.dropTarget!==s&&o.onDragOver(s)},onDrop:e=>{e.preventDefault(),o.onDrop(s)},onDragEnd:()=>o.onDragEnd(),className:[x,"relative group/sys transition-all",m?"opacity-50":"",u?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background rounded-lg":""].join(" "),children:[r,(0,a.jsxs)("div",{className:"absolute top-2 right-2 opacity-0 group-hover/sys:opacity-100 transition-opacity flex items-center gap-1 bg-background/85 backdrop-blur rounded p-0.5",children:[(0,a.jsx)(er,{rootId:t,widgetId:s,mode:l,onChanged:d}),(0,a.jsx)("button",{type:"button",onClick:()=>i(s),"aria-label":c("widgetsCommon.hideAria"),title:c("widgetsCommon.hideSystemTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:"\xd7"})]})]})}function eA(e,t){(0,r.useMemo)(()=>{t(e)},[JSON.stringify(e)])}function eC(e){let{rootId:t,initialSnapshot:s}=e,c=(0,n.c)("roots"),[m,u]=(0,r.useState)(s),[x,h]=(0,r.useTransition)(),p=(0,r.useCallback)(()=>{h(async()=>{try{let s=await fetch("/api/roots/".concat(t,"/dashboard"),{cache:"no-store"}),a=await s.json();if(!a.ok||!a.snapshot){var e;o.oR.error(null!=(e=a.error)?e:c("dashboard.refreshFailed"));return}u(a.snapshot)}catch(e){o.oR.error(e instanceof Error?e.message:String(e))}})},[t,c]);(0,d.S9)(d.Zi.topicsChanged(t),p),(0,d.S9)(d.Zi.kbChanged(t),p),(0,r.useEffect)(()=>{let e=window.setInterval(()=>{"visible"===document.visibilityState&&p()},3e4);return()=>window.clearInterval(e)},[p]);let g={"sys:active-goals":(0,a.jsx)(f,{rootId:t,activeGoals:m.activeGoals,runningAgents:m.runningAgents}),"sys:pending":(0,a.jsx)(N,{rootId:t,items:m.pendingApprovals}),"sys:recent-kb":(0,a.jsx)(C,{rootId:t,items:m.recentKb}),"sys:ai-suggestions":(0,a.jsx)(E,{rootId:t,cache:m.suggestions})};return(0,a.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,a.jsxs)("div",{className:"p-6 space-y-5 max-w-6xl mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:c("dashboard.projectOverview")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:c("dashboard.projectOverviewHint")})]}),(0,a.jsxs)(l.$,{type:"button",size:"sm",variant:"ghost",onClick:p,disabled:x,className:"gap-1 h-8",children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5 ".concat(x?"animate-spin":"")}),c("dashboard.refresh")]})]}),(0,a.jsx)(V,{rootId:t}),(0,a.jsx)(ek,{rootId:t,widgets:m.widgets,layout:m.layout,systemRenderers:g,snapshot:m,onLayoutChanged:p}),(0,a.jsx)(_.MemoryEditor,{scope:"project",rootId:t,title:c("dashboard.memoryTitle"),description:c("dashboard.memoryHint")})]})})}},16256:(e,t,s)=>{"use strict";s.d(t,{B:()=>r});var a=s(7911);let r=(0,a.createServerReference)("00bfd42b1d960268fe98c533ae16efbd2a1602bb1b",a.callServer,void 0,a.findSourceMapURL,"listCuratedAction")},28148:(e,t,s)=>{"use strict";s.d(t,{AddUtilityButton:()=>A});var a=s(4624),r=s(99356),n=s(54400),i=s.n(n),o=s(69285),l=s(49411),d=s(39624),c=s(36059),m=s(13561),u=s(3239),x=s(39783),h=s(46972),p=s(43153),g=s(57751),f=s(56221),v=s(85253),b=s(16256),j=s(7911);let w=(0,j.createServerReference)("402ad60cde03a15ac9e7aeea6dc02126ceda113259",j.callServer,void 0,j.findSourceMapURL,"checkUtilityUpdatesAction"),N=(0,j.createServerReference)("40f5da1b6cee7fa4ed62bf83067448e7404d749f21",j.callServer,void 0,j.findSourceMapURL,"applyUtilityUpdateAction");var y=s(93783),k=s(59564),S=s(63514);function A(e){let{rootId:t,installed:s}=e,n=(0,l.c)("roots"),[j,A]=(0,r.useState)(!1),[C,R]=(0,r.useState)([]),[U,M]=(0,r.useState)(!1),[T,D]=(0,r.useState)(null),[I,E]=(0,r.useTransition)(),[P,L]=(0,r.useState)([]),z=(0,r.useRef)(null),W=(0,o.useRouter)(),F=new Set(s.map(e=>e.id)),Z=s.filter(e=>"project"===e.scope),$=new Map(P.map(e=>[e.id,e]));return(0,r.useEffect)(()=>{if(!j)return;let e=e=>{var t;(null==(t=z.current)?void 0:t.contains(e.target))||A(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[j]),(0,r.useEffect)(()=>{!j||C.length>0||U||(M(!0),(async()=>{try{let e=await (0,b.B)();R(e.items)}catch(e){f.oR.error(n("addUtility.loadCatalogFailed"))}finally{M(!1)}})())},[j,C.length,U]),(0,r.useEffect)(()=>{j&&0!==s.length&&(async()=>{let e=await w({rootId:t});e.ok&&L(e.updates)})()},[j,s.length,t]),(0,a.jsxs)("div",{className:"relative",ref:z,children:[(0,a.jsxs)(v.$,{type:"button",variant:"ghost",size:"sm",className:"gap-1",onClick:()=>A(e=>!e),title:n("addUtility.buttonTitle"),children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),n("addUtility.buttonLabel"),Z.length>0&&(0,a.jsx)("span",{className:"ml-1 text-[10px] rounded-full bg-violet-100 text-violet-700 px-1.5",children:Z.length}),P.length>0&&(0,a.jsxs)("span",{className:"ml-0.5 text-[10px] rounded-full bg-amber-100 text-amber-800 px-1.5 inline-flex items-center gap-0.5",title:n("addUtility.updatesTitle",{count:P.length}),children:[(0,a.jsx)(c.A,{className:"h-2.5 w-2.5"}),P.length]})]}),j&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-30 w-[440px] max-h-[75vh] overflow-y-auto rounded-lg border bg-popover shadow-lg",children:[(0,a.jsxs)("div",{className:"sticky top-0 bg-popover flex items-center gap-2 px-3 py-2 border-b",children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,a.jsx)("span",{className:"text-xs font-medium",children:n("addUtility.popoverTitle")}),(0,a.jsx)("button",{type:"button",onClick:()=>A(!1),className:"ml-auto p-0.5 rounded hover:bg-accent",children:(0,a.jsx)(m.A,{className:"h-3 w-3"})})]}),Z.length>0&&(0,a.jsxs)("section",{className:"p-2 border-b",children:[(0,a.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:n("addUtility.installedInProject")}),(0,a.jsx)("ul",{className:"space-y-1",children:Z.map(e=>{let s=$.get(e.id);return(0,a.jsxs)("li",{className:"flex items-center gap-1.5 rounded-md border bg-card px-2 py-1.5 text-xs",children:[(0,a.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"truncate font-medium",children:e.name}),s&&(0,a.jsxs)("div",{className:"text-[10px] text-amber-700 inline-flex items-center gap-0.5",children:[(0,a.jsx)(c.A,{className:"h-2.5 w-2.5"}),s.currentVersion," → ",s.latestVersion]})]}),s&&(0,a.jsxs)("button",{type:"button",onClick:()=>{D(s.id),E(async()=>{let e=await N({...s,rootId:t});if(D(null),!e.ok)return void f.oR.error(e.error);f.oR.success(n("addUtility.applyUpdateSuccess",{name:s.name,from:s.currentVersion,to:e.newVersion})),L(e=>e.filter(e=>e.id!==s.id)),(0,S.$d)(S.Zi.kbChanged(t)),W.refresh()})},disabled:I&&T===e.id,className:"text-[11px] rounded bg-amber-600 px-2 py-1 text-white hover:bg-amber-700 disabled:opacity-50 inline-flex items-center gap-0.5",title:n("addUtility.applyUpdateTitle"),children:[I&&T===e.id?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(c.A,{className:"h-3 w-3"}),n("addUtility.updateAction")]}),(0,a.jsx)(i(),{href:"/utilities/".concat(e.scope,"/").concat(e.id,"?rootId=").concat(encodeURIComponent(t)),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:n("addUtility.openAction"),children:(0,a.jsx)(x.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>{confirm(n("addUtility.removeConfirm",{name:e.name}))&&(D(e.id),E(async()=>{let s=await (0,k.j)(e.scope,e.id,"project"===e.scope?t:void 0);if(D(null),!s.ok){var a;f.oR.error(null!=(a=s.error)?a:n("addUtility.removeFailed"));return}f.oR.success(n("addUtility.removeSuccess",{name:e.name})),(0,S.$d)(S.Zi.kbChanged(t)),W.refresh()}))},disabled:I&&T===e.id,className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-50",title:n("addUtility.removeAction"),children:I&&T===e.id?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(h.A,{className:"h-3 w-3"})})]},e.id)})})]}),(0,a.jsxs)("section",{className:"p-2",children:[(0,a.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:n("addUtility.catalog")}),U?(0,a.jsxs)("div",{className:"px-2 py-4 text-xs text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}),n("addUtility.loading")]}):0===C.length?(0,a.jsx)("p",{className:"px-2 py-4 text-xs text-muted-foreground",children:n("addUtility.catalogEmpty")}):(0,a.jsx)("ul",{className:"space-y-1",children:C.map(e=>{let s=F.has(e.id),r=T===e.id&&I;return(0,a.jsx)("li",{className:"rounded-md border bg-card px-2 py-2",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("span",{className:"text-xl leading-none",children:e.emoji}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug",children:e.description})]}),s?(0,a.jsxs)("span",{className:"text-[10px] text-emerald-700 inline-flex items-center gap-0.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3"})," ",n("addUtility.already")]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{D(e.id),E(async()=>{var s;let a=null!=(s=e.suggestedScope)?s:"global",r=await (0,y.g)({github:e.github,scope:a,..."project"===a?{rootId:t}:{}});if(D(null),!r.ok)return void f.oR.error(r.error);f.oR.success(n("addUtility.installSuccess",{name:e.name})),(0,S.$d)(S.Zi.kbChanged(t)),W.refresh()})},disabled:r||I,className:"text-[11px] rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50 inline-flex items-center gap-0.5",children:[r?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(g.A,{className:"h-3 w-3"}),n("addUtility.add")]})]})},e.id)})})]})]})]})}},59564:(e,t,s)=>{"use strict";s.d(t,{j:()=>r});var a=s(7911);let r=(0,a.createServerReference)("706bccdf9a59e1e24328380cb605693693af6673d4",a.callServer,void 0,a.findSourceMapURL,"removeUtilityAction")},74962:(e,t,s)=>{"use strict";s.d(t,{RunInitButton:()=>u});var a=s(4624),r=s(99356),n=s(3239),i=s(67805),o=s(56221),l=s(85253),d=s(7911);let c=(0,d.createServerReference)("700c188bacfa63458a7ef635f04ec3bff8202f59c0",d.callServer,void 0,d.findSourceMapURL,"runInitAction");var m=s(63514);function u(e){let{rootPath:t,rootId:s}=e,[d,u]=(0,r.useTransition)();return(0,a.jsx)(l.$,{onClick:()=>u(async()=>{let e=o.oR.loading("Running agent — this can take a minute or two…"),a=await c(t,s,!1);if(o.oR.dismiss(e),a.ok)o.oR.success("Init complete"),(0,m.$d)(m.Zi.kbChanged(s)),(0,m.$d)(m.Zi.rootsChanged);else{var r;o.oR.error(null!=(r=a.error)?r:"Init failed")}}),disabled:d,children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"})," Running…"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.A,{className:"mr-2 h-4 w-4"})," Run init"]})})}},77364:(e,t,s)=>{"use strict";s.d(t,{MemoryEditor:()=>v});var a=s(4624),r=s(99356),n=s(56221),i=s(3239),o=s(85924),l=s(65714),d=s(46972),c=s(85253),m=s(4959),u=s(71651),x=s(13506),h=s(7911);let p=(0,h.createServerReference)("402c20ee9ffc2a44da3e1d2b4bb50488fab4d28c95",h.callServer,void 0,h.findSourceMapURL,"loadMemoryAction"),g=(0,h.createServerReference)("405553b2057ee0ed28180499aef130476e3c48afd4",h.callServer,void 0,h.findSourceMapURL,"saveMemoryFileAction"),f=(0,h.createServerReference)("40d5508d880eadcd5dc5088ed2f32c9fff17b4621c",h.callServer,void 0,h.findSourceMapURL,"wipeMemoryAction");function v(e){let{scope:t,rootId:s,title:n,description:l,allowWipe:d}=e,[c,u]=(0,r.useState)([]),[x,h]=(0,r.useState)(!0),[g,f]=(0,r.useState)(null),v=(0,r.useCallback)(async()=>{h(!0);let e=await p(s?{scope:t,rootId:s}:{scope:t});if(h(!1),!e.ok)return void f(e.error);f(null),u(e.files)},[t,s]);return(0,r.useEffect)(()=>{v()},[v]),(0,a.jsxs)(m.Zp,{children:[(0,a.jsx)(m.aR,{children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(m.ZB,{className:"text-lg",children:n}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:l})]}),d&&c.length>0&&(0,a.jsx)(j,{scope:t,rootId:s,onWiped:v})]})}),(0,a.jsx)(m.Wu,{children:x?(0,a.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Loading…"]}):g?(0,a.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-2",children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),g]}):(0,a.jsx)("div",{className:"space-y-4",children:c.map(e=>(0,a.jsx)(b,{snapshot:e,scope:t,rootId:s,onSaved:e=>u(t=>t.map(t=>t.file===e.file?e:t))},e.file))})})]})}function b(e){let{snapshot:t,scope:s,rootId:o,onSaved:d}=e,[m,h]=(0,r.useState)(t.content),[p,f]=(0,r.useTransition)();(0,r.useEffect)(()=>{h(t.content)},[t.content]);let v=m.trim(),b=v?v.split("\n").length:0,j=b>t.cap,w=b>.9*t.cap,N=m!==t.content;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-sm font-semibold",children:t.file}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:t.description})]}),(0,a.jsxs)("span",{className:(0,x.cn)("text-xs tabular-nums",j?"text-destructive font-medium":w?"text-amber-600":"text-muted-foreground"),children:[b,"/",t.cap]})]}),(0,a.jsx)(u.T,{value:m,onChange:e=>h(e.target.value),rows:Math.min(t.cap+2,Math.max(3,b+1)),placeholder:"Empty",className:"font-mono text-xs"}),(0,a.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,a.jsxs)(c.$,{type:"button",size:"sm",variant:N?"default":"ghost",disabled:!N||p||j,onClick:()=>{if(j)return void n.oR.error("".concat(t.file," exceeds ").concat(t.cap,"-line cap (").concat(b,"). Trim before saving."));f(async()=>{let e=await g({scope:s,...o?{rootId:o}:{},file:t.file,content:v});if(!e.ok){var a;n.oR.error(null!=(a=e.error)?a:"Save failed");return}n.oR.success("Saved ".concat(t.file)),d({...t,content:v,lines:e.lines})})},children:[p?(0,a.jsx)(i.A,{className:"mr-1 h-3 w-3 animate-spin"}):(0,a.jsx)(l.A,{className:"mr-1 h-3 w-3"}),"Save"]})})]})}function j(e){let{scope:t,rootId:s,onWiped:i}=e,[o,l]=(0,r.useTransition)();return(0,a.jsxs)(c.$,{type:"button",size:"sm",variant:"ghost",disabled:o,onClick:()=>{confirm("Erase ALL memory at this scope? Cannot be undone.")&&l(async()=>{let e=await f(s?{scope:t,rootId:s}:{scope:t});if(!e.ok){var a;n.oR.error(null!=(a=e.error)?a:"Wipe failed");return}n.oR.success("Memory wiped"),await i()})},className:"text-destructive hover:text-destructive",children:[(0,a.jsx)(d.A,{className:"mr-1 h-3 w-3"}),"Wipe all"]})}},81360:(e,t,s)=>{"use strict";s.d(t,{RemoveRootButton:()=>u});var a=s(4624),r=s(99356),n=s(46972),i=s(56221),o=s(69285),l=s(85253),d=s(7911);let c=(0,d.createServerReference)("40bf6e7de4f56fe8c58af9f0c03f55c332f9da4ace",d.callServer,void 0,d.findSourceMapURL,"removeRootAction");var m=s(63514);function u(e){let{id:t,path:s,redirectHome:d}=e,[u,x]=(0,r.useTransition)(),h=(0,o.useRouter)();return(0,a.jsx)(l.$,{variant:"ghost",size:"sm",disabled:u,title:"Delete Space",onClick:()=>{var e;confirm("Delete this Space?\n\n"+"Path: ".concat(s,"\n\n")+"This wipes the .reflex/ folder (KB, topics, memory, "+'suggestions, audit) and removes mentions of "'.concat(null!=(e=s.split("/").pop())?e:s,'" from global memory.\n\n')+"Your own files in the folder are NOT touched.\n\nThis cannot be undone.")&&x(async()=>{let e=await c(t);if(e.ok)i.oR.success("Space deleted"),(0,m.$d)(m.Zi.rootsChanged),d&&h.push("/");else{var s;i.oR.error(null!=(s=e.error)?s:"Failed to delete")}})},children:(0,a.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"})})}},93783:(e,t,s)=>{"use strict";s.d(t,{g:()=>r});var a=s(7911);let r=(0,a.createServerReference)("40dbfa88cb050ef7eba3c82d8b7538fe6bf9057610",a.callServer,void 0,a.findSourceMapURL,"installCuratedAction")}},e=>{e.O(0,[4400,4678,9776,6785,3335,9411,2038,8775,8566,2608,6226,4442,7922,4933,146,7358],()=>e(e.s=7530)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6388],{3239:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},13506:(e,t,s)=>{"use strict";s.d(t,{cn:()=>i});var r=s(47989),a=s(55701);function i(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}},15523:(e,t,s)=>{"use strict";s.d(t,{p:()=>i});var r=s(4624);s(99356);var a=s(13506);function i(e){let{className:t,type:s,...i}=e;return(0,r.jsx)("input",{type:s,"data-slot":"input",className:(0,a.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}},22841:(e,t,s)=>{"use strict";s.d(t,{bq:()=>u,eb:()=>m,gC:()=>p,l6:()=>d,yv:()=>c});var r=s(4624);s(99356);var a=s(69709),i=s(43153),n=s(59728),l=s(85314),o=s(13506);function d(e){let{...t}=e;return(0,r.jsx)(l.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,r.jsx)(l.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:s="default",children:i,...n}=e;return(0,r.jsxs)(l.Trigger,{"data-slot":"select-trigger","data-size":s,className:(0,o.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...n,children:[i,(0,r.jsx)(l.Icon,{asChild:!0,children:(0,r.jsx)(a.A,{className:"size-4 opacity-50"})})]})}function p(e){let{className:t,children:s,position:a="item-aligned",align:i="center",...n}=e;return(0,r.jsx)(l.Portal,{children:(0,r.jsxs)(l.Content,{"data-slot":"select-content",className:(0,o.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,align:i,...n,children:[(0,r.jsx)(h,{}),(0,r.jsx)(l.Viewport,{className:(0,o.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:s}),(0,r.jsx)(x,{})]})})}function m(e){let{className:t,children:s,...a}=e;return(0,r.jsxs)(l.Item,{"data-slot":"select-item",className:(0,o.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[(0,r.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(l.ItemIndicator,{children:(0,r.jsx)(i.A,{className:"size-4"})})}),(0,r.jsx)(l.ItemText,{children:s})]})}function h(e){let{className:t,...s}=e;return(0,r.jsx)(l.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,r.jsx)(n.A,{className:"size-4"})})}function x(e){let{className:t,...s}=e;return(0,r.jsx)(l.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,r.jsx)(a.A,{className:"size-4"})})}},28310:(e,t,s)=>{"use strict";s.d(t,{E:()=>o});var r=s(4624);s(99356);var a=s(60621),i=s(50362),n=s(13506);let l=(0,a.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:s="default",asChild:a=!1,...o}=e,d=a?i.bL:"span";return(0,r.jsx)(d,{"data-slot":"badge","data-variant":s,className:(0,n.cn)(l({variant:s}),t),...o})}},41379:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},43153:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},46484:(e,t,s)=>{"use strict";s.d(t,{WorkflowEditor:()=>C});var r=s(4624),a=s(99356),i=s(69285),n=s(49411),l=s(3239),o=s(46972),d=s(67805),c=s(41379),u=s(59728),p=s(69709),m=s(76974),h=s(65714),x=s(54400),v=s.n(x),f=s(56221),b=s(28310),g=s(85253),y=s(15523),w=s(71651),k=s(22841),j=s(7911);let N=(0,j.createServerReference)("609204a4c200758e30ad0033a637ffafb3c275fa0e",j.callServer,void 0,j.findSourceMapURL,"saveWorkflowAction"),P=(0,j.createServerReference)("6036906de6d190180f99685422b35d08680c7dd823",j.callServer,void 0,j.findSourceMapURL,"listRunsAction"),z=(0,j.createServerReference)("707fbdeef6f4d5fef6a89a0dd942717db05b6ca2dc",j.callServer,void 0,j.findSourceMapURL,"runWorkflowAction"),A=(0,j.createServerReference)("60377258f57ceda4d069f2d7d8a0f362b25f7aca5e",j.callServer,void 0,j.findSourceMapURL,"deleteWorkflowAction"),S=[{kind:"text-template",label:"Text template",description:"Assembles text from a template with substitutions from previous steps. Use as glue between steps before the next one.",defaultParams:{template:"Hello {{prev}}"},fields:[{key:"template",label:"Template",type:"text",hint:"Substitutions: {{prev}}, {{steps.<id>.output}}, {{input.<field>}}",placeholder:"Summary: {{prev}}"}]},{kind:"http-request",label:"HTTP request",description:"Makes an HTTP request (GET by default). Puts the response body into output as a string or JSON if application/json.",defaultParams:{url:"https://api.example.com/",method:"GET"},fields:[{key:"url",label:"URL",type:"url",placeholder:"https://…"},{key:"method",label:"Method",type:"select",options:["GET","POST","PUT","PATCH","DELETE"]},{key:"headers",label:"Headers (JSON)",type:"json",hint:'Example: {"Authorization":"Bearer …"}'},{key:"body",label:"Body",type:"text",hint:"Leave empty for GET"}]},{kind:"web-fetch",label:"Fetch page",description:"Requests a URL and returns the textual content. Convenient for parsing pages without HTTP-config pain.",defaultParams:{url:"https://example.com"},fields:[{key:"url",label:"URL",type:"url",placeholder:"https://…"}]},{kind:"ask-agent",label:"Ask the agent",description:"Runs a headless orchestrator agent with the given question. Output is the agent's reply (the full assistant text).",defaultParams:{prompt:"Briefly summarize: {{prev}}"},fields:[{key:"prompt",label:"Question for the agent",type:"text",placeholder:"Use {{prev}} to pass the input"}]},{kind:"kb-write",label:"Write to KB",description:"Saves to the knowledge base as a Markdown file with frontmatter (kind, title, body). Use the previous step's output as `body`.",defaultParams:{kind:"note",title:"From workflow {{workflow.label}}",body:"{{prev}}"},fields:[{key:"kind",label:"Kind",type:"string",placeholder:"note"},{key:"title",label:"Title",type:"string",placeholder:"{{workflow.label}}"},{key:"body",label:"Body (Markdown)",type:"text",placeholder:"{{prev}}"}]},{kind:"utility-call",label:"Call a mini-app",description:"Runs a named server action of an installed utility with the given args. Output = the action's result. utility-call lets the workflow use mini-app functions as a library.",defaultParams:{utilityId:"",utilityScope:"global",actionName:"",args:"{}"},fields:[{key:"utilityId",label:"Utility (id)",type:"string",placeholder:"my-utility"},{key:"utilityScope",label:"Scope",type:"select",options:["global","project"]},{key:"actionName",label:"Action",type:"string",placeholder:"name from manifest.serverActions"},{key:"args",label:"Arguments (JSON)",type:"json",hint:"Passed as the first argument to the action. {{prev}} substitutions work inside JSON strings."}]},{kind:"image-generate",label:"Generate an image",description:"Generates an image via Gemini Nano Banana or Codex `$imagegen`. Output: {url, sha, mime, provider} — `url` can be inserted into a kb-write body as ``.",defaultParams:{prompt:"cute raccoon in a spacesuit, watercolor",provider:"gemini",aspectRatio:"1:1"},fields:[{key:"prompt",label:"Prompt",type:"text",placeholder:"Image description"},{key:"provider",label:"Provider",type:"select",options:["gemini","codex"]},{key:"aspectRatio",label:"Aspect ratio",type:"select",options:["1:1","16:9","9:16","4:3","3:4","21:9"]},{key:"size",label:"Size (opt.)",type:"string",placeholder:"1024x1024"}]},{kind:"image-search",label:"Search images on the web",description:"Searches for ready-made images by query (Unsplash by default, Pexels as fallback). Output: {results: [{url, thumb, attribution}…]}.",defaultParams:{query:"mountains sunrise",provider:"unsplash",count:6},fields:[{key:"query",label:"Query",type:"string",placeholder:"mountains sunrise"},{key:"provider",label:"Provider",type:"select",options:["unsplash","pexels","brave"]},{key:"count",label:"Result count",type:"string",placeholder:"6"}]}];function E(e){var t;return null!=(t=S.find(t=>t.kind===e))?t:null}function C(e){var t;let{rootId:s,initial:u,initialRuns:p,readOnly:m,sourceUtilityId:h}=e,x=(0,n.c)("roots"),b=(0,i.useRouter)(),[w,j]=(0,a.useState)(u),[C,M]=(0,a.useState)(p),[O,_]=(0,a.useState)(null),[L,I]=(0,a.useState)("closed"),[U,$]=(0,a.useTransition)(),[H,V]=(0,a.useTransition)(),q=e=>{m||(j(e),V(async()=>{var t;let r=await N(s,e);r.ok||f.oR.error(null!=(t=r.error)?t:x("workflowEditor.saveFailed"))}))},D=async()=>{let e=await P(s,w.id);e.ok&&M(e.runs)},B=(e,t)=>{let s=e+t;if(s<0||s>=w.steps.length)return;let r=[...w.steps],a=r[e],i=r[s];r[e]=i,r[s]=a,q({...w,steps:r,updatedAt:new Date().toISOString()})};return(0,r.jsxs)("div",{className:"space-y-6",children:[m&&(0,r.jsxs)("div",{className:"rounded-md border border-violet-200 bg-violet-50 dark:bg-violet-950/20 px-4 py-2.5 text-xs text-violet-900 dark:text-violet-200",children:["Provided by the"," ",(0,r.jsx)("span",{className:"font-mono",children:null!=h?h:"utility"})," ","mini-app — managed by its manifest, so it's read-only here. You can still run it manually and review the history below."]}),(0,r.jsxs)("div",{className:"rounded-md border bg-card p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:x("workflowEditor.nameLabel")}),(0,r.jsx)(y.p,{value:w.label,onChange:e=>q({...w,label:e.target.value}),className:"text-sm",disabled:m})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:x("workflowEditor.descriptionLabel")}),(0,r.jsx)(y.p,{value:null!=(t=w.description)?t:"",onChange:e=>q({...w,description:e.target.value}),className:"text-sm",placeholder:x("workflowEditor.descriptionPlaceholder"),disabled:m})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:x("workflowEditor.triggerLabel")}),(0,r.jsxs)(k.l6,{value:w.trigger,onValueChange:e=>q({...w,trigger:e}),disabled:m,children:[(0,r.jsx)(k.bq,{className:"h-8 w-32",children:(0,r.jsx)(k.yv,{})}),(0,r.jsxs)(k.gC,{children:[(0,r.jsx)(k.eb,{value:"manual",children:x("workflowEditor.triggerManual")}),(0,r.jsx)(k.eb,{value:"hourly",children:x("workflowEditor.triggerHourly")}),(0,r.jsx)(k.eb,{value:"daily",children:x("workflowEditor.triggerDaily")}),(0,r.jsx)(k.eb,{value:"weekly",children:x("workflowEditor.triggerWeekly")})]})]})]}),w.sourceTopicId&&(0,r.jsx)(v(),{href:"/roots/".concat(s,"/chat/").concat(w.sourceTopicId),className:"text-xs text-muted-foreground hover:underline self-end pb-2",children:x("workflowEditor.editViaTopic")}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-2 self-end pb-1",children:[H&&(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[(0,r.jsx)(l.A,{className:"h-3 w-3 animate-spin inline mr-1"}),x("workflowEditor.saving")]}),!m&&(0,r.jsxs)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{confirm(x("workflowEditor.deleteConfirm",{label:w.label}))&&V(async()=>{let e=await A(s,w.id);if(!e.ok)return void f.oR.error(e.error);b.push("/roots/".concat(s,"/workflows"))})},disabled:H,className:"text-muted-foreground hover:text-destructive",children:[(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 mr-1"}),x("workflowEditor.delete")]}),(0,r.jsxs)(g.$,{type:"button",size:"sm",onClick:()=>{$(async()=>{let e=await z(s,w.id);if(!e.ok)return void f.oR.error(e.error);"completed"===e.run.status?f.oR.success(x("workflowEditor.completed")):"failed"===e.run.status&&f.oR.error(x("workflowEditor.failedRun")),D()})},disabled:U||0===w.steps.length,className:"gap-1",children:[U?(0,r.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(d.A,{className:"h-3.5 w-3.5"}),x("workflowEditor.run")]})]})]})]}),(0,r.jsxs)("section",{className:"space-y-2",children:[(0,r.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:x("workflowEditor.stepsHeading",{count:w.steps.length})}),w.steps.map((e,t)=>(0,r.jsx)(R,{step:e,idx:t,total:w.steps.length,readOnly:m,editing:O===e.id,onToggleEdit:()=>_(O===e.id?null:e.id),onMoveUp:()=>B(t,-1),onMoveDown:()=>B(t,1),onRemove:()=>(e=>{let t=w.steps.filter((t,s)=>s!==e);q({...w,steps:t,updatedAt:new Date().toISOString()})})(t),onChange:e=>((e,t)=>{let s=w.steps.map((s,r)=>r===e?{...s,...t}:s);q({...w,steps:s,updatedAt:new Date().toISOString()})})(t,e)},e.id)),"open"===L?(0,r.jsxs)("div",{className:"rounded-md border bg-card p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-xs font-medium",children:x("workflowEditor.pickStepKind")}),(0,r.jsx)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>I("closed"),className:"h-6 text-xs",children:x("workflowEditor.cancel")})]}),(0,r.jsx)("div",{className:"grid gap-1.5",children:S.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>(e=>{let t=E(e);if(!t)return;let s=function(e,t){let s=t.replace(/[^a-z0-9]/gi,"-"),r=1;for(;e.some(e=>e.id==="".concat(s,"-").concat(r));)r+=1;return"".concat(s,"-").concat(r)}(w.steps,e);q({...w,steps:[...w.steps,{id:s,kind:e,label:t.label,params:{...t.defaultParams}}],updatedAt:new Date().toISOString()}),I("closed"),_(s)})(e.kind),className:"text-left rounded-md border px-3 py-2 hover:bg-accent/60 transition",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:e.label}),(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:e.description})]},e.kind))})]}):m?null:(0,r.jsxs)(g.$,{type:"button",variant:"outline",size:"sm",onClick:()=>I("open"),className:"w-full gap-1 border-dashed",children:[(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"}),x("workflowEditor.addStep")]})]}),(0,r.jsx)(T,{runs:C,onRefresh:D})]})}function R(e){let{step:t,idx:s,total:a,readOnly:i,editing:l,onToggleEdit:d,onMoveUp:c,onMoveDown:x,onRemove:v,onChange:f}=e,j=(0,n.c)("roots"),N=E(t.kind);return(0,r.jsxs)("div",{className:"rounded-md border bg-card overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 group",children:[(0,r.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground w-6 text-center shrink-0",children:s+1}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate",children:t.label}),(0,r.jsx)(b.E,{variant:"outline",className:"text-[10px] font-mono",children:t.kind})]}),N&&(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground line-clamp-1 mt-0.5",children:N.description})]}),(0,r.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[!i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",onClick:c,disabled:0===s,className:"h-7 w-7",children:(0,r.jsx)(u.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",onClick:x,disabled:s===a-1,className:"h-7 w-7",children:(0,r.jsx)(p.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",onClick:d,className:"h-7 w-7",title:i?"View step config":void 0,children:(0,r.jsx)(m.A,{className:"h-3.5 w-3.5"})}),!i&&(0,r.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",onClick:v,className:"h-7 w-7 text-muted-foreground hover:text-destructive",children:(0,r.jsx)(o.A,{className:"h-3.5 w-3.5"})})]})]}),l&&(0,r.jsxs)("div",{className:"border-t bg-muted/30 px-3 py-3 space-y-2.5",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium text-muted-foreground",children:j("workflowEditor.labelField")}),(0,r.jsx)(y.p,{value:t.label,onChange:e=>f({label:e.target.value}),className:"h-8 text-sm"})]}),null==N?void 0:N.fields.map(e=>{var s;let a=null!=(s=t.params[e.key])?s:"";return(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium text-muted-foreground",children:e.label}),"select"===e.type&&e.options?(0,r.jsxs)(k.l6,{value:String(a||e.options[0]),onValueChange:s=>f({params:{...t.params,[e.key]:s}}),children:[(0,r.jsx)(k.bq,{className:"h-8 text-sm",children:(0,r.jsx)(k.yv,{})}),(0,r.jsx)(k.gC,{children:e.options.map(e=>(0,r.jsx)(k.eb,{value:e,children:e},e))})]}):"text"===e.type||"json"===e.type?(0,r.jsx)(w.T,{value:String(a),onChange:s=>f({params:{...t.params,[e.key]:s.target.value}}),placeholder:e.placeholder,rows:3,className:"text-sm font-mono"}):(0,r.jsx)(y.p,{value:String(a),onChange:s=>f({params:{...t.params,[e.key]:s.target.value}}),placeholder:e.placeholder,className:"h-8 text-sm font-mono"}),e.hint&&(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground",children:e.hint})]},e.key)}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:d,className:"h-7 text-xs gap-1",children:[(0,r.jsx)(h.A,{className:"h-3 w-3"}),j("workflowEditor.done")]})})]})]})}function T(e){let{runs:t,onRefresh:s}=e,i=(0,n.c)("roots"),[o,d]=(0,a.useTransition)();return 0===t.length?(0,r.jsxs)("section",{className:"space-y-2",children:[(0,r.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:i("workflowEditor.runHistory")}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:i("workflowEditor.noRuns")})]}):(0,r.jsxs)("section",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:i("workflowEditor.runHistory")}),(0,r.jsx)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>d(async()=>s()),disabled:o,className:"h-7 text-xs",children:o?(0,r.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):i("workflowEditor.refresh")})]}),(0,r.jsx)("ul",{className:"space-y-1.5",children:t.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)("details",{className:"rounded-md border bg-card",children:[(0,r.jsxs)("summary",{className:"cursor-pointer list-none flex items-center gap-2 px-3 py-2",children:[(0,r.jsx)(b.E,{variant:"completed"===e.status?"secondary":"failed"===e.status?"destructive":"outline",className:"text-[10px]",children:e.status}),(0,r.jsx)("span",{className:"text-xs font-mono truncate",children:e.id}),(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(e.startedAt).toLocaleString()})]}),(0,r.jsx)("div",{className:"px-3 pb-3 space-y-1.5",children:e.steps.map(e=>(0,r.jsxs)("div",{className:"text-xs rounded border bg-muted/30 px-2 py-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(b.E,{variant:"completed"===e.status?"secondary":"failed"===e.status?"destructive":"outline",className:"text-[10px]",children:e.status}),(0,r.jsx)("span",{className:"font-mono",children:e.stepId})]}),e.error&&(0,r.jsx)("pre",{className:"mt-1 text-[10px] text-destructive whitespace-pre-wrap",children:e.error}),void 0!==e.output&&(0,r.jsx)("pre",{className:"mt-1 text-[10px] text-muted-foreground whitespace-pre-wrap max-h-32 overflow-y-auto font-mono",children:function(e){try{if("string"==typeof e)return e.length>800?e.slice(0,800)+"…":e;let t=JSON.stringify(e,null,2);return t.length>800?t.slice(0,800)+"…":t}catch(t){return String(e)}}(e.output)})]},e.stepId))})]})},e.id))})]})}},46972:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},52515:(e,t,s)=>{Promise.resolve().then(s.bind(s,46484)),Promise.resolve().then(s.bind(s,91074)),Promise.resolve().then(s.bind(s,96253)),Promise.resolve().then(s.bind(s,28050)),Promise.resolve().then(s.bind(s,94904)),Promise.resolve().then(s.bind(s,13270)),Promise.resolve().then(s.bind(s,99730)),Promise.resolve().then(s.bind(s,89146)),Promise.resolve().then(s.bind(s,19078)),Promise.resolve().then(s.bind(s,67854)),Promise.resolve().then(s.bind(s,69050)),Promise.resolve().then(s.bind(s,63739)),Promise.resolve().then(s.bind(s,33976)),Promise.resolve().then(s.bind(s,12537)),Promise.resolve().then(s.bind(s,97485)),Promise.resolve().then(s.bind(s,41923)),Promise.resolve().then(s.bind(s,73868)),Promise.resolve().then(s.bind(s,53511)),Promise.resolve().then(s.bind(s,2018)),Promise.resolve().then(s.bind(s,18487)),Promise.resolve().then(s.bind(s,98346)),Promise.resolve().then(s.bind(s,14884)),Promise.resolve().then(s.bind(s,85314)),Promise.resolve().then(s.bind(s,17280)),Promise.resolve().then(s.bind(s,8855)),Promise.resolve().then(s.bind(s,86631)),Promise.resolve().then(s.bind(s,2604)),Promise.resolve().then(s.bind(s,27237)),Promise.resolve().then(s.bind(s,49455)),Promise.resolve().then(s.bind(s,39211)),Promise.resolve().then(s.bind(s,56360)),Promise.resolve().then(s.t.bind(s,54400,23))},59728:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},60621:(e,t,s)=>{"use strict";s.d(t,{F:()=>n});var r=s(47989);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.$,n=(e,t)=>s=>{var r;if((null==t?void 0:t.variants)==null)return i(e,null==s?void 0:s.class,null==s?void 0:s.className);let{variants:n,defaultVariants:l}=t,o=Object.keys(n).map(e=>{let t=null==s?void 0:s[e],r=null==l?void 0:l[e];if(null===t)return null;let i=a(t)||a(r);return n[e][i]}),d=s&&Object.entries(s).reduce((e,t)=>{let[s,r]=t;return void 0===r||(e[s]=r),e},{});return i(e,o,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:s,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,s]=e;return Array.isArray(s)?s.includes({...l,...d}[t]):({...l,...d})[t]===s})?[...e,s,r]:e},[]),null==s?void 0:s.class,null==s?void 0:s.className)}},65714:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},67805:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},69285:(e,t,s)=>{"use strict";var r=s(48849);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}})},69709:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},71651:(e,t,s)=>{"use strict";s.d(t,{T:()=>i});var r=s(4624);s(99356);var a=s(13506);function i(e){let{className:t,...s}=e;return(0,r.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...s})}},76974:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(45804).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},85253:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var r=s(4624);s(99356);var a=s(60621),i=s(50362),n=s(13506);let l=(0,a.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:s="default",size:a="default",asChild:o=!1,...d}=e,c=o?i.bL:"button";return(0,r.jsx)(c,{"data-slot":"button","data-variant":s,"data-size":a,className:(0,n.cn)(l({variant:s,size:a,className:t})),...d})}},91074:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>n});var r=s(4624);s(99356);var a=s(44188),i=s(13506);function n(e){let{className:t,orientation:s="horizontal",decorative:n=!0,...l}=e;return(0,r.jsx)(a.b,{"data-slot":"separator",decorative:n,orientation:s,className:(0,i.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}}},e=>{e.O(0,[4400,4678,9776,6785,3335,9411,4933,146,7358],()=>e(e.s=52515)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2699],{13506:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var n=r(47989),s=r(55701);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,n.$)(t))}},17414:(e,t,r)=>{Promise.resolve().then(r.bind(r,97243)),Promise.resolve().then(r.bind(r,91074)),Promise.resolve().then(r.bind(r,96253)),Promise.resolve().then(r.bind(r,28050)),Promise.resolve().then(r.bind(r,94904)),Promise.resolve().then(r.bind(r,13270)),Promise.resolve().then(r.bind(r,99730)),Promise.resolve().then(r.bind(r,89146)),Promise.resolve().then(r.bind(r,19078)),Promise.resolve().then(r.bind(r,67854)),Promise.resolve().then(r.bind(r,69050)),Promise.resolve().then(r.bind(r,63739)),Promise.resolve().then(r.bind(r,33976)),Promise.resolve().then(r.bind(r,12537)),Promise.resolve().then(r.bind(r,97485)),Promise.resolve().then(r.bind(r,41923)),Promise.resolve().then(r.bind(r,73868)),Promise.resolve().then(r.bind(r,53511)),Promise.resolve().then(r.bind(r,2018)),Promise.resolve().then(r.bind(r,18487)),Promise.resolve().then(r.bind(r,98346)),Promise.resolve().then(r.bind(r,14884)),Promise.resolve().then(r.bind(r,85314)),Promise.resolve().then(r.bind(r,17280)),Promise.resolve().then(r.bind(r,8855)),Promise.resolve().then(r.bind(r,86631)),Promise.resolve().then(r.bind(r,2604)),Promise.resolve().then(r.bind(r,27237)),Promise.resolve().then(r.bind(r,49455)),Promise.resolve().then(r.bind(r,39211)),Promise.resolve().then(r.bind(r,56360)),Promise.resolve().then(r.t.bind(r,54400,23))},27474:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(45804).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},28310:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var n=r(4624);r(99356);var s=r(60621),a=r(50362),i=r(13506);let o=(0,s.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r="default",asChild:s=!1,...l}=e,d=s?a.bL:"span";return(0,n.jsx)(d,{"data-slot":"badge","data-variant":r,className:(0,i.cn)(o({variant:r}),t),...l})}},32165:(e,t,r)=>{"use strict";r.d(t,{d:()=>i});var n=r(4624);r(99356);var s=r(8855),a=r(13506);function i(e){let{className:t,size:r="default",...i}=e;return(0,n.jsx)(s.Root,{"data-slot":"switch","data-size":r,className:(0,a.cn)("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 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 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",t),...i,children:(0,n.jsx)(s.Thumb,{"data-slot":"switch-thumb",className:(0,a.cn)("pointer-events-none block rounded-full bg-background 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 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}},60621:(e,t,r)=>{"use strict";r.d(t,{F:()=>i});var n=r(47989);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=n.$,i=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;let a=s(t)||s(n);return i[e][a]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return a(e,l,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...d}[t]):({...o,...d})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},91074:(e,t,r)=>{"use strict";r.d(t,{Separator:()=>i});var n=r(4624);r(99356);var s=r(44188),a=r(13506);function i(e){let{className:t,orientation:r="horizontal",decorative:i=!0,...o}=e;return(0,n.jsx)(s.b,{"data-slot":"separator",decorative:i,orientation:r,className:(0,a.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...o})}},97243:(e,t,r)=>{"use strict";r.d(t,{WorkflowRow:()=>u});var n=r(4624),s=r(99356),a=r(56221),i=r(27474),o=r(28310),l=r(32165),d=r(7911);let c=(0,d.createServerReference)("7092c553b3b3adb1104430279649f6d29d6d41e5e6",d.callServer,void 0,d.findSourceMapURL,"setWorkflowEnabledAction");function u(e){var t;let{rootId:r,wf:d,href:u}=e,[h,v]=(0,s.useState)(d.enabled),[m,b]=(0,s.useTransition)(),f="project"===d.source&&"manual"!==d.trigger;return(0,n.jsx)("div",{className:"rounded-md border bg-card hover:bg-accent/30 transition px-4 py-3",children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(i.A,{className:"h-4 w-4 mt-0.5 shrink-0 text-violet-600"}),(0,n.jsxs)("a",{href:u,className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)("span",{className:"text-sm font-medium truncate",children:d.label}),(0,n.jsx)(o.E,{variant:"outline",className:"text-[10px]",children:d.trigger}),(0,n.jsxs)(o.E,{variant:"secondary",className:"text-[10px]",children:[d.stepCount," ",1===d.stepCount?"step":"steps"]}),"utility"===d.source&&(0,n.jsxs)(o.E,{variant:"outline",className:"text-[10px] border-violet-300 text-violet-700",children:["from ",null!=(t=d.utilityId)?t:"utility"]}),"manual"!==d.trigger&&!h&&(0,n.jsx)(o.E,{variant:"outline",className:"text-[10px] border-amber-300 text-amber-700",children:"paused"})]}),d.description&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:d.description}),(0,n.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground mt-1 font-mono",children:[(0,n.jsx)("span",{children:d.id}),d.lastRun&&(0,n.jsxs)("span",{children:["last: ",function(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return"—";let r=Math.floor(t/1e3);if(r<60)return"".concat(r,"s ago");let n=Math.floor(r/60);if(n<60)return"".concat(n,"m ago");let s=Math.floor(n/60);return s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(d.lastRun.startedAt)," \xb7"," ",(0,n.jsx)("span",{className:"failed"===d.lastRun.status?"text-destructive":"running"===d.lastRun.status?"text-amber-700":"",children:d.lastRun.status})]}),d.nextRunAt&&h&&(0,n.jsxs)("span",{children:["next: ",function(e){let t=Date.parse(e)-Date.now();if(!Number.isFinite(t))return"—";if(t<=0)return"due";let r=Math.floor(t/1e3);if(r<60)return"in ".concat(r,"s");let n=Math.floor(r/60);if(n<60)return"in ".concat(n,"m");let s=Math.floor(n/60);return s<24?"in ".concat(s,"h"):"in ".concat(Math.floor(s/24),"d")}(d.nextRunAt)]})]})]}),"manual"!==d.trigger&&(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:h?"on":"off"}),(0,n.jsx)(l.d,{checked:h,onCheckedChange:e=>{v(e),b(async()=>{let t=await c(r,d.id,e);if(t.ok)a.oR.success(e?"Scheduler resumed":"Scheduler paused");else{var n;v(!e),a.oR.error(null!=(n=t.error)?n:"Couldn't change enabled state")}})},disabled:!f||m,"aria-label":"Toggle scheduler"})]})]})})}}},e=>{e.O(0,[4400,4678,9776,6785,3335,4933,146,7358],()=>e(e.s=17414)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9429],{1633:(e,t,r)=>{"use strict";r.d(t,{DirectoryPicker:()=>C});var a=r(4624),s=r(99356),n=r(69285),i=r(49411);let o=(0,r(45804).A)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);var l=r(3747),d=r(59728),c=r(42146),u=r(72754),h=r(3239),m=r(13561),p=r(69709),x=r(69205),v=r(9923),f=r(56221),b=r(85253),g=r(4959),j=r(15523),y=r(80192),k=r(91074),w=r(7911);let N=(0,w.createServerReference)("40c7fc93774a6aab338eb4b3994f3b0f9fbf2c1bab",w.callServer,void 0,w.findSourceMapURL,"addRootAction");var P=r(63514);let A=(0,w.createServerReference)("40153435813148091dea9679f7326f7fb238c2da92",w.callServer,void 0,w.findSourceMapURL,"browseAction"),S=(0,w.createServerReference)("6047bf1c84cef7ff7c6ec1d52fa302e66185e738ce",w.callServer,void 0,w.findSourceMapURL,"createDirectoryAction");function C(e){let{initialPath:t}=e,r=(0,i.c)("roots"),[p,x]=(0,s.useState)(t),[v,w]=(0,s.useState)(t),[C,R]=(0,s.useState)(null),[D,$]=(0,s.useState)([]),[_,E]=(0,s.useState)(t),[H,T]=(0,s.useState)(!1),[Z,B]=(0,s.useTransition)(),[O,V]=(0,s.useTransition)(),[U,q]=(0,s.useState)(!1),[I,W]=(0,s.useState)(""),[K,Q]=(0,s.useTransition)(),X=(0,n.useRouter)();(0,s.useEffect)(()=>{G(t)},[]);let G=e=>{B(async()=>{let t=await A(e);if(!t.ok){var r;f.oR.error(null!=(r=t.error)?r:"Failed to browse");return}x(t.path),w(t.path),R(t.parent),E(t.path),$(t.entries.filter(e=>e.isDir).map(e=>F(e.name,e.absPath,e.hidden)))})},J=async e=>{let t=function e(t,r){for(let a of t){if(a.absPath===r)return a;if(a.expanded){let t=e(a.children,r);if(t)return t}}return null}(D,e);if(!t)return;if(t.expanded)return void $(t=>L(t,e,e=>({...e,expanded:!1})));if(t.loaded)return void $(t=>L(t,e,e=>({...e,expanded:!0})));$(t=>L(t,e,e=>({...e,loading:!0})));let r=await A(e);if(!r.ok){var a;f.oR.error(null!=(a=r.error)?a:"Failed to browse"),$(t=>L(t,e,e=>({...e,loading:!1})));return}let s=r.entries.filter(e=>e.isDir).map(e=>F(e.name,e.absPath,e.hidden));$(t=>L(t,e,e=>({...e,loading:!1,loaded:!0,expanded:!0,children:s})))},Y=async e=>{if(e===p){let t=await A(e);t.ok&&$(t.entries.filter(e=>e.isDir).map(e=>F(e.name,e.absPath,e.hidden)));return}let t=await A(e);if(!t.ok)return;let r=t.entries.filter(e=>e.isDir).map(e=>F(e.name,e.absPath,e.hidden));$(t=>L(t,e,e=>({...e,children:r,loaded:!0,expanded:!0})))};return(0,a.jsxs)(g.Zp,{children:[(0,a.jsxs)(g.aR,{children:[(0,a.jsxs)(g.ZB,{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{children:"Browse"}),(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>G(t),disabled:Z,children:[(0,a.jsx)(o,{className:"mr-1 h-4 w-4"})," Home"]})]}),(0,a.jsxs)("form",{className:"flex gap-2 mt-2",onSubmit:e=>{e.preventDefault(),G(v)},children:[(0,a.jsx)(j.p,{value:v,onChange:e=>w(e.target.value),placeholder:"/absolute/path",className:"font-mono text-xs"}),(0,a.jsx)(b.$,{type:"submit",variant:"secondary",disabled:Z,children:(0,a.jsx)(l.A,{className:"h-4 w-4 ".concat(Z?"animate-spin":"")})})]})]}),(0,a.jsx)(k.Separator,{}),(0,a.jsx)(g.Wu,{className:"px-2 py-2",children:(0,a.jsxs)(y.F,{className:"h-[460px]",children:[(0,a.jsxs)("div",{className:"px-2 py-1 flex items-center gap-2",children:[(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",disabled:!C||Z,onClick:()=>C&&G(C),className:"h-8",children:[(0,a.jsx)(d.A,{className:"mr-1 h-4 w-4"})," Up"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>E(p),className:"flex-1 flex items-center gap-2 px-2 py-1 text-sm rounded-md hover:bg-accent ".concat(_===p?"bg-accent":""),title:p,children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate font-mono text-xs",children:"."}),(0,a.jsxs)("span",{className:"text-muted-foreground text-[11px] truncate",children:["(",M(p),")"]})]}),(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",disabled:Z||K,onClick:()=>{q(e=>!e),W("")},className:"h-8",title:r("picker.createFolderTitle",{parent:M(_)}),children:[(0,a.jsx)(u.A,{className:"mr-1 h-4 w-4"})," ",r("picker.createButton")]}),(0,a.jsxs)("label",{className:"flex items-center gap-1 text-xs text-muted-foreground select-none",children:[(0,a.jsx)("input",{type:"checkbox",checked:H,onChange:e=>T(e.target.checked)}),"hidden"]})]}),U&&(0,a.jsxs)("form",{className:"px-2 pb-2 flex items-center gap-2",onSubmit:e=>{e.preventDefault();let t=I.trim();t&&Q(async()=>{let e=await S(_,t);if(!e.ok){var a;f.oR.error(null!=(a=e.error)?a:r("picker.createFolderFailed"));return}f.oR.success(r("picker.folderCreated")),q(!1),W(""),await Y(_),E(e.path)})},children:[(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground font-mono truncate max-w-[40%]",children:[_,"/"]}),(0,a.jsx)(j.p,{autoFocus:!0,value:I,onChange:e=>W(e.target.value),placeholder:r("picker.newFolderPlaceholder"),className:"h-8 text-sm flex-1",disabled:K,onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),q(!1),W(""))}}),(0,a.jsxs)(b.$,{type:"submit",size:"sm",disabled:K||!I.trim(),className:"h-8",children:[K?(0,a.jsx)(h.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(u.A,{className:"mr-1 h-3.5 w-3.5"}),r("picker.createButton")]}),(0,a.jsx)(b.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{q(!1),W("")},className:"h-8",children:(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})})]}),(0,a.jsx)(k.Separator,{className:"my-1"}),Z?(0,a.jsxs)("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:[(0,a.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"})," Loading…"]}):0===D.length?(0,a.jsx)("div",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:"No subdirectories."}):(0,a.jsx)(z,{nodes:D,selected:_,onSelect:E,onToggle:J,showHidden:H,depth:0})]})}),(0,a.jsx)(k.Separator,{}),(0,a.jsxs)(g.wL,{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"text-xs text-muted-foreground font-mono truncate",children:["Selected: ",_]}),(0,a.jsx)(b.$,{onClick:()=>{V(async()=>{let e=await N(_);if(!e.ok){var t;f.oR.error(null!=(t=e.error)?t:"Failed to add");return}f.oR.success("Directory added"),(0,P.$d)(P.Zi.rootsChanged),e.onboardingTopicId?X.push("/roots/".concat(e.id,"/chat/").concat(e.onboardingTopicId)):X.push("/roots/".concat(e.id))})},disabled:O||Z,children:O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"})," Adding…"]}):"Add this directory"})]})]})}function z(e){let{nodes:t,selected:r,onSelect:s,onToggle:n,showHidden:i,depth:o}=e;return(0,a.jsx)("ul",{children:t.filter(e=>i||!e.hidden).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)(R,{node:e,depth:o,selected:r,onSelect:s,onToggle:n}),e.expanded&&e.children.length>0&&(0,a.jsx)(z,{nodes:e.children,selected:r,onSelect:s,onToggle:n,showHidden:i,depth:o+1}),e.expanded&&e.loaded&&0===e.children.length&&(0,a.jsx)("div",{className:"text-xs text-muted-foreground italic px-2 py-1",style:{paddingLeft:16*o+44},children:"(empty)"})]},e.absPath))})}function R(e){let{node:t,depth:r,selected:s,onSelect:n,onToggle:i}=e,o=s===t.absPath;return(0,a.jsxs)("div",{className:"group flex items-center gap-1 pr-2 py-1 rounded-md hover:bg-accent/60 ".concat(o?"bg-accent":""),style:{paddingLeft:16*r+4},children:[(0,a.jsx)("button",{type:"button",onClick:()=>i(t.absPath),className:"h-6 w-6 flex items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":t.expanded?"Collapse":"Expand",children:t.loading?(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 animate-spin"}):t.expanded?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(x.A,{className:"h-3.5 w-3.5"})}),(0,a.jsxs)("button",{type:"button",onClick:()=>n(t.absPath),onDoubleClick:()=>i(t.absPath),className:"flex-1 min-w-0 flex items-center gap-2 text-left text-sm",children:[t.expanded?(0,a.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}):(0,a.jsx)(v.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate ".concat(t.hidden?"opacity-60":""),children:t.name})]})]})}function F(e,t,r){return{name:e,absPath:t,hidden:r,loaded:!1,loading:!1,expanded:!1,children:[]}}function L(e,t,r){return e.map(e=>e.absPath===t?r(e):e.children.length>0?{...e,children:L(e.children,t,r)}:e)}function M(e){var t;let r=e.split("/").filter(Boolean);return null!=(t=r[r.length-1])?t:e}},3239:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3747:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},4959:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var a=r(4624);r(99356);var s=r(13506);function n(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,s.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...r})}function i(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("leading-none font-semibold",t),...r})}function l(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...r})}function d(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center px-6 [.border-t]:pt-6",t),...r})}},9923:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("Folder",[["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"}]])},13506:(e,t,r)=>{"use strict";r.d(t,{cn:()=>n});var a=r(47989),s=r(55701);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,a.$)(t))}},13561:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},15523:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(4624);r(99356);var s=r(13506);function n(e){let{className:t,type:r,...n}=e;return(0,a.jsx)("input",{type:r,"data-slot":"input",className:(0,s.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...n})}},32740:(e,t,r)=>{Promise.resolve().then(r.bind(r,1633)),Promise.resolve().then(r.bind(r,96253)),Promise.resolve().then(r.bind(r,28050)),Promise.resolve().then(r.bind(r,94904)),Promise.resolve().then(r.bind(r,13270)),Promise.resolve().then(r.bind(r,99730)),Promise.resolve().then(r.bind(r,89146)),Promise.resolve().then(r.bind(r,19078)),Promise.resolve().then(r.bind(r,67854)),Promise.resolve().then(r.bind(r,69050)),Promise.resolve().then(r.bind(r,63739)),Promise.resolve().then(r.bind(r,33976)),Promise.resolve().then(r.bind(r,12537)),Promise.resolve().then(r.bind(r,97485)),Promise.resolve().then(r.bind(r,41923)),Promise.resolve().then(r.bind(r,73868)),Promise.resolve().then(r.bind(r,53511)),Promise.resolve().then(r.bind(r,2018)),Promise.resolve().then(r.bind(r,18487)),Promise.resolve().then(r.bind(r,98346)),Promise.resolve().then(r.bind(r,14884)),Promise.resolve().then(r.bind(r,85314)),Promise.resolve().then(r.bind(r,17280)),Promise.resolve().then(r.bind(r,8855)),Promise.resolve().then(r.bind(r,86631)),Promise.resolve().then(r.bind(r,2604)),Promise.resolve().then(r.bind(r,27237)),Promise.resolve().then(r.bind(r,49455)),Promise.resolve().then(r.bind(r,39211)),Promise.resolve().then(r.bind(r,56360)),Promise.resolve().then(r.t.bind(r,54400,23))},42146:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},59728:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},60621:(e,t,r)=>{"use strict";r.d(t,{F:()=>i});var a=r(47989);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=a.$,i=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],a=null==o?void 0:o[e];if(null===t)return null;let n=s(t)||s(a);return i[e][n]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return n(e,l,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...d}[t]):({...o,...d})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},63514:(e,t,r)=>{"use strict";r.d(t,{$d:()=>n,S9:()=>i,Zi:()=>s});var a=r(99356);let s={rootsChanged:"reflex:roots-changed",topicsChanged:e=>"reflex:topics-changed:".concat(e),kbChanged:e=>"reflex:kb-changed:".concat(e)};function n(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function i(e,t){(0,a.useEffect)(()=>{let r=e=>t(e.detail);return window.addEventListener(e,r),()=>window.removeEventListener(e,r)},[e,t])}},69205:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},69285:(e,t,r)=>{"use strict";var a=r(48849);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}})},69709:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},72754:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(45804).A)("FolderPlus",[["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"}]])},80192:(e,t,r)=>{"use strict";r.d(t,{F:()=>i});var a=r(4624);r(99356);var s=r(14884),n=r(13506);function i(e){let{className:t,children:r,...i}=e;return(0,a.jsxs)(s.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...i,children:[(0,a.jsx)(s.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:r}),(0,a.jsx)(o,{}),(0,a.jsx)(s.Corner,{})]})}function o(e){let{className:t,orientation:r="vertical",...i}=e;return(0,a.jsx)(s.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:r,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",t),...i,children:(0,a.jsx)(s.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},85253:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(4624);r(99356);var s=r(60621),n=r(50362),i=r(13506);let o=(0,s.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:r="default",size:s="default",asChild:l=!1,...d}=e,c=l?n.bL:"button";return(0,a.jsx)(c,{"data-slot":"button","data-variant":r,"data-size":s,className:(0,i.cn)(o({variant:r,size:s,className:t})),...d})}},91074:(e,t,r)=>{"use strict";r.d(t,{Separator:()=>i});var a=r(4624);r(99356);var s=r(44188),n=r(13506);function i(e){let{className:t,orientation:r="horizontal",decorative:i=!0,...o}=e;return(0,a.jsx)(s.b,{"data-slot":"separator",decorative:i,orientation:r,className:(0,n.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...o})}}},e=>{e.O(0,[4400,4678,9776,6785,3335,9411,4933,146,7358],()=>e(e.s=32740)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{447:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var s=a(7911);let r=(0,s.createServerReference)("4075d44f247542613eeee0bc7505c689034714102a",s.callServer,void 0,s.findSourceMapURL,"saveGeminiKeyAction")},2434:(e,t,a)=>{"use strict";a.d(t,{J:()=>r});var s=a(7911);let r=(0,s.createServerReference)("40875f5effa14f102708d783ecda73c2715799e17b",s.callServer,void 0,s.findSourceMapURL,"getOAuthClientAction")},4959:(e,t,a)=>{"use strict";a.d(t,{BT:()=>o,Wu:()=>c,ZB:()=>l,Zp:()=>n,aR:()=>i,wL:()=>d});var s=a(4624);a(99356);var r=a(13506);function n(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",t),...a})}function c(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",t),...a})}},13506:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(47989),r=a(55701);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},15523:(e,t,a)=>{"use strict";a.d(t,{p:()=>n});var s=a(4624);a(99356);var r=a(13506);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...n})}},17121:(e,t,a)=>{Promise.resolve().then(a.bind(a,51252)),Promise.resolve().then(a.bind(a,91074)),Promise.resolve().then(a.bind(a,96253)),Promise.resolve().then(a.bind(a,28050)),Promise.resolve().then(a.bind(a,94904)),Promise.resolve().then(a.bind(a,13270)),Promise.resolve().then(a.bind(a,99730)),Promise.resolve().then(a.bind(a,89146)),Promise.resolve().then(a.bind(a,19078)),Promise.resolve().then(a.bind(a,67854)),Promise.resolve().then(a.bind(a,69050)),Promise.resolve().then(a.bind(a,63739)),Promise.resolve().then(a.bind(a,33976)),Promise.resolve().then(a.bind(a,12537)),Promise.resolve().then(a.bind(a,97485)),Promise.resolve().then(a.bind(a,41923)),Promise.resolve().then(a.bind(a,73868)),Promise.resolve().then(a.bind(a,53511)),Promise.resolve().then(a.bind(a,2018)),Promise.resolve().then(a.bind(a,18487)),Promise.resolve().then(a.bind(a,98346)),Promise.resolve().then(a.bind(a,14884)),Promise.resolve().then(a.bind(a,85314)),Promise.resolve().then(a.bind(a,17280)),Promise.resolve().then(a.bind(a,8855)),Promise.resolve().then(a.bind(a,86631)),Promise.resolve().then(a.bind(a,2604)),Promise.resolve().then(a.bind(a,27237)),Promise.resolve().then(a.bind(a,49455)),Promise.resolve().then(a.bind(a,39211)),Promise.resolve().then(a.bind(a,56360)),Promise.resolve().then(a.t.bind(a,54400,23))},22841:(e,t,a)=>{"use strict";a.d(t,{bq:()=>m,eb:()=>x,gC:()=>u,l6:()=>c,yv:()=>d});var s=a(4624);a(99356);var r=a(69709),n=a(43153),i=a(59728),l=a(85314),o=a(13506);function c(e){let{...t}=e;return(0,s.jsx)(l.Root,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,s.jsx)(l.Value,{"data-slot":"select-value",...t})}function m(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(l.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...i,children:[n,(0,s.jsx)(l.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function u(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(l.Portal,{children:(0,s.jsxs)(l.Content,{"data-slot":"select-content",className:(0,o.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(h,{}),(0,s.jsx)(l.Viewport,{className:(0,o.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(p,{})]})})}function x(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(l.Item,{"data-slot":"select-item",className:(0,o.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(l.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(l.ItemText,{children:a})]})}function h(e){let{className:t,...a}=e;return(0,s.jsx)(l.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function p(e){let{className:t,...a}=e;return(0,s.jsx)(l.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},22914:(e,t,a)=>{"use strict";a.d(t,{o:()=>r});var s=a(7911);let r=(0,s.createServerReference)("00cfd11d87898110247aaf8bd50ba239b87c8aaad9",s.callServer,void 0,s.findSourceMapURL,"listOAuthStatusesAction")},27344:(e,t,a)=>{"use strict";a.d(t,{N:()=>r});var s=a(7911);let r=(0,s.createServerReference)("00bf2ed558954da84ef1a017e0c8acd1eff544205f",s.callServer,void 0,s.findSourceMapURL,"getTunnelStatusAction")},28310:(e,t,a)=>{"use strict";a.d(t,{E:()=>o});var s=a(4624);a(99356);var r=a(60621),n=a(50362),i=a(13506);let l=(0,r.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a="default",asChild:r=!1,...o}=e,c=r?n.bL:"span";return(0,s.jsx)(c,{"data-slot":"badge","data-variant":a,className:(0,i.cn)(l({variant:a}),t),...o})}},32165:(e,t,a)=>{"use strict";a.d(t,{d:()=>i});var s=a(4624);a(99356);var r=a(8855),n=a(13506);function i(e){let{className:t,size:a="default",...i}=e;return(0,s.jsx)(r.Root,{"data-slot":"switch","data-size":a,className:(0,n.cn)("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 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 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",t),...i,children:(0,s.jsx)(r.Thumb,{"data-slot":"switch-thumb",className:(0,n.cn)("pointer-events-none block rounded-full bg-background 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 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}},49881:(e,t,a)=>{"use strict";a.d(t,{Xi:()=>d,av:()=>m,j7:()=>c,tU:()=>l});var s=a(4624);a(99356);var r=a(60621),n=a(86631),i=a(13506);function l(e){let{className:t,orientation:a="horizontal",...r}=e;return(0,s.jsx)(n.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:(0,i.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}let o=(0,r.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function c(e){let{className:t,variant:a="default",...r}=e;return(0,s.jsx)(n.List,{"data-slot":"tabs-list","data-variant":a,className:(0,i.cn)(o({variant:a}),t),...r})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,i.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,i.cn)("flex-1 outline-none",t),...a})}},51252:(e,t,a)=>{"use strict";a.d(t,{SettingsForm:()=>eY});var s=a(4624),r=a(99356),n=a(69285),i=a(49411),l=a(3747),o=a(3239),c=a(65714),d=a(58726),m=a(52584),u=a(56221),x=a(85253),h=a(4959),p=a(15523),g=a(78825),f=a(32165),v=a(17280),b=a(13506);function j(e){let{className:t,defaultValue:a,value:n,min:i=0,max:l=100,...o}=e,c=r.useMemo(()=>Array.isArray(n)?n:Array.isArray(a)?a:[i,l],[n,a,i,l]);return(0,s.jsxs)(v.Root,{"data-slot":"slider",defaultValue:a,value:n,min:i,max:l,className:(0,b.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[(0,s.jsx)(v.Track,{"data-slot":"slider-track",className:(0,b.cn)("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,s.jsx)(v.Range,{"data-slot":"slider-range",className:(0,b.cn)("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(e,t)=>(0,s.jsx)(v.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},t))]})}var N=a(28310),y=a(22841),w=a(22281);let k=["analyze","chat","rag","embed","quick"],S={analyze:{title:"Analyze",help:"Builds and refreshes the knowledge base. Agentic — runs through Claude Code or Codex with file-write tools."},chat:{title:"Chat",help:"Interactive chat over a folder's KB. Agentic — uses the same harness as analyze by default."},rag:{title:"RAG",help:"Answer questions over the KB without an agent loop. Single-shot LLM call against indexed content."},embed:{title:"Embeddings",help:"Vectorize MD files for retrieval. Ollama runs embedding models locally (e.g. nomic-embed-text)."},quick:{title:"Quick actions",help:"Tiny one-shot calls — generates topic titles, summary snippets, labels. Pick a fast/cheap model."}},R=w.Ik({"claude-code":w.Ik({enabled:w.zM().default(!0)}),codex:w.Ik({enabled:w.zM().default(!0)}),ollama:w.Ik({enabled:w.zM().default(!0),baseUrl:w.Yj().url().default("http://localhost:11434")})}),A=w.Ik({harness:w.k5(["claude-code","codex","ollama"]),model:w.Yj().min(1),allowedTools:w.YO(w.Yj()).default([])}),C=["en","ru"],T=["auto","jpeg","webp","original"],z=w.Ik({enabled:w.zM().default(!0),maxDimension:w.ai().int().min(256).max(8192).default(2e3),quality:w.ai().int().min(40).max(100).default(85),format:w.k5(T).default("auto")});w.Ik({version:w.eu(1).default(1),language:w.Yj().min(1).default("en"),onboardedAt:w.Yj().optional(),userName:w.Yj().default(""),timezone:w.Yj().default(""),uiMode:w.k5(["simple","advanced"]).default("simple"),imageProcessing:z.default({enabled:!0,maxDimension:2e3,quality:85,format:"auto"}),harnesses:R.default({"claude-code":{enabled:!0},codex:{enabled:!0},ollama:{enabled:!0,baseUrl:"http://localhost:11434"}}),assignments:w.Ik({analyze:A,chat:A,rag:A,embed:A,quick:A}).default({analyze:{harness:"claude-code",model:"claude-opus-4-7",allowedTools:["Read","Write","Edit","LS","Glob","Grep","WebSearch","WebFetch"]},chat:{harness:"claude-code",model:"claude-sonnet-4-6",allowedTools:["Read","LS","Glob","Grep","WebSearch","WebFetch"]},rag:{harness:"ollama",model:"llama3.1:8b",allowedTools:[]},embed:{harness:"ollama",model:"nomic-embed-text",allowedTools:[]},quick:{harness:"claude-code",model:"claude-haiku-4-5",allowedTools:[]}}),mapServices:w.Ik({enabled:w.YO(w.Yj()).default(["google","yandex","apple","osm"])}).default({enabled:["google","yandex","apple","osm"]}),ngrok:w.Ik({authtoken:w.Yj().default(""),apiKey:w.Yj().default(""),domain:w.Yj().default(""),port:w.ai().int().min(1).max(65535).default(3210)}).default({authtoken:"",apiKey:"",domain:"",port:3210})}).parse({});var M=a(8096),L=a(13704),U=a(57118),P=a(71651),F=a(49881),E=a(7911);let J=(0,E.createServerReference)("00a8b72de0d171c8383e1662039bbc47725f66f5fc",E.callServer,void 0,E.findSourceMapURL,"listTemplatesAction"),I=(0,E.createServerReference)("4099a5a4e898dc158f743499ab6333a6f90a23abf2",E.callServer,void 0,E.findSourceMapURL,"loadTemplateAction"),_=(0,E.createServerReference)("40b1a8ab5e651c8c26d5a39d180c679f3a99b7b64c",E.callServer,void 0,E.findSourceMapURL,"mergeTemplateAction"),O=(0,E.createServerReference)("608b9ecf8e7fc1d9b45c018cdbd9c81111017ab246",E.callServer,void 0,E.findSourceMapURL,"saveTemplateAction"),W=(0,E.createServerReference)("407aebc790a95a9d84901291061febd96bab52528b",E.callServer,void 0,E.findSourceMapURL,"resetTemplateAction"),B={body:"",defaultBody:"",missingSections:[],path:"",loading:!0,saving:!1,resetting:!1,merging:!1,variables:[]};function $(){let e=(0,i.c)("settings"),[t,a]=(0,r.useState)([]),[n,l]=(0,r.useState)(null),[d,m]=(0,r.useState)({}),[,p]=(0,r.useTransition)(),[,g]=(0,r.useTransition)();(0,r.useEffect)(()=>{(async()=>{let e=await J();a(e),e[0]&&l(e[0].name);let t={};for(let a of e)t[a.name]={...B};for(let a of(m(t),e))f(a.name)})()},[]);let f=async e=>{m(t=>{var a;return{...t,[e]:{...null!=(a=t[e])?a:B,loading:!0}}});let t=await I(e);if(!t.ok){u.oR.error("Load failed: ".concat(t.error)),m(t=>{var a;return{...t,[e]:{...null!=(a=t[e])?a:B,loading:!1}}});return}m(a=>({...a,[e]:{body:t.body,defaultBody:t.defaultBody,missingSections:t.missingSections,path:t.path,loading:!1,saving:!1,resetting:!1,merging:!1,variables:t.variables}}))};return 0===t.length?(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"py-6 text-sm text-muted-foreground",children:[(0,s.jsx)(o.A,{className:"inline h-4 w-4 animate-spin mr-2"})," Loading templates…"]})}):(0,s.jsxs)(F.tU,{value:null!=n?n:t[0].name,onValueChange:l,children:[(0,s.jsx)(F.j7,{children:t.map(e=>(0,s.jsx)(F.Xi,{value:e.name,children:e.label},e.name))}),t.map(t=>{var a;let r=null!=(a=d[t.name])?a:B;return(0,s.jsx)(F.av,{value:t.name,className:"mt-3",children:(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-6 space-y-3",children:[r.missingSections.length>0&&(0,s.jsxs)("div",{className:"rounded border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900 flex items-start gap-2",children:[(0,s.jsx)(M.A,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsx)("div",{className:"font-medium",children:e("promptTemplates.templateUpdated",{count:r.missingSections.length})}),(0,s.jsxs)("div",{className:"text-amber-800/80",children:[e("promptTemplates.missingFromYours")," ",r.missingSections.map((e,t)=>(0,s.jsxs)("span",{children:[(0,s.jsxs)("code",{className:"font-mono",children:["## ",e]}),t<r.missingSections.length-1?", ":""]},e))]})]}),(0,s.jsxs)(x.$,{size:"sm",variant:"outline",onClick:()=>{var a;d[a=t.name]&&(m(e=>{var t;return{...e,[a]:{...null!=(t=e[a])?t:B,merging:!0}}}),(async()=>{let t=await _(a);if(!t.ok){u.oR.error("Merge failed: ".concat(t.error)),m(e=>{var t;return{...e,[a]:{...null!=(t=e[a])?t:B,merging:!1}}});return}u.oR.success(0===t.appended.length?e("promptTemplates.merged"):e("promptTemplates.mergedAppended",{count:t.appended.length,names:t.appended.join(", ")})),m(e=>{var s;return{...e,[a]:{...null!=(s=e[a])?s:B,body:t.body,missingSections:[],merging:!1}}})})())},disabled:r.merging||r.saving||r.resetting,className:"border-amber-400 hover:bg-amber-100 shrink-0",children:[r.merging?(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(L.A,{className:"mr-1 h-3.5 w-3.5"}),e("promptTemplates.addMissing")]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Variables:"}),r.variables.map(e=>(0,s.jsx)(N.E,{variant:"outline",className:"font-mono",children:"{{".concat(e,"}}")},e))]}),(0,s.jsx)(P.T,{value:r.body,onChange:e=>{var a,s;return a=t.name,s=e.target.value,void m(e=>{var t;let r=null!=(t=e[a])?t:B;return{...e,[a]:{...r,body:s}}})},rows:18,className:"font-mono text-xs",disabled:r.loading,placeholder:r.loading?"loading…":""}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground font-mono truncate",children:r.path}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{var e;return e=t.name,void(confirm("Reset ".concat(e,".md to the default template?"))&&g(async()=>{var t;let a=null!=(t=d[e])?t:B;m(t=>({...t,[e]:{...a,resetting:!0}}));let s=await W(e);m(t=>{var a;let r=null!=(a=t[e])?a:B;return{...t,[e]:{...r,resetting:!1,...s.ok&&s.body?{body:s.body}:{}}}}),s.ok?u.oR.success("".concat(e,".md reset")):u.oR.error("Reset failed: ".concat(s.error))}))},disabled:r.resetting||r.saving,children:[(0,s.jsx)(U.A,{className:"mr-1 h-4 w-4 ".concat(r.resetting?"animate-spin":"")}),"Reset to default"]}),(0,s.jsx)(x.$,{type:"button",size:"sm",onClick:()=>{var e;return e=t.name,void p(async()=>{let t=d[e];if(!t)return;m(a=>({...a,[e]:{...t,saving:!0}}));let a=await O(e,t.body);m(t=>{var a;let s=null!=(a=t[e])?a:B;return{...t,[e]:{...s,saving:!1}}}),a.ok?u.oR.success("".concat(e,".md saved")):u.oR.error("Save failed: ".concat(a.error))})},disabled:r.saving||r.loading,children:r.saving?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.A,{className:"mr-1 h-4 w-4 animate-spin"})," ","Saving…"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.A,{className:"mr-1 h-4 w-4"})," Save template"]})})]})]})]})})},t.name)})]})}var D=a(487),H=a(35687),q=a(46972),K=a(41379),Z=a(13561);let G=(0,E.createServerReference)("406b691cdb4871d06c62bc76a75596bb1ccbe51d96",E.callServer,void 0,E.findSourceMapURL,"startMcpSetupAction"),V=(0,E.createServerReference)("00d175deb99eae1eeb0b9d30dcb894c8d9aef9a77c",E.callServer,void 0,E.findSourceMapURL,"listMcpServersAction"),Y=(0,E.createServerReference)("40c7f2c249b85f3d2e4d993e10ca53ebc4d1143d70",E.callServer,void 0,E.findSourceMapURL,"removeMcpServerAction"),X=(0,E.createServerReference)("402d596f75333e2d16d532c9e4e75e6661e67486bf",E.callServer,void 0,E.findSourceMapURL,"testMcpServerAction"),Q=(0,E.createServerReference)("40492609d3f4f28ad3fb18dc8b3ca549ec933ac68b",E.callServer,void 0,E.findSourceMapURL,"addMcpServerAction");function ee(){let e=(0,i.c)("settings"),[t,a]=(0,r.useState)([]),[l,c]=(0,r.useTransition)(),[d,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),[v,b]=(0,r.useTransition)(),j=(0,n.useRouter)(),y=()=>{let t=g.trim();if(!t)return void u.oR.error(e("mcpServers.wizardDescribeError"));b(async()=>{let a=await G(t);if(!a.ok)return void u.oR.error(a.error);u.oR.success(e("mcpServers.wizardOpenedToast")),f(""),j.push("/roots/".concat(a.rootId,"/chat/").concat(a.topicId))})},w=()=>{c(async()=>{let e=await V();if(!e.ok)return void u.oR.error(e.error);a(e.servers)})};(0,r.useEffect)(()=>{w()},[]);let k=async t=>{if(!confirm(e("mcpServers.removeConfirm",{id:t})))return;let a=await Y(t);if(!a.ok){var s;u.oR.error(null!=(s=a.error)?s:"fail");return}u.oR.success(e("mcpServers.removedToast")),w()};return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(h.Zp,{className:"reflex-gradient p-[2px]",children:(0,s.jsxs)("div",{className:"rounded-[7px] bg-background/95 p-4 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(D.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{children:e("mcpServers.wizardTitle")})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e("mcpServers.wizardDescription")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.p,{value:g,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),y())},placeholder:e("mcpServers.wizardPlaceholder"),disabled:v,className:"flex-1"}),(0,s.jsxs)(x.$,{type:"button",onClick:y,disabled:v||!g.trim(),className:"gap-2",children:[v?(0,s.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(M.A,{className:"h-4 w-4"}),e("mcpServers.wizardRun")]})]}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground",children:e("mcpServers.wizardFooter")})]})}),l&&0===t.length?(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"py-6 text-sm text-muted-foreground",children:[(0,s.jsx)(o.A,{className:"inline h-4 w-4 animate-spin mr-2"})," ",e("mcpServers.loading")]})}):0===t.length?(0,s.jsx)(h.Zp,{className:"border-dashed",children:(0,s.jsx)(h.Wu,{className:"py-6 text-sm text-muted-foreground text-center",children:e.rich("mcpServers.emptyHint",{code:e=>(0,s.jsx)("code",{children:e})})})}):(0,s.jsx)("div",{className:"space-y-2",children:t.map(t=>{var a;return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"py-3 px-4 flex items-center gap-3",children:[(0,s.jsx)(H.A,{className:"h-4 w-4 text-muted-foreground"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-sm",children:t.id}),(0,s.jsx)(N.E,{variant:"outline",className:"text-[10px]",children:t.config.transport}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground truncate",children:t.label})]}),(0,s.jsx)("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:"stdio"===t.config.transport?"".concat(t.config.command," ").concat((null!=(a=t.config.args)?a:[]).join(" ")):t.config.url}),t.description&&(0,s.jsx)("div",{className:"text-[11px] text-muted-foreground truncate",children:t.description})]}),(0,s.jsx)(x.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>void k(t.id),title:e("mcpServers.removeTitle"),className:"h-8 w-8",children:(0,s.jsx)(q.A,{className:"h-3.5 w-3.5"})})]})},t.id)})}),d?(0,s.jsx)(et,{existingIds:t.map(e=>e.id),onCancel:()=>m(!1),onAdded:()=>{m(!1),w()}}):(0,s.jsxs)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(!0),className:"gap-2 text-muted-foreground",children:[(0,s.jsx)(K.A,{className:"h-4 w-4"}),e("mcpServers.addManual")]})]})}function et(e){var t;let{existingIds:a,onCancel:n,onAdded:l}=e,c=(0,i.c)("settings"),[m,f]=(0,r.useState)(""),[v,b]=(0,r.useState)(""),[j,N]=(0,r.useState)(""),[w,k]=(0,r.useState)("stdio"),[S,R]=(0,r.useState)(""),[A,C]=(0,r.useState)(""),[T,z]=(0,r.useState)(""),[M,L]=(0,r.useState)(""),[U,F]=(0,r.useState)(""),[E,J]=(0,r.useState)(null),[I,_]=(0,r.useTransition)(),[O,W]=(0,r.useTransition)(),B=()=>{if("stdio"===w){if(!S.trim())return{ok:!1,error:"command required"};try{let e=T.trim()?JSON.parse(T):{};return{ok:!0,config:{transport:"stdio",command:S.trim(),args:A.trim()?A.trim().split(/\s+/).filter(Boolean):[],env:e}}}catch(e){return{ok:!1,error:"env must be JSON object"}}}if(!M.trim())return{ok:!1,error:"URL required"};try{let e=U.trim()?JSON.parse(U):{};return{ok:!0,config:{transport:w,url:M.trim(),headers:e}}}catch(e){return{ok:!1,error:"headers must be JSON object"}}};return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(H.A,{className:"h-4 w-4"})," ",c("mcpServers.form.title")]}),(0,s.jsx)(x.$,{type:"button",size:"icon",variant:"ghost",onClick:n,className:"h-7 w-7",children:(0,s.jsx)(Z.A,{className:"h-3.5 w-3.5"})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"ID (kebab-case)"}),(0,s.jsx)(p.p,{value:m,onChange:e=>f(e.target.value),placeholder:"github",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Label"}),(0,s.jsx)(p.p,{value:v,onChange:e=>b(e.target.value),placeholder:"GitHub",className:"text-sm"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:c("mcpServers.form.descriptionLabel")}),(0,s.jsx)(p.p,{value:j,onChange:e=>N(e.target.value),placeholder:c("mcpServers.form.descriptionPlaceholder"),className:"text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Transport"}),(0,s.jsxs)(y.l6,{value:w,onValueChange:e=>k(e),children:[(0,s.jsx)(y.bq,{className:"w-48",children:(0,s.jsx)(y.yv,{})}),(0,s.jsxs)(y.gC,{children:[(0,s.jsx)(y.eb,{value:"stdio",children:"stdio (subprocess)"}),(0,s.jsx)(y.eb,{value:"http",children:"HTTP (Streamable)"}),(0,s.jsx)(y.eb,{value:"sse",children:"SSE (legacy)"})]})]})]}),"stdio"===w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Command"}),(0,s.jsx)(p.p,{value:S,onChange:e=>R(e.target.value),placeholder:"npx",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Args"}),(0,s.jsx)(p.p,{value:A,onChange:e=>C(e.target.value),placeholder:"-y @modelcontextprotocol/server-github",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Env (JSON, optional)"}),(0,s.jsx)(P.T,{value:T,onChange:e=>z(e.target.value),placeholder:'{"GITHUB_TOKEN": "ghp_…"}',className:"font-mono text-xs",rows:3})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"URL"}),(0,s.jsx)(p.p,{value:M,onChange:e=>L(e.target.value),placeholder:"https://example.com/mcp",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Headers (JSON, optional)"}),(0,s.jsx)(P.T,{value:U,onChange:e=>F(e.target.value),placeholder:'{"Authorization": "Bearer …"}',className:"font-mono text-xs",rows:3})]})]}),E&&(0,s.jsxs)("div",{className:"rounded border border-emerald-300 bg-emerald-50 px-3 py-2 text-xs flex items-center gap-2 text-emerald-900",children:[(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:c.rich("mcpServers.form.connectedTo",{mono:e=>(0,s.jsx)("span",{className:"font-mono",children:e}),name:null!=(t=E.serverName)?t:c("mcpServers.form.anonymousName"),count:E.toolsCount})})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,s.jsxs)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{let e=B();if(!e.ok)return void u.oR.error(e.error);J(null),_(async()=>{var t;let a=await X(e.config);if(!a.ok)return void u.oR.error("Connect failed: "+a.error);J({...a.serverName?{serverName:a.serverName}:{},toolsCount:a.tools.length}),v||b(null!=(t=a.serverName)?t:m)})},disabled:I,children:[I?(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):null,c("mcpServers.form.testButton")]}),(0,s.jsxs)(x.$,{type:"button",size:"sm",onClick:()=>{let e=m.trim().toLowerCase();if(!e)return void u.oR.error("id required");if(a.includes(e))return void u.oR.error('id "'.concat(e,'" already used'));if(!v.trim())return void u.oR.error("label required");let t=B();if(!t.ok)return void u.oR.error(t.error);W(async()=>{let a=await Q({id:e,label:v.trim(),description:j.trim(),config:t.config});if(!a.ok)return void u.oR.error(a.error);u.oR.success(c("mcpServers.form.addedToast",{id:e})),l()})},disabled:O||!E,children:[O?(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):null,c("mcpServers.form.saveButton")]})]}),!E&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:c("mcpServers.form.testFirstHint")})]})})}var ea=a(94151),es=a(43153),er=a(69709),en=a(85924),ei=a(39783),el=a(25104),eo=a(66459),ec=a(22914),ed=a(2434),em=a(92091),eu=a(64963);let ex=(0,E.createServerReference)("400941101a0ae73de307e87bac6f0a44dc5de4f599",E.callServer,void 0,E.findSourceMapURL,"probeOAuthAction"),eh=(0,E.createServerReference)("40f1328b4c07215deeeac75b0f5c64e40f5afe735b",E.callServer,void 0,E.findSourceMapURL,"disconnectOAuthAction"),ep=(0,E.createServerReference)("400d5eea889ca51cb4d8feb02a3d9ba6bd4516c050",E.callServer,void 0,E.findSourceMapURL,"deleteOAuthClientAction"),eg=(0,E.createServerReference)("40487e9c66991ab320ee66ec109f6319590ae384d3",E.callServer,void 0,E.findSourceMapURL,"removeCustomOAuthProviderAction"),ef=(0,E.createServerReference)("40923e2bc784a28f531119e5e584c43588ebe0eaad",E.callServer,void 0,E.findSourceMapURL,"addCustomOAuthProviderAction");function ev(){let e=(0,i.c)("settings"),[t,a]=(0,r.useState)([]),[n,l]=(0,r.useTransition)(),[c,d]=(0,r.useState)(!1),m=()=>{l(async()=>{let e=await (0,ec.o)();if(!e.ok)return void u.oR.error(e.error);a(e.statuses)})};return((0,r.useEffect)(()=>{m()},[]),n&&0===t.length)?(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"py-6 text-sm text-muted-foreground",children:[(0,s.jsx)(o.A,{className:"inline h-4 w-4 animate-spin mr-2"})," ",e("oauth.loading")]})}):(0,s.jsxs)("div",{className:"space-y-2",children:[t.map(e=>(0,s.jsx)(eb,{status:e,onChanged:m},e.id)),c?(0,s.jsx)(ej,{existingIds:t.map(e=>e.id),onCancel:()=>d(!1),onAdded:()=>{d(!1),m()}}):(0,s.jsxs)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(!0),className:"gap-2 text-muted-foreground",children:[(0,s.jsx)(K.A,{className:"h-4 w-4"}),e("oauth.addCustomButton")]})]})}function eb(e){let{status:t,onChanged:a}=e,n=(0,i.c)("settings"),[l,d]=(0,r.useState)(!1),[m,f]=(0,r.useState)(null),[v,b]=(0,r.useState)([]),[j,y]=(0,r.useState)(""),[w,k]=(0,r.useState)(""),[S,R]=(0,r.useState)(""),[A,C]=(0,r.useTransition)(),[T,z]=(0,r.useTransition)(),[M,L]=(0,r.useTransition)();(0,r.useEffect)(()=>{l&&(async()=>{let e=await (0,ed.J)(t.id);if(!e.ok)return u.oR.error(e.error);f(e.client),b(e.defaultScopes),e.client&&(y(e.client.clientId),R(e.client.scopes.join(" ")))})()},[l]);let P=async()=>{if(!confirm(n("oauth.disconnectConfirm",{label:t.label})))return;let e=await eh(t.id);if(!e.ok)return void u.oR.error(e.error);u.oR.success(n("oauth.disconnectedToast")),a()},F=async()=>{if(!confirm(n("oauth.forgetClientConfirm",{label:t.label})))return;let e=await ep(t.id);if(!e.ok)return void u.oR.error(e.error);u.oR.success(n("oauth.forgottenToast")),f(null),y(""),R(""),a()};return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"py-3 px-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(ea.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:t.label}),(0,s.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:t.id}),"user"===t.origin&&(0,s.jsx)(N.E,{variant:"outline",className:"text-[10px]",children:"custom"}),t.hasClient?t.hasTokens?(0,s.jsxs)(N.E,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(es.A,{className:"h-3 w-3"})," ",n("oauth.authorized")]}):(0,s.jsx)(N.E,{variant:"outline",className:"border-amber-400 text-amber-700",children:n("oauth.readyToAuthorize")}):(0,s.jsx)(N.E,{variant:"outline",children:n("oauth.notConfigured")}),t.hasTokens&&t.expiresAt&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("oauth.expiresAt",{time:new Date(t.expiresAt).toLocaleTimeString()})})]})}),(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>d(e=>!e),className:"gap-1",children:[(0,s.jsx)(er.A,{className:"h-3.5 w-3.5 transition-transform ".concat(l?"rotate-180":"")}),l?n("oauth.collapse"):n("oauth.configure")]})]}),l&&(0,s.jsxs)("div",{className:"mt-4 pl-7 space-y-3 border-l-2 ml-1.5",children:[t.setupHint&&(0,s.jsxs)("div",{className:"rounded border border-amber-200 bg-amber-50 px-3 py-2 text-[11px] text-amber-900 flex items-start gap-2",children:[(0,s.jsx)(en.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),(0,s.jsx)("span",{children:t.setupHint})]}),(0,s.jsxs)("a",{href:t.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-violet-700 hover:underline",children:[(0,s.jsx)(ei.A,{className:"h-3 w-3"}),n("oauth.openConsole",{label:t.label})]}),t.setupSteps&&t.setupSteps.length>0&&(0,s.jsxs)("div",{className:"rounded border border-violet-200 bg-violet-50/30 p-3",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-2",children:n("oauth.stepByStep")}),(0,s.jsx)(eo.O,{steps:t.setupSteps})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:"Client ID"}),(0,s.jsx)(p.p,{value:j,onChange:e=>y(e.target.value),placeholder:"123456789-xxxxx.apps.googleusercontent.com",className:"font-mono text-xs h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(g.J,{className:"text-xs",children:[n("oauth.clientSecretLabel"),(null==m?void 0:m.hasSecret)&&(0,s.jsx)("span",{className:"ml-2 text-muted-foreground",children:n("oauth.clientSecretSaved")})]}),(0,s.jsx)(p.p,{type:"password",value:w,onChange:e=>k(e.target.value),placeholder:(null==m?void 0:m.hasSecret)?"••••":"GOCSPX-…",className:"font-mono text-xs h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(g.J,{className:"text-xs",children:[n("oauth.scopesLabel")," ",(0,s.jsx)("span",{className:"text-muted-foreground",children:n("oauth.scopesDefault",{scopes:v.join(" ")||"—"})})]}),(0,s.jsx)(p.p,{value:S,onChange:e=>R(e.target.value),placeholder:v.join(" "),className:"font-mono text-xs h-8"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,s.jsxs)(x.$,{type:"button",size:"sm",onClick:()=>{C(async()=>{let e=S.trim().split(/[\s,]+/).filter(e=>e.length>0),s=await (0,em.S)({provider:t.id,clientId:j,...w?{clientSecret:w}:{},...e.length>0?{scopes:e}:{}});if(!s.ok)return void u.oR.error(s.error);u.oR.success(n("oauth.savedToast")),k(""),a();let r=await (0,ed.J)(t.id);r.ok&&f(r.client)})},disabled:A||!j.trim(),children:[A?(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(c.A,{className:"mr-1 h-3.5 w-3.5"}),n("oauth.saveButton")]}),(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"outline",onClick:()=>{z(async()=>{let e=await (0,eu.T)(t.id);if(!e.ok)return void u.oR.error(e.error);window.open(e.authorizeUrl,"reflex-oauth","width=600,height=720,noopener=no")||window.open(e.authorizeUrl,"_blank","noopener");let s=Date.now(),r=async()=>{if(Date.now()-s>3e5)return void u.oR.error(n("oauth.authTimeoutToast"));let e=await (0,ec.o)();if(e.ok){let s=e.statuses.find(e=>e.id===t.id);if((null==s?void 0:s.hasTokens)&&!t.hasTokens){u.oR.success(n("oauth.authorizedToast")),a();return}}setTimeout(()=>void r(),1500)};r()})},disabled:T||!m,className:"gap-1",children:[T?(0,s.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(ei.A,{className:"h-3.5 w-3.5"}),t.hasTokens?n("oauth.reAuthorize"):n("oauth.authorize")]}),t.hasTokens&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"outline",onClick:()=>{L(async()=>{let e=await ex(t.id);if(!e.ok){var a;u.oR.error(null!=(a=e.error)?a:n("oauth.probeFailToast"));return}u.oR.success(n("oauth.probeOkToast"))})},disabled:M,children:[M&&(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),(0,s.jsx)(H.A,{className:"mr-1 h-3.5 w-3.5"})," ",n("oauth.probeButton")]}),(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"ghost",onClick:P,children:[(0,s.jsx)(el.A,{className:"mr-1 h-3.5 w-3.5"}),n("oauth.disconnect")]})]}),m&&(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"ghost",onClick:F,className:"text-muted-foreground",children:[(0,s.jsx)(U.A,{className:"mr-1 h-3.5 w-3.5"}),n("oauth.forgetClient")]}),"user"===t.origin&&(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"ghost",className:"text-destructive ml-auto",onClick:async()=>{if(!confirm(n("oauth.removeProviderConfirm",{id:t.id})))return;let e=await eg(t.id);if(!e.ok)return void u.oR.error(e.error);await ep(t.id),u.oR.success(n("oauth.providerRemovedToast")),a()},children:[(0,s.jsx)(q.A,{className:"mr-1 h-3.5 w-3.5"}),n("oauth.removeProvider")]})]}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground",children:n.rich("oauth.usageHint",{code:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),id:t.id})})]})]})})}function ej(e){let{existingIds:t,onCancel:a,onAdded:n}=e,l=(0,i.c)("settings"),[c,d]=(0,r.useState)(""),[m,f]=(0,r.useState)(""),[v,b]=(0,r.useState)(""),[j,N]=(0,r.useState)(""),[y,w]=(0,r.useState)(""),[k,S]=(0,r.useState)(""),[R,A]=(0,r.useState)(""),[C,T]=(0,r.useState)(!0),[z,M]=(0,r.useState)(!0),[L,U]=(0,r.useState)(!0),[F,E]=(0,r.useState)(""),[J,I]=(0,r.useTransition)();return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(K.A,{className:"h-4 w-4"})," ",l("oauth.custom.title")]}),(0,s.jsx)(x.$,{type:"button",size:"icon",variant:"ghost",onClick:a,className:"h-7 w-7",children:(0,s.jsx)(Z.A,{className:"h-3.5 w-3.5"})})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:l.rich("oauth.custom.description",{uri:e=>(0,s.jsx)("code",{className:"font-mono",children:e})})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.idLabel")}),(0,s.jsx)(p.p,{value:c,onChange:e=>d(e.target.value),placeholder:"dropbox",className:"font-mono text-sm h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.labelLabel")}),(0,s.jsx)(p.p,{value:m,onChange:e=>f(e.target.value),placeholder:"Dropbox",className:"text-sm h-8"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.authorizeUrlLabel")}),(0,s.jsx)(p.p,{value:v,onChange:e=>b(e.target.value),placeholder:"https://example.com/oauth/authorize",className:"font-mono text-sm h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.tokenUrlLabel")}),(0,s.jsx)(p.p,{value:j,onChange:e=>N(e.target.value),placeholder:"https://example.com/oauth/token",className:"font-mono text-sm h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.defaultScopesLabel")}),(0,s.jsx)(p.p,{value:y,onChange:e=>w(e.target.value),placeholder:"read write",className:"font-mono text-sm h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.consoleUrlLabel")}),(0,s.jsx)(p.p,{value:k,onChange:e=>S(e.target.value),placeholder:"https://www.dropbox.com/developers/apps",className:"font-mono text-sm h-8"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.setupHintLabel")}),(0,s.jsx)(P.T,{value:R,onChange:e=>A(e.target.value),placeholder:l("oauth.custom.setupHintPlaceholder"),className:"text-xs",rows:3})]}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:C,onChange:e=>T(e.target.checked)}),"PKCE"]}),(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:z,onChange:e=>M(e.target.checked)}),"refresh_token"]}),(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:L,onChange:e=>U(e.target.checked)}),"client_secret"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{className:"text-xs",children:l("oauth.custom.extraParamsLabel")}),(0,s.jsx)(P.T,{value:F,onChange:e=>E(e.target.value),placeholder:'{"access_type": "offline", "prompt": "consent"}',className:"font-mono text-xs",rows:2})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,s.jsx)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:a,children:l("oauth.custom.cancel")}),(0,s.jsxs)(x.$,{type:"button",size:"sm",onClick:()=>{let e=c.trim().toLowerCase();if(!e)return void u.oR.error(l("oauth.custom.idRequired"));if(t.includes(e))return void u.oR.error(l("oauth.custom.providerExists",{id:e}));if(!v.trim()||!j.trim())return void u.oR.error(l("oauth.custom.urlsRequired"));let a={};if(F.trim())try{a=JSON.parse(F)}catch(e){u.oR.error(l("oauth.custom.extraMustBeJson"));return}let s=y.trim().split(/[\s,]+/).filter(e=>e.length>0);I(async()=>{let t=await ef({id:e,label:m.trim()||e,authorizeUrl:v.trim(),tokenUrl:j.trim(),defaultScopes:s,supportsPKCE:C,refreshTokenSupported:z,needsClientSecret:L,extraAuthorizeParams:a,setupHint:R.trim(),consoleUrl:k.trim()||"http://localhost:3210/api/oauth/callback"});if(!t.ok)return void u.oR.error(t.error);u.oR.success(l("oauth.custom.addedToast",{id:e})),n()})},disabled:J||!c.trim()||!v.trim()||!j.trim(),children:[J&&(0,s.jsx)(o.A,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),l("oauth.custom.create")]})]})]})})}var eN=a(77364);let ey=(0,E.createServerReference)("40eb0f61a08b9a540de060e836ca0fd50f44d17552",E.callServer,void 0,E.findSourceMapURL,"hasApiKeyAction"),ew=(0,E.createServerReference)("40a209060b84cd95d16dc67fabf413752b4e0168dc",E.callServer,void 0,E.findSourceMapURL,"listGeminiModelsAction");var ek=a(447);let eS=(0,E.createServerReference)("400ddb824d30603de9917be19ae03162f48a2248bd",E.callServer,void 0,E.findSourceMapURL,"saveGeminiModelChoiceAction");function eR(){let e=(0,i.c)("settings"),[t,a]=(0,r.useState)(!1),[n,d]=(0,r.useState)(""),[m,f]=(0,r.useState)([]),[v,b]=(0,r.useState)(""),[j,y]=(0,r.useState)(""),[w,k]=(0,r.useTransition)(),[S,R]=(0,r.useTransition)(),[A,C]=(0,r.useTransition)(),T=async()=>{a((await ey("gemini")).present)},z=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];k(async()=>{let a=await ew(e);if(!a.ok){if(!t)return;u.oR.error(a.error);return}f(a.models),b(a.currentModel),y(a.currentVideoModel)})};(0,r.useEffect)(()=>{(async()=>{await T()})()},[]),(0,r.useEffect)(()=>{t&&z(!1)},[t]);let L=(t,a)=>{C(async()=>{let s=await eS({[t]:a||null});if(!s.ok)return void u.oR.error(s.error);u.oR.success(e("gemini.savedToast")),"model"===t?b(a):y(a)})};return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(M.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{children:"Gemini API"}),t?(0,s.jsxs)(N.E,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(es.A,{className:"h-3 w-3"})," ",e("gemini.keySaved")]}):(0,s.jsx)(N.E,{variant:"outline",children:e("gemini.notConfigured")})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.rich("gemini.description",{strong:e=>(0,s.jsx)("strong",{children:e}),model:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),path:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),link:e=>(0,s.jsxs)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-violet-700 hover:underline",children:[e,(0,s.jsx)(ei.A,{className:"h-3 w-3"})]})})}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(g.J,{className:"text-xs flex items-center gap-1",children:[(0,s.jsx)(ea.A,{className:"h-3 w-3"}),t?e("gemini.replaceKey"):e("gemini.apiKeyLabel")]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.p,{type:"password",value:n,onChange:e=>d(e.target.value),placeholder:t?"••••":"AIza…",className:"font-mono text-sm flex-1 h-8",disabled:S}),(0,s.jsxs)(x.$,{type:"button",size:"sm",onClick:()=>{if(!n.trim())return void u.oR.error(e("gemini.enterKeyError"));R(async()=>{let t=await (0,ek.A)(n.trim());if(!t.ok)return void u.oR.error(t.error);u.oR.success(e("gemini.keySavedToast")),d(""),a(!0),z(!0)})},disabled:S||!n.trim(),className:"h-8 gap-1",children:[S?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(c.A,{className:"h-3 w-3"}),e("gemini.saveButton")]})]})]}),t&&(0,s.jsxs)("div",{className:"space-y-3 pt-1 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.rich("gemini.modelsFromBeta",{path:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),count:m.length>0?"(".concat(m.length,")"):""})}),(0,s.jsxs)(x.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>z(!0),disabled:w,className:"h-7 text-xs gap-1",children:[w?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(l.A,{className:"h-3 w-3"}),e("gemini.refreshButton")]})]}),(0,s.jsx)(eA,{label:e("gemini.defaultModelLabel"),hint:e("gemini.defaultModelHint"),value:v,models:m,disabled:A||w,onChange:e=>L("model",e)}),(0,s.jsx)(eA,{label:e("gemini.youtubeModelLabel"),hint:e("gemini.youtubeModelHint"),value:j,models:m,disabled:A||w,onChange:e=>L("videoModel",e)})]})]})})}function eA(e){let{label:t,hint:a,value:r,models:n,disabled:i,onChange:l}=e,o=new Set(n.map(e=>e.id)).has(r)?n:r?[{id:r,displayName:"".concat(r," (saved)")},...n]:n;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(g.J,{className:"text-xs",children:t}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a}),(0,s.jsxs)(y.l6,{value:r,onValueChange:l,disabled:i,children:[(0,s.jsx)(y.bq,{className:"h-8 w-full",children:(0,s.jsx)(y.yv,{placeholder:"(default)"})}),(0,s.jsx)(y.gC,{children:o.map(e=>(0,s.jsx)(y.eb,{value:e.id,children:(0,s.jsxs)("span",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:e.id}),e.displayName&&e.displayName!==e.id&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.displayName})]})},e.id))})]})]})}var eC=a(39160);let eT=(0,E.createServerReference)("00bcd949924087955c8fc527c17ef7eb74c3c1b2cd",E.callServer,void 0,E.findSourceMapURL,"braveKeyStatusAction"),ez=(0,E.createServerReference)("6075b354edbc522e89f2c17797fd353f472b0a2a9e",E.callServer,void 0,E.findSourceMapURL,"saveImageProviderKeyAction");function eM(){let e=(0,i.c)("settings");return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(eC.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{children:e("imageSearch.headerTitle")})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.rich("imageSearch.description",{api:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),dir:e=>(0,s.jsx)("code",{className:"font-mono",children:e})})}),(0,s.jsx)(eL,{provider:"unsplash",label:"Unsplash",docsHref:"https://unsplash.com/developers",hint:e("imageSearch.unsplash.hint")}),(0,s.jsx)(eL,{provider:"pexels",label:"Pexels",docsHref:"https://pexels.com/api/",hint:e("imageSearch.pexels.hint")}),(0,s.jsx)(eL,{provider:"brave",label:e("imageSearch.brave.label"),docsHref:"https://api-dashboard.search.brave.com/app/keys",hint:e("imageSearch.brave.hint")})]})})}function eL(e){let{provider:t,label:a,docsHref:n,hint:l}=e,d=(0,i.c)("settings"),[m,h]=(0,r.useState)(!1),[f,v]=(0,r.useState)(!1),[b,j]=(0,r.useState)(""),[y,w]=(0,r.useTransition)();return(0,r.useEffect)(()=>{(async()=>{let e=await ey(t);h(e.present),"brave"!==t||e.present||v((await eT()).viaMcp)})()},[t]),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:a}),m?(0,s.jsxs)(N.E,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(es.A,{className:"h-3 w-3"})," ",d("imageSearch.keySaved")]}):f?(0,s.jsxs)(N.E,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(es.A,{className:"h-3 w-3"})," ",d("imageSearch.viaMcp")]}):(0,s.jsx)(N.E,{variant:"outline",children:d("imageSearch.notConfigured")}),(0,s.jsxs)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"ml-auto inline-flex items-center gap-1 text-xs text-violet-700 hover:underline",children:["docs ",(0,s.jsx)(ei.A,{className:"h-3 w-3"})]})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:l}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(g.J,{className:"sr-only",htmlFor:"".concat(t,"-key"),children:[(0,s.jsx)(ea.A,{className:"h-3 w-3"})," ",a," key"]}),(0,s.jsx)(p.p,{id:"".concat(t,"-key"),type:"password",value:b,onChange:e=>j(e.target.value),placeholder:m?"••••":d("imageSearch.keyPlaceholder",{label:a}),className:"font-mono text-sm flex-1 h-8",disabled:y}),(0,s.jsxs)(x.$,{type:"button",size:"sm",onClick:()=>{if(!b.trim())return void u.oR.error(d("imageSearch.enterKeyError"));w(async()=>{let e=await ez(t,b.trim());if(!e.ok)return void u.oR.error(e.error);u.oR.success(d("imageSearch.keySavedToast",{label:a})),j(""),h(!0)})},disabled:y||!b.trim(),className:"h-8 gap-1",children:[y?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(c.A,{className:"h-3 w-3"}),d("imageSearch.saveButton")]})]})]})}var eU=a(23559),eP=a(68682);function eF(e){let{settings:t,onChange:a}=e,r=(0,i.c)("settings"),n=new Set(t.mapServices.enabled);return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(eU.A,{className:"h-4 w-4 text-emerald-700"}),(0,s.jsx)("span",{children:r("mapServices.headerTitle")})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("mapServices.cardHint")}),(0,s.jsx)("ul",{className:"space-y-1.5",children:eP.yp.map(e=>{let t=n.has(e.id);return(0,s.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-3 py-2",children:[(0,s.jsx)("input",{id:"map-svc-".concat(e.id),type:"checkbox",checked:t,onChange:()=>(e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),a({mapServices:{enabled:[...t]}})})(e.id),className:"mt-1 h-3.5 w-3.5"}),(0,s.jsxs)("label",{htmlFor:"map-svc-".concat(e.id),className:"min-w-0 flex-1 cursor-pointer",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:e.label}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5 leading-snug",children:e.description})]}),(0,s.jsxs)("a",{href:e.urlFor(55.7558,37.6173),target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground hover:underline inline-flex items-center gap-0.5 shrink-0 mt-1",title:r("mapServices.previewTitle"),children:[r("mapServices.previewLabel"),(0,s.jsx)(ei.A,{className:"h-2.5 w-2.5"})]})]},e.id)})})]})})}var eE=a(2136),eJ=a(84860),eI=a(67805),e_=a(27344);let eO=(0,E.createServerReference)("0050667c8b1d8c7d09c44a7c55605c43c84679b9f9",E.callServer,void 0,E.findSourceMapURL,"refreshReservedDomainsAction"),eW=(0,E.createServerReference)("408bdaf35385d9cd4bd498281c53240d5876405459",E.callServer,void 0,E.findSourceMapURL,"patchNgrokSettingsAction"),eB=(0,E.createServerReference)("00afd6d7d2a238b11fab47d61f567185685321547c",E.callServer,void 0,E.findSourceMapURL,"startTunnelAction"),e$=(0,E.createServerReference)("00785341a57aefbc84e9355806da00e93102fd7b5e",E.callServer,void 0,E.findSourceMapURL,"stopTunnelAction"),eD=(0,E.createServerReference)("00046e33f185b858dac8b592fbf1cad972dc017e6f",E.callServer,void 0,E.findSourceMapURL,"listSharesAction"),eH=(0,E.createServerReference)("40e4902d2ce5dab2898a8c140f2636d8f18758f759",E.callServer,void 0,E.findSourceMapURL,"deleteShareAction");function eq(e){var t,a;let{settings:n,onChange:c}=e,m=(0,i.c)("settings"),x=n.ngrok,[p,g]=(0,r.useState)({running:!1}),[f,v]=(0,r.useState)(null),[b,j]=(0,r.useState)(null),[N,y]=(0,r.useState)([]),[w,k]=(0,r.useTransition)(),[S,R]=(0,r.useTransition)(),[A,C]=(0,r.useState)(0),T=(0,r.useRef)(null),z=(0,r.useRef)(""),M=async()=>{let e=await (0,e_.N)();g(e.status),v(e.cliVersion),y((await eD()).shares)};(0,r.useEffect)(()=>{M();let e=setInterval(()=>void M(),1e4);return()=>clearInterval(e)},[]);let L=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=await eO();if(!t.ok){e||u.oR.error(t.error);return}j(t.domains),e||u.oR.success(m("ngrok.domainsLoadedToast",{count:t.domains.length}))},U=e=>{c({ngrok:{...x,...e}}),T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{let t=await eW(e);if(!t.ok){var a;u.oR.error(m("ngrok.ngrokSaveError",{error:null!=(a=t.error)?a:m("ngrok.saveFailedFallback")}));return}C(e=>e+1),"string"==typeof e.apiKey&&e.apiKey.trim()&&e.apiKey!==z.current&&(z.current=e.apiKey,L(!0))},600)};(0,r.useEffect)(()=>{x.apiKey.trim()&&""===z.current&&(z.current=x.apiKey,L(!0))},[]);let P=async()=>{T.current&&(clearTimeout(T.current),T.current=null,await eW(x))},F=()=>{R(async()=>{await P(),await e$(),await new Promise(e=>setTimeout(e,400));let e=await eB();if(!e.ok)return void u.oR.error(e.error);u.oR.success(e.publicUrl?m("ngrok.tunnelRestarted",{url:e.publicUrl}):m("ngrok.tunnelRestartedNoUrl")),await M()})},E=(()=>{try{return p.publicUrl?new URL(p.publicUrl).hostname:""}catch(e){return""}})(),J=x.domain.trim(),I=p.running&&J&&E!==J,_=p.running&&p.port!==x.port;return(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-5 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(eE.A,{className:"h-4 w-4 text-violet-600"}),(0,s.jsx)("span",{children:m("ngrok.headerTitle")}),f?(0,s.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground ml-1",children:f.split("\n")[0]}):(0,s.jsxs)("span",{className:"text-[10px] text-destructive ml-1 inline-flex items-center gap-0.5",children:[(0,s.jsx)(en.A,{className:"h-3 w-3"}),m("ngrok.cliMissing")]}),A>0&&(0,s.jsxs)("span",{className:"ml-auto text-[10px] text-emerald-700 inline-flex items-center gap-0.5",title:m("ngrok.autoSavedTooltip"),children:[(0,s.jsx)(d.A,{className:"h-3 w-3"}),m("ngrok.autoSavedLabel")]},A)]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:m.rich("ngrok.intro",{code:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),path:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),link:e=>(0,s.jsx)("a",{href:"https://ngrok.com/download",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e})})}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)("label",{className:"text-xs font-medium",htmlFor:"ngrok-token",children:m("ngrok.authtokenLabel")}),(0,s.jsx)("input",{id:"ngrok-token",type:"password",autoComplete:"off",value:x.authtoken,onChange:e=>U({authtoken:e.target.value}),placeholder:"2abc...xyz",className:"rounded border bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-violet-400"}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground",children:m.rich("ngrok.authtokenHint",{code:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),path:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),link:e=>(0,s.jsx)("a",{href:"https://dashboard.ngrok.com/get-started/your-authtoken",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e})})})]}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)("label",{className:"text-xs font-medium",htmlFor:"ngrok-apikey",children:m("ngrok.apiKeyLabel")}),(0,s.jsx)("input",{id:"ngrok-apikey",type:"password",autoComplete:"off",value:x.apiKey,onChange:e=>U({apiKey:e.target.value}),placeholder:"2abc...xyz",className:"rounded border bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-violet-400"}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground",children:m.rich("ngrok.apiKeyHint",{link:e=>(0,s.jsx)("a",{href:"https://dashboard.ngrok.com/api",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e})})})]}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("label",{className:"text-xs font-medium",htmlFor:"ngrok-domain",children:m("ngrok.reservedDomainLabel")}),(0,s.jsxs)("button",{type:"button",onClick:()=>{k(async()=>{await L()})},disabled:w||!x.apiKey,className:"text-[11px] inline-flex items-center gap-1 text-violet-700 hover:underline disabled:opacity-50",children:[w?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(l.A,{className:"h-3 w-3"}),m("ngrok.refreshList")]})]}),b&&b.length>0?(0,s.jsxs)("select",{id:"ngrok-domain",value:x.domain,onChange:e=>U({domain:e.target.value}),className:"rounded border bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400",children:[(0,s.jsx)("option",{value:"",children:m("ngrok.randomSubdomain")}),b.map(e=>(0,s.jsxs)("option",{value:e.domain,children:[e.domain,e.region?" (".concat(e.region,")"):""]},e.id))]}):(0,s.jsx)("input",{id:"ngrok-domain",type:"text",value:x.domain,onChange:e=>U({domain:e.target.value}),placeholder:m("ngrok.domainPlaceholder"),className:"rounded border bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs font-medium",htmlFor:"ngrok-port",children:m("ngrok.localPortLabel")}),(0,s.jsx)("input",{id:"ngrok-port",type:"number",min:1,max:65535,value:x.port,onChange:e=>U({port:Math.max(1,Number(e.target.value)||3210)}),className:"mt-1 w-32 rounded border bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),p.running?(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("button",{type:"button",onClick:F,disabled:S,className:"rounded border px-3 py-1.5 text-xs font-medium hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:m("ngrok.restartTitle"),children:[S?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(l.A,{className:"h-3 w-3"}),m("ngrok.restart")]}),(0,s.jsxs)("button",{type:"button",onClick:()=>{R(async()=>{await e$(),u.oR.success(m("ngrok.tunnelStoppedToast")),await M()})},disabled:S,className:"rounded bg-destructive px-3 py-1.5 text-xs font-medium text-white hover:bg-destructive/90 disabled:opacity-50 inline-flex items-center gap-1",children:[S?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(eJ.A,{className:"h-3 w-3"}),m("ngrok.stop")]})]}):(0,s.jsxs)("button",{type:"button",onClick:()=>{R(async()=>{await P();let e=await eB();if(!e.ok)return void u.oR.error(e.error);u.oR.success(e.publicUrl?m("ngrok.tunnelStarted",{url:e.publicUrl}):m("ngrok.tunnelStartedNoUrl")),await M()})},disabled:S||!x.authtoken,className:"rounded bg-violet-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-violet-700 disabled:opacity-50 inline-flex items-center gap-1",children:[S?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(eI.A,{className:"h-3 w-3"}),m("ngrok.start")]})]}),p.running&&(0,s.jsxs)("div",{className:"rounded border border-emerald-300 bg-emerald-50 dark:bg-emerald-950/30 dark:border-emerald-900/50 px-3 py-2 text-xs space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-800 dark:text-emerald-200",children:[(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:m("ngrok.tunnelActive")})]}),p.publicUrl?(0,s.jsx)("a",{href:p.publicUrl,target:"_blank",rel:"noopener noreferrer",className:"block font-mono text-violet-700 hover:underline truncate",children:p.publicUrl}):(0,s.jsx)("p",{className:"text-muted-foreground",children:m("ngrok.urlPending")}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground",children:m("ngrok.startedAt",{time:p.startedAt?new Date(p.startedAt).toLocaleTimeString():"",port:null!=(t=p.port)?t:""})})]}),(I||_)&&(0,s.jsxs)("div",{className:"rounded border border-amber-300 bg-amber-50 dark:bg-amber-950/30 dark:border-amber-900/50 px-3 py-2 text-xs space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-amber-800 dark:text-amber-200 font-medium",children:[(0,s.jsx)(en.A,{className:"h-3.5 w-3.5"}),m("ngrok.settingsChanged")]}),(0,s.jsxs)("ul",{className:"text-[11px] text-amber-900 dark:text-amber-100 list-disc pl-4 space-y-0.5",children:[I&&(0,s.jsx)("li",{children:m.rich("ngrok.domainMismatch",{code:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),running:E,desired:J})}),_&&(0,s.jsx)("li",{children:m.rich("ngrok.portMismatch",{code:e=>(0,s.jsx)("code",{className:"font-mono",children:e}),running:null!=(a=p.port)?a:"",desired:x.port})})]}),(0,s.jsxs)("button",{type:"button",onClick:F,disabled:S,className:"inline-flex items-center gap-1 rounded bg-amber-600 px-2 py-1 text-white hover:bg-amber-700 disabled:opacity-50",children:[S?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(l.A,{className:"h-3 w-3"}),m("ngrok.restartWithNewSettings")]})]}),(0,s.jsx)("hr",{className:"my-3"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xs font-semibold mb-2",children:m("ngrok.activeLinks",{count:N.length})}),0===N.length?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:m("ngrok.noShares")}):(0,s.jsx)("ul",{className:"space-y-1",children:N.map(e=>(0,s.jsx)(eK,{share:e,publicHost:p.publicUrl,onDeleted:()=>void M()},e.id))})]})]})})}function eK(e){var t,a;let{share:n,publicHost:l,onDeleted:c}=e,d=(0,i.c)("settings"),[m,x]=(0,r.useTransition)(),h=l?new URL("/share/".concat(n.id),l).toString():"/share/".concat(n.id),p=n.label||("utility"===n.kind?d("ngrok.shareLabel.utility",{id:null!=(t=n.utilityId)?t:""}):"kb-file"===n.kind?d("ngrok.shareLabel.kbFile",{path:null!=(a=n.kbRelPath)?a:""}):"kb-tree"===n.kind?d("ngrok.shareLabel.kbTree"):d("ngrok.shareLabel.dashboard"));return(0,s.jsxs)("li",{className:"flex items-start gap-2 rounded border bg-card px-2 py-1.5 text-xs",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"font-medium truncate",children:p}),(0,s.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-muted-foreground",children:n.kind}),n.passwordHash&&(0,s.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-violet-600",children:"\uD83D\uDD12"})]}),(0,s.jsx)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"block text-[10px] font-mono text-violet-700 hover:underline truncate",children:h})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(h).then(()=>u.oR.success(d("ngrok.copiedToast")))},className:"text-[10px] text-muted-foreground hover:text-foreground rounded px-1 py-0.5",children:"copy"}),(0,s.jsx)("button",{type:"button",onClick:()=>{confirm(d("ngrok.deleteConfirm",{label:p}))&&x(async()=>{await eH(n.id),c()})},disabled:m,className:"text-muted-foreground hover:text-destructive rounded px-1",title:d("ngrok.deleteTitle"),children:m?(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(q.A,{className:"h-3 w-3"})})]})}let eZ=(0,E.createServerReference)("40fef83c673f78a4a30463c32e8a6f1627b83dbad2",E.callServer,void 0,E.findSourceMapURL,"listModelsAction"),eG=(0,E.createServerReference)("4055d231b46465bc78a94c3814fc15e86376e3e2a5",E.callServer,void 0,E.findSourceMapURL,"probeHarnessAction"),eV=(0,E.createServerReference)("408c566723b69516815d2423baf731a2e32f33eac0",E.callServer,void 0,E.findSourceMapURL,"saveSettingsAction");function eY(e){let{initialSettings:t,harnesses:a}=e,d=(0,i.c)("settings"),[m,v]=(0,r.useState)(t),[b,w]=(0,r.useState)({"claude-code":null,codex:null,ollama:null}),[R,A]=(0,r.useState)({"claude-code":null,codex:null,ollama:null}),[z,M]=(0,r.useState)({"claude-code":!1,codex:!1,ollama:!1}),[L,U]=(0,r.useState)({"claude-code":null,codex:null,ollama:null}),[P,F]=(0,r.useTransition)(),E=(0,r.useCallback)(async e=>{M(t=>({...t,[e]:!0})),A(t=>({...t,[e]:null}));let t=await eZ(e);M(t=>({...t,[e]:!1})),t.ok?w(a=>({...a,[e]:t.models})):(A(a=>({...a,[e]:t.error})),w(t=>({...t,[e]:[]})))},[]),J=(0,r.useCallback)(async e=>{let t=await eG(e);U(a=>({...a,[e]:t}))},[]);(0,r.useEffect)(()=>{a.forEach(e=>{J(e.id),E(e.id)})},[a,J,E]);let I=(e,t)=>{v(a=>({...a,assignments:{...a.assignments,[e]:{...a.assignments[e],...t}}}))},_=(0,n.useRouter)(),O=e=>{v(t=>({...t,imageProcessing:{...t.imageProcessing,...e}}))},W={en:"English",ru:"Русский"},B="advanced"===m.uiMode;return(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsx)(h.Zp,{className:"border-violet-200 dark:border-violet-900/50 bg-violet-50/40 dark:bg-violet-950/20",children:(0,s.jsxs)(h.Wu,{className:"pt-5 pb-5 flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:B?d("uiMode.advancedTitle"):d("uiMode.simpleTitle")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:B?d("uiMode.advancedHint"):d("uiMode.simpleHint")})]}),(0,s.jsx)(x.$,{type:"button",variant:B?"outline":"default",size:"sm",onClick:()=>{let e={...m,uiMode:B?"simple":"advanced"};v(e),eV(e)},children:B?d("uiMode.switchToSimple"):d("uiMode.switchToAdvanced")})]})}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Memory"}),(0,s.jsx)(eN.MemoryEditor,{scope:"global",title:"What Reflex remembers about you",description:"These files are loaded into every chat so the agent has context. Edit any line directly, or let the agent maintain them as you talk.",allowWipe:!0})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Interface & content language"}),(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-6",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Switches the UI and the language the agent writes in. Code, paths, and quoted source stay verbatim."}),(0,s.jsx)("div",{className:"max-w-xs",children:(0,s.jsxs)(y.l6,{value:C.includes(m.language)?m.language:"en",onValueChange:e=>{v(t=>({...t,language:e}))},children:[(0,s.jsx)(y.bq,{children:(0,s.jsx)(y.yv,{})}),(0,s.jsx)(y.gC,{children:C.map(e=>{var t;return(0,s.jsx)(y.eb,{value:e,children:null!=(t=W[e])?t:e},e)})})]})})]})})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("imageProcessing.title")}),(0,s.jsx)(h.Zp,{children:(0,s.jsxs)(h.Wu,{className:"pt-6 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm",children:d.rich("imageProcessing.description",{dir:e=>(0,s.jsx)("code",{className:"font-mono text-xs",children:e})})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:d("imageProcessing.hint")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsx)(g.J,{htmlFor:"img-enabled",className:"text-xs",children:d("imageProcessing.enabledLabel")}),(0,s.jsx)(f.d,{id:"img-enabled",checked:m.imageProcessing.enabled,onCheckedChange:e=>O({enabled:e})})]})]}),(0,s.jsxs)("div",{className:m.imageProcessing.enabled?"space-y-4":"space-y-4 opacity-50 pointer-events-none",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:d("imageProcessing.maxDimensionLabel")}),(0,s.jsxs)("span",{className:"font-mono text-xs",children:[m.imageProcessing.maxDimension,"px"]})]}),(0,s.jsx)(j,{min:256,max:8192,step:64,value:[m.imageProcessing.maxDimension],onValueChange:e=>{var t;return O({maxDimension:null!=(t=e[0])?t:2e3})}}),(0,s.jsxs)("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1",children:[(0,s.jsx)("span",{children:"256"}),(0,s.jsx)("span",{children:"2048"}),(0,s.jsx)("span",{children:"4096"}),(0,s.jsx)("span",{children:"8192"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:d("imageProcessing.qualityLabel")}),(0,s.jsx)("span",{className:"font-mono text-xs",children:m.imageProcessing.quality})]}),(0,s.jsx)(j,{min:40,max:100,step:1,value:[m.imageProcessing.quality],onValueChange:e=>{var t;return O({quality:null!=(t=e[0])?t:85})}})]}),(0,s.jsxs)("div",{className:"max-w-xs",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:d("imageProcessing.formatLabel")}),(0,s.jsxs)(y.l6,{value:m.imageProcessing.format,onValueChange:e=>O({format:e}),children:[(0,s.jsx)(y.bq,{className:"mt-1",children:(0,s.jsx)(y.yv,{})}),(0,s.jsx)(y.gC,{children:T.map(e=>(0,s.jsxs)(y.eb,{value:e,children:[(0,s.jsx)("span",{className:"font-mono",children:e}),(0,s.jsx)("span",{className:"ml-2 text-muted-foreground text-xs",children:"auto"===e?d("imageProcessing.format.auto"):"jpeg"===e?d("imageProcessing.format.jpeg"):"webp"===e?d("imageProcessing.format.webp"):d("imageProcessing.format.original")})]},e))})]})]})]})]})})]}),B&&(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Harnesses"}),(0,s.jsx)("div",{className:"grid gap-4",children:a.map(e=>{var t,a,r,n,i,c;let d=L[e.id],u=m.harnesses[e.id].enabled;return(0,s.jsxs)(h.Zp,{children:[(0,s.jsx)(h.aR,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(h.ZB,{className:"flex items-center gap-2",children:[e.label,(0,s.jsx)(e0,{probe:d})]}),(0,s.jsx)(h.BT,{children:d?d.detail:"checking…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)(x.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{J(e.id),E(e.id)},disabled:z[e.id],children:[(0,s.jsx)(l.A,{className:"mr-1 h-4 w-4 ".concat(z[e.id]?"animate-spin":"")}),"Refresh"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(g.J,{htmlFor:"enable-".concat(e.id),className:"text-xs",children:"enabled"}),(0,s.jsx)(f.d,{id:"enable-".concat(e.id),checked:u,onCheckedChange:t=>{var a;return a=e.id,void v(e=>({...e,harnesses:{...e.harnesses,[a]:{...e.harnesses[a],enabled:t}}}))}})]})]})]})}),(0,s.jsxs)(h.Wu,{children:["ollama"===e.id&&(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2 max-w-md",children:[(0,s.jsx)(g.J,{htmlFor:"ollama-url",className:"text-xs w-24 shrink-0",children:"Base URL"}),(0,s.jsx)(p.p,{id:"ollama-url",value:m.harnesses.ollama.baseUrl,onChange:e=>{var t;return t=e.target.value,void v(e=>({...e,harnesses:{...e.harnesses,ollama:{...e.harnesses.ollama,baseUrl:t}}}))},placeholder:"http://localhost:11434",className:"font-mono text-xs"})]}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Models loaded:"," ",z[e.id]?(0,s.jsxs)("span",{children:[(0,s.jsx)(o.A,{className:"inline h-3 w-3 animate-spin mr-1"}),"loading…"]}):R[e.id]?(0,s.jsx)("span",{className:"text-destructive",children:R[e.id]}):"".concat(null!=(i=null==(t=b[e.id])?void 0:t.length)?i:0),(null!=(c=null==(a=b[e.id])?void 0:a.length)?c:0)>0&&(0,s.jsxs)("span",{className:"ml-2",children:["(",null==(n=b[e.id])||null==(r=n[0])?void 0:r.source,")"]})]})]})]},e.id)})})]}),B&&(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Task assignments"}),(0,s.jsx)("div",{className:"grid gap-4",children:k.map(e=>{var t,r;let n=m.assignments[e],i=a.filter(t=>t.supports.includes(e)&&m.harnesses[t.id].enabled),l=null!=(r=b[n.harness])?r:[],o=null==(t=l[0])?void 0:t.source;return(0,s.jsxs)(h.Zp,{children:[(0,s.jsxs)(h.aR,{children:[(0,s.jsx)(h.ZB,{className:"text-base",children:S[e].title}),(0,s.jsx)(h.BT,{children:S[e].help})]}),(0,s.jsxs)(h.Wu,{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end gap-3",children:[(0,s.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:"Harness"}),(0,s.jsxs)(y.l6,{value:n.harness,onValueChange:t=>{var a,s,r;return I(e,{harness:t,model:null!=(r=null==(s=b[t])||null==(a=s[0])?void 0:a.id)?r:""})},children:[(0,s.jsx)(y.bq,{className:"mt-1",children:(0,s.jsx)(y.yv,{})}),(0,s.jsx)(y.gC,{children:i.map(e=>(0,s.jsx)(y.eb,{value:e.id,children:e.label},e.id))})]})]}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:"Model"}),o&&(0,s.jsx)(N.E,{variant:"live"===o?"default":"secondary",className:"text-[10px] uppercase",children:o})]}),l.length>0?(0,s.jsxs)(y.l6,{value:n.model,onValueChange:t=>I(e,{model:t}),children:[(0,s.jsx)(y.bq,{className:"mt-1",children:(0,s.jsx)(y.yv,{placeholder:"select model"})}),(0,s.jsx)(y.gC,{children:l.map(e=>(0,s.jsxs)(y.eb,{value:e.id,children:[(0,s.jsx)("span",{className:"font-mono",children:e.id}),e.size&&(0,s.jsx)("span",{className:"ml-2 text-muted-foreground text-xs",children:e.size})]},e.id))})]}):(0,s.jsx)(p.p,{value:n.model,onChange:t=>I(e,{model:t.target.value}),placeholder:"model id",className:"mt-1 font-mono text-xs"})]})]}),"claude-code"===n.harness&&(0,s.jsx)(eQ,{tools:n.allowedTools,onChange:t=>I(e,{allowedTools:t})})]})]},e)})})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Gemini"}),(0,s.jsx)(eR,{})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("imageSearch.title")}),(0,s.jsx)(eM,{})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("oauth.title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:d.rich("oauth.description",{code:e=>(0,s.jsx)("code",{children:e}),uri:e=>(0,s.jsx)("code",{className:"font-mono",children:e})})}),(0,s.jsx)(ev,{})]}),B&&(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("mcpServers.title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:d.rich("mcpServers.description",{code:e=>(0,s.jsx)("code",{children:e}),path:e=>(0,s.jsx)("code",{children:e})})}),(0,s.jsx)(ee,{})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("mapServices.title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:d("mapServices.description")}),(0,s.jsx)(eF,{settings:m,onChange:e=>v(t=>({...t,...e}))})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:d("ngrok.title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:d("ngrok.description")}),(0,s.jsx)(eq,{settings:m,onChange:e=>v(t=>({...t,...e}))})]}),B&&(0,s.jsxs)("section",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Prompt templates"}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground mb-3",children:["Stored on disk under ",(0,s.jsx)("code",{children:"~/.reflex/prompts/"}),". Edit here or directly in any editor. Use ",(0,s.jsx)("code",{children:"{{language}}"}),","," ",(0,s.jsx)("code",{children:"{{scope}}"}),", etc. — variable list is shown per template."]}),(0,s.jsx)($,{})]}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(x.$,{onClick:()=>{F(async()=>{let e=await eV(m);if(!e.ok){var t;u.oR.error(null!=(t=e.error)?t:d("form.saveFailedFallback"));return}u.oR.success(d("form.savedToast")),_.refresh()})},disabled:P,children:P?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"})," Saving…"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.A,{className:"mr-2 h-4 w-4"})," Save settings"]})})})]})}let eX=["Read","Write","Edit","LS","Glob","Grep","Bash","WebSearch","WebFetch","TodoWrite","Task","NotebookEdit"];function eQ(e){let{tools:t,onChange:a}=e,n=(0,i.c)("settings"),l=e=>{let s=e.trim();s&&(t.includes(s)||a([...t,s]))},[o,c]=(0,r.useState)(""),d=eX.filter(e=>!t.includes(e));return(0,s.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)(g.J,{className:"text-xs text-muted-foreground",children:"Allowed tools (claude-code)"}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("toolsPolicy.noToolsHint")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[0===t.length&&(0,s.jsx)("span",{className:"text-[11px] italic text-muted-foreground",children:n("toolsPolicy.usingDefaults")}),t.map(e=>(0,s.jsxs)(N.E,{variant:"secondary",className:"gap-1 font-mono",children:[e,(0,s.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-foreground",onClick:()=>a(t.filter(t=>t!==e)),children:"\xd7"})]},e))]}),d.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:d.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>l(e),className:"text-[11px] font-mono rounded px-1.5 py-0.5 border border-dashed border-muted-foreground/40 text-muted-foreground hover:border-foreground hover:text-foreground",children:["+ ",e]},e))}),(0,s.jsxs)("form",{className:"flex gap-1",onSubmit:e=>{e.preventDefault(),l(o),c("")},children:[(0,s.jsx)(p.p,{value:o,onChange:e=>c(e.target.value),placeholder:n("toolsPolicy.customToolPlaceholder"),className:"h-7 text-xs font-mono"}),(0,s.jsx)(x.$,{type:"submit",size:"sm",variant:"ghost",className:"h-7",children:"+"})]})]})}function e0(e){let{probe:t}=e;return t?t.available?(0,s.jsxs)(N.E,{variant:"default",className:"gap-1 bg-emerald-600",children:[(0,s.jsx)(d.A,{className:"h-3 w-3"})," available"]}):(0,s.jsxs)(N.E,{variant:"destructive",className:"gap-1",children:[(0,s.jsx)(m.A,{className:"h-3 w-3"})," unavailable"]}):(0,s.jsxs)(N.E,{variant:"outline",className:"gap-1",children:[(0,s.jsx)(o.A,{className:"h-3 w-3 animate-spin"})," checking"]})}},64963:(e,t,a)=>{"use strict";a.d(t,{T:()=>r});var s=a(7911);let r=(0,s.createServerReference)("60345a3ec2d80062f357d0fb2647e18973e9443e0e",s.callServer,void 0,s.findSourceMapURL,"beginOAuthAction")},66459:(e,t,a)=>{"use strict";a.d(t,{O:()=>d});var s=a(4624),r=a(99356),n=a(43153),i=a(9598),l=a(56221),o=a(49411),c=a(85253);function d(e){let{steps:t}=e,a=(0,o.c)("app");return t&&0!==t.length?(0,s.jsx)("ol",{className:"space-y-2 text-xs",children:t.map((e,t)=>(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsxs)("span",{className:"font-mono text-muted-foreground shrink-0 w-5 text-right",children:[t+1,"."]}),(0,s.jsxs)("div",{className:"space-y-1 flex-1 min-w-0",children:[(0,s.jsx)("div",{children:e.title}),e.choice&&(0,s.jsxs)("div",{className:"text-[11px]",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:a("oauth.copyHint")}),(0,s.jsx)("span",{className:"font-medium bg-muted/60 rounded px-1.5 py-0.5",children:e.choice})]}),e.body&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e.body}),e.copy&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.field&&(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[e.field,":"]}),(0,s.jsx)("code",{className:"font-mono text-[11px] bg-muted/60 rounded px-1.5 py-0.5 break-all flex-1 min-w-0",children:e.copy}),(0,s.jsx)(m,{value:e.copy})]})]})]},t))}):null}function m(e){let{value:t}=e,a=(0,o.c)("app"),[d,m]=(0,r.useState)(!1);return(0,s.jsx)(c.$,{type:"button",size:"icon",variant:"ghost",className:"h-6 w-6 shrink-0",onClick:async()=>{try{await navigator.clipboard.writeText(t),m(!0),l.oR.success(a("oauth.copied")),setTimeout(()=>m(!1),1200)}catch(e){l.oR.error(a("oauth.copyFailed"))}},title:a("oauth.copy"),children:d?(0,s.jsx)(n.A,{className:"h-3 w-3 text-emerald-600"}):(0,s.jsx)(i.A,{className:"h-3 w-3"})})}},68682:(e,t,a)=>{"use strict";function s(e){return"".concat(e.lat,",").concat(e.lng)}function r(e){return"".concat(e.lng,",").concat(e.lat)}a.d(t,{JY:()=>i,yp:()=>n});let n=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(e,t)=>"https://www.google.com/maps/dir/?api=1&destination=".concat(e,",").concat(t),routeUrlFor:e=>{if(e.length<2)return"";let t=s(e[0]),a=s(e[e.length-1]),r=e.slice(1,-1).map(s).join("|"),n=r?"&waypoints=".concat(encodeURIComponent(r)):"";return"https://www.google.com/maps/dir/?api=1&origin=".concat(t,"&destination=").concat(a).concat(n)}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(e,t)=>"https://yandex.ru/maps/?rtext=~".concat(e,",").concat(t,"&rtt=auto"),routeUrlFor:e=>"https://yandex.ru/maps/?rtext=".concat(e.map(s).join("~"),"&rtt=auto")},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(e,t)=>"https://2gis.ru/routeSearch/to/".concat(t,",").concat(e),routeUrlFor:e=>{let t=r(e[0]),a=r(e[e.length-1]),s=e.slice(1,-1).map(e=>"/via/".concat(r(e))).join("");return"https://2gis.ru/routeSearch/rsType/car/from/".concat(t).concat(s,"/to/").concat(a)}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(e,t)=>"https://maps.apple.com/?daddr=".concat(e,",").concat(t),routeUrlFor:e=>{let t=s(e[0]),a=e.slice(1).map(e=>"+to:".concat(s(e))).join("");return"https://maps.apple.com/?saddr=".concat(t,"&daddr=").concat(t).concat(a)}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(e,t)=>"https://www.openstreetmap.org/directions?to=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e.map(s).join(";");return"https://www.openstreetmap.org/directions?route=".concat(encodeURIComponent(t))}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(e,t)=>"https://waze.com/ul?ll=".concat(e,",").concat(t,"&navigate=yes"),routeUrlFor:e=>{let t=e[e.length-1];return"https://waze.com/ul?ll=".concat(t.lat,",").concat(t.lng,"&navigate=yes")}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(e,t)=>"om://map?ll=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e[0],a=e[e.length-1];return"om://route?sll=".concat(t.lat,",").concat(t.lng,"&saddr=&dll=").concat(a.lat,",").concat(a.lng,"&daddr=&type=vehicle")}}],i=["google","yandex","apple","osm"]},71651:(e,t,a)=>{"use strict";a.d(t,{T:()=>n});var s=a(4624);a(99356);var r=a(13506);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...a})}},77364:(e,t,a)=>{"use strict";a.d(t,{MemoryEditor:()=>v});var s=a(4624),r=a(99356),n=a(56221),i=a(3239),l=a(85924),o=a(65714),c=a(46972),d=a(85253),m=a(4959),u=a(71651),x=a(13506),h=a(7911);let p=(0,h.createServerReference)("402c20ee9ffc2a44da3e1d2b4bb50488fab4d28c95",h.callServer,void 0,h.findSourceMapURL,"loadMemoryAction"),g=(0,h.createServerReference)("405553b2057ee0ed28180499aef130476e3c48afd4",h.callServer,void 0,h.findSourceMapURL,"saveMemoryFileAction"),f=(0,h.createServerReference)("40d5508d880eadcd5dc5088ed2f32c9fff17b4621c",h.callServer,void 0,h.findSourceMapURL,"wipeMemoryAction");function v(e){let{scope:t,rootId:a,title:n,description:o,allowWipe:c}=e,[d,u]=(0,r.useState)([]),[x,h]=(0,r.useState)(!0),[g,f]=(0,r.useState)(null),v=(0,r.useCallback)(async()=>{h(!0);let e=await p(a?{scope:t,rootId:a}:{scope:t});if(h(!1),!e.ok)return void f(e.error);f(null),u(e.files)},[t,a]);return(0,r.useEffect)(()=>{v()},[v]),(0,s.jsxs)(m.Zp,{children:[(0,s.jsx)(m.aR,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(m.ZB,{className:"text-lg",children:n}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:o})]}),c&&d.length>0&&(0,s.jsx)(j,{scope:t,rootId:a,onWiped:v})]})}),(0,s.jsx)(m.Wu,{children:x?(0,s.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Loading…"]}):g?(0,s.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5"}),g]}):(0,s.jsx)("div",{className:"space-y-4",children:d.map(e=>(0,s.jsx)(b,{snapshot:e,scope:t,rootId:a,onSaved:e=>u(t=>t.map(t=>t.file===e.file?e:t))},e.file))})})]})}function b(e){let{snapshot:t,scope:a,rootId:l,onSaved:c}=e,[m,h]=(0,r.useState)(t.content),[p,f]=(0,r.useTransition)();(0,r.useEffect)(()=>{h(t.content)},[t.content]);let v=m.trim(),b=v?v.split("\n").length:0,j=b>t.cap,N=b>.9*t.cap,y=m!==t.content;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-sm font-semibold",children:t.file}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t.description})]}),(0,s.jsxs)("span",{className:(0,x.cn)("text-xs tabular-nums",j?"text-destructive font-medium":N?"text-amber-600":"text-muted-foreground"),children:[b,"/",t.cap]})]}),(0,s.jsx)(u.T,{value:m,onChange:e=>h(e.target.value),rows:Math.min(t.cap+2,Math.max(3,b+1)),placeholder:"Empty",className:"font-mono text-xs"}),(0,s.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,s.jsxs)(d.$,{type:"button",size:"sm",variant:y?"default":"ghost",disabled:!y||p||j,onClick:()=>{if(j)return void n.oR.error("".concat(t.file," exceeds ").concat(t.cap,"-line cap (").concat(b,"). Trim before saving."));f(async()=>{let e=await g({scope:a,...l?{rootId:l}:{},file:t.file,content:v});if(!e.ok){var s;n.oR.error(null!=(s=e.error)?s:"Save failed");return}n.oR.success("Saved ".concat(t.file)),c({...t,content:v,lines:e.lines})})},children:[p?(0,s.jsx)(i.A,{className:"mr-1 h-3 w-3 animate-spin"}):(0,s.jsx)(o.A,{className:"mr-1 h-3 w-3"}),"Save"]})})]})}function j(e){let{scope:t,rootId:a,onWiped:i}=e,[l,o]=(0,r.useTransition)();return(0,s.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",disabled:l,onClick:()=>{confirm("Erase ALL memory at this scope? Cannot be undone.")&&o(async()=>{let e=await f(a?{scope:t,rootId:a}:{scope:t});if(!e.ok){var s;n.oR.error(null!=(s=e.error)?s:"Wipe failed");return}n.oR.success("Memory wiped"),await i()})},className:"text-destructive hover:text-destructive",children:[(0,s.jsx)(c.A,{className:"mr-1 h-3 w-3"}),"Wipe all"]})}},78825:(e,t,a)=>{"use strict";a.d(t,{J:()=>i});var s=a(4624);a(99356);var r=a(33976),n=a(13506);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},85253:(e,t,a)=>{"use strict";a.d(t,{$:()=>o});var s=a(4624);a(99356);var r=a(60621),n=a(50362),i=a(13506);let l=(0,r.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:a="default",size:r="default",asChild:o=!1,...c}=e,d=o?n.bL:"button";return(0,s.jsx)(d,{"data-slot":"button","data-variant":a,"data-size":r,className:(0,i.cn)(l({variant:a,size:r,className:t})),...c})}},91074:(e,t,a)=>{"use strict";a.d(t,{Separator:()=>i});var s=a(4624);a(99356);var r=a(44188),n=a(13506);function i(e){let{className:t,orientation:a="horizontal",decorative:i=!0,...l}=e;return(0,s.jsx)(r.b,{"data-slot":"separator",decorative:i,orientation:a,className:(0,n.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},92091:(e,t,a)=>{"use strict";a.d(t,{S:()=>r});var s=a(7911);let r=(0,s.createServerReference)("405eb2ef746a086a6b8df68d0f82aaac5b08159c7e",s.callServer,void 0,s.findSourceMapURL,"saveOAuthClientAction")}},e=>{e.O(0,[4400,4678,9776,6785,3335,9411,6231,4933,146,7358],()=>e(e.s=17121)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8580],{55861:(e,s,a)=>{Promise.resolve().then(a.bind(a,79624)),Promise.resolve().then(a.bind(a,79739)),Promise.resolve().then(a.t.bind(a,54400,23))},79739:(e,s,a)=>{"use strict";a.d(s,{ShareAuthForm:()=>d});var t=a(4624),r=a(99356),n=a(3239);let o=(0,a(45804).A)("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);var i=a(49411),l=a(7911);let c=(0,l.createServerReference)("605157adfb61ac93cca62138a141b3a2a0f50c6307",l.callServer,void 0,l.findSourceMapURL,"submitSharePasswordAction");function d(e){let{shareId:s,error:a}=e,l=(0,i.c)("app"),[d,u]=(0,r.useTransition)();return(0,t.jsxs)("form",{action:e=>u(async()=>{var a;await c(s,(null!=(a=e.get("password"))?a:"").toString())}),className:"space-y-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"pw-".concat(s),children:l("share.auth.passwordLabel")}),(0,t.jsx)("input",{id:"pw-".concat(s),name:"password",type:"password",autoFocus:!0,className:"w-full rounded border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-violet-400",placeholder:"••••••••"}),"bad"===a&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:l("share.auth.badPassword")}),(0,t.jsxs)("button",{type:"submit",disabled:d,className:"w-full rounded bg-violet-600 px-3 py-2 text-sm font-medium text-white hover:bg-violet-700 disabled:opacity-50 inline-flex items-center justify-center gap-2",children:[d?(0,t.jsx)(n.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o,{className:"h-3.5 w-3.5"}),l("share.auth.open")]})]})}}},e=>{e.O(0,[4400,4678,9776,9411,9624,4933,146,7358],()=>e(e.s=55861)),_N_E=e.O()}]);
|