@blastlauncher/web 3.0.0-alpha.0 → 3.0.0-alpha.3
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/README.md +6 -6
- package/assets/blast-sources.json +1 -1
- package/assets/blast-web.js +14 -9
- package/dist/bundles.d.ts +4 -0
- package/dist/bundles.js +9 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/capabilities.js +6 -1
- package/dist/extension-files.d.ts +17 -0
- package/dist/extension-files.js +43 -0
- package/dist/sandbox.d.ts +9 -0
- package/dist/sandbox.js +24 -0
- package/dist/session.d.ts +2 -0
- package/dist/session.js +22 -36
- package/package.json +3 -3
package/assets/blast-web.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var ri=Object.create;var{getPrototypeOf:si,defineProperty:Jn,getOwnPropertyNames:oi}=Object;var Kn=Object.prototype.hasOwnProperty;function ii(e){return this[e]}var ai,ci,li=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var s=t?ai??=new WeakMap:ci??=new WeakMap,o=s.get(e);if(o)return o}n=e!=null?ri(si(e)):{};let i=t||!e||!e.__esModule||!Kn.call(e,"default")?Jn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of oi(e))if(!Kn.call(i,a))Jn(i,a,{get:ii.bind(e,a),enumerable:!0})}if(r)s.set(e,i);return i};var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var st=T(function(cp,vr){var aa=Number.MAX_SAFE_INTEGER||9007199254740991,ca=["major","premajor","minor","preminor","patch","prepatch","prerelease"];vr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:aa,RELEASE_TYPES:ca,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ht=T(function(lp,Ir){var la=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ir.exports=la});var ot=T(function(Ae,Ar){var{MAX_SAFE_COMPONENT_LENGTH:pn,MAX_SAFE_BUILD_LENGTH:ua,MAX_LENGTH:da}=st(),pa=ht();Ae=Ar.exports={};var fa=Ae.re=[],ma=Ae.safeRe=[],v=Ae.src=[],ha=Ae.safeSrc=[],I=Ae.t={},ga=0,fn="[a-zA-Z0-9-]",ba=[["\\s",1],["\\d",da],[fn,ua]],ya=(e)=>{for(let[t,n]of ba)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},L=(e,t,n)=>{let r=ya(t),s=ga++;pa(e,s,t),I[e]=s,v[s]=t,ha[s]=r,fa[s]=new RegExp(t,n?"g":void 0),ma[s]=new RegExp(r,n?"g":void 0)};L("NUMERICIDENTIFIER","0|[1-9]\\d*");L("NUMERICIDENTIFIERLOOSE","\\d+");L("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fn}*`);L("MAINVERSION",`(${v[I.NUMERICIDENTIFIER]})\\.(${v[I.NUMERICIDENTIFIER]})\\.(${v[I.NUMERICIDENTIFIER]})`);L("MAINVERSIONLOOSE",`(${v[I.NUMERICIDENTIFIERLOOSE]})\\.(${v[I.NUMERICIDENTIFIERLOOSE]})\\.(${v[I.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASEIDENTIFIER",`(?:${v[I.NONNUMERICIDENTIFIER]}|${v[I.NUMERICIDENTIFIER]})`);L("PRERELEASEIDENTIFIERLOOSE",`(?:${v[I.NONNUMERICIDENTIFIER]}|${v[I.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASE",`(?:-(${v[I.PRERELEASEIDENTIFIER]}(?:\\.${v[I.PRERELEASEIDENTIFIER]})*))`);L("PRERELEASELOOSE",`(?:-?(${v[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[I.PRERELEASEIDENTIFIERLOOSE]})*))`);L("BUILDIDENTIFIER",`${fn}+`);L("BUILD",`(?:\\+(${v[I.BUILDIDENTIFIER]}(?:\\.${v[I.BUILDIDENTIFIER]})*))`);L("FULLPLAIN",`v?${v[I.MAINVERSION]}${v[I.PRERELEASE]}?${v[I.BUILD]}?`);L("FULL",`^${v[I.FULLPLAIN]}$`);L("LOOSEPLAIN",`[v=\\s]*${v[I.MAINVERSIONLOOSE]}${v[I.PRERELEASELOOSE]}?${v[I.BUILD]}?`);L("LOOSE",`^${v[I.LOOSEPLAIN]}$`);L("GTLT","((?:<|>)?=?)");L("XRANGEIDENTIFIERLOOSE",`${v[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);L("XRANGEIDENTIFIER",`${v[I.NUMERICIDENTIFIER]}|x|X|\\*`);L("XRANGEPLAIN",`[v=\\s]*(${v[I.XRANGEIDENTIFIER]})(?:\\.(${v[I.XRANGEIDENTIFIER]})(?:\\.(${v[I.XRANGEIDENTIFIER]})(?:${v[I.PRERELEASE]})?${v[I.BUILD]}?)?)?`);L("XRANGEPLAINLOOSE",`[v=\\s]*(${v[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[I.XRANGEIDENTIFIERLOOSE]})(?:${v[I.PRERELEASELOOSE]})?${v[I.BUILD]}?)?)?`);L("XRANGE",`^${v[I.GTLT]}\\s*${v[I.XRANGEPLAIN]}$`);L("XRANGELOOSE",`^${v[I.GTLT]}\\s*${v[I.XRANGEPLAINLOOSE]}$`);L("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pn}})(?:\\.(\\d{1,${pn}}))?(?:\\.(\\d{1,${pn}}))?`);L("COERCE",`${v[I.COERCEPLAIN]}(?:$|[^\\d])`);L("COERCEFULL",v[I.COERCEPLAIN]+`(?:${v[I.PRERELEASE]})?(?:${v[I.BUILD]})?(?:$|[^\\d])`);L("COERCERTL",v[I.COERCE],!0);L("COERCERTLFULL",v[I.COERCEFULL],!0);L("LONETILDE","(?:~>?)");L("TILDETRIM",`(\\s*)${v[I.LONETILDE]}\\s+`,!0);Ae.tildeTrimReplace="$1~";L("TILDE",`^${v[I.LONETILDE]}${v[I.XRANGEPLAIN]}$`);L("TILDELOOSE",`^${v[I.LONETILDE]}${v[I.XRANGEPLAINLOOSE]}$`);L("LONECARET","(?:\\^)");L("CARETTRIM",`(\\s*)${v[I.LONECARET]}\\s+`,!0);Ae.caretTrimReplace="$1^";L("CARET",`^${v[I.LONECARET]}${v[I.XRANGEPLAIN]}$`);L("CARETLOOSE",`^${v[I.LONECARET]}${v[I.XRANGEPLAINLOOSE]}$`);L("COMPARATORLOOSE",`^${v[I.GTLT]}\\s*(${v[I.LOOSEPLAIN]})$|^$`);L("COMPARATOR",`^${v[I.GTLT]}\\s*(${v[I.FULLPLAIN]})$|^$`);L("COMPARATORTRIM",`(\\s*)${v[I.GTLT]}\\s*(${v[I.LOOSEPLAIN]}|${v[I.XRANGEPLAIN]})`,!0);Ae.comparatorTrimReplace="$1$2$3";L("HYPHENRANGE",`^\\s*(${v[I.XRANGEPLAIN]})\\s+-\\s+(${v[I.XRANGEPLAIN]})\\s*$`);L("HYPHENRANGELOOSE",`^\\s*(${v[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[I.XRANGEPLAINLOOSE]})\\s*$`);L("STAR","(<|>)?=?\\s*\\*");L("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");L("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ot=T(function(up,Nr){var wa=Object.freeze({loose:!0}),xa=Object.freeze({}),Ea=(e)=>{if(!e)return xa;if(typeof e!=="object")return wa;return e};Nr.exports=Ea});var mn=T(function(dp,Tr){var Or=/^[0-9]+$/,Cr=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let n=Or.test(e),r=Or.test(t);if(n&&r)e=+e,t=+t;return e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},$a=(e,t)=>Cr(t,e);Tr.exports={compareIdentifiers:Cr,rcompareIdentifiers:$a}});var te=T(function(pp,Pr){var Ct=ht(),{MAX_LENGTH:Lr,MAX_SAFE_INTEGER:Tt}=st(),{safeRe:Lt,t:Pt}=ot(),ka=Ot(),{compareIdentifiers:hn}=mn(),Sa=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;r<n.length;r++)if(hn(e[r],n[r])!==0)return!1;return!0};class ve{constructor(e,t){if(t=ka(t),e instanceof ve)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lr)throw TypeError(`version is longer than ${Lr} characters`);Ct("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Lt[Pt.LOOSE]:Lt[Pt.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Tt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Tt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Tt||this.patch<0)throw TypeError("Invalid patch version");if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map((r)=>{if(/^[0-9]+$/.test(r)){let s=+r;if(s>=0&&s<Tt)return s}return r});this.build=n[5]?n[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Ct("SemVer.compare",this.version,this.options,e),!(e instanceof ve)){if(typeof e==="string"&&e===this.version)return 0;e=new ve(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof ve))e=new ve(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof ve))e=new ve(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],r=e.prerelease[t];if(Ct("prerelease compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return hn(n,r)}while(++t)}compareBuild(e){if(!(e instanceof ve))e=new ve(e,this.options);let t=0;do{let n=this.build[t],r=e.build[t];if(Ct("build compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return hn(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw Error("invalid increment argument: identifier is empty");if(t){let r=`-${t}`.match(this.options.loose?Lt[Pt.PRERELEASELOOSE]:Lt[Pt.PRERELEASE]);if(!r||r[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,n);this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){let s=[t,r];if(n===!1)s=[t];if(Sa(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Pr.exports=ve});var _e=T(function(fp,Br){var Mr=te(),Ra=(e,t,n=!1)=>{if(e instanceof Mr)return e;try{return new Mr(e,t)}catch(r){if(!n)return null;throw r}};Br.exports=Ra});var jr=T(function(mp,Fr){var va=_e(),Ia=(e,t)=>{let n=va(e,t);return n?n.version:null};Fr.exports=Ia});var Vr=T(function(hp,_r){var Aa=_e(),Na=(e,t)=>{let n=Aa(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};_r.exports=Na});var qr=T(function(gp,Dr){var Ur=te(),Oa=(e,t,n,r,s)=>{if(typeof n==="string")s=r,r=n,n=void 0;try{return new Ur(e instanceof Ur?e.version:e,n).inc(t,r,s).version}catch(o){return null}};Dr.exports=Oa});var Hr=T(function(bp,Wr){var Gr=_e(),Ca=(e,t)=>{let n=Gr(e,null,!0),r=Gr(t,null,!0),s=n.compare(r);if(s===0)return null;let o=s>0,i=o?n:r,a=o?r:n,f=!!i.prerelease.length;if(!!a.prerelease.length&&!f){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let l=f?"pre":"";if(n.major!==r.major)return l+"major";if(n.minor!==r.minor)return l+"minor";if(n.patch!==r.patch)return l+"patch";return"prerelease"};Wr.exports=Ca});var Jr=T(function(yp,Xr){var Ta=te(),La=(e,t)=>new Ta(e,t).major;Xr.exports=La});var zr=T(function(wp,Kr){var Pa=te(),Ma=(e,t)=>new Pa(e,t).minor;Kr.exports=Ma});var Qr=T(function(xp,Yr){var Ba=te(),Fa=(e,t)=>new Ba(e,t).patch;Yr.exports=Fa});var es=T(function(Ep,Zr){var ja=_e(),_a=(e,t)=>{let n=ja(e,t);return n&&n.prerelease.length?n.prerelease:null};Zr.exports=_a});var xe=T(function($p,ns){var ts=te(),Va=(e,t,n)=>new ts(e,n).compare(new ts(t,n));ns.exports=Va});var ss=T(function(kp,rs){var Ua=xe(),Da=(e,t,n)=>Ua(t,e,n);rs.exports=Da});var is=T(function(Sp,os){var qa=xe(),Ga=(e,t)=>qa(e,t,!0);os.exports=Ga});var Mt=T(function(Rp,cs){var as=te(),Wa=(e,t,n)=>{let r=new as(e,n),s=new as(t,n);return r.compare(s)||r.compareBuild(s)};cs.exports=Wa});var us=T(function(vp,ls){var Ha=Mt(),Xa=(e,t)=>e.sort((n,r)=>Ha(n,r,t));ls.exports=Xa});var ps=T(function(Ip,ds){var Ja=Mt(),Ka=(e,t)=>e.sort((n,r)=>Ja(r,n,t));ds.exports=Ka});var gt=T(function(Ap,fs){var za=xe(),Ya=(e,t,n)=>za(e,t,n)>0;fs.exports=Ya});var Bt=T(function(Np,ms){var Qa=xe(),Za=(e,t,n)=>Qa(e,t,n)<0;ms.exports=Za});var gn=T(function(Op,hs){var ec=xe(),tc=(e,t,n)=>ec(e,t,n)===0;hs.exports=tc});var bn=T(function(Cp,gs){var nc=xe(),rc=(e,t,n)=>nc(e,t,n)!==0;gs.exports=rc});var Ft=T(function(Tp,bs){var sc=xe(),oc=(e,t,n)=>sc(e,t,n)>=0;bs.exports=oc});var jt=T(function(Lp,ys){var ic=xe(),ac=(e,t,n)=>ic(e,t,n)<=0;ys.exports=ac});var yn=T(function(Pp,ws){var cc=gn(),lc=bn(),uc=gt(),dc=Ft(),pc=Bt(),fc=jt(),mc=(e,t,n,r)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return cc(e,n,r);case"!=":return lc(e,n,r);case">":return uc(e,n,r);case">=":return dc(e,n,r);case"<":return pc(e,n,r);case"<=":return fc(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}};ws.exports=mc});var Es=T(function(Mp,xs){var hc=te(),gc=_e(),{safeRe:_t,t:Vt}=ot(),bc=(e,t)=>{if(e instanceof hc)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?_t[Vt.COERCEFULL]:_t[Vt.COERCE]);else{let f=t.includePrerelease?_t[Vt.COERCERTLFULL]:_t[Vt.COERCERTL],d;while((d=f.exec(e))&&(!n||n.index+n[0].length!==e.length)){if(!n||d.index+d[0].length!==n.index+n[0].length)n=d;f.lastIndex=d.index+d[1].length+d[2].length}f.lastIndex=-1}if(n===null)return null;let r=n[2],s=n[3]||"0",o=n[4]||"0",i=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return gc(`${r}.${s}.${o}${i}${a}`,t)};xs.exports=bc});var ks=T(function(Bp,$s){var yc=_e(),wc=st(),xc=te(),Ec=(e,t,n)=>{if(!wc.RELEASE_TYPES.includes(t))return null;let r=$c(e,n);return r&&kc(r,t)},$c=(e,t)=>{let n=e instanceof xc?e.version:e;return yc(n,t)},kc=(e,t)=>{if(Sc(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Sc=(e)=>e.startsWith("pre");$s.exports=Ec});var vs=T(function(Fp,Rs){class Ss{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,t)}return this}}Rs.exports=Ss});var Ee=T(function(jp,Os){var Rc=/\s+/g;class bt{constructor(e,t){if(t=Ic(t),e instanceof bt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new bt(e.raw,t);if(e instanceof wn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Rc," "),this.set=this.raw.split("||").map((n)=>this.parseRange(n.trim())).filter((n)=>n.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter((r)=>!As(r[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Bc(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let n=0;n<t.length;n++){if(n>0)this.formatted+=" ";this.formatted+=t[n].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Mc,"");let n=((this.options.includePrerelease&&Lc)|(this.options.loose&&Pc))+":"+e,r=Is.get(n);if(r)return r;let s=this.options.loose,o=s?le[ne.HYPHENRANGELOOSE]:le[ne.HYPHENRANGE];e=e.replace(o,Xc(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(le[ne.COMPARATORTRIM],Oc),W("comparator trim",e),e=e.replace(le[ne.TILDETRIM],Cc),W("tilde trim",e),e=e.replace(le[ne.CARETTRIM],Tc),W("caret trim",e);let i=e.split(" ").map((l)=>Fc(l,this.options)).join(" ").split(/\s+/).map((l)=>Hc(l,this.options));if(s)i=i.filter((l)=>(W("loose invalid filter",l,this.options),!!l.match(le[ne.COMPARATORLOOSE])));W("range list",i);let a=new Map,f=i.map((l)=>new wn(l,this.options));for(let l of f){if(As(l))return[l];a.set(l.value,l)}if(a.size>1&&a.has(""))a.delete("");let d=[...a.values()];return Is.set(n,d),d}intersects(e,t){if(!(e instanceof bt))throw TypeError("a Range is required");return this.set.some((n)=>Ns(n,t)&&e.set.some((r)=>Ns(r,t)&&n.every((s)=>r.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Ac(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Jc(this.set[t],e,this.options))return!0;return!1}}Os.exports=bt;var vc=vs(),Is=new vc,Ic=Ot(),wn=yt(),W=ht(),Ac=te(),{safeRe:le,src:Nc,t:ne,comparatorTrimReplace:Oc,tildeTrimReplace:Cc,caretTrimReplace:Tc}=ot(),{FLAG_INCLUDE_PRERELEASE:Lc,FLAG_LOOSE:Pc}=st(),Mc=new RegExp(Nc[ne.BUILD],"g"),As=(e)=>e.value==="<0.0.0-0",Bc=(e)=>e.value==="",Ns=(e,t)=>{let n=!0,r=e.slice(),s=r.pop();while(n&&r.length)n=r.every((o)=>s.intersects(o,t)),s=r.pop();return n},Fc=(e,t)=>(e=e.replace(le[ne.BUILD],""),W("comp",e,t),e=Uc(e,t),W("caret",e),e=_c(e,t),W("tildes",e),e=qc(e,t),W("xrange",e),e=Wc(e,t),W("stars",e),e),Q=(e)=>!e||e.toLowerCase()==="x"||e==="*",jc=(e,t,n)=>Q(e)&&!Q(t)||Q(t)&&n&&!Q(n),_c=(e,t)=>e.trim().split(/\s+/).map((n)=>Vc(n,t)).join(" "),Vc=(e,t)=>{let n=t.loose?le[ne.TILDELOOSE]:le[ne.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{W("tilde",e,s,o,i,a,f);let d;if(Q(o))d="";else if(Q(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Q(a))d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else if(f)W("replaceTilde pr",f),d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;return W("tilde return",d),d})},Uc=(e,t)=>e.trim().split(/\s+/).map((n)=>Dc(n,t)).join(" "),Dc=(e,t)=>{W("caret",e,t);let n=t.loose?le[ne.CARETLOOSE]:le[ne.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{W("caret",e,s,o,i,a,f);let d;if(Q(o))d="";else if(Q(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Q(a))if(o==="0")d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.0${r} <${+o+1}.0.0-0`;else if(f)if(W("replaceCaret pr",f),o==="0")if(i==="0")d=`>=${o}.${i}.${a}-${f} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a}-${f} <${+o+1}.0.0-0`;else if(W("no pr"),o==="0")if(i==="0")d=`>=${o}.${i}.${a} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return W("caret return",d),d})},qc=(e,t)=>(W("replaceXRanges",e,t),e.split(/\s+/).map((n)=>Gc(n,t)).join(" ")),Gc=(e,t)=>{e=e.trim();let n=t.loose?le[ne.XRANGELOOSE]:le[ne.XRANGE];return e.replace(n,(r,s,o,i,a,f)=>{if(W("xRange",e,r,s,o,i,a,f),jc(o,i,a))return e;let d=Q(o),l=d||Q(i),p=l||Q(a),c=p;if(s==="="&&c)s="";if(f=t.includePrerelease?"-0":"",d)if(s===">"||s==="<")r="<0.0.0-0";else r="*";else if(s&&c){if(l)i=0;if(a=0,s===">")if(s=">=",l)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",l)o=+o+1;else i=+i+1;if(s==="<")f="-0";r=`${s+o}.${i}.${a}${f}`}else if(l)r=`>=${o}.0.0${f} <${+o+1}.0.0-0`;else if(p)r=`>=${o}.${i}.0${f} <${o}.${+i+1}.0-0`;return W("xRange return",r),r})},Wc=(e,t)=>(W("replaceStars",e,t),e.trim().replace(le[ne.STAR],"")),Hc=(e,t)=>(W("replaceGTE0",e,t),e.trim().replace(le[t.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),Xc=(e)=>(t,n,r,s,o,i,a,f,d,l,p,c)=>{if(Q(r))n="";else if(Q(s))n=`>=${r}.0.0${e?"-0":""}`;else if(Q(o))n=`>=${r}.${s}.0${e?"-0":""}`;else if(i)n=`>=${n}`;else n=`>=${n}${e?"-0":""}`;if(Q(d))f="";else if(Q(l))f=`<${+d+1}.0.0-0`;else if(Q(p))f=`<${d}.${+l+1}.0-0`;else if(c)f=`<=${d}.${l}.${p}-${c}`;else if(e)f=`<${d}.${l}.${+p+1}-0`;else f=`<=${f}`;return`${n} ${f}`.trim()},Jc=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++){if(W(e[r].semver),e[r].semver===wn.ANY)continue;if(e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var yt=T(function(_p,Bs){var wt=Symbol("SemVer ANY");class Ut{static get ANY(){return wt}constructor(e,t){if(t=Cs(t),e instanceof Ut)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),En("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===wt)this.value="";else this.value=this.operator+this.semver.version;En("comp",this)}parse(e){let t=this.options.loose?Ts[Ls.COMPARATORLOOSE]:Ts[Ls.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=n[1]!==void 0?n[1]:"",this.operator==="=")this.operator="";if(!n[2])this.semver=wt;else this.semver=new Ps(n[2],this.options.loose)}toString(){return this.value}test(e){if(En("Comparator.test",e,this.options.loose),this.semver===wt||e===wt)return!0;if(typeof e==="string")try{e=new Ps(e,this.options)}catch(t){return!1}return xn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ut))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ms(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ms(this.value,t).test(e.semver)}if(t=Cs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(xn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(xn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Bs.exports=Ut;var Cs=Ot(),{safeRe:Ts,t:Ls}=ot(),xn=yn(),En=ht(),Ps=te(),Ms=Ee()});var xt=T(function(Vp,Fs){var Kc=Ee(),zc=(e,t,n)=>{try{t=new Kc(t,n)}catch(r){return!1}return t.test(e)};Fs.exports=zc});var _s=T(function(Up,js){var Yc=Ee(),Qc=(e,t)=>new Yc(e,t).set.map((n)=>n.map((r)=>r.value).join(" ").trim().split(" "));js.exports=Qc});var Us=T(function(Dp,Vs){var Zc=te(),el=Ee(),tl=(e,t,n)=>{let r=null,s=null,o=null;try{o=new el(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===-1)r=i,s=new Zc(r,n)}}),r};Vs.exports=tl});var qs=T(function(qp,Ds){var nl=te(),rl=Ee(),sl=(e,t,n)=>{let r=null,s=null,o=null;try{o=new rl(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===1)r=i,s=new nl(r,n)}}),r};Ds.exports=sl});var Hs=T(function(Gp,Ws){var $n=te(),ol=Ee(),Gs=gt(),il=(e,t)=>{e=new ol(e,t);let n=new $n("0.0.0");if(e.test(n))return n;if(n=new $n("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r<e.set.length;++r){let s=e.set[r],o=null;if(s.forEach((i)=>{let a=new $n(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Gs(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!n||Gs(n,o)))n=o}if(n&&e.test(n))return n;return null};Ws.exports=il});var Js=T(function(Wp,Xs){var al=Ee(),cl=(e,t)=>{try{return new al(e,t).range||"*"}catch(n){return null}};Xs.exports=cl});var Dt=T(function(Hp,Qs){var ll=te(),Ys=yt(),{ANY:ul}=Ys,dl=Ee(),pl=xt(),Ks=gt(),zs=Bt(),fl=jt(),ml=Ft(),hl=(e,t,n,r)=>{e=new ll(e,r),t=new dl(t,r);let s,o,i,a,f;switch(n){case">":s=Ks,o=fl,i=zs,a=">",f=">=";break;case"<":s=zs,o=ml,i=Ks,a="<",f="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(pl(e,t,r))return!1;for(let d=0;d<t.set.length;++d){let l=t.set[d],p=null,c=null;if(l.forEach((u)=>{if(u.semver===ul)u=new Ys(">=0.0.0");if(p=p||u,c=c||u,s(u.semver,p.semver,r))p=u;else if(i(u.semver,c.semver,r))c=u}),p.operator===a||p.operator===f)return!1;if((!c.operator||c.operator===a)&&o(e,c.semver))return!1;else if(c.operator===f&&i(e,c.semver))return!1}return!0};Qs.exports=hl});var eo=T(function(Xp,Zs){var gl=Dt(),bl=(e,t,n)=>gl(e,t,">",n);Zs.exports=bl});var no=T(function(Jp,to){var yl=Dt(),wl=(e,t,n)=>yl(e,t,"<",n);to.exports=wl});var oo=T(function(Kp,so){var ro=Ee(),xl=(e,t,n)=>(e=new ro(e,n),t=new ro(t,n),e.intersects(t,n));so.exports=xl});var ao=T(function(zp,io){var El=xt(),$l=xe();io.exports=(e,t,n)=>{let r=[],s=null,o=null,i=e.sort((l,p)=>$l(l,p,n));for(let l of i)if(El(l,t,n)){if(o=l,!s)s=l}else{if(o)r.push([s,o]);o=null,s=null}if(s)r.push([s,null]);let a=[];for(let[l,p]of r)if(l===p)a.push(l);else if(!p&&l===i[0])a.push("*");else if(!p)a.push(`>=${l}`);else if(l===i[0])a.push(`<=${p}`);else a.push(`${l} - ${p}`);let f=a.join(" || "),d=typeof t.raw==="string"?t.raw:String(t);return f.length<d.length?f:t}});var mo=T(function(Yp,fo){var co=Ee(),Rn=yt(),{ANY:kn}=Rn,Sn=xt(),vn=xe(),kl=(e,t,n={})=>{if(e===t)return!0;e=new co(e,n),t=new co(t,n);let r=!1;e:for(let s of e.set){for(let o of t.set){let i=Rl(s,o,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Sl=[new Rn(">=0.0.0-0")],lo=[new Rn(">=0.0.0")],Rl=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===kn)if(t.length===1&&t[0].semver===kn)return!0;else if(n.includePrerelease)e=Sl;else e=lo;if(t.length===1&&t[0].semver===kn)if(n.includePrerelease)return!0;else t=lo;let r=new Set,s,o;for(let u of e)if(u.operator===">"||u.operator===">=")s=uo(s,u,n);else if(u.operator==="<"||u.operator==="<=")o=po(o,u,n);else r.add(u.semver);if(r.size>1)return null;let i;if(s&&o){if(i=vn(s.semver,o.semver,n),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let u of r){if(s&&!Sn(u,String(s),n))return null;if(o&&!Sn(u,String(o),n))return null;for(let g of t)if(!Sn(u,String(g),n))return!1;return!0}let a,f,d,l,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,c=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(l=l||u.operator===">"||u.operator===">=",d=d||u.operator==="<"||u.operator==="<=",s){if(c){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===c.major&&u.semver.minor===c.minor&&u.semver.patch===c.patch)c=!1}if(u.operator===">"||u.operator===">="){if(a=uo(s,u,n),a===u&&a!==s)return!1}else if(s.operator===">="&&!u.test(s.semver))return!1}if(o){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator==="<"||u.operator==="<="){if(f=po(o,u,n),f===u&&f!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||s)&&i!==0)return!1}if(s&&d&&!o&&i!==0)return!1;if(o&&l&&!s&&i!==0)return!1;if(c||p)return!1;return!0},uo=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e},po=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};fo.exports=kl});var yo=T(function(Qp,bo){var In=ot(),ho=st(),vl=te(),go=mn(),Il=_e(),Al=jr(),Nl=Vr(),Ol=qr(),Cl=Hr(),Tl=Jr(),Ll=zr(),Pl=Qr(),Ml=es(),Bl=xe(),Fl=ss(),jl=is(),_l=Mt(),Vl=us(),Ul=ps(),Dl=gt(),ql=Bt(),Gl=gn(),Wl=bn(),Hl=Ft(),Xl=jt(),Jl=yn(),Kl=Es(),zl=ks(),Yl=yt(),Ql=Ee(),Zl=xt(),eu=_s(),tu=Us(),nu=qs(),ru=Hs(),su=Js(),ou=Dt(),iu=eo(),au=no(),cu=oo(),lu=ao(),uu=mo();bo.exports={parse:Il,valid:Al,clean:Nl,inc:Ol,diff:Cl,major:Tl,minor:Ll,patch:Pl,prerelease:Ml,compare:Bl,rcompare:Fl,compareLoose:jl,compareBuild:_l,sort:Vl,rsort:Ul,gt:Dl,lt:ql,eq:Gl,neq:Wl,gte:Hl,lte:Xl,cmp:Jl,coerce:Kl,truncate:zl,Comparator:Yl,Range:Ql,satisfies:Zl,toComparators:eu,maxSatisfying:tu,minSatisfying:nu,minVersion:ru,validRange:su,outside:ou,gtr:iu,ltr:au,intersects:cu,simplifyRange:lu,subset:uu,SemVer:vl,re:In.re,src:In.src,tokens:In.t,SEMVER_SPEC_VERSION:ho.SEMVER_SPEC_VERSION,RELEASE_TYPES:ho.RELEASE_TYPES,compareIdentifiers:go.compareIdentifiers,rcompareIdentifiers:go.rcompareIdentifiers}});function ie(e){return e!==null&&typeof e==="object"&&"$handler"in e}function x(e){if(typeof e==="string"||typeof e==="number")return String(e);if(e&&typeof e==="object"&&"value"in e)return x(e.value);return""}function ke(e,t){return e.children.find((n)=>n.type==="Slot"&&n.props.name===t)}function J(e){return e?x(e.props.id??e.id):null}function Fe(e,t,n=[]){return e&&ie(t)?{node:e.id,handler:t.$handler,args:n}:void 0}function Z(e,t,n=[]){return Fe(e,e?.props[t],n)}function Zt(e){let t=e?.props.pagination;if(!t||typeof t!=="object"||Array.isArray(t))return;if(!("pageSize"in t)||!("hasMore"in t)||!("onLoadMore"in t))return;return t}function qe(e){return{...e?.tint?{iconTint:e.tint}:{},...e?.source?{iconSource:e.source}:{},...e?.mask?{iconMask:e.mask}:{}}}var zn={add:"+",addperson:"+",airplane:"✈",alarm:"⏰",alarmringing:"⏰",aligncentre:"≡",alignleft:"≡",alignright:"≡",anchor:"⚓",appwindow:"▭",appwindowgrid2x2:"▦",appwindowgrid3x3:"▦",appwindowlist:"☰",appwindowsidebarleft:"▯",appwindowsidebarright:"▯",arrowclockwise:"↻",arrowcounterclockwise:"↺",arrowdown:"↓",arrowdowncircle:"↓",arrowleft:"←",arrowleftcircle:"←",arrowne:"↗",arrowright:"→",arrowrightcircle:"→",arrowup:"↑",arrowupcircle:"↑",arrowscontract:"⤡",arrowsexpand:"⤢",atsymbol:"@",barchart:"▥",barcode:"▮",battery:"▭",batterycharging:"▭",batterydisabled:"▭",bell:"♢",belldisabled:"♢",bicycle:"⚲",bike:"⚲",binoculars:"◎",bird:"▷",blankdocument:"▤",bluetooth:"ᛒ",bold:"B",bolt:"ϟ",boltdisabled:"ϟ",book:"▤",bookmark:"▮",box:"▢",brush:"✎",bug:"☗",building:"▥",bulletpoints:"•",bullseye:"◎",calculator:"▦",calendar:"▦",camera:"◉",car:"▰",cart:"▰",cd:"◎",check:"✓",checkcircle:"✓",checklist:"✓",checkmark:"✓",chevrondown:"⌄",chevronleft:"‹",chevronright:"›",chevronup:"⌃",chevronupdown:"⇕",circle:"●",circledisabled:"○",circleellipsis:"◌",circlefilled:"●",circleprogress:"◌",clipboard:"▧",clock:"◷",cloud:"☁",cloudlightning:"☁",cloudrain:"☁",cloudsnow:"☁",cloudsun:"☁",code:"</>",codeblock:"</>",contrast:"◒",cog:"⚙",coin:"◉",coins:"◉",commandsymbol:"⌘",compass:"⊕",computerchip:"▣",copyclipboard:"⧉",creditcard:"▭",crop:"⌗",crown:"♛",crypto:"◈",deletedocument:"⌫",desktop:"▭",devices:"▭",dna:"⋈",document:"▤",dot:"·",download:"↓",droplets:"◌",duplicate:"⧉",eject:"⏏",ellipsis:"…",ellipsisvertical:"⋮",emoji:"☺",emojisad:"☹",envelope:"✉",eraser:"▱",exclamationmark:"!",exclamationmark2:"!",exclamationmark3:"!",eye:"◉",eyedisabled:"◌",eyedropper:"⌖",female:"♀",filmstrip:"▤",filter:"▽",finder:"⌕",fingerprint:"◎",flag:"⚑",folder:"▰",footprints:"∴",forward:"↷",gamecontroller:"▭",gauge:"◔",gear:"⚙",geopin:"⌖",gift:"▧",glasses:"∞",globe:"⊕",goal:"◎",hammer:"⚒",harddrive:"▭",hashtag:"#",heading:"H",headphones:"◠",heart:"♥",heartbeat:"♥",highlight:"▰",hourglass:"⌛",house:"⌂",humidity:"≈",image:"▣",important:"!",info:"ⓘ",italics:"I",key:"⚿",keyboard:"▦",layers:"▤",leaderboard:"▥",leaf:"❧",lightbulb:"☀",lightbulboff:"☼",linechart:"↗",link:"↗",list:"☰",livestream:"◉",lock:"⚿",lockdisabled:"⚿",lockunlocked:"⚿",logout:"⇥",lorry:"▰",lowercase:"a",magnifyingglass:"⌕",male:"♂",map:"⌗",mask:"◒",maximize:"⤢",medicalsupport:"+",megaphone:"◁",memorychip:"▣",memorystick:"▭",message:"▤",microphone:"◉",microphonedisabled:"◌",minimize:"⤡",minus:"−",minuscircle:"−",mobile:"▯",monitor:"▭",moon:"☾",moondown:"☾",moonrise:"☾",moonup:"☽",mountain:"▲",mouse:"▭",move:"✥",mug:"▯",multiply:"×",music:"♪",network:"⌗",newdocument:"+",newfolder:"+",number:"#",numberlist:"#",paperclip:"⌇",paragraph:"¶",patch:"✚",pause:"Ⅱ",pencil:"✎",person:"●",personcircle:"●",personlines:"●",phone:"☏",phoneringing:"☏",piechart:"◔",pill:"◍",pin:"⌖",pindisabled:"⌖",play:"▶",plug:"⚡",plus:"+",pluscircle:"+",plusminusedividemultiply:"±",plussquare:"+",plustoprightsquare:"+",power:"⏻",print:"⎙",questionmarkcircle:"?",quicklink:"↗",quotationmarks:"“",quoteblock:"▮",receipt:"▤",redo:"↷",removeperson:"−",repeat:"↻",replace:"⇄",reply:"↰",rewind:"◀",rocket:"▲",rosette:"✿",rotateanticlockwise:"↺",rotateclockwise:"↻",rss:"◎",ruler:"⌗",savedocument:"▤",shield:"⛨",shortparagraph:"¶",shuffle:"⤨",signal:"▂",snippets:"▤",snowflake:"❄",soccerball:"◉",speaker:"◁",speakerdown:"◁",speakerlow:"◁",speakerhigh:"◁",speakeroff:"◁",speakeron:"◁",speakerup:"◁",speechbubble:"▤",speechbubbleactive:"▣",speechbubbleimportant:"!",stackedbars:"▤",star:"★",starcircle:"★",stardisabled:"☆",stars:"✦",stop:"■",stopwatch:"◷",store:"⌂",strikethrough:"S",sun:"☀",sunrise:"☀",swatch:"◧",switch:"⇄",syringe:"⌇",tack:"⌖",tag:"⌑",temperature:"°",terminal:"▮",text:"T",textcursor:"▏",textinput:"▭",textselection:"▮",thumbsdown:"▽",thumbsup:"△",ticket:"▤",torch:"◉",trash:"⌫",tray:"▤",tree:"♣",trophy:"♛",twopeople:"●",umbrella:"☂",underline:"U",undo:"↶",upload:"↑",uppercase:"A",video:"▶",videodisabled:"▶",wallet:"▭",wand:"✧",warning:"⚠",waveform:"∿",weights:"▭",wifi:"▂",wifidisabled:"▂",wind:"≈",windsock:"◁",wrenchscrewdriver:"⚒",wristwatch:"◷",xmark:"×",xmarkcircle:"×",xmarktopleftsquare:"⧉",xmarktrightsquare:"⧉",xmarktoprightsquare:"⧉"},ui={"raycast-blue":"blue","raycast-green":"green","raycast-magenta":"magenta","raycast-orange":"orange","raycast-purple":"purple","raycast-red":"red","raycast-yellow":"yellow","raycast-primary-text":"primary-text","raycast-secondary-text":"secondary-text",blue:"blue",green:"green",magenta:"magenta",orange:"orange",purple:"purple",red:"red",yellow:"yellow"};function Qn(e,t){if(typeof e==="string")return ui[e.toLowerCase()]??e;if(e&&typeof e==="object"&&!Array.isArray(e)){let n=e;return Qn(t==="dark"?n.dark??n.light:n.light??n.dark,t)}return}function di(e,t){if(typeof e==="string")return{source:e,...en(e)?{image:!0}:{}};if(!e||typeof e!=="object"||Array.isArray(e))return{};let n=e;if(typeof n.fileIcon==="string")return{fileIcon:n.fileIcon,image:!0};let r=Qn(n.tintColor,t),s=n.mask==="circle"||n.mask==="roundedRectangle"?n.mask:void 0,o=n.source;if(o&&typeof o==="object"&&!Array.isArray(o)){let i=o;o=t==="dark"?i.dark??i.light:i.light??i.dark}return{...typeof o==="string"?{source:o,...en(o)?{image:!0}:{}}:{},...r?{tint:r}:{},...s?{mask:s}:{}}}function en(e){return/^(https?:|data:|file:|\/)/i.test(e)||/\.(png|jpe?g|gif|svg|webp|bmp|heic)$/i.test(e)}function pi(e,t){if(/^(https?:|data:)/i.test(e))return{kind:"url",url:e};if(/^file:/i.test(e))try{return{kind:"file",path:decodeURIComponent(new URL(e).pathname)}}catch{return}if(e.startsWith("/")||/^[a-z]:[\\/]/i.test(e))return{kind:"file",path:e};if(!en(e))return{kind:"builtin",name:e};if(!t||e.split(/[\\/]/).includes(".."))return;return{kind:"file",path:`${t.replace(/[\\/]+$/,"")}/${e.replace(/^\.?[\\/]/,"")}`}}function fi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();return n.join("").toLowerCase()}function Yn(e){return e.replace(/(^|\s)(\S)/g,(t,n,r)=>`${n}${r.toUpperCase()}`)}function mi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();let r=n.join(" ").trim();if(!r)return"◇";let s=Yn(r);return s.length<=12?s:`${Yn(r.slice(0,9))}…`}function ye(e,t={}){let{source:n,fileIcon:r,tint:s,mask:o,image:i}=di(e,t.appearance??"light"),a=r!==void 0?{kind:"fileIcon",path:r}:n===void 0?void 0:pi(n,t.assetsDir),f={...s?{tint:s}:{},...a?{source:a}:{},...o?{mask:o}:{}};if(!n)return{label:r===void 0?"◇":"▣",...f};let d=fi(n);return{label:zn[d]??zn[d.replace(/(?:filled|disabled|small|large)$/,"")]??void 0??(i?"▣":mi(n)),...f}}var hi=4,gi=3,bi=2,yi=1,wi=3,xi=2,Ei=1;function $i(e,t){let n=e.toLowerCase();if(n===t)return hi;if(n.startsWith(t))return gi;let r=n.indexOf(t);if(r<0)return 0;for(let s=r;s>=0;s=n.indexOf(t,s+1))if(s===0||!/[\p{L}\p{N}]/u.test(n[s-1]??""))return bi;return yi}function we(e,t){let n=t.toLowerCase();if(!n)return 1;let r=0,s=(o,i)=>{let a=o?$i(o,n):0;if(a)r=Math.max(r,a*4+i)};s(e.title,wi);for(let o of e.keywords??[])s(o,xi);return s(e.subtitle,Ei),r}function Qe(e){return{title:x(e.props.title),subtitle:x(e.props.subtitle),keywords:Array.isArray(e.props.keywords)?e.props.keywords.map(x):[]}}function Ce(e){let t=e?.props.filtering,n=t===void 0||t===null?!ie(e?.props.onSearchTextChange):t!==!1,r=!!t&&typeof t==="object"&&!Array.isArray(t)&&"keepSectionOrder"in t&&t.keepSectionOrder===!0;return{enabled:n,keepSectionOrder:r}}function Se(e,t,n,r){if(!r.enabled||!t)return e.filter((i)=>i.items.length>0);let s=e.map((i,a)=>{let f=i.items.map((d,l)=>({item:d,index:l,value:n(d)})).filter((d)=>d.value>0).toSorted((d,l)=>l.value-d.value||d.index-l.index);return{group:{...i,items:f.map((d)=>d.item)},order:a,best:f[0]?.value??0}}).filter((i)=>i.group.items.length>0);return(r.keepSectionOrder?s:s.toSorted((i,a)=>a.best-i.best||i.order-a.order)).map((i)=>i.group)}function Ze(e,t,n){let r=[],s;for(let o of e.children)if(n(o))s=void 0,r.push({section:o,items:o.children.filter(t)});else if(t(o)){if(!s)r.push(s={items:[]});s.items.push(o)}return r}function Zn(e,t){let n=e.props.columns;return typeof n==="number"&&n>0?n:t}function er(e){let t=e.props.content,n=t&&typeof t==="object"&&!Array.isArray(t)&&"value"in t?t.value:t;if(typeof n==="string")return n;if(n&&typeof n==="object"&&!Array.isArray(n)&&"color"in n){let r=x(n.color);return r?`■ ${r}`:"■"}return"◇"}function tr(e,t){let n=e.props.content,r=n&&typeof n==="object"&&!Array.isArray(n)&&"value"in n?n.value:n;if(r===void 0||r===null)return;if(typeof r==="object"&&!Array.isArray(r)&&"color"in r)return;return ye(r,t)}function nr(e,t="",n=Ce(e)){let r=[],s=[];if(e?.type!=="Grid")return{rows:r,cells:s};let o=Zn(e,5),i=Se(Ze(e,(a)=>a.type==="Grid.Item",(a)=>a.type==="Grid.Section"),t,(a)=>we(Qe(a),t),n);for(let a of i){let f=a.section?Zn(a.section,o):o;if(a.section)r.push({node:a.section,header:[x(a.section.props.title),x(a.section.props.subtitle)].filter(Boolean).join(" — "),cells:[]});let d;for(let l of a.items){if(!d||d.cells.length>=f)d={node:void 0,header:"",cells:[]},r.push(d);d.cells.push(l),s.push(l)}}return{rows:r,cells:s}}function rr(e,t,n){let r=e.map((p)=>p.cells),s;r.forEach((p,c)=>p.forEach((u,g)=>{if(J(u)===t)s={r:c,c:g}}));let o=(p,c)=>{let u=r[p];if(!u?.length)return;return{r:p,c:Math.min(c,u.length-1)}};if(!s){let p=r.find((c)=>c.length>0)?.[0];return p?J(p):null}let{r:i,c:a}=s,f=r[i]??[],d;if(n==="left")d=a>0?{r:i,c:a-1}:void 0;else if(n==="right")d=a+1<f.length?{r:i,c:a+1}:void 0;else if(n==="up")for(let p=i-1;p>=0&&!d;p--)d=o(p,a);else for(let p=i+1;p<r.length&&!d;p++)d=o(p,a);let l=d?r[d.r]?.[d.c]:f[a];return J(l)}function sr(e){return(e?ke(e,"searchBarAccessory"):void 0)?.children.find((n)=>n.type==="List.Dropdown"||n.type==="Grid.Dropdown")}function tn(e){let t=[];function n(r,s,o){if(r.type.endsWith("Dropdown.Section")){let i=x(r.props.title);r.children.forEach((a)=>n(a,i,r.id))}else if(r.type.endsWith("Dropdown.Item"))t.push({node:r,value:x(r.props.value),title:x(r.props.title),section:s,sectionId:o})}return e?.children.forEach((r)=>n(r,"","")),t}function ki(e,t,n={enabled:!0,keepSectionOrder:!1}){let r=[];for(let s of e){let o=r[r.length-1];if(o?.section===s.sectionId)o.items.push(s);else r.push({section:s.sectionId,items:[s]})}return Se(r,t,(s)=>we({title:s.title,subtitle:s.value,keywords:Array.isArray(s.node.props.keywords)?s.node.props.keywords.map(x):[]},t),n).flatMap((s)=>s.items)}function or(e,t){return ki(tn(e),t,Ce(e))}function ir(e,t){let n=x(e?.props.value??e?.props.defaultValue);return t.find((r)=>r.value===n)?.title||n}var Si=["cmd","ctrl","opt","shift","alt","windows"],Ri={return:"return",enter:"return",escape:"escape",space:"space",backspace:"backspace",delete:"backspace",deleteForward:"delete",tab:"tab",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right",pageUp:"pageup",pageDown:"pagedown",home:"home",end:"end"},vi={enter:"return",esc:"escape"};function et(e){return e&&typeof e==="object"&&"key"in e&&"modifiers"in e?e:void 0}function Ii(e,t){if(et(e))return et(e);if(!e||typeof e!=="object")return;if(t==="macOS")return"macOS"in e?et(e.macOS):void 0;if("Windows"in e&&et(e.Windows))return et(e.Windows);return"windows"in e?et(e.windows):void 0}function Ai(e,t){if(e==="shift")return"shift";if(e==="windows")return"super";if(e==="opt"||e==="alt")return"option";if(e==="cmd")return t==="macOS"?"meta":"ctrl";return"ctrl"}function ar(e,t){let n=Ii(e,t);if(!n)return;let{key:r,modifiers:s}=n;if(typeof r!=="string"||!Array.isArray(s))return;if(!s.every((i)=>typeof i==="string"&&Si.includes(i)))return;let o=Ri[r]??(r.length===1?r.toLowerCase():void 0);if(!o)return;return{key:o,modifiers:new Set(s.map((i)=>Ai(i,t)))}}function Ge(e,t,n="Linux"){let r=ar(e,n);if(!r)return!1;let s=t.name.toLowerCase(),o={ctrl:!!t.ctrl,option:!!t.option,shift:!!t.shift,meta:!!t.meta,super:!!t.super};return(vi[s]??s)===r.key&&Object.keys(o).every((i)=>o[i]===r.modifiers.has(i))}var Ni={ctrl:"⌃",option:"⌥",shift:"⇧",meta:"⌘",super:"❖"},Oi={ctrl:"Ctrl",option:"Alt",shift:"Shift",meta:"Cmd",super:"Win"},Ci=["ctrl","option","shift","meta","super"],Ti={return:"↵",escape:"⎋",space:"␣",backspace:"⌫",delete:"⌦",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},Li={return:"Enter",escape:"Esc",space:"Space",backspace:"Backspace",delete:"Delete",tab:"Tab",up:"Up",down:"Down",left:"Left",right:"Right",pageup:"PageUp",pagedown:"PageDown",home:"Home",end:"End"};function Te(e,t="Linux"){let n=ar(e,t);if(!n)return"";let r=t==="macOS",s=Ci.filter((o)=>n.modifiers.has(o));if(r)return[...s.map((o)=>Ni[o]),Ti[n.key]??n.key.toUpperCase()].join("");return[...s.map((o)=>Oi[o]),Li[n.key]??n.key.toUpperCase()].join("+")}function rn(e,t){if(e.props.shortcut!==void 0)return e.props.shortcut;if(e.type==="Action.CopyToClipboard")return{modifiers:["cmd"],key:"c"};if(t===1)return{modifiers:["cmd"],key:"return"};return}function vt(e){if(!e)return;if(e.type==="Action"||e.type.startsWith("Action."))return e;if(e.type==="ActionPanel.Submenu")return;for(let t of e.children){let n=vt(t);if(n)return n}}function We(e){if(e?.type==="Navigation")return We(e.children.find((t)=>t.type==="Navigation.Entry"&&t.props.active));if(e?.type==="Navigation.Entry")return We(e.children[0]);return e??void 0}function Pi(e,t){let n=e.props.accessories;return(Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?ye(s.icon,t).label:""].filter(Boolean).join(" ")}):[]).filter(Boolean).join(" ")}function Mi(e,t){let n=e.props.accessories,r=Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?ye(s.icon,t).label:""].filter(Boolean).join(" ")}):[];return[e.props.icon?ye(e.props.icon,t).label:"",x(e.props.title),x(e.props.subtitle),...r].filter(Boolean).join(" ")}function Bi(e,t){return{node:e,text:Mi(e,t),item:!0,title:x(e.props.title),subtitle:x(e.props.subtitle),accessories:Pi(e,t),icon:Boolean(e.props.icon),...e.props.icon?{iconView:ye(e.props.icon,t)}:{}}}function Fi(e){let t=[x(e.props.title),x(e.props.subtitle)].filter(Boolean).join(" — ");return{node:e,text:t,title:t,item:!1}}function cr(e){return{node:e,title:e.type,text:`[Unsupported: ${e.type}]`,item:!1,unsupported:!0}}function dr(e,t){let n=We(e?.root),r=[],s=t.searchText,o=t.icons??{},i=Ce(n),a=n?.type==="Grid"?nr(n,s,i):void 0;if(n?.type==="List"){let c=Se(Ze(n,(u)=>u.type==="List.Item",(u)=>u.type==="List.Section"),s,(u)=>we(Qe(u),s),i);for(let u of c){let g=u.section?Fi(u.section):void 0;if(g)r.push(g);for(let y of u.items)r.push(Bi(y,o));if(g)g.count=u.items.length}for(let u of n.children)if(!["List.Item","List.Section","List.EmptyView","Slot"].includes(u.type))r.push(cr(u))}else if(!a&&n&&n.type!=="Detail")r.push(cr(n));let f=a?a.cells:r.filter((c)=>c.item).map((c)=>c.node),d=n?.props.selectedItemId??t.selectedId,l=f.find((c)=>(c.props.id??c.id)===d)??f[0],p=n?.children.find((c)=>c.type==="List.EmptyView"||c.type==="Grid.EmptyView");return{list:n,grid:a,accessory:sr(n),navigation:e?.root?.type==="Navigation"?e.root:void 0,actions:(l?ke(l,"actions"):void 0)??(!l&&p?ke(p,"actions"):void 0)??(n?ke(n,"actions"):void 0),detail:n?.type==="Detail"?ur(n):n?.props.isShowingDetail?ur(l?ke(l,"detail"):void 0):"",rows:r,items:f,empty:p,selected:l,title:x(n?.props.navigationTitle)||(n?.type==="MenuBarExtra"?[x(n.props.title),x(n.props.tooltip)].filter(Boolean).join(" — "):"")||t.fallbackTitle||"Blast",loading:n?.props.isLoading===!0||!e,emptyText:p?[p.props.icon?ye(p.props.icon,o).label:"",x(p.props.title),x(p.props.description)].filter(Boolean).join(" "):"No results",primary:vt(l?ke(l,"actions"):void 0)??vt(!l&&p?ke(p,"actions"):void 0)??vt(n?ke(n,"actions"):void 0)}}function lr(e,t,n){let r=e.type==="ActionPanel.Submenu",s=x(e.props.title),o=Te(rn(e,n),t);return{node:e,item:!0,title:s,shortcut:o,isSubmenu:r,text:`${s}${r?" ›":""} ${o}`.trim()}}function pr(e){return e.type==="ActionPanel.Submenu"||e.type==="Action"||e.type.startsWith("Action.")}function nn(e,t,n){for(let r of e.children)if(pr(r)){if(!n.current)t.push(n.current={items:[]});n.current.items.push(r)}else if(r.type==="ActionPanel.Section"){n.current=void 0;let s=[],o=[];nn(r,o,{});for(let i of o)s.push(...i.items);t.push({section:r,items:s})}else nn(r,t,n)}function It(e,t="",n="Linux",r={enabled:!0,keepSectionOrder:!1}){if(!e)return[];if(pr(e)){let i=lr(e,n,0);return we({title:x(e.props.title)},t)>0?[i]:[]}let s=[];nn(e,s,{});let o=0;return Se(s,t,(i)=>we({title:x(i.props.title)},t),r).flatMap((i)=>{let a=i.items.map((f)=>lr(f,n,o++));return i.section?[{node:i.section,item:!1,title:x(i.section.props.title),text:x(i.section.props.title)},...a]:a})}function At(e,t="",n="Linux"){return e?.type==="ActionPanel.Submenu"?It({...e,type:"ActionPanel"},t,n,Ce(e)):It(e,t,n)}function ur(e){if(!e)return"";let t=[x(e.props.markdown)];function n(r){if(r.type==="Slot"&&r.props.name==="actions")return;if(typeof r.props.markdown==="string")t.push(r.props.markdown);let s=[x(r.props.text),x(r.props.value),x(r.props.target)].filter(Boolean).join(" "),o=x(r.props.title??r.props.label);if(o||s)t.push([o,s].filter(Boolean).join(": "));r.children.forEach(n)}return e.children.forEach(n),t.filter(Boolean).join(`
|
|
2
|
-
`)}var hr=new Set(["TextField","TextArea","PasswordField","Checkbox","Dropdown","TagPicker","DatePicker","FilePicker"].map((e)=>`Form.${e}`));function ji(e){return e.children.filter((t)=>hr.has(t.type))}function _i(e,t,n){if(!e.length)return;let r=e.findIndex((s)=>s.id===t);return e[(Math.max(0,r)+n+e.length)%e.length]}function fr(e){function t(n){return n.type===`${e.type}.Item`?[n]:n.children.flatMap(t)}return e.children.flatMap(t)}function Vi(e,t=""){return Se(Ze(e,(n)=>n.type==="Form.Dropdown.Item",(n)=>n.type==="Form.Dropdown.Section"),t,(n)=>we({...Qe(n),subtitle:String(n.props.value??"")},t),Ce(e)).flatMap((n)=>n.items)}function Ui(e){if(!e)return null;if(!/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?)?$/.test(e))return;let t=new Date(e),n=new Date(`${e.slice(0,10)}T00:00:00Z`);if(!Number.isFinite(t.getTime())||n.toISOString().slice(0,10)!==e.slice(0,10))return;return t.toISOString()}var tt=(e)=>Object.hasOwn(e.props,"value")?e.props.value:e.props.defaultValue??null,He=(e,t,n,r=[])=>{let s=Z(t,n,r);if(s)e.push(s)},mr=(e)=>({value:x(e.props.value),title:x(e.props.title)});function gr(){let e,t=[],n=null,r,s=[],o=0,i=!0,a=new Map,f=new Map,d=(c)=>c.type==="Form.Dropdown"?Vi(c,f.get(c.id)??""):fr(c);function l(c,u,g=!0){if((c??null)===n)return;if(g&&i)He(u,t.find((y)=>y.id===n),"onBlur");if(n=c??null,o=0,c&&g&&i)s.push(c),He(u,t.find((y)=>y.id===c),"onFocus")}function p(c,u){if(c===i)return;i=c;let g=t.find((y)=>y.id===n);if(g&&c)s.push(g.id);He(u,g,c?"onFocus":"onBlur")}return{active:p,scene(c,u,g=!0){if(c?.id!==e?.id)n=null,r=void 0,s=[],o=0,a.clear(),f.clear();let y=t;e=c,t=c?ji(c):[],p(g,u);for(let[m,R]of a){let A=t.find((F)=>F.id===m),_=y.find((F)=>F.id===m);if(!A||A.type==="Form.TextField"&&A!==_||JSON.stringify(tt(A))!==JSON.stringify(tt(_??A))&&JSON.stringify(tt(A))!==JSON.stringify(R.value))a.delete(m)}let S=t.find((m)=>m.props.focused)?.id;if(S&&S!==r){let m=s.indexOf(S);if(m>=0)s.splice(0,m+1);else l(S,u,!1)}if(r=S,!t.some((m)=>m.id===n))l(t[0]?.id,u)},input(c,u){let g=t.find((y)=>y.id===("id"in c?c.id:n));if(c.type==="focusNext"||c.type==="focusPrev")return l(_i(t,n??void 0,c.type==="focusNext"?1:-1)?.id,u);if(!g)return;if(c.type==="focus")return l(g.id,u);if(c.type==="toggle"){if(g.type==="Form.Checkbox")He(u,g,"onChange",[!tt(g)])}else if(c.type==="optionMove"||c.type==="optionChoose"){if(!["Form.Dropdown","Form.TagPicker"].includes(g.type))return;let y=d(g),S=(m)=>Math.max(0,Math.min(y.length-1,m));if(o=S(o),c.type==="optionMove")o=S(o+Math.trunc(c.delta));else{let m=y[o]?.props.value;if(typeof m!=="string")return;let R=tt(g),A=Array.isArray(R)?R:[];He(u,g,"onChange",[g.type==="Form.Dropdown"?m:A.includes(m)?A.filter((_)=>_!==m):[...A,m]])}}else if(c.type==="setValue"){if(g.type==="Form.Dropdown"){f.set(g.id,c.value),o=0,He(u,g,"onSearchTextChange",[c.value]);return}if(!["Form.TextField","Form.TextArea","Form.PasswordField","Form.DatePicker","Form.FilePicker"].includes(g.type))return;let y=c.value,S="";if(g.type==="Form.DatePicker"){let m=Ui(c.value);S=m===void 0?"Enter a valid ISO date or date/time":"",y=m??null}else if(g.type==="Form.FilePicker"){let m=c.value.split(",").map((R)=>R.trim()).filter(Boolean);y=g.props.allowMultipleSelection===!1?m.slice(0,1):m}if(g.type!=="Form.PasswordField")a.set(g.id,{text:c.value,value:y,error:S});if(!S)He(u,g,"onChange",[y])}},view(){return{focusId:n,items:(e?.children??[]).flatMap((c)=>{if(hr.has(c.type))return[{kind:"field",id:c.id}];if(c.type==="Form.Separator")return[{kind:"separator",id:c.id}];if(c.type==="Form.Description")return[{kind:"description",id:c.id,title:x(c.props.title),text:x(c.props.text)}];return[]}),fields:t.map((c)=>{let u=c.type==="Form.PasswordField",g=u?null:tt(c),y=a.get(c.id),S=d(c).map(mr);return{id:c.id,type:c.type,title:x(c.props.title??c.props.id),required:c.props.required===!0,info:n===c.id?x(c.props.info):"",label:x(c.props.label),placeholder:x(c.props.placeholder),error:y?.error||x(c.props.error),value:g,text:u?"":y?.text??(Array.isArray(g)?g.map(x).join(", "):x(g)),checked:g===!0,hasValue:u&&c.props.hasValue===!0,selected:fr(c).map(mr).filter((m)=>Array.isArray(g)?g.includes(m.value):g===m.value),options:S,optionIndex:n===c.id&&S.length?Math.min(o,S.length-1):0,query:f.get(c.id)??"",focused:n===c.id}})}}}}function br(e,t,n,r){let s=Zt(e);if(!s||!ie(s.onLoadMore)||s.hasMore!==!0)return;let o=t.at(-1);if(!o||J(o)!==n||r===t.length)return;let i=Fe(e,s.onLoadMore);return i?{count:t.length,event:i}:void 0}var Di=200;function sn(e,t){if(!ie(e?.props.onSearchTextChange))return;let n=Z(e,"onSearchTextChange",[t]);if(!n)return;return{event:n,delayMs:e?.props.throttle?Di:0}}var Nt=2500;var yr=3000;function qi(e){return e?.root?.type==="Navigation"?e.root.children:[]}function Gi(e){return e==="immediate"||e==="suspended"?e:"default"}function Re(e){let t=qi(e),n=t.find((i)=>i.type==="Toast"),r=t.find((i)=>i.type==="HUD"),s=t.find((i)=>i.type==="Alert"),o=(i)=>{let a=s?.children.find((f)=>f.props.name===i);return a?{node:a,title:x(a.props.title),style:x(a.props.style)||"default"}:void 0};return{toast:n&&{node:n,style:x(n.props.style).toLowerCase(),title:x(n.props.title),message:x(n.props.message),actions:n.children.map((i)=>({node:i,name:x(i.props.name),title:x(i.props.title),shortcut:i.props.shortcut}))},hud:r&&{node:r,title:x(r.props.title),durationMs:Nt,popToRootType:Gi(r.props.popToRootType),clearRootSearch:r.props.clearRootSearch===!0},alert:s&&{node:s,title:x(s.props.title),message:x(s.props.message),rememberUserChoice:s.props.rememberUserChoice===!0,primary:o("primaryAction"),dismiss:o("dismissAction")}}}var Wi={path:[],selectedId:null};function Hi(e,t,n="Linux",r={}){if(e?.type!=="MenuBarExtra")return[];let s=e;for(let a of t){let f;if(function d(l){for(let p of l.children){if(f)return;if(p.type==="MenuBarExtra.Submenu"&&p.id===a)f=p;else d(p)}}(s),!f)break;s=f}let o=[];function i(a){if(a.type==="MenuBarExtra.Item"){let f=x(a.props.title),d=x(a.props.subtitle),l=Te(a.props.shortcut,n),p=a.props.icon===void 0?void 0:ye(a.props.icon,r);o.push({node:a,item:!0,disabled:!ie(a.props.onAction),title:f,subtitle:d,...p?{iconLabel:p.label,...qe(p)}:{},shortcut:l,text:[f,d,l].filter(Boolean).join(" ")})}else if(a.type==="MenuBarExtra.Submenu"){let f=x(a.props.title);o.push({node:a,item:!0,disabled:!1,title:f,isSubmenu:!0,text:`${f} ›`})}else if(a.type==="MenuBarExtra.Section"){let f=o.length,d=x(a.props.title);if(o.push({node:a,item:!1,disabled:!0,title:d,text:d}),a.children.forEach(i),o.length===f+1)o.splice(f,1)}}return s.children.forEach(i),o}function on(e,t=Wi,n="Linux",r={}){let s=We(e?.root),o=s?.type==="MenuBarExtra"?s:void 0,i=Hi(o,t.path,n,r),a=i.filter((f)=>f.item);return{menu:o,rows:i,items:a,selected:a.find((f)=>J(f.node)===t.selectedId)??a[0],path:t.path,isLoading:o?.props.isLoading===!0,title:x(o?.props.title),tooltip:x(o?.props.tooltip)}}function wr(e,t,n,r="Linux"){let s=on(e,t,r),o={state:t,events:[],leave:!1};if(n.type==="back"){if(t.path.length)return{...o,state:{path:t.path.slice(0,-1),selectedId:null}};return{...o,leave:n.escape===!0}}if(n.type==="move"){let a=s.items.findIndex((l)=>l.node===s.selected?.node),f=s.items[Math.max(0,Math.min(s.items.length-1,a+n.delta))],d=f?J(f.node):null;if(!f||d===J(s.selected?.node))return o;return{...o,state:{...t,selectedId:d},events:[Z(s.menu,"onSelectionChange",[d])].filter((l)=>l!==void 0)}}let i=s.selected;if(i?.node.type==="MenuBarExtra.Submenu")return{...o,state:{path:[...t.path,i.node.id],selectedId:null}};if(i&&!i.disabled)return{...o,events:[Fe(i.node,i.node.props.onAction,[{type:"left-click"}])].filter((a)=>a!==void 0)};return o}function xr(e,t,n="Linux"){if(e?.type!=="MenuBarExtra")return;let r=[...e.children];for(let s=r.shift();s;s=r.shift()){if(s.type==="MenuBarExtra.Item"&&ie(s.props.onAction)&&Ge(s.props.shortcut,t,n))return s;r.push(...s.children)}return}var an=()=>({events:[],effects:[]}),ae=(e,t)=>{if(t)e.events.push(t)},je=(e,t)=>ae(e,Z(t,Xi(t))),pt=(e,t)=>Math.max(0,Math.min(t-1,e)),Xi=(e)=>ie(e?.props.onAction)?"onAction":"onSubmit";function cn(e){let{platform:t}=e,n={appearance:e.appearance??"light",...e.assetsDir===void 0?{}:{assetsDir:e.assetsDir}},r,s=gr(),o="",i=null,a,f,d,l=[],p=null,c="",u=0,g=!1,y="",S=0,m=-1,R,A,_,F="",U="",re="",ue=!1,Pe=0,Ie="",se=!1,Ke=0,D=!1,K=!1,Ve=0,de=new Map,N=new Set,j="",M=(h)=>{if(D)return;D=!0,h.effects.push({type:"quit"})},V=(h,b,w)=>{if(de.delete(b),!w)return;if(!w.delayMs)return ae(h,w.event);let C=`${b}:${++Ve}`;de.set(b,{token:C,event:w.event}),h.effects.push({type:"schedule",ms:w.delayMs,token:C})},G=()=>dr(r,{searchText:o,selectedId:i,...e.fallbackTitle?{fallbackTitle:e.fallbackTitle}:{},icons:n}),X=(h)=>h.list?.type==="MenuBarExtra",pe=(h)=>{let b=h.actions;for(let w of p??[])b=At(b,"",t).find((C)=>C.node.id===w)?.node;return b},$e=(h)=>{let b=pe(h),w=At(b,c,t),C=w.filter((k)=>k.item),B=C.length?pt(u,C.length):-1;return{node:b,rows:w,items:C,index:B,chosen:C[B]?.node}},Ne=(h)=>{let b=or(h.accessory,y),w=b.length?pt(S,b.length):-1;return{options:b,index:w,chosen:b[w]}},z=(h,b)=>b?"alert":X(h)?"menu":g?"dropdown":p!==null?"panel":"base",ge=()=>{g=!1,y="",S=0},Me=(h)=>{p=h,c="",u=0},Be=(h,b)=>{if(ie(b.navigation?.props.pop))ae(h,Z(b.navigation,"pop"));else M(h)};function kt(h){R=h?.id,p=null,c="",u=0,i=null,a=void 0,d=void 0,l=[],ge(),m=-1,o=x(h?.props.searchText),_=void 0,de.delete("search"),de.delete("dropdown")}function ct(h){let b=G();if(s.active(z(b,!!Re(r).alert)==="base",h.events),g&&!b.accessory)ge();let w=J(b.selected);if(d!==void 0&&w===d)d=void 0;if(w!==null&&d===void 0){if(i=w,a!==w)a=w,ae(h,Z(b.list,"onSelectionChange",[w]))}let C=br(b.list,b.items,w,m);if(C)m=C.count,ae(h,C.event)}function Ue(h){let b=We(r?.root),w=b?.props.searchText;if(b?.id!==R)kt(b);else if(w!==A){if(w===_)_=void 0;if(typeof w==="string"&&_===void 0)o=w}A=w;let C=b?.props.selectedItemId;if(C!==f)d=void 0;f=C;let B=G();s.scene(b?.type==="Form"?b:void 0,h.events,z(B,!!Re(r).alert)==="base"),K=!1;let k=B.navigation?.props;if(k){let Y=JSON.stringify(k.clearSearchBar)??"",be=JSON.stringify(k.popToRoot)??"",fe=k.popToRoot;if(Y&&Y!==F||be!==U&&fe&&typeof fe==="object"&&!Array.isArray(fe)&&"clearSearchBar"in fe&&fe.clearSearchBar)o="",_=void 0,de.delete("search"),K=!0,ae(h,Z(B.list,"onSearchTextChange",[""]));if(F=Y,U=be,k.closeMainWindow)M(h)}let{hud:P}=Re(r),H=P?`${P.node.id}\x00${P.title}`:"";if(H!==re){re=H,ue=!!P;let Y=++Pe;if(P)h.effects.push({type:"schedule",ms:e.hudDurationMs??P.durationMs??Nt,token:`hud:${Y}`})}let q=Re(r).toast,ee=q?`${q.node.id}\x00${JSON.stringify(q.node)}`:"";if(ee!==Ie){Ie=ee,se=!!q;let Y=++Ke;if(q&&q.style!=="animated")h.effects.push({type:"schedule",ms:e.toastDurationMs??yr,token:`toast:${Y}`})}}function Oe(h,b){let w=G(),C=b==="up"||b==="down",B=b==="down"||b==="right"?1:-1;switch(z(w,!!Re(r).alert)){case"alert":return;case"menu":return ut(h,w,C?{type:"move",delta:B}:b==="left"?{type:"back"}:{type:"activate"});case"dropdown":if(C)S=pt(Ne(w).index+B,Ne(w).options.length);return;case"panel":if(C)u=pt($e(w).index+B,$e(w).items.length);return}if(w.list?.type==="Form")return;if(!C&&!w.grid)return;let k=J(w.selected),P=w.items.findIndex((H)=>H.id===w.selected?.id);lt(h,w,w.grid?rr(w.grid.rows,k,b):J(w.items[pt(P+B,w.items.length)]))}function lt(h,b,w){if(b.list?.props.selectedItemId==null){i=w;return}if(w===null||w===J(b.selected))return;d=w,a=w,ae(h,Z(b.list,"onSelectionChange",[w]))}function ut(h,b,w){let C=wr(r,{path:l,selectedId:i},w,t);if(C.leave)Be(h,b);l=C.state.path,i=C.state.selectedId;for(let B of C.events)ae(h,B)}function St(h,b){switch(z(b,!!Re(r).alert)){case"alert":return;case"menu":return ut(h,b,{type:"activate"});case"dropdown":{let{chosen:w}=Ne(b);if(!w)return;return ae(h,Z(b.accessory,"onChange",[w.value])),ge()}case"panel":{let{chosen:w}=$e(b);if(w?.type==="ActionPanel.Submenu")return ae(h,Z(w,"onOpen")),Me([...p??[],w.id]);je(h,w),p=null;return}}je(h,b.primary)}function Rt(h,b){let{alert:w}=Re(r);switch(z(b,!!w)){case"alert":return je(h,w?.dismiss?.node);case"menu":return ut(h,b,{type:"back",escape:!0});case"dropdown":return ge();case"panel":{let C=p??[];p=C.length?C.slice(0,-1):null,c="",u=0;return}}Be(h,b)}function ze(h,b,w){let C=Re(r),B=z(b,!!C.alert);if(B==="menu"){let ee=xr(b.list,w,t);if(!ee)return;h.handled=!0;let Y=Fe(ee,ee.props.onAction,[{type:"left-click"}]);if(Y)ae(h,Y);return}if(B!=="base"&&B!=="panel")return;let k=B==="base"&&se&&C.toast?.actions.find((ee)=>Ge(ee.shortcut,w,t));if(k)return h.handled=!0,je(h,k.node);let P=It(b.actions,"",t),H=0,q=P.find((ee)=>{if(!ee.item)return!1;let Y=Ge(rn(ee.node,H),w,t);return H++,Y});if(!q)return;if(h.handled=!0,p=null,c="",u=0,q.node.type==="ActionPanel.Submenu")ae(h,Z(q.node,"onOpen")),Me([q.node.id]);else je(h,q.node)}function zt(h,b){let w=G(),C=Re(r),B=z(w,!!C.alert);switch(b.type){case"focus":case"focusNext":case"focusPrev":case"setValue":case"toggle":case"optionMove":case"optionChoose":if(B==="base"&&w.list?.type==="Form")s.input(b,h.events);return;case"submit":if(B==="base"&&w.list?.type==="Form")je(h,w.primary);return;case"search":{if(B!=="base"||X(w)||o===b.text)return;o=b.text,K=!1;let k=sn(w.list,b.text);return _=k?b.text:void 0,V(h,"search",k)}case"move":return Oe(h,b.direction);case"select":{if(B!=="base"||X(w))return;if(w.items.some((k)=>J(k)===b.id))lt(h,w,b.id);return}case"primary":return St(h,w);case"openActions":if(B==="base"&&w.list?.type!=="MenuBarExtra")Me([]);return;case"closeActions":if(B==="panel")p=null;return;case"actionsQuery":{if(B!=="panel")return;return c=b.text,u=0,ae(h,Z($e(w).node,"onSearchTextChange",[b.text]))}case"key":return ze(h,w,b.key);case"back":return Rt(h,w);case"openDropdown":if(B==="base"&&w.accessory)g=!0,y="",S=0;return;case"dropdownQuery":if(B!=="dropdown")return;return y=b.text,S=0,V(h,"dropdown",sn(w.accessory,b.text));case"chooseDropdown":if(B==="dropdown")St(h,w);return;case"toastAction":{if(B==="alert")return;let k=se&&C.toast?.actions[b.index];return k?je(h,k.node):void 0}case"alert":{let{alert:k}=C;if(!k)return;if(b.remember!==void 0)ae(h,Z(k.node,"onRememberUserChoiceChange",[b.remember]));return je(h,(b.confirm?k.primary:k.dismiss)?.node)}}}function De(h){ct(h);let b=dt(),w=JSON.stringify(b);if(w!==j){j=w;for(let C of N)C(b)}return h}function dt(){let h=G(),b=Re(r),w=z(h,!!b.alert),C=!h.list?"empty":h.list.type==="Grid"?"grid":h.list.type==="Detail"?"detail":h.list.type==="Form"?"form":h.list.type==="MenuBarExtra"?"menu-bar":"list",B=J(h.selected),k=(O)=>{let oe=O.item;return{id:oe?J(O.node)??O.node.id:O.node.id,kind:oe?"item":O.unsupported?"unsupported":"section",title:O.title??O.text,subtitle:O.subtitle??"",accessories:O.accessories??"",icon:O.icon===!0,iconLabel:O.iconView?.label??"",...qe(O.iconView),count:O.count??null,selected:oe&&O.node.id===h.selected?.id,text:O.text}},P=$e(h),H=Ne(h),q=on(r,{path:l,selectedId:i},t,n),ee=h.primary,Y=[];if(p?.length){let O=h.actions;Y=p.map((oe)=>(O=At(O,"",t).find((Ye)=>Ye.node.id===oe)?.node,x(O?.props.title)))}let be=se?b.toast:void 0,fe=b.alert,Yt=fe?.dismiss,Qt=fe?.primary,Xn=h.empty?.props.icon?ye(h.empty.props.icon,n):void 0;return{kind:C,title:h.title,navigation:{canGoBack:ie(h.navigation?.props.pop)},loading:h.loading,search:{text:o,placeholder:x(h.list?.props.searchBarPlaceholder)||"Search…"},rows:C==="list"?h.rows.map(k):[],grid:h.grid?h.grid.rows.map((O)=>({id:O.node?O.node.id:null,header:O.header,cells:O.cells.map((oe)=>{let Ye=tr(oe,n);return{id:J(oe)??oe.id,title:x(oe.props.title),subtitle:x(oe.props.subtitle),content:er(oe),...Ye?.source?{iconSource:Ye.source}:{},...Ye?.mask?{iconMask:Ye.mask}:{},selected:oe.id===h.selected?.id}})})):null,selectedId:B,emptyText:h.emptyText,empty:h.empty?{title:x(h.empty.props.title),description:x(h.empty.props.description),iconLabel:Xn?.label??"",...qe(Xn)}:null,detail:h.detail,primary:{title:x(ee?.props.title)||(C==="form"?"Submit":"Run"),shortcut:Te({modifiers:[],key:"return"},t),enabled:!!ee},actions:{open:w==="panel",title:x(P.node?.props.title)||"Actions",query:c,breadcrumb:Y,rows:P.rows.map((O)=>({id:O.node.id,kind:!O.item?"section":O.isSubmenu?"submenu":"action",title:O.title??O.text,shortcut:O.shortcut??"",selected:O.item&&O.node.id===P.chosen?.id})),selectedIndex:P.index},dropdown:h.accessory?{label:ir(h.accessory,tn(h.accessory)),tooltip:x(h.accessory.props.tooltip),open:w==="dropdown",query:y,options:H.options.map((O,oe)=>({value:O.value,title:O.title,section:O.section,current:O.value===x(h.accessory?.props.value??h.accessory?.props.defaultValue),selected:oe===H.index})),selectedIndex:H.index}:null,feedback:{toast:be?{style:be.style,title:be.title,message:be.message,actions:be.actions.map((O)=>({title:O.title,shortcut:Te(O.shortcut,t)}))}:null,hud:b.hud&&ue?{title:b.hud.title}:null,alert:fe?{title:fe.title,message:fe.message,rememberUserChoice:fe.rememberUserChoice,remember:fe.node.props.rememberChoice===!0,primary:Qt?{title:Qt.title,style:Qt.style}:null,dismiss:Yt?{title:Yt.title,style:Yt.style}:null}:null},menuBar:q.menu?{title:q.title,tooltip:q.tooltip,loading:q.isLoading,path:q.path,selectedId:q.selected?J(q.selected.node):null,rows:q.rows.map((O)=>({id:O.node.id,kind:!O.item?"section":O.isSubmenu?"submenu":"item",title:O.title??"",subtitle:O.subtitle??"",iconLabel:O.iconLabel??"",...O.iconTint?{iconTint:O.iconTint}:{},...O.iconSource?{iconSource:O.iconSource}:{},...O.iconMask?{iconMask:O.iconMask}:{},shortcut:O.shortcut??"",disabled:O.disabled,selected:O.item&&O.node.id===q.selected?.node.id}))}:null,form:C==="form"?s.view():null,requests:{quit:D,clearSearch:K}}}return{scene(h){r=h;let b=an();return Ue(b),De(b)},input(h){let b=an();return zt(b,h),De(b)},tick(h){let b=an();if(h===`hud:${Pe}`)ue=!1;if(h===`toast:${Ke}`)se=!1;for(let[w,C]of de)if(C.token===h)de.delete(w),ae(b,C.event);return De(b)},view:dt,subscribe(h){return N.add(h),()=>void N.delete(h)}}}var Ji="Search commands…",Er="Open Command",Ki="Configure Command",$r={modifiers:["cmd","shift"],key:","},kr=[{id:"open"},{id:"configure"}],zi={view:"Command","no-view":"No View","menu-bar":"Menu Bar"},nt=(e)=>`${e.extension}:${e.command}`;function Sr(e=[],t={}){let n=t.platform??"Linux",r=e,s="",o=null,i=!1,a=0,f=null,d=new Set,l=()=>{let y=new Map;for(let m of r){let R=y.get(m.extension);if(R)R.push(m);else y.set(m.extension,[m])}let S=[...y].map(([m,R])=>({section:m,items:R}));return Se(S,s,(m)=>we({title:m.title,subtitle:m.subtitle||m.description||"",keywords:[m.command,m.extension,m.extensionTitle??""]},s),{enabled:!0,keepSectionOrder:!0}).flatMap((m)=>m.items)},p=(y)=>y.find((S)=>nt(S)===o)??y[0],c=()=>{let y=l(),S=p(y),m=[],R;for(let A of y){if(A.extension!==R){R=A.extension;let F=A.extensionTitle??R;m.push({id:`section:${R}`,kind:"section",title:F,subtitle:"",accessories:"",icon:!1,count:y.filter((U)=>U.extension===R).length,selected:!1,iconLabel:"",text:F})}let _=A.subtitle||A.description||"";m.push({id:nt(A),kind:"item",title:A.title,subtitle:_,accessories:A.mode?zi[A.mode]:"",icon:!!A.icon,count:null,selected:A===S,iconLabel:A.icon?.label??"",...qe(A.icon),text:_?`${A.title} ${_}`:A.title})}return{kind:"list",title:"Commands",navigation:{canGoBack:!1},loading:!1,search:{text:s,placeholder:Ji},rows:m,grid:null,selectedId:S?nt(S):null,emptyText:s?"No matching commands":"No commands",empty:null,detail:"",primary:{title:Er,shortcut:"",enabled:!!S},actions:{open:i&&!!S,title:S?.title??"Actions",query:"",breadcrumb:[],rows:i&&S?[{id:"open",kind:"action",title:Er,shortcut:"",selected:a===0},{id:"configure",kind:"action",title:Ki,shortcut:Te($r,n),selected:a===1}]:[],selectedIndex:i&&S?a:-1},dropdown:null,feedback:{toast:f&&{style:"failure",...f,actions:[]},hud:null,alert:null},menuBar:null,form:null,requests:{quit:!1,clearSearch:!1}}},u=()=>{let y=c();for(let S of d)S(y)},g=(y)=>{let S=p(l());return i=!1,{effects:S?[{type:y,extension:S.extension,command:S.command}]:[]}};return{input(y){f=null;let S={effects:[]};switch(y.type){case"search":s=y.text,o=null,i=!1;break;case"move":{let m=l(),R=y.direction==="down"?1:y.direction==="up"?-1:0,A=p(m);if(i){a=Math.max(0,Math.min(kr.length-1,a+R));break}let _=m[(A?m.indexOf(A):0)+R];if(_)o=nt(_);break}case"select":{let m=l().find((R)=>nt(R)===y.id);if(m)o=nt(m);break}case"primary":S=g(i&&kr[a]?.id==="configure"?"configure":"launch");break;case"key":if(Ge($r,y.key,n))S=g("configure");break;case"openActions":i=!0,a=0;break;case"closeActions":case"back":i=!1;break;default:break}return u(),S},setCatalog(y){r=y,u()},fail(y,S){f={title:y,message:S},u()},reset(){s="",i=!1,f=null,u()},view:c,subscribe(y){return d.add(y),y(c()),()=>d.delete(y)}}}class ft extends Error{code="BROWSER_MISSING_FILE";path;constructor(e){super(`Browser bundle file is missing: ${e}`);this.name="BrowserMissingFileError",this.path=e}}class ln extends Error{code="BROWSER_MISSING_DEPENDENCY";packages;constructor(e){let t=[...new Set(e)].toSorted();super(`Browser bundle dependencies are missing: ${t.join(", ")}`);this.name="BrowserMissingDependencyError",this.packages=t}}class un extends Error{code="BROWSER_NATIVE_MODULE";modules;constructor(e){let t=[...new Set(e)].toSorted();super(`Native modules are not supported in a browser bundle: ${t.join(", ")}`);this.name="BrowserNativeModuleError",this.modules=t}}var dn=[".tsx",".ts",".jsx",".js",".json"],Yi=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"],Qi=new Set(Yi),Zi=new Set(["better-sqlite3","canvas","fsevents","keytar","node-gyp-build","sharp","sqlite3"]);function ce(e){let t=[];for(let n of e.replaceAll("\\","/").split("/")){if(!n||n===".")continue;if(n==="..")t.pop();else t.push(n)}return`/${t.join("/")}`}function rt(e){return e.startsWith("@")?e.split("/").slice(0,2).join("/"):e.split("/")[0]}function ea(e){return e.startsWith("node:")||Qi.has(e)}function ta(e){let t=dn.find((n)=>e.endsWith(n));if(t===".tsx")return"tsx";if(t===".ts")return"ts";if(t===".jsx")return"jsx";if(t===".json")return"json";return"js"}function na(e){return e}function ra(e){return typeof e==="string"?e:new TextDecoder().decode(e)}function me(e,t){let n=ce(t),r=n.replace(/\.[cm]?jsx?$/,""),s=[n,...r===n?[]:dn.map((o)=>`${r}${o}`),...dn.map((o)=>`${n}${o}`),`${n}/index.ts`,`${n}/index.tsx`,`${n}/index.js`,`${n}/index.json`];for(let o of s){if(e.has(o))return o;let i=o.slice(1);if(e.has(i))return i}return}function sa(e,t){let n=me(e,`${t}/package.json`);if(!n)return;try{let r=JSON.parse(ra(e.get(n)));return r&&typeof r==="object"?r:void 0}catch{return}}function oa(e,t,n){let r=[],s=ce(t.slice(0,t.lastIndexOf("/"))||"/");while(!0){let i=ce(`${s}/node_modules/${n}`);if(e.has(i)||e.has(i.slice(1))||[...e.keys()].some((a)=>ce(a).startsWith(`${i}/`)))r.push(i);if(s==="/")break;s=ce(`${s}/..`)}let o=`/${n}`;if(e.has(o)||e.has(n)||[...e.keys()].some((i)=>ce(i).startsWith(`${o}/`)))r.push(o);return[...new Set(r)]}function mt(e,t){if(typeof e==="string")return e;if(e===null||e===!1)return!1;if(Array.isArray(e)){for(let s of e){let o=mt(s,t);if(o!==void 0&&o!==!1)return o}return}if(!e||typeof e!=="object")return;let n=e,r=Object.keys(n).filter((s)=>s.startsWith("."));if(r.length){let s=n[t];if(s!==void 0)return mt(s,t);let o=r.filter((i)=>i.endsWith("*")&&t.startsWith(i.slice(0,-1))).toSorted((i,a)=>a.length-i.length)[0];if(o){let i=mt(n[o],t);return typeof i==="string"?i.replaceAll("*",t.slice(o.length-1)):i}return}for(let s of["browser","import","module","require","default"])if(n[s]!==void 0){let o=mt(n[s],t);if(o!==void 0)return o}return}function ia(e,t,n){let r=rt(t),s=t.slice(r.length).replace(/^\//,"");for(let o of oa(e,n,r)){let i=sa(e,o),a=s?`./${s}`:".";if(i?.exports!==void 0){let c=mt(i.exports,a);if(c===!1||c===void 0)return[];let u=me(e,ce(`${o}/${c}`));return u?[u]:[]}let f=s?ce(`${o}/${s}`):void 0;if(f){let c=me(e,f);if(c)return[c];continue}let d=i?.browser;if(typeof d==="string"){let c=me(e,ce(`${o}/${d}`));if(c)return[c]}let l=[],p=typeof i?.module==="string"?i.module:typeof i?.main==="string"?i.main:"index";if(typeof d==="object"&&d){let c=d[`./${p}`]??d["."];if(typeof c==="string")l.push(ce(`${o}/${c}`))}if(l.push(ce(`${o}/${p}`)),typeof i?.main==="string"&&typeof i?.module==="string")l.push(ce(`${o}/${i.main}`));l.push(ce(`${o}/index`));for(let c of l){let u=me(e,c);if(u)return[u]}}return[]}async function Rr(e){let t=new Map([...e.files,...e.packages]),n=me(t,e.command),r=me(t,e.runtimeEntry);if(!n)throw new ft(e.command);if(!r)throw new ft(e.runtimeEntry);let s=new Set,o=new Set,i=new Set,a="/__blast_browser_bundle_entry__.js",f={name:"blast-browser-memory",setup(p){p.onResolve({filter:/.*/},(c)=>{let u=c.path;if(c.kind==="entry-point"){if(u===a)return{path:a};let m=me(t,u);return m?{path:m}:void 0}if(e.sharedRuntime&&e.sharedModules?.includes(u))return{path:`/__blast_shared_${u.replaceAll("/","_")}`};let g=e.aliases?.[u];if(g)return{path:me(t,g)??g};if(ea(u))return{path:u,external:!0};if(u.endsWith(".node"))return o.add(u),{errors:[{text:`Native module ${u} is not supported`}]};if(!u.startsWith(".")&&!u.startsWith("/")&&Zi.has(rt(u)))return o.add(rt(u)),{errors:[{text:`Native package ${rt(u)} is not supported`}]};if(u==="@blastlauncher/command")return{path:n};let y=u.startsWith(".")||u.startsWith("/"),S=y?me(t,ce(`${c.importer.slice(0,c.importer.lastIndexOf("/"))}/${u}`)):g?me(t,g):ia(t,u,c.importer).map((m)=>me(t,m)).find(Boolean);if(S)return{path:S.startsWith("/")?S:`/${S}`};if(!y)return s.add(rt(u)),{errors:[{text:`Missing browser dependency ${rt(u)}`}]};return i.add(u),{errors:[{text:`Missing browser file ${u}`}]}}),p.onLoad({filter:/.*/},(c)=>{if(c.path===a)return{contents:e.entryCode?e.entryCode:e.sharedRuntime?`const __blastRuntime = globalThis.__blastRuntime;
|
|
1
|
+
var ii=Object.create;var{getPrototypeOf:ai,defineProperty:Jn,getOwnPropertyNames:ci}=Object;var Kn=Object.prototype.hasOwnProperty;function li(e){return this[e]}var ui,di,pi=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var s=t?ui??=new WeakMap:di??=new WeakMap,o=s.get(e);if(o)return o}n=e!=null?ii(ai(e)):{};let i=t||!e||!e.__esModule||!Kn.call(e,"default")?Jn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of ci(e))if(!Kn.call(i,a))Jn(i,a,{get:li.bind(e,a),enumerable:!0})}if(r)s.set(e,i);return i};var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nt=T(function(fp,vr){var ua=Number.MAX_SAFE_INTEGER||9007199254740991,da=["major","premajor","minor","preminor","patch","prepatch","prerelease"];vr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ua,RELEASE_TYPES:da,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var mt=T(function(mp,Ir){var pa=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ir.exports=pa});var rt=T(function(Oe,Ar){var{MAX_SAFE_COMPONENT_LENGTH:pn,MAX_SAFE_BUILD_LENGTH:fa,MAX_LENGTH:ma}=nt(),ga=mt();Oe=Ar.exports={};var ha=Oe.re=[],ba=Oe.safeRe=[],I=Oe.src=[],ya=Oe.safeSrc=[],A=Oe.t={},wa=0,fn="[a-zA-Z0-9-]",xa=[["\\s",1],["\\d",ma],[fn,fa]],Ea=(e)=>{for(let[t,n]of xa)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},L=(e,t,n)=>{let r=Ea(t),s=wa++;ga(e,s,t),A[e]=s,I[s]=t,ya[s]=r,ha[s]=new RegExp(t,n?"g":void 0),ba[s]=new RegExp(r,n?"g":void 0)};L("NUMERICIDENTIFIER","0|[1-9]\\d*");L("NUMERICIDENTIFIERLOOSE","\\d+");L("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fn}*`);L("MAINVERSION",`(${I[A.NUMERICIDENTIFIER]})\\.(${I[A.NUMERICIDENTIFIER]})\\.(${I[A.NUMERICIDENTIFIER]})`);L("MAINVERSIONLOOSE",`(${I[A.NUMERICIDENTIFIERLOOSE]})\\.(${I[A.NUMERICIDENTIFIERLOOSE]})\\.(${I[A.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASEIDENTIFIER",`(?:${I[A.NONNUMERICIDENTIFIER]}|${I[A.NUMERICIDENTIFIER]})`);L("PRERELEASEIDENTIFIERLOOSE",`(?:${I[A.NONNUMERICIDENTIFIER]}|${I[A.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASE",`(?:-(${I[A.PRERELEASEIDENTIFIER]}(?:\\.${I[A.PRERELEASEIDENTIFIER]})*))`);L("PRERELEASELOOSE",`(?:-?(${I[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[A.PRERELEASEIDENTIFIERLOOSE]})*))`);L("BUILDIDENTIFIER",`${fn}+`);L("BUILD",`(?:\\+(${I[A.BUILDIDENTIFIER]}(?:\\.${I[A.BUILDIDENTIFIER]})*))`);L("FULLPLAIN",`v?${I[A.MAINVERSION]}${I[A.PRERELEASE]}?${I[A.BUILD]}?`);L("FULL",`^${I[A.FULLPLAIN]}$`);L("LOOSEPLAIN",`[v=\\s]*${I[A.MAINVERSIONLOOSE]}${I[A.PRERELEASELOOSE]}?${I[A.BUILD]}?`);L("LOOSE",`^${I[A.LOOSEPLAIN]}$`);L("GTLT","((?:<|>)?=?)");L("XRANGEIDENTIFIERLOOSE",`${I[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);L("XRANGEIDENTIFIER",`${I[A.NUMERICIDENTIFIER]}|x|X|\\*`);L("XRANGEPLAIN",`[v=\\s]*(${I[A.XRANGEIDENTIFIER]})(?:\\.(${I[A.XRANGEIDENTIFIER]})(?:\\.(${I[A.XRANGEIDENTIFIER]})(?:${I[A.PRERELEASE]})?${I[A.BUILD]}?)?)?`);L("XRANGEPLAINLOOSE",`[v=\\s]*(${I[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[A.XRANGEIDENTIFIERLOOSE]})(?:${I[A.PRERELEASELOOSE]})?${I[A.BUILD]}?)?)?`);L("XRANGE",`^${I[A.GTLT]}\\s*${I[A.XRANGEPLAIN]}$`);L("XRANGELOOSE",`^${I[A.GTLT]}\\s*${I[A.XRANGEPLAINLOOSE]}$`);L("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pn}})(?:\\.(\\d{1,${pn}}))?(?:\\.(\\d{1,${pn}}))?`);L("COERCE",`${I[A.COERCEPLAIN]}(?:$|[^\\d])`);L("COERCEFULL",I[A.COERCEPLAIN]+`(?:${I[A.PRERELEASE]})?(?:${I[A.BUILD]})?(?:$|[^\\d])`);L("COERCERTL",I[A.COERCE],!0);L("COERCERTLFULL",I[A.COERCEFULL],!0);L("LONETILDE","(?:~>?)");L("TILDETRIM",`(\\s*)${I[A.LONETILDE]}\\s+`,!0);Oe.tildeTrimReplace="$1~";L("TILDE",`^${I[A.LONETILDE]}${I[A.XRANGEPLAIN]}$`);L("TILDELOOSE",`^${I[A.LONETILDE]}${I[A.XRANGEPLAINLOOSE]}$`);L("LONECARET","(?:\\^)");L("CARETTRIM",`(\\s*)${I[A.LONECARET]}\\s+`,!0);Oe.caretTrimReplace="$1^";L("CARET",`^${I[A.LONECARET]}${I[A.XRANGEPLAIN]}$`);L("CARETLOOSE",`^${I[A.LONECARET]}${I[A.XRANGEPLAINLOOSE]}$`);L("COMPARATORLOOSE",`^${I[A.GTLT]}\\s*(${I[A.LOOSEPLAIN]})$|^$`);L("COMPARATOR",`^${I[A.GTLT]}\\s*(${I[A.FULLPLAIN]})$|^$`);L("COMPARATORTRIM",`(\\s*)${I[A.GTLT]}\\s*(${I[A.LOOSEPLAIN]}|${I[A.XRANGEPLAIN]})`,!0);Oe.comparatorTrimReplace="$1$2$3";L("HYPHENRANGE",`^\\s*(${I[A.XRANGEPLAIN]})\\s+-\\s+(${I[A.XRANGEPLAIN]})\\s*$`);L("HYPHENRANGELOOSE",`^\\s*(${I[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[A.XRANGEPLAINLOOSE]})\\s*$`);L("STAR","(<|>)?=?\\s*\\*");L("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");L("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Nt=T(function(gp,Or){var $a=Object.freeze({loose:!0}),ka=Object.freeze({}),Sa=(e)=>{if(!e)return ka;if(typeof e!=="object")return $a;return e};Or.exports=Sa});var mn=T(function(hp,Tr){var Nr=/^[0-9]+$/,Cr=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let n=Nr.test(e),r=Nr.test(t);if(n&&r)e=+e,t=+t;return e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},Ra=(e,t)=>Cr(t,e);Tr.exports={compareIdentifiers:Cr,rcompareIdentifiers:Ra}});var te=T(function(bp,Pr){var Ct=mt(),{MAX_LENGTH:Lr,MAX_SAFE_INTEGER:Tt}=nt(),{safeRe:Lt,t:Pt}=rt(),va=Nt(),{compareIdentifiers:gn}=mn(),Ia=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;r<n.length;r++)if(gn(e[r],n[r])!==0)return!1;return!0};class Ie{constructor(e,t){if(t=va(t),e instanceof Ie)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lr)throw TypeError(`version is longer than ${Lr} characters`);Ct("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Lt[Pt.LOOSE]:Lt[Pt.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Tt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Tt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Tt||this.patch<0)throw TypeError("Invalid patch version");if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map((r)=>{if(/^[0-9]+$/.test(r)){let s=+r;if(s>=0&&s<Tt)return s}return r});this.build=n[5]?n[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Ct("SemVer.compare",this.version,this.options,e),!(e instanceof Ie)){if(typeof e==="string"&&e===this.version)return 0;e=new Ie(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Ie))e=new Ie(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Ie))e=new Ie(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],r=e.prerelease[t];if(Ct("prerelease compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return gn(n,r)}while(++t)}compareBuild(e){if(!(e instanceof Ie))e=new Ie(e,this.options);let t=0;do{let n=this.build[t],r=e.build[t];if(Ct("build compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return gn(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw Error("invalid increment argument: identifier is empty");if(t){let r=`-${t}`.match(this.options.loose?Lt[Pt.PRERELEASELOOSE]:Lt[Pt.PRERELEASE]);if(!r||r[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,n);this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){let s=[t,r];if(n===!1)s=[t];if(Ia(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Pr.exports=Ie});var Fe=T(function(yp,Br){var Mr=te(),Aa=(e,t,n=!1)=>{if(e instanceof Mr)return e;try{return new Mr(e,t)}catch(r){if(!n)return null;throw r}};Br.exports=Aa});var jr=T(function(wp,Fr){var Oa=Fe(),Na=(e,t)=>{let n=Oa(e,t);return n?n.version:null};Fr.exports=Na});var Vr=T(function(xp,_r){var Ca=Fe(),Ta=(e,t)=>{let n=Ca(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};_r.exports=Ta});var qr=T(function(Ep,Dr){var Ur=te(),La=(e,t,n,r,s)=>{if(typeof n==="string")s=r,r=n,n=void 0;try{return new Ur(e instanceof Ur?e.version:e,n).inc(t,r,s).version}catch(o){return null}};Dr.exports=La});var Hr=T(function($p,Wr){var Gr=Fe(),Pa=(e,t)=>{let n=Gr(e,null,!0),r=Gr(t,null,!0),s=n.compare(r);if(s===0)return null;let o=s>0,i=o?n:r,a=o?r:n,f=!!i.prerelease.length;if(!!a.prerelease.length&&!f){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let l=f?"pre":"";if(n.major!==r.major)return l+"major";if(n.minor!==r.minor)return l+"minor";if(n.patch!==r.patch)return l+"patch";return"prerelease"};Wr.exports=Pa});var Jr=T(function(kp,Xr){var Ma=te(),Ba=(e,t)=>new Ma(e,t).major;Xr.exports=Ba});var zr=T(function(Sp,Kr){var Fa=te(),ja=(e,t)=>new Fa(e,t).minor;Kr.exports=ja});var Qr=T(function(Rp,Yr){var _a=te(),Va=(e,t)=>new _a(e,t).patch;Yr.exports=Va});var es=T(function(vp,Zr){var Ua=Fe(),Da=(e,t)=>{let n=Ua(e,t);return n&&n.prerelease.length?n.prerelease:null};Zr.exports=Da});var Ee=T(function(Ip,ns){var ts=te(),qa=(e,t,n)=>new ts(e,n).compare(new ts(t,n));ns.exports=qa});var ss=T(function(Ap,rs){var Ga=Ee(),Wa=(e,t,n)=>Ga(t,e,n);rs.exports=Wa});var is=T(function(Op,os){var Ha=Ee(),Xa=(e,t)=>Ha(e,t,!0);os.exports=Xa});var Mt=T(function(Np,cs){var as=te(),Ja=(e,t,n)=>{let r=new as(e,n),s=new as(t,n);return r.compare(s)||r.compareBuild(s)};cs.exports=Ja});var us=T(function(Cp,ls){var Ka=Mt(),za=(e,t)=>e.sort((n,r)=>Ka(n,r,t));ls.exports=za});var ps=T(function(Tp,ds){var Ya=Mt(),Qa=(e,t)=>e.sort((n,r)=>Ya(r,n,t));ds.exports=Qa});var gt=T(function(Lp,fs){var Za=Ee(),ec=(e,t,n)=>Za(e,t,n)>0;fs.exports=ec});var Bt=T(function(Pp,ms){var tc=Ee(),nc=(e,t,n)=>tc(e,t,n)<0;ms.exports=nc});var hn=T(function(Mp,gs){var rc=Ee(),sc=(e,t,n)=>rc(e,t,n)===0;gs.exports=sc});var bn=T(function(Bp,hs){var oc=Ee(),ic=(e,t,n)=>oc(e,t,n)!==0;hs.exports=ic});var Ft=T(function(Fp,bs){var ac=Ee(),cc=(e,t,n)=>ac(e,t,n)>=0;bs.exports=cc});var jt=T(function(jp,ys){var lc=Ee(),uc=(e,t,n)=>lc(e,t,n)<=0;ys.exports=uc});var yn=T(function(_p,ws){var dc=hn(),pc=bn(),fc=gt(),mc=Ft(),gc=Bt(),hc=jt(),bc=(e,t,n,r)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return dc(e,n,r);case"!=":return pc(e,n,r);case">":return fc(e,n,r);case">=":return mc(e,n,r);case"<":return gc(e,n,r);case"<=":return hc(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}};ws.exports=bc});var Es=T(function(Vp,xs){var yc=te(),wc=Fe(),{safeRe:_t,t:Vt}=rt(),xc=(e,t)=>{if(e instanceof yc)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?_t[Vt.COERCEFULL]:_t[Vt.COERCE]);else{let f=t.includePrerelease?_t[Vt.COERCERTLFULL]:_t[Vt.COERCERTL],d;while((d=f.exec(e))&&(!n||n.index+n[0].length!==e.length)){if(!n||d.index+d[0].length!==n.index+n[0].length)n=d;f.lastIndex=d.index+d[1].length+d[2].length}f.lastIndex=-1}if(n===null)return null;let r=n[2],s=n[3]||"0",o=n[4]||"0",i=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return wc(`${r}.${s}.${o}${i}${a}`,t)};xs.exports=xc});var ks=T(function(Up,$s){var Ec=Fe(),$c=nt(),kc=te(),Sc=(e,t,n)=>{if(!$c.RELEASE_TYPES.includes(t))return null;let r=Rc(e,n);return r&&vc(r,t)},Rc=(e,t)=>{let n=e instanceof kc?e.version:e;return Ec(n,t)},vc=(e,t)=>{if(Ic(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Ic=(e)=>e.startsWith("pre");$s.exports=Sc});var vs=T(function(Dp,Rs){class Ss{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,t)}return this}}Rs.exports=Ss});var $e=T(function(qp,Ns){var Ac=/\s+/g;class ht{constructor(e,t){if(t=Nc(t),e instanceof ht)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new ht(e.raw,t);if(e instanceof wn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Ac," "),this.set=this.raw.split("||").map((n)=>this.parseRange(n.trim())).filter((n)=>n.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter((r)=>!As(r[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&_c(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let n=0;n<t.length;n++){if(n>0)this.formatted+=" ";this.formatted+=t[n].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(jc,"");let n=((this.options.includePrerelease&&Bc)|(this.options.loose&&Fc))+":"+e,r=Is.get(n);if(r)return r;let s=this.options.loose,o=s?le[ne.HYPHENRANGELOOSE]:le[ne.HYPHENRANGE];e=e.replace(o,zc(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(le[ne.COMPARATORTRIM],Lc),q("comparator trim",e),e=e.replace(le[ne.TILDETRIM],Pc),q("tilde trim",e),e=e.replace(le[ne.CARETTRIM],Mc),q("caret trim",e);let i=e.split(" ").map((l)=>Vc(l,this.options)).join(" ").split(/\s+/).map((l)=>Kc(l,this.options));if(s)i=i.filter((l)=>(q("loose invalid filter",l,this.options),!!l.match(le[ne.COMPARATORLOOSE])));q("range list",i);let a=new Map,f=i.map((l)=>new wn(l,this.options));for(let l of f){if(As(l))return[l];a.set(l.value,l)}if(a.size>1&&a.has(""))a.delete("");let d=[...a.values()];return Is.set(n,d),d}intersects(e,t){if(!(e instanceof ht))throw TypeError("a Range is required");return this.set.some((n)=>Os(n,t)&&e.set.some((r)=>Os(r,t)&&n.every((s)=>r.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Cc(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Yc(this.set[t],e,this.options))return!0;return!1}}Ns.exports=ht;var Oc=vs(),Is=new Oc,Nc=Nt(),wn=bt(),q=mt(),Cc=te(),{safeRe:le,src:Tc,t:ne,comparatorTrimReplace:Lc,tildeTrimReplace:Pc,caretTrimReplace:Mc}=rt(),{FLAG_INCLUDE_PRERELEASE:Bc,FLAG_LOOSE:Fc}=nt(),jc=new RegExp(Tc[ne.BUILD],"g"),As=(e)=>e.value==="<0.0.0-0",_c=(e)=>e.value==="",Os=(e,t)=>{let n=!0,r=e.slice(),s=r.pop();while(n&&r.length)n=r.every((o)=>s.intersects(o,t)),s=r.pop();return n},Vc=(e,t)=>(e=e.replace(le[ne.BUILD],""),q("comp",e,t),e=Gc(e,t),q("caret",e),e=Dc(e,t),q("tildes",e),e=Hc(e,t),q("xrange",e),e=Jc(e,t),q("stars",e),e),Y=(e)=>!e||e.toLowerCase()==="x"||e==="*",Uc=(e,t,n)=>Y(e)&&!Y(t)||Y(t)&&n&&!Y(n),Dc=(e,t)=>e.trim().split(/\s+/).map((n)=>qc(n,t)).join(" "),qc=(e,t)=>{let n=t.loose?le[ne.TILDELOOSE]:le[ne.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{q("tilde",e,s,o,i,a,f);let d;if(Y(o))d="";else if(Y(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Y(a))d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else if(f)q("replaceTilde pr",f),d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;return q("tilde return",d),d})},Gc=(e,t)=>e.trim().split(/\s+/).map((n)=>Wc(n,t)).join(" "),Wc=(e,t)=>{q("caret",e,t);let n=t.loose?le[ne.CARETLOOSE]:le[ne.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{q("caret",e,s,o,i,a,f);let d;if(Y(o))d="";else if(Y(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Y(a))if(o==="0")d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.0${r} <${+o+1}.0.0-0`;else if(f)if(q("replaceCaret pr",f),o==="0")if(i==="0")d=`>=${o}.${i}.${a}-${f} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a}-${f} <${+o+1}.0.0-0`;else if(q("no pr"),o==="0")if(i==="0")d=`>=${o}.${i}.${a} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return q("caret return",d),d})},Hc=(e,t)=>(q("replaceXRanges",e,t),e.split(/\s+/).map((n)=>Xc(n,t)).join(" ")),Xc=(e,t)=>{e=e.trim();let n=t.loose?le[ne.XRANGELOOSE]:le[ne.XRANGE];return e.replace(n,(r,s,o,i,a,f)=>{if(q("xRange",e,r,s,o,i,a,f),Uc(o,i,a))return e;let d=Y(o),l=d||Y(i),p=l||Y(a),c=p;if(s==="="&&c)s="";if(f=t.includePrerelease?"-0":"",d)if(s===">"||s==="<")r="<0.0.0-0";else r="*";else if(s&&c){if(l)i=0;if(a=0,s===">")if(s=">=",l)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",l)o=+o+1;else i=+i+1;if(s==="<")f="-0";r=`${s+o}.${i}.${a}${f}`}else if(l)r=`>=${o}.0.0${f} <${+o+1}.0.0-0`;else if(p)r=`>=${o}.${i}.0${f} <${o}.${+i+1}.0-0`;return q("xRange return",r),r})},Jc=(e,t)=>(q("replaceStars",e,t),e.trim().replace(le[ne.STAR],"")),Kc=(e,t)=>(q("replaceGTE0",e,t),e.trim().replace(le[t.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),zc=(e)=>(t,n,r,s,o,i,a,f,d,l,p,c)=>{if(Y(r))n="";else if(Y(s))n=`>=${r}.0.0${e?"-0":""}`;else if(Y(o))n=`>=${r}.${s}.0${e?"-0":""}`;else if(i)n=`>=${n}`;else n=`>=${n}${e?"-0":""}`;if(Y(d))f="";else if(Y(l))f=`<${+d+1}.0.0-0`;else if(Y(p))f=`<${d}.${+l+1}.0-0`;else if(c)f=`<=${d}.${l}.${p}-${c}`;else if(e)f=`<${d}.${l}.${+p+1}-0`;else f=`<=${f}`;return`${n} ${f}`.trim()},Yc=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++){if(q(e[r].semver),e[r].semver===wn.ANY)continue;if(e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var bt=T(function(Gp,Bs){var yt=Symbol("SemVer ANY");class Ut{static get ANY(){return yt}constructor(e,t){if(t=Cs(t),e instanceof Ut)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),En("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===yt)this.value="";else this.value=this.operator+this.semver.version;En("comp",this)}parse(e){let t=this.options.loose?Ts[Ls.COMPARATORLOOSE]:Ts[Ls.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=n[1]!==void 0?n[1]:"",this.operator==="=")this.operator="";if(!n[2])this.semver=yt;else this.semver=new Ps(n[2],this.options.loose)}toString(){return this.value}test(e){if(En("Comparator.test",e,this.options.loose),this.semver===yt||e===yt)return!0;if(typeof e==="string")try{e=new Ps(e,this.options)}catch(t){return!1}return xn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ut))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ms(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ms(this.value,t).test(e.semver)}if(t=Cs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(xn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(xn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Bs.exports=Ut;var Cs=Nt(),{safeRe:Ts,t:Ls}=rt(),xn=yn(),En=mt(),Ps=te(),Ms=$e()});var wt=T(function(Wp,Fs){var Qc=$e(),Zc=(e,t,n)=>{try{t=new Qc(t,n)}catch(r){return!1}return t.test(e)};Fs.exports=Zc});var _s=T(function(Hp,js){var el=$e(),tl=(e,t)=>new el(e,t).set.map((n)=>n.map((r)=>r.value).join(" ").trim().split(" "));js.exports=tl});var Us=T(function(Xp,Vs){var nl=te(),rl=$e(),sl=(e,t,n)=>{let r=null,s=null,o=null;try{o=new rl(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===-1)r=i,s=new nl(r,n)}}),r};Vs.exports=sl});var qs=T(function(Jp,Ds){var ol=te(),il=$e(),al=(e,t,n)=>{let r=null,s=null,o=null;try{o=new il(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===1)r=i,s=new ol(r,n)}}),r};Ds.exports=al});var Hs=T(function(Kp,Ws){var $n=te(),cl=$e(),Gs=gt(),ll=(e,t)=>{e=new cl(e,t);let n=new $n("0.0.0");if(e.test(n))return n;if(n=new $n("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r<e.set.length;++r){let s=e.set[r],o=null;if(s.forEach((i)=>{let a=new $n(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Gs(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!n||Gs(n,o)))n=o}if(n&&e.test(n))return n;return null};Ws.exports=ll});var Js=T(function(zp,Xs){var ul=$e(),dl=(e,t)=>{try{return new ul(e,t).range||"*"}catch(n){return null}};Xs.exports=dl});var Dt=T(function(Yp,Qs){var pl=te(),Ys=bt(),{ANY:fl}=Ys,ml=$e(),gl=wt(),Ks=gt(),zs=Bt(),hl=jt(),bl=Ft(),yl=(e,t,n,r)=>{e=new pl(e,r),t=new ml(t,r);let s,o,i,a,f;switch(n){case">":s=Ks,o=hl,i=zs,a=">",f=">=";break;case"<":s=zs,o=bl,i=Ks,a="<",f="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(gl(e,t,r))return!1;for(let d=0;d<t.set.length;++d){let l=t.set[d],p=null,c=null;if(l.forEach((u)=>{if(u.semver===fl)u=new Ys(">=0.0.0");if(p=p||u,c=c||u,s(u.semver,p.semver,r))p=u;else if(i(u.semver,c.semver,r))c=u}),p.operator===a||p.operator===f)return!1;if((!c.operator||c.operator===a)&&o(e,c.semver))return!1;else if(c.operator===f&&i(e,c.semver))return!1}return!0};Qs.exports=yl});var eo=T(function(Qp,Zs){var wl=Dt(),xl=(e,t,n)=>wl(e,t,">",n);Zs.exports=xl});var no=T(function(Zp,to){var El=Dt(),$l=(e,t,n)=>El(e,t,"<",n);to.exports=$l});var oo=T(function(ef,so){var ro=$e(),kl=(e,t,n)=>(e=new ro(e,n),t=new ro(t,n),e.intersects(t,n));so.exports=kl});var ao=T(function(tf,io){var Sl=wt(),Rl=Ee();io.exports=(e,t,n)=>{let r=[],s=null,o=null,i=e.sort((l,p)=>Rl(l,p,n));for(let l of i)if(Sl(l,t,n)){if(o=l,!s)s=l}else{if(o)r.push([s,o]);o=null,s=null}if(s)r.push([s,null]);let a=[];for(let[l,p]of r)if(l===p)a.push(l);else if(!p&&l===i[0])a.push("*");else if(!p)a.push(`>=${l}`);else if(l===i[0])a.push(`<=${p}`);else a.push(`${l} - ${p}`);let f=a.join(" || "),d=typeof t.raw==="string"?t.raw:String(t);return f.length<d.length?f:t}});var mo=T(function(nf,fo){var co=$e(),Rn=bt(),{ANY:kn}=Rn,Sn=wt(),vn=Ee(),vl=(e,t,n={})=>{if(e===t)return!0;e=new co(e,n),t=new co(t,n);let r=!1;e:for(let s of e.set){for(let o of t.set){let i=Al(s,o,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Il=[new Rn(">=0.0.0-0")],lo=[new Rn(">=0.0.0")],Al=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===kn)if(t.length===1&&t[0].semver===kn)return!0;else if(n.includePrerelease)e=Il;else e=lo;if(t.length===1&&t[0].semver===kn)if(n.includePrerelease)return!0;else t=lo;let r=new Set,s,o;for(let u of e)if(u.operator===">"||u.operator===">=")s=uo(s,u,n);else if(u.operator==="<"||u.operator==="<=")o=po(o,u,n);else r.add(u.semver);if(r.size>1)return null;let i;if(s&&o){if(i=vn(s.semver,o.semver,n),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let u of r){if(s&&!Sn(u,String(s),n))return null;if(o&&!Sn(u,String(o),n))return null;for(let h of t)if(!Sn(u,String(h),n))return!1;return!0}let a,f,d,l,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,c=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(l=l||u.operator===">"||u.operator===">=",d=d||u.operator==="<"||u.operator==="<=",s){if(c){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===c.major&&u.semver.minor===c.minor&&u.semver.patch===c.patch)c=!1}if(u.operator===">"||u.operator===">="){if(a=uo(s,u,n),a===u&&a!==s)return!1}else if(s.operator===">="&&!u.test(s.semver))return!1}if(o){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator==="<"||u.operator==="<="){if(f=po(o,u,n),f===u&&f!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||s)&&i!==0)return!1}if(s&&d&&!o&&i!==0)return!1;if(o&&l&&!s&&i!==0)return!1;if(c||p)return!1;return!0},uo=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e},po=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};fo.exports=vl});var yo=T(function(rf,bo){var In=rt(),go=nt(),Ol=te(),ho=mn(),Nl=Fe(),Cl=jr(),Tl=Vr(),Ll=qr(),Pl=Hr(),Ml=Jr(),Bl=zr(),Fl=Qr(),jl=es(),_l=Ee(),Vl=ss(),Ul=is(),Dl=Mt(),ql=us(),Gl=ps(),Wl=gt(),Hl=Bt(),Xl=hn(),Jl=bn(),Kl=Ft(),zl=jt(),Yl=yn(),Ql=Es(),Zl=ks(),eu=bt(),tu=$e(),nu=wt(),ru=_s(),su=Us(),ou=qs(),iu=Hs(),au=Js(),cu=Dt(),lu=eo(),uu=no(),du=oo(),pu=ao(),fu=mo();bo.exports={parse:Nl,valid:Cl,clean:Tl,inc:Ll,diff:Pl,major:Ml,minor:Bl,patch:Fl,prerelease:jl,compare:_l,rcompare:Vl,compareLoose:Ul,compareBuild:Dl,sort:ql,rsort:Gl,gt:Wl,lt:Hl,eq:Xl,neq:Jl,gte:Kl,lte:zl,cmp:Yl,coerce:Ql,truncate:Zl,Comparator:eu,Range:tu,satisfies:nu,toComparators:ru,maxSatisfying:su,minSatisfying:ou,minVersion:iu,validRange:au,outside:cu,gtr:lu,ltr:uu,intersects:du,simplifyRange:pu,subset:fu,SemVer:Ol,re:In.re,src:In.src,tokens:In.t,SEMVER_SPEC_VERSION:go.SEMVER_SPEC_VERSION,RELEASE_TYPES:go.RELEASE_TYPES,compareIdentifiers:ho.compareIdentifiers,rcompareIdentifiers:ho.rcompareIdentifiers}});function ie(e){return e!==null&&typeof e==="object"&&"$handler"in e}function x(e){if(typeof e==="string"||typeof e==="number")return String(e);if(e&&typeof e==="object"&&"value"in e)return x(e.value);return""}function Se(e,t){return e.children.find((n)=>n.type==="Slot"&&n.props.name===t)}function J(e){return e?x(e.props.id??e.id):null}function Me(e,t,n=[]){return e&&ie(t)?{node:e.id,handler:t.$handler,args:n}:void 0}function Q(e,t,n=[]){return Me(e,e?.props[t],n)}function Zt(e){let t=e?.props.pagination;if(!t||typeof t!=="object"||Array.isArray(t))return;if(!("pageSize"in t)||!("hasMore"in t)||!("onLoadMore"in t))return;return t}function Ue(e){return{...e?.tint?{iconTint:e.tint}:{},...e?.source?{iconSource:e.source}:{},...e?.mask?{iconMask:e.mask}:{}}}var zn={add:"+",addperson:"+",airplane:"✈",alarm:"⏰",alarmringing:"⏰",aligncentre:"≡",alignleft:"≡",alignright:"≡",anchor:"⚓",appwindow:"▭",appwindowgrid2x2:"▦",appwindowgrid3x3:"▦",appwindowlist:"☰",appwindowsidebarleft:"▯",appwindowsidebarright:"▯",arrowclockwise:"↻",arrowcounterclockwise:"↺",arrowdown:"↓",arrowdowncircle:"↓",arrowleft:"←",arrowleftcircle:"←",arrowne:"↗",arrowright:"→",arrowrightcircle:"→",arrowup:"↑",arrowupcircle:"↑",arrowscontract:"⤡",arrowsexpand:"⤢",atsymbol:"@",barchart:"▥",barcode:"▮",battery:"▭",batterycharging:"▭",batterydisabled:"▭",bell:"♢",belldisabled:"♢",bicycle:"⚲",bike:"⚲",binoculars:"◎",bird:"▷",blankdocument:"▤",bluetooth:"ᛒ",bold:"B",bolt:"ϟ",boltdisabled:"ϟ",book:"▤",bookmark:"▮",box:"▢",brush:"✎",bug:"☗",building:"▥",bulletpoints:"•",bullseye:"◎",calculator:"▦",calendar:"▦",camera:"◉",car:"▰",cart:"▰",cd:"◎",check:"✓",checkcircle:"✓",checklist:"✓",checkmark:"✓",chevrondown:"⌄",chevronleft:"‹",chevronright:"›",chevronup:"⌃",chevronupdown:"⇕",circle:"●",circledisabled:"○",circleellipsis:"◌",circlefilled:"●",circleprogress:"◌",clipboard:"▧",clock:"◷",cloud:"☁",cloudlightning:"☁",cloudrain:"☁",cloudsnow:"☁",cloudsun:"☁",code:"</>",codeblock:"</>",contrast:"◒",cog:"⚙",coin:"◉",coins:"◉",commandsymbol:"⌘",compass:"⊕",computerchip:"▣",copyclipboard:"⧉",creditcard:"▭",crop:"⌗",crown:"♛",crypto:"◈",deletedocument:"⌫",desktop:"▭",devices:"▭",dna:"⋈",document:"▤",dot:"·",download:"↓",droplets:"◌",duplicate:"⧉",eject:"⏏",ellipsis:"…",ellipsisvertical:"⋮",emoji:"☺",emojisad:"☹",envelope:"✉",eraser:"▱",exclamationmark:"!",exclamationmark2:"!",exclamationmark3:"!",eye:"◉",eyedisabled:"◌",eyedropper:"⌖",female:"♀",filmstrip:"▤",filter:"▽",finder:"⌕",fingerprint:"◎",flag:"⚑",folder:"▰",footprints:"∴",forward:"↷",gamecontroller:"▭",gauge:"◔",gear:"⚙",geopin:"⌖",gift:"▧",glasses:"∞",globe:"⊕",goal:"◎",hammer:"⚒",harddrive:"▭",hashtag:"#",heading:"H",headphones:"◠",heart:"♥",heartbeat:"♥",highlight:"▰",hourglass:"⌛",house:"⌂",humidity:"≈",image:"▣",important:"!",info:"ⓘ",italics:"I",key:"⚿",keyboard:"▦",layers:"▤",leaderboard:"▥",leaf:"❧",lightbulb:"☀",lightbulboff:"☼",linechart:"↗",link:"↗",list:"☰",livestream:"◉",lock:"⚿",lockdisabled:"⚿",lockunlocked:"⚿",logout:"⇥",lorry:"▰",lowercase:"a",magnifyingglass:"⌕",male:"♂",map:"⌗",mask:"◒",maximize:"⤢",medicalsupport:"+",megaphone:"◁",memorychip:"▣",memorystick:"▭",message:"▤",microphone:"◉",microphonedisabled:"◌",minimize:"⤡",minus:"−",minuscircle:"−",mobile:"▯",monitor:"▭",moon:"☾",moondown:"☾",moonrise:"☾",moonup:"☽",mountain:"▲",mouse:"▭",move:"✥",mug:"▯",multiply:"×",music:"♪",network:"⌗",newdocument:"+",newfolder:"+",number:"#",numberlist:"#",paperclip:"⌇",paragraph:"¶",patch:"✚",pause:"Ⅱ",pencil:"✎",person:"●",personcircle:"●",personlines:"●",phone:"☏",phoneringing:"☏",piechart:"◔",pill:"◍",pin:"⌖",pindisabled:"⌖",play:"▶",plug:"⚡",plus:"+",pluscircle:"+",plusminusedividemultiply:"±",plussquare:"+",plustoprightsquare:"+",power:"⏻",print:"⎙",questionmarkcircle:"?",quicklink:"↗",quotationmarks:"“",quoteblock:"▮",receipt:"▤",redo:"↷",removeperson:"−",repeat:"↻",replace:"⇄",reply:"↰",rewind:"◀",rocket:"▲",rosette:"✿",rotateanticlockwise:"↺",rotateclockwise:"↻",rss:"◎",ruler:"⌗",savedocument:"▤",shield:"⛨",shortparagraph:"¶",shuffle:"⤨",signal:"▂",snippets:"▤",snowflake:"❄",soccerball:"◉",speaker:"◁",speakerdown:"◁",speakerlow:"◁",speakerhigh:"◁",speakeroff:"◁",speakeron:"◁",speakerup:"◁",speechbubble:"▤",speechbubbleactive:"▣",speechbubbleimportant:"!",stackedbars:"▤",star:"★",starcircle:"★",stardisabled:"☆",stars:"✦",stop:"■",stopwatch:"◷",store:"⌂",strikethrough:"S",sun:"☀",sunrise:"☀",swatch:"◧",switch:"⇄",syringe:"⌇",tack:"⌖",tag:"⌑",temperature:"°",terminal:"▮",text:"T",textcursor:"▏",textinput:"▭",textselection:"▮",thumbsdown:"▽",thumbsup:"△",ticket:"▤",torch:"◉",trash:"⌫",tray:"▤",tree:"♣",trophy:"♛",twopeople:"●",umbrella:"☂",underline:"U",undo:"↶",upload:"↑",uppercase:"A",video:"▶",videodisabled:"▶",wallet:"▭",wand:"✧",warning:"⚠",waveform:"∿",weights:"▭",wifi:"▂",wifidisabled:"▂",wind:"≈",windsock:"◁",wrenchscrewdriver:"⚒",wristwatch:"◷",xmark:"×",xmarkcircle:"×",xmarktopleftsquare:"⧉",xmarktrightsquare:"⧉",xmarktoprightsquare:"⧉"},fi={"raycast-blue":"blue","raycast-green":"green","raycast-magenta":"magenta","raycast-orange":"orange","raycast-purple":"purple","raycast-red":"red","raycast-yellow":"yellow","raycast-primary-text":"primary-text","raycast-secondary-text":"secondary-text",blue:"blue",green:"green",magenta:"magenta",orange:"orange",purple:"purple",red:"red",yellow:"yellow"};function Qn(e,t){if(typeof e==="string")return fi[e.toLowerCase()]??e;if(e&&typeof e==="object"&&!Array.isArray(e)){let n=e;return Qn(t==="dark"?n.dark??n.light:n.light??n.dark,t)}return}function mi(e,t){if(typeof e==="string")return{source:e,...en(e)?{image:!0}:{}};if(!e||typeof e!=="object"||Array.isArray(e))return{};let n=e;if(typeof n.fileIcon==="string")return{fileIcon:n.fileIcon,image:!0};let r=Qn(n.tintColor,t),s=n.mask==="circle"||n.mask==="roundedRectangle"?n.mask:void 0,o=n.source;if(o&&typeof o==="object"&&!Array.isArray(o)){let i=o;o=t==="dark"?i.dark??i.light:i.light??i.dark}return{...typeof o==="string"?{source:o,...en(o)?{image:!0}:{}}:{},...r?{tint:r}:{},...s?{mask:s}:{}}}function en(e){return/^(https?:|data:|file:|\/)/i.test(e)||/\.(png|jpe?g|gif|svg|webp|bmp|heic)$/i.test(e)}function gi(e,t){if(/^(https?:|data:)/i.test(e))return{kind:"url",url:e};if(/^file:/i.test(e))try{return{kind:"file",path:decodeURIComponent(new URL(e).pathname)}}catch{return}if(e.startsWith("/")||/^[a-z]:[\\/]/i.test(e))return{kind:"file",path:e};if(!en(e))return{kind:"builtin",name:e};if(!t||e.split(/[\\/]/).includes(".."))return;return{kind:"file",path:`${t.replace(/[\\/]+$/,"")}/${e.replace(/^\.?[\\/]/,"")}`}}function hi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();return n.join("").toLowerCase()}function Yn(e){return e.replace(/(^|\s)(\S)/g,(t,n,r)=>`${n}${r.toUpperCase()}`)}function bi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();let r=n.join(" ").trim();if(!r)return"◇";let s=Yn(r);return s.length<=12?s:`${Yn(r.slice(0,9))}…`}function we(e,t={}){let{source:n,fileIcon:r,tint:s,mask:o,image:i}=mi(e,t.appearance??"light"),a=r!==void 0?{kind:"fileIcon",path:r}:n===void 0?void 0:gi(n,t.assetsDir),f={...s?{tint:s}:{},...a?{source:a}:{},...o?{mask:o}:{}};if(!n)return{label:r===void 0?"◇":"▣",...f};let d=hi(n);return{label:zn[d]??zn[d.replace(/(?:filled|disabled|small|large)$/,"")]??void 0??(i?"▣":bi(n)),...f}}var yi=4,wi=3,xi=2,Ei=1,$i=3,ki=2,Si=1;function Ri(e,t){let n=e.toLowerCase();if(n===t)return yi;if(n.startsWith(t))return wi;let r=n.indexOf(t);if(r<0)return 0;for(let s=r;s>=0;s=n.indexOf(t,s+1))if(s===0||!/[\p{L}\p{N}]/u.test(n[s-1]??""))return xi;return Ei}function xe(e,t){let n=t.toLowerCase();if(!n)return 1;let r=0,s=(o,i)=>{let a=o?Ri(o,n):0;if(a)r=Math.max(r,a*4+i)};s(e.title,$i);for(let o of e.keywords??[])s(o,ki);return s(e.subtitle,Si),r}function ze(e){return{title:x(e.props.title),subtitle:x(e.props.subtitle),keywords:Array.isArray(e.props.keywords)?e.props.keywords.map(x):[]}}function Ne(e){let t=e?.props.filtering,n=t===void 0||t===null?!ie(e?.props.onSearchTextChange):t!==!1,r=!!t&&typeof t==="object"&&!Array.isArray(t)&&"keepSectionOrder"in t&&t.keepSectionOrder===!0;return{enabled:n,keepSectionOrder:r}}function Re(e,t,n,r){if(!r.enabled||!t)return e.filter((i)=>i.items.length>0);let s=e.map((i,a)=>{let f=i.items.map((d,l)=>({item:d,index:l,value:n(d)})).filter((d)=>d.value>0).toSorted((d,l)=>l.value-d.value||d.index-l.index);return{group:{...i,items:f.map((d)=>d.item)},order:a,best:f[0]?.value??0}}).filter((i)=>i.group.items.length>0);return(r.keepSectionOrder?s:s.toSorted((i,a)=>a.best-i.best||i.order-a.order)).map((i)=>i.group)}function Ye(e,t,n){let r=[],s;for(let o of e.children)if(n(o))s=void 0,r.push({section:o,items:o.children.filter(t)});else if(t(o)){if(!s)r.push(s={items:[]});s.items.push(o)}return r}function Zn(e,t){let n=e.props.columns;return typeof n==="number"&&n>0?n:t}function er(e){let t=e.props.content,n=t&&typeof t==="object"&&!Array.isArray(t)&&"value"in t?t.value:t;if(typeof n==="string")return n;if(n&&typeof n==="object"&&!Array.isArray(n)&&"color"in n){let r=x(n.color);return r?`■ ${r}`:"■"}return"◇"}function tr(e,t){let n=e.props.content,r=n&&typeof n==="object"&&!Array.isArray(n)&&"value"in n?n.value:n;if(r===void 0||r===null)return;if(typeof r==="object"&&!Array.isArray(r)&&"color"in r)return;return we(r,t)}function nr(e,t="",n=Ne(e)){let r=[],s=[];if(e?.type!=="Grid")return{rows:r,cells:s};let o=Zn(e,5),i=Re(Ye(e,(a)=>a.type==="Grid.Item",(a)=>a.type==="Grid.Section"),t,(a)=>xe(ze(a),t),n);for(let a of i){let f=a.section?Zn(a.section,o):o;if(a.section)r.push({node:a.section,header:[x(a.section.props.title),x(a.section.props.subtitle)].filter(Boolean).join(" — "),cells:[]});let d;for(let l of a.items){if(!d||d.cells.length>=f)d={node:void 0,header:"",cells:[]},r.push(d);d.cells.push(l),s.push(l)}}return{rows:r,cells:s}}function rr(e,t,n){let r=e.map((p)=>p.cells),s;r.forEach((p,c)=>p.forEach((u,h)=>{if(J(u)===t)s={r:c,c:h}}));let o=(p,c)=>{let u=r[p];if(!u?.length)return;return{r:p,c:Math.min(c,u.length-1)}};if(!s){let p=r.find((c)=>c.length>0)?.[0];return p?J(p):null}let{r:i,c:a}=s,f=r[i]??[],d;if(n==="left")d=a>0?{r:i,c:a-1}:void 0;else if(n==="right")d=a+1<f.length?{r:i,c:a+1}:void 0;else if(n==="up")for(let p=i-1;p>=0&&!d;p--)d=o(p,a);else for(let p=i+1;p<r.length&&!d;p++)d=o(p,a);let l=d?r[d.r]?.[d.c]:f[a];return J(l)}function sr(e){return(e?Se(e,"searchBarAccessory"):void 0)?.children.find((n)=>n.type==="List.Dropdown"||n.type==="Grid.Dropdown")}function tn(e){let t=[];function n(r,s,o){if(r.type.endsWith("Dropdown.Section")){let i=x(r.props.title);r.children.forEach((a)=>n(a,i,r.id))}else if(r.type.endsWith("Dropdown.Item"))t.push({node:r,value:x(r.props.value),title:x(r.props.title),section:s,sectionId:o})}return e?.children.forEach((r)=>n(r,"","")),t}function vi(e,t,n={enabled:!0,keepSectionOrder:!1}){let r=[];for(let s of e){let o=r[r.length-1];if(o?.section===s.sectionId)o.items.push(s);else r.push({section:s.sectionId,items:[s]})}return Re(r,t,(s)=>xe({title:s.title,subtitle:s.value,keywords:Array.isArray(s.node.props.keywords)?s.node.props.keywords.map(x):[]},t),n).flatMap((s)=>s.items)}function or(e,t){return vi(tn(e),t,Ne(e))}function ir(e,t){let n=x(e?.props.value??e?.props.defaultValue);return t.find((r)=>r.value===n)?.title||n}var Ii=["cmd","ctrl","opt","shift","alt","windows"],Ai={return:"return",enter:"return",escape:"escape",space:"space",backspace:"backspace",delete:"backspace",deleteForward:"delete",tab:"tab",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right",pageUp:"pageup",pageDown:"pagedown",home:"home",end:"end"},Oi={enter:"return",esc:"escape"};function Qe(e){return e&&typeof e==="object"&&"key"in e&&"modifiers"in e?e:void 0}function Ni(e,t){if(Qe(e))return Qe(e);if(!e||typeof e!=="object")return;if(t==="macOS")return"macOS"in e?Qe(e.macOS):void 0;if("Windows"in e&&Qe(e.Windows))return Qe(e.Windows);return"windows"in e?Qe(e.windows):void 0}function Ci(e,t){if(e==="shift")return"shift";if(e==="windows")return"super";if(e==="opt"||e==="alt")return"option";if(e==="cmd")return t==="macOS"?"meta":"ctrl";return"ctrl"}function ar(e,t){let n=Ni(e,t);if(!n)return;let{key:r,modifiers:s}=n;if(typeof r!=="string"||!Array.isArray(s))return;if(!s.every((i)=>typeof i==="string"&&Ii.includes(i)))return;let o=Ai[r]??(r.length===1?r.toLowerCase():void 0);if(!o)return;return{key:o,modifiers:new Set(s.map((i)=>Ci(i,t)))}}function De(e,t,n="Linux"){let r=ar(e,n);if(!r)return!1;let s=t.name.toLowerCase(),o={ctrl:!!t.ctrl,option:!!t.option,shift:!!t.shift,meta:!!t.meta,super:!!t.super};return(Oi[s]??s)===r.key&&Object.keys(o).every((i)=>o[i]===r.modifiers.has(i))}var Ti={ctrl:"⌃",option:"⌥",shift:"⇧",meta:"⌘",super:"❖"},Li={ctrl:"Ctrl",option:"Alt",shift:"Shift",meta:"Cmd",super:"Win"},Pi=["ctrl","option","shift","meta","super"],Mi={return:"↵",escape:"⎋",space:"␣",backspace:"⌫",delete:"⌦",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},Bi={return:"Enter",escape:"Esc",space:"Space",backspace:"Backspace",delete:"Delete",tab:"Tab",up:"Up",down:"Down",left:"Left",right:"Right",pageup:"PageUp",pagedown:"PageDown",home:"Home",end:"End"};function Ce(e,t="Linux"){let n=ar(e,t);if(!n)return"";let r=t==="macOS",s=Pi.filter((o)=>n.modifiers.has(o));if(r)return[...s.map((o)=>Ti[o]),Mi[n.key]??n.key.toUpperCase()].join("");return[...s.map((o)=>Li[o]),Bi[n.key]??n.key.toUpperCase()].join("+")}function rn(e,t){if(e.props.shortcut!==void 0)return e.props.shortcut;if(e.type==="Action.CopyToClipboard")return{modifiers:["cmd"],key:"c"};if(t===1)return{modifiers:["cmd"],key:"return"};return}function vt(e){if(!e)return;if(e.type==="Action"||e.type.startsWith("Action."))return e;if(e.type==="ActionPanel.Submenu")return;for(let t of e.children){let n=vt(t);if(n)return n}}function qe(e){if(e?.type==="Navigation")return qe(e.children.find((t)=>t.type==="Navigation.Entry"&&t.props.active));if(e?.type==="Navigation.Entry")return qe(e.children[0]);return e??void 0}function Fi(e,t){let n=e.props.accessories;return(Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?we(s.icon,t).label:""].filter(Boolean).join(" ")}):[]).filter(Boolean).join(" ")}function ji(e,t){let n=e.props.accessories,r=Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?we(s.icon,t).label:""].filter(Boolean).join(" ")}):[];return[e.props.icon?we(e.props.icon,t).label:"",x(e.props.title),x(e.props.subtitle),...r].filter(Boolean).join(" ")}function _i(e,t){return{node:e,text:ji(e,t),item:!0,title:x(e.props.title),subtitle:x(e.props.subtitle),accessories:Fi(e,t),icon:Boolean(e.props.icon),...e.props.icon?{iconView:we(e.props.icon,t)}:{}}}function Vi(e){let t=[x(e.props.title),x(e.props.subtitle)].filter(Boolean).join(" — ");return{node:e,text:t,title:t,item:!1}}function cr(e){return{node:e,title:e.type,text:`[Unsupported: ${e.type}]`,item:!1,unsupported:!0}}function dr(e,t){let n=qe(e?.root),r=[],s=t.searchText,o=t.icons??{},i=Ne(n),a=n?.type==="Grid"?nr(n,s,i):void 0;if(n?.type==="List"){let c=Re(Ye(n,(u)=>u.type==="List.Item",(u)=>u.type==="List.Section"),s,(u)=>xe(ze(u),s),i);for(let u of c){let h=u.section?Vi(u.section):void 0;if(h)r.push(h);for(let y of u.items)r.push(_i(y,o));if(h)h.count=u.items.length}for(let u of n.children)if(!["List.Item","List.Section","List.EmptyView","Slot"].includes(u.type))r.push(cr(u))}else if(!a&&n&&n.type!=="Detail")r.push(cr(n));let f=a?a.cells:r.filter((c)=>c.item).map((c)=>c.node),d=n?.props.selectedItemId??t.selectedId,l=f.find((c)=>(c.props.id??c.id)===d)??f[0],p=n?.children.find((c)=>c.type==="List.EmptyView"||c.type==="Grid.EmptyView");return{list:n,grid:a,accessory:sr(n),navigation:e?.root?.type==="Navigation"?e.root:void 0,actions:(l?Se(l,"actions"):void 0)??(!l&&p?Se(p,"actions"):void 0)??(n?Se(n,"actions"):void 0),detail:n?.type==="Detail"?ur(n):n?.props.isShowingDetail?ur(l?Se(l,"detail"):void 0):"",rows:r,items:f,empty:p,selected:l,title:x(n?.props.navigationTitle)||(n?.type==="MenuBarExtra"?[x(n.props.title),x(n.props.tooltip)].filter(Boolean).join(" — "):"")||t.fallbackTitle||"Blast",loading:n?.props.isLoading===!0||!e,emptyText:p?[p.props.icon?we(p.props.icon,o).label:"",x(p.props.title),x(p.props.description)].filter(Boolean).join(" "):"No results",primary:vt(l?Se(l,"actions"):void 0)??vt(!l&&p?Se(p,"actions"):void 0)??vt(n?Se(n,"actions"):void 0)}}function lr(e,t,n){let r=e.type==="ActionPanel.Submenu",s=x(e.props.title),o=Ce(rn(e,n),t);return{node:e,item:!0,title:s,shortcut:o,isSubmenu:r,text:`${s}${r?" ›":""} ${o}`.trim()}}function pr(e){return e.type==="ActionPanel.Submenu"||e.type==="Action"||e.type.startsWith("Action.")}function nn(e,t,n){for(let r of e.children)if(pr(r)){if(!n.current)t.push(n.current={items:[]});n.current.items.push(r)}else if(r.type==="ActionPanel.Section"){n.current=void 0;let s=[],o=[];nn(r,o,{});for(let i of o)s.push(...i.items);t.push({section:r,items:s})}else nn(r,t,n)}function It(e,t="",n="Linux",r={enabled:!0,keepSectionOrder:!1}){if(!e)return[];if(pr(e)){let i=lr(e,n,0);return xe({title:x(e.props.title)},t)>0?[i]:[]}let s=[];nn(e,s,{});let o=0;return Re(s,t,(i)=>xe({title:x(i.props.title)},t),r).flatMap((i)=>{let a=i.items.map((f)=>lr(f,n,o++));return i.section?[{node:i.section,item:!1,title:x(i.section.props.title),text:x(i.section.props.title)},...a]:a})}function At(e,t="",n="Linux"){return e?.type==="ActionPanel.Submenu"?It({...e,type:"ActionPanel"},t,n,Ne(e)):It(e,t,n)}function ur(e){if(!e)return"";let t=[x(e.props.markdown)];function n(r){if(r.type==="Slot"&&r.props.name==="actions")return;if(typeof r.props.markdown==="string")t.push(r.props.markdown);let s=[x(r.props.text),x(r.props.value),x(r.props.target)].filter(Boolean).join(" "),o=x(r.props.title??r.props.label);if(o||s)t.push([o,s].filter(Boolean).join(": "));r.children.forEach(n)}return e.children.forEach(n),t.filter(Boolean).join(`
|
|
2
|
+
`)}var gr=new Set(["TextField","TextArea","PasswordField","Checkbox","Dropdown","TagPicker","DatePicker","FilePicker"].map((e)=>`Form.${e}`));function Ui(e){return e.children.filter((t)=>gr.has(t.type))}function Di(e,t,n){if(!e.length)return;let r=e.findIndex((s)=>s.id===t);return e[(Math.max(0,r)+n+e.length)%e.length]}function fr(e){function t(n){return n.type===`${e.type}.Item`?[n]:n.children.flatMap(t)}return e.children.flatMap(t)}function qi(e,t=""){return Re(Ye(e,(n)=>n.type==="Form.Dropdown.Item",(n)=>n.type==="Form.Dropdown.Section"),t,(n)=>xe({...ze(n),subtitle:String(n.props.value??"")},t),Ne(e)).flatMap((n)=>n.items)}function Gi(e){if(!e)return null;if(!/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?)?$/.test(e))return;let t=new Date(e),n=new Date(`${e.slice(0,10)}T00:00:00Z`);if(!Number.isFinite(t.getTime())||n.toISOString().slice(0,10)!==e.slice(0,10))return;return t.toISOString()}var Ze=(e)=>Object.hasOwn(e.props,"value")?e.props.value:e.props.defaultValue??null,Ge=(e,t,n,r=[])=>{let s=Q(t,n,r);if(s)e.push(s)},mr=(e)=>({value:x(e.props.value),title:x(e.props.title)});function hr(){let e,t=[],n=null,r,s=[],o=0,i=!0,a=new Map,f=new Map,d=(c)=>c.type==="Form.Dropdown"?qi(c,f.get(c.id)??""):fr(c);function l(c,u,h=!0){if((c??null)===n)return;if(h&&i)Ge(u,t.find((y)=>y.id===n),"onBlur");if(n=c??null,o=0,c&&h&&i)s.push(c),Ge(u,t.find((y)=>y.id===c),"onFocus")}function p(c,u){if(c===i)return;i=c;let h=t.find((y)=>y.id===n);if(h&&c)s.push(h.id);Ge(u,h,c?"onFocus":"onBlur")}return{active:p,scene(c,u,h=!0){if(c?.id!==e?.id)n=null,r=void 0,s=[],o=0,a.clear(),f.clear();let y=t;e=c,t=c?Ui(c):[],p(h,u);for(let[m,S]of a){let v=t.find((F)=>F.id===m),B=y.find((F)=>F.id===m);if(!v||v.type==="Form.TextField"&&v!==B||JSON.stringify(Ze(v))!==JSON.stringify(Ze(B??v))&&JSON.stringify(Ze(v))!==JSON.stringify(S.value))a.delete(m)}let E=t.find((m)=>m.props.focused)?.id;if(E&&E!==r){let m=s.indexOf(E);if(m>=0)s.splice(0,m+1);else l(E,u,!1)}if(r=E,!t.some((m)=>m.id===n))l(t[0]?.id,u)},input(c,u){let h=t.find((y)=>y.id===("id"in c?c.id:n));if(c.type==="focusNext"||c.type==="focusPrev")return l(Di(t,n??void 0,c.type==="focusNext"?1:-1)?.id,u);if(!h)return;if(c.type==="focus")return l(h.id,u);if(c.type==="toggle"){if(h.type==="Form.Checkbox")Ge(u,h,"onChange",[!Ze(h)])}else if(c.type==="optionMove"||c.type==="optionChoose"){if(!["Form.Dropdown","Form.TagPicker"].includes(h.type))return;let y=d(h),E=(m)=>Math.max(0,Math.min(y.length-1,m));if(o=E(o),c.type==="optionMove")o=E(o+Math.trunc(c.delta));else{let m=y[o]?.props.value;if(typeof m!=="string")return;let S=Ze(h),v=Array.isArray(S)?S:[];Ge(u,h,"onChange",[h.type==="Form.Dropdown"?m:v.includes(m)?v.filter((B)=>B!==m):[...v,m]])}}else if(c.type==="setValue"){if(h.type==="Form.Dropdown"){f.set(h.id,c.value),o=0,Ge(u,h,"onSearchTextChange",[c.value]);return}if(!["Form.TextField","Form.TextArea","Form.PasswordField","Form.DatePicker","Form.FilePicker"].includes(h.type))return;let y=c.value,E="";if(h.type==="Form.DatePicker"){let m=Gi(c.value);E=m===void 0?"Enter a valid ISO date or date/time":"",y=m??null}else if(h.type==="Form.FilePicker"){let m=c.value.split(",").map((S)=>S.trim()).filter(Boolean);y=h.props.allowMultipleSelection===!1?m.slice(0,1):m}if(h.type!=="Form.PasswordField")a.set(h.id,{text:c.value,value:y,error:E});if(!E)Ge(u,h,"onChange",[y])}},view(){return{focusId:n,items:(e?.children??[]).flatMap((c)=>{if(gr.has(c.type))return[{kind:"field",id:c.id}];if(c.type==="Form.Separator")return[{kind:"separator",id:c.id}];if(c.type==="Form.Description")return[{kind:"description",id:c.id,title:x(c.props.title),text:x(c.props.text)}];return[]}),fields:t.map((c)=>{let u=c.type==="Form.PasswordField",h=u?null:Ze(c),y=a.get(c.id),E=d(c).map(mr);return{id:c.id,type:c.type,title:x(c.props.title??c.props.id),required:c.props.required===!0,info:n===c.id?x(c.props.info):"",label:x(c.props.label),placeholder:x(c.props.placeholder),error:y?.error||x(c.props.error),value:h,text:u?"":y?.text??(Array.isArray(h)?h.map(x).join(", "):x(h)),checked:h===!0,hasValue:u&&c.props.hasValue===!0,selected:fr(c).map(mr).filter((m)=>Array.isArray(h)?h.includes(m.value):h===m.value),options:E,optionIndex:n===c.id&&E.length?Math.min(o,E.length-1):0,query:f.get(c.id)??"",focused:n===c.id}})}}}}function br(e,t,n,r){let s=Zt(e);if(!s||!ie(s.onLoadMore)||s.hasMore!==!0)return;let o=t.at(-1);if(!o||J(o)!==n||r===t.length)return;let i=Me(e,s.onLoadMore);return i?{count:t.length,event:i}:void 0}var Wi=200;function sn(e,t){if(!ie(e?.props.onSearchTextChange))return;let n=Q(e,"onSearchTextChange",[t]);if(!n)return;return{event:n,delayMs:e?.props.throttle?Wi:0}}var Ot=2500;var yr=3000;function Hi(e){return e?.root?.type==="Navigation"?e.root.children:[]}function Xi(e){return e==="immediate"||e==="suspended"?e:"default"}function ve(e){let t=Hi(e),n=t.find((i)=>i.type==="Toast"),r=t.find((i)=>i.type==="HUD"),s=t.find((i)=>i.type==="Alert"),o=(i)=>{let a=s?.children.find((f)=>f.props.name===i);return a?{node:a,title:x(a.props.title),style:x(a.props.style)||"default"}:void 0};return{toast:n&&{node:n,style:x(n.props.style).toLowerCase(),title:x(n.props.title),message:x(n.props.message),actions:n.children.map((i)=>({node:i,name:x(i.props.name),title:x(i.props.title),shortcut:i.props.shortcut}))},hud:r&&{node:r,title:x(r.props.title),durationMs:Ot,popToRootType:Xi(r.props.popToRootType),clearRootSearch:r.props.clearRootSearch===!0},alert:s&&{node:s,title:x(s.props.title),message:x(s.props.message),rememberUserChoice:s.props.rememberUserChoice===!0,primary:o("primaryAction"),dismiss:o("dismissAction")}}}var Ji={path:[],selectedId:null};function Ki(e,t,n="Linux",r={}){if(e?.type!=="MenuBarExtra")return[];let s=e;for(let a of t){let f;if(function d(l){for(let p of l.children){if(f)return;if(p.type==="MenuBarExtra.Submenu"&&p.id===a)f=p;else d(p)}}(s),!f)break;s=f}let o=[];function i(a){if(a.type==="MenuBarExtra.Item"){let f=x(a.props.title),d=x(a.props.subtitle),l=Ce(a.props.shortcut,n),p=a.props.icon===void 0?void 0:we(a.props.icon,r);o.push({node:a,item:!0,disabled:!ie(a.props.onAction),title:f,subtitle:d,...p?{iconLabel:p.label,...Ue(p)}:{},shortcut:l,text:[f,d,l].filter(Boolean).join(" ")})}else if(a.type==="MenuBarExtra.Submenu"){let f=x(a.props.title);o.push({node:a,item:!0,disabled:!1,title:f,isSubmenu:!0,text:`${f} ›`})}else if(a.type==="MenuBarExtra.Section"){let f=o.length,d=x(a.props.title);if(o.push({node:a,item:!1,disabled:!0,title:d,text:d}),a.children.forEach(i),o.length===f+1)o.splice(f,1)}}return s.children.forEach(i),o}function on(e,t=Ji,n="Linux",r={}){let s=qe(e?.root),o=s?.type==="MenuBarExtra"?s:void 0,i=Ki(o,t.path,n,r),a=i.filter((f)=>f.item);return{menu:o,rows:i,items:a,selected:a.find((f)=>J(f.node)===t.selectedId)??a[0],path:t.path,isLoading:o?.props.isLoading===!0,title:x(o?.props.title),tooltip:x(o?.props.tooltip)}}function wr(e,t,n,r="Linux"){let s=on(e,t,r),o={state:t,events:[],leave:!1};if(n.type==="back"){if(t.path.length)return{...o,state:{path:t.path.slice(0,-1),selectedId:null}};return{...o,leave:n.escape===!0}}if(n.type==="move"){let a=s.items.findIndex((l)=>l.node===s.selected?.node),f=s.items[Math.max(0,Math.min(s.items.length-1,a+n.delta))],d=f?J(f.node):null;if(!f||d===J(s.selected?.node))return o;return{...o,state:{...t,selectedId:d},events:[Q(s.menu,"onSelectionChange",[d])].filter((l)=>l!==void 0)}}let i=s.selected;if(i?.node.type==="MenuBarExtra.Submenu")return{...o,state:{path:[...t.path,i.node.id],selectedId:null}};if(i&&!i.disabled)return{...o,events:[Me(i.node,i.node.props.onAction,[{type:"left-click"}])].filter((a)=>a!==void 0)};return o}function xr(e,t,n="Linux"){if(e?.type!=="MenuBarExtra")return;let r=[...e.children];for(let s=r.shift();s;s=r.shift()){if(s.type==="MenuBarExtra.Item"&&ie(s.props.onAction)&&De(s.props.shortcut,t,n))return s;r.push(...s.children)}return}var an=()=>({events:[],effects:[]}),ae=(e,t)=>{if(t)e.events.push(t)},Be=(e,t)=>ae(e,Q(t,zi(t))),dt=(e,t)=>Math.max(0,Math.min(t-1,e)),zi=(e)=>ie(e?.props.onAction)?"onAction":"onSubmit";function cn(e){let{platform:t}=e,n={appearance:e.appearance??"light",...e.assetsDir===void 0?{}:{assetsDir:e.assetsDir}},r,s=hr(),o="",i=null,a,f,d,l=[],p=null,c="",u=0,h=!1,y="",E=0,m=-1,S,v,B,F="",U="",re="",ue=!1,Le=0,Ae="",se=!1,Xe=0,D=!1,K=!1,je=0,de=new Map,O=new Set,j="",H=(g)=>{if(D)return;D=!0,g.effects.push({type:"quit"})},P=(g,b,w)=>{if(de.delete(b),!w)return;if(!w.delayMs)return ae(g,w.event);let C=`${b}:${++je}`;de.set(b,{token:C,event:w.event}),g.effects.push({type:"schedule",ms:w.delayMs,token:C})},V=()=>dr(r,{searchText:o,selectedId:i,...e.fallbackTitle?{fallbackTitle:e.fallbackTitle}:{},icons:n}),pe=(g)=>g.list?.type==="MenuBarExtra",X=(g)=>{let b=g.actions;for(let w of p??[])b=At(b,"",t).find((C)=>C.node.id===w)?.node;return b},be=(g)=>{let b=X(g),w=At(b,c,t),C=w.filter((R)=>R.item),_=C.length?dt(u,C.length):-1;return{node:b,rows:w,items:C,index:_,chosen:C[_]?.node}},ke=(g)=>{let b=or(g.accessory,y),w=b.length?dt(E,b.length):-1;return{options:b,index:w,chosen:b[w]}},fe=(g,b)=>b?"alert":pe(g)?"menu":h?"dropdown":p!==null?"panel":"base",Z=()=>{h=!1,y="",E=0},Pe=(g)=>{p=g,c="",u=0},it=(g,b)=>{if(ie(b.navigation?.props.pop))ae(g,Q(b.navigation,"pop"));else H(g)};function _e(g){S=g?.id,p=null,c="",u=0,i=null,a=void 0,d=void 0,l=[],Z(),m=-1,o=x(g?.props.searchText),B=void 0,de.delete("search"),de.delete("dropdown")}function $t(g){let b=V();if(s.active(fe(b,!!ve(r).alert)==="base",g.events),h&&!b.accessory)Z();let w=J(b.selected);if(d!==void 0&&w===d)d=void 0;if(w!==null&&d===void 0){if(i=w,a!==w)a=w,ae(g,Q(b.list,"onSelectionChange",[w]))}let C=br(b.list,b.items,w,m);if(C)m=C.count,ae(g,C.event)}function kt(g){let b=qe(r?.root),w=b?.props.searchText;if(b?.id!==S)_e(b);else if(w!==v){if(w===B)B=void 0;if(typeof w==="string"&&B===void 0)o=w}v=w;let C=b?.props.selectedItemId;if(C!==f)d=void 0;f=C;let _=V();s.scene(b?.type==="Form"?b:void 0,g.events,fe(_,!!ve(r).alert)==="base"),K=!1;let R=_.navigation?.props;if(R){let z=JSON.stringify(R.clearSearchBar)??"",ye=JSON.stringify(R.popToRoot)??"",me=R.popToRoot;if(z&&z!==F||ye!==U&&me&&typeof me==="object"&&!Array.isArray(me)&&"clearSearchBar"in me&&me.clearSearchBar)o="",B=void 0,de.delete("search"),K=!0,ae(g,Q(_.list,"onSearchTextChange",[""]));if(F=z,U=ye,R.closeMainWindow)H(g)}let{hud:M}=ve(r),W=M?`${M.node.id}\x00${M.title}`:"";if(W!==re){re=W,ue=!!M;let z=++Le;if(M)g.effects.push({type:"schedule",ms:e.hudDurationMs??M.durationMs??Ot,token:`hud:${z}`})}let G=ve(r).toast,ee=G?`${G.node.id}\x00${JSON.stringify(G.node)}`:"";if(ee!==Ae){Ae=ee,se=!!G;let z=++Xe;if(G&&G.style!=="animated")g.effects.push({type:"schedule",ms:e.toastDurationMs??yr,token:`toast:${z}`})}}function at(g,b){let w=V(),C=b==="up"||b==="down",_=b==="down"||b==="right"?1:-1;switch(fe(w,!!ve(r).alert)){case"alert":return;case"menu":return lt(g,w,C?{type:"move",delta:_}:b==="left"?{type:"back"}:{type:"activate"});case"dropdown":if(C)E=dt(ke(w).index+_,ke(w).options.length);return;case"panel":if(C)u=dt(be(w).index+_,be(w).items.length);return}if(w.list?.type==="Form")return;if(!C&&!w.grid)return;let R=J(w.selected),M=w.items.findIndex((W)=>W.id===w.selected?.id);ct(g,w,w.grid?rr(w.grid.rows,R,b):J(w.items[dt(M+_,w.items.length)]))}function ct(g,b,w){if(b.list?.props.selectedItemId==null){i=w;return}if(w===null||w===J(b.selected))return;d=w,a=w,ae(g,Q(b.list,"onSelectionChange",[w]))}function lt(g,b,w){let C=wr(r,{path:l,selectedId:i},w,t);if(C.leave)it(g,b);l=C.state.path,i=C.state.selectedId;for(let _ of C.events)ae(g,_)}function St(g,b){switch(fe(b,!!ve(r).alert)){case"alert":return;case"menu":return lt(g,b,{type:"activate"});case"dropdown":{let{chosen:w}=ke(b);if(!w)return;return ae(g,Q(b.accessory,"onChange",[w.value])),Z()}case"panel":{let{chosen:w}=be(b);if(w?.type==="ActionPanel.Submenu")return ae(g,Q(w,"onOpen")),Pe([...p??[],w.id]);Be(g,w),p=null;return}}Be(g,b.primary)}function Rt(g,b){let{alert:w}=ve(r);switch(fe(b,!!w)){case"alert":return Be(g,w?.dismiss?.node);case"menu":return lt(g,b,{type:"back",escape:!0});case"dropdown":return Z();case"panel":{let C=p??[];p=C.length?C.slice(0,-1):null,c="",u=0;return}}it(g,b)}function Je(g,b,w){let C=ve(r),_=fe(b,!!C.alert);if(_==="menu"){let ee=xr(b.list,w,t);if(!ee)return;g.handled=!0;let z=Me(ee,ee.props.onAction,[{type:"left-click"}]);if(z)ae(g,z);return}if(_!=="base"&&_!=="panel")return;let R=_==="base"&&se&&C.toast?.actions.find((ee)=>De(ee.shortcut,w,t));if(R)return g.handled=!0,Be(g,R.node);let M=It(b.actions,"",t),W=0,G=M.find((ee)=>{if(!ee.item)return!1;let z=De(rn(ee.node,W),w,t);return W++,z});if(!G)return;if(g.handled=!0,p=null,c="",u=0,G.node.type==="ActionPanel.Submenu")ae(g,Q(G.node,"onOpen")),Pe([G.node.id]);else Be(g,G.node)}function zt(g,b){let w=V(),C=ve(r),_=fe(w,!!C.alert);switch(b.type){case"focus":case"focusNext":case"focusPrev":case"setValue":case"toggle":case"optionMove":case"optionChoose":if(_==="base"&&w.list?.type==="Form")s.input(b,g.events);return;case"submit":if(_==="base"&&w.list?.type==="Form")Be(g,w.primary);return;case"search":{if(_!=="base"||pe(w)||o===b.text)return;o=b.text,K=!1;let R=sn(w.list,b.text);return B=R?b.text:void 0,P(g,"search",R)}case"move":return at(g,b.direction);case"select":{if(_!=="base"||pe(w))return;if(w.items.some((R)=>J(R)===b.id))ct(g,w,b.id);return}case"primary":return St(g,w);case"openActions":if(_==="base"&&w.list?.type!=="MenuBarExtra")Pe([]);return;case"closeActions":if(_==="panel")p=null;return;case"actionsQuery":{if(_!=="panel")return;return c=b.text,u=0,ae(g,Q(be(w).node,"onSearchTextChange",[b.text]))}case"key":return Je(g,w,b.key);case"back":return Rt(g,w);case"openDropdown":if(_==="base"&&w.accessory)h=!0,y="",E=0;return;case"dropdownQuery":if(_!=="dropdown")return;return y=b.text,E=0,P(g,"dropdown",sn(w.accessory,b.text));case"chooseDropdown":if(_==="dropdown")St(g,w);return;case"toastAction":{if(_==="alert")return;let R=se&&C.toast?.actions[b.index];return R?Be(g,R.node):void 0}case"alert":{let{alert:R}=C;if(!R)return;if(b.remember!==void 0)ae(g,Q(R.node,"onRememberUserChoiceChange",[b.remember]));return Be(g,(b.confirm?R.primary:R.dismiss)?.node)}}}function Ve(g){$t(g);let b=ut(),w=JSON.stringify(b);if(w!==j){j=w;for(let C of O)C(b)}return g}function ut(){let g=V(),b=ve(r),w=fe(g,!!b.alert),C=!g.list?"empty":g.list.type==="Grid"?"grid":g.list.type==="Detail"?"detail":g.list.type==="Form"?"form":g.list.type==="MenuBarExtra"?"menu-bar":"list",_=J(g.selected),R=(N)=>{let oe=N.item;return{id:oe?J(N.node)??N.node.id:N.node.id,kind:oe?"item":N.unsupported?"unsupported":"section",title:N.title??N.text,subtitle:N.subtitle??"",accessories:N.accessories??"",icon:N.icon===!0,iconLabel:N.iconView?.label??"",...Ue(N.iconView),count:N.count??null,selected:oe&&N.node.id===g.selected?.id,text:N.text}},M=be(g),W=ke(g),G=on(r,{path:l,selectedId:i},t,n),ee=g.primary,z=[];if(p?.length){let N=g.actions;z=p.map((oe)=>(N=At(N,"",t).find((Ke)=>Ke.node.id===oe)?.node,x(N?.props.title)))}let ye=se?b.toast:void 0,me=b.alert,Yt=me?.dismiss,Qt=me?.primary,Xn=g.empty?.props.icon?we(g.empty.props.icon,n):void 0;return{kind:C,title:g.title,navigation:{canGoBack:ie(g.navigation?.props.pop)},loading:g.loading,search:{text:o,placeholder:x(g.list?.props.searchBarPlaceholder)||"Search…"},rows:C==="list"?g.rows.map(R):[],grid:g.grid?g.grid.rows.map((N)=>({id:N.node?N.node.id:null,header:N.header,cells:N.cells.map((oe)=>{let Ke=tr(oe,n);return{id:J(oe)??oe.id,title:x(oe.props.title),subtitle:x(oe.props.subtitle),content:er(oe),...Ke?.source?{iconSource:Ke.source}:{},...Ke?.mask?{iconMask:Ke.mask}:{},selected:oe.id===g.selected?.id}})})):null,selectedId:_,emptyText:g.emptyText,empty:g.empty?{title:x(g.empty.props.title),description:x(g.empty.props.description),iconLabel:Xn?.label??"",...Ue(Xn)}:null,detail:g.detail,primary:{title:x(ee?.props.title)||(C==="form"?"Submit":"Run"),shortcut:Ce({modifiers:[],key:"return"},t),enabled:!!ee},actions:{open:w==="panel",title:x(M.node?.props.title)||"Actions",query:c,breadcrumb:z,rows:M.rows.map((N)=>({id:N.node.id,kind:!N.item?"section":N.isSubmenu?"submenu":"action",title:N.title??N.text,shortcut:N.shortcut??"",selected:N.item&&N.node.id===M.chosen?.id})),selectedIndex:M.index},dropdown:g.accessory?{label:ir(g.accessory,tn(g.accessory)),tooltip:x(g.accessory.props.tooltip),open:w==="dropdown",query:y,options:W.options.map((N,oe)=>({value:N.value,title:N.title,section:N.section,current:N.value===x(g.accessory?.props.value??g.accessory?.props.defaultValue),selected:oe===W.index})),selectedIndex:W.index}:null,feedback:{toast:ye?{style:ye.style,title:ye.title,message:ye.message,actions:ye.actions.map((N)=>({title:N.title,shortcut:Ce(N.shortcut,t)}))}:null,hud:b.hud&&ue?{title:b.hud.title}:null,alert:me?{title:me.title,message:me.message,rememberUserChoice:me.rememberUserChoice,remember:me.node.props.rememberChoice===!0,primary:Qt?{title:Qt.title,style:Qt.style}:null,dismiss:Yt?{title:Yt.title,style:Yt.style}:null}:null},menuBar:G.menu?{title:G.title,tooltip:G.tooltip,loading:G.isLoading,path:G.path,selectedId:G.selected?J(G.selected.node):null,rows:G.rows.map((N)=>({id:N.node.id,kind:!N.item?"section":N.isSubmenu?"submenu":"item",title:N.title??"",subtitle:N.subtitle??"",iconLabel:N.iconLabel??"",...N.iconTint?{iconTint:N.iconTint}:{},...N.iconSource?{iconSource:N.iconSource}:{},...N.iconMask?{iconMask:N.iconMask}:{},shortcut:N.shortcut??"",disabled:N.disabled,selected:N.item&&N.node.id===G.selected?.node.id}))}:null,form:C==="form"?s.view():null,requests:{quit:D,clearSearch:K}}}return{scene(g){r=g;let b=an();return kt(b),Ve(b)},input(g){let b=an();return zt(b,g),Ve(b)},tick(g){let b=an();if(g===`hud:${Le}`)ue=!1;if(g===`toast:${Xe}`)se=!1;for(let[w,C]of de)if(C.token===g)de.delete(w),ae(b,C.event);return Ve(b)},view:ut,subscribe(g){return O.add(g),()=>void O.delete(g)}}}var Yi="Search commands…",Er="Open Command",Qi="Configure Command",$r={modifiers:["cmd","shift"],key:","},kr=[{id:"open"},{id:"configure"}],Zi={view:"Command","no-view":"No View","menu-bar":"Menu Bar"},et=(e)=>`${e.extension}:${e.command}`;function Sr(e=[],t={}){let n=t.platform??"Linux",r=e,s="",o=null,i=!1,a=0,f=null,d=new Set,l=()=>{let y=new Map;for(let m of r){let S=y.get(m.extension);if(S)S.push(m);else y.set(m.extension,[m])}let E=[...y].map(([m,S])=>({section:m,items:S}));return Re(E,s,(m)=>xe({title:m.title,subtitle:m.subtitle||m.description||"",keywords:[m.command,m.extension,m.extensionTitle??""]},s),{enabled:!0,keepSectionOrder:!0}).flatMap((m)=>m.items)},p=(y)=>y.find((E)=>et(E)===o)??y[0],c=()=>{let y=l(),E=p(y),m=[],S;for(let v of y){if(v.extension!==S){S=v.extension;let F=v.extensionTitle??S;m.push({id:`section:${S}`,kind:"section",title:F,subtitle:"",accessories:"",icon:!1,count:y.filter((U)=>U.extension===S).length,selected:!1,iconLabel:"",text:F})}let B=v.subtitle||v.description||"";m.push({id:et(v),kind:"item",title:v.title,subtitle:B,accessories:v.mode?Zi[v.mode]:"",icon:!!v.icon,count:null,selected:v===E,iconLabel:v.icon?.label??"",...Ue(v.icon),text:B?`${v.title} ${B}`:v.title})}return{kind:"list",title:"Commands",navigation:{canGoBack:!1},loading:!1,search:{text:s,placeholder:Yi},rows:m,grid:null,selectedId:E?et(E):null,emptyText:s?"No matching commands":"No commands",empty:null,detail:"",primary:{title:Er,shortcut:"",enabled:!!E},actions:{open:i&&!!E,title:E?.title??"Actions",query:"",breadcrumb:[],rows:i&&E?[{id:"open",kind:"action",title:Er,shortcut:"",selected:a===0},{id:"configure",kind:"action",title:Qi,shortcut:Ce($r,n),selected:a===1}]:[],selectedIndex:i&&E?a:-1},dropdown:null,feedback:{toast:f&&{style:"failure",...f,actions:[]},hud:null,alert:null},menuBar:null,form:null,requests:{quit:!1,clearSearch:!1}}},u=()=>{let y=c();for(let E of d)E(y)},h=(y)=>{let E=p(l());return i=!1,{effects:E?[{type:y,extension:E.extension,command:E.command}]:[]}};return{input(y){f=null;let E={effects:[]};switch(y.type){case"search":s=y.text,o=null,i=!1;break;case"move":{let m=l(),S=y.direction==="down"?1:y.direction==="up"?-1:0,v=p(m);if(i){a=Math.max(0,Math.min(kr.length-1,a+S));break}let B=m[(v?m.indexOf(v):0)+S];if(B)o=et(B);break}case"select":{let m=l().find((S)=>et(S)===y.id);if(m)o=et(m);break}case"primary":E=h(i&&kr[a]?.id==="configure"?"configure":"launch");break;case"key":if(De($r,y.key,n))E=h("configure");break;case"openActions":i=!0,a=0;break;case"closeActions":case"back":i=!1;break;default:break}return u(),E},setCatalog(y){r=y,u()},fail(y,E){f={title:y,message:E},u()},reset(){s="",i=!1,f=null,u()},view:c,subscribe(y){return d.add(y),y(c()),()=>d.delete(y)}}}class pt extends Error{code="BROWSER_MISSING_FILE";path;constructor(e){super(`Browser bundle file is missing: ${e}`);this.name="BrowserMissingFileError",this.path=e}}class ln extends Error{code="BROWSER_MISSING_DEPENDENCY";packages;constructor(e){let t=[...new Set(e)].toSorted();super(`Browser bundle dependencies are missing: ${t.join(", ")}`);this.name="BrowserMissingDependencyError",this.packages=t}}class un extends Error{code="BROWSER_NATIVE_MODULE";modules;constructor(e){let t=[...new Set(e)].toSorted();super(`Native modules are not supported in a browser bundle: ${t.join(", ")}`);this.name="BrowserNativeModuleError",this.modules=t}}var dn=[".tsx",".ts",".jsx",".js",".json"],ea=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"],ta=new Set(ea),na=new Set(["better-sqlite3","canvas","fsevents","keytar","node-gyp-build","sharp","sqlite3"]);function ce(e){let t=[];for(let n of e.replaceAll("\\","/").split("/")){if(!n||n===".")continue;if(n==="..")t.pop();else t.push(n)}return`/${t.join("/")}`}function tt(e){return e.startsWith("@")?e.split("/").slice(0,2).join("/"):e.split("/")[0]}function ra(e){return e.startsWith("node:")||ta.has(e)}function sa(e){let t=dn.find((n)=>e.endsWith(n));if(t===".tsx")return"tsx";if(t===".ts")return"ts";if(t===".jsx")return"jsx";if(t===".json")return"json";return"js"}function oa(e){return e}function ia(e){return typeof e==="string"?e:new TextDecoder().decode(e)}function ge(e,t){let n=ce(t),r=n.replace(/\.[cm]?jsx?$/,""),s=[n,...r===n?[]:dn.map((o)=>`${r}${o}`),...dn.map((o)=>`${n}${o}`),`${n}/index.ts`,`${n}/index.tsx`,`${n}/index.js`,`${n}/index.json`];for(let o of s){if(e.has(o))return o;let i=o.slice(1);if(e.has(i))return i}return}function aa(e,t){let n=ge(e,`${t}/package.json`);if(!n)return;try{let r=JSON.parse(ia(e.get(n)));return r&&typeof r==="object"?r:void 0}catch{return}}function ca(e,t,n){let r=[],s=ce(t.slice(0,t.lastIndexOf("/"))||"/");while(!0){let i=ce(`${s}/node_modules/${n}`);if(e.has(i)||e.has(i.slice(1))||[...e.keys()].some((a)=>ce(a).startsWith(`${i}/`)))r.push(i);if(s==="/")break;s=ce(`${s}/..`)}let o=`/${n}`;if(e.has(o)||e.has(n)||[...e.keys()].some((i)=>ce(i).startsWith(`${o}/`)))r.push(o);return[...new Set(r)]}function ft(e,t){if(typeof e==="string")return e;if(e===null||e===!1)return!1;if(Array.isArray(e)){for(let s of e){let o=ft(s,t);if(o!==void 0&&o!==!1)return o}return}if(!e||typeof e!=="object")return;let n=e,r=Object.keys(n).filter((s)=>s.startsWith("."));if(r.length){let s=n[t];if(s!==void 0)return ft(s,t);let o=r.filter((i)=>i.endsWith("*")&&t.startsWith(i.slice(0,-1))).toSorted((i,a)=>a.length-i.length)[0];if(o){let i=ft(n[o],t);return typeof i==="string"?i.replaceAll("*",t.slice(o.length-1)):i}return}for(let s of["browser","import","module","require","default"])if(n[s]!==void 0){let o=ft(n[s],t);if(o!==void 0)return o}return}function la(e,t,n){let r=tt(t),s=t.slice(r.length).replace(/^\//,"");for(let o of ca(e,n,r)){let i=aa(e,o),a=s?`./${s}`:".";if(i?.exports!==void 0){let c=ft(i.exports,a);if(c===!1||c===void 0)return[];let u=ge(e,ce(`${o}/${c}`));return u?[u]:[]}let f=s?ce(`${o}/${s}`):void 0;if(f){let c=ge(e,f);if(c)return[c];continue}let d=i?.browser;if(typeof d==="string"){let c=ge(e,ce(`${o}/${d}`));if(c)return[c]}let l=[],p=typeof i?.module==="string"?i.module:typeof i?.main==="string"?i.main:"index";if(typeof d==="object"&&d){let c=d[`./${p}`]??d["."];if(typeof c==="string")l.push(ce(`${o}/${c}`))}if(l.push(ce(`${o}/${p}`)),typeof i?.main==="string"&&typeof i?.module==="string")l.push(ce(`${o}/${i.main}`));l.push(ce(`${o}/index`));for(let c of l){let u=ge(e,c);if(u)return[u]}}return[]}async function Rr(e){let t=new Map([...e.files,...e.packages]),n=ge(t,e.command),r=ge(t,e.runtimeEntry);if(!n)throw new pt(e.command);if(!r)throw new pt(e.runtimeEntry);let s=new Set,o=new Set,i=new Set,a="/__blast_browser_bundle_entry__.js",f={name:"blast-browser-memory",setup(p){p.onResolve({filter:/.*/},(c)=>{let u=c.path;if(c.kind==="entry-point"){if(u===a)return{path:a};let m=ge(t,u);return m?{path:m}:void 0}if(e.sharedRuntime&&e.sharedModules?.includes(u))return{path:`/__blast_shared_${u.replaceAll("/","_")}`};let h=e.aliases?.[u];if(h)return{path:ge(t,h)??h};if(ra(u))return{path:u,external:!0};if(u.endsWith(".node"))return o.add(u),{errors:[{text:`Native module ${u} is not supported`}]};if(!u.startsWith(".")&&!u.startsWith("/")&&na.has(tt(u)))return o.add(tt(u)),{errors:[{text:`Native package ${tt(u)} is not supported`}]};if(u==="@blastlauncher/command")return{path:n};let y=u.startsWith(".")||u.startsWith("/"),E=y?ge(t,ce(`${c.importer.slice(0,c.importer.lastIndexOf("/"))}/${u}`)):h?ge(t,h):la(t,u,c.importer).map((m)=>ge(t,m)).find(Boolean);if(E)return{path:E.startsWith("/")?E:`/${E}`};if(!y)return s.add(tt(u)),{errors:[{text:`Missing browser dependency ${tt(u)}`}]};return i.add(u),{errors:[{text:`Missing browser file ${u}`}]}}),p.onLoad({filter:/.*/},(c)=>{if(c.path===a)return{contents:e.entryCode?e.entryCode:e.sharedRuntime?`const __blastRuntime = globalThis.__blastRuntime;
|
|
3
3
|
if (typeof __blastRuntime?.start === "function") __blastRuntime.start(async () => { const __blastCommand = await import(${JSON.stringify(n)}); return { ...__blastCommand, default: __blastCommand.default ?? __blastCommand }; });`:`import * as __blastRuntime from ${JSON.stringify(r)};
|
|
4
|
-
if (typeof __blastRuntime.start === "function") __blastRuntime.start(async () => { const __blastCommand = await import(${JSON.stringify(n)}); return { ...__blastCommand, default: __blastCommand.default ?? __blastCommand }; });`,loader:"js",resolveDir:"/"};if(c.path.startsWith("/__blast_shared_")){let
|
|
5
|
-
`)){let p=l.indexOf("=");if(p>0){if(l.slice(l.indexOf(" ")+1,p)==="path")r=l.slice(p+1)}}continue}if(a=
|
|
4
|
+
if (typeof __blastRuntime.start === "function") __blastRuntime.start(async () => { const __blastCommand = await import(${JSON.stringify(n)}); return { ...__blastCommand, default: __blastCommand.default ?? __blastCommand }; });`,loader:"js",resolveDir:"/"};if(c.path.startsWith("/__blast_shared_")){let h=c.path.slice(16).replaceAll("_","/");return{contents:`module.exports = globalThis.__blastModules[${JSON.stringify(h)}];`,loader:"js"}}let u=ge(t,c.path);if(!u)return{errors:[{text:`Missing browser file ${c.path}`}]};return{contents:oa(t.get(u)),loader:sa(u),resolveDir:ce(u.slice(0,u.lastIndexOf("/")))}})}},d=await e.esbuild.build({absWorkingDir:"/",entryPoints:[a],bundle:!0,write:!1,format:"cjs",platform:"browser",target:"es2020",minify:!0,legalComments:"none",jsx:"automatic",plugins:[f],logLevel:"silent"}).catch((p)=>{if(o.size)throw new un(o);if(s.size)throw new ln(s);if(i.size)throw new pt([...i].toSorted()[0]);throw p});if(o.size)throw new un(o);if(s.size)throw new ln(s);if(i.size)throw new pt([...i].toSorted()[0]);let l=d.outputFiles?.[0];if(!l)throw Error("esbuild returned no browser bundle");return{code:l.text,warnings:(d.warnings??[]).map((p)=>p.text),bytes:l.contents.byteLength}}var Te=pi(yo(),1);function wo(e){return e==="@raycast/api"||/^react(?:\/|$)/.test(e)||e.startsWith("@types/")}class He extends Error{code;constructor(e,t){super(t);this.name="BrowserInstallError",this.code=e}}class xo extends He{packageName;expected;actual;constructor(e,t,n){super("BROWSER_INTEGRITY",`Integrity check failed for ${e}`);this.name="BrowserIntegrityError",this.packageName=e,this.expected=t,this.actual=n}}class Eo extends He{limit;actual;constructor(e,t){super("BROWSER_SIZE_LIMIT",`Browser dependency size limit exceeded (${t} > ${e} bytes)`);this.name="BrowserSizeLimitError",this.limit=e,this.actual=t}}class $o extends He{limit;constructor(e){super("BROWSER_PACKAGE_LIMIT",`Browser dependency package limit exceeded (${e})`);this.name="BrowserPackageLimitError",this.limit=e}}class ko extends He{packageName;constructor(e){super("BROWSER_NATIVE_MODULE",`Native package is not supported in the browser: ${e}`);this.name="BrowserNativePackageError",this.packageName=e}}class xt extends He{packageName;constructor(e,t){super("BROWSER_RESOLUTION",`Unable to resolve ${e}@${t} from the npm registry`);this.name="BrowserResolutionError",this.packageName=e}}var mu=33554432,gu=128;function We(e){return`node_modules/${e}`}function hu(e,t){if(!e)return[We(t)];let n=[`${e}/node_modules/${t}`],r=e;while(r&&r!=="."){let s=r.slice(0,r.lastIndexOf("/"));if(!s)break;n.push(`${s}/${t}`);let o=s.lastIndexOf("/");if(o<0)break;r=s.slice(0,o)}return n.push(We(t)),[...new Set(n)]}function An(e,t){return e?.packages?.[t]?.version}function bu(e,t){return e?.dependencies?.[t]?.version}function yu(e){if(e===void 0)return;if(typeof e==="string")return JSON.parse(e);return e}function So(e){return new TextDecoder().decode(e)}function On(e){return So(e).replace(/\0.*$/,"").trim()}function wu(e){let t=On(e).replace(/[^0-7].*$/,"");return t?Number.parseInt(t,8):0}class Nn extends He{path;constructor(e){super("BROWSER_TAR_PATH",`Unsafe path in npm archive: ${e}`);this.name="BrowserTarPathError",this.path=e}}function xu(e){if(e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))throw new Nn(e);let t=e.split("/");if(t.some((n)=>n===".."))throw new Nn(e);return t.filter((n)=>n!==""&&n!==".").join("/")}function Eu(e){let t=new Map,n=0,r;while(n+512<=e.length){let s=e.subarray(n,n+512);if(n+=512,s.every((l)=>l===0))break;let o=wu(s.subarray(124,136)),i=s[156],a=On(s.subarray(0,100)),f=On(s.subarray(345,500));if(f)a=`${f}/${a}`;let d=e.subarray(n,n+o);if(n+=Math.ceil(o/512)*512,i===120){for(let l of So(d).split(`
|
|
5
|
+
`)){let p=l.indexOf("=");if(p>0){if(l.slice(l.indexOf(" ")+1,p)==="path")r=l.slice(p+1)}}continue}if(a=xu(r??a),r=void 0,!a||i===53||i===1||i===2||a.endsWith("/"))continue;if(i===0||i===48||i===void 0)t.set(a,d.slice())}return t}async function $u(e){let t=new Uint8Array(e.byteLength);t.set(e);let n=new Blob([t.buffer]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(n).arrayBuffer())}async function ku(e){let t=new Uint8Array(e.byteLength);t.set(e);let n=await globalThis.crypto.subtle.digest("SHA-512",t.buffer),r="";for(let s of new Uint8Array(n))r+=String.fromCharCode(s);return`sha512-${btoa(r)}`}async function Ro(e){let t=e.maxBytes??mu,n=e.maxPackages??gu,r=yu(e.lockfile),s=(e.registry??"https://registry.npmjs.org").replace(/\/$/,""),o=new Map,i=new Map,a=new Map,f=0,d=(u)=>{if(f+=u,f>t)throw new Eo(t,f)},l=new Map,p=(u,h)=>{let y=l.get(u);if(!y)y=e.fetch(`${s}/${u}`,{headers:{Accept:"application/vnd.npm.install-v1+json"}}).then((E)=>{if(!E.ok)throw new xt(u,h);return E.json()}),l.set(u,y);return y};async function c(u,h,y){if(wo(u))return;let E=await p(u,h),m=hu(y,u),S=m.find((D)=>a.has(D));if(S){let D=a.get(S);if(Te.satisfies(D.version,h)){if(!D.active)await D.promise;return}}let v=S?void 0:m.find((D)=>{let K=An(r,D);return K!==void 0&&Te.satisfies(K,h)&&!a.has(D)});if(!v)if(S)v=`${y??We(u)}/node_modules/${u}`;else if(y===void 0)v=We(u);else{let D=We(u),K=An(r,D);v=K!==void 0&&!Te.satisfies(K,h)?`${y}/node_modules/${u}`:D}while(a.has(v)){let D=a.get(v);if(Te.satisfies(D.version,h)){if(!D.active)await D.promise;return}v=`${v}/node_modules/${u}`}let B=An(r,v)??(v===We(u)?bu(r,u):void 0),F=B!==void 0&&Te.satisfies(B,h)?B:Te.maxSatisfying(Object.keys(E.versions??{}),h);if(!F||!Te.satisfies(F,h))throw new xt(u,h);let U=E.versions?.[F],re=U?.dist?.tarball;if(!U||!re)throw new xt(u,h);if(a.size>=n)throw new $o(n);let ue,Le,Ae=new Promise((D,K)=>{ue=D,Le=K}),se={name:u,version:F,promise:Ae,active:!0};a.set(v,se);let Xe=(async()=>{try{let D=await e.fetch(re);if(!D.ok)throw new xt(u,F);let K=new Uint8Array(await D.arrayBuffer());d(K.byteLength);let je=await ku(K),O=U.dist?.integrity?.split(/\s+/).find((V)=>V.startsWith("sha512-"));if(O&&O!==je)throw new xo(u,O,je);let j=Eu(await $u(K));if([...j.keys()].some((V)=>V.endsWith(".node")||V==="binding.gyp"||V.endsWith("/binding.gyp")))throw new ko(u);for(let[V,pe]of j){let X=V.replace(/^package\/?/,"");if(X)o.set(`${v}/${X}`,pe)}if(!o.has(`${v}/package.json`))o.set(`${v}/package.json`,JSON.stringify({name:u,version:F}));if(!i.has(u)||v===We(u))i.set(u,F);let H=new Set(Object.entries(U.peerDependenciesMeta??{}).filter(([,V])=>V?.optional===!0).map(([V])=>V)),P=Object.fromEntries(Object.entries({...U.dependencies,...U.peerDependencies}).filter(([V])=>!H.has(V)));await Promise.all(Object.entries(P).map(([V,pe])=>c(V,pe,v))),se.active=!1,ue()}catch(D){se.active=!1,Le(D)}})();return Ae}return await Promise.all(Object.entries(e.manifest.dependencies??{}).map(([u,h])=>c(u,h))),{packages:o,versions:i,bytes:f}}var vo={"@raycast/api":"/packages/runtime/src/api/index.ts","@blastlauncher/protocol":"/packages/protocol/src/index.ts",react:"/node_modules/react/index.js","react/jsx-runtime":"/node_modules/react/jsx-runtime.js","react/jsx-dev-runtime":"/node_modules/react/jsx-dev-runtime.js","react-reconciler":"/node_modules/react-reconciler/index.js","react-reconciler/constants.js":"/node_modules/react-reconciler/constants.js",scheduler:"/node_modules/scheduler/index.js","stream/promises":"/packages/web/sandbox/stream-promises.ts","node:stream/promises":"/packages/web/sandbox/stream-promises.ts","util/types":"/packages/web/sandbox/util-types.ts","node:util/types":"/packages/web/sandbox/util-types.ts"};var Cn=()=>({extension:{},commands:{}});function Ln(e,t){let n=`blast:${e}:preferences`,r=null,s=()=>{try{return t?.getItem(n)??r}catch{return r}},o=()=>{let a=s();if(!a)return Cn();try{let f=JSON.parse(a);if(!f||typeof f!=="object"||!f.extension||!f.commands)return Cn();return{extension:f.extension,commands:f.commands}}catch{return Cn()}},i=(a)=>{let f=JSON.stringify(a);r=f;try{t?.setItem(n,f)}catch{}};return{read:o,save:i,values(a){let f=o();return{...f.extension,...f.commands[a]}},update(a,f,d){let l=o();i({extension:{...l.extension,...a},commands:{...l.commands,[f]:{...l.commands[f],...d}}})}}}var he=(e)=>({ok:!1,error:{code:"DENIED",message:e}});function Su(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function Io(e,t){return e.extensions.find((n)=>n.name===t)}var Oo=(e,t,n)=>`blast:${e}:${n?"internal":"user"}:${t}`,Ao=(e)=>{if(e===null)return null;try{return JSON.parse(e)}catch{return null}},Tn=(e,t)=>Oo(e,`oauth:${t}`,!0);function No(e){let t=new Map,n="",r=e.storage,s=(d)=>{try{return r?.getItem(d)??t.get(d)??null}catch{return t.get(d)??null}},o=(d,l)=>{t.set(d,l);try{r?.setItem(d,l)}catch{}},i=(d)=>{t.delete(d);try{r?.removeItem(d)}catch{}},a=(d)=>{let l=`blast:${d}:user:`,p=new Map;try{for(let u=0;u<(r?.length??0);u++){let h=r?.key(u);if(h?.startsWith(l)){let y=h.slice(l.length),E=r?.getItem(h);if(typeof E==="string")p.set(y,E)}}}catch{}for(let[u,h]of t)if(u.startsWith(l))p.set(u.slice(l.length),h);let c={};for(let[u,h]of p)try{c[u]=JSON.parse(h)}catch{}return c},f=(d)=>{let l=`blast:${d}:user:`,p=new Set;for(let c of t.keys())if(c.startsWith(l))p.add(c);try{for(let c=0;c<(r?.length??0);c++){let u=r?.key(c);if(u?.startsWith(l))p.add(u)}}catch{}for(let c of p)i(c)};return async function(l,p){let c=Su(l.params);if(l.name==="storage.get"||l.name==="storage.set"||l.name==="storage.remove"){let u=typeof c.key==="string"?c.key:"";if(!u)return he(`${l.name} requires a non-empty key`);let h=Oo(p.extensionName,u,c.scope==="blast:internal");if(l.name==="storage.get")return{ok:!0,value:Ao(s(h))};if(l.name==="storage.remove")return i(h),{ok:!0,value:null};return o(h,JSON.stringify(c.value)),{ok:!0,value:null}}if(l.name==="storage.all")return{ok:!0,value:a(p.extensionName)};if(l.name==="storage.clear")return f(p.extensionName),{ok:!0,value:null};if(l.name==="oauth.tokens.get")return{ok:!0,value:Ao(s(Tn(p.extensionName,String(c.providerId??""))))};if(l.name==="oauth.tokens.set")return o(Tn(p.extensionName,String(c.providerId??"")),JSON.stringify(c.tokens)),{ok:!0,value:null};if(l.name==="oauth.tokens.remove")return i(Tn(p.extensionName,String(c.providerId??""))),{ok:!0,value:null};if(l.name==="clipboard.copy"||l.name==="clipboard.paste"){let u=typeof c.text==="string"?c.text:"";n=u;try{await e.clipboard?.writeText?.(u)}catch{}if(l.name==="clipboard.paste")e.status?.("Copied — paste with ⌘V");else e.status?.("Copied");return{ok:!0,value:null}}if(l.name==="clipboard.read"){try{let u=await e.clipboard?.readText?.();if(typeof u==="string")return{ok:!0,value:{text:u}}}catch{}return{ok:!0,value:{text:n}}}if(l.name==="clipboard.clear")return n="",{ok:!0,value:null};if(l.name==="open.url"){let u=typeof c.url==="string"?c.url:"";return e.openUrl?.(u),{ok:!0,value:null}}if(l.name==="command.metadata")return Io(e.catalog,p.extensionName)?.commands.find((h)=>h.name===p.commandName)?{ok:!0,value:null}:he("This command is not in the browser catalog");if(l.name==="command.launch"){let u=String(c.extensionName??p.extensionName);if(u!==p.extensionName)return he("The browser demo can launch commands only from the current extension");let h=typeof c.name==="string"?c.name:"";if(!Io(e.catalog,u)?.commands.some((E)=>E.name===h))return he("That command is not in the browser catalog");if(c.type==="background")return e.status?.(`Background command accepted: ${h}`),{ok:!0,value:null};if(!e.launchCommand)return he("Command launching is unavailable in this browser session");let y={};if(c.arguments&&typeof c.arguments==="object"){for(let[E,m]of Object.entries(c.arguments))if(typeof m==="string")y[E]=m}return await e.launchCommand(p.source,h,y),{ok:!0,value:null}}if(l.name==="oauth.authorize")return he("OAuth authorization needs a host redirect and is unavailable in a browser tab");if(l.name==="preferences.open"){let u=c.scope;if(u!=="extension"&&u!=="command")return he("preferences.open requires an extension or command scope");return e.openPreferences?.(u,p),{ok:!0,value:null}}if(l.name==="applications.list")return{ok:!0,value:[]};if(l.name==="applications.default"||l.name==="applications.frontmost")return he("Applications are unavailable in a browser tab");if(l.name.startsWith("applications."))return he("Applications are unavailable in a browser tab");if(l.name.startsWith("selection."))return he("Selection is unavailable in a browser tab");if(l.name.startsWith("window."))return he("Window management is unavailable in a browser tab");if(l.name.startsWith("ai."))return he("AI access is unavailable in a browser tab");return he(`${l.name} is not supported by the browser demo`)}}var Co=`
|
|
6
6
|
.blast-web{--blast-bg:#fcfcfc;--blast-fg:#171717;--blast-muted:#646464;--blast-line:#e2e2e2;--blast-selection:#ededed;--blast-accent:#ff6338;--blast-error:#d93036;--blast-radius:12px;font:14px/1.4 system-ui,sans-serif;background:var(--blast-bg);color:var(--blast-fg);border:1px solid var(--blast-line);border-radius:var(--blast-radius);overflow:hidden}
|
|
7
7
|
.blast-web[data-theme=dark]{--blast-bg:#161616;--blast-fg:#f2f2f2;--blast-muted:#a0a0a0;--blast-line:#343434;--blast-selection:#282828}
|
|
8
8
|
@media(prefers-color-scheme:dark){.blast-web:not([data-theme=light]){--blast-bg:#161616;--blast-fg:#f2f2f2;--blast-muted:#a0a0a0;--blast-line:#343434;--blast-selection:#282828}}
|
|
@@ -28,8 +28,13 @@ if (typeof __blastRuntime.start === "function") __blastRuntime.start(async () =>
|
|
|
28
28
|
.blast-web .detail,.blast-web .extension-form{padding:.75rem}
|
|
29
29
|
.blast-web .form-field{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.5rem}
|
|
30
30
|
.blast-web .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
31
|
-
`;function E(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var To=(e,t,n)=>`<button type="button" class="footer-key" data-footer="${n}"><span>${E(e)}</span><kbd>${E(t)}</kbd></button>`,Mn=(e,t,n)=>{if(!t)return"";let r=n?.(t);return r?`<${e} class="reserved" title="${E(r)}" aria-label="${E(`${t}, ${r}`)}">${E(t)}</${e}>`:`<${e}>${E(t)}</${e}>`},$u=(e,t,n=!1)=>`<button data-input="${E(t)}"${n?' class="selected"':""}>${E(e)}</button>`,Lo=(e,t)=>{if(t&&/^data:image\/[a-z0-9.+-]+[;,]\S*$/iu.test(e))return e;try{return new URL(e).protocol==="https:"?e:void 0}catch{return}},qt=(e)=>E(e).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__([^_]+)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/(^|[^\w])_([^_]+)_(?!\w)/g,"$1<em>$2</em>"),Pn=(e)=>{let t="",n=0;for(let r of e.matchAll(/`([^`]+)`|(!?)\[([^\]]*)\]\(([^\s)]+)\)/gu)){t+=qt(e.slice(n,r.index)),n=r.index+r[0].length;let[,s,o,i="",a=""]=r;if(s!==void 0)t+=`<code>${E(s)}</code>`;else if(o){let f=Lo(a,!0);t+=f?`<img src="${E(f)}" alt="${E(i)}">`:E(i)}else{let f=Lo(a,!1);t+=f?`<a href="${E(f)}" target="_blank" rel="noreferrer noopener">${qt(i)}</a>`:qt(i)}}return t+qt(e.slice(n))};function ku(e){let t=String(e??"").split(/\r?\n/),n=[],r=!1;for(let s of t){let o=s.match(/^\s*[-*]\s+(.+)$/);if(o){if(!r)n.push("<ul>"),r=!0;n.push(`<li>${Pn(o[1]??"")}</li>`);continue}if(r)n.push("</ul>"),r=!1;let i=s.match(/^\s*(#{1,3})\s+(.+)$/);if(i){let a=i[1]?.length??1;n.push(`<h${a}>${Pn(i[2]??"")}</h${a}>`);continue}if(!s.trim())continue;n.push(`<p>${Pn(s)}</p>`)}if(r)n.push("</ul>");return n.join("")}function Su(e){return`<span id="status" role="status" data-error="${e.error?"true":"false"}"${e.stage?` data-stage="${E(e.stage)}"`:""}>${e.progress?'<span class="status-spinner" aria-hidden="true"></span>':""}${E(e.text)}</span>`}function Ru(e){if(!e)return"";return`<div class="breadcrumb"><span class="breadcrumb-icon" aria-hidden="true">${e.iconUrl?`<img src="${E(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:E(e.icon??"⌘")}</span><span>${E(e.extensionTitle)}</span><span class="breadcrumb-separator">›</span><span>${E(e.commandTitle)}</span></div>`}function vu(e,t){if(!e)return"";return`<span class="footer-context" aria-hidden="true"><span class="footer-icon">${e.iconUrl?`<img src="${E(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:E(e.icon??"⌘")}</span><span class="footer-title">${E(t||e.commandTitle)}</span></span>`}function Iu(e,t={}){let n=e.feedback.toast?`<aside class="toast" data-style="${E(e.feedback.toast.style)}"><strong>${E(e.feedback.toast.title)}</strong> ${E(e.feedback.toast.message)}${e.feedback.toast.actions.map((o,i)=>`<button type="button" data-toast-action="${i}">${E(o.title)} ${Mn("small",o.shortcut,t.reservedHint)}</button>`).join("")}</aside>`:"",r=e.feedback.hud?`<aside class="hud" role="status">${E(e.feedback.hud.title)}</aside>`:"",s=e.feedback.alert?`<section class="alert-backdrop"><dialog open class="alert" role="alertdialog" aria-modal="true" aria-labelledby="alert-title"><h2 id="alert-title">${E(e.feedback.alert.title)}</h2><p>${E(e.feedback.alert.message)}</p>${e.feedback.alert.rememberUserChoice?`<label><input id="alert-remember" type="checkbox"${e.feedback.alert.remember?" checked":""}> Remember my choice</label>`:""}<footer>${e.feedback.alert.dismiss?`<button type="button" data-alert="dismiss">${E(e.feedback.alert.dismiss.title)}</button>`:""}${e.feedback.alert.primary?`<button type="button" data-alert="confirm">${E(e.feedback.alert.primary.title)}</button>`:""}</footer></dialog></section>`:"";return`${n}${r}${s}`}function Po(e,t={}){let n=t.status??{text:"Ready"},r=`<input id="search" value="${E(e.search.text)}" placeholder="${E(e.search.placeholder)}" aria-label="Search">${e.dropdown?`<button type="button" class="dropdown-trigger" data-dropdown-open aria-label="${E(e.dropdown.tooltip||e.dropdown.label)}">${E(e.dropdown.label||"Filter")}⌄</button>`:""}`,s=e.rows.map((m)=>m.kind==="section"?`<li class="section-header" data-id="${E(m.id)}"><strong>${E(m.title)}</strong>${m.count===null?"":`<small>${m.count}</small>`}</li>`:`<li${m.selected?' class="selected"':""} data-id="${E(m.id)}"><span class="root-icon"${m.iconTint?` style="color:${E(m.iconTint)}"`:""}>${E(m.iconLabel)}</span><span class="root-copy"><strong>${E(m.title)}</strong>${m.subtitle?`<small>${E(m.subtitle)}</small>`:""}</span>${m.accessories?`<span class="root-accessory">${E(m.accessories)}</span>`:""}</li>`).join(""),o=(e.grid??[]).map((m)=>`${m.header?`<li class="grid-header">${E(m.header)}</li>`:""}<li class="grid-row">${m.cells.map((R)=>`<button type="button" class="grid-cell${R.selected?" selected":""}" data-id="${E(R.id)}"><span class="grid-content">${E(R.content)}</span><strong>${E(R.title)}</strong><small>${E(R.subtitle)}</small></button>`).join("")}</li>`).join(""),i=e.dropdown?.open?`<section class="dropdown-panel" role="dialog" aria-label="${E(e.dropdown.label)}"><input id="dropdown-search" data-dropdown-search value="${E(e.dropdown.query)}" aria-label="Filter options"><ul>${e.dropdown.options.map((m)=>`<li><button type="button" data-dropdown-value="${E(m.value)}"${m.selected?' class="selected"':""}>${E(m.title)}${m.current?" ✓":""}</button></li>`).join("")}</ul></section>`:"",a=e.actions.open?`<section class="actions"><strong>${E(e.actions.title)}</strong><div class="breadcrumb">${e.actions.breadcrumb.map(E).join(" / ")}</div><input id="action-search" value="${E(e.actions.query)}" placeholder="Search actions…" aria-label="Action search"><ul>${e.actions.rows.map((m,R)=>`<li${m.selected?' class="selected"':""} data-action-index="${R}">${E(m.title)} ${Mn("small",m.shortcut,t.reservedHint)}</li>`).join("")}</ul></section>`:"",f=e.form,d=f?`<form class="extension-form">${f.items.map((m)=>{if(m.kind==="separator")return'<hr class="form-separator">';if(m.kind==="description")return`<p class="form-description">${E(m.title)}${m.text?`: ${E(m.text)}`:""}</p>`;let R=f.fields.find((re)=>re.id===m.id);if(!R)return"";let A=E(R.title||R.label||R.id),_=`id="field-${E(R.id)}" data-field="${E(R.id)}"`,F=R.error?`<small class="form-error" role="alert">${E(R.error)}</small>`:"";if(R.type==="Form.Checkbox")return`<label class="form-field checkbox"><span>${A}</span><input ${_} type="checkbox"${R.checked?" checked":""}></label>`;if(R.type==="Form.Dropdown"||R.type==="Form.TagPicker")return`<label class="form-field"><span>${A}</span><select ${_} ${R.type==="Form.TagPicker"?"multiple":""}>${R.options.map((re)=>`<option value="${E(re.value)}"${R.selected.some((ue)=>ue.value===re.value)?" selected":""}>${E(re.title)}</option>`).join("")}</select>${F}</label>`;if(R.type==="Form.DatePicker")return`<label class="form-field"><span>${A}</span><input ${_} type="date" value="${E(R.text.slice(0,10))}">${F}</label>`;if(R.type==="Form.FilePicker")return`<p class="form-unavailable">${A}: not available in the browser</p>`;let U=R.type==="Form.TextArea";return`<label class="form-field"><span>${A}</span>${U?`<textarea ${_} placeholder="${E(R.placeholder)}">${E(R.text)}</textarea>`:`<input ${_} type="${R.type==="Form.PasswordField"?"password":"text"}"${R.hasValue?" data-has-value":""} value="${E(R.text)}" placeholder="${E(R.placeholder)}">`}${F}</label>`}).join("")}${$u("Submit","primary")}</form>`:"",l=e.kind==="detail"||e.kind==="list"&&e.detail?`<article class="detail">${ku(e.detail)}</article>`:"",p=e.kind==="grid"?(e.grid??[]).every((m)=>m.cells.length===0):e.rows.length===0,c=e.empty?`<p class="empty"><strong>${E(e.empty.title)}</strong> ${E(e.empty.description)}</p>`:p&&(e.kind==="list"||e.kind==="grid")?`<p class="empty">${E(e.emptyText||"No results")}</p>`:"",u=e.menuBar?`<nav class="menu-bar" aria-label="${E(e.menuBar.tooltip||e.menuBar.title||"Menu")}"><h2>${E(e.menuBar.title||"Menu")}</h2><ul>${e.menuBar.rows.map((m)=>m.kind==="section"?`<li class="menu-section"><strong>${E(m.title)}</strong></li>`:`<li><button type="button" data-menu-id="${E(m.id)}"${m.selected?' class="selected"':""}${m.disabled?" disabled":""}><span class="menu-icon"${m.iconTint?` style="color:${E(m.iconTint)}"`:""}>${E(m.iconLabel||"")}</span><span>${E(m.title)}</span>${m.subtitle?`<small>${E(m.subtitle)}</small>`:""}${Mn("kbd",m.shortcut,t.reservedHint)}${m.kind==="submenu"?" ›":""}</button></li>`).join("")}</ul></nav>`:"",g=e.kind==="menu-bar"?u:e.kind==="form"?d:e.kind==="detail"?l:e.kind==="grid"?`<ul class="grid">${o}</ul>${c}`:l?`<div class="list-split"><div class="list-pane"><ul class="rows">${s}</ul>${c}</div>${l}</div>`:`<ul class="rows">${s}</ul>${c}`,y=`<footer>${vu(t.context,e.title)}${Su(n)}<span class="footer-hints">${e.primary.enabled?To(e.primary.title,e.primary.shortcut||"↵","primary"):""}${To("Actions",t.actionsKey??"⌘K","actions")}</span></footer>`,S='<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>';return`<main data-kind="${E(e.kind)}" data-loading="${e.loading?"true":"false"}" aria-busy="${e.loading?"true":"false"}"><header><h1>${E(e.title)}</h1><div class="search-line">${'<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>'}${Ru(t.context)}${r}</div></header>${g}${a}${i}${y}${Iu(e,t)}</main>`}var Mo="blast-web-styles";function Au(e){if(e.getElementById(Mo))return;let t=e.createElement("style");t.id=Mo,t.textContent=Co,e.head.prepend(t)}var Nu=(e)=>e instanceof HTMLElement?e.closest("[data-field]"):null;function Bo(e,t,n={}){if(Au(e.ownerDocument),e.classList.add("blast-web"),typeof n.theme==="string")e.dataset.theme=n.theme;else if(n.theme)for(let[d,l]of Object.entries(n.theme))e.style.setProperty(d,l);if(!e.hasAttribute("tabindex"))e.tabIndex=0;let r,s=(d)=>{if(!r)return;let l=d.target,p=l instanceof HTMLTextAreaElement;if(d.key==="ArrowDown")t({type:"move",direction:"down"});else if(d.key==="ArrowUp")t({type:"move",direction:"up"});else if(d.key==="Enter"&&(d.metaKey||d.ctrlKey))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if(d.key==="Enter"&&!p&&!(l instanceof HTMLButtonElement))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if((d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k")t({type:r.actions.open?"closeActions":"openActions"});else if(d.key==="Escape")if(!r.actions.open&&!r.dropdown?.open&&r.search.text)t({type:"search",text:""});else t({type:"back"});else return;d.preventDefault()},o=(d)=>{let l=d.target,p=Nu(l);if(l.id==="search")t({type:"search",text:l.value});else if(l.id==="action-search")t({type:"actionsQuery",text:l.value});else if(l.hasAttribute("data-dropdown-search"))t({type:"dropdownQuery",text:l.value});else if(p?.dataset.field)t(l.type==="checkbox"?{type:"toggle",id:p.dataset.field}:{type:"setValue",id:p.dataset.field,value:l.value})},i=(d)=>{let l=d.target,p=l.closest("[data-footer]")?.dataset.footer;if(p==="primary")return t({type:"primary"});if(p==="actions")return t({type:"openActions"});if(p==="back")return t({type:"back"});if(l.closest("[data-dropdown-open]"))return t({type:"openDropdown"});let c=l.closest("[data-action-index]");if(c&&r?.actions.open){let g=Number(c.dataset.actionIndex)-r.actions.selectedIndex;for(let y=0;y<Math.abs(g);y++)t({type:"move",direction:g>0?"down":"up"});return t({type:"primary"})}let u=l.closest("[data-id], [data-menu-id]");if(u)t({type:"select",id:u.dataset.id??u.dataset.menuId??""})},a=(d)=>{d.preventDefault(),t({type:"submit"})};e.addEventListener("keydown",s),e.addEventListener("input",o),e.addEventListener("click",i),e.addEventListener("submit",a);let f=(d)=>{let l=e.contains(document.activeElement)?document.activeElement:void 0,p=l?.id||l?.dataset.field,c=l?[l.selectionStart,l.selectionEnd]:void 0;d();let u=(p?e.querySelector(`#${CSS.escape(p)}, [data-field="${p}"]`):null)??(l?null:e.querySelector("#search"));if(!u)return;if(u.focus({preventScroll:!0}),c?.[0]!=null&&c[1]!=null)u.setSelectionRange?.(c[0],c[1])};return{draw(d,l){if("type"in d&&d.type==="loading"){r=void 0,e.innerHTML='<p role="status" aria-busy="true"></p>',e.firstElementChild.textContent=l.text||"Loading extension…";return}if("type"in d&&d.type==="error"){r=void 0,e.innerHTML='<p role="alert" data-blast-error></p>',e.firstElementChild.textContent=d.message;return}r=d,f(()=>{e.innerHTML=Po(r,{status:l,...n.actionsKey?{actionsKey:n.actionsKey}:{}})})},destroy(){e.removeEventListener("keydown",s),e.removeEventListener("input",o),e.removeEventListener("click",i),e.removeEventListener("submit",a),e.classList.remove("blast-web"),e.replaceChildren()}}}function Gt(e){let t=e.trim();if(!t)throw Error("Enter a GitHub extension URL or name");if(!t.includes("://")){if(t.includes("/")||t.includes("\\"))throw Error("Extension names cannot contain a path separator");return{kind:"github",owner:"raycast",repo:"extensions",ref:"main",path:`extensions/${t}`}}let n;try{n=new URL(t)}catch{throw Error("Invalid extension URL")}if(n.protocol!=="https:"||n.hostname!=="github.com")throw Error("Extension URL must use https://github.com");let r=n.pathname.split("/").filter(Boolean);if(r[2]!=="tree"||r.length<5)throw Error("GitHub URL must be /<owner>/<repo>/tree/<ref>/<path>");let[s,o,,i,...a]=r;if(!s||!o||!i||a.length===0)throw Error("GitHub URL must include an extension path");return{kind:"github",owner:s,repo:o,ref:i,path:a.join("/")}}function Wt(e){return/\.(?:cjs|css|html?|js|jsx|json|md|mjs|ts|tsx|txt|yaml|yml)$/i.test(e)}function Fo(e,t){return t&&e.owner==="raycast"&&e.repo==="extensions"}var Ou=(e)=>e.split("/").map((t)=>encodeURIComponent(t)).join("/"),jo=(e)=>e.status===403&&e.headers.get("x-ratelimit-remaining")==="0";function Bn(e){return/^raycast\/extensions\/([^/]+)$/.exec(e.trim())?.[1]??e}async function _o(e,t={}){let n=t.fetch??((l,p)=>fetch(l,p)),r=Gt(Bn(e)),s=new Map,o=async(l,p)=>{let c=await n(p);if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to fetch ${l} (${c.status})`)}let u=new Uint8Array(await c.arrayBuffer());s.set(`/${l}`,Wt(l)?new TextDecoder().decode(u):u)},i=r.path,a=[];if(Fo(r,t.fixturesUrl!==void 0)){let l=`${t.fixturesUrl}${encodeURIComponent(r.path.replace(/^extensions\//,""))}`,p=await n(`${l}/__files`).catch(()=>{return});if(p?.ok){a=await p.json(),i=r.path.replace(/^extensions\//,"");for(let c of a)await o(c,`${l}/${c}`)}}if(a.length===0){let l=async(p)=>{let c=await n(`https://api.github.com/repos/${encodeURIComponent(r.owner)}/${encodeURIComponent(r.repo)}/contents/${Ou(p)}?ref=${encodeURIComponent(r.ref)}`,{headers:{Accept:"application/vnd.github+json"}});if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to list GitHub extension files (${c.status})`)}let u=await c.json(),g=[];for(let y of u){if(!y.path||y.path.split("/").includes("node_modules"))continue;if(y.type==="dir")g.push(...await l(y.path));else if(y.type==="file")g.push(y.path.slice(r.path.length+1))}return g};if(a=await l(r.path),!a.includes("package.json"))throw Error("Extension package.json was not found");for(let p of a)await o(p,`https://raw.githubusercontent.com/${r.owner}/${r.repo}/${encodeURIComponent(r.ref)}/${r.path}/${p}`)}let f=JSON.parse(String(s.get("/package.json"))),d=s.get("/package-lock.json");return{files:s,manifest:f,root:i,...typeof d==="string"?{lockfile:d}:{}}}function Vo(e,t){for(let n of["tsx","ts","jsx","js"]){let r=`/src/${t}.${n}`;if(e.has(r))return r}if(e.has("/src/index.tsx"))return"/src/index.tsx";throw Error(`Command source not found for ${t}`)}function Fn(e){let t=e.commands;return Array.isArray(t)?t.flatMap((n)=>typeof n?.name==="string"?[n.name]:[]):[]}function jn(){let e;try{e=globalThis.localStorage}catch{}return{...e?{storage:e}:{},clipboard:{readText:()=>navigator.clipboard.readText(),writeText:(t)=>navigator.clipboard.writeText(t)},openUrl:(t)=>{if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer")}}}class Uo extends Error{code="BROWSER_LAUNCH_TIMEOUT";stage;constructor(e,t){super(`Command did not start (${t}) after ${e} ms`);this.name="BrowserLaunchTimeoutError",this.stage=t}}function _n(e,t,n="waiting for runtime port"){return new Promise((r,s)=>{let o=setTimeout(()=>s(new Uo(t,n)),t);e.then((i)=>{clearTimeout(o),r(i)},(i)=>{clearTimeout(o),s(i)})})}function Do(){let e=0;return{next:()=>++e,current:()=>e,isCurrent:(t)=>t===e}}var Cu=["appPicker","checkbox","dropdown","password","textfield","file","directory"];function it(e,t="Preferences"){if(e===void 0)return[];if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((n,r)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} entry ${r+1} must be an object`);let s=n,{name:o,type:i,default:a,description:f,placeholder:d,label:l}=s;if(typeof o!=="string"||!o)throw Error(`${t} entry ${r+1} needs a name`);if(typeof i!=="string"||!Cu.includes(i))throw Error(`Preference ${JSON.stringify(o)} has an unknown type ${JSON.stringify(i)}`);if(a!==void 0&&typeof a!=="string"&&typeof a!=="boolean"&&!(typeof a==="number"&&Number.isFinite(a)))throw Error(`Preference ${JSON.stringify(o)} needs a scalar "default"`);if(f!==void 0&&typeof f!=="string")throw Error(`Preference ${JSON.stringify(o)} needs a string "description"`);return{name:o,type:i,title:(i==="checkbox"?l:s.title)||o,required:s.required===!0,data:Array.isArray(s.data)?s.data.filter((p)=>!!p&&typeof p==="object"&&typeof p.value==="string"&&typeof p.title==="string"):[],...typeof f==="string"?{description:f}:{},...typeof d==="string"?{placeholder:d}:{},...typeof l==="string"?{label:l}:{},...a===void 0?{}:{default:a}}})}function Ht(e,t){return[...new Map([...e,...t].map((n)=>[n.name,n])).values()]}function qo(e,t){return Object.fromEntries(Ht(e,t).filter((n)=>n.default!==void 0).map((n)=>[n.name,n.default]))}function Vn(e,t){return e.filter((n)=>n.required&&n.default===void 0&&(t[n.name]===void 0||t[n.name]===""))}function Un(e,t){return`${e}/${t}`}function Dn(e){if(!e||typeof e!=="object")throw Error("Invalid browser bundle index");let t=e;if(typeof t.buildSha!=="string"||!t.bundles||typeof t.bundles!=="object")throw Error("Invalid browser bundle index shape");let n=t.runtime,r;if(n!==void 0){if(!n||typeof n!=="object")throw Error("Invalid runtime bundle");let o=n;if(o.path!=="bundles/runtime.js"||typeof o.bytes!=="number"||!Number.isInteger(o.bytes)||typeof o.sha256!=="string"||!/^[0-9a-f]{64}$/.test(o.sha256))throw Error("Invalid runtime bundle");r={path:o.path,bytes:o.bytes,sha256:o.sha256}}let s={};for(let[o,i]of Object.entries(t.bundles)){if(!i||typeof i!=="object")throw Error(`Invalid bundle entry: ${o}`);let a=i;if(typeof a.path!=="string"||!/^bundles\/[^/]+\/[^/]+\.js$/.test(a.path)||typeof a.bytes!=="number"||!Number.isInteger(a.bytes)||a.bytes<0||typeof a.sha256!=="string"||!/^[0-9a-f]{64}$/.test(a.sha256))throw Error(`Invalid bundle entry shape: ${o}`);let f={};if(a.files!==void 0){if(!a.files||typeof a.files!=="object")throw Error(`Invalid bundle files: ${o}`);for(let[l,p]of Object.entries(a.files)){if(!p||typeof p!=="object")throw Error(`Invalid bundle file: ${o}/${l}`);let c=p;if(typeof c.path!=="string"||!c.path.startsWith("bundles/")||typeof c.bytes!=="number"||!Number.isInteger(c.bytes)||c.bytes<0||typeof c.sha256!=="string"||!/^[0-9a-f]{64}$/.test(c.sha256))throw Error(`Invalid bundle file shape: ${o}/${l}`);f[l]={path:c.path,bytes:c.bytes,sha256:c.sha256}}}let d;if(a.manifest!==void 0){if(!a.manifest||typeof a.manifest!=="object")throw Error(`Invalid bundle manifest: ${o}`);let l=a.manifest;if(typeof l.name!=="string"||!l.commands||typeof l.commands!=="object")throw Error(`Invalid bundle manifest shape: ${o}`);let p={},c={},u=l.modes;if(u!==void 0&&(!u||typeof u!=="object"))throw Error(`Invalid bundle manifest modes: ${o}`);for(let[S,m]of Object.entries(u??{})){if(m!=="view"&&m!=="no-view"&&m!=="menu-bar"&&m!=="model-provider")throw Error(`Invalid bundle manifest mode: ${o}/${S}`);c[S]=m}for(let[S,m]of Object.entries(l.commands))p[S]=it(m,`Bundle ${o} command ${S} preferences`);for(let S of Object.keys(p))c[S]??="view";let g={},y=l.arguments;if(y!==void 0&&(!y||typeof y!=="object"))throw Error(`Invalid bundle manifest arguments: ${o}`);for(let[S,m]of Object.entries(y??{})){if(!Array.isArray(m))throw Error(`Invalid bundle manifest arguments: ${o}/${S}`);g[S]=m.map((R)=>{let A=R;if(!A||typeof A.name!=="string"||typeof A.required!=="boolean")throw Error(`Invalid bundle manifest argument: ${o}/${S}`);return{name:A.name,required:A.required}})}d={name:l.name,preferences:it(l.preferences,`Bundle ${o} preferences`),commands:p,...Object.keys(g).length?{arguments:g}:{},...Object.keys(c).length?{modes:c}:{}}}s[o]={path:a.path,bytes:a.bytes,sha256:a.sha256,...Object.keys(f).length?{files:f}:{},...d?{manifest:d}:{}}}return{buildSha:t.buildSha,bundles:s,...r?{runtime:r}:{}}}async function Xt(e){let t=await globalThis.crypto.subtle.digest("SHA-256",e);return[...new Uint8Array(t)].map((n)=>n.toString(16).padStart(2,"0")).join("")}async function qn(e,t,n,r){let s=e?.bundles[n];return Boolean(s&&t===e?.buildSha&&s.bytes===r.byteLength&&await Xt(r)===s.sha256)}var Hn=()=>globalThis.location?.href,Gn=new Map,Wn=new Map,Go=(e)=>`${e.bundlesUrl}
|
|
32
|
-
${e.buildUrl??""}`,
|
|
33
|
-
`)
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
`;function k(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var To=(e,t,n)=>`<button type="button" class="footer-key" data-footer="${n}"><span>${k(e)}</span><kbd>${k(t)}</kbd></button>`,Mn=(e,t,n)=>{if(!t)return"";let r=n?.(t);return r?`<${e} class="reserved" title="${k(r)}" aria-label="${k(`${t}, ${r}`)}">${k(t)}</${e}>`:`<${e}>${k(t)}</${e}>`},Ru=(e,t,n=!1)=>`<button data-input="${k(t)}"${n?' class="selected"':""}>${k(e)}</button>`,Lo=(e,t)=>{if(t&&/^data:image\/[a-z0-9.+-]+[;,]\S*$/iu.test(e))return e;try{return new URL(e).protocol==="https:"?e:void 0}catch{return}},qt=(e)=>k(e).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__([^_]+)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/(^|[^\w])_([^_]+)_(?!\w)/g,"$1<em>$2</em>"),Pn=(e)=>{let t="",n=0;for(let r of e.matchAll(/`([^`]+)`|(!?)\[([^\]]*)\]\(([^\s)]+)\)/gu)){t+=qt(e.slice(n,r.index)),n=r.index+r[0].length;let[,s,o,i="",a=""]=r;if(s!==void 0)t+=`<code>${k(s)}</code>`;else if(o){let f=Lo(a,!0);t+=f?`<img src="${k(f)}" alt="${k(i)}">`:k(i)}else{let f=Lo(a,!1);t+=f?`<a href="${k(f)}" target="_blank" rel="noreferrer noopener">${qt(i)}</a>`:qt(i)}}return t+qt(e.slice(n))};function vu(e){let t=String(e??"").split(/\r?\n/),n=[],r=!1;for(let s of t){let o=s.match(/^\s*[-*]\s+(.+)$/);if(o){if(!r)n.push("<ul>"),r=!0;n.push(`<li>${Pn(o[1]??"")}</li>`);continue}if(r)n.push("</ul>"),r=!1;let i=s.match(/^\s*(#{1,3})\s+(.+)$/);if(i){let a=i[1]?.length??1;n.push(`<h${a}>${Pn(i[2]??"")}</h${a}>`);continue}if(!s.trim())continue;n.push(`<p>${Pn(s)}</p>`)}if(r)n.push("</ul>");return n.join("")}function Iu(e){return`<span id="status" role="status" data-error="${e.error?"true":"false"}"${e.stage?` data-stage="${k(e.stage)}"`:""}>${e.progress?'<span class="status-spinner" aria-hidden="true"></span>':""}${k(e.text)}</span>`}function Au(e){if(!e)return"";return`<div class="breadcrumb"><span class="breadcrumb-icon" aria-hidden="true">${e.iconUrl?`<img src="${k(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:k(e.icon??"⌘")}</span><span>${k(e.extensionTitle)}</span><span class="breadcrumb-separator">›</span><span>${k(e.commandTitle)}</span></div>`}function Ou(e,t){if(!e)return"";return`<span class="footer-context" aria-hidden="true"><span class="footer-icon">${e.iconUrl?`<img src="${k(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:k(e.icon??"⌘")}</span><span class="footer-title">${k(t||e.commandTitle)}</span></span>`}function Nu(e,t={}){let n=e.feedback.toast?`<aside class="toast" data-style="${k(e.feedback.toast.style)}"><strong>${k(e.feedback.toast.title)}</strong> ${k(e.feedback.toast.message)}${e.feedback.toast.actions.map((o,i)=>`<button type="button" data-toast-action="${i}">${k(o.title)} ${Mn("small",o.shortcut,t.reservedHint)}</button>`).join("")}</aside>`:"",r=e.feedback.hud?`<aside class="hud" role="status">${k(e.feedback.hud.title)}</aside>`:"",s=e.feedback.alert?`<section class="alert-backdrop"><dialog open class="alert" role="alertdialog" aria-modal="true" aria-labelledby="alert-title"><h2 id="alert-title">${k(e.feedback.alert.title)}</h2><p>${k(e.feedback.alert.message)}</p>${e.feedback.alert.rememberUserChoice?`<label><input id="alert-remember" type="checkbox"${e.feedback.alert.remember?" checked":""}> Remember my choice</label>`:""}<footer>${e.feedback.alert.dismiss?`<button type="button" data-alert="dismiss">${k(e.feedback.alert.dismiss.title)}</button>`:""}${e.feedback.alert.primary?`<button type="button" data-alert="confirm">${k(e.feedback.alert.primary.title)}</button>`:""}</footer></dialog></section>`:"";return`${n}${r}${s}`}function Po(e,t={}){let n=t.status??{text:"Ready"},r=`<input id="search" value="${k(e.search.text)}" placeholder="${k(e.search.placeholder)}" aria-label="Search">${e.dropdown?`<button type="button" class="dropdown-trigger" data-dropdown-open aria-label="${k(e.dropdown.tooltip||e.dropdown.label)}">${k(e.dropdown.label||"Filter")}⌄</button>`:""}`,s=e.rows.map((m)=>m.kind==="section"?`<li class="section-header" data-id="${k(m.id)}"><strong>${k(m.title)}</strong>${m.count===null?"":`<small>${m.count}</small>`}</li>`:`<li${m.selected?' class="selected"':""} data-id="${k(m.id)}"><span class="root-icon"${m.iconTint?` style="color:${k(m.iconTint)}"`:""}>${k(m.iconLabel)}</span><span class="root-copy"><strong>${k(m.title)}</strong>${m.subtitle?`<small>${k(m.subtitle)}</small>`:""}</span>${m.accessories?`<span class="root-accessory">${k(m.accessories)}</span>`:""}</li>`).join(""),o=(e.grid??[]).map((m)=>`${m.header?`<li class="grid-header">${k(m.header)}</li>`:""}<li class="grid-row">${m.cells.map((S)=>`<button type="button" class="grid-cell${S.selected?" selected":""}" data-id="${k(S.id)}"><span class="grid-content">${k(S.content)}</span><strong>${k(S.title)}</strong><small>${k(S.subtitle)}</small></button>`).join("")}</li>`).join(""),i=e.dropdown?.open?`<section class="dropdown-panel" role="dialog" aria-label="${k(e.dropdown.label)}"><input id="dropdown-search" data-dropdown-search value="${k(e.dropdown.query)}" aria-label="Filter options"><ul>${e.dropdown.options.map((m)=>`<li><button type="button" data-dropdown-value="${k(m.value)}"${m.selected?' class="selected"':""}>${k(m.title)}${m.current?" ✓":""}</button></li>`).join("")}</ul></section>`:"",a=e.actions.open?`<section class="actions"><strong>${k(e.actions.title)}</strong><div class="breadcrumb">${e.actions.breadcrumb.map(k).join(" / ")}</div><input id="action-search" value="${k(e.actions.query)}" placeholder="Search actions…" aria-label="Action search"><ul>${e.actions.rows.map((m,S)=>`<li${m.selected?' class="selected"':""} data-action-index="${S}">${k(m.title)} ${Mn("small",m.shortcut,t.reservedHint)}</li>`).join("")}</ul></section>`:"",f=e.form,d=f?`<form class="extension-form">${f.items.map((m)=>{if(m.kind==="separator")return'<hr class="form-separator">';if(m.kind==="description")return`<p class="form-description">${k(m.title)}${m.text?`: ${k(m.text)}`:""}</p>`;let S=f.fields.find((re)=>re.id===m.id);if(!S)return"";let v=k(S.title||S.label||S.id),B=`id="field-${k(S.id)}" data-field="${k(S.id)}"`,F=S.error?`<small class="form-error" role="alert">${k(S.error)}</small>`:"";if(S.type==="Form.Checkbox")return`<label class="form-field checkbox"><span>${v}</span><input ${B} type="checkbox"${S.checked?" checked":""}></label>`;if(S.type==="Form.Dropdown"||S.type==="Form.TagPicker")return`<label class="form-field"><span>${v}</span><select ${B} ${S.type==="Form.TagPicker"?"multiple":""}>${S.options.map((re)=>`<option value="${k(re.value)}"${S.selected.some((ue)=>ue.value===re.value)?" selected":""}>${k(re.title)}</option>`).join("")}</select>${F}</label>`;if(S.type==="Form.DatePicker")return`<label class="form-field"><span>${v}</span><input ${B} type="date" value="${k(S.text.slice(0,10))}">${F}</label>`;if(S.type==="Form.FilePicker")return`<p class="form-unavailable">${v}: not available in the browser</p>`;let U=S.type==="Form.TextArea";return`<label class="form-field"><span>${v}</span>${U?`<textarea ${B} placeholder="${k(S.placeholder)}">${k(S.text)}</textarea>`:`<input ${B} type="${S.type==="Form.PasswordField"?"password":"text"}"${S.hasValue?" data-has-value":""} value="${k(S.text)}" placeholder="${k(S.placeholder)}">`}${F}</label>`}).join("")}${Ru("Submit","primary")}</form>`:"",l=e.kind==="detail"||e.kind==="list"&&e.detail?`<article class="detail">${vu(e.detail)}</article>`:"",p=e.kind==="grid"?(e.grid??[]).every((m)=>m.cells.length===0):e.rows.length===0,c=e.empty?`<p class="empty"><strong>${k(e.empty.title)}</strong> ${k(e.empty.description)}</p>`:p&&(e.kind==="list"||e.kind==="grid")?`<p class="empty">${k(e.emptyText||"No results")}</p>`:"",u=e.menuBar?`<nav class="menu-bar" aria-label="${k(e.menuBar.tooltip||e.menuBar.title||"Menu")}"><h2>${k(e.menuBar.title||"Menu")}</h2><ul>${e.menuBar.rows.map((m)=>m.kind==="section"?`<li class="menu-section"><strong>${k(m.title)}</strong></li>`:`<li><button type="button" data-menu-id="${k(m.id)}"${m.selected?' class="selected"':""}${m.disabled?" disabled":""}><span class="menu-icon"${m.iconTint?` style="color:${k(m.iconTint)}"`:""}>${k(m.iconLabel||"")}</span><span>${k(m.title)}</span>${m.subtitle?`<small>${k(m.subtitle)}</small>`:""}${Mn("kbd",m.shortcut,t.reservedHint)}${m.kind==="submenu"?" ›":""}</button></li>`).join("")}</ul></nav>`:"",h=e.kind==="menu-bar"?u:e.kind==="form"?d:e.kind==="detail"?l:e.kind==="grid"?`<ul class="grid">${o}</ul>${c}`:l?`<div class="list-split"><div class="list-pane"><ul class="rows">${s}</ul>${c}</div>${l}</div>`:`<ul class="rows">${s}</ul>${c}`,y=`<footer>${Ou(t.context,e.title)}${Iu(n)}<span class="footer-hints">${e.primary.enabled?To(e.primary.title,e.primary.shortcut||"↵","primary"):""}${To("Actions",t.actionsKey??"⌘K","actions")}</span></footer>`,E='<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>';return`<main data-kind="${k(e.kind)}" data-loading="${e.loading?"true":"false"}" aria-busy="${e.loading?"true":"false"}"><header><h1>${k(e.title)}</h1><div class="search-line">${'<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>'}${Au(t.context)}${r}</div></header>${h}${a}${i}${y}${Nu(e,t)}</main>`}var Mo="blast-web-styles";function Cu(e){if(e.getElementById(Mo))return;let t=e.createElement("style");t.id=Mo,t.textContent=Co,e.head.prepend(t)}var Tu=(e)=>e instanceof HTMLElement?e.closest("[data-field]"):null;function Bo(e,t,n={}){if(Cu(e.ownerDocument),e.classList.add("blast-web"),typeof n.theme==="string")e.dataset.theme=n.theme;else if(n.theme)for(let[d,l]of Object.entries(n.theme))e.style.setProperty(d,l);if(!e.hasAttribute("tabindex"))e.tabIndex=0;let r,s=(d)=>{if(!r)return;let l=d.target,p=l instanceof HTMLTextAreaElement;if(d.key==="ArrowDown")t({type:"move",direction:"down"});else if(d.key==="ArrowUp")t({type:"move",direction:"up"});else if(d.key==="Enter"&&(d.metaKey||d.ctrlKey))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if(d.key==="Enter"&&!p&&!(l instanceof HTMLButtonElement))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if((d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k")t({type:r.actions.open?"closeActions":"openActions"});else if(d.key==="Escape")if(!r.actions.open&&!r.dropdown?.open&&r.search.text)t({type:"search",text:""});else t({type:"back"});else return;d.preventDefault()},o=(d)=>{let l=d.target,p=Tu(l);if(l.id==="search")t({type:"search",text:l.value});else if(l.id==="action-search")t({type:"actionsQuery",text:l.value});else if(l.hasAttribute("data-dropdown-search"))t({type:"dropdownQuery",text:l.value});else if(p?.dataset.field)t(l.type==="checkbox"?{type:"toggle",id:p.dataset.field}:{type:"setValue",id:p.dataset.field,value:l.value})},i=(d)=>{let l=d.target,p=l.closest("[data-footer]")?.dataset.footer;if(p==="primary")return t({type:"primary"});if(p==="actions")return t({type:"openActions"});if(p==="back")return t({type:"back"});if(l.closest("[data-dropdown-open]"))return t({type:"openDropdown"});let c=l.closest("[data-action-index]");if(c&&r?.actions.open){let h=Number(c.dataset.actionIndex)-r.actions.selectedIndex;for(let y=0;y<Math.abs(h);y++)t({type:"move",direction:h>0?"down":"up"});return t({type:"primary"})}let u=l.closest("[data-id], [data-menu-id]");if(u)t({type:"select",id:u.dataset.id??u.dataset.menuId??""})},a=(d)=>{d.preventDefault(),t({type:"submit"})};e.addEventListener("keydown",s),e.addEventListener("input",o),e.addEventListener("click",i),e.addEventListener("submit",a);let f=(d)=>{let l=e.contains(document.activeElement)?document.activeElement:void 0,p=l?.id||l?.dataset.field,c=l?[l.selectionStart,l.selectionEnd]:void 0;d();let u=(p?e.querySelector(`#${CSS.escape(p)}, [data-field="${p}"]`):null)??(l?null:e.querySelector("#search"));if(!u)return;if(u.focus({preventScroll:!0}),c?.[0]!=null&&c[1]!=null)u.setSelectionRange?.(c[0],c[1])};return{draw(d,l){if("type"in d&&d.type==="loading"){r=void 0,e.innerHTML='<p role="status" aria-busy="true"></p>',e.firstElementChild.textContent=l.text||"Loading extension…";return}if("type"in d&&d.type==="error"){r=void 0,e.innerHTML='<p role="alert" data-blast-error></p>',e.firstElementChild.textContent=d.message;return}r=d,f(()=>{e.innerHTML=Po(r,{status:l,...n.actionsKey?{actionsKey:n.actionsKey}:{}})})},destroy(){e.removeEventListener("keydown",s),e.removeEventListener("input",o),e.removeEventListener("click",i),e.removeEventListener("submit",a),e.classList.remove("blast-web"),e.replaceChildren()}}}function Gt(e){let t=e.trim();if(!t)throw Error("Enter a GitHub extension URL or name");if(!t.includes("://")){if(t.includes("/")||t.includes("\\"))throw Error("Extension names cannot contain a path separator");return{kind:"github",owner:"raycast",repo:"extensions",ref:"main",path:`extensions/${t}`}}let n;try{n=new URL(t)}catch{throw Error("Invalid extension URL")}if(n.protocol!=="https:"||n.hostname!=="github.com")throw Error("Extension URL must use https://github.com");let r=n.pathname.split("/").filter(Boolean);if(r[2]!=="tree"||r.length<5)throw Error("GitHub URL must be /<owner>/<repo>/tree/<ref>/<path>");let[s,o,,i,...a]=r;if(!s||!o||!i||a.length===0)throw Error("GitHub URL must include an extension path");return{kind:"github",owner:s,repo:o,ref:i,path:a.join("/")}}function Wt(e){return/\.(?:cjs|css|html?|js|jsx|json|md|mjs|ts|tsx|txt|yaml|yml)$/i.test(e)}function Fo(e,t){return t&&e.owner==="raycast"&&e.repo==="extensions"}var Lu=(e)=>e.split("/").map((t)=>encodeURIComponent(t)).join("/"),jo=(e)=>e.status===403&&e.headers.get("x-ratelimit-remaining")==="0";function Bn(e){return/^raycast\/extensions\/([^/]+)$/.exec(e.trim())?.[1]??e}async function _o(e,t={}){let n=t.fetch??((l,p)=>fetch(l,p)),r=Gt(Bn(e)),s=new Map,o=async(l,p)=>{let c=await n(p);if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to fetch ${l} (${c.status})`)}let u=new Uint8Array(await c.arrayBuffer());s.set(`/${l}`,Wt(l)?new TextDecoder().decode(u):u)},i=r.path,a=[];if(Fo(r,t.fixturesUrl!==void 0)){let l=`${t.fixturesUrl}${encodeURIComponent(r.path.replace(/^extensions\//,""))}`,p=await n(`${l}/__files`).catch(()=>{return});if(p?.ok){a=await p.json(),i=r.path.replace(/^extensions\//,"");for(let c of a)await o(c,`${l}/${c}`)}}if(a.length===0){let l=async(p)=>{let c=await n(`https://api.github.com/repos/${encodeURIComponent(r.owner)}/${encodeURIComponent(r.repo)}/contents/${Lu(p)}?ref=${encodeURIComponent(r.ref)}`,{headers:{Accept:"application/vnd.github+json"}});if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to list GitHub extension files (${c.status})`)}let u=await c.json(),h=[];for(let y of u){if(!y.path||y.path.split("/").includes("node_modules"))continue;if(y.type==="dir")h.push(...await l(y.path));else if(y.type==="file")h.push(y.path.slice(r.path.length+1))}return h};if(a=await l(r.path),!a.includes("package.json"))throw Error("Extension package.json was not found");for(let p of a)await o(p,`https://raw.githubusercontent.com/${r.owner}/${r.repo}/${encodeURIComponent(r.ref)}/${r.path}/${p}`)}let f=JSON.parse(String(s.get("/package.json"))),d=s.get("/package-lock.json");return{files:s,manifest:f,root:i,...typeof d==="string"?{lockfile:d}:{}}}function Pu(e){if(e.includes("/node_modules/"))return;if(e.startsWith("/assets/"))return e.slice(8)||void 0;if(e.startsWith("/src/"))return/\.(?:cjs|css|html?|js|jsx|mjs|ts|tsx)$/iu.test(e)?void 0:e.slice(5);return e.replace(/^\//u,"")||void 0}function Vo(e){return[...e].flatMap(([t,n])=>{let r=Pu(t);return r?[[r,n]]:[]})}function Uo(e,t,n){let r=[[`${n}/.keep`,""],[`${t}/.keep`,""]];for(let[s,o]of e)if(r.push([`${t}/${s}`,o]),s==="package.json")r.push([`${t.slice(0,t.lastIndexOf("/"))}/package.json`,o]);return r}function Do(e,t){for(let n of["tsx","ts","jsx","js"]){let r=`/src/${t}.${n}`;if(e.has(r))return r}if(e.has("/src/index.tsx"))return"/src/index.tsx";throw Error(`Command source not found for ${t}`)}function Fn(e){let t=e.commands;return Array.isArray(t)?t.flatMap((n)=>typeof n?.name==="string"?[n.name]:[]):[]}function jn(){let e;try{e=globalThis.localStorage}catch{}return{...e?{storage:e}:{},clipboard:{readText:()=>navigator.clipboard.readText(),writeText:(t)=>navigator.clipboard.writeText(t)},openUrl:(t)=>{if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer")}}}class qo extends Error{code="BROWSER_LAUNCH_TIMEOUT";stage;constructor(e,t){super(`Command did not start (${t}) after ${e} ms`);this.name="BrowserLaunchTimeoutError",this.stage=t}}function _n(e,t,n="waiting for runtime port"){return new Promise((r,s)=>{let o=setTimeout(()=>s(new qo(t,n)),t);e.then((i)=>{clearTimeout(o),r(i)},(i)=>{clearTimeout(o),s(i)})})}function Go(){let e=0;return{next:()=>++e,current:()=>e,isCurrent:(t)=>t===e}}var Mu=["appPicker","checkbox","dropdown","password","textfield","file","directory"];function st(e,t="Preferences"){if(e===void 0)return[];if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((n,r)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} entry ${r+1} must be an object`);let s=n,{name:o,type:i,default:a,description:f,placeholder:d,label:l}=s;if(typeof o!=="string"||!o)throw Error(`${t} entry ${r+1} needs a name`);if(typeof i!=="string"||!Mu.includes(i))throw Error(`Preference ${JSON.stringify(o)} has an unknown type ${JSON.stringify(i)}`);if(a!==void 0&&typeof a!=="string"&&typeof a!=="boolean"&&!(typeof a==="number"&&Number.isFinite(a)))throw Error(`Preference ${JSON.stringify(o)} needs a scalar "default"`);if(f!==void 0&&typeof f!=="string")throw Error(`Preference ${JSON.stringify(o)} needs a string "description"`);return{name:o,type:i,title:(i==="checkbox"?l:s.title)||o,required:s.required===!0,data:Array.isArray(s.data)?s.data.filter((p)=>!!p&&typeof p==="object"&&typeof p.value==="string"&&typeof p.title==="string"):[],...typeof f==="string"?{description:f}:{},...typeof d==="string"?{placeholder:d}:{},...typeof l==="string"?{label:l}:{},...a===void 0?{}:{default:a}}})}function Ht(e,t){return[...new Map([...e,...t].map((n)=>[n.name,n])).values()]}function Wo(e,t){return Object.fromEntries(Ht(e,t).filter((n)=>n.default!==void 0).map((n)=>[n.name,n.default]))}function Vn(e,t){return e.filter((n)=>n.required&&n.default===void 0&&(t[n.name]===void 0||t[n.name]===""))}function Un(e,t){return`${e}/${t}`}function Dn(e){if(!e||typeof e!=="object")throw Error("Invalid browser bundle index");let t=e;if(typeof t.buildSha!=="string"||!t.bundles||typeof t.bundles!=="object")throw Error("Invalid browser bundle index shape");let n=t.runtime,r;if(n!==void 0){if(!n||typeof n!=="object")throw Error("Invalid runtime bundle");let o=n;if(o.path!=="bundles/runtime.js"||typeof o.bytes!=="number"||!Number.isInteger(o.bytes)||typeof o.sha256!=="string"||!/^[0-9a-f]{64}$/.test(o.sha256))throw Error("Invalid runtime bundle");r={path:o.path,bytes:o.bytes,sha256:o.sha256}}let s={};for(let[o,i]of Object.entries(t.bundles)){if(!i||typeof i!=="object")throw Error(`Invalid bundle entry: ${o}`);let a=i;if(typeof a.path!=="string"||!/^bundles\/[^/]+\/[^/]+\.js$/.test(a.path)||typeof a.bytes!=="number"||!Number.isInteger(a.bytes)||a.bytes<0||typeof a.sha256!=="string"||!/^[0-9a-f]{64}$/.test(a.sha256))throw Error(`Invalid bundle entry shape: ${o}`);let f={};if(a.files!==void 0){if(!a.files||typeof a.files!=="object")throw Error(`Invalid bundle files: ${o}`);for(let[l,p]of Object.entries(a.files)){if(!p||typeof p!=="object")throw Error(`Invalid bundle file: ${o}/${l}`);let c=p;if(typeof c.path!=="string"||!c.path.startsWith("bundles/")||typeof c.bytes!=="number"||!Number.isInteger(c.bytes)||c.bytes<0||typeof c.sha256!=="string"||!/^[0-9a-f]{64}$/.test(c.sha256))throw Error(`Invalid bundle file shape: ${o}/${l}`);f[l]={path:c.path,bytes:c.bytes,sha256:c.sha256}}}let d;if(a.manifest!==void 0){if(!a.manifest||typeof a.manifest!=="object")throw Error(`Invalid bundle manifest: ${o}`);let l=a.manifest;if(typeof l.name!=="string"||!l.commands||typeof l.commands!=="object")throw Error(`Invalid bundle manifest shape: ${o}`);let p={},c={},u=l.modes;if(u!==void 0&&(!u||typeof u!=="object"))throw Error(`Invalid bundle manifest modes: ${o}`);for(let[E,m]of Object.entries(u??{})){if(m!=="view"&&m!=="no-view"&&m!=="menu-bar"&&m!=="model-provider")throw Error(`Invalid bundle manifest mode: ${o}/${E}`);c[E]=m}for(let[E,m]of Object.entries(l.commands))p[E]=st(m,`Bundle ${o} command ${E} preferences`);for(let E of Object.keys(p))c[E]??="view";let h={},y=l.arguments;if(y!==void 0&&(!y||typeof y!=="object"))throw Error(`Invalid bundle manifest arguments: ${o}`);for(let[E,m]of Object.entries(y??{})){if(!Array.isArray(m))throw Error(`Invalid bundle manifest arguments: ${o}/${E}`);h[E]=m.map((S)=>{let v=S;if(!v||typeof v.name!=="string"||typeof v.required!=="boolean")throw Error(`Invalid bundle manifest argument: ${o}/${E}`);let B=Array.isArray(v.values)?v.values.filter((F)=>typeof F==="string"):[];return{name:v.name,required:v.required,...typeof v.type==="string"?{type:v.type}:{},...B.length?{values:B}:{}}})}d={name:l.name,preferences:st(l.preferences,`Bundle ${o} preferences`),commands:p,...Object.keys(h).length?{arguments:h}:{},...Object.keys(c).length?{modes:c}:{}}}s[o]={path:a.path,bytes:a.bytes,sha256:a.sha256,...Object.keys(f).length?{files:f}:{},...d?{manifest:d}:{}}}return{buildSha:t.buildSha,bundles:s,...r?{runtime:r}:{}}}async function Xt(e){let t=await globalThis.crypto.subtle.digest("SHA-256",e);return[...new Uint8Array(t)].map((n)=>n.toString(16).padStart(2,"0")).join("")}async function qn(e,t,n,r){let s=e?.bundles[n];return Boolean(s&&t===e?.buildSha&&s.bytes===r.byteLength&&await Xt(r)===s.sha256)}var Hn=()=>globalThis.location?.href,Gn=new Map,Wn=new Map,Ho=(e)=>`${e.bundlesUrl}
|
|
32
|
+
${e.buildUrl??""}`,Xo=(e,t)=>new URL(e,new URL(t.bundlesUrl,Hn()));async function Jo(e,t){let n=await fetch(Xo(e.path,t));if(!n.ok)return;let r=await n.arrayBuffer();if(r.byteLength!==e.bytes||await Xt(r)!==e.sha256)return;return r}function Ko(e){let t=Ho(e),n=Gn.get(t);if(!n)n=(async()=>{let[r,s]=await Promise.all([fetch(new URL(e.bundlesUrl,Hn())),e.buildUrl?fetch(new URL(e.buildUrl,Hn())):null]);if(!r.ok||s&&!s.ok)return;let o=Dn(await r.json());if(s){if((await s.json()).sha!==o.buildSha)return}return o})().catch(()=>{return}),n.then((r)=>r??Gn.delete(t)),Gn.set(t,n);return n}function zo(e){let t=Ho(e),n=Wn.get(t);if(!n)n=(async()=>{let r=await Ko(e),s=r?.runtime?await Jo(r.runtime,e):void 0;return s?new TextDecoder().decode(s):void 0})().catch(()=>{return}),n.then((r)=>r??Wn.delete(t)),Wn.set(t,n);return n}function Bu(e){try{let t=Gt(Bn(e)),[n,r,...s]=t.path.split("/");return t.owner==="raycast"&&t.repo==="extensions"&&n==="extensions"&&r&&s.length===0?r:void 0}catch{return}}async function Yo(e,t,n){try{let r=Bu(t),s=r?await Ko(e):void 0;if(!r||!s)return;let o=Un(r,n),i=s.bundles[o];if(!i?.manifest)return;let a=await fetch(Xo(i.path,e));if(!a.ok)return;let f=await a.arrayBuffer();if(!await qn(s,s.buildSha,o,f))return;let d=new Map;for(let[l,p]of Object.entries(i.files??{})){let c=await Jo(p,e);if(!c)return;d.set(`/${l}`,Wt(l)?new TextDecoder().decode(c):new Uint8Array(c))}return{code:new TextDecoder().decode(f),files:d,manifest:i.manifest}}catch{return}}function Fu(e){return typeof e==="object"&&e!==null&&e.type==="blast-port-request"}function Qo(e,t,n,r){return!n&&e===t&&Fu(r)}var ot,ju=()=>new URL("./",import.meta.url),Jt=(e,t)=>new URL(t,e.assetsUrl?new URL(e.assetsUrl,globalThis.location?.href):ju()).toString(),Zo=(e)=>[e.sandboxUrl,Jt(e,"./"),e.bundlesUrl,e.buildUrl].join(`
|
|
33
|
+
`),_u=(e)=>{let t=typeof e==="string"?new TextEncoder().encode(e):e,n="";for(let r=0;r<t.length;r+=32768)n+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(n)};async function ei(e,t){let n=JSON.stringify(t.map(([r,s])=>[r,_u(s)]));await e.execute(`const fs = require("fs");
|
|
34
|
+
for (const [path, data] of ${n}) {
|
|
35
|
+
fs.mkdirSync(path.slice(0, path.lastIndexOf("/")) || "/", { recursive: true });
|
|
36
|
+
fs.writeFileSync(path, Buffer.from(data, "base64"));
|
|
37
|
+
}
|
|
38
|
+
module.exports = null;`,"/blast/write-files.cjs")}function Et(e){try{e?.terminate?.()}catch{}e?.iframe?.remove()}async function ti(e,t){let n=await import(Jt(e,"almostnode.mjs")),r=await n.createRuntime(new n.VirtualFS,{sandbox:e.sandboxUrl});r.iframe?.setAttribute("data-blast",t);try{let s=e.bundlesUrl?await zo({bundlesUrl:e.bundlesUrl,buildUrl:e.buildUrl}):void 0;if(s)await r.execute(`${s}
|
|
39
|
+
module.exports = null;`,"/runtime.cjs")}catch(s){throw Et(r),s}return r}function Vu(e){let t=Zo(e);if(ot?.key===t)return;let n=ot;ot={key:t,runtime:ti(e,"warm").catch(()=>{return})},n?.runtime.then(Et)}async function ni(e){if(ot?.key===Zo(e)){let t=ot.runtime;ot=void 0;let n=await t;if(n)return n.iframe?.setAttribute("data-blast","session"),n}return ti(e,"session")}var ri=new WeakSet,si=30000,Uu="/packages/web/sandbox/runtime-entry.ts",Du=()=>{let e=navigator.platform||"";if(/mac|iphone|ipad/i.test(e))return"macOS";return/win/i.test(e)?"Windows":"Linux"},oi=(e)=>e==="no-view"||e==="menu-bar"||e==="model-provider"?e:"view";function qu(e,t,n){let s=(Array.isArray(e.commands)?e.commands:[]).find((o)=>o?.name===t);return{extensionName:String(e.name??n),commands:Fn(e),extensionPreferences:st(e.preferences,"Extension preferences"),commandPreferences:st(s?.preferences,`Command ${t} preferences`),mode:oi(s?.mode),...typeof s?.title==="string"?{title:s.title}:{}}}function Gu(e,t){return{extensionName:e.name,commands:Object.keys(e.commands),extensionPreferences:e.preferences,commandPreferences:e.commands[t]??[],mode:oi(e.modes?.[t])}}function Kt(e,t){let n=t.source??t.extension;if(!n)throw TypeError("mount requires extension or source");let r=n;if(!t.sandboxUrl)throw TypeError("mount requires sandboxUrl");let s=(O)=>Jt(t,O),o={...jn(),...t.handlers},i=Go(),a=new Set,f=Du(),d=!1,l={text:"Loading extension…",progress:!0},p,c,u,h,y,E,m="view",S=r,v=(O)=>{if(d)return;if(p){let H=p.input(O);return re(H),H}if(!c)return;let j=c.input(O);for(let H of j.effects)if(H.type==="launch")de(H.command,{});return{events:[],effects:[]}},B=t.render?void 0:Bo(e,(O)=>void v(O),{...t.theme===void 0?{}:{theme:t.theme},actionsKey:f==="macOS"?"⌘K":"Ctrl+K"}),F=(O)=>{if(d)return;if(t.render)t.render(O,v,{...E?{scene:E}:{},status:l});else B?.draw(O,l)},U=(O,j=!1,H=!1)=>{l={text:O,...j?{error:j}:{},...H?{progress:H}:{}},t.onStatus?.(l)};function re(O){for(let j of O.events)u?.postMessage({type:"event",node:j.node,handler:j.handler,args:j.args});for(let j of O.effects)if(j.type==="quit"){if(m!=="no-view")Le("quit")}else{let H=i.current(),P=setTimeout(()=>{if(a.delete(P),!i.isCurrent(H)||!p)return;re(p.tick(j.token))},j.ms);a.add(P)}}function ue(){i.next();for(let O of a)clearTimeout(O);a.clear(),y?.(),y=void 0,u?.close(),u=void 0,p=void 0,E=void 0,Et(h),h=void 0}function Le(O){let j=p?.view();if(ue(),t.onExit)t.onExit({reason:O,...j?{view:j}:{}});else if(c)c.reset(),F(c.view()),U("Ready");else if(j)U("Command finished")}function Ae(O){if(d)return;let j=O instanceof Error?O.message:String(O);if(ue(),U(j,!0),c)c.fail("Command failed",j),F(c.view());else F({type:"error",message:j})}let se,Xe=async()=>{if(typeof t.esbuild==="function")return t.esbuild();if(t.esbuild)return t.esbuild;if(se??=await import(s("esbuild.mjs")),!ri.has(se))ri.add(se),await se.initialize({wasmURL:s("esbuild.wasm"),worker:!1});return se},D,K=()=>D??=_o(r,{fixturesUrl:t.fixtures?s("fixtures/"):void 0});async function je(O,j,H,P){if(!t.preferenceForm)return;let V=Ln(O.extensionName,o.storage),pe=H==="extension"?O.extensionPreferences:Ht(O.extensionPreferences,O.commandPreferences),X=await t.preferenceForm({extension:O.extensionName,command:j,scope:H,fields:pe,values:P});if(!X)return;let be=new Set(O.extensionPreferences.map((Z)=>Z.name)),ke={},fe={};for(let[Z,Pe]of Object.entries(X))(be.has(Z)?ke:fe)[Z]=Pe;return V.update(ke,j,fe),X}async function de(O,j){ue();let H=i.current(),P=()=>!d&&i.isCurrent(H);try{U("Fetching extension…",!1,!0),F({type:"loading",extension:r,command:O});let V=t.bundlesUrl?await Yo({bundlesUrl:t.bundlesUrl,buildUrl:t.buildUrl},r,O):void 0;if(!P())return;let pe,X,be,ke;if(V)pe=[...V.files].map(([R,M])=>[R.replace(/^\//u,""),M]),X=Gu(V.manifest,O),be=`/src/${O}.tsx`,ke=V.code;else{let R=await K();if(!P())return;pe=Vo(R.files),X=qu(R.manifest,O,r),be=Do(R.files,O),U("Installing…",!1,!0);let M=await(await fetch(s("blast-sources.json"))).json(),W=await Ro({fetch:(z,ye)=>fetch(z,ye),manifest:R.manifest,...R.lockfile===void 0?{}:{lockfile:R.lockfile}});if(!P())return;U("Bundling…",!1,!0);let G=await Xe();if(!P())return;let ee=new Map(Object.entries(M));for(let[z,ye]of R.files)ee.set(z,ye);if(ke=(await Rr({esbuild:G,files:ee,packages:W.packages,command:be,runtimeEntry:Uu,aliases:vo})).code,!P())return}S=X.extensionName,m=X.mode;let fe=Ln(S,o.storage),Z={...Wo(X.extensionPreferences,X.commandPreferences),...fe.values(O),...t.preferences},Pe=Ht(X.extensionPreferences,X.commandPreferences),it=Vn(Pe,Z);if(it.length>0){if(!t.preferenceForm)throw Error(`Missing required preferences: ${it.map((M)=>M.title||M.name).join(", ")}`);let R=await je(X,O,"command",Z);if(!P()||!R)return;if(Z={...Z,...R},Vn(Pe,Z).length)throw Error("Required preferences are missing");U("Fetching extension…",!1,!0),F({type:"loading",extension:r,command:O})}U("Starting…",!1,!0);let _e=await ni(t);if(!P()){Et(_e);return}h=_e;let $t=S.replace(/[^A-Za-z0-9._-]/gu,"_")||"extension",kt=`/blast/support/${$t}`,at=`/blast/assets/${$t}`;if(await ei(_e,Uo(pe,at,kt)),!P())return;let ct={extensionName:S,commandName:O,source:r},lt=No({catalog:{extensions:[{name:S,commands:X.commands.map((R)=>({name:R}))}]},...o.storage?{storage:o.storage}:{},...o.clipboard?{clipboard:o.clipboard}:{},...o.openUrl?{openUrl:o.openUrl}:{},status:(R,M)=>U(R,M===!0),launchCommand:async(R,M,W)=>{de(M,W)},openPreferences:(R)=>{if(!t.preferenceForm){U("Preferences are not available in this embed",!0);return}je(X,O,R,{...Z}).then((M)=>{if(M&&P())de(O,j)})}}),St=async(R)=>{let W=await o.capability?.(R,ct)??await lt(R,ct);if(!P())return;if(u?.postMessage({type:"capability.result",id:R.id,...W}),!W.ok)U(W.error.message,!0)},Rt=new MessageChannel;u=Rt.port1,u.start();let Je,zt=(R)=>{if(!P())return;if(R.type==="scene"){if(!p)return;E=R;let M=p.scene(R);if(Je)U("Ready");Je?.resolve(),Je=void 0,F(p.view()),re(M)}else if(R.type==="capability.request")St(R).catch((M)=>{if(!P())return;let W=M instanceof Error?M.message:String(M);u?.postMessage({type:"capability.result",id:R.id,ok:!1,error:{code:"DENIED",message:W}}),U(W,!0)});else if(R.type==="exit")if(R.code===0)Le("exit");else Ae(Error(`Command exited with code ${R.code}`));else if(R.type==="error")Ae(Error(R.message))};u.addEventListener("message",(R)=>zt(R.data));let Ve=!1,ut,g=new Promise((R)=>ut=R),b=(R)=>{if(!P())return;let M=_e.iframe?.contentWindow??void 0;if(!Qo(R.source,M,Ve,R.data))return;Ve=!0,y?.(),M?.postMessage({type:"blast-port"},"*",[Rt.port2]),ut()};if(window.addEventListener("message",b),y=()=>window.removeEventListener("message",b),await _n((async()=>{if(await _e.execute(`${ke}
|
|
40
|
+
module.exports = null;`,`${at}/bundle.cjs`),P())await g})(),si,"waiting for runtime port"),!P()||!Ve)return;let w=t.commandTitle??X.title;p=cn({platform:f,...w?{fallbackTitle:w}:{}});let C=p;C.subscribe((R)=>{if(P()&&p===C)F(R)});let _=new Promise((R,M)=>Je={resolve:R,reject:M});u.postMessage({type:"init",protocol:1,command:{extension:S,name:O,entry:be,mode:m,...Object.keys(j).length?{arguments:{...j}}:{}},preferences:{...Z},environment:{extensionName:S,commandName:O,ownerOrAuthorName:"Browser",assetsPath:at,supportPath:kt,isDevelopment:!1,appearance:t.theme==="light"?"light":"dark",textSize:"medium"}}),await _n(_,si,"waiting for first scene")}catch(V){if(P())Ae(V)}}return(async()=>{try{if(U("Fetching extension…",!1,!0),F({type:"loading",extension:r,...t.command?{command:t.command}:{}}),!t.root){let P=t.command??Fn((await K()).manifest)[0];if(!d)await de(P??"index",{...t.arguments});return}let O=(await K()).manifest;if(d)return;S=String(O.name??r);let H=(Array.isArray(O.commands)?O.commands:[]).flatMap((P)=>typeof P?.name==="string"?[{extension:S,extensionTitle:String(O.title??S),command:P.name,title:typeof P.title==="string"?P.title:P.name,...typeof P.subtitle==="string"?{subtitle:P.subtitle}:{},mode:P.mode==="no-view"||P.mode==="menu-bar"?P.mode:"view"}]:[]);c=Sr(H),c.subscribe((P)=>{if(!p)F(P)}),U("Ready"),F(c.view())}catch(O){Ae(O)}})(),{input:v,view:()=>p?.view(),close(){if(d)return;ue(),d=!0,B?.destroy()}}}function Wu(e="blast-extension"){if(customElements.get(e))return;customElements.define(e,class extends HTMLElement{#e;connectedCallback(){let t={sandboxUrl:this.getAttribute("sandbox-url")??"/sandbox/",root:this.hasAttribute("root"),fixtures:this.hasAttribute("fixtures")};for(let[n,r]of[["extension","extension"],["source","source"],["command","command"],["assets-url","assetsUrl"],["theme","theme"]]){let s=this.getAttribute(n);if(s)t[r]=s}this.#e=Kt(this,t)}disconnectedCallback(){this.#e?.close(),this.#e=void 0}})}function Jf(e,t){if(!e)throw TypeError("mount requires an element");return Kt(e,t)}export{He as BrowserInstallError,xo as BrowserIntegrityError,ln as BrowserMissingDependencyError,pt as BrowserMissingFileError,un as BrowserNativeModuleError,ko as BrowserNativePackageError,$o as BrowserPackageLimitError,xt as BrowserResolutionError,Eo as BrowserSizeLimitError,Nn as BrowserTarPathError,ea as browserBuiltinModules,Rr as bundleForBrowser,Un as bundleKey,qn as bundleMatches,jn as createDefaultHandlers,Wu as defineBlastExtension,Ro as installForBrowser,Jf as mount,Dn as parseBundleIndex,Vu as prewarm,Xt as sha256Hex,Eu as unpackTar};
|