@neuralnomads/codenomad 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/manager.js +5 -1
- package/dist/background-processes/manager.js +164 -25
- package/dist/clients/connection-manager.js +93 -0
- package/dist/config/schema.js +1 -0
- package/dist/events/bus.js +4 -0
- package/dist/filesystem/browser.js +7 -0
- package/dist/index.js +56 -5
- package/dist/opencode-config/package.json +1 -1
- package/dist/opencode-config/plugin/codenomad.ts +30 -0
- package/dist/opencode-config/plugin/lib/background-process.ts +14 -2
- package/dist/plugins/voice-mode.js +78 -0
- package/dist/server/__tests__/network-addresses.test.js +68 -0
- package/dist/server/http-server.js +294 -3
- package/dist/server/network-addresses.js +43 -1
- package/dist/server/routes/background-processes.js +19 -1
- package/dist/server/routes/events.js +24 -1
- package/dist/server/routes/meta.js +0 -3
- package/dist/server/routes/plugin.js +22 -4
- package/dist/server/routes/remote-servers.js +142 -0
- package/dist/server/routes/sidecars.js +46 -0
- package/dist/server/routes/workspaces.js +14 -0
- package/dist/settings/migrate.js +5 -0
- package/dist/settings/service.js +64 -4
- package/dist/sidecars/manager.js +193 -0
- package/dist/speech/providers/openai-compatible.js +32 -11
- package/dist/ui/__tests__/remote-ui.test.js +21 -0
- package/dist/ui/remote-ui.js +2 -2
- package/dist/workspaces/manager.js +7 -0
- package/dist/workspaces/runtime.js +2 -1
- package/package.json +1 -1
- package/public/assets/ChangesTab-CFkk3tAp.js +2 -0
- package/public/assets/DiffToolbar-CQQLR1mp.js +1 -0
- package/public/assets/FilesTab-CXgucPtN.js +2 -0
- package/public/assets/GitChangesTab-BidSb28_.js +2 -0
- package/public/assets/{SplitFilePanel-DbTPpm8n.js → SplitFilePanel-CupweEA5.js} +1 -1
- package/public/assets/StatusTab-C2Pl_Vce.js +1 -0
- package/public/assets/{bundle-full-UinVq7HP.js → bundle-full-B-5u6Iv3.js} +1 -1
- package/public/assets/diff-viewer-_ehhYA-Z.js +1 -0
- package/public/assets/git-diff-vendor-CSgooKT_.js +52 -0
- package/public/assets/index-BnfDkr8C.js +1 -0
- package/public/assets/index-BntAaLZs.js +1 -0
- package/public/assets/index-BqiNjV6R.js +1 -0
- package/public/assets/index-BwCEJ4BE.css +1 -0
- package/public/assets/{index-CdoHjzfy.js → index-CxQr-wOF.js} +1 -1
- package/public/assets/index-DXaitXVC.js +1 -0
- package/public/assets/index-DzRzoTK8.js +2 -0
- package/public/assets/index-ShHad48G.js +1 -0
- package/public/assets/index-_EaXFUIj.js +1 -0
- package/public/assets/index-mMh5TJvW.js +1 -0
- package/public/assets/{loading-D8mHQfQ7.js → loading-Dck2H3XH.js} +1 -1
- package/public/assets/main-BsIf5lOY.js +50 -0
- package/public/assets/{markdown-pqPmydDQ.js → markdown-CFV9kR80.js} +20 -20
- package/public/assets/monaco-viewer-CMM6n0T3.js +25 -0
- package/public/assets/{todo-BbZMcvOc.js → todo-Ghwirj-b.js} +1 -1
- package/public/assets/tool-call-BC2Pv3uG.js +60 -0
- package/public/assets/unified-picker-Dw0kTXoT.js +1 -0
- package/public/assets/wrap-text-D2MJk2ad.js +1 -0
- package/public/index.html +5 -5
- package/public/loading.html +5 -5
- package/public/sw.js +1 -1
- package/public/ui-version.json +1 -1
- package/public/assets/ChangesTab-DdswQ3Ok.js +0 -2
- package/public/assets/DiffToolbar-Yldqxvj8.js +0 -1
- package/public/assets/FilesTab-7agluNpw.js +0 -2
- package/public/assets/GitChangesTab-BZ5PaHzK.js +0 -2
- package/public/assets/StatusTab-CKBp3O9-.js +0 -1
- package/public/assets/diff-viewer-D9gxUZHP.js +0 -1
- package/public/assets/git-diff-vendor-CAv-4upN.js +0 -52
- package/public/assets/index-0Gk1-9Cd.js +0 -1
- package/public/assets/index-BEO8r15M.js +0 -1
- package/public/assets/index-BH7b9sVx.js +0 -1
- package/public/assets/index-CHPcUby9.js +0 -2
- package/public/assets/index-Cjpfqqyq.js +0 -1
- package/public/assets/index-D7Ta2Qha.js +0 -1
- package/public/assets/index-DxTSRG2o.js +0 -1
- package/public/assets/index-ENvu-xYE.css +0 -1
- package/public/assets/index-YR_aK97-.js +0 -1
- package/public/assets/main-DnH_qzWG.js +0 -56
- package/public/assets/monaco-viewer-BSBw02bx.js +0 -15
- package/public/assets/tool-call-BBzW7Hvr.js +0 -60
- package/public/assets/unified-picker-DcafxZRV.js +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var Er=Object.defineProperty;var Tr=(e,t,n)=>t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>Tr(e,typeof t!="symbol"?t+"":t,n);import{c as $,u as Pe,a as Q,s as et,b as ee,r as Pr,d as v,e as Sn,o as be,g as Wt,f as O,$ as E,h as fe,i as He,j as Me,k as Oe,l as Fe,m as On,n as te,p as Mr,q as Ir,t as tt,v as Fr}from"./git-diff-vendor-CAv-4upN.js";import{g as Dr}from"./fast-diff-vendor-DgdwVvTQ.js";const Lr=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Br=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Lr]),Nr=new Set(["innerHTML","textContent","innerText","children"]),Rr=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),jr=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function _r(e,t){const n=jr[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ur=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xn=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Vr={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},zr=e=>$(()=>e());function Wr(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,c=t[o-1].nextSibling,u=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const l=s<r?a?n[a-1].nextSibling:n[s-a]:c;for(;a<s;)e.insertBefore(n[a++],l)}else if(s===a)for(;i<o;)(!u||!u.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const l=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],l),t[o]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const l=u.get(t[i]);if(l!=null)if(a<l&&l<s){let d=i,f=1,g;for(;++d<o&&d<s&&!((g=u.get(t[d]))==null||g!==l+f);)f++;if(f>l-a){const p=t[i];for(;a<l;)e.insertBefore(n[a++],p)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const Kt="_$DX_DELEGATE";function ja(e,t,n,r={}){let o;return Sn(s=>{o=s,t===document?e():Ct(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function kn(e,t,n,r){let o;const s=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},i=t?()=>Pe(()=>document.importNode(o||(o=s()),!0)):()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function Kr(e,t=window.document){const n=t[Kt]||(t[Kt]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,eo))}}function wt(e,t,n){se(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Hr(e,t,n,r){se(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Gr(e,t,n){se(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function qr(e,t){se(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Jr(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Xr(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(Ht(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Ht(e,a,!0),n[a]=c)}return n}function Yr(e,t,n){if(!t)return n?wt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function _a(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function vn(e,t={},n,r){const o={};return r||Q(()=>o.children=Ie(e,t.children,o.children)),Q(()=>typeof t.ref=="function"&&Ft(t.ref,e)),Q(()=>Zr(e,t,n,!0,o,!0)),o}function Ft(e,t,n){return Pe(()=>e(t,n))}function Ct(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ie(e,t,r,n);Q(o=>Ie(e,t(),o,n),r)}function Zr(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=Gt(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=Gt(e,i,a,o[i],n,s,t)}}function $n(e){let t,n;return!se()||!(t=O.registry.get(n=to()))?e():(O.completed&&O.completed.add(t),O.registry.delete(n),t)}function se(e){return!!O.context&&!O.done&&(!e||e.isConnected)}function Qr(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ht(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function Gt(e,t,n,r,o,s,i){let a,c,u,l,d;if(t==="style")return Yr(e,n,r);if(t==="classList")return Xr(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=Ur.has(f);if(!g&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(f,p)}(g||n)&&(Jr(e,f,n,g),g&&Kr([f]))}else if(t.slice(0,5)==="attr:")wt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Gr(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=Nr.has(t))||!o&&((l=_r(t,e.tagName))||(c=Br.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),c=!0;else if(se(e))return n;t==="class"||t==="className"?qr(e,n):a&&!c&&!u?e[Qr(t)]=n:e[l||t]=n}else{const f=o&&t.indexOf(":")>-1&&Vr[t.split(":")[0]];f?Hr(e,f,t,n):wt(e,Rr[t]||t,n)}return n}function eo(e){if(O.registry&&O.events&&O.events.find(([c,u])=>u===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),i=()=>{const c=t[n];if(c&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?c.call(t,u,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),O.registry&&!O.done&&(O.done=_$HY.done=!0),e.composedPath){const c=e.composedPath();s(c[0]);for(let u=0;u<c.length-2&&(t=c[u],!!i());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function Ie(e,t,n,r,o){const s=se(e);if(s){!n&&(n=[...e.childNodes]);let c=[];for(let u=0;u<n.length;u++){const l=n[u];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():c.push(l)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=ce(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=ce(e,n,r)}else{if(i==="function")return Q(()=>{let c=t();for(;typeof c=="function";)c=c();n=Ie(e,c,n,r)}),()=>n;if(Array.isArray(t)){const c=[],u=n&&Array.isArray(n);if(St(c,t,n,o))return Q(()=>n=Ie(e,c,n,r,!0)),()=>n;if(s){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let l=c[0];if(l.parentNode!==e)return n;const d=[l];for(;(l=l.nextSibling)!==r;)d.push(l);return n=d}if(c.length===0){if(n=ce(e,n,r),a)return n}else u?n.length===0?qt(e,c,r):Wr(e,n,c):(n&&ce(e),qt(e,c));n=c}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=ce(e,n,r,t);ce(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function St(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],c=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=St(e,a,c)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=St(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const l=String(a);c&&c.nodeType===3&&c.data===l?e.push(c):e.push(document.createTextNode(l))}}return o}function qt(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ce(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const c=a.parentNode===e;!s&&!i?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function to(){return O.getNextContextId()}const no="http://www.w3.org/2000/svg";function An(e,t=!1,n=void 0){return t?document.createElementNS(no,e):document.createElement(e,{is:n})}function Ua(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Wt();let s,i=!!O.context;return ee(()=>{i&&(Wt().user=i=!1),s||(s=Pr(o,()=>$(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[c,u]=v(!1),l=()=>u(!0);Sn(d=>Ct(a,()=>c()?d():s(),null)),be(l)}else{const c=An(e.isSVG?"g":"div",e.isSVG),u=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),Ct(u,s),a.appendChild(c),e.ref&&e.ref(c),be(()=>a.removeChild(c))}},void 0,{render:!i}),n}function ro(e,t){const n=$(e);return $(()=>{const r=n();switch(typeof r){case"function":return Pe(()=>r(t));case"string":const o=xn.has(r),s=O.context?$n():An(r,o,Pe(()=>t.is));return vn(s,t,o),s}})}function Va(e){const[,t]=et(e,["component"]);return ro(()=>e.component,t)}const we=Symbol("store-raw"),U=Symbol("store-node"),F=Symbol("store-has"),En=Symbol("store-self");function Tn(e){let t=e[E];if(!t&&(Object.defineProperty(e,E,{value:t=new Proxy(e,so)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function R(e){let t;return e!=null&&typeof e=="object"&&(e[E]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function z(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[we])return n;if(!R(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=z(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,u=i.length;c<u;c++)s=i[c],!a[s].get&&(o=e[s],(r=z(o,t))!==o&&(e[s]=r))}return e}function Ce(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function ne(e,t,n){if(e[t])return e[t];const[r,o]=v(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function oo(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===E||t===U||(delete n.value,delete n.writable,n.get=()=>e[E][t]),n}function Dt(e){Me()&&ne(Ce(e,U),En)()}function Pn(e){return Dt(e),Reflect.ownKeys(e)}const so={get(e,t,n){if(t===we)return e;if(t===E)return n;if(t===He)return Dt(e),n;const r=Ce(e,U),o=r[t];let s=o?o():e[t];if(t===U||t===F||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Me()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=ne(r,t,s)())}return R(s)?Tn(s):s},has(e,t){return t===we||t===E||t===He||t===U||t===F||t==="__proto__"?!0:(Me()&&ne(Ce(e,F),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Pn,getOwnPropertyDescriptor:oo};function k(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[F]&&e[F][t]&&o!==void 0&&e[F][t].$()):(e[t]=n,e[F]&&e[F][t]&&o===void 0&&e[F][t].$());let i=Ce(e,U),a;if((a=ne(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let c=e.length;c<s;c++)(a=i[c])&&a.$();(a=ne(i,"length",s))&&a.$(e.length)}(a=i[En])&&a.$()}function Mn(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];k(e,o,t[o])}}function io(e,t){if(typeof t=="function"&&(t=t(e)),t=z(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&k(e,n,o)}k(e,"length",r)}else Mn(e,t)}function ve(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c<r.length;c++)ve(e,[r[c]].concat(t),n);return}else if(a&&i==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&ve(e,[c].concat(t),n);return}else if(a&&i==="object"){const{from:c=0,to:u=e.length-1,by:l=1}=r;for(let d=c;d<=u;d+=l)ve(e,[d].concat(t),n);return}else if(t.length>1){ve(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=z(s),r===void 0||R(o)&&R(s)&&!Array.isArray(s)?Mn(o,s):k(e,r,s))}function za(...[e,t]){const n=z(e||{}),r=Array.isArray(n),o=Tn(n);function s(...i){fe(()=>{r&&i.length===1?io(n,i[0]):ve(n,i)})}return[o,s]}function ao(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===E||t===U||(delete n.value,delete n.writable,n.get=()=>e[E][t],n.set=r=>e[E][t]=r),n}const co={get(e,t,n){if(t===we)return e;if(t===E)return n;if(t===He)return Dt(e),n;const r=Ce(e,U),o=r[t];let s=o?o():e[t];if(t===U||t===F||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t),a=typeof s=="function";if(Me()&&(!a||e.hasOwnProperty(t))&&!(i&&i.get))s=ne(r,t,s)();else if(s!=null&&a&&s===Array.prototype[t])return(...c)=>fe(()=>Array.prototype[t].apply(n,c))}return R(s)?In(s):s},has(e,t){return t===we||t===E||t===He||t===U||t===F||t==="__proto__"?!0:(Me()&&ne(Ce(e,F),t)(),t in e)},set(e,t,n){return fe(()=>k(e,t,z(n))),!0},deleteProperty(e,t){return fe(()=>k(e,t,void 0,!0)),!0},ownKeys:Pn,getOwnPropertyDescriptor:ao};function In(e){let t=e[E];if(!t){Object.defineProperty(e,E,{value:t=new Proxy(e,co)});const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),s=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(s){let i=o;for(;i!=null;){const a=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(a)),Object.assign(r,a),i=Object.getPrototypeOf(i)}}for(let i=0,a=n.length;i<a;i++){const c=n[i];if(!(s&&c==="constructor")){if(r[c].get){const u=r[c].get.bind(t);Object.defineProperty(e,c,{get:u,configurable:!0})}if(r[c].set){const u=r[c].set;Object.defineProperty(e,c,{set:d=>fe(()=>u.call(t,d)),configurable:!0})}}}}return t}function lo(e,t){const n=z(e||{});return In(n)}const Ot=Symbol("store-root");function ue(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==Ot&&(!R(e)||!R(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){k(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let u,l,d,f,g,p,b,m;for(d=0,f=Math.min(s.length,e.length);d<f&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]&&s[d][o]===e[d][o]);d++)ue(e[d],s,d,r,o);const x=new Array(e.length),L=new Map;for(f=s.length-1,g=e.length-1;f>=d&&g>=d&&(s[f]===e[g]||o&&s[f]&&e[g]&&s[f][o]&&s[f][o]===e[g][o]);f--,g--)x[g]=s[f];if(d>g||d>f){for(l=d;l<=g;l++)k(s,l,e[l]);for(;l<e.length;l++)k(s,l,x[l]),ue(e[l],s,l,r,o);s.length>e.length&&k(s,"length",e.length);return}for(b=new Array(g+1),l=g;l>=d;l--)p=e[l],m=o&&p?p[o]:p,u=L.get(m),b[l]=u===void 0?-1:u,L.set(m,l);for(u=d;u<=f;u++)p=s[u],m=o&&p?p[o]:p,l=L.get(m),l!==void 0&&l!==-1&&(x[l]=s[u],l=b[l],L.set(m,l));for(l=d;l<e.length;l++)l in x?(k(s,l,x[l]),ue(e[l],s,l,r,o)):k(s,l,e[l])}else for(let u=0,l=e.length;u<l;u++)ue(e[u],s,u,r,o);s.length>e.length&&k(s,"length",e.length);return}const a=Object.keys(e);for(let u=0,l=a.length;u<l;u++)ue(e[a[u]],s,a[u],r,o);const c=Object.keys(s);for(let u=0,l=c.length;u<l;u++)e[c[u]]===void 0&&k(s,c[u],void 0)}function Wa(e,t={}){const{merge:n,key:r="id"}=t,o=z(e);return s=>{if(!R(s)||!R(o))return o;const i=ue(o,{[Ot]:s},Ot,n,r);return i===void 0?s:i}}const Ge=new WeakMap,Fn={get(e,t){if(t===we)return e;const n=e[t];let r;return R(n)?Ge.get(n)||(Ge.set(n,r=new Proxy(n,Fn)),r):n},set(e,t,n){return k(e,t,z(n)),!0},deleteProperty(e,t){return k(e,t,void 0,!0),!0}};function Ka(e){return t=>{if(R(t)){let n;(n=Ge.get(t))||Ge.set(t,n=new Proxy(t,Fn)),e(n)}return t}}function Lt(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function uo(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function re(e){if(typeof e!="string")return e;if(e.charAt(0)==="#")return re(uo(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const r=e.substring(t+1,e.length-1);let o,s;if(n==="color"){if(o=r.split(" "),s=o.shift(),o.length===4&&o[3].charAt(0)==="/"&&(o[3]=o[3].substr(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020. "+s)}else o=r.split(",");return{type:n,values:o.map(i=>parseFloat(i)),colorSpace:s}}function nt(e){const{type:t,colorSpace:n}=e,{values:r}=e;let o;return t.indexOf("rgb")!==-1?o=r.map((s,i)=>i<3?parseInt(s.toString(),10):s).join(","):t.indexOf("hsl")!==-1&&(o=r.map((s,i)=>i===1||i===2?`${s}%`:s).join(",")),t.indexOf("color")!==-1?o=`${n} ${r.join(" ")}`:o=`${r.join(", ")}`,`${t}(${o})`}function fo(e){const t=re(e),{values:n}=t,r=n[0],o=n[1]/100,s=n[2]/100,i=o*Math.min(s,1-s),a=(l,d=(l+r/30)%12)=>s-i*Math.max(Math.min(d-3,9-d,1),-1);let c="rgb";const u=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(c+="a",u.push(n[3])),nt({type:c,values:u})}function Jt(e){const{type:t,values:n}=re(e);let r=t==="hsl"?re(fo(e)).values:n;return r=r.map(o=>(t!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*r[0]+.7152*r[1]+.0722*r[2]).toFixed(3))}function ho(e,t){const n=Jt(e),r=Jt(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ha(e,t){let{type:n,values:r}=re(e);return t=Lt(t),(n==="rgb"||n==="hsl")&&(n+="a"),n==="color"?r[3]=`/${t}`:r[3]=t,nt({type:n,values:r})}function go(e,t){const n=re(e);if(t=Lt(t),n.type.indexOf("hsl")!==-1)n.values[2]*=1-t;else if(n.type.indexOf("rgb")!==-1||n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]*=1-t;return nt(n)}function po(e,t){const n=re(e);if(t=Lt(t),n.type.indexOf("hsl")!==-1)n.values[2]+=(100-n.values[2])*t;else if(n.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(255-n.values[r])*t;else if(n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(1-n.values[r])*t;return nt(n)}const mo={xs:0,sm:600,md:900,lg:1200,xl:1536};function yo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints;return t.reduce((i,a,c)=>(i={...i,...s.up(s.keys[c],n(t[c]))},i),{})}if(typeof t=="object"){const s=r.breakpoints;return Object.keys(t).reduce((a,c)=>{if(Object.keys(s.values||mo).indexOf(c)!==-1)a={...a,...s.up(c,n(t[c],c))};else{const u=c;a[u]=t[u]}return a},{})}return n(t)}const bo={cleanupStyles:!0},wo=Oe(bo),oe={black:"#000",white:"#fff"},he={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ge={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},pe={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},me={300:"#4fc3f7",400:"#29b6f6",700:"#0288d1",800:"#0277bd",900:"#01579b"},ye={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Ee={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Co={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function $e(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function So(e,t){for(const n of t){const r=e[n];delete e[n],e[n]=r}}function Bt(e,t,n={clone:!0}){const r=n.clone?{...e}:e,o=n.sortKeys?[]:void 0;return $e(e)&&$e(t)&&(Object.keys(t).forEach(s=>{if(s==="__proto__")return;o&&o.push(s);let i,a;$e(i=t[s])&&s in e&&$e(a=e[s])?r[s]=Bt(a,i,n):i!==void 0&&(r[s]=i)}),o&&So(r,o)),r}function xt(e){if(Array.isArray(e)){const t=[];for(const n of e)t.push(xt(n));return t}else if($e(e)){const t={};for(const n in e)n!=="__proto__"&&(t[n]=xt(e[n]));return t}else return e}function De(e,...t){for(const n of t)Bt(e,xt(n),{clone:!1});return e}const Oo=()=>({text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:oe.white,default:oe.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}),xo={primary:{main:pe[700],light:pe[400],dark:pe[800]},secondary:{main:ge[500],light:ge[300],dark:ge[700]},error:{main:he[700],light:he[400],dark:he[800]},info:{main:me[700],light:me[800],dark:me[900]},success:{main:ye[800],light:ye[500],dark:ye[900]},warning:{main:"#ED6C02",light:Ee[500],dark:Ee[900]}},ko=()=>({text:{primary:oe.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:oe.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}),vo={primary:{main:pe[200],light:pe[50],dark:pe[400]},secondary:{main:ge[200],light:ge[50],dark:ge[400]},error:{main:he[500],light:he[300],dark:he[700]},info:{main:me[400],light:me[300],dark:me[700]},success:{main:ye[400],light:ye[300],dark:ye[700]},warning:{main:Ee[400],light:Ee[300],dark:Ee[700]}},$o={light:Oo,dark:ko};function Dn(e,t){return ho(e,oe.white)>=t?oe.white:"rgba(0, 0, 0, 0.87)"}function Xt(e,t,n,r){const o=typeof r=="number"?r:r.light,s=typeof r=="number"?r*1.5:r.dark;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=po(e.main,o):t==="dark"&&(e.dark=go(e.main,s)))}function Ao(e){const t={...e.color},n=e.mainShade??500;return!e.color.main&&e.color[n]&&(t.main=e.color[n]),Xt(t,"light",e.lightShade??300,e.tonalOffset),Xt(t,"dark",e.darkShade??700,e.tonalOffset),t.contrastText||(t.contrastText=Dn(t.main,e.contrastThreshold)),t}const Eo=()=>({mode:"light",tonalOffset:.2,contrastThreshold:3,grey:Co,common:oe});function To(e){const t=["error","info","primary","secondary","success","warning"],n=Eo(),r={...De({},n,$o[(e==null?void 0:e.mode)??n.mode](),e),isColorName(s){return t.includes(s)},getColorObject(s){return r[s]},getColor(s){return r.mode==="light"?r[s].light:r[s].dark},augmentColor(s){return Ao({...s,tonalOffset:r.tonalOffset,contrastThreshold:r.contrastThreshold})},getContrastText(s){return Dn(s,r.contrastThreshold)}},o=s=>r.mode==="light"?xo[s]:vo[s];return r.primary=r.augmentColor({color:r.primary||o("primary")}),r.secondary=r.augmentColor({color:r.secondary||o("secondary"),mainShade:"A400",lightShade:"A200",darkShade:"A700"}),r.error=r.augmentColor({color:r.error||o("error")}),r.warning=r.augmentColor({color:r.warning||o("warning")}),r.info=r.augmentColor({color:r.info||o("info")}),r.success=r.augmentColor({color:r.success||o("success")}),r}const Po={};function Mo(e){return{...De({},Po,e??{})}}function Io(e,t=void 0,n={}){return{toolbar:{minHeight:56,[`${e.up("xs")} and (orientation: landscape)`]:{minHeight:48},[e.up("sm")]:{minHeight:64}},...n}}const dt={},Fo=.2,Do=.14,Lo=.12;function w(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Fo})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Do})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Lo})`].join(",")}const Bo=[()=>"none",()=>w(0,2,1,-1,0,1,1,0,0,1,3,0),()=>w(0,3,1,-2,0,2,2,0,0,1,5,0),()=>w(0,3,3,-2,0,3,4,0,0,1,8,0),()=>w(0,2,4,-1,0,4,5,0,0,1,10,0),()=>w(0,3,5,-1,0,5,8,0,0,1,14,0),()=>w(0,3,5,-1,0,6,10,0,0,1,18,0),()=>w(0,4,5,-2,0,7,10,1,0,2,16,1),()=>w(0,5,5,-3,0,8,10,1,0,3,14,2),()=>w(0,5,6,-3,0,9,12,1,0,3,16,2),()=>w(0,6,6,-3,0,10,14,1,0,4,18,3),()=>w(0,6,7,-4,0,11,15,1,0,4,20,3),()=>w(0,7,8,-4,0,12,17,2,0,5,22,4),()=>w(0,7,8,-4,0,13,19,2,0,5,24,4),()=>w(0,7,9,-4,0,14,21,2,0,5,26,4),()=>w(0,8,9,-5,0,15,22,2,0,6,28,5),()=>w(0,8,10,-5,0,16,24,2,0,6,30,5),()=>w(0,8,11,-5,0,17,26,2,0,6,32,5),()=>w(0,9,11,-5,0,18,28,2,0,7,34,6),()=>w(0,9,12,-6,0,19,29,2,0,7,36,6),()=>w(0,10,13,-6,0,20,31,3,0,8,38,7),()=>w(0,10,13,-6,0,21,33,3,0,8,40,7),()=>w(0,10,14,-6,0,22,35,3,0,8,42,7),()=>w(0,11,14,-7,0,23,36,3,0,9,44,8),()=>w(0,11,15,-7,0,24,38,3,0,9,46,8)];function No(){return new Proxy([],{get:(e,t)=>typeof t!="string"||isNaN(Number(t))?e[t]:t in dt?dt[t]:dt[t]=Bo[t]()})}const Ro={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},jo={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Yt(e){return`${Math.round(e)}ms`}function _o(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Uo(e){const t={...Ro,...e.easing},n={...jo,...e.duration};return{getAutoHeightDuration:_o,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...u}=s;return(Array.isArray(o)?o:[o]).map(l=>`${l} ${typeof i=="string"?i:Yt(i)} ${a} ${typeof c=="string"?c:Yt(c)}`).join(",")},...e,easing:t,duration:n}}const T={light:300,regular:400,medium:500},Re={fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontSize:14,htmlFontSize:16,h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},subtitle1:{},subtitle2:{},body1:{},body2:{},button:{},caption:{},overline:{},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700};function Vo(e){return Math.round(e*1e5)/1e5}function P(e,t,n,r,o,s){return{fontFamily:e.fontFamily,fontWeight:t,fontSize:e.pxToRem(n),lineHeight:`${r}`,letterSpacing:`${Vo(o/n)}em`,...s?{textTransform:"uppercase"}:{}}}function zo(e={}){const t={fontFamily:e.fontFamily??Re.fontFamily,fontSize:e.fontSize??Re.fontSize,htmlFontSize:(e==null?void 0:e.htmlFontSize)??Re.htmlFontSize,pxToRem:n=>{const r=t.fontSize/14;return`${n/t.htmlFontSize*r}rem`}};return De(Re,t,{h1:P(t,T.light,96,1.167,-1.5),h2:P(t,T.light,60,1.2,-.5),h3:P(t,T.regular,48,1.167,0),h4:P(t,T.regular,34,1.235,.25),h5:P(t,T.regular,24,1.334,0),h6:P(t,T.medium,20,1.6,.15),subtitle1:P(t,T.regular,16,1.75,.15),subtitle2:P(t,T.medium,14,1.57,.1),body1:P(t,T.regular,16,1.5,.15),body2:P(t,T.regular,14,1.43,.15),button:P(t,T.medium,14,1.75,.4,!0),caption:P(t,T.regular,12,1.66,.4),overline:P(t,T.regular,12,2.66,1,!0)},e)}const Wo={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Ko(e){return{...De({},Wo,e)}}function ft(e,t,n="px"){let r;if(e==="up")r=`(min-width:${t}${n})`;else if(e==="down")r=`(max-width:${t}${n})`;else if(e==="between"){const[o,s]=t;r=`(max-width:${o}${n}) and (min-width:${s}${n})`}else throw new Error(`Invalid comparator: ${e}`);return`@media ${r}`}const Ho={columns:12,keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:900,lg:1200,xl:1536},unit:"px"};function Ln(e){const t={...Ho,...e??{},up:(n,r)=>{const o=ft("up",t.resolve(n));return r?{[o]:r}:o},down:(n,r)=>{const o=ft("down",t.resolve(n));return r?{[o]:r}:o},between:(n,r)=>{const o=ft("between",[t.resolve(n[0]),t.resolve(n[1])]);return r?{[o]:r}:o},resolve:n=>typeof n=="number"?n:t.values[n]};return t}function Bn(e){return typeof e=="function"?e:(...n)=>n.map(r=>typeof r=="number"?`${r*(e??8)}px`:r).join(" ")}const Go={borderRadius:4};function Nn(e){return{...De({},Go,e)}}function Rn(e={}){const t={direction:"ltr",...e};function n(r,o){const s=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,...typeof s=="function"?{get:s}:{value:o({[r]:s})}})}return n("breakpoints",r=>Ln(r.breakpoints)),n("components",r=>Mo(r.components)),n("palette",r=>To(r.palette)),n("shape",r=>Nn(r.shape)),n("spacing",r=>Bn(r.spacing)),n("typography",r=>zo(r.typography)),n("shadows",()=>No()),n("transitions",()=>Uo({})),n("zIndex",r=>Ko(r.zIndex)),n("mixins",()=>Io(t.breakpoints)),t}function jn(e){let t;return function(){return t||(t=e()),t}}const qo=jn(Rn);let _n;_n=Oe({});const rt=_n;function Jo(e){return{direction:"ltr",shadows:void 0,transitions:void 0,components:void 0,palette:void 0,typography:void 0,zIndex:void 0,mixins:void 0,...e,breakpoints:Ln(e==null?void 0:e.breakpoints),shape:Nn(e==null?void 0:e.shape),spacing:Bn(e==null?void 0:e.spacing)}}const Xo=jn(Jo);function Yo(e){for(const t in e)return!1;return!0}function Nt(e=Xo,t=rt){const n=Fe(t);if(typeof n=="function")return new Proxy({},{get:(r,o)=>n()[o]});if(Yo(n)&&e)return typeof e=="function"?e():e;if(!n)throw new Error("Theme is not defined");return n}function Un(e=qo){return Nt(e,rt)}function Zo(e){return Nt(e,rt)}function Qo(e){var s,i;const t=[],n=typeof e.propDefaults=="function"?e.propDefaults({set:a=>a,inProps:e.props}):e.propDefaults,o=(i=(s=Zo().components)==null?void 0:s[e.name])==null?void 0:i.defaultProps;return n&&t.push(n),o&&t.push(o),t.length?On(...t,e.props):e.props}function es(e){return te(rt.Provider,{get value(){return e.theme},get children(){return e.children}})}function ts(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function ns(e,t){switch(typeof e){case"function":return Object.assign(e,{[Mr]:!0}),Pe(()=>e(t));case"string":const n=xn.has(e),r=O.context?$n():ts(e,n);return vn(r,t,n),r}}function Vn(e,t){const n=$(e);return $(()=>ns(n(),t))}function Ga(e){const[t,n]=et(e,["$component"]);return Vn(()=>t.$component,n)}function rs(e){const t=e.reduce((n,r)=>("name"in r&&(n[`--${r.name}`]="0"),Bt(n,r,{clone:!1,sortKeys:!0}),n),{});return delete t.name,t}function zn(e){return e.startsWith("--")}function os(e){return e.startsWith("__")}function Wn(e){return/[^a-z-]/i.test(e)&&!zn(e)}function Kn(e){return e.startsWith("@global")}function kt(e){return e.startsWith("@media")}function Hn(e){return e.startsWith("@keyframes")}function Zt(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Qt(e,t,n=[],r={}){const o=e.split(",").map(s=>(s=s.trim(),s.includes("&")?s:`& ${s}`));return qe(t,(n.length?n:[""]).flatMap(s=>o.map(i=>i.replace(/&/g,s).trim())),{...r})}function en(e,t){if(!t)return Zt(e);let n=t.get(e);return n||(t.set(e,n=Zt(e)),n)}function qe(e,t=[],n={}){const r=[],o=[];for(let i in e){const a=e[i];if(!os(i))if(Kn(i))for(const c in a)o.push(...Qt(c,a[c],[],n));else if(kt(i))o.push(...qe(a,t,{...n,sublevel:!0}).map(c=>`${i} {
|
|
2
|
-
${c}
|
|
3
|
-
}`));else if(zn(i))a!=null&&r.push(`${i}: ${a};`);else if(Hn(i)){const c=[];for(const u in a)c.push(...qe(a[u],[/^\d+$/.test(u)?`${u}%`:u],{...n,sublevel:!0}));o.push(`${i} {
|
|
4
|
-
${c.join(`
|
|
5
|
-
`)}
|
|
6
|
-
}`)}else if(Wn(i))o.push(...Qt(i,a,t,n));else if(n.extraProperties&&i in n.extraProperties){const c=n.extraProperties[i](a);for(const u in c){const l=c[u],d=n.onPropertyValue?n.onPropertyValue(u,l):l;d!=null&&r.push(`${en(u,n.propertyNameCache)}: ${d};`)}}else{i=en(i,n.propertyNameCache);const c=n.onPropertyValue?n.onPropertyValue(i,a):a;c!=null&&r.push(`${i}: ${c};`)}}const s=i=>{const a=" ".repeat(i);return`${a}${r.join(`
|
|
7
|
-
${a}`)}`};if(t.length){const i=n.sublevel?" ":"",a=i+t.join(`,
|
|
8
|
-
${i}`);return[...r.length?[`${a} {
|
|
9
|
-
${s(n.sublevel?2:1)}
|
|
10
|
-
${i}}`]:[],...o]}else return[...r.length?[s(0)]:[],...o]}function ss(e){return e?Array.isArray(e)?e:[e]:[]}function is(e){return typeof e=="function"&&(e=e()),e}class as{constructor(){Ne(this,"ids",new Map);Ne(this,"rules",new Map);Ne(this,"propertyNames",new Map)}create(t,n,r){let o=this.rules.get(n);if(o)return o;let s=this.ids.get(r);return typeof s=="number"&&(this.ids.set(r,++s),r+=`_${s}`),o=Gn(t,n,r),this.save(o,n),o}save(t,n){this.ids.set(t.id,0),this.rules.set(n,t)}delete(t){this.ids.delete(t.id),this.rules.delete(t.rules)}}function Gn(e,t,n){return{id:n,name:e,className:`${e}-${n}`,rules:t.replaceAll("$id",`${n}`)}}function cs(e){var s,i;const t=`${e.name}-$id`,n=ss(is(e.props)),r=(s=e.cache)==null?void 0:s.propertyNames,o=n.map(a=>typeof a=="string"?`.${t} {
|
|
11
|
-
${a}
|
|
12
|
-
}`:qe(a,[`.${t}`],{extraProperties:e.extraProperties,propertyNameCache:r}).join(`
|
|
13
|
-
`)).join(`
|
|
14
|
-
`);return((i=e.cache)==null?void 0:i.create(e.name,o,e.componentId))||Gn(e.name,o,e.componentId)}function qn(e,t){"styleSheet"in e?e.styleSheet.cssText=t:(e.innerText="",e.appendChild(document.createTextNode(t)))}function ls(e,t){for(const n in t){const r=t[n];r!==void 0&&(r===null?e.removeAttribute(n):e.setAttribute(n,r))}}function us(e,t){const n=document.createElement("style");return n.type="text/css",t&&ls(n,t),qn(n,e),n}function vt(e){let t=Number(e.getAttribute("data-uses"));t++,e.setAttribute("data-uses",t.toString())}const tn="suid-injectFirst";function ds(e,t,n){Array.isArray(e)&&(e=e.join(`
|
|
15
|
-
`));const r=t==null?void 0:t.id,o=document.head||document.getElementsByTagName("head")[0],s=r&&document.getElementById(r);if(s&&s instanceof HTMLStyleElement)return qn(s,e),vt(s),s;{s&&s.remove();const i=us(e,t);if(vt(i),n){let a=o.querySelector(`#${tn}`);a||(a=document.createElement("style"),a.setAttribute("id",tn),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function fs(e,t="css-"){if(typeof e=="string")return document.getElementById(e);const n=[...e.classList].find(r=>r.startsWith(t));if(n)return document.getElementById(n.slice(t.length))}function nn(e,t=!0){let n=Number(e.getAttribute("data-uses"));n--,n<=0?t?e.remove():e.setAttribute("data-uses","0"):e.setAttribute("data-uses",n.toString())}function qa(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function Ja(e,t=166){let n;function r(...o){const s=()=>{e.apply(null,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function Xa(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function hs(e){return e&&e.ownerDocument||document}function Ya(e){return hs(e).defaultView||window}function Jn(){return Math.random().toString(36).substring(2,15).slice(0,8)}let ot=!0,$t=!1,rn;const gs={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function ps(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&gs[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function ms(e){e.metaKey||e.altKey||e.ctrlKey||(ot=!0)}function ht(){ot=!1}function ys(){this.visibilityState==="hidden"&&$t&&(ot=!0)}function bs(e){e.addEventListener("keydown",ms,!0),e.addEventListener("mousedown",ht,!0),e.addEventListener("pointerdown",ht,!0),e.addEventListener("touchstart",ht,!0),e.addEventListener("visibilitychange",ys,!0)}function ws(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ot||ps(t)}function Za(){const e=s=>{s!=null&&bs(s.ownerDocument)},[t,n]=v(!1);function r(){return t()?($t=!0,window.clearTimeout(rn),rn=window.setTimeout(()=>{$t=!1},100),n(!1),!0):!1}function o(s){return ws(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const Cs=new as;function Ss(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function Os(){if(!O.context)return Jn();const e=Ir().replaceAll("-",""),t=9,n=Math.ceil(e.length/t),r=[];for(let o=1;o<=n;++o){const s=(o-1)*t,i=Number(e.slice(s,s+t));r.push(i.toString(32))}return r.join("-")}function Xn(e){const t=Fe(wo),[n,r]=v(""),o=Os();let s,i=!1;return Q(a=>{var l;const c=e();let u;if(c){const d=rs(Ss(c));i="@global"in d,u=cs({name:"css",props:d,cache:Cs,componentId:o}),s=fs(u.id),s?vt(s):s=ds(u.rules,{id:u.id,nonce:(l=t.cache)==null?void 0:l.nonce},t.injectFirst),a!=null&&a.styleElement&&nn(a.styleElement)}return typeof(u==null?void 0:u.className)=="string"?r(u.className):r(""),{className:u==null?void 0:u.className,styleElement:s}},void 0),be(()=>{s&&nn(s,t.cleanupStyles??i)}),n}function de(e,t,n={}){for(const r in e){const o=e[r];if(Kn(r))n[r]=de(o,t);else if(kt(r))n[r]=de(o,t);else if(Hn(r)){n[r]={};for(const s in o)n[r][s]=de(o[s],t)}else if(Wn(r))n[r]=de(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=kt(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const xs=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function Yn(e,t){if(typeof t=="number")return{[e]:xs.has(e)?t.toString():`${t}px`}}function on(e,t={}){return de(e,Yn,t)}function Je(e,t,n){if(typeof n!="string")return n;const r=n.split(".");let o=e[t];for(let s=0;s<r.length&&(o=o==null?void 0:o[r[s]],!!o);s++);return o??n}function ks(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function vs(e,t,n,r){const o=ks(e,t)||n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}const G={x:["Left","Right"],y:["Top","Bottom"]};function Zn(e){return typeof e=="number"?`${e}px`:e}function Qn(e,t){return(n,r)=>t(e,n,r)}function h(e,t){return t?(n,r)=>({[e]:t(e,n,r)}):n=>({[e]:n})}function Ae(e){return h(e,(t,n)=>Zn(n))}function I(e,t,n){const r=t.map(o=>`${e}${o}`);return n?(o,s)=>r.reduce((i,a)=>(i[a]=n(a,o,s),i),{}):o=>r.reduce((s,i)=>(s[i]=o,s),{})}function $s(){return{...As(),...Es(),...Ts(),...Ps(),...Ms(),...Is(),...Fs(),...Ls(),...Ds()}}function As(){return{displayPrint:Qn("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:h("display"),overflow:h("overflow"),textOverflow:h("textOverflow"),visibility:h("visibility"),whiteSpace:h("whiteSpace")}}function Es(){return{flexBasis:h("flexBasis"),flexDirection:h("flexDirection"),flexWrap:h("flexWrap"),justifyContent:h("justifyContent"),alignItems:h("alignItems"),alignContent:h("alignContent"),order:h("order"),flex:h("flex"),flexGrow:h("flexGrow"),flexShrink:h("flexShrink"),alignSelf:h("alignSelf"),justifyItems:h("justifyItems"),justifySelf:h("justifySelf")}}function Ts(){const e=(t,n,r)=>vs(r,"spacing",8)(n);return{gap:h("gap",e),columnGap:h("columnGap",e),rowGap:h("rowGap",e),gridColumn:h("gridColumn"),gridRow:h("gridRow"),gridAutoFlow:h("gridAutoFlow"),gridAutoColumns:h("gridAutoColumns"),gridAutoRows:h("gridAutoRows"),gridTemplateColumns:h("gridTemplateColumns"),gridTemplateRows:h("gridTemplateRows"),gridTemplateAreas:h("gridTemplateAreas"),gridArea:h("gridArea")}}function Ps(){return{position:h("position"),zIndex:h("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:Ae("top"),right:Ae("right"),bottom:Ae("bottom"),left:Ae("left")}}function Ms(){const e=(t,n,r)=>Je(r,"palette",n);return{color:h("color",e),bgcolor:h("backgroundColor",e),backgroundColor:h("backgroundColor",e)}}function Is(){const e=(t,n,r)=>(t==="maxWidth"&&(n=r.breakpoints.values[t]??n),typeof n=="number"&&(n=n>0&&n<=1?`${n*100}%`:`${n}px`),n);return{width:h("width",e),maxWidth:h("maxWidth",e),minWidth:h("minWidth",e),height:h("height",e),maxHeight:h("maxHeight",e),minHeight:h("minHeight",e),boxSizing:h("boxSizing",e)}}function Fs(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>Je(o,"palette",r);return{border:h("border",e),borderTop:h("borderTop",e),borderRight:h("borderRight",e),borderBottom:h("borderBottom",e),borderLeft:h("borderLeft",e),borderColor:h("borderColor",t),borderTopColor:h("borderTopColor",t),borderRightColor:h("borderRightColor",t),borderBottomColor:h("borderBottomColor",t),borderLeftColor:h("borderLeftColor",t),borderRadius:h("borderRadius",(n,r,o)=>typeof r=="number"?`${o.shape.borderRadius*r}px`:r)}}function Ds(){const e=(t,n,r)=>Je(r,"typography",n);return{typography:Qn("typography",(t,n,r)=>Je(r,"typography",n)),fontFamily:h("fontFamily",e),fontSize:h("fontSize",(t,n,r)=>Zn(e(t,n,r))),fontStyle:h("fontStyle",e),fontWeight:h("fontWeight",e),letterSpacing:Ae("letterSpacing"),lineHeight:h("lineHeight"),textAlign:h("textAlign"),textTransform:h("textTransform")}}function Ls(){const e=(r,o,s)=>s.spacing(o),t="margin",n="padding";return{m:h(t,e),mt:h("marginTop",e),mr:h("marginRight",e),mb:h("marginBottom",e),ml:h("marginLeft",e),mx:I(t,G.x,e),my:I(t,G.y,e),margin:h(t,e),marginTop:h("marginTop",e),marginRight:h("marginRight",e),marginBottom:h("marginBottom",e),marginLeft:h("marginLeft",e),marginX:I(t,G.x,e),marginY:I(t,G.y,e),marginInline:I(t,["Inline","InlineStart"],e),marginInlineStart:h("marginInlineStart",e),marginInlineEnd:h("marginInlineEnd",e),marginBlock:I(t,["BlockStart","BlockEnd"],e),marginBlockStart:h("marginBlockStart",e),marginBlockEnd:h("marginBlockEnd",e),p:h(n,e),pt:h("paddingTop",e),pr:h("paddingRight",e),pb:h("paddingBottom",e),pl:h("paddingLeft",e),px:I(n,G.x,e),py:I(n,G.y,e),padding:h(n,e),paddingTop:h("paddingTop",e),paddingRight:h("paddingRight",e),paddingBottom:h("paddingBottom",e),paddingLeft:h("paddingLeft",e),paddingX:I(n,G.x,e),paddingY:I(n,G.y,e),paddingInline:I(n,["Inline","InlineStart"],e),paddingInlineStart:h("paddingInlineStart",e),paddingInlineEnd:h("paddingInlineEnd",e),paddingBlock:I(n,["BlockStart","BlockEnd"],e),paddingBlockStart:h("paddingBlockStart",e),paddingBlockEnd:h("paddingBlockEnd",e)}}const Rt=$s(),Qa=Object.keys(Rt);function Bs(e,t,n){return Rt[e](t,n)}function sn(e,t,n){return e in Rt?Bs(e,t,n):Yn(e,t)}function Ns(e,t){return de(e,(n,r)=>{if(typeof r=="function"&&(r=r(t)),r==null)return r;if(typeof r=="object"){const o={};for(const s of t.breakpoints.keys)o[t.breakpoints.up(s)]={};return Object.assign(o,yo({theme:t},r,s=>sn(n,s,t)??{[n]:s}))}else return sn(n,r,t)})}function er(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=er(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rs(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=er(e))&&(r&&(r+=" "),r+=t);return r}const tr=["ownerState","theme","sx","as"];function js(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function _s(e,t,n,r,o={}){return $(()=>{const s=e(),i=js(o.name,s),a=r.ownerState,c=n.reduce((l,d)=>{let f;return typeof d=="function"?f=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(f=d),f&&l.push(on(f,{name:t,__resolved:!0})),l},[]);let u=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(u=o.overridesResolver(r,i).map(l=>l?on(l,{}):null).filter(Boolean)),c.concat(u)})}function nr(e,t){e.__suid=t}function an(e){if(typeof e=="function")return e.__suid}function Us(e){return function(n,r={}){let o,s;if(r.name){const a=r.slot||"Root";s=o=`${r.name}-${a.slice(0,1).toLowerCase()+a.slice(1)}`}else s=`styled-${Jn()}`,o="css";const i=an(n);return function(...a){function c(u){let l;const d=()=>{const A=u.theme;return A||l||(l=e&&e.onUseTheme?e.onUseTheme():Nt())},[,f]=et(u,r.skipProps||tr),g=_s(d,o,a,u,r),p=()=>{const A=u.sx;return A?Array.isArray(A)?A:[A]:[]},b=()=>{if(i)return n;const A=u.as;return A||n},m=i?()=>i:$(()=>an(b())),x=r.skipSx?()=>g():()=>{const A=d();return[...g(),...p().map(H=>H.__resolved?H:Ns(H,A))]},L=Xn(()=>m()?void 0:x());return Vn(b,On(f,{get children(){return u.children},get component(){return m()?u.component:null},get as(){return i?u.as:void 0},get sx(){return m()?x():void 0},get ownerState(){return m()==="system"?u.ownerState:void 0},get class(){return Rs([...new Set([u.class,s,L()])])}}))}return nr(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const ec=[...tr,"classes"],tc=Us({onUseTheme:()=>Un()});var At={exports:{}},gt,cn;function Vs(){if(cn)return gt;cn=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;gt=function(l,d){d=d||{};var f=typeof l;if(f==="string"&&l.length>0)return i(l);if(f==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function i(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var f=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=n?Math.round(l/n)+"h":d>=t?Math.round(l/t)+"m":d>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?u(l,d,r,"day"):d>=n?u(l,d,n,"hour"):d>=t?u(l,d,t,"minute"):d>=e?u(l,d,e,"second"):l+" ms"}function u(l,d,f,g){var p=d>=f*1.5;return Math.round(l/f)+" "+g+(p?"s":"")}return gt}function zs(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Vs(),n.destroy=u,Object.keys(e).forEach(l=>{n[l]=e[l]}),n.names=[],n.skips=[],n.formatters={};function t(l){let d=0;for(let f=0;f<l.length;f++)d=(d<<5)-d+l.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(l){let d,f=null,g,p;function b(...m){if(!b.enabled)return;const x=b,L=Number(new Date),A=L-(d||L);x.diff=A,x.prev=d,x.curr=L,d=L,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let H=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(ut,$r)=>{if(ut==="%%")return"%";H++;const zt=n.formatters[$r];if(typeof zt=="function"){const Ar=m[H];ut=zt.call(x,Ar),m.splice(H,1),H--}return ut}),n.formatArgs.call(x,m),(x.log||n.log).apply(x,m)}return b.namespace=l,b.useColors=n.useColors(),b.color=n.selectColor(l),b.extend=r,b.destroy=n.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==n.namespaces&&(g=n.namespaces,p=n.enabled(l)),p),set:m=>{f=m}}),typeof n.init=="function"&&n.init(b),b}function r(l,d){const f=n(this.namespace+(typeof d>"u"?":":d)+l);return f.log=this.log,f}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const f of d)f[0]==="-"?n.skips.push(f.slice(1)):n.names.push(f)}function s(l,d){let f=0,g=0,p=-1,b=0;for(;f<l.length;)if(g<d.length&&(d[g]===l[f]||d[g]==="*"))d[g]==="*"?(p=g,b=f,g++):(f++,g++);else if(p!==-1)g=p+1,b++,f=b;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===d.length}function i(){const l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(const d of n.skips)if(s(l,d))return!1;for(const d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Ws=zs;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,f=0;u[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(d++,g==="%c"&&(f=d))}),u.splice(f,0,l)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function i(){let u;try{u=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=Ws(t);const{formatters:c}=e.exports;c.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(At,At.exports);var Ks=At.exports;const Et=Dr(Ks),xe=["sse","api","session","actions"],rr="opencode:logger:namespaces",pt=new Map,j=new Set,_=typeof globalThis<"u"?globalThis.console:void 0;function Le(){j.size===0?Et.disable():Et.enable(Array.from(j).join(","))}function st(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(rr,JSON.stringify(Array.from(j)))}catch(t){(e=_==null?void 0:_.warn)==null||e.call(_,"Failed to persist logger namespaces",t)}}function Hs(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(rr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)xe.includes(r)&&j.add(r)}catch(t){(e=_==null?void 0:_.warn)==null||e.call(_,"Failed to hydrate logger namespaces",t)}}Hs();Le();function Gs(e){const n=Et(e),r=(o,s)=>{n(o,...s)};return{log:(...o)=>n(...o),info:(...o)=>n(...o),warn:(...o)=>r("[warn]",o),error:(...o)=>r("[error]",o)}}function ie(e){if(!xe.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return pt.has(e)||pt.set(e,Gs(e)),pt.get(e)}function qs(){return xe.map(e=>({name:e,enabled:j.has(e)}))}function Js(e){if(!xe.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)||(j.add(e),st(),Le())}function Xs(e){if(!xe.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)&&(j.delete(e),st(),Le())}function Ys(){j.clear(),st(),Le()}function Zs(){xe.forEach(e=>j.add(e)),st(),Le()}const Qs={listLoggerNamespaces:qs,enableLogger:Js,disableLogger:Xs,enableAllLoggers:Zs,disableAllLoggers:Ys};function ei(){typeof window>"u"||(window.codenomadLogger=Qs)}ei();var Cn;const ti=typeof window<"u"?(Cn=window.location)==null?void 0:Cn.origin:void 0,ni=typeof window<"u"?window.__CODENOMAD_API_BASE__??ti:void 0,ri=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",J=ni,ln=oi(J,ri),nc=J;function rc(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return si(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function oi(e,t){if(t.startsWith("http://")||t.startsWith("https://"))return t;if(e){const n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`}return t}function si(e){if(e.startsWith("http://")||e.startsWith("https://")||!J)return e;const t=e.startsWith("/")?e:`/${e}`;return`${J}${t}`}const un=ie("api"),mt=ie("sse");function or(e){const t={};if(!e)return t;if(e instanceof Headers)return e.forEach((n,r)=>{t[r]=n}),t;if(Array.isArray(e)){for(const[n,r]of e)t[n]=r;return t}return{...e}}function Z(e,t){if(t){un.info(e,t);return}un.info(e)}async function y(e,t){const n=J?new URL(e,J).toString():e,r=or(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);try{const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const c=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return Z(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw Z(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function ii(e,t){const n=J?new URL(e,J).toString():e,r=or(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!r["Content-Type"]&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const V={fetchWorkspaces(){return y("/api/workspaces")},fetchWorktrees(e){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees`,{method:"POST",body:JSON.stringify(t)})},deleteWorktree(e,t,n){const r=new URLSearchParams;n!=null&&n.force&&r.set("force","true");const o=r.toString()?`?${r.toString()}`:"";return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return y("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchServerMeta(){return y("/api/meta")},fetchAuthStatus(){return y("/api/auth/status")},setServerPassword(e){return y("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return y(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return y(`/api/workspaces/${encodeURIComponent(e)}/files?${n.toString()}`)},searchWorkspaceFiles(e,t,n){const r=t.trim();if(!r)return Promise.resolve([]);const o=new URLSearchParams({q:r});return n!=null&&n.limit&&o.set("limit",String(n.limit)),n!=null&&n.type&&o.set("type",n.type),y(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t){const n=new URLSearchParams({path:t});return y(`/api/workspaces/${encodeURIComponent(e)}/files/content?${n.toString()}`)},fetchConfigOwner(e){return y(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return y(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return y(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return y(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return y("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return y("/api/speech/capabilities")},transcribeAudio(e){return y("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return y("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return ii("/api/speech/synthesize/stream",{method:"POST",body:JSON.stringify(e),signal:t})},listFileSystem(e,t){const n=new URLSearchParams;e&&e!=="."&&n.set("path",e),(t==null?void 0:t.includeFiles)!==void 0&&n.set("includeFiles",String(t.includeFiles));const r=n.toString();return y(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return y("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readInstanceData(e){return y(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return y(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return y(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},fetchBackgroundProcessOutput(e,t,n){const r=new URLSearchParams;n!=null&&n.method&&r.set("method",n.method),n!=null&&n.pattern&&r.set("pattern",n.pattern),n!=null&&n.lines&&r.set("lines",String(n.lines)),(n==null?void 0:n.maxBytes)!==void 0&&r.set("maxBytes",String(n.maxBytes));const o=r.toString(),s=o?`?${o}`:"";return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t){mt.info(`Connecting to ${ln}`);const n=new EventSource(ln,{withCredentials:!0});return n.onmessage=r=>{try{const o=JSON.parse(r.data);e(o)}catch(o){mt.error("Failed to parse event",o)}},n.onerror=()=>{mt.warn("EventSource error, closing stream"),t==null||t()},n}},dn=1e3,ai=1e4,fn=ie("sse");function je(e,t){if(t){fn.info(e,t);return}fn.info(e)}class ci{constructor(){this.handlers=new Map,this.source=null,this.retryDelay=dn,this.connect()}connect(){this.source&&this.source.close(),je("Connecting to backend events stream"),this.source=V.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect()),this.source.onopen=()=>{je("Events stream connected"),this.retryDelay=dn}}scheduleReconnect(){this.source&&(this.source.close(),this.source=null),je("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),setTimeout(()=>{this.retryDelay=Math.min(this.retryDelay*2,ai),this.connect()},this.retryDelay)}dispatch(t){var n,r;je(`event ${t.type}`),(n=this.handlers.get("*"))==null||n.forEach(o=>o(t)),(r=this.handlers.get(t.type))==null||r.forEach(o=>o(t))}on(t,n){this.handlers.has(t)||this.handlers.set(t,new Set);const r=this.handlers.get(t);return r.add(n),()=>r.delete(n)}}const yt=new ci,li=ie("actions"),hn={messageHistory:[],agentModelSelections:{}};function gn(e,t){if(e===t)return!0;if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null)try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){li.warn("Failed to compare config objects",n)}return!1}class ui{constructor(){this.configOwnerCache=new Map,this.stateOwnerCache=new Map,this.configOwnerLoadPromises=new Map,this.stateOwnerLoadPromises=new Map,this.configOwnerListeners=new Map,this.stateOwnerListeners=new Map,this.instanceDataCache=new Map,this.instanceDataListeners=new Map,this.instanceLoadPromises=new Map,yt.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),yt.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),yt.on("instance.dataChanged",t=>{t.type==="instance.dataChanged"&&this.setInstanceDataCache(t.instanceId,t.data)})}async loadConfigOwner(t){const n=this.configOwnerCache.get(t);if(n)return n;if(!this.configOwnerLoadPromises.has(t)){const r=V.fetchConfigOwner(t).then(o=>(this.setOwnerCache("config",t,o),o)).finally(()=>{this.configOwnerLoadPromises.delete(t)});this.configOwnerLoadPromises.set(t,r)}return this.configOwnerLoadPromises.get(t)}async patchConfigOwner(t,n){const r=await V.patchConfigOwner(t,n);return this.setOwnerCache("config",t,r),r}async loadStateOwner(t){const n=this.stateOwnerCache.get(t);if(n)return n;if(!this.stateOwnerLoadPromises.has(t)){const r=V.fetchStateOwner(t).then(o=>(this.setOwnerCache("state",t,o),o)).finally(()=>{this.stateOwnerLoadPromises.delete(t)});this.stateOwnerLoadPromises.set(t,r)}return this.stateOwnerLoadPromises.get(t)}async patchStateOwner(t,n){const r=await V.patchStateOwner(t,n);return this.setOwnerCache("state",t,r),r}async loadInstanceData(t){const n=this.instanceDataCache.get(t);if(n)return n;if(!this.instanceLoadPromises.has(t)){const r=V.readInstanceData(t).then(o=>{const s=this.normalizeInstanceData(o);return this.setInstanceDataCache(t,s),s}).finally(()=>{this.instanceLoadPromises.delete(t)});this.instanceLoadPromises.set(t,r)}return this.instanceLoadPromises.get(t)}async saveInstanceData(t,n){const r=this.normalizeInstanceData(n);await V.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await V.deleteInstanceData(t),this.setInstanceDataCache(t,hn)}onConfigOwnerChanged(t,n){this.configOwnerListeners.has(t)||this.configOwnerListeners.set(t,new Set);const r=this.configOwnerListeners.get(t);r.add(n);const o=this.configOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.configOwnerListeners.delete(t)}}onStateOwnerChanged(t,n){this.stateOwnerListeners.has(t)||this.stateOwnerListeners.set(t,new Set);const r=this.stateOwnerListeners.get(t);r.add(n);const o=this.stateOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.stateOwnerListeners.delete(t)}}onInstanceDataChanged(t,n){this.instanceDataListeners.has(t)||this.instanceDataListeners.set(t,new Set);const r=this.instanceDataListeners.get(t);r.add(n);const o=this.instanceDataCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.instanceDataListeners.delete(t)}}setOwnerCache(t,n,r){if(n==="*"){t==="config"?this.configOwnerCache.clear():this.stateOwnerCache.clear();return}const o=t==="config"?this.configOwnerCache:this.stateOwnerCache,s=t==="config"?this.configOwnerListeners:this.stateOwnerListeners,i=o.get(n);if(i&&gn(i,r)){o.set(n,r);return}o.set(n,r);const a=s.get(n);if(a)for(const c of a)c(r)}normalizeInstanceData(t){const n=t??hn,r=Array.isArray(n.messageHistory)?[...n.messageHistory]:[],o={...n.agentModelSelections??{}};return{...n,messageHistory:r,agentModelSelections:o}}setInstanceDataCache(t,n){const r=this.normalizeInstanceData(n),o=this.instanceDataCache.get(t);if(o&&gn(o,r)){this.instanceDataCache.set(t,r);return}this.instanceDataCache.set(t,r),this.notifyInstanceDataChanged(t,r)}notifyInstanceDataChanged(t,n){const r=this.instanceDataListeners.get(t);if(r)for(const o of r)o(n)}}const N=new ui,sr=ie("api"),it={messageHistory:[],agentModelSelections:{}},[jt,ir]=v(new Map),_e=new Map,Se=new Map;function ar(e){const t=e??it;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function pn(e){if(Se.has(e))return;const t=N.onInstanceDataChanged(e,n=>{Xe(e,n)});Se.set(e,t)}function di(e){const t=Se.get(e);t&&(t(),Se.delete(e))}function Xe(e,t){ir(n=>{const r=new Map(n);return r.set(e,ar(t)),r})}async function at(e){if(!e||jt().has(e))return;if(_e.has(e)){await _e.get(e);return}const t=N.loadInstanceData(e).then(n=>{Xe(e,n),pn(e)}).catch(n=>{sr.warn("Failed to load instance data",n),Xe(e,it),pn(e)}).finally(()=>{_e.delete(e)});_e.set(e,t),await t}async function cr(e,t){if(!e)return;await at(e);const n=jt().get(e)??it,r=ar(n);t(r);try{await N.saveInstanceData(e,r)}catch(o){sr.warn("Failed to persist instance data",o)}Xe(e,r)}function lr(e){return jt().get(e)??it}function fi(e){ir(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),di(e)}const hi=Oe(),gi={getInstanceConfig:lr,ensureInstanceConfig:at,updateInstanceConfig:cr,clearInstanceConfig:fi},oc=e=>(be(()=>{for(const t of Se.values())t();Se.clear()}),te(hi.Provider,{value:gi,get children(){return e.children}})),pi=ie("api"),[mn,Tt]=v(null),[sc,yn]=v(!1),[ic,Ke]=v(null);let ke=null;async function mi(e=!1){return!e&&mn()?mn():ke||(yn(!0),Ke(null),ke=V.fetchSpeechCapabilities().then(t=>(Tt(t),Ke(null),t)).catch(t=>(pi.error("Failed to load speech capabilities",t),Tt(null),Ke(t instanceof Error?t.message:String(t)),null)).finally(()=>{yn(!1),ke=null}),ke)}function yi(){Tt(null),Ke(null)}const C=ie("actions"),bi=20,wi=5,Ci=50,S={showThinkingBlocks:!1,showKeyboardShortcutHints:!0,thinkingBlocksExpansion:"expanded",showTimelineTools:!0,promptSubmitOnEnter:!1,showPromptVoiceInput:!0,diffViewMode:"split",toolOutputExpansion:"expanded",diagnosticsExpansion:"expanded",toolInputsVisibility:"collapsed",showUsageMetrics:!0,autoCleanupBlankSessions:!0,osNotificationsEnabled:!1,osNotificationsAllowWhenVisible:!1,notifyOnNeedsInput:!0,notifyOnIdle:!0},le={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function ur(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??S.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??S.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??S.thinkingBlocksExpansion,showTimelineTools:t.showTimelineTools??S.showTimelineTools,promptSubmitOnEnter:t.promptSubmitOnEnter??S.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??S.showPromptVoiceInput,locale:t.locale??S.locale,diffViewMode:t.diffViewMode??S.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??S.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??S.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:S.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??S.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??S.autoCleanupBlankSessions,osNotificationsEnabled:t.osNotificationsEnabled??S.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??S.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??S.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??S.notifyOnIdle}}function dr(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return t}function fr(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:le.provider,apiKey:typeof t.apiKey=="string"&&t.apiKey.trim()?t.apiKey.trim():void 0,hasApiKey:t.hasApiKey===!0||typeof t.apiKey=="string"&&t.apiKey.trim().length>0,baseUrl:typeof t.baseUrl=="string"&&t.baseUrl.trim()?t.baseUrl.trim():void 0,sttModel:typeof t.sttModel=="string"&&t.sttModel.trim()?t.sttModel.trim():le.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():le.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():le.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:le.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:le.ttsFormat}}function Ue(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){const o=t(r);o&&n.push(o)}return n}function Si(e){var n,r,o;const t=e??{};return{recentFolders:Ue(t.recentFolders,s=>{if(!s||typeof s!="object")return null;const i=s.path,a=s.lastAccessed;if(typeof i!="string")return null;const c=typeof a=="number"?a:Date.now();return{path:i,lastAccessed:c}}),opencodeBinaries:Ue(t.opencodeBinaries,s=>{if(!s||typeof s!="object")return null;const i=s.path;if(typeof i!="string")return null;const a=typeof s.lastUsed=="number"?s.lastUsed:Date.now(),c=typeof s.version=="string"?s.version:void 0,u=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:u,lastUsed:a}}),models:{recents:Ue((n=t.models)==null?void 0:n.recents,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),favorites:Ue((r=t.models)==null?void 0:r.favorites,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),thinkingSelections:dr((o=t.models)==null?void 0:o.thinkingSelections)}}}function Oi(e){const t=e??{},n=t.listeningMode==="all"?"all":"local",r=typeof t.opencodeBinary=="string"&&t.opencodeBinary.trim()?t.opencodeBinary:"opencode",o=dr(t.environmentVariables),s=fr(t.speech);return{listeningMode:n,opencodeBinary:r,environmentVariables:o,speech:s}}function hr(e){return`${e.providerId}/${e.modelId}`}function gr(e,t){const n=t.filter(r=>r.path!==e);return n.unshift({path:e,lastAccessed:Date.now()}),n.slice(0,bi)}function _t(e,t,n){const r=Date.now(),o=n.find(i=>i.path===e);if(o){const i={...o,lastUsed:r,version:t??o.version},a=n.filter(c=>c.path!==e);return[i,...a]}return[t?{path:e,version:t,lastUsed:r}:{path:e,lastUsed:r},...n].slice(0,10)}const[Ut,Ye]=v({}),[xi,Ze]=v({}),[ki,Qe]=v({}),[pr,Te]=v(!1),vi=$(()=>ur(Ut().settings)),mr=$(()=>Ut().theme??"system"),ae=$(()=>Oi(xi())),W=$(()=>Si(ki())),M=vi,ct=$(()=>W().recentFolders),Be=$(()=>W().opencodeBinaries);let Ve=null;async function lt(){pr()||(Ve||(Ve=Promise.all([N.loadConfigOwner("ui"),N.loadConfigOwner("server"),N.loadStateOwner("ui")]).then(([e,t,n])=>{Ye(e),Ze(t),Qe(n),Te(!0)}).catch(e=>{C.error("Failed to load settings",e),Ye({}),Ze({}),Qe({}),Te(!0)}).finally(()=>{Ve=null})),await Ve)}async function X(e,t){await lt();const n=await N.patchConfigOwner(e,t);e==="ui"&&Ye(n),e==="server"&&Ze(n)}async function K(e,t){await lt();const n=await N.patchStateOwner(e,t);Qe(n)}function D(e){const t=Ut(),r={settings:ur({...t.settings??{},...e})};X("ui",r).catch(o=>C.error("Failed to patch ui settings",o))}function yr(e){D(e)}function $i(e){mr()!==e&&X("ui",{theme:e}).catch(t=>C.error("Failed to set theme",t))}async function Ai(e){ae().listeningMode!==e&&await X("server",{listeningMode:e})}function Vt(e){X("server",{environmentVariables:e}).catch(t=>C.error("Failed to update environment variables",t))}function Ei(e,t){const n=ae().environmentVariables;Vt({...n,[e]:t})}function Ti(e){const t=ae().environmentVariables,{[e]:n,...r}=t;Vt(r)}function Pi(e){const t=e&&e.trim().length>0?e:"opencode";X("server",{opencodeBinary:t}).catch(r=>C.error("Failed to set default binary",r));const n=_t(t,void 0,Be());K("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to update binary list",r))}async function Mi(e){const t=e.apiKey,{apiKey:n,...r}=e,o=fr({...ae().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await X("server",{speech:a})}catch(c){throw C.error("Failed to update speech settings",c),c}}function Ii(e,t){const n=_t(e,t,Be());K("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to add binary",r))}function Fi(e){const t=Be().filter(n=>n.path!==e);K("ui",{opencodeBinaries:t}).catch(n=>C.error("Failed to remove binary",n)),ae().opencodeBinary===e&&X("server",{opencodeBinary:"opencode"}).catch(n=>C.error("Failed to reset default binary",n))}function Di(e){const t=gr(e,ct());K("ui",{recentFolders:t}).catch(n=>C.error("Failed to add recent folder",n))}function Li(e){const t=ct().filter(n=>n.path!==e);K("ui",{recentFolders:t}).catch(n=>C.error("Failed to remove recent folder",n))}function Bi(e,t){const n=t&&t.trim().length>0?t:ae().opencodeBinary,r=gr(e,ct()),o=_t(n,void 0,Be());K("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>C.error("Failed to update ui state on launch",s)),X("server",{opencodeBinary:n}).catch(s=>C.error("Failed to persist selected binary",s))}function Ni(e){if(!e.providerId||!e.modelId)return;const n=W().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,wi);K("ui",{models:{recents:r}}).catch(o=>C.error("Failed to update model recents",o))}function Ri(e){return!e.providerId||!e.modelId?!1:W().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function ji(e){if(!e.providerId||!e.modelId)return;const t=W().models.favorites,r=t.some(o=>o.providerId===e.providerId&&o.modelId===e.modelId)?t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId):[e,...t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId)].slice(0,Ci);K("ui",{models:{favorites:r}}).catch(o=>C.error("Failed to update model favorites",o))}function _i(e){if(!(!e.providerId||!e.modelId))return W().models.thinkingSelections[hr(e)]}function Ui(e,t){if(!e.providerId||!e.modelId)return;const n=hr(e);if(W().models.thinkingSelections[n]===t)return;const o={...W().models.thinkingSelections};t?o[n]=t:delete o[n],K("ui",{models:{thinkingSelections:o}}).catch(s=>C.error("Failed to update thinking selection",s))}function Vi(e){M().diffViewMode!==e&&D({diffViewMode:e})}function zi(e){M().toolOutputExpansion!==e&&D({toolOutputExpansion:e})}function Wi(e){M().diagnosticsExpansion!==e&&D({diagnosticsExpansion:e})}function Ki(e){M().toolInputsVisibility!==e&&D({toolInputsVisibility:e})}function Hi(e){M().thinkingBlocksExpansion!==e&&D({thinkingBlocksExpansion:e})}function Gi(){D({showThinkingBlocks:!M().showThinkingBlocks})}function qi(){yr({showKeyboardShortcutHints:!M().showKeyboardShortcutHints})}function Ji(){D({showTimelineTools:!M().showTimelineTools})}function Xi(){D({showUsageMetrics:!M().showUsageMetrics})}function Yi(){D({promptSubmitOnEnter:!M().promptSubmitOnEnter})}function Zi(){D({showPromptVoiceInput:!M().showPromptVoiceInput})}function Qi(){const e=!M().autoCleanupBlankSessions;C.info("toggle auto cleanup",{value:e}),D({autoCleanupBlankSessions:e})}async function ea(e,t,n){!e||!t||!n.providerId||!n.modelId||(await at(e),await cr(e,r=>{const o={...r.agentModelSelections??{}},s=o[t];s&&s.providerId===n.providerId&&s.modelId===n.modelId||(o[t]=n,r.agentModelSelections=o)}))}async function ta(e,t){return!e||!t?void 0:(await at(e),(lr(e).agentModelSelections??{})[t])}lt().catch(e=>{C.error("Failed to initialize settings",e)});const br=Oe(),na={isLoaded:pr,preferences:M,updatePreferences:yr,themePreference:mr,setThemePreference:$i,serverSettings:ae,setListeningMode:Ai,updateEnvironmentVariables:Vt,addEnvironmentVariable:Ei,removeEnvironmentVariable:Ti,updateLastUsedBinary:Pi,updateSpeechSettings:Mi,recentFolders:ct,opencodeBinaries:Be,uiState:W,addRecentFolder:Di,removeRecentFolder:Li,addOpenCodeBinary:Ii,removeOpenCodeBinary:Fi,recordWorkspaceLaunch:Bi,addRecentModelPreference:Ni,isFavoriteModelPreference:Ri,toggleFavoriteModelPreference:ji,getModelThinkingSelection:_i,setModelThinkingSelection:Ui,toggleShowThinkingBlocks:Gi,toggleKeyboardShortcutHints:qi,toggleShowTimelineTools:Ji,toggleUsageMetrics:Xi,toggleAutoCleanupBlankSessions:Qi,togglePromptSubmitOnEnter:Yi,toggleShowPromptVoiceInput:Zi,setDiffViewMode:Vi,setToolOutputExpansion:zi,setDiagnosticsExpansion:Wi,setThinkingBlocksExpansion:Hi,setToolInputsVisibility:Ki,setAgentModelPreference:ea,getAgentModelPreference:ta},ac=e=>(tt(()=>{lt().catch(o=>{C.error("Failed to initialize settings",o)});const t=N.onConfigOwnerChanged("ui",o=>{Ye(o),Te(!0)}),n=N.onConfigOwnerChanged("server",o=>{Ze(o),Te(!0),yi(),mi(!0)}),r=N.onStateOwnerChanged("ui",o=>{Qe(o),Te(!0)});return()=>{t(),n(),r()}}),te(br.Provider,{value:na,get children(){return e.children}}));function ra(){const e=Fe(br);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function oa(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>(i&&(n&&n[i]&&s.push(n[i]),s.push(t(i))),s),[]).join(" ")}),r}const sa=Symbol("solid-inspect"),ia=Oe();function aa(e){function t(n){var r;return(r=Fe(ia))!=null&&r.enabled?{Component:t,props:n,$INSPECT:sa}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function wr(){return function(e){function t(a){const c=!!e.slotClasses,u=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return oa(e.slotClasses(a),e.utilityClass,a.classes??"")},l=lo({});return c&&Fr(()=>{const d=u();fe(()=>{for(const f in d)l[f]=d[f]})}),l}function n(a){const[c,u]=et(a,e.selfPropNames);return{allProps:a,props:c,otherProps:u}}function r(a){return Qo({propDefaults:a.propDefaults||e.propDefaults,props:a.props,name:e.name})}function o(a){const c=r({props:a});return n(c)}function s(a,c=!0){return a=aa(a),a.toString=()=>`.${e.name}-root`,c&&nr(a,"base"),a}function i(a){const c=s(function(l){const{allProps:d,otherProps:f,props:g}=o(l),p=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:f,props:g,classes:p})});return Object.defineProperty(c,"name",{value:a.name}),c}return{name:e.name,selfPropNames:e.selfPropNames,component:i,defineComponent:s,useClasses:t,useThemeProps:r,useProps:o,splitInProps:n}}}const ca=wr()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),la=ca.component(function({props:t}){return Xn(()=>({"@global":t.styles||{}})),[]}),ua=wr()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),da=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),fa=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),ha=(e,t=!1)=>({html:da(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...fa(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),ga=ua.component(function({props:t}){const n=Un();return te(la,{get styles(){return ha(n,t.enableColorScheme)}})}),Cr=Oe();function bn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const pa={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},ma={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},Y=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},ya=e=>{const t=e?ma:pa,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:Y("--surface-base",t.backgroundDefault,n),backgroundPaper:Y("--surface-secondary",t.backgroundPaper,n),primary:Y("--accent-primary",t.primary,n),primaryContrast:Y("--text-inverted",t.primaryContrast,n),textPrimary:Y("--text-primary",t.textPrimary,n),textSecondary:Y("--text-secondary",t.textSecondary,n),divider:Y("--border-base",t.divider,n)}};function cc(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=ra(),[o,s]=v(!0),[i,a]=v(0),c=()=>n(),u=()=>{const p=c();return p==="dark"?!0:p==="light"?!1:(t==null?void 0:t.matches)??!1},l=()=>{const p=c(),b=u();bn(p==="system"?"system":p),s(b),typeof window<"u"?requestAnimationFrame(()=>a(m=>m+1)):a(m=>m+1)};ee(()=>{l()}),tt(()=>{if(!t)return;const p=()=>{l()};return t.addEventListener("change",p),()=>{t.removeEventListener("change",p)}});const d=p=>{r(p)},f=()=>{const p=c();d(p==="system"?"light":p==="light"?"dark":"system")},g=$(()=>{i();const p=ya(o());return Rn({palette:{mode:o()?"dark":"light",primary:{main:p.primary,contrastText:p.primaryContrast},secondary:{main:p.primary},background:{default:p.backgroundDefault,paper:p.backgroundPaper},text:{primary:p.textPrimary,secondary:p.textSecondary},divider:p.divider},typography:{fontFamily:"var(--font-family-sans)"},shape:{borderRadius:8},components:{MuiIconButton:{styleOverrides:{root:{color:"inherit","&.Mui-disabled":{color:"var(--text-muted)",opacity:.55}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)",boxShadow:"none",borderBottom:"1px solid var(--border-base)",zIndex:10}}},MuiToolbar:{styleOverrides:{root:{minHeight:"56px"}}}}})});return te(Cr.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:f},get children(){return te(es,{get theme(){return g()},get children(){return[te(ga,{}),zr(()=>e.children)]}})}})}function Sr(){const e=Fe(Cr);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const ba="0.52.2",Pt=`https://cdn.jsdelivr.net/npm/monaco-editor@${ba}/min/vs`,B="/monaco/vs";let ze=null;function wa(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),n(s)}).catch(s=>{clearTimeout(o),r(s)})})}async function Ca(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${Pt}/loader.js`,{method:"HEAD",signal:e.signal}),n=await wa(t,1200);return e.abort(),n.ok}catch{return!1}}function Sa(){return typeof document>"u"||document.querySelector('script[data-monaco-loader="true"]')?Promise.resolve():new Promise((t,n)=>{const r=document.createElement("script");r.dataset.monacoLoader="true",r.src=`${B}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function Oa(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${B}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function xa(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Or(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function ka(){const t=Or().config;if(!t)throw new Error("require.config is not available");return t}function Mt(e){const t=Or();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function va(e){const t=String(e||"plaintext");return!t||t==="plaintext"?null:t==="typescript"||t==="javascript"?"vs/language/typescript/monaco.contribution":t==="json"?"vs/language/json/monaco.contribution":t==="css"||t==="scss"||t==="less"?"vs/language/css/monaco.contribution":t==="html"?"vs/language/html/monaco.contribution":t==="toml"?"vs/basic-languages/toml/toml":`vs/basic-languages/${t}/${t}`}const wn=new Set,bt=new Map;async function xr(e){const t=va(e);if(!t||wn.has(t))return;const n=bt.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await Mt([t]),o=!0}catch{}finally{o&&wn.add(t),bt.delete(t)}})();return bt.set(t,r),r}async function kr(){return ze||(ze=(async()=>{await Sa(),xa(),Oa();const e=await Ca(),t=ka(),n={vs:B};e&&(n["vs/basic-languages"]=`${Pt}/basic-languages`,n["vs/language"]=`${Pt}/language`,n["vs/basic-languages/python"]=`${B}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${B}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${B}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${B}/basic-languages/kotlin`,n["vs/language/typescript"]=`${B}/language/typescript`,n["vs/language/html"]=`${B}/language/html`,n["vs/language/json"]=`${B}/language/json`,n["vs/language/css"]=`${B}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await Mt(["vs/editor/editor.main"]);return await Mt(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),ze)}const $a=5,q=new Map;function Aa(e,t){q.delete(e),q.set(e,t)}function Ea(){for(;q.size>$a;){const e=q.keys().next().value;if(!e)return;const t=q.get(e);q.delete(e);try{t==null||t.model.dispose()}catch{}}}function It(e){const t=q.get(e.cacheKey);if(t)return Aa(e.cacheKey,t),t.model.getValue()!==e.value&&t.model.setValue(e.value),t.model;const n=e.monaco.Uri.parse(`opencode://model/${encodeURIComponent(e.cacheKey)}`),r=e.monaco.editor.createModel(e.value,"plaintext",n),o={model:r};return q.set(e.cacheKey,o),Ea(),r}let We=null;function Ta(e){var o;if(We)return We;const t=new Map,n=new Map,r=typeof((o=e==null?void 0:e.languages)==null?void 0:o.getLanguages)=="function"?e.languages.getLanguages():[];if(Array.isArray(r))for(const s of r){const i=typeof(s==null?void 0:s.id)=="string"?s.id:null;if(!i)continue;const a=Array.isArray(s==null?void 0:s.filenames)?s.filenames:[];for(const u of a)typeof u=="string"&&(t.has(u)||t.set(u,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const u of c)typeof u=="string"&&(n.has(u)||n.set(u,i))}return We={fileNameToId:t,extToId:n},We}function Pa(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function vr(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=Pa(r);if(o)return o;const s=Ta(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),u=s.extToId.get(c);if(u)return u}return"plaintext"}var Ma=kn("<div class=monaco-viewer>");function Ia(e){const{isDark:t}=Sr();let n,r=null,o=null;const[s,i]=v(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null};return tt(()=>{let c=!1;(async()=>(o=await kr(),!c&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.createDiffEditor(n,{readOnly:!0,automaticLayout:!0,renderSideBySide:!0,renderSideBySideInlineBreakpoint:0,renderMarginRevertIcon:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,renderWhitespace:"selection",fontSize:13,wordWrap:e.wordWrap==="on"?"on":"off",glyphMargin:!1,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),i(!0)))))(),be(()=>{c=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{var d,f,g,p,b,m;if(!s()||!o||!r)return;const c=e.viewMode==="unified"?"unified":"split",u=e.contextMode==="collapsed"?"collapsed":"expanded",l=e.wordWrap==="on"?"on":"off";r.updateOptions({renderSideBySide:c==="split",renderSideBySideInlineBreakpoint:0,hideUnchangedRegions:u==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:l});try{(g=(f=(d=r.getOriginalEditor)==null?void 0:d.call(r))==null?void 0:f.updateOptions)==null||g.call(f,{wordWrap:l})}catch{}try{(m=(b=(p=r.getModifiedEditor)==null?void 0:p.call(r))==null?void 0:b.updateOptions)==null||m.call(b,{wordWrap:l})}catch{}}),ee(()=>{if(!s()||!o||!r)return;const c=vr(o,e.path),u=`${e.scopeKey}:diff:${e.path}:before`,l=`${e.scopeKey}:diff:${e.path}:after`,d=It({monaco:o,cacheKey:u,value:e.before}),f=It({monaco:o,cacheKey:l,value:e.after});r.setModel({original:d,modified:f}),xr(c).then(()=>{try{o.editor.setModelLanguage(d,c),o.editor.setModelLanguage(f,c)}catch{}})}),(()=>{var c=Ma(),u=n;return typeof u=="function"?Ft(u,c):n=c,c})()}const lc=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:Ia},Symbol.toStringTag,{value:"Module"}));var Fa=kn("<div class=monaco-viewer>");function Da(e){const{isDark:t}=Sr();let n,r=null,o=null;const[s,i]=v(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null};return tt(()=>{let c=!1;(async()=>(o=await kr(),!c&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.create(n,{value:"",language:"plaintext",readOnly:!0,automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"off",renderWhitespace:"selection",fontSize:13}),i(!0)))))(),be(()=>{c=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{if(!s()||!o||!r)return;const c=vr(o,e.path),u=`${e.scopeKey}:file:${e.path}`,l=It({monaco:o,cacheKey:u,value:e.content});r.setModel(l),xr(c).then(()=>{try{o.editor.setModelLanguage(l,c)}catch{}})}),(()=>{var c=Fa(),u=n;return typeof u=="function"?Ft(u,c):n=c,c})()}const uc=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:Da},Symbol.toStringTag,{value:"Module"}));export{rc as $,_i as A,M as B,nc as C,Va as D,at as E,tc as F,Ha as G,wr as H,Rs as I,qa as J,Qa as K,Us as L,tr as M,Ga as N,Xa as O,Ua as P,hs as Q,Ya as R,Ja as S,ec as T,lo as U,Za as V,po as W,go as X,Sr as Y,lr as Z,cr as _,qr as a,ji as a0,Ui as a1,Ai as a2,sc as a3,ic as a4,N as a5,ja as a6,oc as a7,cc as a8,ac as a9,lc as aa,uc as ab,vn as b,za as c,wt as d,Un as e,Kr as f,_a as g,V as h,Ct as i,Jr as j,ie as k,ra as l,zr as m,yt as n,ta as o,Ka as p,W as q,Wa as r,Yr as s,kn as t,Ft as u,mi as v,mn as w,ae as x,ea as y,Ni as z};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-viewer-D9gxUZHP.js","assets/monaco-viewer-BSBw02bx.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css","assets/main-DnH_qzWG.js","assets/index-CHPcUby9.js","assets/index-ENvu-xYE.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as V,i as $,a as Se,d as x,j as Ve,u as Le,m as je,f as pt,l as Ms,Y as Ds,k as js}from"./monaco-viewer-BSBw02bx.js";import{n as E,m as on,c as I,S as z,F as Ye,a as oe,d as ce,b as ve,u as Rs,A as Bs,z as Vs,t as Fs,o as ft}from"./git-diff-vendor-CAv-4upN.js";import{I as ln,r as X,f as an,i as We,a as Lt,b as cn,e as Ie,g as ee,c as Un,d as Fe,h as Jn,j as un,m as Qn,k as xs,l as Ks,n as qs,o as zn,p as Us,q as Js,s as Yn,t as Wt,u as Qs,v as Ht,w as zs,x as Ys,M as Ws,y as Hs,z as Gs,A as Xs,C as Zs,S as ei,B as ti,L as ni,D as si,E as ii,F as ri,G as oi,H as li}from"./main-DnH_qzWG.js";import{t as we,e as ai,u as fn,_ as ci}from"./index-CHPcUby9.js";import{t as en}from"./todo-BbZMcvOc.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const ui=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}]],fi=e=>E(ln,on(e,{name:"ArrowRightSquare",iconNode:ui})),di=[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]],gi=e=>E(ln,on(e,{name:"Hourglass",iconNode:di})),hi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],mi=e=>E(ln,on(e,{name:"XCircle",iconNode:hi})),dn=Symbol.for("yaml.alias"),tn=Symbol.for("yaml.document"),qe=Symbol.for("yaml.map"),Wn=Symbol.for("yaml.pair"),Mt=Symbol.for("yaml.scalar"),it=Symbol.for("yaml.seq"),_e=Symbol.for("yaml.node.type"),He=e=>!!e&&typeof e=="object"&&e[_e]===dn,vt=e=>!!e&&typeof e=="object"&&e[_e]===tn,$t=e=>!!e&&typeof e=="object"&&e[_e]===qe,le=e=>!!e&&typeof e=="object"&&e[_e]===Wn,Z=e=>!!e&&typeof e=="object"&&e[_e]===Mt,St=e=>!!e&&typeof e=="object"&&e[_e]===it;function te(e){if(e&&typeof e=="object")switch(e[_e]){case qe:case it:return!0}return!1}function ne(e){if(e&&typeof e=="object")switch(e[_e]){case dn:case qe:case Mt:case it:return!0}return!1}const Hn=e=>(Z(e)||te(e))&&!!e.anchor,Je=Symbol("break visit"),yi=Symbol("skip children"),mt=Symbol("remove node");function rt(e,t){const n=bi(t);vt(e)?Xe(null,e.contents,n,Object.freeze([e]))===mt&&(e.contents=null):Xe(null,e,n,Object.freeze([]))}rt.BREAK=Je;rt.SKIP=yi;rt.REMOVE=mt;function Xe(e,t,n,s){const i=pi(e,t,n,s);if(ne(i)||le(i))return vi(e,s,i),Xe(e,i,n,s);if(typeof i!="symbol"){if(te(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){const o=Xe(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===Je)return Je;o===mt&&(t.items.splice(r,1),r-=1)}}}else if(le(t)){s=Object.freeze(s.concat(t));const r=Xe("key",t.key,n,s);if(r===Je)return Je;r===mt&&(t.key=null);const o=Xe("value",t.value,n,s);if(o===Je)return Je;o===mt&&(t.value=null)}}return i}function bi(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function pi(e,t,n,s){var i,r,o,a,c;if(typeof n=="function")return n(e,t,s);if($t(t))return(i=n.Map)==null?void 0:i.call(n,e,t,s);if(St(t))return(r=n.Seq)==null?void 0:r.call(n,e,t,s);if(le(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(Z(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,s);if(He(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function vi(e,t,n){const s=t[t.length-1];if(te(s))s.items[e]=n;else if(le(s))e==="key"?s.key=n:s.value=n;else if(vt(s))s.contents=n;else{const i=He(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const $i={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Si=e=>e.replace(/[!,[\]{}]/g,t=>$i[t]);class be{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},be.defaultYaml,t),this.tags=Object.assign({},be.defaultTags,n)}clone(){const t=new be(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new be(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:be.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},be.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:be.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},be.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+Si(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(t&&s.length>0&&ne(t.contents)){const r={};rt(t.contents,(o,a)=>{ne(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
|
|
3
|
-
`)}}be.defaultYaml={explicit:!1,version:"1.2"};be.defaultTags={"!!":"tag:yaml.org,2002:"};function Gn(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Xn(e){const t=new Set;return rt(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Zn(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function wi(e,t){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=Xn(e));const o=Zn(t,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(Z(o.node)||te(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function Ze(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],a=Ze(e,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=Ze(e,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=Ze(e,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=Ze(e,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return e.call(t,n,s)}function Ce(e,t,n){if(Array.isArray(e))return e.map((s,i)=>Ce(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Hn(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class gn{constructor(t){Object.defineProperty(this,_e,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!vt(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Ce(this,"",o);if(typeof i=="function")for(const{count:c,res:u}of o.anchors.values())i(u,c);return typeof r=="function"?Ze(r,{"":a},"",a):a}}class es extends gn{constructor(t){super(dn),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],rt(t,{Node:(r,o)=>{(He(o)||Hn(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=s.get(o);if(a||(Ce(o,null,n),a=s.get(o)),(a==null?void 0:a.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=It(i,o,s)),a.count*a.aliasCount>r)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,s){const i=`*${this.source}`;if(t){if(Gn(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function It(e,t,n){if(He(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(te(t)){let s=0;for(const i of t.items){const r=It(e,i,n);r>s&&(s=r)}return s}else if(le(t)){const s=It(e,t.key,n),i=It(e,t.value,n);return Math.max(s,i)}return 1}const ts=e=>!e||typeof e!="function"&&typeof e!="object";class K extends gn{constructor(t){super(Mt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ce(this.value,t,n)}toString(){return String(this.value)}}K.BLOCK_FOLDED="BLOCK_FOLDED";K.BLOCK_LITERAL="BLOCK_LITERAL";K.PLAIN="PLAIN";K.QUOTE_DOUBLE="QUOTE_DOUBLE";K.QUOTE_SINGLE="QUOTE_SINGLE";const Ci="tag:yaml.org,2002:";function ki(e,t,n){if(t){const s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,e))&&!s.format})}function bt(e,t,n){var m,b,S;if(vt(e)&&(e=e.contents),ne(e))return e;if(le(e)){const h=(b=(m=n.schema[qe]).createNode)==null?void 0:b.call(m,n.schema,null,n);return h.items.push(e),h}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let c;if(s&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new es(c.anchor);c={anchor:null,node:null},a.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Ci+t.slice(2));let u=ki(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const h=new K(e);return c&&(c.node=h),h}u=e instanceof Map?o[qe]:Symbol.iterator in Object(e)?o[it]:o[qe]}r&&(r(u),delete n.onTagObj);const y=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((S=u==null?void 0:u.nodeClass)==null?void 0:S.from)=="function"?u.nodeClass.from(n.schema,e,n):new K(e);return t?y.tag=t:u.default||(y.tag=u.tag),c&&(c.node=y),y}function Et(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return bt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const gt=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class ns extends gn{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>ne(s)||le(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gt(t))this.add(n);else{const[s,...i]=t,r=this.get(s,!0);if(te(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,Et(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(te(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&Z(r)?r.value:r:te(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!le(n))return!1;const s=n.value;return s==null||t&&Z(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const i=this.get(n,!0);return te(i)?i.hasIn(s):!1}setIn(t,n){const[s,...i]=t;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(te(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,Et(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const _i=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Re(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Qe=(e,t,n)=>e.endsWith(`
|
|
4
|
-
`)?Re(n,t):n.includes(`
|
|
5
|
-
`)?`
|
|
6
|
-
`+Re(n,t):(e.endsWith(" ")?"":" ")+n,ss="flow",nn="block",Tt="quoted";function Dt(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<r&&(r=0);const c=Math.max(1+r,1+i-t.length);if(e.length<=c)return e;const u=[],y={};let m=i-t.length;typeof s=="number"&&(s>i-Math.max(2,r)?u.push(0):m=i-s);let b,S,h=!1,f=-1,d=-1,g=-1;n===nn&&(f=Pn(e,f,t.length),f!==-1&&(m=f+c));for(let w;w=e[f+=1];){if(n===Tt&&w==="\\"){switch(d=f,e[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}g=f}if(w===`
|
|
7
|
-
`)n===nn&&(f=Pn(e,f,t.length)),m=f+t.length+c,b=void 0;else{if(w===" "&&S&&S!==" "&&S!==`
|
|
8
|
-
`&&S!==" "){const _=e[f+1];_&&_!==" "&&_!==`
|
|
9
|
-
`&&_!==" "&&(b=f)}if(f>=m)if(b)u.push(b),m=b+c,b=void 0;else if(n===Tt){for(;S===" "||S===" ";)S=w,w=e[f+=1],h=!0;const _=f>g+1?f-2:d-1;if(y[_])return e;u.push(_),y[_]=!0,m=_+c,b=void 0}else h=!0}S=w}if(h&&a&&a(),u.length===0)return e;o&&o();let p=e.slice(0,u[0]);for(let w=0;w<u.length;++w){const _=u[w],O=u[w+1]||e.length;_===0?p=`
|
|
10
|
-
${t}${e.slice(0,O)}`:(n===Tt&&y[_]&&(p+=`${e[_]}\\`),p+=`
|
|
11
|
-
${t}${e.slice(_+1,O)}`)}return p}function Pn(e,t,n){let s=t,i=t+1,r=e[i];for(;r===" "||r===" ";)if(t<i+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
|
|
12
|
-
`);s=t,i=t+1,r=e[i]}return s}const jt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Rt=e=>/^(%|---|\.\.\.)/m.test(e);function Ai(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
|
|
13
|
-
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function yt(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(Rt(e)?" ":"");let o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const y=n.substr(c+2,4);switch(y){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:y.substr(0,2)==="00"?o+="\\x"+y.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
|
|
14
|
-
|
|
15
|
-
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
16
|
-
`,c+=2;o+=r,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,s?o:Dt(o,r,Tt,jt(t,!1))}function sn(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return yt(e,t);const n=t.indent||(Rt(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
-
${n}`)+"'";return t.implicitKey?s:Dt(s,n,ss,jt(t,!1))}function et(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=yt;else{const i=e.includes('"'),r=e.includes("'");i&&!r?s=sn:r&&!i?s=yt:s=n?sn:yt}return s(e,t)}let rn;try{rn=new RegExp(`(^|(?<!
|
|
19
|
-
))
|
|
20
|
-
+(?!
|
|
21
|
-
|$)`,"g")}catch{rn=/\n+(?!\n|$)/g}function Ot({comment:e,type:t,value:n},s,i,r){const{blockQuote:o,commentString:a,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return et(n,s);const u=s.indent||(s.forceBlockIndent||Rt(n)?" ":""),y=o==="literal"?!0:o==="folded"||t===K.BLOCK_FOLDED?!1:t===K.BLOCK_LITERAL?!0:!Ai(n,c,u.length);if(!n)return y?`|
|
|
22
|
-
`:`>
|
|
23
|
-
`;let m,b;for(b=n.length;b>0;--b){const O=n[b-1];if(O!==`
|
|
24
|
-
`&&O!==" "&&O!==" ")break}let S=n.substring(b);const h=S.indexOf(`
|
|
25
|
-
`);h===-1?m="-":n===S||h!==S.length-1?(m="+",r&&r()):m="",S&&(n=n.slice(0,-S.length),S[S.length-1]===`
|
|
26
|
-
`&&(S=S.slice(0,-1)),S=S.replace(rn,`$&${u}`));let f=!1,d,g=-1;for(d=0;d<n.length;++d){const O=n[d];if(O===" ")f=!0;else if(O===`
|
|
27
|
-
`)g=d;else break}let p=n.substring(0,g<d?g+1:d);p&&(n=n.substring(p.length),p=p.replace(/\n+/g,`$&${u}`));let _=(f?u?"2":"1":"")+m;if(e&&(_+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!y){const O=n.replace(/\n+/g,`
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let P=!1;const M=jt(s,!0);o!=="folded"&&t!==K.BLOCK_FOLDED&&(M.onOverflow=()=>{P=!0});const U=Dt(`${p}${O}${S}`,u,nn,M);if(!P)return`>${_}
|
|
29
|
-
${u}${U}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_}
|
|
30
|
-
${u}${p}${n}${S}`}function Ii(e,t,n,s){const{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:y}=t;if(a&&r.includes(`
|
|
31
|
-
`)||y&&/[[\]{},]/.test(r))return et(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||y||!r.includes(`
|
|
32
|
-
`)?et(r,t):Ot(e,t,n,s);if(!a&&!y&&i!==K.PLAIN&&r.includes(`
|
|
33
|
-
`))return Ot(e,t,n,s);if(Rt(r)){if(c==="")return t.forceBlockIndent=!0,Ot(e,t,n,s);if(a&&c===u)return et(r,t)}const m=r.replace(/\n+/g,`$&
|
|
34
|
-
${c}`);if(o){const b=f=>{var d;return f.default&&f.tag!=="tag:yaml.org,2002:str"&&((d=f.test)==null?void 0:d.test(m))},{compat:S,tags:h}=t.doc.schema;if(h.some(b)||S!=null&&S.some(b))return et(r,t)}return a?m:Dt(m,c,ss,jt(t,!1))}function hn(e,t,n,s){const{implicitKey:i,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==K.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=K.QUOTE_DOUBLE);const c=y=>{switch(y){case K.BLOCK_FOLDED:case K.BLOCK_LITERAL:return i||r?et(o.value,t):Ot(o,t,n,s);case K.QUOTE_DOUBLE:return yt(o.value,t);case K.QUOTE_SINGLE:return sn(o.value,t);case K.PLAIN:return Ii(o,t,n,s);default:return null}};let u=c(a);if(u===null){const{defaultKeyType:y,defaultStringType:m}=t.options,b=i&&y||m;if(u=c(b),u===null)throw new Error(`Unsupported default string type ${b}`)}return u}function is(e,t){const n=Object.assign({blockQuote:!0,commentString:_i,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Ti(e,t){var i;if(t.tag){const r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,s;if(Z(t)){s=t.value;let r=e.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,s)});if(r.length>1){const o=r.filter(a=>a.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else s=t,n=e.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function Oi(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(Z(e)||te(e))&&e.anchor;r&&Gn(r)&&(n.add(r),i.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function st(e,t,n,s){var c;if(le(e))return e.toString(t,n,s);if(He(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=ne(e)?e:t.doc.createNode(e,{onTagObj:u=>i=u});i??(i=Ti(t.doc.schema.tags,r));const o=Oi(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,t,n,s):Z(r)?hn(r,t,n,s):r.toString(t,n,s);return o?Z(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
-
${t.indent}${a}`:a}function Ei({key:e,value:t},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:y,simpleKeys:m}}=n;let b=ne(e)&&e.comment||null;if(m){if(b)throw new Error("With simple keys, key nodes cannot have comments");if(te(e)||!ne(e)&&typeof e=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let S=!m&&(!e||b&&t==null&&!n.inFlow||te(e)||(Z(e)?e.type===K.BLOCK_FOLDED||e.type===K.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!S&&(m||!r),indent:a+c});let h=!1,f=!1,d=st(e,n,()=>h=!0,()=>f=!0);if(!S&&!n.inFlow&&d.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(n.inFlow){if(r||t==null)return h&&s&&s(),d===""?"?":S?`? ${d}`:d}else if(r&&!m||t==null&&S)return d=`? ${d}`,b&&!h?d+=Qe(d,n.indent,u(b)):f&&i&&i(),d;h&&(b=null),S?(b&&(d+=Qe(d,n.indent,u(b))),d=`? ${d}
|
|
36
|
-
${a}:`):(d=`${d}:`,b&&(d+=Qe(d,n.indent,u(b))));let g,p,w;ne(t)?(g=!!t.spaceBefore,p=t.commentBefore,w=t.comment):(g=!1,p=null,w=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!S&&!b&&Z(t)&&(n.indentAtStart=d.length+1),f=!1,!y&&c.length>=2&&!n.inFlow&&!S&&St(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const O=st(t,n,()=>_=!0,()=>f=!0);let P=" ";if(b||g||p){if(P=g?`
|
|
37
|
-
`:"",p){const M=u(p);P+=`
|
|
38
|
-
${Re(M,n.indent)}`}O===""&&!n.inFlow?P===`
|
|
39
|
-
`&&w&&(P=`
|
|
40
|
-
|
|
41
|
-
`):P+=`
|
|
42
|
-
${n.indent}`}else if(!S&&te(t)){const M=O[0],U=O.indexOf(`
|
|
43
|
-
`),ae=U!==-1,J=n.inFlow??t.flow??t.items.length===0;if(ae||!J){let q=!1;if(ae&&(M==="&"||M==="!")){let L=O.indexOf(" ");M==="&"&&L!==-1&&L<U&&O[L+1]==="!"&&(L=O.indexOf(" ",L+1)),(L===-1||U<L)&&(q=!0)}q||(P=`
|
|
44
|
-
${n.indent}`)}}else(O===""||O[0]===`
|
|
45
|
-
`)&&(P="");return d+=P+O,n.inFlow?_&&s&&s():w&&!_?d+=Qe(d,n.indent,u(w)):f&&i&&i(),d}function Ni(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const kt="<<",Be={identify:e=>e===kt||typeof e=="symbol"&&e.description===kt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new K(Symbol(kt)),{addToJSMap:rs}),stringify:()=>kt},Pi=(e,t)=>(Be.identify(t)||Z(t)&&(!t.type||t.type===K.PLAIN)&&Be.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Be.tag&&n.default));function rs(e,t,n){if(n=e&&He(n)?n.resolve(e.doc):n,St(n))for(const s of n.items)Gt(e,t,s);else if(Array.isArray(n))for(const s of n)Gt(e,t,s);else Gt(e,t,n)}function Gt(e,t,n){const s=e&&He(n)?n.resolve(e.doc):n;if(!$t(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function os(e,t,{key:n,value:s}){if(ne(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(Pi(e,n))rs(e,t,s);else{const i=Ce(n,"",e);if(t instanceof Map)t.set(i,Ce(s,i,e));else if(t instanceof Set)t.add(i);else{const r=Li(n,i,e),o=Ce(s,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function Li(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ne(e)&&(n!=null&&n.doc)){const s=is(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Ni(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function mn(e,t,n){const s=bt(e,void 0,n),i=bt(t,void 0,n);return new ke(s,i)}class ke{constructor(t,n=null){Object.defineProperty(this,_e,{value:Wn}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return ne(n)&&(n=n.clone(t)),ne(s)&&(s=s.clone(t)),new ke(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return os(n,s,this)}toString(t,n,s){return t!=null&&t.doc?Ei(this,t,n,s):JSON.stringify(this)}}function ls(e,t,n){return(t.inFlow??e.flow?Di:Mi)(e,t,n)}function Mi({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:u}}=n,y=Object.assign({},n,{indent:r,type:null});let m=!1;const b=[];for(let h=0;h<t.length;++h){const f=t[h];let d=null;if(ne(f))!m&&f.spaceBefore&&b.push(""),Nt(n,b,f.commentBefore,m),f.comment&&(d=f.comment);else if(le(f)){const p=ne(f.key)?f.key:null;p&&(!m&&p.spaceBefore&&b.push(""),Nt(n,b,p.commentBefore,m))}m=!1;let g=st(f,y,()=>d=null,()=>m=!0);d&&(g+=Qe(g,r,u(d))),m&&d&&(m=!1),b.push(s+g)}let S;if(b.length===0)S=i.start+i.end;else{S=b[0];for(let h=1;h<b.length;++h){const f=b[h];S+=f?`
|
|
46
|
-
${c}${f}`:`
|
|
47
|
-
`}}return e?(S+=`
|
|
48
|
-
`+Re(u(e),c),a&&a()):m&&o&&o(),S}function Di({items:e},t,{flowChars:n,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;s+=r;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,y=0;const m=[];for(let h=0;h<e.length;++h){const f=e[h];let d=null;if(ne(f))f.spaceBefore&&m.push(""),Nt(t,m,f.commentBefore,!1),f.comment&&(d=f.comment);else if(le(f)){const p=ne(f.key)?f.key:null;p&&(p.spaceBefore&&m.push(""),Nt(t,m,p.commentBefore,!1),p.comment&&(u=!0));const w=ne(f.value)?f.value:null;w?(w.comment&&(d=w.comment),w.commentBefore&&(u=!0)):f.value==null&&(p!=null&&p.comment)&&(d=p.comment)}d&&(u=!0);let g=st(f,c,()=>d=null);h<e.length-1&&(g+=","),d&&(g+=Qe(g,s,a(d))),!u&&(m.length>y||g.includes(`
|
|
49
|
-
`))&&(u=!0),m.push(g),y=m.length}const{start:b,end:S}=n;if(m.length===0)return b+S;if(!u){const h=m.reduce((f,d)=>f+d.length+2,2);u=t.options.lineWidth>0&&h>t.options.lineWidth}if(u){let h=b;for(const f of m)h+=f?`
|
|
50
|
-
${r}${i}${f}`:`
|
|
51
|
-
`;return`${h}
|
|
52
|
-
${i}${S}`}else return`${b}${o}${m.join(" ")}${o}${S}`}function Nt({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=Re(t(s),e);n.push(r.trimStart())}}function ze(e,t){const n=Z(t)?t.value:t;for(const s of e)if(le(s)&&(s.key===t||s.key===n||Z(s.key)&&s.key.value===n))return s}class Ke extends ns{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(qe,t),this.items=[]}static from(t,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(t),a=(c,u)=>{if(typeof r=="function")u=r.call(n,c,u);else if(Array.isArray(r)&&!r.includes(c))return;(u!==void 0||i)&&o.items.push(mn(c,u,s))};if(n instanceof Map)for(const[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;le(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new ke(t,t==null?void 0:t.value):s=new ke(t.key,t.value);const i=ze(this.items,s.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);Z(i.value)&&ts(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const a=this.items.findIndex(c=>r(s,c)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(t){const n=ze(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=ze(this.items,t),i=s==null?void 0:s.value;return(!n&&Z(i)?i.value:i)??void 0}has(t){return!!ze(this.items,t)}set(t,n){this.add(new ke(t,n),!0)}toJSON(t,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)os(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(const i of this.items)if(!le(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),ls(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const ot={collection:"map",default:!0,nodeClass:Ke,tag:"tag:yaml.org,2002:map",resolve(e,t){return $t(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ke.from(e,t,n)};class Pt extends ns{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(it,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=_t(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=_t(t);if(typeof s!="number")return;const i=this.items[s];return!n&&Z(i)?i.value:i}has(t){const n=_t(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=_t(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[s];Z(i)&&ts(n)?i.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let i=0;for(const r of this.items)s.push(Ce(r,String(i++),n));return s}toString(t,n,s){return t?ls(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){const c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}r.items.push(bt(a,void 0,s))}}return r}}function _t(e){let t=Z(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const lt={collection:"seq",default:!0,nodeClass:Pt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return St(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Pt.from(e,t,n)},Bt={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),hn(e,t,n,s)}},Vt={identify:e=>e==null,createNode:()=>new K(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new K(null),stringify:({source:e},t)=>typeof e=="string"&&Vt.test.test(e)?e:t.options.nullStr},yn={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new K(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&yn.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function Te({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const as={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te},cs={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Te(e)}},us={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new K(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Te},Ft=e=>typeof e=="bigint"||Number.isInteger(e),bn=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function fs(e,t,n){const{value:s}=e;return Ft(s)&&s>=0?n+s.toString(t):Te(e)}const ds={identify:e=>Ft(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>bn(e,2,8,n),stringify:e=>fs(e,8,"0o")},gs={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>bn(e,0,10,n),stringify:Te},hs={identify:e=>Ft(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>bn(e,2,16,n),stringify:e=>fs(e,16,"0x")},ji=[ot,lt,Bt,Vt,yn,ds,gs,hs,as,cs,us];function Ln(e){return typeof e=="bigint"||Number.isInteger(e)}const At=({value:e})=>JSON.stringify(e),Ri=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:At},{identify:e=>e==null,createNode:()=>new K(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:At},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:At},{identify:Ln,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Ln(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:At}],Bi={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Vi=[ot,lt].concat(Ri,Bi),pn={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i<n.length;++i)s[i]=n.charCodeAt(i);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,i,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=K.BLOCK_LITERAL),t!==K.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(a.length/c),y=new Array(u);for(let m=0,b=0;m<u;++m,b+=c)y[m]=a.substr(b,c);a=y.join(t===K.BLOCK_LITERAL?`
|
|
53
|
-
`:" ")}return hn({comment:e,type:t,value:a},s,i,r)}};function ms(e,t){if(St(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!le(s)){if($t(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const i=s.items[0]||new ke(new K(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
54
|
-
${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
55
|
-
${r.comment}`:s.comment}s=i}e.items[n]=le(s)?s:new ke(s)}}else t("Expected a sequence for this tag");return e}function ys(e,t,n){const{replacer:s}=n,i=new Pt(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(r++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(mn(a,c,n))}return i}const vn={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ms,createNode:ys};class tt extends Pt{constructor(){super(),this.add=Ke.prototype.add.bind(this),this.delete=Ke.prototype.delete.bind(this),this.get=Ke.prototype.get.bind(this),this.has=Ke.prototype.has.bind(this),this.set=Ke.prototype.set.bind(this),this.tag=tt.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(le(i)?(r=Ce(i.key,"",n),o=Ce(i.value,r,n)):r=Ce(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(t,n,s){const i=ys(t,n,s),r=new this;return r.items=i.items,r}}tt.tag="tag:yaml.org,2002:omap";const $n={collection:"seq",identify:e=>e instanceof Map,nodeClass:tt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=ms(e,t),s=[];for(const{key:i}of n.items)Z(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new tt,n)},createNode:(e,t,n)=>tt.from(e,t,n)};function bs({value:e,source:t},n){return t&&(e?ps:vs).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const ps={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new K(!0),stringify:bs},vs={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new K(!1),stringify:bs},Fi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te},xi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Te(e)}},Ki={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new K(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:Te},wt=e=>typeof e=="bigint"||Number.isInteger(e);function xt(e,t,n,{intAsBigInt:s}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return i==="-"?-1*r:r}function Sn(e,t,n){const{value:s}=e;if(wt(s)){const i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return Te(e)}const qi={identify:wt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>xt(e,2,2,n),stringify:e=>Sn(e,2,"0b")},Ui={identify:wt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>xt(e,1,8,n),stringify:e=>Sn(e,8,"0")},Ji={identify:wt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>xt(e,0,10,n),stringify:Te},Qi={identify:wt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>xt(e,2,16,n),stringify:e=>Sn(e,16,"0x")};class nt extends Ke{constructor(t){super(t),this.tag=nt.tag}add(t){let n;le(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new ke(t.key,null):n=new ke(t,null),ze(this.items,n.key)||this.items.push(n)}get(t,n){const s=ze(this.items,t);return!n&&le(s)?Z(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=ze(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new ke(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(mn(o,null,s));return r}}nt.tag="tag:yaml.org,2002:set";const wn={collection:"map",identify:e=>e instanceof Set,nodeClass:nt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>nt.from(e,t,n),resolve(e,t){if($t(e)){if(e.hasAllNullValues(!0))return Object.assign(new nt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Cn(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function $s(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Te(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ss={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Cn(e,n),stringify:$s},ws={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Cn(e,!1),stringify:$s},Kt={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Kt.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,i,r||0,o||0,a||0,c);const y=t[8];if(y&&y!=="Z"){let m=Cn(y,!1);Math.abs(m)<30&&(m*=60),u-=6e4*m}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Mn=[ot,lt,Bt,Vt,ps,vs,qi,Ui,Ji,Qi,Fi,xi,Ki,pn,Be,$n,vn,wn,Ss,ws,Kt],Dn=new Map([["core",ji],["failsafe",[ot,lt,Bt]],["json",Vi],["yaml11",Mn],["yaml-1.1",Mn]]),jn={binary:pn,bool:yn,float:us,floatExp:cs,floatNaN:as,floatTime:ws,int:gs,intHex:hs,intOct:ds,intTime:Ss,map:ot,merge:Be,null:Vt,omap:$n,pairs:vn,seq:lt,set:wn,timestamp:Kt},zi={"tag:yaml.org,2002:binary":pn,"tag:yaml.org,2002:merge":Be,"tag:yaml.org,2002:omap":$n,"tag:yaml.org,2002:pairs":vn,"tag:yaml.org,2002:set":wn,"tag:yaml.org,2002:timestamp":Kt};function Xt(e,t,n){const s=Dn.get(t);if(s&&!e)return n&&!s.includes(Be)?s.concat(Be):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{const r=Array.from(Dn.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Be)),i.reduce((r,o)=>{const a=typeof o=="string"?jn[o]:o;if(!a){const c=JSON.stringify(o),u=Object.keys(jn).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(a)||r.push(a),r},[])}const Yi=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class kn{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Xt(t,"compat"):t?Xt(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?zi:{},this.tags=Xt(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,qe,{value:ot}),Object.defineProperty(this,Mt,{value:Bt}),Object.defineProperty(this,it,{value:lt}),this.sortMapEntries=typeof o=="function"?o:o===!0?Yi:null}clone(){const t=Object.create(kn.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Wi(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=is(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=r(e.commentBefore);n.unshift(Re(u,""))}let o=!1,a=null;if(e.contents){if(ne(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const m=r(e.contents.commentBefore);n.push(Re(m,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const u=a?void 0:()=>o=!0;let y=st(e.contents,i,()=>a=null,u);a&&(y+=Qe(y,"",r(a))),(y[0]==="|"||y[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${y}`:n.push(y)}else n.push(st(e.contents,i));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=r(e.comment);u.includes(`
|
|
56
|
-
`)?(n.push("..."),n.push(Re(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Re(r(u),"")))}return n.join(`
|
|
57
|
-
`)+`
|
|
58
|
-
`}class _n{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_e,{value:tn});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new be({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){const t=Object.create(_n.prototype,{[_e]:{value:tn}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ne(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Ge(this.contents)&&this.contents.add(t)}addIn(t,n){Ge(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Xn(this);t.anchor=!n||s.has(n)?Zn(n||"a",s):n}return new es(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const d=p=>typeof p=="number"||p instanceof String||p instanceof Number,g=n.filter(d).map(String);g.length>0&&(n=n.concat(g)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:y}=s??{},{onAnchor:m,setAnchors:b,sourceObjects:S}=wi(this,o||"a"),h={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:m,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:S},f=bt(t,y,h);return a&&te(f)&&(f.flow=!0),b(),f}createPair(t,n,s={}){const i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new ke(i,r)}delete(t){return Ge(this.contents)?this.contents.delete(t):!1}deleteIn(t){return gt(t)?this.contents==null?!1:(this.contents=null,!0):Ge(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return te(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return gt(t)?!n&&Z(this.contents)?this.contents.value:this.contents:te(this.contents)?this.contents.getIn(t,n):void 0}has(t){return te(this.contents)?this.contents.has(t):!1}hasIn(t){return gt(t)?this.contents!==void 0:te(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Et(this.schema,[t],n):Ge(this.contents)&&this.contents.set(t,n)}setIn(t,n){gt(t)?this.contents=n:this.contents==null?this.contents=Et(this.schema,Array.from(t),n):Ge(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new be({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new be({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new kn(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Ce(this.contents,n??"",a);if(typeof r=="function")for(const{count:u,res:y}of a.anchors.values())r(y,u);return typeof o=="function"?Ze(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Wi(this,t)}}function Ge(e){if(te(e))return!0;throw new Error("Expected a YAML collection as document contents")}new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{}
|
|
59
|
-
\r `);function Hi(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return vt(e)&&!s?e.toString(n):new _n(e,s,n).toString(n)}const Cs={tools:["bash"],getAction:()=>we("toolCall.renderer.action.writingCommand"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t),s=ee("bash"),i=typeof n.description=="string"&&n.description.length>0?n.description:"",r=typeof n.timeout=="number"&&n.timeout>0?n.timeout:void 0,o=i?`${s} ${i}`:s;if(!r)return o;const a=`${r}ms`;return`${o} · ${we("toolCall.renderer.bash.title.timeout",{timeout:a})}`},renderBody({toolState:e,renderMarkdown:t,renderAnsi:n}){const s=e();if(!s||s.status==="pending")return null;const{input:i,metadata:r}=X(s),o=typeof i.command=="string"&&i.command.length>0?`$ ${i.command}`:"",a=an(We(s)?s.output:(Lt(s)||cn(s))&&r.output?r.output:void 0),c=[o,a==null?void 0:a.text].filter(Boolean);if(c.length===0)return null;const u=c.join(`
|
|
60
|
-
`);if(s.status==="running")return n({content:u,variant:"running"});const y=n({content:u,requireAnsi:!0,variant:"final"});if(y)return y;const m=Ie(u,"bash",!0);return m?t({content:m}):null}},An={tools:["*"],renderBody({toolState:e,renderMarkdown:t}){const n=e();if(!n||n.status==="pending")return null;const{metadata:s,input:i}=X(n),r=We(n)?n.output:(Lt(n)||cn(n))&&s.output?s.output:s.diff??s.preview??i.content,o=an(r);if(!o)return null;const a=Ie(o.text,o.language,!0);return a?t({content:a,disableHighlight:n.status==="running"}):null}},ks={tools:["edit"],getAction:()=>we("toolCall.renderer.action.preparingEdit"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t),s=typeof n.filePath=="string"?n.filePath:"";return s?`${ee("edit")} ${Fe(s)}`:ee("edit")},renderBody({toolState:e,toolName:t,renderDiff:n,renderMarkdown:s}){const i=e();if(!i||i.status==="pending")return null;const r=Un(t(),i);if(r)return n(r);const{metadata:o}=X(i),a=typeof o.diff=="string"?o.diff:null,c=We(i)&&typeof i.output=="string"?i.output:null,u=Ie(a||c,"diff",!0);return u?s({content:u,size:"large",disableHighlight:i.status==="running"}):null}};var Gi=V("<div class=tool-call-diagnostics-wrapper><div class=tool-call-diagnostics role=region><div class=tool-call-diagnostics-body role=list>"),Xi=V("<div class=tool-call-diagnostic-row role=listitem><span><span class=tool-call-diagnostic-chip-icon></span><span></span></span><span class=tool-call-diagnostic-path><span class=tool-call-diagnostic-coords>:L<!>:C</span></span><span class=tool-call-diagnostic-message>"),Zi=V("<div class=tool-call-apply-patch>"),er=V("<div class=tool-call-apply-patch-file>");function ht(e){return e.replace(/\\/g,"/")}function tr(e){return e===1?"error":e===2?"warning":"info"}function nr(e,t){return e==="error"?{label:t("toolCall.diagnostics.severity.error.short"),icon:"!",rank:0}:e==="warning"?{label:t("toolCall.diagnostics.severity.warning.short"),icon:"!",rank:1}:{label:t("toolCall.diagnostics.severity.info.short"),icon:"i",rank:2}}function sr(e,t){const n=typeof t.filePath=="string"?ht(t.filePath):"",s=typeof t.relativePath=="string"?ht(t.relativePath):"";if(n&&e[n])return n;if(s&&e[s])return s;if(n){const i=Object.keys(e).find(r=>ht(r)===n);if(i)return i}if(s){const i=Object.keys(e).find(r=>{const o=ht(r);return o===s||o.endsWith("/"+s)});if(i)return i}}function ir(e,t,n){var a,c,u,y;const s=sr(e,t);if(!s)return[];const i=e[s];if(!Array.isArray(i)||i.length===0)return[];const r=ht(s),o=[];for(let m=0;m<i.length;m++){const b=i[m];if(!b||typeof b.message!="string")continue;const S=tr(typeof b.severity=="number"?b.severity:void 0),h=nr(S,n),f=typeof((c=(a=b.range)==null?void 0:a.start)==null?void 0:c.line)=="number"?b.range.start.line+1:0,d=typeof((y=(u=b.range)==null?void 0:u.start)==null?void 0:y.character)=="number"?b.range.start.character+1:0;o.push({id:`${r}-${m}-${b.message}`,severity:h.rank,tone:S,label:h.label,icon:h.icon,message:b.message,filePath:r,displayPath:Fe(r),line:f,column:d})}return o.sort((m,b)=>m.severity-b.severity)}function rr(e){return E(z,{get when(){return e.entries.length>0},get children(){var t=Gi(),n=t.firstChild,s=n.firstChild;return $(s,E(Ye,{get each(){return e.entries},children:i=>(()=>{var r=Xi(),o=r.firstChild,a=o.firstChild,c=a.nextSibling,u=o.nextSibling,y=u.firstChild,m=y.firstChild,b=m.nextSibling;b.nextSibling;var S=u.nextSibling;return $(a,()=>i.icon),$(c,()=>i.label),$(u,()=>i.displayPath,y),$(y,()=>i.line||"-",b),$(y,()=>i.column||"-",null),$(S,()=>i.message),oe(h=>{var f=`tool-call-diagnostic-chip tool-call-diagnostic-${i.tone}`,d=i.filePath;return f!==h.e&&Se(o,h.e=f),d!==h.t&&x(u,"title",h.t=d),h},{e:void 0,t:void 0}),r})()})),oe(()=>x(n,"aria-label",e.t("toolCall.diagnostics.ariaLabel.withLabel",{label:e.label}))),t}})}const _s={tools:["apply_patch"],getAction:({t:e})=>e("toolCall.applyPatch.action.preparing"),getTitle({toolState:e,t}){const n=e();if(!n)return;if(n.status==="pending")return ee("apply_patch");const{metadata:s}=X(n),i=Array.isArray(s.files)?s.files:[];if(i.length>0){const r=ee("apply_patch");return i.length===1?t("toolCall.applyPatch.title.withFileCount.one",{tool:r,count:i.length}):t("toolCall.applyPatch.title.withFileCount.other",{tool:r,count:i.length})}return ee("apply_patch")},renderBody({toolState:e,renderDiff:t,renderMarkdown:n,t:s}){const i=e();if(!i||i.status==="pending")return null;const r=X(i),o=I(()=>{const c=r.metadata.files;return Array.isArray(c)?c:[]}),a=I(()=>{const c=r.metadata.diagnostics;return c&&typeof c=="object"?c:{}});if(o().length===0){const c=We(i)&&typeof i.output=="string"?i.output:null;return c?n({content:c,size:"large",disableHighlight:i.status==="running"}):null}return(()=>{var c=Zi();return $(c,E(Ye,{get each(){return o()},children:(u,y)=>{const m=u.relativePath||u.filePath||s("toolCall.applyPatch.fileFallback",{number:y()+1}),b=typeof u.diff=="string"?u.diff:"",S=typeof u.filePath=="string"?u.filePath:u.relativePath,h=I(()=>ir(a(),u,s));return(()=>{var f=er();return $(f,E(z,{get when(){return b.trim().length>0},get children(){return t({diffText:b,filePath:S},{label:s("toolCall.diff.label.withPath",{path:Fe(m)}),cacheKey:`apply_patch:${m}:${y()}`})}}),null),$(f,E(rr,{get entries(){return h()},label:m,t:s}),null),f})()}})),c})()}},As={tools:["patch"],getAction:()=>we("toolCall.renderer.action.preparingPatch"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t),s=typeof n.filePath=="string"?n.filePath:"";return s?`${ee("patch")} ${Fe(s)}`:ee("patch")},renderBody({toolState:e,toolName:t,renderDiff:n,renderMarkdown:s}){const i=e();if(!i||i.status==="pending")return null;const r=Un(t(),i);if(r)return n(r);const{metadata:o}=X(i),a=typeof o.diff=="string"?o.diff:null,c=We(i)&&typeof i.output=="string"?i.output:null,u=Ie(a||c,"diff",!0);return u?s({content:u,size:"large",disableHighlight:i.status==="running"}):null}},Is={tools:["read"],getAction:()=>we("toolCall.renderer.action.readingFile"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t),s=typeof n.filePath=="string"?n.filePath:"",i=typeof n.offset=="number"?n.offset:void 0,r=typeof n.limit=="number"?n.limit:void 0,o=s?Fe(s):"",a=[];typeof i=="number"&&a.push(we("toolCall.renderer.read.detail.offset",{offset:i})),typeof r=="number"&&a.push(we("toolCall.renderer.read.detail.limit",{limit:r}));const c=o?`${ee("read")} ${o}`:ee("read");return a.length?`${c} · ${a.join(" · ")}`:c},renderBody({toolState:e,renderMarkdown:t}){const n=e();if(!n||n.status==="pending")return null;const{metadata:s,input:i}=X(n),r=typeof s.preview=="string"?s.preview:null,o=Jn(typeof i.filePath=="string"?i.filePath:void 0),a=Ie(r,o,!0);return a?t({content:a,disableHighlight:n.status==="running"}):null}},Ts={tools:["write"],getAction:()=>we("toolCall.renderer.action.preparingWrite"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t),s=typeof n.filePath=="string"?n.filePath:"";return s?`${ee("write")} ${Fe(s)}`:ee("write")},renderBody({toolState:e,renderMarkdown:t}){const n=e();if(!n||n.status==="pending")return null;const{metadata:s,input:i}=X(n),r=typeof i.content=="string"?i.content:s.content,o=typeof i.filePath=="string"?i.filePath:void 0,a=Ie(r??null,Jn(o),!0);return a?t({content:a,size:"large",disableHighlight:n.status==="running"}):null}},Os={tools:["webfetch"],getAction:()=>we("toolCall.renderer.action.fetchingFromWeb"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t);return typeof n.url=="string"&&n.url.length>0?`${ee("webfetch")} ${n.url}`:ee("webfetch")},renderBody({toolState:e,renderMarkdown:t}){const n=e();if(!n||n.status==="pending")return null;const{metadata:s}=X(n),i=an(n.status==="completed"?n.output:s.output);if(!i)return null;const r=Ie(i.text,i.language,!0);return r?t({content:r,disableHighlight:n.status==="running"}):null}},Es={tools:["invalid"],getTitle({toolState:e}){const t=e();if(!t)return ee("invalid");const{input:n}=X(t);return typeof n.tool=="string"?ee(n.tool):ee("invalid")},renderBody(e){return An.renderBody(e)}},or={bash:Cs,read:Is,write:Ts,edit:ks,apply_patch:_s,patch:As,webfetch:Os,todowrite:en,todoread:en,invalid:Es};function lr(e){return or[e]??An}function ar(e){return{id:"",type:"tool",tool:e.toolName,state:e.state}}function cr(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const i=t[s];return i==null?"":String(i)}):e}function ur(){return(e,t)=>{const n=ai[e]??e;return cr(n,t)}}function fr(e){const t=()=>e.state,n=()=>e.toolName,s=()=>ar(e),i=()=>{},r=()=>{},o=ur();return{toolCall:s,toolState:t,toolName:n,instanceId:"",sessionId:"",t:o,messageVersion:i,partVersion:r,renderMarkdown:()=>null,renderAnsi:()=>null,renderDiff:()=>null,renderToolCall:()=>null,scrollHelpers:void 0}}function Ns(e){var a,c;const t=lr(e.toolName),n=fr(e),s=e.state,i=((a=t.getAction)==null?void 0:a.call(t,n))??un(e.toolName);if(!s||s.status==="pending")return i;const r=typeof s.title=="string"?s.title:void 0;if(r&&r.length>0)return r;const o=(c=t.getTitle)==null?void 0:c.call(t,n);return o||ee(e.toolName)}var Rn=V("<span class=tool-call-task-section-meta>"),Bn=V("<section class=tool-call-task-section><header class=tool-call-task-section-header><span class=tool-call-task-section-title></span></header><div class=tool-call-task-section-body>"),Vn=V('<div class="message-text tool-call-markdown tool-call-task-container"><div class=tool-call-task-summary>'),dr=V("<section class=tool-call-task-section><header class=tool-call-task-section-header><span class=tool-call-task-section-title></span><span class=tool-call-task-section-meta></span></header><div class=tool-call-task-section-body>"),gr=V("<div class=tool-call-task-sections>"),hr=V("<span class=tool-call-task-status>"),mr=V("<div class=tool-call-task-item><span class=tool-call-task-icon></span><span class=tool-call-task-label></span><span class=tool-call-task-separator aria-hidden=true>—</span><span class=tool-call-task-text>");function yr(e){if(!e)return"";const t=e.metadata??{},n=(t==null?void 0:t.sessionId)??(t==null?void 0:t.sessionID);return typeof n=="string"?n:""}function br(e){const t="::",n=e.lastIndexOf(t);if(n<=0)return null;const s=e.slice(0,n),i=e.slice(n+t.length);return!s||!i?null:{messageId:s,partId:i}}function pr(e){const t=I(()=>br(e.toolKey)),n=I(()=>{var y;return((y=t())==null?void 0:y.messageId)??""}),s=I(()=>{var y;return((y=t())==null?void 0:y.partId)??""}),i=I(()=>{const y=n();if(y)return e.store.getMessage(y)}),r=I(()=>{var b;const y=i(),m=s();if(!(!y||!m))return(b=y.parts)==null?void 0:b[m]}),o=I(()=>{var m;const y=(m=r())==null?void 0:m.data;return y&&y.type==="tool"?y:void 0}),a=I(()=>{var y;return((y=i())==null?void 0:y.revision)??0}),c=I(()=>{var y;return((y=r())==null?void 0:y.revision)??0}),u=I(()=>{const y=o();return y?e.renderToolCall({toolCall:y,messageId:n(),messageVersion:a(),partVersion:c(),sessionId:e.sessionId,forceCollapsed:!0}):null});return je(u)}function Fn(e){if(e==="pending"||e==="running"||e==="completed"||e==="error")return e}function vr(e){switch(e){case"pending":return"⏸";case"running":return"⏳";case"completed":return"✓";case"error":return"✗";default:return""}}function Ps(e){const t=typeof e.description=="string"?e.description:void 0,n=typeof e.subagent_type=="string"?e.subagent_type:void 0,s=ee("task");return t&&n?`${s}[${n}] ${t}`:t?`${s} ${t}`:s}function $r(e){return e.title&&e.title.length>0?e.title:e.tool==="task"?Ps({...e.metadata,...e.input}):e.state?Ns({toolName:e.tool,state:e.state}):un(e.tool)}const Sr={tools:["task"],getAction:({t:e})=>e("toolCall.task.action.delegating"),getTitle({toolState:e}){const t=e();if(!t)return;const{input:n}=X(t);return Ps(n)},renderBody({toolState:e,instanceId:t,renderToolCall:n,messageVersion:s,partVersion:i,scrollHelpers:r,renderMarkdown:o,t:a}){const c=Qn.getOrCreate(t),[u,y]=ce(!1),m=I(()=>{const C=e();return yr(C)}),b=I(()=>{const C=m();if(!C)return!1;const N=xs().get(t);return(N==null?void 0:N.has(C))??!1}),S=I(()=>{const C=m();if(!C)return!1;const N=Ks().loadingMessages.get(t);return(N==null?void 0:N.has(C))??!1});ve(()=>{const C=m();C&&(u()||b()||S()||(y(!0),qs(t,C)))});const[h,f]=ce([]);let d="",g=0,p="";const w=new Map;function _(C){d=C,g=0,p="",w.clear(),f([])}function O(C,N){var W;const T=c.getMessage(C);if(!T)return[];const A=T.partIds,Q=[];for(let R=N;R<A.length;R+=1){const Y=A[R],G=(W=T.parts)==null?void 0:W[Y],F=G==null?void 0:G.data;!F||F.type!=="tool"||Q.push(`${C}::${Y}`)}return w.set(C,A.length),Q}function P(C,N){d=C,g=N.length,p=N[N.length-1]??"",w.clear();const T=[];for(const A of N)T.push(...O(A,0));f(T)}ve(()=>{const C=m(),N=b();if(!C||!N){d&&_("");return}c.getSessionRevision(C),Rs(()=>{const T=c.getSessionMessageIds(C);if(!d||d!==C){P(C,T);return}if(T.length<g){P(C,T);return}if(g>0){const R=g-1;if(R>=0&&T[R]!==p){P(C,T);return}}const A=[];for(let R=g;R<T.length;R+=1){const Y=T[R];A.push(...O(Y,0))}const Q=Math.min(g,T.length),W=Math.max(0,Q-3);for(let R=W;R<Q;R+=1){const Y=T[R],G=w.get(Y)??0,F=c.getMessage(Y);((F==null?void 0:F.partIds.length)??0)>G&&A.push(...O(Y,G))}g=T.length,p=T[T.length-1]??"",A.length>0&&f(R=>[...R,...A])})});const M=I(()=>{const C=e();if(!C)return null;const{input:N}=X(C),T=typeof N.prompt=="string"?N.prompt:null;return Ie(T,void 0,!1)}),U=I(()=>{const C=e();if(!C)return null;const N=typeof C.output=="string"?C.output:null;return Ie(N,void 0,!1)}),ae=I(()=>{const C=e();if(!C)return null;const{input:N}=X(C);return typeof N.subagent_type=="string"?N.subagent_type:null}),J=I(()=>{const C=e();if(!C)return null;const{metadata:N}=X(C),T=N.model;if(!T||typeof T!="object")return null;const A=typeof T.providerID=="string"?T.providerID:null,Q=typeof T.modelID=="string"?T.modelID:null;return!A&&!Q?null:A&&Q?`${A}/${Q}`:A??Q}),q=I(()=>{const C=ae(),N=J();return C&&N?a("toolCall.task.meta.agentModel",{agent:C,model:N}):C?a("toolCall.task.meta.agent",{agent:C}):N?a("toolCall.task.meta.model",{model:N}):null}),L=I(()=>{s==null||s(),i==null||i();const C=e();if(!C)return[];if(b())return[];const{metadata:N}=X(C);return(Array.isArray(N.summary)?N.summary:[]).map((A,Q)=>{const W=typeof(A==null?void 0:A.tool)=="string"?A.tool:"unknown",R=typeof(A==null?void 0:A.state)=="object"?A.state:void 0,Y=typeof(A==null?void 0:A.metadata)=="object"&&A.metadata?A.metadata:{},G=typeof(A==null?void 0:A.input)=="object"&&A.input?A.input:{},F=typeof(A==null?void 0:A.id)=="string"&&A.id.length>0?A.id:`${W}-${Q}`,ue=Fn((A==null?void 0:A.status)??(R==null?void 0:R.status)),D=typeof(A==null?void 0:A.title)=="string"?A.title:void 0;return{id:F,tool:W,input:G,metadata:Y,state:R,status:ue,title:D}})});return(()=>{var C=gr();return $(C,E(z,{get when(){return M()},get children(){var N=Bn(),T=N.firstChild,A=T.firstChild,Q=T.nextSibling;return $(A,()=>a("toolCall.task.sections.prompt")),$(T,E(z,{get when(){return q()},get children(){var W=Rn();return $(W,q),W}}),null),$(Q,()=>o({content:M(),cacheKey:"task:prompt",disableScrollTracking:!0,disableHighlight:!1})),N}}),null),$(C,E(z,{get when(){return h().length>0||L().length>0},get children(){var N=dr(),T=N.firstChild,A=T.firstChild,Q=A.nextSibling,W=T.nextSibling;return $(A,()=>a("toolCall.task.sections.steps")),$(Q,()=>a("toolCall.task.steps.count",{count:h().length>0?h().length:L().length})),$(W,E(z,{get when(){return h().length>0},get fallback(){return(()=>{var R=Vn(),Y=R.firstChild;Ve(R,"scroll",r?F=>r.handleScroll(F):void 0);var G=r==null?void 0:r.registerContainer;return typeof G=="function"&&Le(G,R),$(Y,E(Ye,{get each(){return L()},children:F=>{var ge;const ue=zn(F.tool),D=$r(F),fe=ee(F.tool),se=Fn(F.status??((ge=F.state)==null?void 0:ge.status)),de=vr(se),ie=se,me=a(ie?`toolCall.status.${ie}`:"toolCall.status.unknown"),Ae=se??"pending";return(()=>{var H=mr(),Oe=H.firstChild,Ee=Oe.nextSibling,Me=Ee.nextSibling,Ne=Me.nextSibling;return x(H,"data-task-status",Ae),$(Oe,ue),$(Ee,fe),$(Ne,D),$(H,E(z,{when:de,get children(){var $e=hr();return x($e,"aria-label",me),x($e,"title",me),$($e,de),$e}}),null),oe(()=>x(H,"data-task-id",F.id)),H})()}})),$(R,()=>{var F;return(F=r==null?void 0:r.renderSentinel)==null?void 0:F.call(r)},null),R})()},get children(){var R=Vn(),Y=R.firstChild;Ve(R,"scroll",r?F=>r.handleScroll(F):void 0);var G=r==null?void 0:r.registerContainer;return typeof G=="function"&&Le(G,R),$(Y,E(Ye,{get each(){return h()},children:F=>E(z,{when:n,children:ue=>E(pr,{toolKey:F,store:c,get sessionId(){return m()},get renderToolCall(){return ue()}})})})),$(R,()=>{var F;return(F=r==null?void 0:r.renderSentinel)==null?void 0:F.call(r)},null),R}})),N}}),null),$(C,E(z,{get when(){return U()},get children(){var N=Bn(),T=N.firstChild,A=T.firstChild,Q=T.nextSibling;return $(A,()=>a("toolCall.task.sections.output")),$(T,E(z,{get when(){return q()},get children(){var W=Rn();return $(W,q),W}}),null),$(Q,()=>o({content:U(),cacheKey:"task:output",disableScrollTracking:!0})),N}}),null),C})()}},wr={tools:["question"],getAction:({t:e})=>e("toolCall.question.action.awaitingAnswers"),getTitle({toolState:e,t}){const n=e();return!n||n.status==="completed"?t("toolCall.question.title.questions"):t("toolCall.question.title.askingQuestions")},renderBody(){return null}},Cr=[Cs,Is,Ts,ks,_s,As,Os,en,Sr,wr,Es],kr=Cr.reduce((e,t)=>(t.tools.forEach(n=>{e[n]=t}),e),{});function Ls(e){return kr[e]??An}var _r=V("<div class=tool-call-permission-error>"),Ar=V('<div class="tool-call-permission-actions px-3 pb-3"><div class=tool-call-permission-buttons><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button></button></div><div class=tool-call-permission-shortcuts><kbd class=kbd>Enter</kbd><span></span><kbd class=kbd>Esc</kbd><span>'),Ir=V('<p class="tool-call-permission-queued-text px-3 pb-3">'),Tr=V('<div><div class=tool-call-permission-body><div class="flex flex-col gap-2">'),Or=V('<div class="text-xs text-muted">'),Er=V('<div class="border border-base bg-surface-secondary p-3 text-primary"><div class="flex items-baseline justify-between gap-2"><div class="text-sm text-primary"> <span class=font-semibold></span></div></div><div class="mt-1 text-sm font-medium text-primary"></div><div class="mt-3 flex flex-col gap-1"><label><input class="mt-0.5 accent-[var(--accent-primary)]"><div class="flex flex-1 flex-col gap-2"><div class="text-sm leading-tight text-primary"></div><input class="w-full rounded-md border border-base bg-surface-base px-2 py-1 text-sm text-primary"type=text>'),Nr=V('<label><input class="mt-0.5 accent-[var(--accent-primary)]"><div class="flex flex-col"><div class="text-sm leading-tight text-primary"></div><div class="text-xs text-muted leading-tight">');function Pr(e){const{t}=fn();let n;ve(()=>{e.active()&&n&&n.focus()});const s=I(()=>{var d;const h=e.toolState(),f=e.request();return(f==null?void 0:f.id)??((d=h==null?void 0:h.input)==null?void 0:d.requestID)??`question-${e.toolCallId()}`}),i=I(()=>{var w;const h=e.toolState(),f=e.request(),d=e.toolName()==="question";if(!f&&!d)return[];const g=(f==null?void 0:f.questions)??((w=h==null?void 0:h.input)==null?void 0:w.questions)??[];return Array.isArray(g)?g:[]}),r=I(()=>{const h=e.request(),f=e.toolName()==="question";return!!h||f}),o=I(()=>{var w,_;const h=e.toolState(),f=(h==null?void 0:h.status)==="completed"&&Array.isArray((w=h==null?void 0:h.metadata)==null?void 0:w.answers)?h.metadata.answers:void 0;if(f)return f;const d=e.request(),g=(_=d==null?void 0:d.questions)==null?void 0:_.map(O=>O==null?void 0:O.answer);if(Array.isArray(g)&&g.some(O=>Array.isArray(O)&&O.length>0))return g;const p=e.draftAnswers()[s()]??[];return Array.isArray(p)?p:[]}),a=I(()=>{var g;const h=e.toolState();if((h==null?void 0:h.status)==="completed")return!0;const f=e.request(),d=(g=f==null?void 0:f.questions)==null?void 0:g.map(p=>p==null?void 0:p.answer);return Array.isArray(d)&&d.length>0?d.every(p=>Array.isArray(p)&&p.length>0):!1}),c=(h,f)=>{e.active()&&e.setDraftAnswers(d=>{const p=[...d[s()]??[]];return p[h]=f,{...d,[s()]:p}})},u=(h,f)=>{const d=i()[h],g=(d==null?void 0:d.multiple)===!0,p=o()[h]??[];if(g){const w=p.includes(f)?p.filter(_=>_!==f):[...p,f];c(h,w);return}c(h,[f])},y=()=>!e.active()||e.submitting()?!0:i().some((h,f)=>{var d;return(((d=o()[f])==null?void 0:d.length)??0)===0}),m=(h,f)=>{if(!e.active())return;const g=(f==null?void 0:f.value)??"";if(g.trim().length===0)return;const p=i()[h];if(!((p==null?void 0:p.multiple)===!0)){c(h,[]),u(h,g);return}const _=o()[h]??[];_.includes(g)||c(h,[..._,g])},b=(h,f)=>{if(!e.active()||f.length===0)return;const g=(o()[h]??[]).filter(p=>!f.includes(p));c(h,g)},S=(h,f)=>{if(!e.active())return;const d=f.value,g=d.trim(),p=i()[h];if(!((p==null?void 0:p.multiple)===!0)){c(h,g.length>0?[d]:[]);return}const _=new Set(((p==null?void 0:p.options)??[]).map(U=>U.label)),O=o()[h]??[],P=f.dataset.lastValue??"";let M=O.filter(U=>U!==P);g.length>0?(!_.has(g)&&!M.includes(d)?M=[...M,d]:_.has(g)||M.includes(d)||(M=[...M,d]),f.dataset.lastValue=d):delete f.dataset.lastValue,c(h,M)};return E(z,{get when(){return je(()=>!!r())()&&i().length>0},get children(){var h=Tr(),f=h.firstChild,d=f.firstChild;return $(d,E(Ye,{get each(){return i()},children:(g,p)=>{const w=()=>p(),_=()=>(g==null?void 0:g.multiple)===!0,O=()=>o()[w()]??[],P=()=>_()?"checkbox":"radio",M=()=>`question-${s()}-${w()}`,U=()=>new Set(((g==null?void 0:g.options)??[]).map(L=>L.label)),ae=()=>O().filter(L=>!U().has(L)),J=()=>ae()[0]??"",q=()=>J().length>0;return(()=>{var L=Er(),C=L.firstChild,N=C.firstChild,T=N.firstChild,A=T.nextSibling,Q=C.nextSibling,W=Q.nextSibling,R=W.firstChild,Y=R.firstChild,G=Y.nextSibling,F=G.firstChild,ue=F.nextSibling;return $(N,()=>t("toolCall.question.number",{number:w()+1}),T),$(A,()=>g==null?void 0:g.header),$(C,E(z,{get when(){return _()},get children(){var D=Or();return $(D,()=>t("toolCall.question.multiple")),D}}),null),$(Q,()=>g==null?void 0:g.question),$(W,E(Ye,{get each(){return(g==null?void 0:g.options)??[]},children:(D,fe)=>{const se=()=>O().includes(D.label);return(()=>{var de=Nr(),ie=de.firstChild,me=ie.nextSibling,Ae=me.firstChild,ge=Ae.nextSibling;return ie.addEventListener("change",()=>u(w(),D.label)),Le(H=>{w()===0&&fe()===0&&(n=H)},ie),$(Ae,()=>D.label),$(ge,()=>D.description),oe(H=>{var Oe=`flex items-start gap-2 py-1 ${e.active()?"cursor-pointer":e.request()?"opacity-80":""}`,Ee=D.description,Me=P(),Ne=M(),$e=!e.active()||e.submitting();return Oe!==H.e&&Se(de,H.e=Oe),Ee!==H.t&&x(de,"title",H.t=Ee),Me!==H.a&&x(ie,"type",H.a=Me),Ne!==H.o&&x(ie,"name",H.o=Ne),$e!==H.i&&(ie.disabled=H.i=$e),H},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),oe(()=>ie.checked=se()),de})()}}),R),Y.addEventListener("change",D=>{const fe=D.currentTarget.closest("label"),se=fe==null?void 0:fe.querySelector("input[type='text']");if(e.active()){if(q()){b(w(),ae()),se&&delete se.dataset.lastValue;return}m(w(),se)}}),Le(D=>{var fe;w()===0&&(((fe=g==null?void 0:g.options)==null?void 0:fe.length)??0)===0&&(n=D)},Y),$(F,()=>t("toolCall.question.custom.label")),ue.$$keydown=D=>{D.key==="Enter"&&!D.isComposing&&(y()||e.onSubmit())},ue.$$input=D=>S(w(),D.currentTarget),ue.addEventListener("focus",D=>{e.active()&&m(w(),D.currentTarget)}),oe(D=>{var fe=`mt-2 flex items-start gap-2 py-1 ${e.active()?"cursor-pointer":e.request()?"opacity-80":""}`,se=t("toolCall.question.custom.title"),de=P(),ie=M(),me=!e.active()||e.submitting(),Ae=t("toolCall.question.custom.placeholder"),ge=!e.active()||e.submitting();return fe!==D.e&&Se(R,D.e=fe),se!==D.t&&x(R,"title",D.t=se),de!==D.a&&x(Y,"type",D.a=de),ie!==D.o&&x(Y,"name",D.o=ie),me!==D.i&&(Y.disabled=D.i=me),Ae!==D.n&&x(ue,"placeholder",D.n=Ae),ge!==D.s&&(ue.disabled=D.s=ge),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),oe(()=>Y.checked=q()),oe(()=>ue.value=J()),L})()}}),null),$(d,E(z,{get when(){return e.active()},get children(){var g=Ar(),p=g.firstChild,w=p.firstChild,_=w.nextSibling,O=p.nextSibling,P=O.firstChild,M=P.nextSibling,U=M.nextSibling,ae=U.nextSibling;return w.$$click=()=>e.onSubmit(),$(w,()=>t("toolCall.question.actions.submit")),_.$$click=()=>e.onDismiss(),$(_,()=>t("toolCall.question.actions.dismiss")),$(M,()=>t("toolCall.question.shortcuts.submit")),$(ae,()=>t("toolCall.question.shortcuts.dismiss")),$(g,E(z,{get when(){return e.error()},get children(){var J=_r();return $(J,()=>e.error()),J}}),null),oe(J=>{var q=y(),L=e.submitting();return q!==J.e&&(w.disabled=J.e=q),L!==J.t&&(_.disabled=J.t=L),J},{e:void 0,t:void 0}),g}}),null),$(d,E(z,{get when(){return je(()=>!e.active())()&&e.request()},get children(){var g=Ir();return $(g,()=>t("toolCall.question.queuedText")),g}}),null),oe(()=>Se(h,`tool-call-permission p-0 gap-2 ${e.active()?"tool-call-permission-active":"tool-call-permission-queued"} ${a()?"tool-call-permission-answered":""}`)),h}})}pt(["click","input","keydown"]);var Lr=V("<p class=tool-call-permission-queued-text>"),Mr=V("<div class=tool-call-permission-shortcuts><kbd class=kbd>Enter</kbd><span></span><kbd class=kbd>A</kbd><span></span><kbd class=kbd>D</kbd><span>"),Dr=V("<div class=tool-call-permission-error>"),jr=V("<div><div class=tool-call-permission-header><span class=tool-call-permission-label></span><span class=tool-call-permission-type></span></div><div class=tool-call-permission-body><div class=tool-call-permission-title><code></code></div><div class=tool-call-permission-actions><div class=tool-call-permission-buttons><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button>"),Rr=V("<div class=tool-call-permission-diff>");function Br(e){const{t}=fn(),n=()=>{const i=e.permission();if(!i)return null;const r=i.metadata??{},o=typeof r.diff=="string"?r.diff:null,a=(()=>{if(typeof r.filePath=="string")return r.filePath;if(typeof r.path=="string")return r.path})();return!o||o.trim().length===0?null:{diffText:o,filePath:a}},s=i=>{const r=e.permission();if(!r)return;const o=Yn(r)||e.fallbackSessionId();e.onRespond(r,o,i)};return E(z,{get when(){return e.permission()},children:i=>(()=>{var r=jr(),o=r.firstChild,a=o.firstChild,c=a.nextSibling,u=o.nextSibling,y=u.firstChild,m=y.firstChild,b=y.nextSibling,S=b.firstChild,h=S.firstChild,f=h.nextSibling,d=f.nextSibling;return $(a,(()=>{var g=je(()=>!!e.active());return()=>g()?t("toolCall.permission.status.required"):t("toolCall.permission.status.queued")})()),$(c,()=>Us(i())),$(m,()=>Js(i())),$(u,E(z,{get when(){return n()},children:g=>(()=>{var p=Rr();return $(p,()=>e.renderDiff(g(),{variant:"permission-diff",disableScrollTracking:!0,label:g().filePath?t("toolCall.permission.requestedDiff.withPath",{path:Fe(g().filePath||"")}):t("toolCall.permission.requestedDiff.label")})),p})()}),b),$(u,E(z,{get when(){return!e.active()},get children(){var g=Lr();return $(g,()=>t("toolCall.permission.queuedText")),g}}),b),h.$$click=()=>s("once"),$(h,()=>t("toolCall.permission.actions.allowOnce")),f.$$click=()=>s("always"),$(f,()=>t("toolCall.permission.actions.alwaysAllow")),d.$$click=()=>s("reject"),$(d,()=>t("toolCall.permission.actions.deny")),$(b,E(z,{get when(){return e.active()},get children(){var g=Mr(),p=g.firstChild,w=p.nextSibling,_=w.nextSibling,O=_.nextSibling,P=O.nextSibling,M=P.nextSibling;return $(w,()=>t("toolCall.permission.shortcuts.allowOnce")),$(O,()=>t("toolCall.permission.shortcuts.alwaysAllow")),$(M,()=>t("toolCall.permission.shortcuts.deny")),g}}),null),$(u,E(z,{get when(){return e.error()},get children(){var g=Dr();return $(g,()=>e.error()),g}}),null),oe(g=>{var p=`tool-call-permission ${e.active()?"tool-call-permission-active":"tool-call-permission-queued"}`,w=e.submitting(),_=e.submitting(),O=e.submitting();return p!==g.e&&Se(r,g.e=p),w!==g.t&&(h.disabled=g.t=w),_!==g.a&&(f.disabled=g.a=_),O!==g.o&&(d.disabled=g.o=O),g},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()})}pt(["click"]);var Vr=V('<div><pre class="tool-call-content tool-call-ansi"dir=auto>');function Fr(e){const t=Qs();let n="";const s=a=>{e.scrollHelpers.registerContainer(a)},i=a=>{e.scrollHelpers.registerContainer(a,{disableTracking:!0})},r=()=>{var c;const a=(c=e.partVersion)==null?void 0:c.call(e);return typeof a=="number"?String(a):void 0};function o(a){if(!a.content)return null;const u=`message-text tool-call-markdown${(a.size||"default")==="large"?" tool-call-markdown-large":""}`,y=a.variant==="running"?e.ansiRunningCache:e.ansiFinalCache,m=y.get(),b=r(),S=a.variant==="running",h=!S,f=h?i:s;let d;if(S){const g=a.content;if(!m||!m.text||!g.startsWith(m.text)||m.text!==n)if(Wt(g)){t.reset();const _=t.render(g);d={text:g,html:_,mode:b,hasAnsi:!0}}else t.reset(),d={text:g,html:Ht(g),mode:b,hasAnsi:!1};else{const w=g.slice(m.text.length);if(w.length===0)d={...m,mode:b};else if(!m.hasAnsi&&Wt(w)){t.reset();const _=t.render(g);d={text:g,html:_,mode:b,hasAnsi:!0}}else if(m.hasAnsi){const _=t.render(w);d={text:g,html:`${m.html}${_}`,mode:b,hasAnsi:!0}}else d={text:g,html:`${m.html}${Ht(w)}`,mode:b,hasAnsi:!1}}n=d.text,y.set(d)}else if(m&&m.text===a.content)d={...m,mode:b};else{const g=Wt(a.content),p=g?zs(a.content):Ht(a.content);d={text:a.content,html:p,mode:b,hasAnsi:g},y.set(d)}return a.requireAnsi&&!d.hasAnsi?null:(()=>{var g=Vr(),p=g.firstChild;return Ve(g,"scroll",h?void 0:e.scrollHelpers.handleScroll),Le(f,g),Se(g,u),$(g,()=>e.scrollHelpers.renderSentinel({disableTracking:h}),null),oe(()=>p.innerHTML=d.html),g})()}return{renderAnsiContent:o}}var xr=V("<div class=tool-call-diff-viewer><div>"),Kr=V('<div class="message-text tool-call-markdown tool-call-markdown-large tool-call-diff-shell"><div class=tool-call-diff-toolbar role=group><span class=tool-call-diff-toolbar-label></span><div class=tool-call-diff-toggle><button type=button></button><button type=button>'),qr=V("<pre class=tool-call-diff-fallback>");const Ur=Bs(()=>ci(()=>import("./diff-viewer-D9gxUZHP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.ToolCallDiffViewer})));function Jr(e){return Fs(()=>{var t;(t=e.onRendered)==null||t.call(e)}),(()=>{var t=xr(),n=t.firstChild;return oe(()=>n.innerHTML=e.html),t})()}function Qr(e){const t=i=>{e.scrollHelpers.registerContainer(i)},n=i=>{e.scrollHelpers.registerContainer(i,{disableTracking:!0})};function s(i,r){const o=i.filePath?Fe(i.filePath):"",a=(r==null?void 0:r.label)||(o?e.t("toolCall.diff.label.withPath",{path:o}):e.t("toolCall.diff.label")),u=((r==null?void 0:r.variant)==="permission-diff"?"permission-diff":"diff")==="permission-diff"?e.permissionDiffCache:e.diffCache,y=()=>e.preferences().diffViewMode||"split",m=e.isDark()?"dark":"light",b=e.toolState(),S=!!(r!=null&&r.disableScrollTracking||(b==null?void 0:b.status)!=="running"&&(b==null?void 0:b.status)!=="pending"),h=S?n:t,f=u.params(),d=(()=>{const P=typeof(r==null?void 0:r.cacheKey)=="string"?r.cacheKey.trim():"";return P?{...f,cacheId:`${f.cacheId}:${P}`}:f})();let g;const p=Ys(d),w=y();p&&p.text===i.diffText&&p.theme===m&&p.mode===w&&(g=p.html);const _=P=>{e.setDiffViewMode(P)},O=()=>{var P;S||e.handleScrollRendered(),(P=e.onContentRendered)==null||P.call(e)};return(()=>{var P=Kr(),M=P.firstChild,U=M.firstChild,ae=U.nextSibling,J=ae.firstChild,q=J.nextSibling;return Ve(P,"scroll",S?void 0:e.scrollHelpers.handleScroll),Le(h,P),$(U,a),J.$$click=()=>_("split"),$(J,()=>e.t("toolCall.diff.viewMode.split")),q.$$click=()=>_("unified"),$(q,()=>e.t("toolCall.diff.viewMode.unified")),$(P,g?E(Jr,{html:g,onRendered:O}):E(Vs,{get fallback(){return(()=>{var L=qr();return $(L,()=>i.diffText),L})()},get children(){return E(Ur,{get diffText(){return i.diffText},get filePath(){return i.filePath},theme:m,get mode(){return y()},cacheEntryParams:d,onRendered:O})}}),null),$(P,()=>e.scrollHelpers.renderSentinel({disableTracking:S}),null),oe(L=>{var C=e.t("toolCall.diff.viewMode.ariaLabel"),N=`tool-call-diff-mode-button${y()==="split"?" active":""}`,T=y()==="split",A=`tool-call-diff-mode-button${y()==="unified"?" active":""}`,Q=y()==="unified";return C!==L.e&&x(M,"aria-label",L.e=C),N!==L.t&&Se(J,L.t=N),T!==L.a&&x(J,"aria-pressed",L.a=T),A!==L.o&&Se(q,L.o=A),Q!==L.i&&x(q,"aria-pressed",L.i=Q),L},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),P})()}return{renderDiffContent:s}}pt(["click"]);var zr=V('<div><pre class="whitespace-pre-wrap break-words text-sm font-mono"dir=auto>'),Yr=V("<div>");function Wr(e){const t=i=>{e.scrollHelpers.registerContainer(i)},n=i=>{e.scrollHelpers.registerContainer(i,{disableTracking:!0})};function s(i){var f;if(!i.content)return null;const r=i.size||"default",o=i.disableHighlight||!1,a=`message-text tool-call-markdown${r==="large"?" tool-call-markdown-large":""}`,c=e.toolState(),u=i.disableScrollTracking||(c==null?void 0:c.status)!=="running"&&(c==null?void 0:c.status)!=="pending",y=u?n:t;if(!!(c&&(c.status==="running"||c.status==="pending")&&o))return(()=>{var d=zr(),g=d.firstChild;return Ve(d,"scroll",u?void 0:e.scrollHelpers.handleScroll),Le(y,d),Se(d,a),$(g,()=>i.content),$(d,()=>e.scrollHelpers.renderSentinel({disableTracking:u}),null),d})();const b=typeof i.cacheKey=="string"&&i.cacheKey.length>0?i.cacheKey:void 0,S={id:b?`${e.partId()}:${b}`:e.partId(),type:"text",text:i.content,version:(f=e.partVersion)==null?void 0:f.call(e)},h=()=>{var d;e.handleScrollRendered(),(d=e.onContentRendered)==null||d.call(e)};return(()=>{var d=Yr();return Ve(d,"scroll",u?void 0:e.scrollHelpers.handleScroll),Le(y,d),Se(d,a),$(d,E(Ws,{part:S,get instanceId(){return e.instanceId},get sessionId(){return e.sessionId},get isDark(){return e.isDark()},disableHighlight:o,onRendered:h}),null),$(d,()=>e.scrollHelpers.renderSentinel({disableTracking:u}),null),d})()}return{renderMarkdownContent:s}}function Zt(e){return e.replace(/\\/g,"/")}function Hr(e){return e===1?"error":e===2?"warning":"info"}function Gr(e){return e==="error"?{label:we("toolCall.diagnostics.severity.error.short"),icon:"!",rank:0}:e==="warning"?{label:we("toolCall.diagnostics.severity.warning.short"),icon:"!",rank:1}:{label:we("toolCall.diagnostics.severity.info.short"),icon:"i",rank:2}}function Xr(e){var y,m,b,S;if(!e)return[];if(!(Lt(e)||We(e)||cn(e)))return[];const n=e.metadata||{},s=e.input||{},i=n==null?void 0:n.diagnostics;if(!i)return[];const r=[s.filePath,n.filePath,n.filepath,s.path].find(h=>typeof h=="string"&&h.length>0),o=r?Zt(r):void 0;if(!o)return[];const a=Object.entries(i).filter(([,h])=>Array.isArray(h)&&h.length>0);if(a.length===0)return[];const c=a.filter(([h])=>Zt(h)===o);if(c.length===0)return[];const u=[];for(const[h,f]of c){if(!Array.isArray(f))continue;const d=Zt(h);for(let g=0;g<f.length;g++){const p=f[g];if(!p||typeof p.message!="string")continue;const w=Hr(typeof p.severity=="number"?p.severity:void 0),_=Gr(w),O=typeof((m=(y=p.range)==null?void 0:y.start)==null?void 0:m.line)=="number"?p.range.start.line+1:0,P=typeof((S=(b=p.range)==null?void 0:b.start)==null?void 0:S.character)=="number"?p.range.start.character+1:0;u.push({id:`${d}-${g}-${p.message}`,severity:_.rank,tone:w,label:_.label,icon:_.icon,message:p.message,filePath:d,displayPath:Fe(d),line:O,column:P})}}return u.sort((h,f)=>h.severity-f.severity)}function Zr(e){const t=e[0];return t?t.displayPath:""}var eo=V("<div class=tool-call-diagnostics role=region><div class=tool-call-diagnostics-body role=list>"),to=V("<div class=tool-call-diagnostics-wrapper><button type=button class=tool-call-diagnostics-heading><span class=tool-call-icon aria-hidden=true></span><span class=tool-call-emoji aria-hidden=true>🛠</span><span class=tool-call-summary></span><span class=tool-call-diagnostics-file>"),no=V("<div class=tool-call-diagnostic-row role=listitem><span><span class=tool-call-diagnostic-chip-icon></span><span></span></span><span class=tool-call-diagnostic-path><span class=tool-call-diagnostic-coords>:L<!>:C</span></span><span class=tool-call-diagnostic-message dir=auto>");function so(e,t,n,s,i){return t.length===0?null:(()=>{var r=to(),o=r.firstChild,a=o.firstChild,c=a.nextSibling,u=c.nextSibling,y=u.nextSibling;return Ve(o,"click",s,!0),x(o,"aria-expanded",n),$(a,n?"▼":"▶"),$(u,()=>e("toolCall.diagnostics.title")),x(y,"title",i),$(y,i),$(r,E(z,{when:n,get children(){var m=eo(),b=m.firstChild;return $(b,E(Ye,{each:t,children:S=>(()=>{var h=no(),f=h.firstChild,d=f.firstChild,g=d.nextSibling,p=f.nextSibling,w=p.firstChild,_=w.firstChild,O=_.nextSibling;O.nextSibling;var P=p.nextSibling;return $(d,()=>S.icon),$(g,()=>S.label),$(p,()=>S.displayPath,w),$(w,()=>S.line||"-",O),$(w,()=>S.column||"-",null),$(P,()=>S.message),oe(M=>{var U=`tool-call-diagnostic-chip tool-call-diagnostic-${S.tone}`,ae=S.filePath;return U!==M.e&&Se(f,M.e=U),ae!==M.t&&x(p,"title",M.t=ae),M},{e:void 0,t:void 0}),h})()})),oe(()=>x(m,"aria-label",e("toolCall.diagnostics.ariaLabel"))),m}}),null),r})()}pt(["click"]);var io=V("<div aria-hidden=true class=tool-call-scroll-sentinel style=height:1px>"),ro=V("<div class=tool-call-error-content><strong></strong> "),xn=V("<div class=tool-call-io-body>"),Kn=V("<div class=tool-call-pending-message><span class=spinner-small></span><span>"),oo=V("<div class=tool-call-io-sections><div class=tool-call-io-section><button type=button class=tool-call-io-toggle><span class=tool-call-io-title></span></button></div><div class=tool-call-io-section><button type=button class=tool-call-io-toggle><span class=tool-call-io-title>"),lo=V("<div class=tool-call-details>"),ao=V("<button type=button class=tool-call-header-input>"),co=V("<div data-part-type=tool><div class=tool-call-header><button type=button class=tool-call-header-toggle><span class=tool-call-summary></span></button><button type=button class=tool-call-header-copy></button><span class=tool-call-header-status aria-hidden=true>");const dt=js("session"),uo="tool-call",qn=48,fo=600,go=new Set(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," ","Spacebar"]);function ho(e,t,n,s="default"){return`${t??"unknown-message"}:${n??e??"unknown-tool-call"}:${s}`}function mo(e){const t=I(()=>e.messageVersion),n=I(()=>e.partVersion),s=I(()=>{var l;return{toolCallId:e.toolCallIdentifier(),messageId:e.messageId,partId:((l=e.toolCallMemo())==null?void 0:l.id)??null}}),i=I(()=>typeof e.partVersion=="number"?String(e.partVersion):typeof e.messageVersion=="number"?String(e.messageVersion):"noversion"),r=(l,v)=>ii({instanceId:()=>e.instanceId,sessionId:()=>e.sessionId,scope:uo,cacheId:()=>{const k=s(),j=typeof l=="function"?l():l;return ho(k.toolCallId||void 0,k.messageId,k.partId,j)},version:()=>v?v():i()}),o=r("diff"),a=r("permission-diff"),c=r("ansi-running",()=>"running"),u=r("ansi-final"),y=I(()=>{var l;return(l=e.pendingPermission())==null?void 0:l.permission}),m=I(()=>{var l;return(l=e.pendingQuestion())==null?void 0:l.request}),b=I(()=>{const l=y();return l&&e.isPermissionActive()?l.id:""}),S=I(()=>{const l=m();return l&&e.isQuestionActive()?l.id:""}),[h,f]=ce(!1),[d,g]=ce(null),[p,w]=ce(),[_,O]=ce(null),[P,M]=ce(!0),[U,ae]=ce(!0);let J,q,L=null,C=null,N=0,T=e.scrollTopSnapshot();function A(l=!1){const v=J;v&&(l?(v.scrollTop=v.scrollHeight,T=v.scrollTop,e.setScrollTopSnapshot(T)):v.scrollTop=T)}const Q=l=>{l&&(T=l.scrollTop,e.setScrollTopSnapshot(T))};function W(){N=(typeof performance<"u"?performance.now():Date.now())+fo}function R(){return(typeof performance<"u"?performance.now():Date.now())<=N}function Y(l){q&&(q(),q=void 0);const v=()=>W(),k=j=>{go.has(j.key)&&W()};l.addEventListener("wheel",v,{passive:!0}),l.addEventListener("pointerdown",v),l.addEventListener("touchstart",v,{passive:!0}),l.addEventListener("keydown",k),q=()=>{l.removeEventListener("wheel",v),l.removeEventListener("pointerdown",v),l.removeEventListener("touchstart",v),l.removeEventListener("keydown",k)}}function G(l=!1){if(!P())return;const v=_(),k=J;!v||!k||(C!==null&&(cancelAnimationFrame(C),C=null),C=requestAnimationFrame(()=>{C=null;const j=k.getBoundingClientRect(),De=v.getBoundingClientRect().bottom-j.bottom+qn;Math.abs(De)>1&&k.scrollBy({top:De,behavior:l?"auto":"smooth"}),T=k.scrollTop,e.setScrollTopSnapshot(T)}))}function F(){if(!p())return;L!==null&&cancelAnimationFrame(L);const v=R();L=requestAnimationFrame(()=>{L=null;const k=U();v&&(k?P()||M(!0):P()&&M(!1))})}const ue=l=>{F(),Q(l.currentTarget)},D=()=>{requestAnimationFrame(()=>{A(P()),G(!0)})},fe=l=>{const v=l||void 0;v!==J&&(J=v,w(J),J&&(T=e.scrollTopSnapshot(),A(P())))},se={registerContainer:(l,v)=>{v!=null&&v.disableTracking||fe(l)},handleScroll:ue,renderSentinel:l=>l!=null&&l.disableTracking?null:(()=>{var v=io();return Le(O,v),v})()};ve(()=>{const l=p();l&&(Y(l),ft(()=>{q&&(q(),q=void 0)}))}),ve(()=>{const l=p(),v=_();if(!l||!v)return;const k=new IntersectionObserver(j=>{j.forEach(he=>{he.target===v&&ae(he.isIntersecting)})},{root:l,threshold:0,rootMargin:`0px 0px ${qn}px 0px`});k.observe(v),ft(()=>k.disconnect())}),ve(()=>{y()||f(!1),g(null)}),ve(()=>{(b()||S())&&requestAnimationFrame(()=>{var v;(v=e.toolCallRootEl())==null||v.scrollIntoView({block:"center",behavior:"smooth"})})});async function de(l,v){if(l){f(!0),g(null);try{const k=Yn(l)||e.sessionId;await ri(e.instanceId,k,l.id,v)}catch(k){dt.error("Failed to send permission response",k),g(k instanceof Error?k.message:e.t("toolCall.permission.errors.unableToUpdate"))}finally{f(!1)}}}ve(()=>{if(!b())return;const v=k=>{const j=y();!j||!e.isPermissionActive()||(k.key==="Enter"?(k.preventDefault(),de(j,"once")):k.key==="a"||k.key==="A"?(k.preventDefault(),de(j,"always")):(k.key==="d"||k.key==="D")&&(k.preventDefault(),de(j,"reject")))};document.addEventListener("keydown",v),ft(()=>document.removeEventListener("keydown",v))});const[ie,me]=ce(!1),[Ae,ge]=ce(null),[H,Oe]=ce({});function Ee(){const l=document.activeElement;return(l==null?void 0:l.tagName)==="TEXTAREA"||(l==null?void 0:l.tagName)==="INPUT"||((l==null?void 0:l.hasAttribute("contenteditable"))??!1)}async function Me(){const l=m();if(!l||!e.isQuestionActive())return;const v=(H()[l.id]??[]).map(j=>Array.isArray(j)?j:[]),k=l.questions.map((j,he)=>(v[he]??[]).map(B=>B.trim()).filter(B=>B.length>0));if(k.some(j=>((j==null?void 0:j.length)??0)===0)){ge(e.t("toolCall.question.validation.answerAll"));return}me(!0),ge(null);try{const j=l.sessionID??l.sessionId??e.sessionId;await oi(e.instanceId,j,l.id,k)}catch(j){dt.error("Failed to send question reply",j),ge(j instanceof Error?j.message:e.t("toolCall.question.errors.unableToReply"))}finally{me(!1)}}async function Ne(){const l=m();if(!(!l||!e.isQuestionActive())){me(!0),ge(null);try{const v=l.sessionID??l.sessionId??e.sessionId;await li(e.instanceId,v,l.id)}catch(v){dt.error("Failed to reject question",v),ge(v instanceof Error?v.message:e.t("toolCall.question.errors.unableToDismiss"))}finally{me(!1)}}}ve(()=>{if(!S())return;const v=k=>{Ee()||(k.key==="Enter"?(k.preventDefault(),Me()):k.key==="Escape"&&(k.preventDefault(),Ne()))};document.addEventListener("keydown",v),ft(()=>document.removeEventListener("keydown",v))}),ve(()=>{const l=m();if(!l){me(!1),ge(null);return}ge(null);const v=l.id;Oe(k=>{if(k[v])return k;const j=l.questions.map(()=>[]);return{...k,[v]:j}})});const $e=()=>{var l;return((l=e.toolState())==null?void 0:l.status)||""},qt=I(()=>{const l=e.toolInput();if(!l||Object.keys(l).length===0)return null;try{const v=Hi(l);return Ie(v,"yaml",!0)}catch(v){dt.error("Failed to convert tool call input to YAML",v);try{const k=JSON.stringify(l,null,2);return Ie(k,"json",!0)}catch(k){return dt.error("Failed to stringify tool call input",k),null}}}),Ut=I(()=>Ls(e.toolName())),{renderAnsiContent:Jt}=Fr({ansiRunningCache:c,ansiFinalCache:u,scrollHelpers:se,partVersion:n}),{renderDiffContent:at}=Qr({toolState:e.toolState,preferences:e.preferences,setDiffViewMode:e.setDiffViewMode,isDark:e.isDark,t:e.t,diffCache:o,permissionDiffCache:a,scrollHelpers:se,handleScrollRendered:D,onContentRendered:e.onContentRendered}),{renderMarkdownContent:ct}=Wr({toolState:e.toolState,partId:e.toolCallIdentifier,partVersion:n,instanceId:e.instanceId,sessionId:e.sessionId,isDark:e.isDark,scrollHelpers:se,handleScrollRendered:D,onContentRendered:e.onContentRendered}),Qt={toolCall:e.toolCallMemo,toolState:e.toolState,toolName:e.toolName,instanceId:e.instanceId,sessionId:e.sessionId,t:e.t,messageVersion:t,partVersion:n,renderMarkdown:ct,renderAnsi:Jt,renderDiff:at,renderToolCall:l=>l!=null&&l.toolCall?E(yo,{get toolCall(){return l.toolCall},get toolCallId(){return l.toolCall.id},get messageId(){return l.messageId},get messageVersion(){return l.messageVersion},get partVersion(){return l.partVersion},get instanceId(){return e.instanceId},get sessionId(){return l.sessionId},get forceCollapsed(){return l.forceCollapsed}}):null,scrollHelpers:se};let Ue;ve(()=>{const l=n();l!==void 0&&(Ue!==void 0&&l===Ue||(Ue=l,G(!0)))}),ve(()=>{P()&&G(!0)});const ut=()=>Ut().renderBody(Qt),xe=()=>{const l=e.toolState();return(l==null?void 0:l.status)==="error"&&l.error?(()=>{var v=ro(),k=v.firstChild;return k.nextSibling,$(k,()=>e.t("toolCall.error.label")),$(v,()=>l.error,null),v})():null},zt=()=>E(Br,{permission:y,get active(){return e.isPermissionActive},submitting:h,error:d,renderDiff:at,fallbackSessionId:()=>e.sessionId,onRespond:(l,v,k)=>void de(l,k)}),Yt=()=>E(Pr,{get toolName(){return e.toolName},get toolState(){return e.toolState},get toolCallId(){return e.toolCallIdentifier},request:m,get active(){return e.isQuestionActive},submitting:ie,error:Ae,draftAnswers:H,setDraftAnswers:Oe,onSubmit:()=>void Me(),onDismiss:()=>void Ne()});return ft(()=>{L!==null&&(cancelAnimationFrame(L),L=null),C!==null&&(cancelAnimationFrame(C),C=null),q&&(q(),q=void 0)}),(()=>{var l=lo();return $(l,E(z,{get when(){return je(()=>!!e.isToolInputVisible())()&&e.hasToolInput()},get fallback(){return[je(ut),je(xe),E(z,{get when(){return je(()=>$e()==="pending")()&&!e.pendingPermission()},get children(){var v=Kn(),k=v.firstChild,j=k.nextSibling;return $(j,()=>e.t("toolCall.pending.waitingToRun")),v}})]},get children(){var v=oo(),k=v.firstChild,j=k.firstChild,he=j.firstChild,De=k.nextSibling,B=De.firstChild,pe=B.firstChild;return Ve(j,"click",e.toggleInputSection,!0),$(he,()=>e.t("toolCall.io.input")),$(k,E(z,{get when(){return e.inputSectionExpanded()},get children(){var re=xn();return $(re,()=>{const ye=qt();return ye?ct({content:ye,cacheKey:"input"}):null}),re}}),null),Ve(B,"click",e.toggleOutputSection,!0),$(pe,()=>e.t("toolCall.io.output")),$(De,E(z,{get when(){return e.outputSectionExpanded()},get children(){var re=xn();return $(re,ut,null),$(re,xe,null),$(re,E(z,{get when(){return je(()=>$e()==="pending")()&&!e.pendingPermission()},get children(){var ye=Kn(),Pe=ye.firstChild,Ct=Pe.nextSibling;return $(Ct,()=>e.t("toolCall.pending.waitingToRun")),ye}}),null),re}}),null),oe(re=>{var ye=e.inputSectionExpanded(),Pe=e.outputSectionExpanded();return ye!==re.e&&x(j,"aria-expanded",re.e=ye),Pe!==re.t&&x(B,"aria-expanded",re.t=Pe),re},{e:void 0,t:void 0}),v}}),null),$(l,zt,null),$(l,Yt,null),l})()}function yo(e){const{preferences:t,setDiffViewMode:n}=Ms(),{isDark:s}=Ds(),{t:i}=fn(),r=I(()=>e.toolCall),o=I(()=>{var l;return((l=r())==null?void 0:l.tool)||""}),a=I(()=>{var v;const l=(v=r())==null?void 0:v.id;if(!l)throw new Error("Tool call requires a part id");return l}),c=I(()=>{var l;return(l=r())==null?void 0:l.state}),u=I(()=>Qn.getOrCreate(e.instanceId)),y=I(()=>Hs().get(e.instanceId)??null),m=I(()=>u().getPermissionState(e.messageId,a())),b=I(()=>{var v;const l=m();return l?{permission:l.entry.permission,active:l.active}:(v=r())==null?void 0:v.pendingPermission}),S=I(()=>u().getQuestionState(e.messageId,a())),h=I(()=>{const l=S();if(l)return{request:l.entry.request,active:l.active}}),f=I(()=>(t().toolOutputExpansion||"expanded")==="expanded"),d=I(()=>(t().diagnosticsExpansion||"expanded")==="expanded"),g=I(()=>{var k;if(e.forceCollapsed)return!1;const l=f();if((((k=r())==null?void 0:k.tool)||"")==="read"){const j=c();return(j==null?void 0:j.status)==="error"}return l}),[p,w]=ce(null),_=I(()=>t().toolInputsVisibility||"collapsed"),[O,P]=ce(null),M=I(()=>O()??_()),U=I(()=>M()!=="hidden"),ae=I(()=>M()==="expanded"),[J,q]=ce(null),[L,C]=ce(null),N=()=>{const l=J();return l!==null?l:ae()},T=()=>{const l=L();return l!==null?l:!0},A=I(()=>{const l=b();if(!(l!=null&&l.permission))return!1;const v=y();return(v==null?void 0:v.kind)==="permission"&&v.id===l.permission.id}),Q=I(()=>{const l=h();if(!(l!=null&&l.request))return!1;const v=y();return(v==null?void 0:v.kind)==="question"&&v.id===l.request.id}),W=()=>{if(A()||Q())return!0;const l=p();return l!==null?l:g()},R=I(()=>{const l=c();return X(l).input}),Y=I(()=>{const l=R();return l&&Object.keys(l).length>0}),[G,F]=ce(),[ue,D]=ce(0),[fe,se]=ce(void 0),de=()=>{if(A()||Q())return!0;const l=fe();return l!==void 0?l:d()},ie=I(()=>{const l=c();return l?Xr(l):[]}),me=()=>{q(l=>!(l===null?N():l))},Ae=()=>{C(l=>!(l===null?T():l))},ge=()=>{var v;switch(((v=c())==null?void 0:v.status)||""){case"pending":return E(gi,{class:"w-4 h-4"});case"running":return E(ni,{class:"w-4 h-4 animate-spin"});case"completed":return E(ti,{class:"w-4 h-4"});case"error":return E(mi,{class:"w-4 h-4"});default:return""}},H=()=>{var v;return`tool-call-status-${((v=c())==null?void 0:v.status)||"pending"}`},Oe=()=>{const l=H();return b()||h()?`${l} tool-call-awaiting-permission`:l};function Ee(){const l=b();l!=null&&l.active||w(v=>!(v===null?g():v))}ve(()=>{_(),P(null),q(null),C(null)});const Me=l=>{l.preventDefault(),l.stopPropagation(),W()||Ee();const v=U();P(v?"hidden":"expanded")},Ne=I(()=>Ls(o())),$e=()=>null,qt=()=>null,Ut=()=>null,Jt=()=>null,at={toolCall:r,toolState:c,toolName:o,instanceId:e.instanceId,sessionId:e.sessionId,t:i,messageVersion:()=>e.messageVersion,partVersion:()=>e.partVersion,renderMarkdown:$e,renderAnsi:qt,renderDiff:Ut,renderToolCall:Jt,scrollHelpers:void 0},ct=()=>{var l,v;return((v=(l=Ne()).getAction)==null?void 0:v.call(l,at))??un(o())},Qt=()=>{var j,he;const l=c(),v=o();if(v!=="task")return Ns({toolName:v,state:l});if(!l||l.status==="pending")return ct();const k=(he=(j=Ne()).getTitle)==null?void 0:he.call(j,at);return k||(Lt(l)&&l.title||We(l)&&l.title?l.title:ee(v))},Ue=I(()=>Qt()),ut=I(()=>Gs({title:Ue(),state:c(),t:i})),xe=Xs({id:()=>`${e.instanceId}:${e.sessionId}:${e.messageId??"message"}:${a()}`,text:ut}),zt=()=>ut().trim().length>0&&xe.canUseSpeech(),Yt=async l=>{l.preventDefault(),l.stopPropagation();const v=Ue();v&&await si(v)};return(()=>{var l=co(),v=l.firstChild,k=v.firstChild,j=k.firstChild,he=k.nextSibling,De=he.nextSibling;return Le(B=>{F(B||void 0)},l),k.$$click=Ee,$(j,Ue),$(v,E(z,{get when(){return Y()},get children(){var B=ao();return B.$$click=Me,$(B,E(fi,{class:"w-3.5 h-3.5"})),oe(pe=>{var re=U(),ye=U()?i("toolCall.header.hideInputAriaLabel"):i("toolCall.header.showInputAriaLabel"),Pe=U()?i("toolCall.header.hideInputTitle"):i("toolCall.header.showInputTitle");return re!==pe.e&&x(B,"aria-pressed",pe.e=re),ye!==pe.t&&x(B,"aria-label",pe.t=ye),Pe!==pe.a&&x(B,"title",pe.a=Pe),pe},{e:void 0,t:void 0,a:void 0}),B}}),he),he.$$click=Yt,$(he,E(Zs,{class:"w-3.5 h-3.5"})),$(v,E(z,{get when(){return zt()},get children(){return E(ei,{class:"tool-call-header-copy",onClick:()=>void xe.toggle(),get title(){return xe.buttonTitle()},get isLoading(){return xe.isLoading()},get isPlaying(){return xe.isPlaying()}})}}),De),$(De,ge),$(l,E(z,{get when(){return W()},get children(){return E(mo,{toolCallMemo:r,toolState:c,toolName:o,toolCallIdentifier:a,get instanceId(){return e.instanceId},get sessionId(){return e.sessionId},get messageId(){return e.messageId},get messageVersion(){return e.messageVersion},get partVersion(){return e.partVersion},get onContentRendered(){return e.onContentRendered},preferences:t,setDiffViewMode:n,isDark:s,t:i,store:u,pendingPermission:b,pendingQuestion:h,isPermissionActive:A,isQuestionActive:Q,hasToolInput:Y,isToolInputVisible:U,toolInput:R,inputSectionExpanded:N,outputSectionExpanded:T,toggleInputSection:me,toggleOutputSection:Ae,toolCallRootEl:G,scrollTopSnapshot:ue,setScrollTopSnapshot:D})}}),null),$(l,E(z,{get when(){return ie().length},get children(){return so(i,ie(),de(),()=>se(B=>!(B===void 0?d():B)),Zr(ie()))}}),null),oe(B=>{var pe=`tool-call ${Oe()}`,re=o(),ye=e.instanceId,Pe=e.sessionId,Ct=e.messageId,In=a(),Tn=W(),On=zn(o()),En=i("toolCall.header.copyAriaLabel"),Nn=i("toolCall.header.copyTitle");return pe!==B.e&&Se(l,B.e=pe),re!==B.t&&x(l,"data-tool-name",B.t=re),ye!==B.a&&x(l,"data-instance-id",B.a=ye),Pe!==B.o&&x(l,"data-session-id",B.o=Pe),Ct!==B.i&&x(l,"data-message-id",B.i=Ct),In!==B.n&&x(l,"data-part-id",B.n=In),Tn!==B.s&&x(k,"aria-expanded",B.s=Tn),On!==B.h&&x(j,"data-tool-icon",B.h=On),En!==B.r&&x(he,"aria-label",B.r=En),Nn!==B.d&&x(he,"title",B.d=Nn),B},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),l})()}pt(["click"]);export{yo as default};
|