copilot-operator 0.1.88 → 0.1.90
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 +66 -3
- package/dist/src/api/operator.service.js +141 -0
- package/dist/src/api/server.js +5 -1
- package/dist/src/cli.js +6 -0
- package/dist/src/config/live.js +1 -1
- package/dist/src/config/schema.js +12 -0
- package/dist/src/orchestrator/taskRunner.js +9 -2
- package/dist/src/plan/systemGuide.js +158 -0
- package/dist/src/session/locatorFailures.js +55 -0
- package/dist/src/transport/copilotTransport.js +310 -65
- package/dist/src/transport/keptWindow.js +3 -0
- package/dist/src/transport/locators.js +126 -5
- package/dist/src/transport/pageHtml.js +62 -0
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/{1077.26ca37faa3726fff.js → 1077.1cc6d439e3dd0fa9.js} +1 -1
- package/dist/web/_next/static/chunks/{1548.f5790cd11a91309f.js → 1548.3de9dc874e47558e.js} +1 -1
- package/dist/web/_next/static/chunks/{2163.aa9d9b82fcde6caa.js → 2163.66458fb9c54fb52d.js} +1 -1
- package/dist/web/_next/static/chunks/{714.b7dbce98ba0b59a8.js → 714.cffed2b87154be0f.js} +1 -1
- package/dist/web/_next/static/chunks/{7220.0ca53eefec5d01ea.js → 7220.30b6a3e1bd41e51a.js} +1 -1
- package/dist/web/_next/static/chunks/7921-d3a4a261e08950e0.js +1 -0
- package/dist/web/_next/static/chunks/{8584.9f3b058a8f67d3d7.js → 8584.36422ed19d6c43e9.js} +1 -1
- package/dist/web/_next/static/chunks/{9067.107f6164157e0aa1.js → 9067.e579f97591576de2.js} +1 -1
- package/dist/web/_next/static/chunks/{9747.984a86f70f9cd973.js → 9747.11247f0e21542f6d.js} +1 -1
- package/dist/web/_next/static/chunks/app/layout-7b5fa7c74ecd6939.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/{page-317151444eda8115.js → page-7909ba7c9e3d4c2d.js} +1 -1
- package/dist/web/_next/static/chunks/app/settings/page-7651920337bbb580.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-c015bbeb103c0856.js → webpack-78ec62098b09e4a0.js} +1 -1
- package/dist/web/_next/static/css/{0c5d6d5914aa3824.css → d74aa18c98dacdb4.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/7921-8f6503aba840928a.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-127e5af1ebf21876.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-95069cb94d79e909.js +0 -1
- /package/dist/web/_next/static/{hLBBsG7Kn4vd0p_J-47BJ → 3VkK1sxEugkae88HSFR-i}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{hLBBsG7Kn4vd0p_J-47BJ → 3VkK1sxEugkae88HSFR-i}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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/{hLBBsG7Kn4vd0p_J-47BJ → 3VkK1sxEugkae88HSFR-i}/_buildManifest.js
RENAMED
|
File without changes
|
/package/dist/web/_next/static/{hLBBsG7Kn4vd0p_J-47BJ → 3VkK1sxEugkae88HSFR-i}/_ssgManifest.js
RENAMED
|
File without changes
|