copilot-operator 0.1.85 → 0.1.88
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/dist/src/api/operator.controller.js +23 -0
- package/dist/src/api/operator.service.js +59 -2
- package/dist/src/config/schema.js +15 -0
- package/dist/src/orchestrator/kerriganRunner.js +3 -1
- package/dist/src/orchestrator/leadRunner.js +3 -1
- package/dist/src/orchestrator/taskRunner.js +56 -31
- package/dist/src/plan/systemGuide.js +35 -4
- package/dist/src/session/compose.js +5 -1
- package/dist/src/transport/chatTransport.js +6 -2
- package/dist/src/transport/copilotTransport.js +226 -11
- package/dist/src/transport/keptWindow.js +247 -0
- package/dist/src/transport/locators.js +14 -4
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1077.26ca37faa3726fff.js +1 -0
- package/dist/web/_next/static/chunks/1548.f5790cd11a91309f.js +1 -0
- package/dist/web/_next/static/chunks/2163.aa9d9b82fcde6caa.js +1 -0
- package/dist/web/_next/static/chunks/714.b7dbce98ba0b59a8.js +1 -0
- package/dist/web/_next/static/chunks/7220.0ca53eefec5d01ea.js +1 -0
- package/dist/web/_next/static/chunks/7921-8f6503aba840928a.js +1 -0
- package/dist/web/_next/static/chunks/8584.9f3b058a8f67d3d7.js +1 -0
- package/dist/web/_next/static/chunks/9067.107f6164157e0aa1.js +1 -0
- package/dist/web/_next/static/chunks/9747.984a86f70f9cd973.js +1 -0
- package/dist/web/_next/static/chunks/app/page-b71841852e6b9ff5.js +1 -0
- package/dist/web/_next/static/chunks/app/settings/page-95069cb94d79e909.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-13ccb80d7b7094ca.js → webpack-c015bbeb103c0856.js} +1 -1
- package/dist/web/_next/static/css/{6e2b8656501f0dd7.css → 0c5d6d5914aa3824.css} +1 -1
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +8 -8
- package/dist/web/index.html +3 -3
- package/dist/web/index.txt +9 -9
- package/dist/web/queue.html +2 -2
- package/dist/web/queue.txt +9 -9
- package/dist/web/settings.html +2 -2
- package/dist/web/settings.txt +9 -9
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +9 -9
- package/package.json +3 -2
- package/dist/web/_next/static/chunks/1077.06fe73b2c16f8f49.js +0 -1
- package/dist/web/_next/static/chunks/1548.b38c5d8d00ab2a72.js +0 -1
- package/dist/web/_next/static/chunks/2163.ba933c9a506302ca.js +0 -1
- package/dist/web/_next/static/chunks/714.575273a189d030fe.js +0 -1
- package/dist/web/_next/static/chunks/7220.988dfd28e00f407c.js +0 -1
- package/dist/web/_next/static/chunks/7921-65dd56d87144bd44.js +0 -1
- package/dist/web/_next/static/chunks/8584.2221587201bc2fa2.js +0 -1
- package/dist/web/_next/static/chunks/9067.8d94a08830c3d1da.js +0 -1
- package/dist/web/_next/static/chunks/9747.8671194406acd839.js +0 -1
- package/dist/web/_next/static/chunks/app/page-76139370c7ca3715.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-116da78c83f0c5c9.js +0 -1
- /package/dist/web/_next/static/{aCQe1FDhYTj4zGeI5ueVq → hLBBsG7Kn4vd0p_J-47BJ}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{aCQe1FDhYTj4zGeI5ueVq → hLBBsG7Kn4vd0p_J-47BJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{5462:(e,l,t)=>{"use strict";t.d(l,{f:()=>s,q:()=>r});var a=t(73365),n=t(1521);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"below",[l,t]=(0,n.useState)(!1),a=(0,n.useRef)(null),s=(0,n.useRef)(null),r=(0,n.useId)(),[i,o]=(0,n.useState)({visibility:"hidden"}),c=(0,n.useCallback)(()=>t(!1),[]),d=(0,n.useCallback)(()=>t(e=>!e),[]);return(0,n.useLayoutEffect)(()=>{var t;let n,r;if(!l)return void o({visibility:"hidden"});let i=null==(t=a.current)?void 0:t.getBoundingClientRect(),c=s.current;if(!i||!c)return;let d=c.offsetWidth,u=c.offsetHeight;"right"===e?(n=i.right+6,r=Math.min(i.top,window.innerHeight-u-8)):(n=Math.min(i.left,window.innerWidth-d-8),r=i.bottom+6+u>window.innerHeight-8?i.top-6-u:i.bottom+6),o({left:Math.max(8,n),top:Math.max(8,r)})},[l,e]),(0,n.useEffect)(()=>{if(!l)return;let e=e=>{var l,n;let r=e.target;(null==(l=s.current)?void 0:l.contains(r))||(null==(n=a.current)?void 0:n.contains(r))||t(!1)},n=e=>{var l;"Escape"===e.key&&(t(!1),null==(l=a.current)||l.focus())},r=()=>t(!1);return document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",n),window.addEventListener("resize",r),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",n),window.removeEventListener("resize",r)}},[l]),{open:l,setOpen:t,toggle:d,close:c,anchor:a,panel:s,style:i,id:r}}function r(e){let{label:l,text:t}=e,n=s("below");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{ref:n.anchor,type:"button",className:"info-btn","aria-label":l,title:l,"aria-expanded":n.open,"aria-controls":n.open?n.id:void 0,onClick:n.toggle,children:"i"}),n.open&&(0,a.jsxs)("div",{ref:n.panel,id:n.id,role:"dialog","aria-label":l,className:"pop info-pop",style:n.style,children:[(0,a.jsx)("p",{className:"pop-title",children:l}),t.split(/\n\s*\n/).map((e,l)=>{let t=l>0?/^([^::.。\n]{2,90}?)\s?(?::\s|:)/.exec(e):null;return(0,a.jsx)("p",{children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:t[1]}),e.slice(t[1].length)]}):e},e)})]})]})}},11272:(e,l,t)=>{"use strict";t.d(l,{O:()=>n});var a=t(73365);function n(){return(0,a.jsxs)("svg",{className:"branch-ico",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,a.jsx)("path",{d:"M4.5 3.5v9M4.5 10c0-3 7-2.5 7-5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"4.5",cy:"3",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"4.5",cy:"13",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"11.5",cy:"4.2",r:"1.7",fill:"currentColor"})]})}},24784:(e,l,t)=>{"use strict";t.d(l,{Yb:()=>o,u:()=>i});var a=t(73365),n=t(1521),s=t(15549),r=t(8205);let i="::by-hand::";function o(e){var l,t,o;let{id:c,chosen:d,onChange:u,none:m,byHand:h,catalogue:p,disabled:x=!1,style:v}=e,{t:f}=(0,r.kj)(),j=function(e){let[l,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(void 0!==e)return;let l=!0;return s.FH.models().then(e=>{l&&t(e)}).catch(()=>void 0),()=>{l=!1}},[e]),void 0!==e?e:l}(p),g=null!=(l=null==j?void 0:j.options)?l:[],b=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),k=d&&d!==i?g.find(e=>b(e.name)===b(d)):void 0,y=null!=(t=null==k?void 0:k.name)?t:d,w=!!k||d===i&&void 0!==h,N=g.filter(e=>!e.group),S=new Map;for(let e of g)e.group&&S.set(e.group,[...null!=(o=S.get(e.group))?o:[],e]);return(0,a.jsxs)("select",{id:c,value:y,onChange:e=>u(e.target.value),disabled:x,style:{width:"auto",minWidth:280,...v},children:[void 0!==h&&(0,a.jsx)("option",{value:i,children:h}),void 0!==m&&(0,a.jsx)("option",{value:"",children:m}),d&&!w&&(0,a.jsx)("option",{value:d,children:f("model.notInList",{name:d})}),N.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name)),[...S.entries()].map(e=>{let[l,t]=e;return(0,a.jsx)("optgroup",{label:l,children:t.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name))},l)})]})}},51035:(e,l,t)=>{"use strict";t.d(l,{DialogHost:()=>d,Z:()=>c});var a=t(73365),n=t(1521),s=t(8205),r=t(94969);let i=null,o=[];function c(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var a;return a={kind:"confirm",message:e,...l,resolve:t},void(i?i(a):o.push(a))})}function d(e){var l,t;let{children:c}=e,{t:d}=(0,s.kj)(),[u,m]=(0,n.useState)([]),h=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(i=e=>m(l=>[...l,e]),o.length>0){let e=o.splice(0,o.length);m(l=>[...l,...e])}return()=>{i=null}},[]);let x=u[0],v=(0,n.useCallback)(e=>{x&&(x.resolve(e),m(e=>e.slice(1)))},[x]);return(0,r.V)(p,!!x,h),(0,n.useEffect)(()=>{if(!x)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),v(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x,v]),(0,a.jsxs)(a.Fragment,{children:[c,x&&(0,a.jsx)("div",{className:"modal-backdrop",onClick:()=>v(!1),role:"presentation",children:(0,a.jsxs)("div",{ref:p,className:"modal".concat(x.danger?" danger":""),role:"confirm"===x.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("h2",{id:"modal-title",children:null!=(l=x.title)?l:d("confirm"===x.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,a.jsx)("div",{id:"modal-body",className:"modal-body",children:x.message}),(0,a.jsxs)("div",{className:"row modal-actions",children:["confirm"===x.kind&&(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>v(!1),children:d("dialog.cancel")}),(0,a.jsx)("button",{ref:h,type:"button",className:x.danger?"danger":"primary",onClick:()=>v(!0),children:null!=(t=x.okLabel)?t:d("dialog.ok")})]})]})})]})}},65323:(e,l,t)=>{Promise.resolve().then(t.bind(t,91082))},91082:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>f});var a=t(73365),n=t(1521),s=t(15549);let r="{$model_name}",i="{$provider_name}",o=["button","rows","model","provider","providerModel"],c={button:null,rows:null,model:r,provider:i,providerModel:r};function d(e){return e.includes("'")?e.includes('"')?"concat('".concat(e.split("'").join("', \"'\", '"),"')"):'"'.concat(e,'"'):"'".concat(e,"'")}function u(e,l){let t=e,a=(e,l)=>{void 0!==l&&(t=t.split("'".concat(e,"'")).join(l.includes("'")?d(l):"'".concat(l,"'")).split('"'.concat(e,'"')).join(l.includes('"')?d(l):'"'.concat(l,'"')).split(e).join(l))};return a(r,l.model),a(i,l.provider),t}var m=t(8205),h=t(51035),p=t(24784),x=t(5462),v=t(11272);function f(){let{t:e}=(0,m.kj)();(0,n.useEffect)(()=>{let e,l=0,t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));if(!t)return;let a=Date.now()+5e3;cancelAnimationFrame(l);let n=()=>{let s=document.getElementById(t);if(!s){Date.now()<a&&(l=requestAnimationFrame(n));return}let r="reduced"===document.documentElement.dataset.motion||window.matchMedia("(prefers-reduced-motion: reduce)").matches;s.scrollIntoView({block:"start",behavior:r?"auto":"smooth"}),s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}),s.classList.remove("spotlight"),s.offsetWidth,s.classList.add("spotlight"),clearTimeout(e),e=setTimeout(()=>s.classList.remove("spotlight"),4200)};n()};return t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t),cancelAnimationFrame(l),clearTimeout(e)}},[]);let[l,t]=(0,n.useState)(null),[r,i]=(0,n.useState)(!1),[o,c]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.models().then(t).catch(()=>void 0)},[]);let d=async()=>{if(await (0,h.Z)(e("model.refreshConfirm"))){i(!0),c(e("model.refreshing"));try{var l;let a=await s.FH.models().then(()=>s.FH.refreshModels());t(a),c(0===a.options.length?null!=(l=a.note)?l:e("model.none"):e("model.refreshed",{n:a.options.length}))}catch(e){c(e.message)}finally{i(!1)}}},u={catalogue:l,setCatalogue:t,refreshModels:d,refreshing:r,refreshMsg:o};return(0,a.jsxs)("div",{className:"settings",children:[(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:e("def.title")}),(0,a.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,a.jsx)("p",{className:"why",children:e("def.autoSave")}),(0,a.jsx)("p",{className:"why",children:e("def.live")})]}),(0,a.jsx)(E,{}),(0,a.jsx)(O,{}),(0,a.jsx)(M,{}),(0,a.jsx)(I,{}),(0,a.jsx)(L,{role:"worker",...u}),(0,a.jsx)(L,{role:"lead",...u}),(0,a.jsx)(L,{role:"kerrigan",...u}),(0,a.jsx)(L,{role:"review",...u}),(0,a.jsx)(T,{catalogue:l}),(0,a.jsx)(K,{}),(0,a.jsx)(U,{}),(0,a.jsx)(Z,{})]})}function j(e){let{htmlFor:l,label:t,info:n,as:s="label"}=e,{t:r}=(0,m.kj)();return(0,a.jsxs)("div",{className:"field-label",children:["label"===s?(0,a.jsx)("label",{htmlFor:l,children:t}):(0,a.jsx)("span",{className:"field-name",children:t}),(0,a.jsx)(x.q,{label:r("info.about",{name:t}),text:n})]})}function g(e){let{id:l,label:t,info:n,unit:s,children:r}=e;return(0,a.jsxs)("div",{className:"settings-field",children:[(0,a.jsx)(j,{htmlFor:l,label:t,info:n}),(0,a.jsxs)("div",{className:"field-control",children:[r,s&&(0,a.jsx)("span",{className:"unit",children:s})]})]})}function b(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,t=(0,n.useRef)(null),a=(0,n.useRef)(null),s=(0,n.useRef)(e);return s.current=e,(0,n.useEffect)(()=>()=>{t.current&&clearTimeout(t.current),a.current&&s.current(a.current.value)},[]),e=>{t.current&&clearTimeout(t.current),a.current={value:e},t.current=setTimeout(()=>{a.current=null,s.current(e)},l)}}function k(e){let{id:l,value:t,min:s,max:r,onChange:i,disabled:o}=e,[c,d]=(0,n.useState)(String(t));return(0,n.useEffect)(()=>d(e=>y(e)===t?e:String(t)),[t]),(0,a.jsx)("input",{id:l,type:"number",className:"number",min:s,max:r,step:1,value:c,onChange:e=>{d(e.target.value);let l=y(e.target.value);null!==l&&l>=s&&l<=r&&i(l)},onBlur:()=>{let e=y(c),l=null===e?t:Math.max(s,Math.min(r,e));d(String(l)),l!==t&&i(l)},disabled:o})}function y(e){if(""===e.trim())return null;let l=Number(e);return Number.isInteger(l)?l:null}let w=(0,n.createContext)(e=>e);function N(){let[e,l]=(0,n.useState)(0),t=(0,n.useRef)(!0);return(0,n.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),{saving:e>0,track:(0,n.useCallback)(async e=>{let a=Date.now();l(e=>e+1);try{return await e}finally{setTimeout(()=>{t.current&&l(e=>Math.max(0,e-1))},Math.max(0,1600-(Date.now()-a)))}},[])}}function S(){let[e,l]=(0,n.useState)(1);return(0,n.useEffect)(()=>{let e=setInterval(()=>l(e=>e%3+1),380);return()=>clearInterval(e)},[]),(0,a.jsx)("span",{className:"saving-dots","aria-hidden":"true",children:".".repeat(e)})}function C(e){let{msg:l,saving:t}=e,{t:n}=(0,m.kj)();return t?(0,a.jsx)("div",{className:"row saved-note",children:(0,a.jsxs)("span",{className:"saving small",role:"status",children:[n("def.saving"),(0,a.jsx)(S,{})]})}):l?(0,a.jsx)("div",{className:"row saved-note",children:(0,a.jsx)("span",{className:"muted small",role:"status",children:l})}):null}let R={name:"",description:"",text:"",projectDir:"",forKerrigan:""};function M(){let{t:e}=(0,m.kj)(),{saving:l,track:t}=N(),[r,i]=(0,n.useState)(null),[o,c]=(0,n.useState)({maxDescription:300,maxForKerrigan:3e3}),[d,u]=(0,n.useState)([]),[p,x]=(0,n.useState)(""),[v,f]=(0,n.useState)(""),[j,g]=(0,n.useState)(!1),[b,k]=(0,n.useState)(R);(0,n.useEffect)(()=>{s.FH.skills().then(e=>{var l;i(e.skills),c({maxDescription:e.maxDescription,maxForKerrigan:null!=(l=e.maxForKerrigan)?l:3e3})}).catch(e=>f(e.message)),s.FH.project().then(e=>u([...e.rootDir?[{name:e.name||e.rootDir,dir:e.rootDir}]:[],...e.others.map(e=>({name:e.name,dir:e.rootDir}))])).catch(()=>void 0)},[]);let y=async l=>{g(!0),f("");try{let a=await t(s.FH.setSkills(l));return i(a.skills),x(e("skills.saved",{n:a.skills.length})),!0}catch(e){return f(e.message),!1}finally{g(!1)}},w=null!=r?r:[],S=async()=>{await y([...w,{...b,name:b.name.trim().toLowerCase()}])&&k(R)},M=async l=>{await (0,h.Z)(e("skills.removeConfirm",{name:w[l].name}),{okLabel:e("skills.remove"),danger:!0})&&await y(w.filter((e,t)=>t!==l))};return(0,a.jsxs)("section",{className:"panel",id:"skills","aria-labelledby":"skills-title",children:[(0,a.jsx)("h2",{id:"skills-title",children:e("skills.title")}),(0,a.jsx)("p",{className:"muted small",children:e("skills.intro")}),v&&(0,a.jsx)("div",{className:"err",children:v}),r&&0===r.length&&(0,a.jsx)("p",{className:"muted small",children:e("skills.none")}),w.map((e,l)=>(0,a.jsx)(W,{skill:e,projects:d,limits:o,onChange:e=>y(w.map((t,a)=>a===l?e:t)),onRemove:()=>void M(l),busy:j},"skill-".concat(l))),(0,a.jsx)(C,{msg:p,saving:l}),(0,a.jsx)("h3",{id:"skills-add",children:e("skills.addTitle")}),(0,a.jsx)(W,{skill:b,projects:d,limits:o,onDraft:k,busy:j}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("button",{className:"primary",onClick:()=>void S(),disabled:j||!b.name.trim()||!b.text.trim(),children:e("skills.add")})})]})}function F(){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2.5 4h11M6 4V2.5h4V4M3.8 4l.7 9.5h7l.7-9.5M6.6 6.6v4.8M9.4 6.6v4.8"})})}function W(e){var l;let{skill:t,projects:s,limits:r,onChange:i,onDraft:o,onRemove:c,busy:d}=e,{t:u}=(0,m.kj)(),h=(0,n.useId)(),[p,x]=(0,n.useState)(t),v=(0,n.useRef)(!1);(0,n.useEffect)(()=>{v.current||x(t)},[t]);let f=e=>{let l={...p,...e};return x(l),null==o||o(l),l},g=b(async e=>{v.current=!1,i&&(e.text!==t.text||e.forKerrigan!==t.forKerrigan)&&await i(e)},1200),k=()=>{i&&(p.name!==t.name||p.description!==t.description)&&i(p)};return(0,a.jsxs)("div",{className:"panel inner skill-entry".concat(i?"":" skill-new"),children:[c&&(0,a.jsxs)("div",{className:"skill-head",children:[(0,a.jsxs)("span",{className:"skill-title",children:["/",p.name]}),(0,a.jsxs)("button",{type:"button",className:"danger skill-delete",onClick:c,disabled:d,"aria-label":u("skills.removeOne",{name:p.name}),title:u("skills.removeOne",{name:p.name}),children:[(0,a.jsx)(F,{}),u("skills.remove")]})]}),(0,a.jsxs)("div",{className:"project-fields",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(h,"-name"),label:u("skills.name"),info:u("skills.nameInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons skill-name-box",children:[(0,a.jsx)("span",{className:"skill-slash","aria-hidden":"true",children:"/"}),(0,a.jsx)("input",{id:"".concat(h,"-name"),type:"text",value:p.name,onChange:e=>f({name:e.target.value}),onBlur:k,placeholder:"new-test",spellCheck:!1})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(h,"-description"),label:u("skills.description"),info:u("skills.descriptionInfo")}),(0,a.jsx)("input",{id:"".concat(h,"-description"),type:"text",value:p.description,maxLength:r.maxDescription,onChange:e=>f({description:e.target.value}),onBlur:k})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(h,"-project"),label:u("skills.project"),info:u("skills.projectInfo")}),(0,a.jsx)("div",{className:"input-with-buttons",children:(0,a.jsxs)("select",{id:"".concat(h,"-project"),value:p.projectDir,onChange:e=>{let l=f({projectDir:e.target.value});i&&i(l)},children:[(0,a.jsx)("option",{value:"",children:u("skills.allProjects")}),s.map(e=>(0,a.jsx)("option",{value:e.dir,children:e.name},e.dir))]})})]})]}),(0,a.jsxs)("div",{className:"project-level2",children:[(0,a.jsx)(j,{htmlFor:"".concat(h,"-text"),label:u("skills.text"),info:u("skills.textInfo")}),(0,a.jsx)("textarea",{id:"".concat(h,"-text"),className:"prose",rows:5,value:p.text,onChange:e=>{let l=f({text:e.target.value});i&&(v.current=!0,g(l))},placeholder:u("skills.textPlaceholder")}),(0,a.jsx)("span",{className:"muted small skill-count",children:u("skills.count",{n:p.text.length.toLocaleString()})})]}),(0,a.jsxs)("div",{className:"project-level2",children:[(0,a.jsx)(j,{htmlFor:"".concat(h,"-kerrigan"),label:u("skills.forKerrigan"),info:u("skills.forKerriganInfo")}),(0,a.jsx)("textarea",{id:"".concat(h,"-kerrigan"),className:"prose",rows:3,maxLength:r.maxForKerrigan,value:null!=(l=p.forKerrigan)?l:"",onChange:e=>{let l=f({forKerrigan:e.target.value});i&&(v.current=!0,g(l))},placeholder:u("skills.forKerriganPlaceholder")})]})]})}function E(){let{t:e}=(0,m.kj)(),[l,t]=(0,n.useState)(null),[r,i]=(0,n.useState)("");return(0,n.useEffect)(()=>{s.FH.level1().then(e=>t(e.content)).catch(l=>i(e("l1.failed",{reason:l.message})))},[]),(0,a.jsxs)("section",{className:"panel",id:"level1","aria-labelledby":"level1-title",children:[(0,a.jsxs)("div",{className:"row section-title",children:[(0,a.jsx)("h2",{id:"level1-title",children:e("l1.title")}),(0,a.jsx)("span",{className:"badge",children:e("l1.readOnly")})]}),(0,a.jsx)("div",{className:"callout",role:"note",children:e("l1.what")}),r&&(0,a.jsx)("div",{className:"err",children:r}),(0,a.jsxs)("details",{className:"l1-text",children:[(0,a.jsx)("summary",{children:e("l1.show")}),(0,a.jsx)("pre",{className:"l1-pre",children:null!=l?l:"…"})]})]})}function O(){var e,l;let{t}=(0,m.kj)(),{saving:r,track:i}=N(),[o,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(""),[h,p]=(0,n.useState)(""),[x,v]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),[k,y]=(0,n.useState)(!1),[w,S]=(0,n.useState)(""),[R,M]=(0,n.useState)(""),F=(0,n.useCallback)(async()=>{try{let e=await s.FH.project();c(e),u(e.rootDir),p(e.name),g("")}catch(e){g(e.message)}},[]);(0,n.useEffect)(()=>{F()},[F]);let W=async(e,l)=>{y(!0),v("");try{let t=await i(s.FH.setProject(e));return c(t),u(t.rootDir),v(l(t)),g(""),!0}catch(e){return g(e.message),!1}finally{y(!1)}},E=e=>W({rootDir:e},e=>e.rootDir?t("proj.saved",{dir:e.rootDir}):t("proj.cleared")),O=e=>W({name:e},()=>t("proj.nameSaved")),I=b(E),A=b(O),L=async(e,l)=>{y(!0);try{var t;let a=await s.FH.browseFolder(l.trim()||void 0);a.ok?e(a.path):a.cancelled||g(null!=(t=a.reason)?t:"")}catch(e){g(e.message)}finally{y(!1)}},H=null!=(e=null==o?void 0:o.others)?e:[],P=e=>e.map(e=>({name:e.name,rootDir:e.rootDir,level2:e.level2,readOnly:e.readOnly})),T=(e,l,t)=>W({others:P(H.map(t=>t.name===e.name?{...t,...l}:t))},t),q=async()=>{await W({others:[...P(H),{name:w.trim(),rootDir:R.trim(),level2:"",readOnly:!1}]},e=>t("proj.othersSaved",{n:e.others.length}))&&(S(""),M(""))};return(0,a.jsxs)("section",{className:"panel",id:"project","aria-labelledby":"project-title",children:[(0,a.jsx)("h2",{id:"project-title",children:t("proj.title")}),(0,a.jsx)("p",{className:"muted small",children:t("proj.intro")}),f&&(0,a.jsx)("div",{className:"err",children:f}),(0,a.jsx)(D,{name:h,dir:d,repoOk:!!(null==o?void 0:o.repoOk),repoProblem:null==o?void 0:o.repoProblem,branch:null==o?void 0:o.branch,level2:null!=(l=null==o?void 0:o.level2)?l:"",readOnly:(null==o?void 0:o.readOnly)===!0,onReadOnly:e=>W({readOnly:e},()=>t(e?"proj.readOnlyOn":"proj.readOnlyOff",{name:h||d})),isDefault:!0,busy:k,onNameInput:e=>{p(e),A(e)},onName:e=>void O(e),onDirInput:e=>{u(e),I(e)},onDir:e=>void E(e),onBrowse:()=>void L(e=>void E(e),d),onLevel2:e=>W({level2:e},()=>t("proj.level2Saved",{name:h||d})),onRemove:(null==o?void 0:o.rootDir)?()=>void E(""):void 0,removeLabel:t("proj.clear")}),o&&!o.rootDir&&(0,a.jsx)("p",{className:"muted small",children:t("proj.none")}),H.map((e,l)=>(0,a.jsx)(D,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,branch:e.branch,level2:e.level2,readOnly:!0===e.readOnly,onReadOnly:l=>T(e,{readOnly:l},()=>t(l?"proj.readOnlyOn":"proj.readOnlyOff",{name:e.name})),busy:k,onName:l=>void T(e,{name:l},()=>t("proj.nameSaved")),onDir:l=>void T(e,{rootDir:l},()=>t("proj.othersSaved",{n:H.length})),onBrowse:()=>void L(l=>void T(e,{rootDir:l},()=>t("proj.othersSaved",{n:H.length})),e.rootDir),onLevel2:l=>T(e,{level2:l},()=>t("proj.level2Saved",{name:e.name})),onRemove:()=>{let l;l=e.name,W({others:P(H.filter(e=>e.name!==l))},e=>t("proj.othersSaved",{n:e.others.length}))},removeLabel:t("proj.otherRemove")},"other-".concat(l))),(0,a.jsx)(C,{msg:x,saving:r}),(0,a.jsx)("h3",{id:"others",children:t("proj.addTitle")}),(0,a.jsx)("p",{className:"muted small",children:t("proj.othersIntro")}),(0,a.jsxs)("div",{className:"project-fields add-project",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"new-project-name",label:t("proj.entryName"),info:t("proj.nameInfo")}),(0,a.jsx)("input",{id:"new-project-name",type:"text",value:w,onChange:e=>S(e.target.value),placeholder:t("proj.entryName"),disabled:k})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"new-project-dir",label:t("proj.entryDir"),info:t("proj.dirInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons",children:[(0,a.jsx)("input",{id:"new-project-dir",type:"text",value:R,onChange:e=>M(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:k}),(0,a.jsx)("button",{onClick:()=>void L(e=>M(e),R),disabled:k,children:t("mirror.browse")}),(0,a.jsx)("button",{className:"primary",onClick:()=>void q(),disabled:k||!w.trim()||!R.trim(),children:t("proj.otherAdd")})]})]})]})]})}function D(e){var l;let{name:t,dir:s,repoOk:r,repoProblem:i,branch:o,level2:c,readOnly:d,onReadOnly:u,isDefault:h=!1,busy:p,onNameInput:f,onName:g,onDirInput:k,onDir:y,onBrowse:w,onLevel2:N,onRemove:S,removeLabel:C}=e,{t:R}=(0,m.kj)(),M=(0,n.useId)(),[F,W]=(0,n.useState)(t),[E,O]=(0,n.useState)(s),[D,I]=(0,n.useState)(c),A=(0,n.useRef)(!1),[L,H]=(0,n.useState)(d);(0,n.useEffect)(()=>H(d),[d]),(0,n.useEffect)(()=>W(t),[t]),(0,n.useEffect)(()=>O(s),[s]),(0,n.useEffect)(()=>{A.current||I(c)},[c]);let P=b(async e=>{A.current=!1,e!==c&&await N(e)},1200);return(0,a.jsxs)("div",{className:"panel inner project-entry",children:[(0,a.jsxs)("div",{className:"row project-tags",children:[h&&(0,a.jsx)("span",{className:"chip",title:R("proj.isDefaultWhy"),children:R("proj.isDefault")}),L&&(0,a.jsx)("span",{className:"badge reference",title:R("proj.readOnlyInfo"),children:R("proj.readOnlyBadge")}),s&&(0,a.jsx)("span",{className:"badge ".concat(r?"done":""),title:r?R("proj.isRepo"):i,children:R(r?"proj.otherRepo":"proj.otherNotRepo")}),s&&r&&o&&(0,a.jsxs)("span",{className:"branch-tag",children:[(0,a.jsxs)("span",{className:"badge branch",children:[(0,a.jsx)(v.O,{})," ","HEAD"===o?R("proj.detached"):R("proj.branch",{name:o})]}),(0,a.jsx)(x.q,{label:R("info.about",{name:R("proj.branch",{name:o})}),text:R("proj.branchInfo")})]})]}),s&&!r&&(0,a.jsx)("p",{className:"muted small",children:i||R("proj.notRepoWhy")}),(0,a.jsxs)("div",{className:"field-label check-label project-readonly",children:[(0,a.jsx)("input",{id:"".concat(M,"-readonly"),type:"checkbox",checked:L,onChange:e=>{let l=e.target.checked;H(l),u(l).then(e=>{!1===e&&H(!l)})}}),(0,a.jsx)("label",{htmlFor:"".concat(M,"-readonly"),children:R("proj.readOnly")}),(0,a.jsx)(x.q,{label:R("info.about",{name:R("proj.readOnly")}),text:R("proj.readOnlyInfo")})]}),(0,a.jsxs)("div",{className:"project-fields",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(M,"-name"),label:R("proj.entryName"),info:R("proj.nameInfo")}),(0,a.jsx)("input",{id:"".concat(M,"-name"),type:"text",value:F,onChange:e=>{W(e.target.value),null==f||f(e.target.value)},onBlur:()=>{(F!==t||f)&&g(F)},placeholder:s?null!=(l=s.replace(/[\\/]+$/,"").split(/[\\/]/).pop())?l:"":R("proj.namePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(M,"-dir"),label:R("proj.entryDir"),info:R("proj.dirInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons",children:[(0,a.jsx)("input",{id:"".concat(M,"-dir"),type:"text",value:E,onChange:e=>{O(e.target.value),null==k||k(e.target.value)},onBlur:()=>{(E!==s||k)&&y(E)},placeholder:"C:\\Projects\\my-app"}),(0,a.jsx)("button",{onClick:w,disabled:p,children:R("mirror.browse")}),S&&(0,a.jsx)("button",{className:"quiet",onClick:S,disabled:p,children:C})]})]})]}),(0,a.jsxs)("div",{className:"project-level2",children:[(0,a.jsx)(j,{htmlFor:"".concat(M,"-level2"),label:R("proj.level2"),info:R("proj.level2Info")}),(0,a.jsx)("textarea",{id:"".concat(M,"-level2"),className:"prose",rows:4,value:D,onChange:e=>{A.current=!0,I(e.target.value),P(e.target.value)},placeholder:R("proj.level2Placeholder")}),(0,a.jsx)("span",{className:"muted small",children:R("proj.level2Count",{n:D.length.toLocaleString()})})]})]})}function I(){let{t:e}=(0,m.kj)(),[l,t]=(0,n.useState)(""),[r,i]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),h=async()=>{i(!0),u(""),c(e("login.waiting"));try{let e=await s.FH.login(l);e.ok?c(e.message):(c(""),u(e.message))}catch(e){c(""),u(e.message)}finally{i(!1)}};return(0,a.jsxs)("section",{className:"panel",id:"login","aria-labelledby":"login-title",children:[(0,a.jsx)("h2",{id:"login-title",children:e("login.title")}),(0,a.jsx)("p",{className:"muted small",children:e("login.intro")}),d&&(0,a.jsx)("div",{className:"err",children:d}),(0,a.jsxs)(g,{id:"login-account",label:e("login.account"),info:e("login.accountWhy"),children:[(0,a.jsx)("input",{id:"login-account",type:"email",value:l,onChange:e=>t(e.target.value),placeholder:"name@company.com",disabled:r}),(0,a.jsx)("button",{className:"primary",onClick:()=>void h(),disabled:r,children:r?e("login.busy"):e("login.button")})]}),o&&(0,a.jsx)("div",{className:"small",role:"status",children:o})]})}let A={worker:{section:"model",pick:"default-model",manualId:"manual-model",manualKey:"manualModel",field:"defaultModel",title:"def.modelTitle",intro:"def.modelIntro",info:"def.modelInfo",manualWhy:"def.manualModelWhy",saved:"def.modelSaved",cleared:"def.modelCleared",save:async e=>(await s.FH.setDefaultModel(e)).defaultModel},lead:{section:"lead-model",pick:"default-lead-model",manualId:"manual-lead-model",manualKey:"leadManualModel",field:"defaultLeadModel",title:"def.leadTitle",intro:"def.leadIntro",info:"def.leadInfo",manualWhy:"def.leadManualWhy",saved:"def.leadSaved",cleared:"def.leadCleared",save:async e=>(await s.FH.setDefaultLeadModel(e)).defaultLeadModel},kerrigan:{section:"kerrigan-model",pick:"default-kerrigan-model",manualId:"manual-kerrigan-model",manualKey:"kerriganManualModel",field:"defaultKerriganModel",title:"def.kerriganTitle",intro:"def.kerriganIntro",info:"def.kerriganInfo",manualWhy:"def.kerriganManualWhy",saved:"def.kerriganSaved",cleared:"def.kerriganCleared",save:async e=>(await s.FH.setDefaultKerriganModel(e)).defaultKerriganModel},review:{section:"review",pick:"default-review-model",manualId:"manual-review-model",manualKey:"reviewManualModel",field:"defaultReviewModel",title:"def.reviewTitle",intro:"def.reviewIntro",info:"def.reviewInfo",manualWhy:"def.reviewManualWhy",saved:"def.reviewSaved",cleared:"def.reviewCleared",save:async e=>(await s.FH.setDefaultReviewModel(e)).defaultReviewModel}};function L(e){var l,t;let{role:s,catalogue:r,setCatalogue:i,refreshModels:o,refreshing:c,refreshMsg:d}=e,{t:u}=(0,m.kj)(),h=(0,m.W3)(),x=A[s],{saving:v,track:f}=N(),[j,b]=(0,n.useState)(""),[k,y]=(0,n.useState)(""),[S,R]=(0,n.useState)(!1),M=null!=(l=null==r?void 0:r[x.field])?l:"",F=async e=>{R(!0),b("");try{let l=await f(x.save(e));r&&i({...r,[x.field]:l}),b(l?u(x.saved,{name:l}):u(x.cleared)),y("")}catch(e){y(e.message)}finally{R(!1)}},W="review"===s&&""!==M&&M===(null!=(t=null==r?void 0:r.defaultModel)?t:"");return(0,a.jsx)(w.Provider,{value:f,children:(0,a.jsxs)("section",{className:"panel",id:x.section,"aria-labelledby":"".concat(x.section,"-title"),children:[(0,a.jsx)("h2",{id:"".concat(x.section,"-title"),children:u(x.title)}),(0,a.jsx)("p",{className:"muted small",children:u(x.intro)}),k&&(0,a.jsx)("div",{className:"err",children:k}),(0,a.jsxs)(g,{id:x.pick,label:u("def.modelField"),info:u(x.info),children:[(0,a.jsx)(p.Yb,{id:x.pick,chosen:M,onChange:e=>void F(e),none:u("def.modelNone"),catalogue:r,disabled:S||c}),(0,a.jsx)("button",{className:"quiet",onClick:()=>void F(""),disabled:S||!M,children:u("proj.clear")}),(0,a.jsx)("button",{onClick:()=>void o(),disabled:S||c,children:u("model.refresh")})]}),(0,a.jsx)("p",{className:"muted small field-after",children:(null==r?void 0:r.readAt)?u("model.readAt",{t:h(r.readAt),n:r.options.length}):u("model.neverRead")}),W&&(0,a.jsx)("p",{className:"why field-after warned-text",children:u("def.reviewSame")}),(0,a.jsx)(H,{id:x.manualId,setting:x.manualKey,why:x.manualWhy}),(0,a.jsx)(C,{msg:j||d,saving:v})]})})}function H(e){let{id:l,setting:t,why:r}=e,{t:i}=(0,m.kj)(),o=(0,n.useContext)(w),[c,d]=(0,n.useState)(null),[u,h]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,a,n;let s=null!=(n=e.raw.copilot)?n:{},r=(null==(a=e.defaults)||null==(l=a.copilot)?void 0:l.manualModel)!==!1,i="boolean"==typeof s.manualModel?s.manualModel:r,o="boolean"==typeof s.leadManualModel?s.leadManualModel:i,c=s[t];d("boolean"==typeof c?c:"kerriganManualModel"===t?o:i)}).catch(e=>h(e.message))},[t]);let p=async e=>{d(e);try{await o(s.FH.settings().then(l=>{var a;return s.FH.saveSettings({...l.raw,copilot:{...null!=(a=l.raw.copilot)?a:{},[t]:e}})})),h("")}catch(e){h(e.message)}};return(0,a.jsxs)("div",{className:"settings-field",children:[(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:l,type:"checkbox",checked:!0===c,disabled:null===c,onChange:e=>void p(e.target.checked)}),(0,a.jsx)("label",{htmlFor:l,children:i("def.manualModel")}),(0,a.jsx)(x.q,{label:i("info.about",{name:i("def.manualModel")}),text:i(r)})]}),u&&(0,a.jsx)("div",{className:"err",children:u})]})}let P=[{key:"button",label:"loc.button",why:"loc.buttonWhy"},{key:"rows",label:"loc.rows",why:"loc.rowsWhy"},{key:"model",label:"loc.model",why:"loc.modelWhy"},{key:"provider",label:"loc.provider",why:"loc.providerWhy"},{key:"providerModel",label:"loc.providerModel",why:"loc.providerModelWhy"}];function T(e){var l,t,r,i;let{catalogue:c}=e,{t:d}=(0,m.kj)(),{saving:u,track:h}=N(),[p,v]=(0,n.useState)(null),[f,j]=(0,n.useState)(null),[g,b]=(0,n.useState)(null),[k,y]=(0,n.useState)(!1),[S,R]=(0,n.useState)(""),[M,F]=(0,n.useState)(""),W=(0,n.useRef)(Promise.resolve());(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,t,a,n,s,r;let i=null!=(a=e.raw.copilot)?a:{},c=null!=(n=i.pickerLocators)?n:{};v(Object.fromEntries(o.map(e=>{var l;return[e,null!=(l=c[e])?l:""]}))),j(null!=(s=null==(l=e.picker)?void 0:l.defaults)?s:null),b(null!=(r=null==(t=e.picker)?void 0:t.dirs)?r:null),y(!0===i.pickerSteps)}).catch(e=>F(e.message))},[]);let E=e=>{let l=async()=>{try{var l;let t=(await s.FH.settings()).raw;R(""),await h(s.FH.saveSettings({...t,copilot:e({...null!=(l=t.copilot)?l:{}})})),R(d("loc.saved")),F("")}catch(e){F(e.message)}},t=W.current.then(l,l);return W.current=t.catch(()=>void 0),t},O=null!=(t=null==c||null==(l=c.options.find(e=>!e.group))?void 0:l.name)?t:"Think deeper",D=null==c?void 0:c.options.find(e=>e.group),I=null!=(r=null==D?void 0:D.group)?r:"Claude",A=null!=(i=null==D?void 0:D.name)?i:"Opus 5.5";return(0,a.jsx)(w.Provider,{value:h,children:(0,a.jsxs)("section",{className:"panel",id:"picker-locators","aria-labelledby":"picker-locators-title",children:[(0,a.jsx)("h2",{id:"picker-locators-title",children:d("loc.title")}),(0,a.jsx)("p",{className:"muted small",children:d("loc.intro")}),(0,a.jsxs)("details",{className:"picker-how",children:[(0,a.jsx)("summary",{children:d("loc.howTitle")}),(0,a.jsxs)("ol",{className:"small",children:[(0,a.jsx)("li",{children:d("loc.how1")}),(0,a.jsx)("li",{children:d("loc.how2")}),(0,a.jsx)("li",{children:d("loc.how3")}),(0,a.jsx)("li",{children:d("loc.how4")})]})]}),M&&(0,a.jsx)("div",{className:"err",children:M}),p&&f?P.map(e=>{let l;return(0,a.jsx)(q,{field:e.key,label:d(e.label),why:d(e.why),initial:p[e.key],fallback:f[e.key],example:"model"===(l=e.key)?{name:O,names:{model:O}}:"provider"===l?{name:I,names:{provider:I}}:"providerModel"===l?{name:A,names:{model:A,provider:I}}:null,onSave:l=>{let t;return t=e.key,E(e=>{var a;let n={...null!=(a=e.pickerLocators)?a:{}};l.trim()?n[t]=l.trim():delete n[t];let s={...e,pickerLocators:n};return 0===Object.keys(n).length&&delete s.pickerLocators,s})}},e.key)}):!M&&(0,a.jsx)("p",{className:"muted small",children:d("loc.loading")}),(0,a.jsx)("div",{className:"settings-field",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"picker-steps",type:"checkbox",checked:k,disabled:!p,onChange:e=>{let l=e.target.checked;y(l),E(e=>({...e,pickerSteps:l}))}}),(0,a.jsx)("label",{htmlFor:"picker-steps",children:d("loc.steps")}),(0,a.jsx)(x.q,{label:d("info.about",{name:d("loc.steps")}),text:d("loc.stepsWhy")})]})}),g&&(0,a.jsx)("p",{className:"muted small field-after picker-dirs",children:d("loc.stepsWhere",{run:g.run,read:g.read})}),(0,a.jsx)(C,{msg:S,saving:u})]})})}function q(e){let{field:l,label:t,why:s,initial:r,fallback:i,example:o,onSave:d}=e,{t:h}=(0,m.kj)(),[p,x]=(0,n.useState)(r),[v,f]=(0,n.useState)(null),g=b(e=>d(e)),k="picker-".concat(l),y=v?"placeholder"===v.kind?h("loc.noPlaceholder",{ph:v.placeholder}):"colons"===v.kind?h("loc.twoColons",{axis:v.axis}):"xpath"===v.kind?h("loc.badXPath",{msg:v.message}):h("loc.badCss",{msg:v.message}):"",w=p.trim()||i;return(0,a.jsxs)("div",{className:"settings-field picker-field",children:[(0,a.jsx)(j,{htmlFor:k,label:t,info:s}),(0,a.jsxs)("div",{className:"field-control",children:[(0,a.jsx)("input",{id:k,type:"text",className:"picker-locator",spellCheck:!1,autoComplete:"off",value:p,placeholder:i,"aria-invalid":!!v||void 0,onChange:e=>(e=>{x(e);let t=function(e,l,t){var a;let n=l.trim();if(""===n)return null;let s=c[e];if(s&&!n.includes(s))return{kind:"placeholder",placeholder:s};let r=n.startsWith("xpath=")||!n.startsWith("css=")&&/^\s*(\/|\(|\.\.?\/)/.test(n),i=/(^|[/[(|\s])(ancestor-or-self|ancestor|attribute|child|descendant-or-self|descendant|following-sibling|following|parent|preceding-sibling|preceding|self):(?!:)/.exec(n);if(i&&r)return{kind:"colons",axis:i[2]};if(!t)return null;let o=u(n.replace(/^(xpath|css)=/,""),{model:"Think deeper",provider:"Claude"});try{r?t.evaluate(o,t,null,XPathResult.ANY_TYPE,null):t.querySelector(o)}catch(l){let e=(null!=(a=l.message)?a:String(l)).replace(/^Failed to execute '\w+' on 'Document': /,"");return r?{kind:"xpath",message:e}:{kind:"css",message:e}}return null}(l,e,document);f(t),t||g(e)})(e.target.value)}),(0,a.jsx)("button",{className:"quiet",disabled:!p,onClick:()=>{x(""),f(null),d("")},children:h("loc.default")})]}),v?(0,a.jsx)("div",{className:"err field-after",role:"alert",children:y}):(0,a.jsxs)("p",{className:"muted small field-after picker-note",children:[!p.trim()&&(0,a.jsxs)("span",{children:[h("loc.isDefault")," "]}),o&&(0,a.jsxs)(a.Fragment,{children:[h("loc.example",{name:o.name})," ",(0,a.jsx)("code",{className:"picker-example",children:u(w,o.names)})]})]})]})}function K(){let{t:e}=(0,m.kj)(),{saving:l,track:t}=N(),[r,i]=(0,n.useState)(null),o=(0,n.useRef)(null),c=(0,n.useRef)(Promise.resolve()),[d,u]=(0,n.useState)(2),[p,v]=(0,n.useState)(3),[f,j]=(0,n.useState)(3),[y,w]=(0,n.useState)(2),[S,R]=(0,n.useState)(2),[M,F]=(0,n.useState)(60),[W,E]=(0,n.useState)(240),[O,D]=(0,n.useState)(20),[I,A]=(0,n.useState)(6),[L,H]=(0,n.useState)(900),[P,T]=(0,n.useState)(12e4),[q,K]=(0,n.useState)(!1),[B,U]=(0,n.useState)(60),[_,Z]=(0,n.useState)(!1),[z,V]=(0,n.useState)(90),[$,Y]=(0,n.useState)("none"),[X,J]=(0,n.useState)("confirm"),[G,Q]=(0,n.useState)("ask"),[ee,el]=(0,n.useState)("ask"),[et,ea]=(0,n.useState)("ask"),[en,es]=(0,n.useState)("copy"),[er,ei]=(0,n.useState)("ask"),[eo,ec]=(0,n.useState)(2),[ed,eu]=(0,n.useState)(15),[em,eh]=(0,n.useState)(""),[ep,ex]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,t,a,n,s,r,c,d,m;o.current=e.raw,i(e.raw);let h=null!=(l=e.raw.limits)?l:{};v("number"==typeof h.autoContinue?h.autoContinue:3),j("number"==typeof h.reopenWindow?h.reopenWindow:3),u("number"==typeof h.retryBlockedInFreshChat?h.retryBlockedInFreshChat:2),w("number"==typeof h.minApproachesBeforeBlocked?h.minApproachesBeforeBlocked:2),R("number"==typeof h.maxReviewRounds?h.maxReviewRounds:2),F("number"==typeof h.maxIterations?h.maxIterations:60),E("number"==typeof h.maxRunMinutes?h.maxRunMinutes:240),D("number"==typeof h.maxSubtasks?h.maxSubtasks:20),A("number"==typeof h.maxKerriganSends?h.maxKerriganSends:6),T("number"==typeof h.maxMessageChars?h.maxMessageChars:12e4),ei(null!=(t=h.subtaskRetryMode)?t:"ask"),ec("number"==typeof h.subtaskRetries?h.subtaskRetries:2),eu("number"==typeof h.subtaskRetryWaitSec?h.subtaskRetryWaitSec:15);let p=null!=(a=e.raw.pacing)?a:{};K(!0===p.gapEnabled),U("number"==typeof p.gapSec?p.gapSec:60),Z(!0===p.gapRandom),V("number"==typeof p.gapMaxSec?p.gapMaxSec:90);let x=null!=(n=e.raw.copilot)?n:{};H("number"==typeof x.replyTimeoutSec?x.replyTimeoutSec:900);let f=null!=(s=e.raw.execution)?s:{};es("exchange"===f.kerriganResult?"exchange":"copy"),Q("run"===f.writtenScripts?"run":"ask"),Y(null!=(r=f.isolation)?r:"none"),J(null!=(c=f.mode)?c:"confirm"),el(null!=(d=f.networkFetch)?d:"ask"),ea(null!=(m=f.questions)?m:"ask")}).catch(e=>ex(e.message))},[]);let ev=(l,a,n)=>{let r=async()=>{var r;if(!o.current)return;let c=await s.FH.settings().then(e=>e.raw).catch(()=>o.current),d={...c,[l]:{...null!=(r=c[l])?r:{},[a]:n}};eh("");try{await t(s.FH.saveSettings(d)),o.current=d,i(d),eh(e("exec.saved")),ex("")}catch(e){ex(e.message)}},d=c.current.then(r);return c.current=d.catch(()=>void 0),d},ef=b(e=>ev("limits","retryBlockedInFreshChat",e)),ej=b(e=>ev("limits","autoContinue",e)),eg=b(e=>ev("limits","reopenWindow",e)),eb=b(e=>ev("limits","minApproachesBeforeBlocked",e)),ek=b(e=>ev("limits","maxReviewRounds",e)),ey=b(e=>ev("limits","maxIterations",e)),ew=b(e=>ev("limits","maxRunMinutes",e)),eN=b(e=>ev("limits","maxSubtasks",e)),eS=b(e=>ev("limits","maxKerriganSends",e)),eC=b(e=>ev("copilot","replyTimeoutSec",e)),eR=b(e=>ev("limits","maxMessageChars",e)),eM=b(e=>ev("limits","subtaskRetries",e)),eF=b(e=>ev("limits","subtaskRetryWaitSec",e)),eW=b(e=>ev("pacing","gapSec",e)),eE=b(e=>ev("pacing","gapMaxSec",e)),eO=(e,l)=>ev("execution",e,l),eD=[{id:"auto-continue",label:e("exec.autoContinue"),info:e("exec.autoContinueWhy"),unit:e("exec.autoContinueUnit"),value:p,min:0,max:20,set:v,later:ej},{id:"reopen-window",label:e("exec.reopenWindow"),info:e("exec.reopenWindowWhy"),unit:e("exec.reopenWindowUnit"),value:f,min:0,max:10,set:j,later:eg},{id:"min-approaches",label:e("exec.minApproaches"),info:e("exec.minApproachesWhy"),unit:e("exec.minApproachesUnit"),value:y,min:2,max:20,set:w,later:eb},{id:"max-review-rounds",label:e("exec.maxReviewRounds"),info:e("exec.maxReviewRoundsWhy"),unit:e("exec.maxReviewRoundsUnit"),value:S,min:1,max:6,set:R,later:ek},{id:"retry-blocked",label:e("exec.retryBlocked"),info:e("exec.retryBlockedWhy"),unit:e("exec.retryBlockedTimes"),value:d,min:0,max:5,set:u,later:ef},{id:"max-iterations",label:e("exec.maxIterations"),info:e("exec.maxIterationsWhy"),unit:e("exec.maxIterationsUnit"),value:M,min:5,max:200,set:F,later:ey},{id:"max-minutes",label:e("exec.maxRunMinutes"),info:e("exec.maxRunMinutesWhy"),unit:e("exec.maxRunMinutesUnit"),value:W,min:10,max:1440,set:E,later:ew},{id:"max-subtasks",label:e("exec.maxSubtasks"),info:e("exec.maxSubtasksWhy"),unit:e("exec.maxSubtasksUnit"),value:O,min:1,max:100,set:D,later:eN},{id:"max-kerrigan-sends",label:e("exec.maxKerriganSends"),info:e("exec.maxKerriganSendsWhy"),unit:e("exec.maxKerriganSendsUnit"),value:I,min:1,max:50,set:A,later:eS},{id:"reply-timeout",label:e("exec.replyTimeout"),info:e("exec.replyTimeoutWhy"),unit:e("exec.replyTimeoutUnit"),value:L,min:60,max:10800,set:H,later:eC},{id:"max-message-chars",label:e("exec.maxMessageChars"),info:e("exec.maxMessageCharsWhy"),unit:e("exec.maxMessageCharsUnit"),value:P,min:1e3,max:1e6,set:T,later:eR}];return(0,a.jsxs)("section",{className:"panel",id:"execution","aria-labelledby":"execution-title",children:[(0,a.jsx)("h2",{id:"execution-title",children:e("exec.title")}),(0,a.jsx)("p",{className:"muted small",children:e("exec.intro")}),ep&&(0,a.jsx)("div",{className:"err",children:ep}),eD.map(e=>(0,a.jsx)(g,{id:e.id,label:e.label,info:e.info,unit:e.unit,children:(0,a.jsx)(k,{id:e.id,value:e.value,min:e.min,max:e.max,onChange:l=>{e.set(l),e.later(l)},disabled:!r})},e.id)),(0,a.jsx)("div",{className:"settings-field",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"gap-on",type:"checkbox",checked:q,disabled:!r,onChange:e=>{K(e.target.checked),ev("pacing","gapEnabled",e.target.checked)}}),(0,a.jsx)("label",{htmlFor:"gap-on",children:e("exec.gap")}),(0,a.jsx)(x.q,{label:e("info.about",{name:e("exec.gap")}),text:e("exec.gapWhy")})]})}),q&&(0,a.jsx)(g,{id:"gap-sec",label:e("exec.gapSec"),info:e("exec.gapSecWhy"),unit:e("exec.gapUnit"),children:(0,a.jsx)(k,{id:"gap-sec",value:B,min:1,max:3600,onChange:e=>{U(e),eW(e)},disabled:!r})}),q&&(0,a.jsx)("div",{className:"settings-field gap-random",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"gap-random",type:"checkbox",checked:_,disabled:!r,onChange:e=>{Z(e.target.checked),ev("pacing","gapRandom",e.target.checked),e.target.checked&&z<B&&(V(B),eE(B))}}),(0,a.jsx)("label",{htmlFor:"gap-random",children:e("exec.gapRandom")}),(0,a.jsx)(x.q,{label:e("info.about",{name:e("exec.gapRandom")}),text:e("exec.gapRandomWhy")})]})}),q&&_&&(0,a.jsx)(g,{id:"gap-max",label:e("exec.gapMax"),info:e("exec.gapMaxWhy"),unit:e("exec.gapUnit"),children:(0,a.jsx)(k,{id:"gap-max",value:z,min:B,max:3600,onChange:e=>{V(e),eE(e)},disabled:!r})}),(0,a.jsx)(g,{id:"isolation",label:e("exec.isolation"),info:e("exec.isolationWhy"),children:(0,a.jsxs)("select",{id:"isolation",value:$,onChange:e=>{let l=e.target.value;Y(l),eO("isolation",l)},disabled:!r,children:[(0,a.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,a.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,a.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,a.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,a.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]})}),(0,a.jsx)(g,{id:"start-mode",label:e("exec.startMode"),info:e("exec.startModeWhy"),children:(0,a.jsxs)("select",{id:"start-mode",value:"confirm"===X?"confirm":"run"===G?"unattended":"unattended-ask",onChange:async l=>{let t=l.target.value;if("unattended-ask"===t&&"unattended"!==X&&!await (0,h.Z)(e("exec.modeAutoConfirm"))||"unattended"===t&&!await (0,h.Z)(e("exec.modeAutoAllConfirm")))return;let a="confirm"===t?"confirm":"unattended",n="unattended"===t?"run":"ask";J(a),Q(n),eO("mode",a).then(()=>eO("writtenScripts",n))},disabled:!r,children:[(0,a.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,a.jsx)("option",{value:"unattended-ask",children:e("exec.startModeAutoAsk")}),(0,a.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]})}),(0,a.jsx)(g,{id:"network-fetch",label:e("exec.networkFetch"),info:e("exec.networkFetchWhy"),children:(0,a.jsxs)("select",{id:"network-fetch",value:ee,onChange:e=>{let l=e.target.value;el(l),eO("networkFetch",l)},disabled:!r,children:[(0,a.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,a.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,a.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]})}),(0,a.jsx)(g,{id:"questions",label:e("exec.questions"),info:e("exec.questionsWhy"),children:(0,a.jsxs)("select",{id:"questions",value:et,onChange:async l=>{let t=l.target.value;("agree"!==t||await (0,h.Z)(e("exec.questionsAgreeConfirm")))&&(ea(t),eO("questions",t))},disabled:!r,children:[(0,a.jsx)("option",{value:"ask",children:e("exec.questionsAsk")}),(0,a.jsx)("option",{value:"agree",children:e("exec.questionsAgree")})]})}),(0,a.jsx)(g,{id:"kerrigan-result",label:e("exec.kerriganResult"),info:e("exec.kerriganResultWhy"),children:(0,a.jsxs)("select",{id:"kerrigan-result",value:en,onChange:e=>{let l="exchange"===e.target.value?"exchange":"copy";es(l),eO("kerriganResult",l)},disabled:!r,children:[(0,a.jsx)("option",{value:"copy",children:e("exec.kerriganResultCopy")}),(0,a.jsx)("option",{value:"exchange",children:e("exec.kerriganResultExchange")})]})}),(0,a.jsx)("h3",{id:"subtask-retry",children:e("exec.subRetryTitle")}),(0,a.jsx)("p",{className:"muted small",children:e("exec.subRetryIntro")}),(0,a.jsx)(g,{id:"subtask-retry-mode",label:e("exec.subRetryMode"),info:e("exec.subRetryModeWhy"),children:(0,a.jsxs)("select",{id:"subtask-retry-mode",value:er,onChange:e=>{let l=e.target.value;ei(l),ev("limits","subtaskRetryMode",l)},disabled:!r,children:[(0,a.jsx)("option",{value:"ask",children:e("exec.subRetryAsk")}),(0,a.jsx)("option",{value:"same",children:e("exec.subRetrySame")}),(0,a.jsx)("option",{value:"fresh",children:e("exec.subRetryFresh")}),(0,a.jsx)("option",{value:"lead",children:e("exec.subRetryLead")})]})}),(0,a.jsx)(g,{id:"subtask-retries",label:e("exec.subRetries"),info:e("exec.subRetriesWhy"),unit:e("exec.subRetriesUnit"),children:(0,a.jsx)(k,{id:"subtask-retries",value:eo,min:0,max:3,onChange:e=>{ec(e),eM(e)},disabled:!r})}),(0,a.jsx)(g,{id:"subtask-retry-wait",label:e("exec.subRetryWait"),info:e("exec.subRetryWaitWhy"),unit:e("exec.subRetryWaitUnit"),children:(0,a.jsx)(k,{id:"subtask-retry-wait",value:ed,min:0,max:600,onChange:e=>{eu(e),eF(e)},disabled:!r})}),(0,a.jsx)(C,{msg:em,saving:l})]})}let B=/^[a-z0-9][a-z0-9._+-]*$/;function U(){let{t:e}=(0,m.kj)(),{saving:l,track:t}=N(),[r,i]=(0,n.useState)(null),[o,c]=(0,n.useState)([]),[d,u]=(0,n.useState)([]),[p,v]=(0,n.useState)([]),[f,j]=(0,n.useState)({platforms:{},readOnly:[],inForce:[]}),[b,k]=(0,n.useState)(""),[y,w]=(0,n.useState)(""),[S,R]=(0,n.useState)(""),M=(0,n.useCallback)(async()=>{var e,l,t,a;let n=await s.FH.settings(),r=null!=(t=n.raw.execution)?t:{},o=(null!=(a=null==(l=n.defaults)||null==(e=l.execution)?void 0:e.allowedPrograms)?a:[]).slice();v(o),i(Array.isArray(r.allowedPrograms)?r.allowedPrograms:o),c(Array.isArray(r.readOnlyPrograms)?r.readOnlyPrograms:[]),u(Array.isArray(r.runWithoutAsking)?r.runWithoutAsking:[]),n.programs&&j(n.programs)},[]);(0,n.useEffect)(()=>{M().catch(e=>R(e.message))},[M]);let F=async function(l,a){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d;R(""),w("");try{var r;let i=(await s.FH.settings()).raw,o={...null!=(r=i.execution)?r:{}};return null===l?(delete o.allowedPrograms,delete o.readOnlyPrograms,delete o.runWithoutAsking):(o.allowedPrograms=l,o.readOnlyPrograms=a,o.runWithoutAsking=n),await t(s.FH.saveSettings({...i,execution:o})),await M(),w(e("prog.saved",{n:(null!=l?l:p).length})),!0}catch(e){return R(e.message),!1}},W=null!=r?r:[],E=async()=>{let l=b.trim().toLowerCase().replace(/\.(exe|cmd|bat|com)$/,"");if(!B.test(l))return R(e("prog.badName"));if(W.includes(l))return R(e("prog.already",{name:l}));let t=f.readOnly.includes(l)?[...o.filter(e=>e!==l),l]:o;await F([...W,l],t)&&k("")},O=async l=>{await (0,h.Z)(e("prog.removeConfirm",{name:l}),{okLabel:e("prog.removeOk"),danger:!0})&&await F(W.filter(e=>e!==l),o.filter(e=>e!==l),d.filter(e=>e!==l))},D=async(l,t)=>{var a;("run"!==t||await (0,h.Z)(e("prog.modeRunConfirm",{name:null!=(a=f.platforms[l])?a:l})))&&await F(W,"read-only"===t?[...o.filter(e=>e!==l),l]:o.filter(e=>e!==l),"run"===t?[...d.filter(e=>e!==l),l]:d.filter(e=>e!==l))},I=async()=>{await (0,h.Z)(e("prog.restoreConfirm"))&&await F(null,[],[])},A=(e,l)=>e.localeCompare(l,"en",{sensitivity:"base"}),L=W.filter(e=>f.platforms[e]).sort(A),H=W.filter(e=>!f.platforms[e]).sort(A),P=r&&f.inForce.length>0?W.filter(e=>!f.inForce.includes(e)):[],T=W.length<=1,q=l=>(0,a.jsx)("button",{type:"button",className:"quiet prog-remove",onClick:()=>void O(l),disabled:!r||T,"aria-label":e("prog.removeOne",{name:l}),title:T?e("prog.lastWhy"):e("prog.removeOne",{name:l}),children:"✕"});return(0,a.jsxs)("section",{className:"panel",id:"programs","aria-labelledby":"programs-title",children:[(0,a.jsx)("h2",{id:"programs-title",children:e("prog.title")}),(0,a.jsx)("p",{className:"muted small",children:e("prog.intro")}),S&&(0,a.jsx)("div",{className:"err",children:S}),P.length>0&&(0,a.jsx)("p",{className:"reason small",children:e("prog.locked",{list:P.join(", ")})}),L.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{id:"programs-platforms",children:e("prog.platforms")}),L.map(l=>(0,a.jsxs)("div",{className:"settings-field prog-platform",children:[(0,a.jsxs)("div",{className:"field-label",children:[(0,a.jsxs)("label",{htmlFor:"prog-mode-".concat(l),children:[(0,a.jsx)("code",{children:l})," ",(0,a.jsx)("span",{className:"muted",children:f.platforms[l]})]}),(0,a.jsx)(x.q,{label:e("info.about",{name:l}),text:e("prog.modeWhy")})]}),(0,a.jsxs)("div",{className:"field-control",children:[(0,a.jsxs)("select",{id:"prog-mode-".concat(l),value:o.includes(l)?"read-only":d.includes(l)?"run":"ask",onChange:e=>void D(l,e.target.value),disabled:!r,children:[(0,a.jsx)("option",{value:"ask",children:e("prog.modeAsk")}),f.readOnly.includes(l)&&(0,a.jsx)("option",{value:"read-only",children:e("prog.modeReadOnly")}),(0,a.jsx)("option",{value:"run",children:e("prog.modeRun")})]}),q(l)]})]},l)),L.some(e=>o.includes(e))&&(0,a.jsx)("p",{className:"small prog-note",children:e("prog.readOnlyNote")}),L.some(e=>d.includes(e))&&(0,a.jsx)("p",{className:"small prog-note prog-run-note",children:e("prog.runNote",{list:L.filter(e=>d.includes(e)).join(", ")})})]}),(0,a.jsx)("h3",{id:"programs-others",children:e("prog.others")}),(0,a.jsx)("ul",{className:"prog-chips",children:H.map(e=>(0,a.jsxs)("li",{className:"prog-chip",children:[(0,a.jsx)("code",{children:e}),q(e)]},e))}),(0,a.jsxs)(g,{id:"prog-add",label:e("prog.add"),info:e("prog.addWhy"),children:[(0,a.jsx)("input",{id:"prog-add",type:"text",dir:"ltr",spellCheck:!1,autoComplete:"off",value:b,placeholder:"az",onChange:e=>k(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),E())},disabled:!r}),(0,a.jsx)("button",{type:"button",className:"primary",onClick:()=>void E(),disabled:!r||!b.trim(),children:e("prog.addButton")})]}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("button",{type:"button",onClick:()=>void I(),disabled:!r,children:e("prog.restore")})}),(0,a.jsx)(C,{msg:y,saving:l})]})}let _=[{kind:"ts",name:"TypeScript",ext:".ts .mts .cts .tsx"},{kind:"js",name:"JavaScript",ext:".js .mjs .cjs .jsx"},{kind:"py",name:"Python",ext:".py .pyw"},{kind:"ps1",name:"PowerShell",ext:".ps1 .psm1"},{kind:"cmd",name:"cmd",ext:".bat .cmd"},{kind:"sh",name:"bash",ext:".sh .bash .zsh"},{kind:"other",name:"Ruby, Perl, PHP",ext:".rb .pl .php"},{kind:"npm",name:"npm"}];function Z(){let{t:e,locale:l}=(0,m.kj)(),{saving:t,track:r}=N(),[i,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(null),[u,p]=(0,n.useState)(""),[v,f]=(0,n.useState)(""),j=(0,n.useCallback)(async()=>{var e,l,t,a,n;let r=await s.FH.settings(),i=null!=(a=null==(e=r.raw.execution)?void 0:e.scripts)?a:{},c=null!=(n=null==(t=r.defaults)||null==(l=t.execution)?void 0:l.scripts)?n:{};o(Object.fromEntries(_.map(e=>{var l,t,a,n,s,r,o,d;let{kind:u}=e;return[u,{own:null==(r=null!=(s=null==(l=i[u])?void 0:l.own)?s:null==(t=c[u])?void 0:t.own)||r,written:null!=(d=null!=(o=null==(a=i[u])?void 0:a.written)?o:null==(n=c[u])?void 0:n.written)&&d}]}))),r.scripts&&d(r.scripts)},[]);(0,n.useEffect)(()=>{j().catch(e=>f(e.message))},[j]);let g=async l=>{f(""),p("");try{var t;let a=(await s.FH.settings()).raw,n={...null!=(t=a.execution)?t:{}};null===l?delete n.scripts:n.scripts=l,await r(s.FH.saveSettings({...a,execution:n})),await j(),p(e("scr.saved"))}catch(e){f(e.message)}},b=(e,l,t)=>{if(!i)return;let a={...i,[e]:{...i[e],[l]:t}};o(a),g(a)},k=async()=>{await (0,h.Z)(e("scr.restoreConfirm"))&&await g(null)},y=l=>"npm"===l.kind?e("scr.npm"):l.name,w=[..._].sort((e,t)=>y(e).localeCompare(y(t),l,{sensitivity:"base"})),S=!!i&&Object.values(i).some(e=>e.written),R=!!i&&!!c&&_.some(e=>{var l,t;let{kind:a}=e;return(null==(l=i[a])?void 0:l.written)&&!(null==(t=c.inForce[a])?void 0:t.written)});return(0,a.jsxs)("section",{className:"panel",id:"scripts","aria-labelledby":"scripts-title",children:[(0,a.jsx)("h2",{id:"scripts-title",children:e("scr.title")}),(0,a.jsx)("p",{className:"muted small",children:e("scr.intro")}),v&&(0,a.jsx)("div",{className:"err",children:v}),R&&(0,a.jsx)("p",{className:"reason small",children:e("scr.locked")}),(0,a.jsxs)("table",{className:"scripts-table",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{scope:"col",children:e("scr.kind")}),(0,a.jsx)("th",{scope:"col",children:(0,a.jsxs)("span",{className:"scripts-head",children:[e("scr.own")," ",(0,a.jsx)(x.q,{label:e("info.about",{name:e("scr.own")}),text:e("scr.ownWhy")})]})}),(0,a.jsx)("th",{scope:"col",children:(0,a.jsxs)("span",{className:"scripts-head",children:[e("scr.written")," ",(0,a.jsx)(x.q,{label:e("info.about",{name:e("scr.written")}),text:e("scr.writtenWhy")})]})})]})}),(0,a.jsx)("tbody",{children:w.map(l=>{var t,n,s,r;return(0,a.jsxs)("tr",{"data-kind":l.kind,children:[(0,a.jsxs)("th",{scope:"row",children:[y(l)," ",l.ext&&(0,a.jsx)("code",{className:"muted small",dir:"ltr",children:l.ext})]}),(0,a.jsx)("td",{children:(0,a.jsx)("input",{type:"checkbox",id:"scr-".concat(l.kind,"-own"),"aria-label":e("scr.ownOf",{kind:y(l)}),checked:null==(s=null==i||null==(t=i[l.kind])?void 0:t.own)||s,disabled:!i,onChange:e=>b(l.kind,"own",e.target.checked)})}),(0,a.jsx)("td",{children:(0,a.jsx)("input",{type:"checkbox",id:"scr-".concat(l.kind,"-written"),"aria-label":e("scr.writtenOf",{kind:y(l)}),checked:null!=(r=null==i||null==(n=i[l.kind])?void 0:n.written)&&r,disabled:!i,onChange:e=>b(l.kind,"written",e.target.checked)})})]},l.kind)})})]}),S&&(0,a.jsx)("p",{className:"small prog-note",children:e("scr.writtenNote")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("button",{type:"button",onClick:()=>void k(),disabled:!i,children:e("scr.restore")})}),(0,a.jsx)(C,{msg:u,saving:t})]})}},94969:(e,l,t)=>{"use strict";t.d(l,{V:()=>s});var a=t(1521);let n='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function s(e,l,t){(0,a.useEffect)(()=>{var a,s;if(!l)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(s=null!=(a=null==t?void 0:t.current)?a:null==i?void 0:i.querySelector(n))?s:null;null==o||o.focus();let c=e=>{if("Tab"!==e.key||!i)return;let l=Array.from(i.querySelectorAll(n)).filter(e=>null!==e.offsetParent);if(0===l.length)return;let t=l[0],a=l[l.length-1],s=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===t||!s)?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a&&s||(e.preventDefault(),t.focus())};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),r&&document.contains(r)&&r.focus()}},[e,l,t])}}},e=>{e.O(0,[7921,2347,3131,7358],()=>e(e.s=65323)),_N_E=e.O()}]);
|
package/dist/web/_next/static/chunks/{webpack-13ccb80d7b7094ca.js → webpack-c015bbeb103c0856.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={},a={};function f(d){var c=a[d];if(void 0!==c)return c.exports;var b=a[d]={exports:{}},t=!0;try{e[d].call(b.exports,b,b.exports,f),t=!1}finally{t&&delete a[d]}return b.exports}f.m=e,(()=>{var e=[];f.O=(a,d,c,b)=>{if(d){b=b||0;for(var t=e.length;t>0&&e[t-1][2]>b;t--)e[t]=e[t-1];e[t]=[d,c,b];return}for(var r=1/0,t=0;t<e.length;t++){for(var[d,c,b]=e[t],o=!0,n=0;n<d.length;n++)(!1&b||r>=b)&&Object.keys(f.O).every(e=>f.O[e](d[n]))?d.splice(n--,1):(o=!1,b<r&&(r=b));if(o){e.splice(t--,1);var i=c();void 0!==i&&(a=i)}}return a}})(),f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},(()=>{var e,a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;f.t=function(d,c){if(1&c&&(d=this(d)),8&c||"object"==typeof d&&d&&(4&c&&d.__esModule||16&c&&"function"==typeof d.then))return d;var b=Object.create(null);f.r(b);var t={};e=e||[null,a({}),a([]),a(a)];for(var r=2&c&&d;"object"==typeof r&&!~e.indexOf(r);r=a(r))Object.getOwnPropertyNames(r).forEach(e=>t[e]=()=>d[e]);return t.default=()=>d,f.d(b,t),b}})(),f.d=(e,a)=>{for(var d in a)f.o(a,d)&&!f.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((a,d)=>(f.f[d](e,a),a),[])),f.u=e=>"static/chunks/"+(({1384:"17449abc",2060:"20154aaa",4033:"f99cb6a2",5459:"85120a0e",6543:"2398d077",7100:"82d3f3cb",7278:"63b9f8e2",8653:"a9ddb983",9346:"c7ea4e13"})[e]||e)+"."+({12:"06a7f14bd6716249",76:"f9c2aea58a61692f",80:"df762af692aca107",192:"955be0d5fcd27ec6",344:"41cc997c8c8deeed",358:"4791f77f174006f3",384:"063f394c789898a7",386:"2718f961400a3322",441:"172f3f581f0030d1",442:"2e236a6c5c413bd9",464:"f60ecfb6c72ec733",603:"4055460889ea24d8",640:"2c2baacde5197a77",642:"b70763e1cfe9e45e",714:"
|
|
1
|
+
(()=>{"use strict";var e={},a={};function f(d){var c=a[d];if(void 0!==c)return c.exports;var b=a[d]={exports:{}},t=!0;try{e[d].call(b.exports,b,b.exports,f),t=!1}finally{t&&delete a[d]}return b.exports}f.m=e,(()=>{var e=[];f.O=(a,d,c,b)=>{if(d){b=b||0;for(var t=e.length;t>0&&e[t-1][2]>b;t--)e[t]=e[t-1];e[t]=[d,c,b];return}for(var r=1/0,t=0;t<e.length;t++){for(var[d,c,b]=e[t],o=!0,n=0;n<d.length;n++)(!1&b||r>=b)&&Object.keys(f.O).every(e=>f.O[e](d[n]))?d.splice(n--,1):(o=!1,b<r&&(r=b));if(o){e.splice(t--,1);var i=c();void 0!==i&&(a=i)}}return a}})(),f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},(()=>{var e,a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;f.t=function(d,c){if(1&c&&(d=this(d)),8&c||"object"==typeof d&&d&&(4&c&&d.__esModule||16&c&&"function"==typeof d.then))return d;var b=Object.create(null);f.r(b);var t={};e=e||[null,a({}),a([]),a(a)];for(var r=2&c&&d;"object"==typeof r&&!~e.indexOf(r);r=a(r))Object.getOwnPropertyNames(r).forEach(e=>t[e]=()=>d[e]);return t.default=()=>d,f.d(b,t),b}})(),f.d=(e,a)=>{for(var d in a)f.o(a,d)&&!f.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((a,d)=>(f.f[d](e,a),a),[])),f.u=e=>"static/chunks/"+(({1384:"17449abc",2060:"20154aaa",4033:"f99cb6a2",5459:"85120a0e",6543:"2398d077",7100:"82d3f3cb",7278:"63b9f8e2",8653:"a9ddb983",9346:"c7ea4e13"})[e]||e)+"."+({12:"06a7f14bd6716249",76:"f9c2aea58a61692f",80:"df762af692aca107",192:"955be0d5fcd27ec6",344:"41cc997c8c8deeed",358:"4791f77f174006f3",384:"063f394c789898a7",386:"2718f961400a3322",441:"172f3f581f0030d1",442:"2e236a6c5c413bd9",464:"f60ecfb6c72ec733",603:"4055460889ea24d8",640:"2c2baacde5197a77",642:"b70763e1cfe9e45e",714:"b7dbce98ba0b59a8",795:"710d39b80c9ae80c",896:"eb46d6e001d25d0f",937:"6d8406b06135134f",948:"132a0571d85c8b01",972:"db753db904050e48",992:"8470b96c23472686",1017:"ce926873b598fb89",1077:"26ca37faa3726fff",1083:"0122bea31f7199d9",1350:"a5dc706c8110fd34",1384:"fa53da036b7dcfb4",1490:"f5154054ddfd3dee",1536:"98fab69162f370f0",1548:"f5790cd11a91309f",1584:"7500138d08971f81",1706:"db51b57351297898",1707:"7d64ffc060c697a0",1732:"90182d376c75c315",1872:"d12259d09bb1173f",1880:"87829ecb91209eda",1920:"59b93a4215a75653",2037:"d1bb5e37c7fe85ae",2060:"28032c3aa5bcd84d",2063:"4745e20abad5b208",2163:"aa9d9b82fcde6caa",2175:"8c8957600f6b88a8",2280:"5a3754f49656d989",2355:"d6bb92f10d516f81",2378:"4f15342be64a9d23",2395:"c2c4d3696d3b5542",2435:"9b433b38d34b4b2e",2486:"d130023b2b399eaa",2506:"bc8515842e225d2a",2529:"c88688b437d71d68",2606:"8e9434e7fee257b9",2738:"2559ed1058f6fb19",2821:"409d92f5ac5b8142",2908:"4e0e875d2d471932",3088:"12b1d19ca55225b7",3117:"a4e1c3348e8bead9",3152:"d623d85a9afed5d3",3184:"0788c67536fc4140",3194:"8ee589997ce1e093",3233:"1dcc2798f7f5efa0",3322:"4f7b378a41711478",3564:"bfa030e92401f57d",3690:"f691d3fcbd70073d",3696:"a367f4c8f42909d1",3748:"8726b202d79d0dba",3794:"19aedfb95f89dc48",3804:"593b14643e74a2a1",3816:"9f5568918e35e4ef",3854:"39b7a1bf2b4189fe",3859:"f56f3c6ac4b74cf1",3976:"11b159e82e0aa974",3986:"d47ed4855773e6dd",4008:"3691a32e1711848f",4033:"3f570aeba3860608",4054:"1c8d37b1513d20d8",4328:"e326d66dd5c820c6",4444:"36f5d8532bd6300d",4459:"d6df347eb58fccd7",4560:"b8235d283fb3608c",4619:"ae3628373decf74f",4623:"d5711a8d967e49f4",4670:"6b811cc3f67a851c",4812:"0af1380aa478f6d3",4912:"1ab85b0ebf52a3e0",4969:"4f7aff472cf938bf",4982:"bbbd303d665de4f0",5052:"dc8c36742419eed5",5115:"fbe164892bfd6fa4",5120:"b4aadb89d4fb4f65",5448:"1c4e0b719af53b3f",5459:"ac16dccf0b8d73d3",5664:"507fea1f6305067e",5706:"be484c6a7bed3fde",5790:"fe114d1a18741d62",6072:"b4b359b24b1738d4",6230:"8645bbed143793da",6260:"6b5b5c9713d7133f",6336:"b09d0d920c7631eb",6364:"5b0466f24f4ecf58",6419:"61399b0413b8bef0",6421:"3ace3aefc3e7350e",6542:"963ec591b5c2bc5a",6543:"79ae940919b9695e",6554:"0110334a71e72bbe",6688:"4a6ac23ba061262b",6885:"8fb8eeb9e792b515",6891:"dd910309748ad46b",6896:"33fdeb4e682c2cab",6912:"3416822e13b4bc03",6944:"635230aa8cb23871",6964:"35718884ad3375bc",6992:"4b059bae2659231d",6996:"7c41217972cabc3f",7024:"8bc670b892a558bb",7040:"e058d8f95c3c11e7",7100:"23be11b749288234",7220:"0ca53eefec5d01ea",7250:"7f1d45021e49d2fd",7278:"218fd437b256a7e4",7290:"7bceed706f7b6df5",7301:"c60eb2ba8ae6b859",7307:"39c27470a879fd0a",7328:"021e5e45124e40de",7333:"04d0e45b223dadd4",7340:"a5a75ee889c30b74",7443:"c189418756727101",7484:"c0e6bfca7b2fb65e",7489:"395193bf37b80884",7496:"e638a7286c17e438",7507:"9fd648884587a7f3",7664:"bd6265e6e94e1ecd",7695:"11ba99db589cb586",7764:"e62333ee1d63a458",7872:"9b08a88b7289949f",8024:"4bd0b5a7f26a0f7d",8173:"b82aa1855e641605",8216:"b248ebe0af447347",8360:"371456f14873ee9f",8381:"2d6783c030f8a913",8544:"7c1fb012f9073eaa",8547:"424f9970cc72775f",8584:"9f3b058a8f67d3d7",8616:"8e05c4a20dcdf39d",8653:"8bbb677720017a57",8662:"f2663643214caed1",8689:"e564346c6e0d16be",8752:"bf29293df3366e17",8800:"3c7b01176e98160a",8924:"49dd385ac101fb7e",9003:"3d5c7a418d0b858b",9067:"107f6164157e0aa1",9068:"9662bb8fa5fdc637",9125:"8589db5ba200cbf1",9178:"a7631bd283f2a69c",9190:"e3a90b1a9ed21668",9202:"8dcf7e6a85cc3d36",9249:"916a423ac8a07e76",9296:"59fcfc8261a4c6bd",9312:"e1fb4089a122d3d3",9313:"e4f6405d96375c40",9346:"9b71b5f026a1d6d4",9348:"022486b05b882739",9418:"1e8f8e14bb5fe3ae",9591:"d205941f0062de24",9628:"d8954a2bd28b85a6",9636:"35df6241125f8513",9658:"cdecb568f615e4c9",9680:"d10b204d08ca3a62",9728:"1d4cb6c68bd55f44",9747:"984a86f70f9cd973",9763:"da9015d4a1b533b9",9784:"c9938b7e977e14eb",9812:"024424a52730b057",9884:"8712c5ed7b044ff2",9888:"ce925cd415b672ef",9891:"a97db7c8f05693d1",9904:"a3d2f8569d7355ab",9924:"03252dda78c705c3",9968:"3d45ff9183e8b07b",9984:"cdabea5a592e42a1"})[e]+".js",f.miniCssF=e=>"static/css/"+({2737:"4bfdd3ebb3d1a180",3499:"2de713eca93a7750",5591:"73368887921d70d9"})[e]+".css",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={},a="_N_E:";f.l=(d,c,b,t)=>{if(e[d])return void e[d].push(c);if(void 0!==b)for(var r,o,n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var l=n[i];if(l.getAttribute("src")==d||l.getAttribute("data-webpack")==a+b){r=l;break}}r||(o=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,f.nc&&r.setAttribute("nonce",f.nc),r.setAttribute("data-webpack",a+b),r.src=f.tu(d)),e[d]=[c];var u=(a,f)=>{r.onerror=r.onload=null,clearTimeout(s);var c=e[d];if(delete e[d],r.parentNode&&r.parentNode.removeChild(r),c&&c.forEach(e=>e(f)),a)return a(f)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),o&&document.head.appendChild(r)}})(),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.U=function(e){var a=new URL(e,"x:/"),f={};for(var d in a)f[d]=a[d];for(var d in f.href=e,f.pathname=e.replace(/[?#].*/,""),f.origin=f.protocol="",f.toString=f.toJSON=()=>e,f)Object.defineProperty(this,d,{enumerable:!0,configurable:!0,value:f[d]})},f.U.prototype=URL.prototype,(()=>{var e;f.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",(()=>{var e={8068:0};f.f.miniCss=(a,d)=>{e[a]?d.push(e[a]):0!==e[a]&&({2737:1,3499:1,5591:1})[a]&&d.push(e[a]=(e=>new Promise((a,d)=>{var c=f.miniCssF(e),b=f.p+c;if(((e,a)=>{for(var f=document.getElementsByTagName("link"),d=0;d<f.length;d++){var c=f[d],b=c.getAttribute("data-href")||c.getAttribute("href");if("stylesheet"===c.rel&&(b===e||b===a))return c}for(var t=document.getElementsByTagName("style"),d=0;d<t.length;d++){var c=t[d],b=c.getAttribute("data-href");if(b===e||b===a)return c}})(c,b))return a();((e,a,f,d)=>{var c=document.createElement("link");return c.rel="stylesheet",c.type="text/css",c.onerror=c.onload=b=>{if(c.onerror=c.onload=null,"load"===b.type)f();else{var t=b&&("load"===b.type?"missing":b.type),r=b&&b.target&&b.target.href||a,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=t,o.request=r,c.parentNode.removeChild(c),d(o)}},c.href=a,!function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:a,onload:f,onerror:d}=e;_N_E_STYLE_LOAD(0===a.indexOf(window.location.origin)?new URL(a).pathname:a).then(()=>null==f?void 0:f.call(e,{type:"load"}),()=>null==d?void 0:d.call(e,{}))}else document.head.appendChild(e)}(c)})(e,b,a,d)}))(a).then(()=>{e[a]=0},f=>{throw delete e[a],f}))}})(),(()=>{f.b=document.baseURI||self.location.href;var e={8068:0,7353:0};f.f.j=(a,d)=>{var c=f.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(2737|3499|5591|7353|8068)$/.test(a))e[a]=0;else{var b=new Promise((f,d)=>c=e[a]=[f,d]);d.push(c[2]=b);var t=f.p+f.u(a),r=Error();f.l(t,d=>{if(f.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var b=d&&("load"===d.type?"missing":d.type),t=d&&d.target&&d.target.src;r.message="Loading chunk "+a+" failed.\n("+b+": "+t+")",r.name="ChunkLoadError",r.type=b,r.request=t,c[1](r)}},"chunk-"+a,a)}},f.O.j=a=>0===e[a];var a=(a,d)=>{var c,b,[t,r,o]=d,n=0;if(t.some(a=>0!==e[a])){for(c in r)f.o(r,c)&&(f.m[c]=r[c]);if(o)var i=o(f)}for(a&&a(d);n<t.length;n++)b=t[n],f.o(e,b)&&e[b]&&e[b][0](),e[b]=0;return f.O(i)},d=self.webpackChunk_N_E=self.webpackChunk_N_E||[];d.forEach(a.bind(null,0)),d.push=a.bind(null,d.push.bind(d))})()})();
|